From 6c56340e1ab7c7fc0e98be2b074a38040ab4777e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 10 Dec 2003 13:53:35 +0000 Subject: native AmigaOS support by Diego Casorran --- lib/amigaos.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 lib/amigaos.c (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c new file mode 100644 index 000000000..55f393198 --- /dev/null +++ b/lib/amigaos.c @@ -0,0 +1,49 @@ +/*************************************************************************** + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * + * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * + * 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. + * + * $Id$ + ***************************************************************************/ + +#include "amigaos.h" +#include /* for stderr */ + +struct Library *SocketBase = NULL; + +void amiga_cleanup() +{ + if(SocketBase) + CloseLibrary(SocketBase); + + SocketBase = NULL; +} + +BOOL amiga_init() +{ + if(!SocketBase) + SocketBase = OpenLibrary("bsdsocket.library", 4); + + if(!SocketBase) { + fprintf(stderr, "No TCP/IP Stack running!\n\a"); + return FALSE; + } + + atexit(amiga_cleanup); + return TRUE; +} -- cgit v1.2.1 From 053f6c85efd0bf698f73343989474d672d0563a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 7 Jan 2004 09:19:33 +0000 Subject: updated year in the copyright string --- lib/amigaos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 55f393198..d81384618 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2003, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 39af394a1c3ae1d8ac71ad263a7c524988702c2e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 6 Oct 2004 07:50:18 +0000 Subject: removed tabs and trailing whitespace from source --- lib/amigaos.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index d81384618..13336ce05 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -30,7 +30,7 @@ void amiga_cleanup() { if(SocketBase) CloseLibrary(SocketBase); - + SocketBase = NULL; } @@ -38,12 +38,12 @@ BOOL amiga_init() { if(!SocketBase) SocketBase = OpenLibrary("bsdsocket.library", 4); - + if(!SocketBase) { fprintf(stderr, "No TCP/IP Stack running!\n\a"); return FALSE; } - + atexit(amiga_cleanup); return TRUE; } -- cgit v1.2.1 From 16bbd13af7244cc0967d9f12327f63ffcaeac4bd Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 13 Jul 2005 18:06:40 +0000 Subject: Diego Casorran patches to make (lib)curl build fine on Amiga again --- lib/amigaos.c | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 13336ce05..95442a533 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -22,28 +22,53 @@ ***************************************************************************/ #include "amigaos.h" -#include /* for stderr */ +#include struct Library *SocketBase = NULL; +extern int errno, h_errno; + +#ifdef __libnix__ +#include +void __request(const char *msg); +#else +# define __request( msg ) Printf( msg "\n\a") +#endif void amiga_cleanup() { - if(SocketBase) - CloseLibrary(SocketBase); - - SocketBase = NULL; + if(SocketBase) { + CloseLibrary(SocketBase); + SocketBase = NULL; + } } BOOL amiga_init() { - if(!SocketBase) - SocketBase = OpenLibrary("bsdsocket.library", 4); - - if(!SocketBase) { - fprintf(stderr, "No TCP/IP Stack running!\n\a"); - return FALSE; - } - - atexit(amiga_cleanup); - return TRUE; + if(!SocketBase) + SocketBase = OpenLibrary("bsdsocket.library", 4); + + if(!SocketBase) { + __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 -- cgit v1.2.1 From bda1e9aeab019d003036a3ec24193605bc191b3a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 9 Jan 2006 13:17:14 +0000 Subject: Made the copyright year match the latest modification's year. --- lib/amigaos.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 95442a533..e26119bd8 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2004, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms -- cgit v1.2.1 From 99dcd33f048598f209ea430b8d9f88bc7bb2bce9 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 28 Feb 2007 05:15:56 +0000 Subject: protect from themselves those who need it --- lib/amigaos.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index e26119bd8..2427077a2 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2005, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,6 +21,8 @@ * $Id$ ***************************************************************************/ +#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(_WIN32_WCE) + #include "amigaos.h" #include @@ -72,3 +74,5 @@ BOOL amiga_init() #ifdef __libnix__ ADD2EXIT(amiga_cleanup,-50); #endif + +#endif /* Not for Windows */ -- cgit v1.2.1 From be8a5d0aef8eef4236d7cd6ce2cd7eabf74006f4 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Wed, 28 Feb 2007 14:45:48 +0000 Subject: proper symbol definition check for all AmigaOS flavours --- lib/amigaos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 2427077a2..64696e848 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -21,7 +21,7 @@ * $Id$ ***************************************************************************/ -#if !defined(WIN32) && !defined(_WIN32) && !defined(__WIN32__) && !defined(_WIN32_WCE) +#ifdef __AMIGA__ /* Any AmigaOS flavour */ #include "amigaos.h" #include @@ -75,4 +75,4 @@ BOOL amiga_init() ADD2EXIT(amiga_cleanup,-50); #endif -#endif /* Not for Windows */ +#endif /* __AMIGA__ */ -- cgit v1.2.1 From 794b4da840852ef7ad6c25ac3f6b1e2f8284dbc3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 27 Feb 2009 08:53:10 +0000 Subject: Indentation fixes, untabify and related whitespace-cleanup. No code changed. --- lib/amigaos.c | 49 +++++++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 26 deletions(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 64696e848..c7438a4eb 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -33,42 +33,39 @@ extern int errno, h_errno; #include void __request(const char *msg); #else -# define __request( msg ) Printf( msg "\n\a") +# define __request( msg ) Printf( msg "\n\a") #endif void amiga_cleanup() { - if(SocketBase) { - CloseLibrary(SocketBase); - SocketBase = NULL; - } + if(SocketBase) { + CloseLibrary(SocketBase); + SocketBase = NULL; + } } BOOL amiga_init() { - if(!SocketBase) - SocketBase = OpenLibrary("bsdsocket.library", 4); - - if(!SocketBase) { - __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; - } - + if(!SocketBase) + SocketBase = OpenLibrary("bsdsocket.library", 4); + + if(!SocketBase) { + __request("No TCP/IP Stack running!"); + return FALSE; + } + + if(SocketBaseTags(SBTM_SETVAL(SBTC_ERRNOPTR(sizeof(errno))), (ULONG) &errno, + SBTM_SETVAL(SBTC_LOGTAGPTR), (ULONG) "cURL", + TAG_DONE)) { + __request("SocketBaseTags ERROR"); + return FALSE; + } + #ifndef __libnix__ - atexit(amiga_cleanup); + atexit(amiga_cleanup); #endif - - return TRUE; + + return TRUE; } #ifdef __libnix__ -- cgit v1.2.1 From b2f430898053258622eebee3328f03441367a32c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 27 Oct 2009 16:38:42 +0000 Subject: Fix Pelles C Win32 target compilation issues --- lib/amigaos.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index c7438a4eb..0e3445d81 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -72,4 +72,10 @@ BOOL amiga_init() ADD2EXIT(amiga_cleanup,-50); #endif +#else /* __AMIGA__ */ + +#ifdef __POCC__ +# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */ +#endif + #endif /* __AMIGA__ */ -- cgit v1.2.1 From 2309b4e330b96bc2e1f8e36b6184015e59544037 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 24 Mar 2010 11:02:54 +0100 Subject: remove the CVSish $Id$ lines --- lib/amigaos.c | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 0e3445d81..2055126fe 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -18,7 +18,6 @@ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * - * $Id$ ***************************************************************************/ #ifdef __AMIGA__ /* Any AmigaOS flavour */ -- cgit v1.2.1 From 919c97fa65a5c00f7044e849eeb0095408413505 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 6 Apr 2012 23:35:15 +0200 Subject: curl tool: use configuration files from lib directory Configuration files such as curl_config.h and all config-*.h no longer exist nor are generated/copied into 'src' directory, now these only exist in 'lib' directory from where curl tool sources uses them. Additionally old src/setup.h has been refactored into src/tool_setup.h which now pulls lib/setup.h The possibility of a makefile needing an include path adjustment exists. --- lib/amigaos.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'lib/amigaos.c') diff --git a/lib/amigaos.c b/lib/amigaos.c index 2055126fe..71ea704e1 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2009, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -20,11 +20,14 @@ * ***************************************************************************/ -#ifdef __AMIGA__ /* Any AmigaOS flavour */ +#include "setup.h" + +#if defined(__AMIGA__) && !defined(__ixemul__) -#include "amigaos.h" #include +#include "amigaos.h" + struct Library *SocketBase = NULL; extern int errno, h_errno; @@ -35,7 +38,7 @@ void __request(const char *msg); # define __request( msg ) Printf( msg "\n\a") #endif -void amiga_cleanup() +void Curl_amiga_cleanup() { if(SocketBase) { CloseLibrary(SocketBase); @@ -43,7 +46,7 @@ void amiga_cleanup() } } -BOOL amiga_init() +bool Curl_amiga_init() { if(!SocketBase) SocketBase = OpenLibrary("bsdsocket.library", 4); @@ -61,20 +64,14 @@ BOOL amiga_init() } #ifndef __libnix__ - atexit(amiga_cleanup); + atexit(Curl_amiga_cleanup); #endif return TRUE; } #ifdef __libnix__ -ADD2EXIT(amiga_cleanup,-50); -#endif - -#else /* __AMIGA__ */ - -#ifdef __POCC__ -# pragma warn(disable:2024) /* Disable warning #2024: Empty input file */ +ADD2EXIT(Curl_amiga_cleanup,-50); #endif -#endif /* __AMIGA__ */ +#endif /* __AMIGA__ && ! __ixemul__ */ -- cgit v1.2.1