home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / WW4SHARE / W424ASRC.ZIP / W424ASRC.DOC < prev   
Text File  |  1994-09-08  |  31KB  |  773 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  WWIV Source Documentation
  11.                          for v4.24a
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                              by
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.                          Wayne Bell
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  This document was a chapter in the 4.24 bbs documentation.
  35. It has been moved to a separate document for 4.24a.  Wayne
  36. Bell will continue to revise and update this document.
  37.  
  38.                           (c) 1995
  39.                          Wayne Bell
  40.  
  41.  
  42.  
  43.                WWIV Source Code Documentaion
  44.                                                             
  45.         ╔═══════════════════════════════════════╗           
  46.         ║        WWIV Source Documentation      ║           
  47.         ║ Copyright (c) 1988-1995 by Wayne Bell ║
  48.         ╚═══════════════════════════════════════╝           
  49.                                                             
  50.  4.1  Source Distribution                                   
  51.                                                             
  52.     Although this document is being included with the pre-
  53.  compiled (shareware) version, its primary use is for those
  54.  sysops who have registered.  Unregistered sysops may also
  55.  learn from it and may see some of the advantages of being
  56.  registered--advantages which include but are not limited
  57.  to the availability of certain options discussed in this
  58.  document.
  59.                                                             
  60.    The source code is ONLY available to people who have     
  61.  registered; IT IS NOT FOR ANY OTHER PEOPLE.  As can be     
  62.  seen in the license agreement in Chapter 3 as well as by   
  63.  the notice at the beginning of all the source files,       
  64.  DISTRIBUTION OF THE SOURCE BY ANYONE EXCEPT BY WAYNE BELL  
  65.  OR A SOURCE DISTRIBUTION SYSTEM (SDS) AUTHORIZED BY ME IS  
  66.  PROHIBITED.  Even if your best friend mails a registra-    
  67.  tion check right before your eyes, he must get the source
  68.  
  69.  
  70.                             -1-
  71.  
  72.  
  73.  
  74.  from ME or from an SDS BBS, you may not give him a copy.   
  75.                                                             
  76.  If you have somehow gotten ahold of the WWIV source code   
  77.  WITHOUT either downloading it from my BBS, downloading it  
  78.  from an SDS BBS, or receiving it in the mail from WWIV     
  79.  Software Services, then you are hurting the cause of good  
  80.  software.  If you continue to possess and use this source  
  81.  code, you may place yourself and the person from whom you  
  82.  received it in legal jeopardy.  If it turns out that it    
  83.  is not possible to control distribution of the source by   
  84.  reasonable means, you will probably find that the source   
  85.  WILL NOT BE AVAILABLE for future versions.                 
  86.                                                             
  87.  The source is provided to registered sysops so that it     
  88.  may be modifed to suit their own needs and desires. You    
  89.  may not give out a copy of your modified program to        
  90.  anyone (either the source or compiled).                    
  91.                                                             
  92.  4.1.A  Distribution of Changes to Source Code              
  93.                                                             
  94.  This does not mean, however, that you can't distribute     
  95.  CHANGES.  You may not distribute a copy of WWIV that you   
  96.  have compiled, ever, or any major portions of the source   
  97.  code without expressed permission of Wayne Bell.  If you   
  98.  would like to help another registered sysop modify their   
  99.  code, you must follow these procedures:
  100.  
  101.  One registered WWIV sysop can legally have another regis-  
  102.  tered WWIV sysop install mods for him.  The rules for      
  103.  doing this are:                                            
  104.                                                             
  105.  1. Both the person doing the modding, and the person re-   
  106.     questing it, must be registered WWIV sysops.            
  107.                                                             
  108.       a. This is verified by having both the requester and  
  109.          the modder email WWIVnet 1@1 from their account    
  110.          on an SDS, where they have access to the source    
  111.          code (ie, are on the list).                        
  112.                                                             
  113.       b. The requester and modder must coordinate before-
  114.          hand on when this is to be done.                   
  115.                                                             
  116.       c. The email will say, "I wish to do modding for Joe
  117.          Blow #xxx @yyyy", or "I want Jane blow #zzz @aaaa
  118.          to do some modding for me." where both accounts
  119.          listed (giving name, user-number, and system
  120.          number) are accounts on an SDS, with access to the
  121.          source code.  The two emails must be sent within a
  122.  
  123.  
  124.                             -2-
  125.  
  126.  
  127.  
  128.          week or two of each other.
  129.                                                             
  130.       d. After both emails are received, and registration   
  131.          is verified [actually, registration will have      
  132.          been verified beforehand, due to their having SDS  
  133.          access] then WWIVnet 1@1 will email back to both   
  134.          saying it has been approved.  (Approval here       
  135.          relies only upon registration, and will not be     
  136.          denied if both are listed for SDS access.)         
  137.                                                             
  138.  2. The modder may start out either with the unmodified     
  139.     source code to the latest version of WWIV, or from a    
  140.     version of the source code sent by the requester.       
  141.                                                             
  142.  3. The modder will then make available to the requester the
  143.     modified source code, plus, optionally, a compiled .exe 
  144.     (but may not only give the .exe, must make available the
  145.     modified source also).                                  
  146.                                                             
  147.  4. For purposes of sending source code and/or compiled     
  148.     .exe's in 2 and 3 above, this must be done either       
  149.     directly (eg, call up each other in a term program      
  150.     and xfer it there, or hand deliver it on floppy), or    
  151.     via the BBS of either requester or modder, where the    
  152.     BBS is that system on which that person is account #1,  
  153.     and in that case, only in an xfer directory where only  
  154.     the requester and modder have access (via DAR           
  155.     restriction).  No other remote sysops or co-sysops      
  156.     may have access to that directory.                      
  157.                                                             
  158.  5. Neither Wayne Bell nor WWIV Software Services are
  159.     responsible for enforcing any modding arrangements.  If
  160.     the modder never actually ends up doing it, don't come  
  161.     crying to us.                                           
  162.  
  163.  Note, that this only applies if you must transfer the
  164.  files between systems.  If you wish, you can have someone
  165.  else (registered or not) come over and make mods on your
  166.  system, without any approval from anyone.  That person
  167.  just can't take (WWIV source) files to or from your
  168.  system (without the approval method listed above).
  169.                                                             
  170.  You may also distribute changes (commonly called mod-      
  171.  ifications, or "mods") you made to the source, so that     
  172.  other people with the source may make the same changes.    
  173.                                                             
  174.  For example, suppose you made a modification to function   
  175.  send_email() in bbsovl1.c, and wanted to allow other
  176.  
  177.  
  178.                             -3-
  179.  
  180.  
  181.  
  182.  people to make the same modification.  Now, since
  183.  function send_email() is under 50 lines (rather short),
  184.  you may just go ahead and distribute the entire
  185.  procedure, telling people they need to replace function
  186.  send_email() in bbsovl1.c with your new one.
  187.                                                             
  188.  Suppose, on the other hand, that you have made modifica-   
  189.  tions to function scan() in msgbase1.c.  Since function
  190.  scan() is around 700 lines, it is unlikely you will have
  191.  made modifications to the entire thing.  Most likely, it
  192.  will be just a block of code, maybe 50-75 lines long,
  193.  that contains the bulk of your changes.  Just pull out
  194.  those blocks that you have made changes to, and
  195.  distribute those, along with a short note telling which
  196.  lines to delete, and where to insert your new ones.
  197.                                                             
  198.  4.1.B  Permission to distribute source code changes        
  199.                                                             
  200.  Suppose, instead, that your modification required you to   
  201.  insert 3 new variables, and put in a few lines of code in  
  202.  4 of the source files.  DO NOT JUST DISTRIBUTE ALL THE     
  203.  FILES YOU CHANGED.  Instead, document where you made the   
  204.  changes, and list where to insert (or delete) the few      
  205.  lines of code you did change.  If your modifications       
  206.  would require you to distribute over 100 lines of the      
  207.  initial BBS code, you should contact Wayne Bell (1@1)      
  208.  before you distribute it, sending me a copy, and asking    
  209.  if it's OK.  Most likely it will be.                       
  210.                                                             
  211.  If you have any questions about this policy, or how it     
  212.  might apply to you, feel free to contact Wayne Bell at     
  213.  Amber BBS at 310-798-9993 300/1200/2400/V.32bis/HST/24     
  214.  hrs.                                                       
  215.                                                             
  216.  You may wonder why I have put such restrictions on         
  217.  distribution of changes.  The main reason is the reckless  
  218.  abandon some people have exhibited in just doing whatever  
  219.  they damn well pleased with earlier versions of WWIV.      
  220.  I've heard of people making changes to the code,           
  221.  inserting profanity in comments throughout the program,    
  222.  and distributing that as if it were a perfectly normal
  223.  copy of WWIV.  This is what I want to prevent.             
  224.                                                             
  225.  As long as your changes don't contain a significant        
  226.  portion of the BBS source in them, I will probably have    
  227.  no problems about your distributing them.  But, do check,  
  228.  BEFOREHAND! The old adage that "It is easier to ask for    
  229.  forgiveness than it is permission" does not apply in this
  230.  
  231.  
  232.                             -4-
  233.  
  234.  
  235.  
  236.  case, and you could be liable for legal damages if you do  
  237.  not follow this policy.                                    
  238.                                                             
  239.  Also, any changes that you do distribute, I'd appreciate   
  240.  it if you'd upload a copy to my system, so that there can  
  241.  be a sort of "central area" where people can find things.  
  242.                                                             
  243.  About INIT.EXE.  As you can see, I'm not distributing the  
  244.  source to the init program.  The source to the init        
  245.  program is not available to anyone, nor is the source to   
  246.  the network program available.                             
  247.                                                             
  248.                                                             
  249.  /******************************************************/   
  250.                                                             
  251.  4.2  Compiler versions                                     
  252.                                                             
  253.  There.  Now that I'm through with that, I can get about    
  254.  describing the source a bit.  First, how to set            
  255.  everything up so that it compiles.  WWIV will compile      
  256.  correctly under Turbo C++ v2.0 and later.  It will not
  257.  compile correctly under any other compilers, and it will
  258.  not compile correctly under Microsoft C, or any other C
  259.  compiler.
  260.                                                             
  261.  With overlays, necessary compiler options, RIPDRIVE
  262.  support, and the shrinking features, it would be too
  263.  difficult (if it's even possible at all) to get it to
  264.  compile and link under the Borland IDE.  Therefore, you
  265.  must use the external "make" utility (that comes with the
  266.  compiler) to compile and link WWIV.
  267.                                                             
  268.  First, un-zip the WWIV source archive into a directory of  
  269.  its own.  DO NOT put it in your Turbo C directory.  At
  270.  the very least, make a separate "WWIV" directory
  271.  somewhere, and do development in there.  By putting the
  272.  source files in their own directory like this, you keep
  273.  them separate from all your other files. It makes it much
  274.  easier to manage.
  275.  
  276.  Whatever directory you use, you must create two
  277.  sub-directories off it, "obj" and "exe".  For example,
  278.  you might say:
  279.  
  280.  C:\>mkdir wwiv
  281.  C:\>cd wwiv
  282.  C:\WWIV>pkunzip \telix\dl\wwivs424.zip
  283.  C:\WWIV>mkdir obj
  284.  
  285.  
  286.                             -5-
  287.  
  288.  
  289.  
  290.  C:\WWIV>mkdir exe
  291.  
  292.  (Note you must first extract the wwivs424.zip file from
  293.  the wwiv424s.zip file.  See the license.agr file in
  294.  wwiv424s.zip file for instructions on that.)
  295.  
  296.  The "obj" directory will hold "*.obj" files.  You will
  297.  never need to look at those, but you need to have them.
  298.  Note that there are also .obj files in your WWIV source
  299.  directory.  Leave them there.
  300.                                                             
  301.  Now, whenever you want to re-compile any changed files     
  302.  and re-link the executables, go to the WWIV source         
  303.  directory and type "make".                                 
  304.                                                             
  305.  If everything is set up correctly, the source should       
  306.  compile without any errors or warnings.  If you have any   
  307.  errors or warnings, you have done something wrong.  Go     
  308.  back and check to ensure that you have the directory       
  309.  variables set up correctly.                                
  310.                                                             
  311.  4.2.A  FCNS.H
  312.                                                             
  313.  There is another feature when using make -- it creates
  314.  the fcns.h file based upon your source files. To
  315.  re-create the fcns.h file just type "make fcns".  This is
  316.  what I have used to create it in the first place, so if
  317.  you run it on an unmodified copy of the source, it should
  318.  end up being the same. Additionally, if you add
  319.  additional source files, this will include the prototypes
  320.  from those files also (assuming, of course, that you use
  321.  the same function declaration style that I do - the
  322.  technique of making the function prototypes is pretty
  323.  dumb, but it works).  Note that if you do "make fcns",
  324.  then all your source will re-compile, so I recommend only
  325.  doing a "make fcns" when something significant has
  326.  changed.
  327.                                                             
  328.  /******************************************************/   
  329.                                                             
  330.  4.3  General Comments about the source                     
  331.                                                             
  332.  The rest of this section is to describe some general
  333.  things about the source, and is not meant to describe how  
  334.  to use Turbo C.  If you need help with the TC integrated   
  335.  environment, look through the manual, and play around      
  336.  with it a bit.
  337.  
  338.  
  339.  
  340.                             -7-
  341.  
  342.  
  343.  
  344.  
  345.  4.3.A  Header files:                                       
  346.                                                             
  347.  VARDEC.H - holds the type declarations and #define's for   
  348.             the BBS.                                        
  349.                                                             
  350.  FCNS.H - holds function declarations for all functions in  
  351.           the BBS.                                          
  352.                                                             
  353.  VARS.H - Holds declarations (and externs) for all global   
  354.           variables.                                        
  355.                                                             
  356.  NET.H - holds structure definitions for WWIVnet.
  357.                                                             
  358.  All the BBS files (except bbs.c) have, after the           
  359.  copyright notice, #include "vars.h" #pragma hdrstop        
  360.                                                             
  361.  Any additional source (.c) files you add should include    
  362.  vars.h, and then have the #pragma hdrstop after that (the  
  363.  #pragma is for the BC++ precompiled header files).  Note   
  364.  that vars.h includes several standard C header files, so   
  365.  you won't have to manually include those yourself.         
  366.                                                             
  367.  4.3.B  Main source files:                                  
  368.                                                             
  369.  The source files fall into two categories: overlaid, and
  370.  non-overlaid.  There are two reasons why a file is in the
  371.  non-overlaid category: it cannot be overlaid; it would be
  372.  too slow if it were.  Anything that might be called from
  373.  an external program (screen and com port IO, for example)
  374.  cannot be overlaid.
  375.  
  376.  You will find that some functions end up in strange
  377.  places.  These are mostly rarely-used sysop services that
  378.  get moved to an overlay from their previous location, in
  379.  an attempt at "overlay-balancing."
  380.  
  381.  bbs.c - holds the main() function, and getcaller().
  382.  getcaller() processes WFC commands.
  383.  
  384.  bbsutl*.c - hold miscellaneous BBS utility functions.
  385.  
  386.  com.c - holds com port related services, and combined
  387.  screen/modem IO.
  388.  
  389.  conio.c - holds console related IO services (that is,
  390.  things that display locally but not remotely).
  391.  
  392.  
  393.  
  394.                             -8-
  395.  
  396.  
  397.  
  398.  connect1.c - holds many WWIVnet-related interfacing
  399.  functions.  Most of reading/writing network files is done
  400.  here.
  401.  
  402.  extrn.c - holds code for interfacing with external
  403.  programs, mostly DOS call intercepting.  You will
  404.  probably not want to touch anything here unless you are
  405.  very familiar with low level DOS.
  406.  
  407.  mmenu.c - holds the main menu and main transfer menu.  If
  408.  you add in something that you want to be available from
  409.  the main menu, you'll need to add in a few lines here to
  410.  call it.
  411.  
  412.  modem.c - handles talking to the modem (answering phone,
  413.  etc).
  414.  
  415.  msgbase*.c - the message base code (scan prompt, reading
  416.  msgs, etc).
  417.  
  418.  share.c - handles file sharing for multiple instances.
  419.  ALL FILE IO should be done using the services in share.c
  420.  Use sh_open(), sh_open1(), or fsh_open() to open files.
  421.  Also use the sh_ or fsh_ versions of read, write, and
  422.  close, from here.
  423.  
  424.  strings.c - handles accessing *.STR files, including
  425.  caching.
  426.  
  427.  subacc.c - handles accessing message base data files,
  428.  primarily to resynchronize when they are changed by
  429.  another instance.
  430.  
  431.  utility.c - generic utility functions
  432.  
  433.  xfer.c - most common transfer section commands
  434.  
  435.  lilo.c - handles logging users on and off the system.
  436.  
  437.  netsup.c - holds higher-level WWIVnet services than those
  438.  in connect1.c.
  439.  
  440.  Many others should be obvious by their name: batch.c,
  441.  chnedit.c, conf.c, defaults.c, etc.
  442.                                                             
  443.  4.3.C  Common functions:                                   
  444.                                                             
  445.  char getkey() - waits for, and returns one character of
  446.  
  447.  
  448.                             -9-
  449.  
  450.  
  451.  
  452.  input
  453.  
  454.  void input(char *s, int len) - inputs len characters
  455.  (uppercase only) to string s.
  456.  
  457.  void inputl(char *s, int len) - same as input, but allows  
  458.  lowercase.                                                 
  459.                                                             
  460.  int yn() - returns 1 for yes, 0 for no.  C/R=no            
  461.                                                             
  462.  int ny() - same as yn(), but C/R=yes                       
  463.                                                             
  464.  void ansic(int n) - selects a color (if user supports      
  465.  ANSI).  n is 0 to 7.                                       
  466.                                                             
  467.  char onek(char *s) - pass it a string, and it allows the   
  468.  user to hit one key in the string, which it returns.  ie,  
  469.  you want Delete, Ignore, Retry, so you do onek("DIR"),     
  470.  and it will return D, I, or R.  If the user hangs up, it   
  471.  returns the first character, so if one option is Quit,     
  472.  have the Q first.                                          
  473.                                                             
  474.  void prt(int i, char *s) - selects color i, prints string  
  475.  s, returns to color 0.                                     
  476.                                                             
  477.  void nl() - does a carriage return/line feed - go to new   
  478.  line.                                                      
  479.                                                             
  480.  void npr(char *, ...) - works the same as printf() does,   
  481.  only puts the output to the com port, also.                
  482.                                                             
  483.  void pl(char *s) - prints string s, with a cr/lf on end    
  484.                                                             
  485.  void outstr(char *s) - prints s, no cr/lf on end           
  486.                                                             
  487.  void pla(char *s, int *abort) - prints s, allowing abort.  
  488.  Pass pointer to an integer, if user aborts, *abort will    
  489.  be 1, and output is terminated.  You MUST initialize       
  490.  *abort to zero.                                            
  491.                                                             
  492.  void outs(char *s) - outputs a string, to the screen only  
  493.  (not to remote user).                                      
  494.                                                             
  495.  void tleft(int x) - updates time left display at top of    
  496.  screen.  If x is non-zero, the user will be hung up on if  
  497.  his time is expired.  If x is zero, time display will be   
  498.  updated, but user won't be hung up on.                     
  499.  
  500.  
  501.  
  502.                             -10-
  503.  
  504.  
  505.  
  506.  void topscreen() - updates top of screen info.             
  507.                                                             
  508.  char *mmkey(int n) - inputs data for the main menu.  see   
  509.  odc below.                                                 
  510.  
  511.  void *malloca(unsigned long nbytes) - allocates space,
  512.  does appropriate logging of out of memory errors.
  513.  
  514.  void stuff_in(...) - creates a commandline for an
  515.  external program by "stuffing in" arguments.
  516.  
  517.  int so(void) - returns non-zero if the sysop (sl=255) is
  518.  the current user (or the sysop hit the temp sysop key).
  519.  
  520.  int cs(void) - returns non-zero if a co-sysop is the
  521.  current user (typically, sl>=100, but is settable in the
  522.  SL editor in INIT).
  523.  
  524.  unsigned int finduser(unsigned char *s) - converts a user
  525.  name to a user number.
  526.  
  527.  void sysoplog(char *s) - loggs a message to the sysop's
  528.  log
  529.  
  530.  void dump() - dumps all pending data from the modem.
  531.  
  532.  checkhangup() - checks to see if the remote user has hung
  533.  up.
  534.  
  535.  int printfile() - prints a file from the gfiles directory.
  536.  
  537.  void printmenu(int i) - prints a numbered menu.
  538.  
  539.  char *get_string(int n) - returns string #n from the
  540.  current bbs.str.
  541.  
  542.  int okansi(void) - returns non-zero if ansi graphics is
  543.  currently turned on.
  544.  
  545.  void read_user(unsigned int un, userrec *u) - read's a
  546.  user's information from user.lst
  547.  
  548.  void write_user(unsigned int un, userrec *u) - writes a
  549.  user's information back out to user.lst
  550.  
  551.  unsigned char *nam1(...) - gives a nice description of
  552.  a user ("John Doe #123 @456")
  553.  
  554.  
  555.  
  556.                             -11-
  557.  
  558.  
  559.  
  560.  double nsl(void) - Number of Seconds Left for the user
  561.  for this call.
  562.  
  563.  void changedsl(void) - re-sets-up many tables, when a
  564.  user's SL has changed.
  565.  
  566.  void wait1(long l) - pauses for l ticks (1 tick is 1/18.2
  567.  of a second).
  568.  
  569.  double freek1(char *s) - returns the number of free k on
  570.  the drive where the specified file resides.
  571.  
  572.  int exist(char *s) - non-zero if the named file exists
  573.  (or, with a wildcard, if any file matches).
  574.  
  575.  void giveup_timeslice(void) - gives up a timeslice to the
  576.  current multitasker.  If you are writing code, you should
  577.  call giveup_timeslice() if you find that you hit an idle
  578.  time, to allow other programs to use that time.
  579.  
  580.  void read_status(void) - reads status.dat.  Before
  581.  accessing anything in the "status" global status
  582.  structure, you should call read_status() to make sure the
  583.  info is up-to-date (and hasn't been updated by another
  584.  instance).
  585.  
  586.  void lock_status(void) / void save_status(void) - To
  587.  update status.dat, first call lock_status(), then update
  588.  the field, then call save_status().  Try to avoid
  589.  assuming that the status hasn't changed, unless you've
  590.  protected it by lock_status()/save_status().
  591.  
  592.  int okfn(char *s) - tells you if the filename is "OK."
  593.  That is, someone didn't enter a filename to extract or
  594.  upload that could harm your system.
  595.  
  596.  char *make_abs_cmd(char *out) - Finds where an exectuable
  597.  actually is, and makes the commandline "absolute."  That
  598.  is, if you say "pkunzip \bbs\dloads\misc\asdf.zip *.doc",
  599.  it would resolve that to "c:\dos\util\pkunzip
  600.  \bbs\dloads\misc\asdf.zip *.doc", for security reasons.
  601.  Typically, for an external program, you'll want to call
  602.  stuff_in() with some values, then make_abs_cmd() to make
  603.  sure it's safe.
  604.  
  605.  void dliscan(void) - opens up disk files for the current
  606.  xfer section
  607.  
  608.  
  609.  
  610.                             -12-
  611.  
  612.  
  613.  
  614.  int recno(char *s) / int nrecno(char *s, int i1) -
  615.  searches the xfer database of the current directory for a
  616.  file match.  recno() returns the record number of the
  617.  first match, and nrecno (passed the first or most recent
  618.  match) will find the next one.
  619.  
  620.  void sublist(void) / void dirlist(void) - list out the
  621.  subs (or dirs) available to the current user.
  622.  
  623.  void val_cur_user(void) - is the F1 key user editor
  624.  
  625.  int extern_prog(char *cmdline, unsigned short flags) -
  626.  runs an external program.  The flags are EFLAG_ #defines
  627.  from vardec.h that can be |-d together.
  628.  
  629.  
  630.  4.3.D  global variables:                                   
  631.                                                             
  632.  int using_modem - is non-zero if there is a remote user    
  633.  
  634.  int hangup - is non-zero if the user has hung up.  MUST    
  635.  BE AN EXIT CONDITION FOR ALL LOOPS THAT DO I/O.            
  636.                                                             
  637.  userrec thisuser - holds information about the current     
  638.  user                                                       
  639.                                                             
  640.  int usernum - holds user number of current user            
  641.                                                             
  642.  configrec syscfg - holds system configuration.  SHOULD     
  643.  NOT BE MODIFIED IN PROGRAM.  The data in here should be    
  644.  changed ONLY in init, the main BBS should use this as      
  645.  READ-ONLY.
  646.  
  647.  configoverrec syscfgovr - override information for syscfg
  648.  info.  Used to allow instance-specific settings for such
  649.  things as com port info, etc.
  650.                                                             
  651.  statusrec status - holds current stats information.  See
  652.  lock_status() discussion above for correct access
  653.  mechanism.
  654.                                                             
  655.  char odc[81] - If you want to have an input like the main  
  656.  menu (ie, certain characters mean get a second character,  
  657.  ie, you hit O at main menu, it goes right to that          
  658.  function, hitting / will get another character), set odc   
  659.  to a string containing the characters you wish a second    
  660.  character for, then call mmkey(2) - will return a pointer  
  661.  to a string for the data entered.
  662.  
  663.  
  664.                             -13-
  665.  
  666.  
  667.  
  668.                                                             
  669.  ie, if you want to enter a number 1-19, you have to get a  
  670.  second character if the user hits one, so you'd say:       
  671.                                                             
  672.  char *ss;                                                  
  673.                                                             
  674.  strcpy(odc,"1"); ss=mmkey(2);                              
  675.                                                             
  676.  Then ss can point to a string "1", "5","15","1X",          
  677.  "G","19", etc.                                             
  678.                                                             
  679.  char curspeed[80] - string holding current baud rate in    
  680.  use, can be "KB","300","1200","2400","9600", or "19200",
  681.  or "RIP/14400/V.32/LAPM/V.42bis"
  682.                                                             
  683.  char cdir[81] - the full main BBS directory path.
  684.  
  685.  char *languagedir, *net_data - should be used for finding
  686.  language or net specific data.  These can change while a
  687.  user is logged on.
  688.  
  689.  curdir - current directory, index into udir[].
  690.  cursub - current sub, index into usub[].
  691.  curldir - index into directories[].
  692.  curlsub - index into subboards[].
  693.  usub[]/udir[] - information on currently available
  694.  subs/dirs
  695.  subboards[]/directories[] - information on all subs and
  696.  dirs in the system.
  697.  
  698.  Be sure not to get curdir/curldir or cursub/curlsub
  699.  confused.  They point into different arrays.  You should
  700.  never convert any of the indexes into numbers for display
  701.  to a user.  To display that, look in
  702.  usub/udir[curlsub/curldir].keys.
  703.  
  704.  
  705.  4.4  Contacting the Author
  706.                                                             
  707.  OK, that's all I can think of for now.  Any questions, or  
  708.  comments, please f-back me on my system, 310-798-9993--    
  709.  300/1200/2400/V.32bis/HST/24 hrs.  Anything you think I    
  710.  left out or could expand upon more, tell me, and I'll      
  711.  have that in the next version of the source docs.  If you  
  712.  wish to write me via US mails, write to Wayne Bell care    
  713.  of                                                         
  714.                                                             
  715.  WWIV Software Services
  716.  
  717.  
  718.                             -14-
  719.  
  720.  
  721.  
  722.  PO Box 720455
  723.  McAllen, TX  78504-0455                                    
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.                             -15-
  772.  
  773.