diff --git a/gopher.c b/gopher.c index d9395b9..36b2659 100644 --- a/gopher.c +++ b/gopher.c @@ -1,6 +1,7 @@ #pragma optimize 79 #pragma noroot +#include #include #include #include @@ -354,7 +355,7 @@ int do_gopher(const char *url, URLComponents *components) return -1; } - if (parse_extension(filename, &FileInfo.fileType, &FileInfo.auxType)) + if (parse_extension_c(filename, &FileInfo.fileType, &FileInfo.auxType)) { FileAttr |= ATTR_FILETYPE | ATTR_AUXTYPE; setfileattr(filename, &FileInfo, FileAttr); diff --git a/http.c b/http.c index dcd3df3..2096743 100644 --- a/http.c +++ b/http.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -371,7 +372,7 @@ int read_response(Word ipid, FILE *file, Handle dict) * a file type / aux type. * */ - value = DictionaryGet(dict, "Content-Type", 12, &valueSize) + value = DictionaryGet(dict, "Content-Type", 12, &valueSize); if (value && valueSize) { int i; @@ -416,7 +417,7 @@ int read_response(Word ipid, FILE *file, Handle dict) struct { LongWord lo; LongWord hi; - } comp; + } xcomp; *pstring = valueSize; memcpy(pstring + 1, value, valueSize); @@ -430,10 +431,11 @@ int read_response(Word ipid, FILE *file, Handle dict) // then use ConvSeconds to get the date // this should handle timezones. - tiDateString2Sec(&comp, pstring, 0x0e00); - if (!_toolErr && hi == 0) + tiDateString2Sec(&xcomp, pstring, 0x0e00); + if (!_toolErr && xcomp.hi == 0) { - ConvSeconds(secs2TimeRec, comp.lo, &FileInfo.modDateTime); + ConvSeconds(secs2TimeRec, (Long)xcomp.lo, + (Pointer)&FileInfo.modDateTime); FileAttr |= ATTR_MODTIME; haveTime = 1; } @@ -571,7 +573,7 @@ static int do_http_1_1( cookie = 0; while ((cookie = DictionaryEnumerate(dict, &e, cookie))) { - s16_debug_printf("%.*s -> %.*s", + s16_debug_printf("%.*s -> %.*s\n", e.keySize, e.key, e.valueSize, e.value); } #endif diff --git a/prototypes.h b/prototypes.h index 09e9ada..78eb3c2 100644 --- a/prototypes.h +++ b/prototypes.h @@ -27,7 +27,7 @@ int parse_extension_c(const char *cp, Word *ftype, LongWord *atype); int parse_extension(const char *cp, Word size, Word *ftype, LongWord *atype); int parse_mime_c(const char *cp, Word *ftype, LongWord *atype); -int parse_mime(const char *cp, Word size, Word *ftype, LongWord *atype) +int parse_mime(const char *cp, Word size, Word *ftype, LongWord *atype); #ifdef __GSOS__ @@ -39,7 +39,7 @@ enum { ATTR_MODTIME = 16 }; -int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags) +int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags); #endif diff --git a/setftype.c b/setftype.c index 30d4656..90007d7 100644 --- a/setftype.c +++ b/setftype.c @@ -5,6 +5,8 @@ #include #include +#include "prototypes.h" + int setfileattr(const char *filename, FileInfoRecGS *info, unsigned flags) { Word rv;