You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.0 KiB
78 lines
2.0 KiB
16 years ago
|
/***************************************************************************
|
||
|
* _ _ ____ _
|
||
|
* Project ___| | | | _ \| |
|
||
|
* / __| | | | |_) | |
|
||
|
* | (__| |_| | _ <| |___
|
||
|
* \___|\___/|_| \_\_____|
|
||
|
*
|
||
10 years ago
|
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||
16 years ago
|
*
|
||
|
* This software is licensed as described in the file COPYING, which
|
||
|
* you should have received as part of this distribution. The terms
|
||
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
||
|
*
|
||
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
||
|
* copies of the Software, and permit persons to whom the Software is
|
||
|
* furnished to do so, under the terms of the COPYING file.
|
||
|
*
|
||
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||
|
* KIND, either express or implied.
|
||
|
*
|
||
|
***************************************************************************/
|
||
|
|
||
10 years ago
|
#include "curl_setup.h"
|
||
|
|
||
|
#if defined(__AMIGA__) && !defined(__ixemul__)
|
||
|
|
||
16 years ago
|
#include <amitcp/socketbasetags.h>
|
||
|
|
||
10 years ago
|
#include "amigaos.h"
|
||
|
|
||
16 years ago
|
struct Library *SocketBase = NULL;
|
||
|
extern int errno, h_errno;
|
||
|
|
||
|
#ifdef __libnix__
|
||
|
#include <stabs.h>
|
||
|
void __request(const char *msg);
|
||
|
#else
|
||
10 years ago
|
# define __request( msg ) Printf( msg "\n\a")
|
||
16 years ago
|
#endif
|
||
|
|
||
10 years ago
|
void Curl_amiga_cleanup()
|
||
16 years ago
|
{
|
||
|
if(SocketBase) {
|
||
|
CloseLibrary(SocketBase);
|
||
|
SocketBase = NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
10 years ago
|
bool Curl_amiga_init()
|
||
16 years ago
|
{
|
||
|
if(!SocketBase)
|
||
|
SocketBase = OpenLibrary("bsdsocket.library", 4);
|
||
10 years ago
|
|
||
16 years ago
|
if(!SocketBase) {
|
||
|
__request("No TCP/IP Stack running!");
|
||
|
return FALSE;
|
||
|
}
|
||
10 years ago
|
|
||
|
if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
|
||
|
SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL",
|
||
|
TAG_DONE)) {
|
||
16 years ago
|
__request("SocketBaseTags ERROR");
|
||
|
return FALSE;
|
||
|
}
|
||
10 years ago
|
|
||
16 years ago
|
#ifndef __libnix__
|
||
10 years ago
|
atexit(Curl_amiga_cleanup);
|
||
16 years ago
|
#endif
|
||
10 years ago
|
|
||
16 years ago
|
return TRUE;
|
||
|
}
|
||
|
|
||
|
#ifdef __libnix__
|
||
10 years ago
|
ADD2EXIT(Curl_amiga_cleanup,-50);
|
||
16 years ago
|
#endif
|
||
10 years ago
|
|
||
|
#endif /* __AMIGA__ && ! __ixemul__ */
|