00001 #ifdef AMIGA
00002 #ifndef AMIGA_H_INCLUDED
00003 #define AMIGA_H_INCLUDED
00004 #define AMIGA_H_VERSION "$Id: amiga.h,v 2.0 2002/06/04 14:34:21 jongfoster Exp $"
00005 /* ******************************************************************
00006 * $Source: /cvsroot/ijbswa/current/src/amiga.h,v $
00007 * ******************************************************************
00008 *
00009 * Written by and Copyright (C) 2001 the SourceForge
00010 * Privoxy team. http://www.privoxy.org/
00011 *
00012 * This program is free software; you can redistribute it
00013 * and/or modify it under the terms of the GNU General
00014 * Public License as published by the Free Software
00015 * Foundation; either version 2 of the License, or (at
00016 * your option) any later version.
00017 *
00018 * This program is distributed in the hope that it will
00019 * be useful, but WITHOUT ANY WARRANTY; without even the
00020 * implied warranty of MERCHANTABILITY or FITNESS FOR A
00021 * PARTICULAR PURPOSE. See the GNU General Public
00022 * License for more details.
00023 *
00024 * The GNU General Public License should be included with
00025 * this file. If not, you can view it at
00026 * http://www.gnu.org/copyleft/gpl.html
00027 * or write to the Free Software Foundation, Inc., 59
00028 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00029 *
00030 * *****************************************************************/
00031 /**
00032 * @file
00033 *
00034 * Amiga-specific declarations.
00035 *
00036 *
00037 * $Log: amiga.h,v $
00038 * Revision 2.0 2002/06/04 14:34:21 jongfoster
00039 * Moving source files to src/
00040 *
00041 * Revision 1.9 2002/03/26 22:29:54 swa
00042 * we have a new homepage!
00043 *
00044 * Revision 1.8 2002/03/24 13:25:43 swa
00045 * name change related issues
00046 *
00047 * Revision 1.7 2002/03/03 09:18:03 joergs
00048 * Made jumbjuster work on AmigaOS again.
00049 *
00050 * Revision 1.6 2001/10/13 12:46:08 joergs
00051 * Added #undef EINTR to avoid warnings
00052 *
00053 * Revision 1.5 2001/07/29 18:43:08 jongfoster
00054 * Changing #ifdef _FILENAME_H to FILENAME_H_INCLUDED, to conform to
00055 * ANSI C rules.
00056 *
00057 * Revision 1.4 2001/05/29 20:05:06 joergs
00058 * Fixed exit() macro not exiting if called before InitAmiga()
00059 * (junkbuster --help and --version).
00060 *
00061 * Revision 1.3 2001/05/25 21:53:27 jongfoster
00062 * Fixing indentation
00063 *
00064 * Revision 1.2 2001/05/23 00:13:58 joergs
00065 * AmigaOS support fixed.
00066 *
00067 * Revision 1.1.1.1 2001/05/15 13:58:46 oes
00068 * Initial import of version 2.9.3 source tree
00069 *
00070 *
00071 */
00072 /* *****************************************************************/
00073
00074
00075 #define _KERNEL
00076 #include <sys/socket.h>
00077 #undef _KERNEL
00078
00079 #define __NOLIBBASE__
00080 #include <proto/socket.h>
00081 #undef __NOLIBBASE__
00082
00083 #define __CONSTLIBBASEDECL__ const
00084 #define DEVICES_TIMER_H
00085 #include <proto/exec.h>
00086 #include <exec/tasks.h>
00087 #include <proto/dos.h>
00088 #include <dos/dostags.h>
00089
00090 struct UserData
00091 {
00092 struct Library *sb;
00093 int eno;
00094 };
00095
00096 #define SocketBase ((struct Library *)(((struct UserData *)(FindTask(NULL)->tc_UserData))->sb))
00097 #define errno (((struct UserData *)(FindTask(NULL)->tc_UserData))->eno)
00098 #define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,NULL)
00099 #define inet_ntoa(x) Inet_NtoA(x.s_addr)
00100
00101 extern int childs;
00102 extern struct Task *main_task;
00103
00104 void InitAmiga(void);
00105 void amiga_exit(void);
00106 void __memCleanUp(void);
00107 __saveds ULONG server_thread(void);
00108
00109 #define exit(x) \
00110 { \
00111 if(main_task) \
00112 { \
00113 if(main_task == FindTask(NULL)) \
00114 { \
00115 while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \
00116 } \
00117 else \
00118 { \
00119 CloseLibrary(SocketBase); \
00120 childs--; \
00121 RemTask(NULL); \
00122 } \
00123 } \
00124 else \
00125 { \
00126 exit(x); \
00127 } \
00128 }
00129
00130 #undef EINTR
00131 #define EINTR 0
00132
00133 #endif /* ndef AMIGA_H_INCLUDED */
00134 #endif /* def AMIGA */
1.2.15