home *** CD-ROM | disk | FTP | other *** search
/ The Arcade BBS / arcadebbs.zip / arcadebbs / bbstools / MODS / COMMON40.ZIP / COMMON.MOD < prev    next >
Encoding:
Text File  |  1995-07-25  |  12.2 KB  |  400 lines

  1. ═══════════════════════════════════════════════════════════════════════════════
  2.   ModTitle: Asylum Common v4.0a for 4.24         Last Update June 19, 1995
  3.   Mods that use this mod will be referred to as a 'Common Mod'
  4.  
  5.   Difficulty: Typical Asylum Mod...that is, a piece of cake.
  6.  
  7.   Files affected: MAKEFILE, VARDEC.H, VARS.H COM.C
  8.  
  9.   A tool box of functions that the Asylum group (and any one else who wants to)
  10.   use in the modifications for WWIV.
  11.  
  12.   Current mods requiring this mod: Pulldown Menus, Listfile Plus, Super
  13.                                    Config and Asylum Chat
  14.  
  15.   BY: Asylum Group-  Zu Digital, 1@8421, and Sam, 1@4051
  16.   Credits: No one
  17. ═══════════════════════════════════════════════════════════════════════════════
  18.  
  19. Why version 4?  Version 4 refers to WWIV 4.24, when 4.25 comes out, it will
  20. be renamed version 5.
  21.  
  22.  
  23. + Add
  24. - Subtract
  25. * Change
  26. = Existing
  27. @# See number
  28.  
  29.     
  30.   I will not be responsible for any problems that arise because of this or any
  31.   other of my mods.  If you have something to lose, make a way to recover it.
  32.   If you don't know how to do this properly, then don't install this.
  33.   If you can't install this mod without any problems, then don't try.
  34.   
  35.   Now,... this mod works as far as I have tested, as has many other people.
  36.   
  37.  
  38.  
  39. Step 1)
  40.   Place the included files in your compling directory, should include COMMON.C,
  41.   COMMON2.C and COMMON.H.
  42.  
  43.   
  44.  
  45.  
  46.   
  47. Step 2) VARS.H
  48.   Have vars.h include common.h into your bbs as well as a simple define
  49.   
  50. = #include <dos.h>
  51. = #include <alloc.h>
  52. = #include <time.h>
  53.  
  54.  
  55. + #include "vardec1.h" /***********  Read !!!!!!!!! ***********/
  56. + #include "common.h"  /*********** important, make sure this is before fcns.h ***********/
  57. = #include "fcns.h"    /*********** Did you read ^^^^^??????????? *********/
  58.  
  59.  
  60.  
  61.  
  62. Step 3) BBS.C
  63.   Put in a check to give us an error if we mess up on the userrec
  64.  
  65. = void main(int argc, char *argv[])
  66. = {
  67. =   char s[81],ch,frc[81], rf[30],*ss;
  68. =   int i,i1,num_min=0;
  69. =   unsigned int ui=0, us=0;
  70. =   double dt;
  71. =   unsigned short c_s,c_o;
  72. =   int this_usernum=0;
  73. =
  74. + #if sizeof(userrec) != 1024
  75. + #error Userrec is not 1024
  76. + #endif
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. Step 4)
  84.  
  85. ======================= START BORLAND C MAKEFILE ADDITIONS ===================
  86.   MAKEFILE.  This is only for the Borland make, if you don't use it, then you
  87.   will have to modify your makefile yourself, being that I don't use it, and
  88.   do not know the syntax.
  89.   
  90.   A) Search for BBS_NRM and add our non-overlaid part of common
  91.  
  92. = BBS_NRM = \
  93. =        msgbase.obj  msgbase1.obj share.obj    strings.obj  \
  94. *        utility.obj  xfer.obj     common2.obj
  95.                                   ^^^^^^^^^^^ add this
  96.  
  97.   B) Down a little add our other part
  98.  
  99. = BBS_O_NRM = \
  100. =        $(OBJ)\msgbase1.obj $(OBJ)\share.obj    $(OBJ)\strings.obj  \
  101. *        $(OBJ)\utility.obj  $(OBJ)\xfer.obj     $(OBJ)\common2.obj
  102.                                                  ^^^^^^^^^^^^^^^^^^ add this
  103.  
  104.  
  105.   C) Search for BBS_OVL and add the common.obj to the end of it, to add
  106.      our overlaid part
  107.   
  108. =       sysopf.obj   tedit.obj    uedit.obj    voteedit.obj \
  109. *       xferovl.obj  xfertmp.obj  xinit.obj    common.obj
  110.                                                ^^^^^^^^^^ added part
  111.   D) Go down a little to BBS_O_OVL
  112.   
  113. =        $(OBJ)\voteedit.obj $(OBJ)\xferovl.obj  $(OBJ)\xfertmp.obj  \
  114. *        $(OBJ)\xinit.obj $(OBJ)\common.obj
  115.                           ^^^^^^^^^^^^^^^^^ added part
  116.  
  117. ########## if you use Turbo C, use this code, a number of people have
  118. ########## given this to me, I just choose to use this one from Tubman
  119.  
  120. A) Search for BBS_NRM = \ and add the \ to the end of the last line.  Then
  121.    add the common2.obj in on it's own line.
  122.  
  123. = BBS_NRM = \
  124. =       $(OBJ)bbs.obj $(OBJ)bbsutl.obj $(OBJ)bbsutl1.obj $(OBJ)com.obj\
  125. =       $(OBJ)conio.obj $(OBJ)connect1.obj $(OBJ)extrn.obj $(OBJ)modem.obj\
  126. =       $(OBJ)msgbase.obj $(OBJ)msgbase1.obj $(OBJ)utility.obj\
  127. =       $(OBJ)xfer.obj $(OBJ)strings.obj $(OBJ)share.obj $(OBJ)subacc.obj\
  128. *       $(OBJ)bbsutl2.obj $(OBJ)mmenu.obj $(OBJ)ripspeed.obj ripint.obj\
  129. +       $(OBJ)common2.obj
  130.  
  131. B) Search for BBS_OVL = \ and add the common.obj to it.
  132.  
  133. = BBS_OVL = \
  134.         .
  135.         .
  136.         .
  137. =       $(OBJ)bbsovl3.obj $(OBJ)qwk.obj $(OBJ)qwk1.obj\
  138. *       $(OBJ)ripovl.obj $(OBJ)wfc.obj $(OBJ)common.obj
  139.  
  140. C) Search down some more, and add this after xfer.obj
  141.  
  142. = $(OBJ)xfer.obj    : xfer.c     vars.h vardec.h net.h
  143. =   $(TCC_NRM)
  144. + $(OBJ)common2.obj : common2.c  vars.h vardec.h net.h
  145. +   $(TCC_NRM)
  146. = $(OBJ)strings.obj : strings.c
  147.  
  148. D) Down a little more, add this after ripovl.obj
  149.  
  150. = $(OBJ)ripovl.obj  : ripovl.c   vars.h vardec.h net.h
  151. =   $(TCC_OVL)
  152. + $(OBJ)common.obj  : common.c   vars.h vardec.h net.h
  153. +   $(TCC_OBL)
  154. =
  155. = $(OBJ)return.obj  : return.c   vars.h vardec.h net.h
  156. =   $(TCC)
  157.  
  158.  
  159.  
  160.   E) Down a little to the NON-OVERLAID PART
  161.  
  162. = share.obj   : share.c
  163. =   $(TCC_NRM)
  164. = utility.obj : utility.c
  165. =   $(TCC_NRM)
  166. = xfer.obj    : xfer.c
  167. =   $(TCC_NRM)
  168. + common2.obj : common2.c
  169. +   $(TCC_NRM)
  170.  
  171.  
  172.  
  173.   F) And now... down a ways... (IN THE OVERLAID PART)
  174.  
  175. xfertmp.obj : xfertmp.c
  176.   $(TCC_OVL)
  177. xinit.obj   : xinit.c
  178.   $(TCC_OVL)
  179. + common.obj : common.c
  180. +  $(TCC_OVL)
  181.  
  182.  
  183.  
  184. ======================= END BORLAND C MAKEFILE ADDITIONS =====================
  185.  
  186.  
  187. ======================= START TURBO C MAKEFILE ADDITIONS =====================
  188.  
  189. ┌────────────────────────────────────────────────────────────────────────────┐
  190. │ Mod Name: SPAM-19A.MOD      By Heartland Software          1@2446 WWIVnet  │
  191. │ Difficulty: █▒▒▒▒▒▒▒▒▒ This makes Asylum's MODs look HARD! 1@3953 WWIVLink │
  192. │ WWIV Version: 4.24                                         1@3950 TerraNET │
  193. │ Files Affected: MAKEFILE.MAK                               1@1    CompuNET │ 
  194. │ Mod info: This MOD gives your the directions for installing COMMON v4.0,   │
  195. │           Asylum Chat, and ListPlus v4.0 for modifying the MAKEFILE.MAK    │
  196. │           section for all fo those Asylum MODs.                            │
  197. │ Disclaimer: You put it in at your own free will, don't come crying to me.  │
  198. └────────────────────────────────────────────────────────────────────────────┘
  199.  
  200. Take NOTE! You only have to install which ever one you want!
  201. Step 1a through step 1d is for COMMON.MOD
  202. Step 2a through step 2c is for LISTPLUS.MOD
  203. Step 3a through setp 3c is for ACHAT.MOD
  204.  
  205.  
  206. Revision Note A: Updated for COMMON v4.0, ListPlus 4.0 and Achat 4.0, and
  207.                  WWIV v4.24 (although it is pretty much the same I fixed a
  208.                  Type-o in the origonal mod [sorry])
  209.  
  210. Legend :
  211.  = [Existing Line]
  212.  * [Modify Line]
  213.  - [Delete Line]
  214.  + [Insert Line]
  215.  
  216. ───[Step 1a]────────────────────────────────────────────────────────────────────
  217.  
  218. This section installs COMMON v4.0 into the Turbo C++ Makefile.mak. 
  219. Load Up MAKEFILE.MAK and do the following changes in Normal, non-overlaid bbs
  220. files:
  221.  
  222. = #############################################################################
  223. = #        
  224. = #
  225. = # Normal, non-overlaid bbs files
  226. = #
  227. = BBS_NRM = \
  228. =         $(OBJ)bbs.obj $(OBJ)bbsutl.obj $(OBJ)bbsutl1.obj $(OBJ)com.obj\
  229. =         $(OBJ)conio.obj $(OBJ)connect1.obj $(OBJ)extrn.obj $(OBJ)modem.obj\
  230. =         $(OBJ)msgbase.obj $(OBJ)msgbase1.obj $(OBJ)utility.obj\
  231. =         $(OBJ)xfer.obj $(OBJ)strings.obj $(OBJ)share.obj $(OBJ)subacc.obj\
  232. *         $(OBJ)bbsutl2.obj $(OBJ)mmenu.obj $(OBJ)ripspeed.obj ripint.obj\
  233. +         $(OBJ)common2.obj
  234.  
  235. Note, the part marked witht the '*' you must add a \ to the end
  236.  
  237. ───[Step 1b]────────────────────────────────────────────────────────────────────
  238. Lower down in the Overlaid bbs files....
  239.  
  240. = #
  241. = # Overlaid bbs files
  242. = #
  243. = BBS_OVL = \
  244. =         $(OBJ)newuser.obj $(OBJ)sysopf.obj $(OBJ)voteedit.obj\
  245. =         $(OBJ)gfledit.obj $(OBJ)tedit.obj $(OBJ)chnedit.obj\
  246. =         $(OBJ)uedit.obj $(OBJ)diredit.obj $(OBJ)subedit.obj\
  247. =         $(OBJ)xferovl.obj $(OBJ)multmail.obj $(OBJ)gfiles.obj\
  248. =         $(OBJ)defaults.obj $(OBJ)misccmd.obj $(OBJ)xinit.obj\
  249. =         $(OBJ)xfertmp.obj $(OBJ)batch.obj $(OBJ)srrcv.obj\
  250. =         $(OBJ)srsend.obj $(OBJ)lilo.obj $(OBJ)subreq.obj\
  251. =         $(OBJ)netsup.obj $(OBJ)subxtr.obj $(OBJ)multinst.obj\
  252. =         $(OBJ)conf.obj $(OBJ)readmail.obj $(OBJ)instmsg.obj\
  253. =         $(OBJ)bbsovl1.obj $(OBJ)extrn1.obj $(OBJ)bbsovl2.obj\
  254. =         $(OBJ)sr.obj $(OBJ)ini.obj $(OBJ)xferovl2.obj\
  255. =         $(OBJ)bbsovl3.obj $(OBJ)qwk.obj $(OBJ)qwk1.obj\
  256. *         $(OBJ)ripovl.obj $(OBJ)common.obj
  257.  
  258. Just add the extra $(OBJ)common.obj to the end of the line
  259.  
  260. ───[Step 1c]────────────────────────────────────────────────────────────────────
  261.  
  262. Further down in the .C files listings....
  263.  
  264. =   $(TCC_NRM)
  265. = $(OBJ)bbsovl3.obj : bbsovl3.c  vars.h vardec.h net.h
  266. =   $(TCC_OVL)
  267. = $(OBJ)qwk.obj     : qwk.c      vars.h vardec.h net.h
  268. =   $(TCC_OVL)
  269. = $(OBJ)qwk1.obj    : qwk1.c     vars.h vardec.h net.h
  270. =   $(TCC_OVL)
  271. = $(OBJ)ripovl.obj  : ripovl.c vars.h vardec.h net.h
  272. =   $(TCC_OVL)
  273. + $(OBJ)common2.obj : common2.c  vars.h vardec.h net.h
  274. +   $(TCC_OVL)
  275. + $(OBJ)common.obj  : common.c   vars.h vardec.h net.h
  276. +   $(TCC_OVL)
  277. = $(OBJ)return.obj  : return.c   vars.h vardec.h net.h
  278. =   $(TCC)
  279.  
  280. ───[Step 1d]────────────────────────────────────────────────────────────────────
  281.  
  282. Compile it, if you installed the rest of COMMON40.MOD then everything should
  283. be fine.
  284.  
  285.  
  286.  
  287.  
  288. ======================= END TURBO C MAKEFILE ADDITIONS =====================
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298. 5) Remove the following functions from COM.C
  299.  
  300.   void outchr(unsigned char c)
  301.   {
  302.   ...
  303.   }
  304.  
  305.   skip some (I think)
  306.  
  307.   void outstr(unsigned char *s)
  308.   {
  309.   ...
  310.   }
  311.  
  312.   skip some..
  313.  
  314.   void npr(char *fmt, ...)
  315.   {
  316.   ...
  317.   }
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327. Step 6)
  328.     FCNS.H
  329.     
  330.     Either update your fcns.h by typing make fcns or by manually inserting
  331.     the following defenitions:
  332.     
  333.     These must go in between the #ifndef _FCNS_H_ and the final #endif
  334.  
  335.  
  336. /* File: common2.c */
  337.  
  338. int find_batch_queue(char *fn);
  339. void remove_batch(char *fn);
  340. void BEEP(void);
  341. void EOL(void);
  342. int pd_amount_in_list(char *list, int rows, int cols);
  343. char * strip_string(char *string);
  344. char *unalign(char *filename);
  345. int outchr(unsigned char c);   /* replace with this */
  346. int outstr(unsigned char *s);  /* replace with this */
  347. int npr(char *fmt, ...);       /* replace with this */
  348.  
  349.  
  350. /* File: common.c */
  351.  
  352. int outchr_color(int c);
  353. char **alloc_2d(int row, int col, unsigned size);
  354. void free_2d(char **pa);
  355. unsigned side_menu(int *menu_pos, int redraw, char *menu_items[], int xpos, int ypos, struct side_menu_colors *smc);
  356. void show_common_mods(void);
  357. void test_vm(void);
  358. void wait_sec(double seconds);
  359. long filesize(FILE *stream);
  360. int fset_rec(FILE *stream, unsigned rec, unsigned rec_size);
  361. int set_rec(int filenum, unsigned rec, unsigned rec_size);
  362. ini_record * open_ini(char *fname, unsigned long flags);
  363. void close_ini(ini_record *ini);
  364. char *ini_read_string(ini_record *ini, char *area, char *ident, char *buff);
  365. long ini_read_number(ini_record *ini, char *area, char *ident);
  366. int ini_read_boolean(ini_record *ini, char *area, char *ident);
  367. int ini_write_string(ini_record *ini, char *area, char *ident, char *value);
  368. int ini_write_number(ini_record *ini, char *area, char *ident, long value);
  369. int ini_remove_ident(ini_record *ini, char *area, char *ident);
  370. void ini_remove_area(ini_record *ini, char *area);
  371. int does_ident_exist(ini_record *ini, char *area, char *ident);
  372. int does_ini_area_exist(ini_record *ini, char *area);
  373. int get_ident_positions(ini_record *ini, char *area, char *ipattern);
  374. int get_ident_patterns(ini_record *ini, char *area, char *ipattern, int getem);
  375. char *fix_ini_name(char *fname);
  376. int ini_write_changes(ini_record *ini);
  377. void release_ini_section(ini_record *ini);
  378. int read_ini_area(ini_record *ini, char *area);
  379. int addto_ini_lines(ini_record *ini, char *line, int modify);
  380. void ini_pack_lines(ini_record *ini);
  381. int replace_in_ini_lines(ini_record *ini, char *line, int x);
  382. int remove_from_ini_lines(ini_record *ini, int x);
  383.  
  384.  
  385.  
  386. /* File: com.c */    (remove these 3 functions)
  387.  
  388. -- void outchr(unsigned char c);   /* find and remove old outchr */
  389. -- void outstr(unsigned char *s);  /* find and remove old outstr */
  390. -- void npr(char *fmt, ...);       /* find and remove old npr */
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.