summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2007-05-31 18:15:27 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2007-05-31 18:15:27 +0000
commit334cb5bb40033d1554016593e93ee0c463438361 (patch)
tree90d59e5533c3823a33e49d852bf007295051c16d
parent34d0c263d9a56bb2beb65385c0b03d013d1657e9 (diff)
downloadyelp-334cb5bb40033d1554016593e93ee0c463438361.tar.gz
Beginning (empty) of new utils resolver (masked by DON_UTILS define)
* src/yelp-utils.h: * src/yelp-utils.c: Beginning (empty) of new utils resolver (masked by DON_UTILS define) * src/test-resolver.c: * src/Makefile.am: Beginnings of resolver test svn path=/branches/yelp-spoon/; revision=2817
-rw-r--r--ChangeLog11
-rw-r--r--src/Makefile.am11
-rw-r--r--src/test-resolver.c31
-rw-r--r--src/yelp-utils.c9
-rw-r--r--src/yelp-utils.h6
5 files changed, 65 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 50396748..ec13ef60 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-05-31 Don Scorgie <dscorgie@svn.gnome.org>
+
+ * src/yelp-utils.h:
+ * src/yelp-utils.c:
+ Beginning (empty) of new utils resolver (masked by DON_UTILS define)
+
+ * src/test-resolver.c:
+ * src/Makefile.am:
+ Beginnings of resolver test
+
+
2007-04-30 Don Scorgie <dscorgie@cvs.gnome.org>
* src/yelp-toc.c:
diff --git a/src/Makefile.am b/src/Makefile.am
index 55475eac..549eb5c1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -106,7 +106,8 @@ check_PROGRAMS = \
test-document \
test-man-parser \
test-page \
- test-transform
+ test-transform \
+ test-resolver
test_document_SOURCES = \
yelp-debug.c yelp-debug.h \
@@ -154,6 +155,14 @@ test_transform_CFLAGS = $(YELP_CFLAGS) $(AM_CFLAGS) $(YELP_DEFINES)
test_transform_LDADD = $(YELP_LIBS)
test_transform_LDFLAGS = $(AM_LDFLAGS)
+test_resolver_SOURCES = \
+ yelp-debug.c yelp-debug.h \
+ yelp-error.c yelp-error.h \
+ yelp-utils.c yelp-utils.h \
+ test-resolver.c
+test_resolver_CFLAGS = $(YELP_CFLAGS) $(AM_CFLAGS) $(YELP_DEFINES) -DDON_UTIL
+test_resolver_LDADD = $(YELP_LIBS)
+test_resolver_LDFLAGS = $(AM_LDFLAGS)
@INTLTOOL_SERVER_RULE@
diff --git a/src/test-resolver.c b/src/test-resolver.c
new file mode 100644
index 00000000..39828f7a
--- /dev/null
+++ b/src/test-resolver.c
@@ -0,0 +1,31 @@
+/* A test util to try out the new
+ * yelp-utils resolver for URIs
+ * Basically, tries to resolve each
+ * given URI and compares to the expected results
+ * (only checks the files exist and the type is correct)
+ */
+
+#include <stdio.h>
+#include "yelp-utils.h"
+
+
+int
+main (int argc, char *argv[])
+{
+ int i=1;
+
+ if (argc < 2 || argc % 2 != 1) {
+ printf ("Usage: %s <test-uri> <type>\n", argv[0]);
+ printf ("type can be one of:\n");
+ printf ("man, info, doc, external, fail\n");
+ return 1;
+ }
+
+ while (i < argc) {
+ printf ("uri: %s type: %s\n", argv[i], argv[i+1]);
+
+ i+=2;
+ }
+}
+
+
diff --git a/src/yelp-utils.c b/src/yelp-utils.c
index 351a4117..03fb3f63 100644
--- a/src/yelp-utils.c
+++ b/src/yelp-utils.c
@@ -36,7 +36,7 @@
#include "yelp-debug.h"
#include <string.h>
-
+#ifndef DON_UTIL
static GHashTable *doc_info_table;
typedef struct {
@@ -1045,3 +1045,10 @@ convert_info_uri (gchar *uri)
return doc_uri;
}
+#else
+gchar *
+yelp_uri_resolve (char *uri)
+{
+ printf ("Resolving %s\n", uri);
+}
+#endif
diff --git a/src/yelp-utils.h b/src/yelp-utils.h
index 8794d364..d502b696 100644
--- a/src/yelp-utils.h
+++ b/src/yelp-utils.h
@@ -24,7 +24,7 @@
#define __YELP_UTILS_H__
#include <glib/gi18n.h>
-
+#ifndef DON_UTIL
typedef struct _YelpDocInfo YelpDocInfo;
typedef enum {
@@ -113,4 +113,8 @@ gchar ** yelp_get_info_paths (void);
gchar ** yelp_get_man_paths (void);
+#else
+gchar * yelp_uri_resolve (char *uri);
+#endif
+
#endif /* __YELP_UTILS_H__ */