home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 193_01 / deff4.txt < prev    next >
Text File  |  1985-11-14  |  4KB  |  122 lines

  1.                         DEFF4.TXT
  2.                         ---------
  3.  
  4.          I have given, below, a description of each of the functions
  5.          which I have written for the file -
  6.  
  7.                    DEFF4.C
  8.  
  9.          and which may be accessed through -
  10.  
  11.                    DEFF4(.CRL)
  12.  
  13.          when you use the CLINK function with BDS C.   It is
  14.          necessary to specify "DEFF4" on the command line when using
  15.          the included functions.   If you put it first, say -
  16.  
  17.                    clink filename deff4 {other options} <RETURN>
  18.  
  19.          then you will always get the DEFF4 functions included in the
  20.          COM file in preference to any other functions of the same name
  21.          which might be elsewhere in your files.
  22.  
  23.          If you intend to use DEFF4 in this way then it should be on
  24.          the same disk as the BDS C DEFF files.   Now, the functions
  25.          I have written and what they do are -
  26.  
  27.  
  28.          ENTAB(n)
  29.          int n;
  30.          ------
  31.  
  32.          This can only be used when the position "n" along the line
  33.          (generally of up to 80 characters and ALWAYS terminated with
  34.          the RETURN character) is known.   So you have to maintain
  35.          (external to this function) a count of where you are along
  36.          the line, and pass this value to TAB.
  37.  
  38.          TAB will then expand any "tab" characters ( = 0x09) into the
  39.          correct number of spaces, so long as you are using a tab
  40.          which is set to 8 spaces.   If you want to change this to any
  41.          other tab spacing, then go into DEFF4 and change the equate.
  42.  
  43.          Note particularly this was written for use with printers
  44.          which don't recognise the tab character.   I believe a lot
  45.          of the older printers are of this type.
  46.  
  47.          LISTD(i)
  48.          int i;
  49.          --------
  50.  
  51.          Will print an integer as a decimal number on the list device
  52.          which is typically the line printer.
  53.  
  54.  
  55.          LISTS(str)
  56.          char *str;
  57.          ----------
  58.  
  59.          Will list a null-terminated string on the list device which is
  60.          typically the line printer.
  61.  
  62.          
  63.          LOWER_STR(str)
  64.          char *str;
  65.          --------------
  66.  
  67.          Will convert a null-terminated string, in place, to lower
  68.          case characters.
  69.  
  70.  
  71.          MAKE_FCB(name, fcb)
  72.          char name[15], fcb[36];
  73.          ------------------------
  74.  
  75.          Will create a CP/M file control block with the file name
  76.          correctly parsed for use with other functions such as
  77.          OPEN_FILE, CREATE_FILE, etc which are to be found in DEFF3.
  78.  
  79.          Note:     I didn't do anything to set the drive code (which is
  80.          ----      character fcb[0], so this will be zero unless you
  81.                    specifically set it to something after using the
  82.                    "make_fcb" function.   It is easy enough to include
  83.                    the drive specifier in the function, if you wish to
  84.                    do this yourself as an exercise.
  85.  
  86.  
  87.          PEC_CLEAR()
  88.          -----------
  89.  
  90.          Clears the terminal screen without having to know the special
  91.          terminal functions.   Note does NOT home the cursor.
  92.  
  93.  
  94.          SET_BIT(fcb, mode)
  95.          char fcb[36], mode[3];
  96.          ---------------------
  97.  
  98.          This is the function used in BACKUP to change the attribute
  99.          bits in the name given in the file control block.   Mode has
  100.          to be one of -
  101.  
  102.               R/O       Read Only
  103.               R/W       Read/Write
  104.               DIR       Appears in directory when listed
  105.               SYS       Doesn't appear in directory
  106.               ARC       Has already been archived by BACKUP
  107.               CPY       Not yet archived
  108.  
  109.  
  110.          UP-STR(str)
  111.          char *str;
  112.          -----------
  113.  
  114.          Will convert a null-terminated string to upper case ASCII
  115.          characters, in place.
  116.          ce
  117.          which is typically the line printer.
  118.  
  119.  
  120.          LISTS(str)
  121.          char *str;
  122.          ----------