home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 May / PCO_5_97.ISO / FilesBBS / OS2 / WWWCNT15.ARJ / WWWCNT15 / WWWCNT15.ZIP / patches.os2 < prev    next >
Encoding:
Text File  |  1995-12-13  |  8.8 KB  |  353 lines

  1. diff -cbr Orig/combine/Makefile WWWCount/combine/Makefile
  2. *** Orig/combine/Makefile    Mon Sep 18 01:48:20 1995
  3. --- WWWCount/combine/Makefile    Wed Dec 13 15:56:52 1995
  4. ***************
  5. *** 4,46 ****
  6.   # 07-11-95
  7.   # 09-17-95 (Count 1.5)
  8.   
  9. ! CC= gcc
  10. ! RM=rm -f
  11. ! AR= ar cq
  12.   
  13.   # for SYSV use RANLIB=echo
  14.   # RANLIB=echo
  15. ! RANLIB= ranlib
  16.   
  17.   INCDIR= -I. -I..
  18.   
  19. ! # replace -O with -g in order to debug
  20. ! CDEBUGFLAGS= -O -D__USE_FIXED_PROTOTYPES__
  21. ! CFLAGS= $(CDEBUGFLAGS) $(INCDIR)
  22.   
  23.   SRCS = comnine.c crbasei.c allocim.c readgif.c rddata.c dstraimg.c\
  24.          readblk.c lzwdec.c syncimg.c duplicim.c writegif.c lsbfwrs.c\
  25.          lzenc.c uncmpimg.c readim.c flatten.c signature.c quantize.c\
  26.          compimg.c rgbtran.c tranrgb.c compcmap.c frameim.c modulate.c\
  27.          alphaim.c setpixel.c getfinfo.c imgstr.c gdfonts.c
  28. ! OBJS = combine.o crbasei.o allocim.o readgif.o rddata.o dstraimg.o\
  29. !        readblk.o lzwdec.o syncimg.o duplicim.o writegif.o lsbfwrs.o\
  30. !        lzwenc.o uncmpimg.o readim.o flatten.o signature.o quantize.o\
  31. !        compimg.o rgbtran.o tranrgb.o compcmap.o frameim.o modulate.o\
  32. !        alphaim.o setpixel.o getfinfo.o imgstr.o gdfonts.o
  33.   
  34. ! .c.o:
  35. !     $(RM) $@
  36.       $(CC) -c $(CFLAGS) $*.c
  37.   
  38. ! all: libCombine.a
  39.   
  40. ! libCombine.a: $(OBJS)
  41.       $(RM) $@
  42.       $(AR) $@ $(OBJS)
  43.       $(RANLIB) $@
  44.   
  45. ! combine.o: combine.h
  46.   
  47.   clean:
  48. !     $(RM) *.o libCombine.a core
  49. --- 4,45 ----
  50.   # 07-11-95
  51.   # 09-17-95 (Count 1.5)
  52.   
  53. ! CC = gcc
  54. ! RM = rm -f
  55. ! AR = ar cr
  56.   
  57.   # for SYSV use RANLIB=echo
  58.   # RANLIB=echo
  59. ! RANLIB = ar s
  60.   
  61.   INCDIR= -I. -I..
  62.   
  63. ! CFLAGS= $(INCDIR)
  64.   
  65.   SRCS = comnine.c crbasei.c allocim.c readgif.c rddata.c dstraimg.c\
  66.          readblk.c lzwdec.c syncimg.c duplicim.c writegif.c lsbfwrs.c\
  67.          lzenc.c uncmpimg.c readim.c flatten.c signature.c quantize.c\
  68.          compimg.c rgbtran.c tranrgb.c compcmap.c frameim.c modulate.c\
  69.          alphaim.c setpixel.c getfinfo.c imgstr.c gdfonts.c
  70. ! OBJS = combine$O crbasei$O allocim$O readgif$O rddata$O dstraimg$O\
  71. !        readblk$O lzwdec$O syncimg$O duplicim$O writegif$O lsbfwrs$O\
  72. !        lzwenc$O uncmpimg$O readim$O flatten$O signature$O quantize$O\
  73. !        compimg$O rgbtran$O tranrgb$O compcmap$O frameim$O modulate$O\
  74. !        alphaim$O setpixel$O getfinfo$O imgstr$O gdfonts$O
  75.   
  76. ! .SUFFIXES: .c $O
  77. ! .c$O:
  78.       $(CC) -c $(CFLAGS) $*.c
  79.   
  80. ! all: combine$A
  81.   
  82. ! combine$A: $(OBJS)
  83.       $(RM) $@
  84.       $(AR) $@ $(OBJS)
  85.       $(RANLIB) $@
  86.   
  87. ! combine$O: combine.h
  88.   
  89.   clean:
  90. !     $(RM) *$O combine$A core
  91. diff -cbr Orig/config.h WWWCount/config.h
  92. *** Orig/config.h    Mon Sep 18 01:47:38 1995
  93. --- WWWCount/config.h    Wed Dec 13 14:19:44 1995
  94. ***************
  95. *** 29,40 ****
  96.   ** base directory of the configuration file.
  97.   ** do not end the string with /
  98.   */
  99. ! #define ConfigDir   "/usr/local/etc/Counter/conf"
  100.   /*
  101.   ** name of the configuration file
  102.   ** look at the example file "count.conf" for the format of this file
  103.   */
  104. ! #define ConfigFile "count.conf"
  105.   
  106.   /*------------------------------------*/
  107.   
  108. --- 29,40 ----
  109.   ** base directory of the configuration file.
  110.   ** do not end the string with /
  111.   */
  112. ! /* #define ConfigDir   "/usr/local/etc/Counter/conf" */
  113.   /*
  114.   ** name of the configuration file
  115.   ** look at the example file "count.conf" for the format of this file
  116.   */
  117. ! /* #define ConfigFile "count.conf" */
  118.   
  119.   /*------------------------------------*/
  120.   
  121. ***************
  122. *** 50,56 ****
  123.   **
  124.   ** DO NOT end the string with a /, it will be added later
  125.   */
  126. ! #define DigitDir "/usr/local/etc/Counter/digits"
  127.   
  128.   /*------------------------------------*/
  129.   
  130. --- 50,56 ----
  131.   **
  132.   ** DO NOT end the string with a /, it will be added later
  133.   */
  134. ! /* #define DigitDir "/usr/local/etc/Counter/digits" */
  135.   
  136.   /*------------------------------------*/
  137.   
  138. ***************
  139. *** 61,78 ****
  140.   ** DO NOT end the string with a /, it will be added later
  141.   ** no need to define datafile name, it will be given while calling
  142.   */
  143. ! #define DataDir "/usr/local/etc/Counter/data"
  144.   
  145.   /*------------------------------------*/
  146.   
  147.   /*
  148.   ** base directory of the log file
  149.   */
  150. ! #define LogDir "/usr/local/etc/Counter/logs"
  151.   /*
  152.   ** name of log file. Error and log messages will be written to this
  153.   */
  154. ! #define LogFile "Count15.log"
  155.   
  156.   #endif /* _COUNT_CONFIG_H*/
  157.   
  158. --- 61,84 ----
  159.   ** DO NOT end the string with a /, it will be added later
  160.   ** no need to define datafile name, it will be given while calling
  161.   */
  162. ! /* #define DataDir "/usr/local/etc/Counter/data" */
  163.   
  164.   /*------------------------------------*/
  165.   
  166.   /*
  167.   ** base directory of the log file
  168.   */
  169. ! /* #define LogDir "/usr/local/etc/Counter/logs" */
  170.   /*
  171.   ** name of log file. Error and log messages will be written to this
  172.   */
  173. ! /* #define LogFile "Count15.log" */
  174.   
  175.   #endif /* _COUNT_CONFIG_H*/
  176.   
  177. + extern char ConfigDir[];
  178. + extern char ConfigFile[];
  179. + extern char DigitDir[];
  180. + extern char DataDir[];
  181. + extern char LogDir[];
  182. + extern char LogFile[];
  183. diff -cbr Orig/count.h WWWCount/count.h
  184. *** Orig/count.h    Sun Sep 17 19:05:44 1995
  185. --- WWWCount/count.h    Wed Dec 13 19:19:00 1995
  186. ***************
  187. *** 241,244 ****
  188. --- 241,247 ----
  189.   unsigned int
  190.       CheckRemoteIP _Declare ((char *, char *));
  191.   
  192. + void
  193. +     GetDirs _Declare ((void));
  194.   #endif /* _COUNT_H */
  195. diff -cbr Orig/main.c WWWCount/main.c
  196. *** Orig/main.c    Sun Sep 17 15:49:06 1995
  197. --- WWWCount/main.c    Wed Dec 13 19:20:10 1995
  198. ***************
  199. *** 48,53 ****
  200. --- 48,59 ----
  201.       "six", "seven", "eight", "nine",
  202.   };
  203.   
  204. + char ConfigDir[512];
  205. + char ConfigFile[512];
  206. + char DigitDir[512];
  207. + char DataDir[512];
  208. + char LogDir[512];
  209. + char LogFile[512];
  210.   
  211.   void main (argc, argv)
  212.   int
  213. ***************
  214. *** 127,135 ****
  215. --- 133,145 ----
  216.           *rem_refh;
  217.   #endif
  218.   
  219. +     _fsetmode(stdout, "b");
  220. +     setmode(1, O_BINARY);
  221.   /*
  222.   **---------initialize globals------Starts---
  223.   */
  224. +     GetDirs();
  225.       for (i=0; i < MaxSites; i++)
  226.       {
  227.           GrefererHost[i] = (char *) NULL;
  228. ***************
  229. *** 801,803 ****
  230. --- 811,846 ----
  231.       }
  232.   }
  233.   
  234. + void GetDirs()
  235. + {
  236. +   char path[512], buffer[512], *ptr, *value;
  237. +   FILE *cfg;
  238. +   _execname(path, sizeof(path));
  239. +   ptr = strrchr(path, '.');
  240. +   strcpy(ptr, ".cfg");
  241. +   if ((cfg = fopen(path, "r")) != NULL)
  242. +   {
  243. +     while (fgets(buffer, sizeof(buffer), cfg) != NULL)
  244. +     {
  245. +       ptr = strtok(buffer, " \t\n");
  246. +       value = strtok(NULL, " \t\n");
  247. +       if (stricmp(ptr, "ConfigDir") == 0)
  248. +     strcpy(ConfigDir, value);
  249. +       else if (stricmp(ptr, "ConfigFile") == 0)
  250. +     strcpy(ConfigFile, value);
  251. +       else if (stricmp(ptr, "DigitDir") == 0)
  252. +     strcpy(DigitDir, value);
  253. +       else if (stricmp(ptr, "DataDir") == 0)
  254. +     strcpy(DataDir, value);
  255. +       else if (stricmp(ptr, "LogDir") == 0)
  256. +     strcpy(LogDir, value);
  257. +       else if (stricmp(ptr, "LogFile") == 0)
  258. +     strcpy(LogFile, value);
  259. +     }
  260. +     fclose(cfg);
  261. +   }
  262. + }
  263. diff -cbr Orig/Makefile WWWCount/Makefile
  264. *** Orig/Makefile    Mon Sep 18 01:46:40 1995
  265. --- WWWCount/Makefile    Wed Dec 13 15:56:04 1995
  266. ***************
  267. *** 33,68 ****
  268.   # permission for httpd
  269.   ##
  270.   
  271. ! CC= gcc 
  272. ! CFLAGS= -O -D__USE_FIXED_PROTOTYPES__ -DACCESS_AUTH\
  273. !         -DUSE_LOCK -I. -I./combine
  274.   
  275.   
  276. ! OBJS= main.o utils.o strimage.o
  277. ! all:    libCombine.a Count
  278. ! #
  279. ! # make the GIF combining library
  280. ! #
  281. ! libCombine.a:
  282. !     (cd combine; make)
  283. ! #
  284. ! Count:    $(OBJS)
  285. !         $(CC) $(CFLAGS) -o Count.cgi $(OBJS) combine/libCombine.a
  286. ! main.o:    main.c
  287.           $(CC) $(CFLAGS) -c main.c
  288.   
  289. ! utils.o:    utils.c
  290.           $(CC) $(CFLAGS) -c utils.c
  291.   
  292. ! strimage.o:    strimage.c
  293.           $(CC) $(CFLAGS) -c strimage.c
  294.   
  295. ! main.o:    count.h config.h
  296. ! utils.o:    count.h config.h
  297.   
  298.   clean:
  299. !     (cd combine; make clean)
  300. !     /bin/rm -f *.o Count.cgi core
  301. --- 33,73 ----
  302.   # permission for httpd
  303.   ##
  304.   
  305. ! emx:
  306. !     $(MAKE) all CC="gcc -O -s -Zomf -Zsys -Zstack 512" O=".obj" X=".exe" \
  307. !     AR="emxomfar cr" RANLIB="emxomfar s" A=".lib" OUT="-o"
  308. ! emx-debug:
  309. !     $(MAKE) all CC="gcc -g" O=".o" X=".exe" \
  310. !     AR="ar cr" RANLIB="ar s" A=".a" OUT="-o"
  311. ! ibm:
  312. !     $(MAKE) all CC="icc -Wpro- -Ti -Gm" O=".obj" X=".exe" \
  313. !     AR="ilib" RANLIB="rem" A=".lib" OUT="-Fe"
  314. ! CFLAGS = -DACCESS_AUTH -I. -I./combine
  315. ! OBJS = main$O utils$O strimage$O
  316. ! all: combine$A count$X
  317. ! combine$A:
  318. !     $(MAKE) -C combine CC="$(CC)" O="$O" X="$X" \
  319. !     AR="$(AR)" RANLIB="$(RANLIB)" A="$A"
  320.   
  321. + count$X: $(OBJS)
  322. +     $(CC) $(CFLAGS) $(OUT) $@ $(OBJS) combine/combine$A
  323.   
  324. ! main$O: main.c
  325.       $(CC) $(CFLAGS) -c main.c
  326.   
  327. ! utils$O: utils.c
  328.       $(CC) $(CFLAGS) -c utils.c
  329.   
  330. ! strimage$O: strimage.c
  331.       $(CC) $(CFLAGS) -c strimage.c
  332.   
  333. ! main$O: count.h config.h
  334. ! utils$O: count.h config.h
  335.   
  336.   clean:
  337. !     $(MAKE) -C combine clean
  338. !     rm -f *$O count.exe core
  339.