~ubuntu-branches/ubuntu/vivid/curl/vivid

« back to all changes in this revision

Viewing changes to lib/amigaos.c

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Schuldei
  • Date: 2009-04-02 23:35:45 UTC
  • mto: (1.2.1 upstream) (3.2.3 sid)
  • mto: This revision was merged to the branch mainline in revision 38.
  • Revision ID: james.westby@ubuntu.com-20090402233545-geixkwhe3izccjt7
Tags: upstream-7.19.4
ImportĀ upstreamĀ versionĀ 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19
19
 * KIND, either express or implied.
20
20
 *
21
 
 * $Id: amigaos.c,v 1.7 2007-02-28 14:45:48 yangtse Exp $
 
21
 * $Id: amigaos.c,v 1.8 2009-02-27 08:53:10 bagder Exp $
22
22
 ***************************************************************************/
23
23
 
24
24
#ifdef __AMIGA__ /* Any AmigaOS flavour */
33
33
#include <stabs.h>
34
34
void __request(const char *msg);
35
35
#else
36
 
# define __request( msg )       Printf( msg "\n\a")
 
36
# define __request( msg )       Printf( msg "\n\a")
37
37
#endif
38
38
 
39
39
void amiga_cleanup()
40
40
{
41
 
        if(SocketBase) {
42
 
                CloseLibrary(SocketBase);
43
 
                SocketBase = NULL;
44
 
        }
 
41
  if(SocketBase) {
 
42
    CloseLibrary(SocketBase);
 
43
    SocketBase = NULL;
 
44
  }
45
45
}
46
46
 
47
47
BOOL amiga_init()
48
48
{
49
 
        if(!SocketBase)
50
 
                SocketBase = OpenLibrary("bsdsocket.library", 4);
51
 
        
52
 
        if(!SocketBase) {
53
 
                __request("No TCP/IP Stack running!");
54
 
                return FALSE;
55
 
        }
56
 
        
57
 
        if(SocketBaseTags(
58
 
                SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
59
 
//              SBTM_SETVAL(SBTC_HERRNOLONGPTR),           (ULONG) &h_errno,
60
 
                SBTM_SETVAL(SBTC_LOGTAGPTR),               (ULONG) "cURL",
61
 
        TAG_DONE)) {
62
 
                
63
 
                __request("SocketBaseTags ERROR");
64
 
                return FALSE;
65
 
        }
66
 
        
 
49
  if(!SocketBase)
 
50
    SocketBase = OpenLibrary("bsdsocket.library", 4);
 
51
 
 
52
  if(!SocketBase) {
 
53
    __request("No TCP/IP Stack running!");
 
54
    return FALSE;
 
55
  }
 
56
 
 
57
  if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno,
 
58
                    SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL",
 
59
                    TAG_DONE)) {
 
60
    __request("SocketBaseTags ERROR");
 
61
    return FALSE;
 
62
  }
 
63
 
67
64
#ifndef __libnix__
68
 
        atexit(amiga_cleanup);
 
65
  atexit(amiga_cleanup);
69
66
#endif
70
 
        
71
 
        return TRUE;
 
67
 
 
68
  return TRUE;
72
69
}
73
70
 
74
71
#ifdef __libnix__