-const char loaders_rcs[] = "$Id: loaders.c,v 1.35 2002/01/17 21:03:08 jongfoster Exp $";
+const char loaders_rcs[] = "$Id: loaders.c,v 1.39 2002/03/07 03:46:17 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/loaders.c,v $
*
* Revisions :
* $Log: loaders.c,v $
+ * Revision 1.39 2002/03/07 03:46:17 oes
+ * Fixed compiler warnings
+ *
+ * Revision 1.38 2002/03/06 22:54:35 jongfoster
+ * Automated function-comment nitpicking.
+ *
+ * Revision 1.37 2002/03/03 15:07:49 oes
+ * Re-enabled automatic config reloading
+ *
+ * Revision 1.36 2002/01/22 23:46:18 jongfoster
+ * Moving edit_read_line() and simple_read_line() to loaders.c, and
+ * extending them to support reading MS-DOS, Mac and UNIX style files
+ * on all platforms.
+ *
+ * Modifying read_config_line() (without changing it's prototype) to
+ * be a trivial wrapper for edit_read_line(). This means that we have
+ * one function to read a line and handle comments, which is common
+ * between the initialization code and the edit interface.
+ *
* Revision 1.35 2002/01/17 21:03:08 jongfoster
* Moving all our URL and URL pattern parsing code to urlmatch.c.
*
&& (current->lastmodified == statbuf->st_mtime)
&& (0 == strcmp(current->filename, filename)))
{
- /* force reload of configfile and all the logs */
- if ( !MustReload ) return 0;
+ return 0;
}
fs = (struct file_list *)zalloc(sizeof(struct file_list));
*********************************************************************/
jb_err simple_read_line(FILE *fp, char **dest, int *newline)
{
- int len = 0;
- int buflen = BUFFER_SIZE;
+ size_t len = 0;
+ size_t buflen = BUFFER_SIZE;
char * buf;
char * p;
int ch;
* 1 : buf = Buffer to use.
* 2 : buflen = Size of buffer in bytes.
* 3 : fp = File to read from
- * 4 : linenum = linenumber in file
+ * 4 : linenum = linenumber in file
*
* Returns : NULL on EOF or error
* Otherwise, returns buf.
*
*********************************************************************/
-char *read_config_line(char *buf, int buflen, FILE *fp, unsigned long *linenum)
+char *read_config_line(char *buf, size_t buflen, FILE *fp, unsigned long *linenum)
{
jb_err err;
char *buf2 = NULL;
else
{
assert(buf2);
- assert(strlen(buf2) + 1U < (unsigned)buflen);
+ assert(strlen(buf2) + 1U < buflen);
strncpy(buf, buf2, buflen - 1);
free(buf2);
buf[buflen - 1] = '\0';