home *** CD-ROM | disk | FTP | other *** search
- # RemoteAccess Structures in 'C'
-
- Though these structures have been ported to 'C' from PASCAL by Sterling
- Moses. This document, though in a different "Language", is still (C)
- Copyright Andrew Milner & Wantree Development, 1993. All rights
- reserved.
-
- # Date: June 1st 1993
-
- Sterling A. Moses
- SilverSoftware
- 1:301/9.0@FidoNet
- 256:4000/0@MXBBSNET
-
- # Date: August 20th 1993
-
- Newest release of 2.00 Structures converted to 'C'. Additions include
- RIP graphics support in the IEMSI sessions. Grammar Fixes, and duplication in
- some parts of the structures. These are now fixed.
-
- -----------------------------------------------------------------------------
-
- These structures are different than any other of the RemoteAccess structures
- that I have ported. They contained many changes, the only safe way to convert
- them was to go LINE-BY-LINE, thus ensuring you would have every change intended
- by the author.
-
- The format of the structures has been changed. I used the "typedef" command on
- all structures and declarations. Doing it this way will allow you to use
- the names more easily, just declare the structure you want as follows
-
- LIMITS limits; Will give you a complete LIMITS structure named limits.
-
- CONFIG configuration; Will give you a complete CONFIG structure named ...
-
- If you are not sure about this, look up "typedef" in your 'C' manual;
-
-
- ----------------------------------------------------------------------------
-
- To decrease the overall size, I used 'byte' and 'word' when refrencing type
- as unsigned int, and unsigned char. They are defined near the beginning of
- the structures as follows:
-
- #define byte unsigned char;
- #define word unsigned int;
-
- -------------------
- String Handling |
- -------------------
-
- In Pascal, when writting a string, the string length is written in the
- first byte of the string, instead of C's null terminator.
- Thus a string 5 characters long (in pascal) would look something
- aken to "\x5FIVES" if read in using C;
-
- To handle this odd convention of writting strings, I intercepted the
- first character of each string (the size) with a one byte (unsigned)
- handle. You will find this handle throughout the structures just before
- each string.
-
- The handle is a simple lower case L (ell) with a number to designate it
- from other handles in the same structure. Look at the following example;
-
- typedef struct {
- byte l1;
- char firstname[35];
- byte l2;
- char lastname[35];
- }NAMES;
-
- NAMES name;
-
- Now, if you were to read a simple pascal file with the above structures,
- you would have the following:
-
- name.l1 = '\x8' or 8;
- name.firstname = "Sterling";
- name.l2 = '\x5' or 5;
- name.lastname = "Moses";
-
- Even though this is a primative language, there is still a way to read
- and display this interesting scheme in C.
-
- printf("Users FirstName: %.*s", name.l1, name.firstname);
-
- What this does is formats the string with the length and then the string
- contents. This way you will not have "overflow" in your printed text;
- If you return to the above example you will see the string contents were
- indeed exactly as big as the length in the byte above it. Not all cases
- are this easy. What you will normally see in structures read in from
- pascal is as follows:
-
- name.l1 = 8; (bleed through)
- name.firstname = "Sterling\x7\43d\v3\x0\x0\x5\x0" Etc...
-
- Thus the format %.*s is needed to weed out all the bogus information and
- print just the length of the actual string and not the bleed through.
-
- ----------
- BOOLEAN |
- ----------
-
- Boolean is another way of saying if it is set to 1 then it is on (true), if
- set to 0 then it is off (false)
-
-
- ------------
- IMPORTANT |
- ------------
-
- While testing these structures, I did notice that you must have the compiler
- switch "TREAT ALL ENUMS AS INT" turned OFF. If you leave it on, you will not
- get correct information through these structures. You must have this
- unchecked in your compiler before using any of the structures that use a type
- ENUM for there declarations. You will find the ENUM declarations at the
- beginning of the structures.
-
- -----------
- SUPPORT |
- -----------
-
- If you have any questions, you can reach me by the following means:
-
- SnailMail: SilverSoftware
- C\O RA Structures
- 1521 San Pablo
- Albuquerque, NM 87116
-
- FIDONET: SilverSoftware
- 1:301/9
- (505)268-8502
-
-
- If for some unknown reason you can not reach me at the above listed
- addresses, you can always recieve help, along with the newest structures from
- the following address:
-
- Jim Dever
- "The Programmers Paragon"
- 1:151/2305
- 1-(919)852-2336
- HST DS