home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / osi / isode / vmsisode / vmsisode80_tar.Z / vmsisode80_tar / sockit / source / readme < prev    next >
Encoding:
Text File  |  1991-08-22  |  6.7 KB  |  157 lines

  1. ****************************************************************************
  2. These routines will compile with either the gcc compiler or the vaxc
  3. compiler. set a logical CCOMPILER to either CC or GCC to determine which
  4. one is used.
  5.  
  6. The compiler now defaults to GCC, (because isode demands it). The
  7. sockit library can be compiled with the cc compiler if necessary
  8. (for debugging)
  9. ****************************************************************************
  10.  
  11. See also SOCKIT_ROOT:[000000]README
  12.  
  13. The unix library - tries to translate unix system calls to VMS routines.
  14.  
  15. Based initially on a desire to write a socket/qio interface, the library
  16. has grown to include quite a few of the routines available to unix programs
  17. but not included in the standard c run time library.
  18.  
  19. Some routines do nothing at all - but pretend they've worked.
  20. Some perhaps pretend they've failed.
  21. Others emulate the call correctly.
  22. Others emulate parts of the call correctly.
  23. Others perform a reasonable alternative to the call.
  24. (Look at the source code if you want to find out what it REALLY does)
  25.  
  26. ****************************************************************************
  27. Use the shared image version of the c run time library - sys$share:vaxcrtl.exe
  28.  
  29. To build a program with the unix library socket interface you will need the
  30. following defines:
  31.  
  32. $ define sockit_root/trans=conc h:[kay.unix.]  /* unix directory */
  33. $ define unixlib sockit_root:[lib]unixlib /* if unixlib is not in sys$share */
  34.  
  35. for the vax c compiler:
  36.  
  37. $ define sys sockit_root:[include.sys],sys$library /* needed for #includes */
  38. $ define arpa sockit_root:[include.arpa]
  39. $ define net sockit_root:[include.net]
  40. $ define netinet sockit_root:[include.netinet]
  41. $ define netx25 sockit_root:[include.netx25]
  42. $ define sundev sockit_root:[include.sundev]
  43.  
  44. $ define vaxc$include sockit_root:[include],sys$library  /* needed for compiler */
  45. $ define c$include [-.include],[-.h]
  46.  
  47.  
  48. Also the following directories should exist:
  49. tmp: - used by popen to write temporary files
  50. etc: - used by tcp/ip and isode to look for configuration files
  51.        this should typically contain files such as HOSTS and SERVICES etc.
  52.  
  53. *********************************************************************
  54. To use the unix library to build anther program you should do the following:
  55.  
  56. define the above logicals
  57.  
  58. put #include <fiddle.h> at the beginning of each source file
  59.  
  60. compile the output-file
  61. $ cc output-file
  62.  
  63. link the program
  64. $ link output-file,opt/opt
  65. in the opt.opt file include the following library
  66. sockit_root:[lib]unixlib.exe/share
  67.  
  68. *********************************************************************
  69. If you want to create shareable image libraries - read the linker manual!
  70. *********************************************************************
  71.  
  72. NB! - some programs may port without any changes being made at all!
  73.     - others may still need a few changes and thought
  74.  
  75. *********************************************************************
  76. Some obvious problems:
  77. watch out for byte ordering problems...
  78.     port = 517; is not going to work on the VAX it should be
  79.     port = htons(517);
  80.  
  81. watch out for alignment problems!
  82.     struct {
  83.     char c;
  84.     int  i;
  85.     }
  86.     i will be aligned on a SUN so the size of the struct is 4
  87.     i will not be aligned on a VAX so its size there will be 3!
  88.  
  89. printf("%*.*s",0,0,NULL) produces a access violation on VMS but not UNIX
  90.  
  91. include files:
  92.    #include "stdio.h" - these have to be changed to #include <stdio.h>
  93. other tricky include files may be ok if you use the c$include_root logical
  94.  
  95.  
  96. *********************************************************************
  97. Here is a list of all the entry points supported in the library:
  98.  
  99. accept        alarm       bcmp       bcopy       bind       bzero
  100. chroot        close       closedir   closelog    connect    crypt
  101. dbmclose      dbminit     endgrent   endpwent    exit       fchmod
  102. fchown        fclose      fcntl      fdopen      fetch      fflush
  103. fgets         firstkey    fixargv    flock       fork       fprintf
  104. fputc         fsync       ftruncate  getdechostname         getdtablesize
  105. getgrent      getgrgid    getgrnam   gethostbyaddr          gethostbyname
  106. gethostname   getitimer   getlogin   getnc       getopt     getpagesize
  107. getpass       getpwent    getpwnam   getpwuid    getservbyname
  108. getservbyport getsockname getsockopt gettimeofday           getusertty
  109. gmtime        gtty        htonl      htons       index      inet_addr
  110. inet_ntoa     initgroups  insque     ioctl       link       listen
  111. nextkey       ntohl       ntohs      opendir     openlog    pclose
  112. popen         read        readdir    recv        recvfrom   remque
  113. rewind        rindex      rmdir      select      send       sendmsgtty
  114. sendmsguser   sendto      set_echo   set_noecho  seteuid    setgid
  115. setgrent      setitimer   setlogmask setpwent    setruid    setsockopt
  116. setuid        shutdown    signal     sigvec      socket     store
  117. stty          sys         syscall    syslog      tempnam    truncate
  118. unlink        utime       wait3      write       writev     xdelete
  119.  
  120. ****************************************************************************
  121.  
  122. Some obviuos problems !
  123.  
  124. ****************************************************************************
  125. The dbm routine delete conflicts with an internel compiler routine?
  126. So it has to be caled xdelete instead.
  127. The dbm database has maximum sizes for key and contents. At present they
  128. are 64bytes key 1024bytes content.
  129. A file dbmfile.DIR can quite easily be generated by unix programs using dbm.
  130. It is not of course a directory! even though it superficially looks like one.
  131. ****************************************************************************
  132. Fork will never work!
  133. It will print out a message that it has been called and then pretend to
  134. be the child process.
  135. ****************************************************************************
  136. Popen and Pclose do a reasonable job. Of course the command in the text
  137. string will not necessarily exist under VMS. They create and use a file
  138. in the are tmp:si_12345.dat
  139. ****************************************************************************
  140. Errno - sometimes it set correctly more often than not it isn't. Errors
  141. will of course return -1 as the function value.
  142. ****************************************************************************
  143. Select - will work with stdin! but you can't read stdin afterwards with
  144. normal i/o. You must use the routine getnc to get the characters.
  145.  
  146. int getnc(s,i)
  147. char *s;
  148. int i;
  149.  
  150. i is the maximum number of characters to be read.
  151. The getnc returns the actual number of characters read.
  152. ****************************************************************************
  153. Link/unlink - link just renames the file, unlink deletes it!
  154. ****************************************************************************
  155.  
  156. LOOK AT THE SOURCE CODE TO CHECK WHAT A ROUTINE DOES
  157.