* Determine whether the specified message number is contained within the
* specified sequence set.
*/
-int is_msg_in_sequence_set(char *mset, long msgnum) {
+int is_msg_in_sequence_set(const char *mset, long msgnum) {
int num_sets;
int s;
char setstr[128], lostr[128], histr[128];
* Determine whether the specified message number is contained within the specified set.
* Returns nonzero if the specified message number is in the specified message set string.
*/
-int is_msg_in_mset(char *mset, long msgnum) {
+int is_msg_in_mset(const char *mset, long msgnum) {
int num_sets;
int s;
char setstr[SIZ], lostr[SIZ], histr[SIZ]; /* was 1024 */
/*
- * \brief searches for a paternn within asearch string
- * \param search the string to search
- * \param patn the pattern to find in string
- * \returns position in string
+ * searches for a pattern within a search string
+ * returns position in string
*/
int pattern2(char *search, char *patn)
{
}
-/*
- * 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);
-}
-
-