diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-03-15 19:22:15 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2007-03-15 19:22:15 (GMT) |
commit | 9314bb49e09b323f1c889d95448ca5dd0a42cc61 (patch) | |
tree | 72c7e4477ba67281ddc446e8cccad11e1b46e408 /Utilities/cmcurl/amigaos.c | |
parent | f52d37c26f5fd48cc745b85c3233848d7b664368 (diff) | |
download | CMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.zip CMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.tar.gz CMake-9314bb49e09b323f1c889d95448ca5dd0a42cc61.tar.bz2 |
ENH: Update Curl to 7.16.1
Diffstat (limited to 'Utilities/cmcurl/amigaos.c')
-rw-r--r-- | Utilities/cmcurl/amigaos.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/Utilities/cmcurl/amigaos.c b/Utilities/cmcurl/amigaos.c index 16a7d5e..7106f8d 100644 --- a/Utilities/cmcurl/amigaos.c +++ b/Utilities/cmcurl/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,28 +22,53 @@ ***************************************************************************/ #include "amigaos.h" -#include <stdio.h> /* for stderr */ +#include <amitcp/socketbasetags.h> struct Library *SocketBase = NULL; +extern int errno, h_errno; + +#ifdef __libnix__ +#include <stabs.h> +void __request(const char *msg); +#else +# define __request( msg ) Printf( msg "\n\a") +#endif void amiga_cleanup() { - if(SocketBase) + if(SocketBase) { CloseLibrary(SocketBase); - - SocketBase = NULL; + SocketBase = NULL; + } } BOOL amiga_init() { if(!SocketBase) SocketBase = OpenLibrary("bsdsocket.library", 4); - + if(!SocketBase) { - fprintf(stderr, "No TCP/IP Stack running!\n\a"); + __request("No TCP/IP Stack running!"); return FALSE; } - + + if(SocketBaseTags( + SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno, +// SBTM_SETVAL(SBTC_HERRNOLONGPTR), (ULONG) &h_errno, + SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL", + TAG_DONE)) { + + __request("SocketBaseTags ERROR"); + return FALSE; + } + +#ifndef __libnix__ atexit(amiga_cleanup); +#endif + return TRUE; } + +#ifdef __libnix__ +ADD2EXIT(amiga_cleanup,-50); +#endif |