home *** CD-ROM | disk | FTP | other *** search
- void __regargs __autoopenfail(char *);
-
- #include <proto/exec.h>
- #include <ss/socket.h>
-
- struct Library *SockBase;
- static void *libbase;
-
- extern int errno;
-
- int __stdargs _STI_opensock(void)
- {
- SockBase = libbase = (void *)OpenLibrary("inet:libs/socket.library", 6);
- if (SockBase == NULL)
- {
- __autoopenfail("inet:libs/socket.library");
- return 1;
- }
- setup_sockets(FD_SETSIZE, &errno);
- return 0;
- }
-
- void __stdargs _STD_closesock(void)
- {
- if (libbase)
- {
- cleanup_sockets();
- CloseLibrary(libbase);
- libbase = SockBase = NULL;
- }
- }
-