1
0
mirror of https://github.com/adtools/clib2.git synced 2025-12-08 14:59:05 +00:00

- Switched over the startup code and the library itself to use

constructor/destructor functions for initialization and cleanup
  purposes.


git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14882 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
Olaf Barthel
2005-03-11 13:23:18 +00:00
parent 86b7e5c429
commit f289140266
21 changed files with 129 additions and 201 deletions

View File

@@ -1,5 +1,5 @@
/*
* $Id: socket_init_exit.c,v 1.15 2005-03-09 12:06:10 obarthel Exp $
* $Id: socket_init_exit.c,v 1.16 2005-03-11 13:23:18 obarthel Exp $
*
* :ts=4
*
@@ -92,10 +92,8 @@ int h_errno;
/****************************************************************************/
CLIB_DESTRUCTOR(__socket_exit)
SOCKET_DESTRUCTOR(__socket_exit)
{
ENTER();
/* Disable ^C checking. */
if(__SocketBase != NULL)
{
@@ -132,21 +130,16 @@ CLIB_DESTRUCTOR(__socket_exit)
CloseLibrary(__SocketBase);
__SocketBase = NULL;
}
LEAVE();
}
/****************************************************************************/
int
__socket_init(void)
SOCKET_CONSTRUCTOR(__socket_init)
{
struct TagItem tags[5];
int result = ERROR;
BOOL success = FALSE;
LONG status;
ENTER();
PROFILE_OFF();
/* bsdsocket.library V3 is sufficient for all the tasks we
@@ -341,12 +334,14 @@ __socket_init(void)
}
}
result = OK;
success = TRUE;
out:
RETURN(result);
return(result);
if(success)
CONSTRUCTOR_SUCCEED();
else
CONSTRUCTOR_FAIL();
}
/****************************************************************************/