home *** CD-ROM | disk | FTP | other *** search
- ****************************************************************************
- These routines will compile with either the gcc compiler or the vaxc
- compiler. set a logical CCOMPILER to either CC or GCC to determine which
- one is used.
-
- The compiler now defaults to GCC, (because isode demands it). The
- sockit library can be compiled with the cc compiler if necessary
- (for debugging)
- ****************************************************************************
-
- See also SOCKIT_ROOT:[000000]README
-
- The unix library - tries to translate unix system calls to VMS routines.
-
- Based initially on a desire to write a socket/qio interface, the library
- has grown to include quite a few of the routines available to unix programs
- but not included in the standard c run time library.
-
- Some routines do nothing at all - but pretend they've worked.
- Some perhaps pretend they've failed.
- Others emulate the call correctly.
- Others emulate parts of the call correctly.
- Others perform a reasonable alternative to the call.
- (Look at the source code if you want to find out what it REALLY does)
-
- ****************************************************************************
- Use the shared image version of the c run time library - sys$share:vaxcrtl.exe
-
- To build a program with the unix library socket interface you will need the
- following defines:
-
- $ define sockit_root/trans=conc h:[kay.unix.] /* unix directory */
- $ define unixlib sockit_root:[lib]unixlib /* if unixlib is not in sys$share */
-
- for the vax c compiler:
-
- $ define sys sockit_root:[include.sys],sys$library /* needed for #includes */
- $ define arpa sockit_root:[include.arpa]
- $ define net sockit_root:[include.net]
- $ define netinet sockit_root:[include.netinet]
- $ define netx25 sockit_root:[include.netx25]
- $ define sundev sockit_root:[include.sundev]
-
- $ define vaxc$include sockit_root:[include],sys$library /* needed for compiler */
- $ define c$include [-.include],[-.h]
-
-
- Also the following directories should exist:
- tmp: - used by popen to write temporary files
- etc: - used by tcp/ip and isode to look for configuration files
- this should typically contain files such as HOSTS and SERVICES etc.
-
- *********************************************************************
- To use the unix library to build anther program you should do the following:
-
- define the above logicals
-
- put #include <fiddle.h> at the beginning of each source file
-
- compile the output-file
- $ cc output-file
-
- link the program
- $ link output-file,opt/opt
- in the opt.opt file include the following library
- sockit_root:[lib]unixlib.exe/share
-
- *********************************************************************
- If you want to create shareable image libraries - read the linker manual!
- *********************************************************************
-
- NB! - some programs may port without any changes being made at all!
- - others may still need a few changes and thought
-
- *********************************************************************
- Some obvious problems:
- watch out for byte ordering problems...
- port = 517; is not going to work on the VAX it should be
- port = htons(517);
-
- watch out for alignment problems!
- struct {
- char c;
- int i;
- }
- i will be aligned on a SUN so the size of the struct is 4
- i will not be aligned on a VAX so its size there will be 3!
-
- printf("%*.*s",0,0,NULL) produces a access violation on VMS but not UNIX
-
- include files:
- #include "stdio.h" - these have to be changed to #include <stdio.h>
- other tricky include files may be ok if you use the c$include_root logical
-
-
- *********************************************************************
- Here is a list of all the entry points supported in the library:
-
- accept alarm bcmp bcopy bind bzero
- chroot close closedir closelog connect crypt
- dbmclose dbminit endgrent endpwent exit fchmod
- fchown fclose fcntl fdopen fetch fflush
- fgets firstkey fixargv flock fork fprintf
- fputc fsync ftruncate getdechostname getdtablesize
- getgrent getgrgid getgrnam gethostbyaddr gethostbyname
- gethostname getitimer getlogin getnc getopt getpagesize
- getpass getpwent getpwnam getpwuid getservbyname
- getservbyport getsockname getsockopt gettimeofday getusertty
- gmtime gtty htonl htons index inet_addr
- inet_ntoa initgroups insque ioctl link listen
- nextkey ntohl ntohs opendir openlog pclose
- popen read readdir recv recvfrom remque
- rewind rindex rmdir select send sendmsgtty
- sendmsguser sendto set_echo set_noecho seteuid setgid
- setgrent setitimer setlogmask setpwent setruid setsockopt
- setuid shutdown signal sigvec socket store
- stty sys syscall syslog tempnam truncate
- unlink utime wait3 write writev xdelete
-
- ****************************************************************************
-
- Some obviuos problems !
-
- ****************************************************************************
- The dbm routine delete conflicts with an internel compiler routine?
- So it has to be caled xdelete instead.
- The dbm database has maximum sizes for key and contents. At present they
- are 64bytes key 1024bytes content.
- A file dbmfile.DIR can quite easily be generated by unix programs using dbm.
- It is not of course a directory! even though it superficially looks like one.
- ****************************************************************************
- Fork will never work!
- It will print out a message that it has been called and then pretend to
- be the child process.
- ****************************************************************************
- Popen and Pclose do a reasonable job. Of course the command in the text
- string will not necessarily exist under VMS. They create and use a file
- in the are tmp:si_12345.dat
- ****************************************************************************
- Errno - sometimes it set correctly more often than not it isn't. Errors
- will of course return -1 as the function value.
- ****************************************************************************
- Select - will work with stdin! but you can't read stdin afterwards with
- normal i/o. You must use the routine getnc to get the characters.
-
- int getnc(s,i)
- char *s;
- int i;
-
- i is the maximum number of characters to be read.
- The getnc returns the actual number of characters read.
- ****************************************************************************
- Link/unlink - link just renames the file, unlink deletes it!
- ****************************************************************************
-
- LOOK AT THE SOURCE CODE TO CHECK WHAT A ROUTINE DOES
-