something outside of rssclient soon.
#define REV_LEVEL 735 /* This version */
#define REV_MIN 591 /* Oldest compatible database */
#define EXPORT_REV_MIN 733 /* Oldest compatible export files */
-#define LIBCITADEL_MIN 109 /* Minimum required version of libcitadel */
+#define LIBCITADEL_MIN 113 /* Minimum required version of libcitadel */
#define SERVER_TYPE 0 /* zero for stock Citadel; other developers please
obtain SERVER_TYPE codes for your implementations */
-/*
- * Parse a URL into host, port number, and resource identifier.
- */
-int parse_url(char *url, char *hostname, int *port, char *identifier)
-{
- char protocol[1024];
- char scratch[1024];
- char *ptr = NULL;
- char *nptr = NULL;
-
- strcpy(scratch, url);
- ptr = (char *)strchr(scratch, ':');
- if (!ptr) {
- return(1); /* no protocol specified */
- }
-
- strcpy(ptr, "");
- strcpy(protocol, scratch);
- if (strcmp(protocol, "http")) {
- return(2); /* not HTTP */
- }
-
- strcpy(scratch, url);
- ptr = (char *) strstr(scratch, "//");
- if (!ptr) {
- return(3); /* no server specified */
- }
- ptr += 2;
-
- strcpy(hostname, ptr);
- nptr = (char *)strchr(ptr, ':');
- if (!nptr) {
- *port = 80; /* default */
- nptr = (char *)strchr(hostname, '/');
- }
- else {
- sscanf(nptr, ":%d", port);
- nptr = (char *)strchr(hostname, ':');
- }
-
- if (nptr) {
- *nptr = '\0';
- }
-
- nptr = (char *)strchr(ptr, '/');
-
- if (!nptr) {
- return(4); /* no url specified */
- }
-
- strcpy(identifier, nptr);
- return(0);
-}
-
-
/*
* Begin a feed parse
*/
*/
#include <time.h>
#include <stdlib.h>
-#define LIBCITADEL_VERSION_NUMBER 112
+#define LIBCITADEL_VERSION_NUMBER 113
/*
* Here's a bunch of stupid magic to make the MIME parser portable.
typedef void (*PrintHashDataFunc) (const char *Key, void *Item, int Odd);
HashList *NewHash(int Uniq, HashFunc F);
-
void DeleteHash(HashList **Hash);
-
int GetHash(HashList *Hash, const char *HKey, long HKLen, void **Data);
-
void Put(HashList *Hash, const char *HKey, long HKLen, void *Data, DeleteHashDataFunc DeleteIt);
-
int GetKey(HashList *Hash, char *HKey, long HKLen, void **Data);
-
int GetHashKeys(HashList *Hash, char ***List);
-
int dbg_PrintHash(HashList *Hash, PrintHashContent first, PrintHashContent Second);
-
-
int PrintHash(HashList *Hash, TransitionFunc Trans, PrintHashDataFunc PrintEntry);
-
HashPos *GetNewHashPos(void);
-
void DeleteHashPos(HashPos **DelMe);
-
int GetNextHashPos(HashList *Hash, HashPos *At, long *HKLen, char **HashKey, void **Data);
-
void SortByHashKey(HashList *Hash, int Order);
void SortByHashKeyStr(HashList *Hash);
int GetCount(HashList *Hash);
const void *GetSearchPayload(const void *HashVoid);
void SortByPayload(HashList *Hash, CompareFunc SortBy);
-
void convert_spaces_to_underscores(char *str);
+int parse_url(char *url, char *hostname, int *port, char *identifier);
/*
* Convert 4 bytes char into an Integer.
}
}
+
+/*
+ * Parse a URL into host, port number, and resource identifier.
+ * (This is used by various functions which might need to fetch web pages.)
+ */
+int parse_url(char *url, char *hostname, int *port, char *identifier)
+{
+ char protocol[1024];
+ char scratch[1024];
+ char *ptr = NULL;
+ char *nptr = NULL;
+
+ strcpy(scratch, url);
+ ptr = (char *)strchr(scratch, ':');
+ if (!ptr) {
+ return(1); /* no protocol specified */
+ }
+
+ strcpy(ptr, "");
+ strcpy(protocol, scratch);
+ if (strcmp(protocol, "http")) {
+ return(2); /* not HTTP */
+ }
+
+ strcpy(scratch, url);
+ ptr = (char *) strstr(scratch, "//");
+ if (!ptr) {
+ return(3); /* no server specified */
+ }
+ ptr += 2;
+
+ strcpy(hostname, ptr);
+ nptr = (char *)strchr(ptr, ':');
+ if (!nptr) {
+ *port = 80; /* default */
+ nptr = (char *)strchr(hostname, '/');
+ }
+ else {
+ sscanf(nptr, ":%d", port);
+ nptr = (char *)strchr(hostname, ':');
+ }
+
+ if (nptr) {
+ *nptr = '\0';
+ }
+
+ nptr = (char *)strchr(ptr, '/');
+
+ if (!nptr) {
+ return(4); /* no url specified */
+ }
+
+ strcpy(identifier, nptr);
+ return(0);
+}
+
+
#define CLIENT_ID 4
#define CLIENT_VERSION 735 /* This version of WebCit */
#define MINIMUM_CIT_VERSION 730 /* min required Citadel ver */
-#define LIBCITADEL_MIN 112 /* min required libcitadel ver */
+#define LIBCITADEL_MIN 113 /* min required libcitadel ver */
#define DEFAULT_HOST "localhost" /* Default Citadel server */
#define DEFAULT_PORT "504"
#define LB (1) /* Internal escape chars */