diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-25 21:49:43 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-25 21:49:43 +0000 |
commit | f7fe2912031909c9cc61cdb6d6cead89326c515a (patch) | |
tree | d2ace8d53471e32c6790e20fdf1f9c4cc97b38ba /driver.c | |
parent | 410cafca60df0eab1bb527ff5e4b6a2db93972e3 (diff) | |
download | fetchmail-f7fe2912031909c9cc61cdb6d6cead89326c515a.tar.gz fetchmail-f7fe2912031909c9cc61cdb6d6cead89326c515a.tar.bz2 fetchmail-f7fe2912031909c9cc61cdb6d6cead89326c515a.zip |
Reorganize some code.
svn path=/trunk/; revision=387
Diffstat (limited to 'driver.c')
-rw-r--r-- | driver.c | 55 |
1 files changed, 27 insertions, 28 deletions
@@ -47,6 +47,33 @@ static int tagnum; static char *shroud; +static int strcrlf(dst, src, count) +/* replace LFs with CR-LF; return length of string with replacements */ +char *dst; /* new string with CR-LFs */ +char *src; /* original string with LFs */ +int count; /* length of src */ +{ + int len = count; + + while (count--) + { + if (*src == '\n') + { + *dst++ = '\r'; + len++; + } + *dst++ = *src++; + } + *dst = '\0'; + return len; +} + +static void alarm_handler (int signal) +/* handle server-timeout signal */ +{ + longjmp(restart, 1); +} + static void reply_hack(buf, host) /* hack message headers so replies will work properly */ char *buf; /* header to be hacked */ @@ -1026,32 +1053,4 @@ va_dcl { return(ok); } -int strcrlf(dst, src, count) -/* replace LFs with CR-LF; return length of string with replacements */ -char *dst; /* new string with CR-LFs */ -char *src; /* original string with LFs */ -int count; /* length of src */ -{ - int len = count; - - while (count--) - { - if (*src == '\n') - { - *dst++ = '\r'; - len++; - } - *dst++ = *src++; - } - *dst = '\0'; - return len; -} - -void -alarm_handler (int signal) -/* handle server-timeout signal */ -{ - longjmp(restart, 1); -} - /* driver.c ends here */ |