home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RAST200.ZIP / README.1ST < prev   
Encoding:
Text File  |  1993-08-20  |  4.9 KB  |  144 lines

  1. # RemoteAccess Structures in 'C'
  2.  
  3.      Though these structures have been ported to 'C' from PASCAL by Sterling
  4.      Moses. This document, though in a different "Language", is still (C)
  5.      Copyright Andrew Milner & Wantree Development, 1993. All rights
  6.      reserved.
  7.  
  8. # Date: June 1st 1993
  9.  
  10. Sterling A. Moses
  11. SilverSoftware
  12. 1:301/9.0@FidoNet
  13. 256:4000/0@MXBBSNET
  14.  
  15. # Date: August 20th 1993
  16.  
  17. Newest release of 2.00 Structures converted to 'C'. Additions include
  18. RIP graphics support in the IEMSI sessions. Grammar Fixes, and duplication in
  19. some parts of the structures. These are now fixed.
  20.  
  21. -----------------------------------------------------------------------------
  22.  
  23. These structures are different than any other of the RemoteAccess structures
  24. that I have ported. They contained many changes, the only safe way to convert
  25. them was to go LINE-BY-LINE, thus ensuring you would have every change intended
  26. by the author.
  27.  
  28. The format of the structures has been changed. I used the "typedef" command on
  29. all structures and declarations. Doing it this way will allow you to use
  30. the names more easily, just declare the structure you want as follows
  31.  
  32.      LIMITS limits;   Will give you a complete LIMITS structure named limits.
  33.  
  34.      CONFIG configuration; Will give you a complete CONFIG structure named ...
  35.  
  36. If you are not sure about this, look up "typedef" in your 'C' manual;
  37.  
  38.  
  39. ----------------------------------------------------------------------------
  40.  
  41. To decrease the overall size, I used 'byte' and 'word' when refrencing type
  42. as unsigned int, and unsigned char. They are defined near the beginning of
  43. the structures as follows:
  44.  
  45. #define byte     unsigned char;
  46. #define word     unsigned int;
  47.  
  48. -------------------
  49. String Handling   |
  50. -------------------
  51.  
  52.      In Pascal, when writting a string, the string length is written in the
  53.      first byte of the string, instead of C's null terminator.
  54.      Thus a string 5 characters long (in pascal) would look something
  55.      aken to "\x5FIVES" if read in using C;
  56.  
  57.      To handle this odd convention of writting strings, I intercepted the
  58.      first character of each string (the size) with a one byte (unsigned)
  59.      handle. You will find this handle throughout the structures just before
  60.      each string.
  61.  
  62.      The handle is a simple lower case L (ell) with a number to designate it
  63.      from other handles in the same structure. Look at the following example;
  64.  
  65. typedef struct {
  66.         byte   l1;
  67.         char   firstname[35];
  68.         byte   l2;
  69.         char   lastname[35];
  70.         }NAMES;
  71.  
  72. NAMES name;
  73.  
  74.      Now, if you were to read a simple pascal file with the above structures,
  75.      you would have the following:
  76.  
  77.      name.l1 = '\x8' or 8;
  78.      name.firstname = "Sterling";
  79.      name.l2 = '\x5' or 5;
  80.      name.lastname = "Moses";
  81.  
  82.      Even though this is a primative language, there is still a way to read
  83.      and display this interesting scheme in C.
  84.  
  85.             printf("Users FirstName: %.*s", name.l1, name.firstname);
  86.  
  87.      What this does is formats the string with the length and then the string
  88.      contents. This way you will not have "overflow" in your printed text;
  89.      If you return to the above example you will see the string contents were
  90.      indeed exactly as big as the length in the byte above it. Not all cases
  91.      are this easy. What you will normally see in structures read in from
  92.      pascal is as follows:
  93.  
  94.      name.l1 = 8;                  (bleed through)
  95.      name.firstname = "Sterling\x7\43d\v3\x0\x0\x5\x0" Etc...
  96.  
  97.      Thus the format %.*s is needed to weed out all the bogus information and
  98.      print just the length of the actual string and not the bleed through.
  99.  
  100. ----------
  101. BOOLEAN  |
  102. ----------
  103.  
  104. Boolean is another way of saying if it is set to 1 then it is on (true), if
  105. set to 0 then it is off (false)
  106.  
  107.  
  108. ------------
  109. IMPORTANT  |
  110. ------------
  111.  
  112. While testing these structures, I did notice that you must have the compiler
  113. switch "TREAT ALL ENUMS AS INT" turned OFF. If you leave it on, you will not
  114. get correct information through these structures. You must have this
  115. unchecked in your compiler before using any of the structures that use a type
  116. ENUM for there declarations. You will find the ENUM declarations at the
  117. beginning of the structures.
  118.  
  119. -----------
  120. SUPPORT   |
  121. -----------
  122.  
  123. If you have any questions, you can reach me by the following means:
  124.  
  125. SnailMail:             SilverSoftware
  126.                        C\O RA Structures
  127.                        1521 San Pablo
  128.                        Albuquerque, NM  87116
  129.  
  130. FIDONET:               SilverSoftware
  131.                        1:301/9
  132.                        (505)268-8502
  133.  
  134.  
  135. If for some unknown reason you can not reach me at the above listed
  136. addresses, you can always recieve help, along with the newest structures from
  137. the following address:
  138.  
  139. Jim Dever
  140. "The Programmers Paragon"
  141. 1:151/2305
  142. 1-(919)852-2336
  143. HST DS
  144.