w32.res: w32.rc w32res.h icons/radar-01.ico icons/radar-02.ico icons/radar-03.ico icons/radar-04.ico icons/radar-05.ico icons/radar-06.ico icons/radar-07.ico icons/radar-08.ico icons/idle.ico icons/privoxy.ico config.h
windres -F pe-i386 -D__MINGW32__=0.2 -O coff -i $< -o $@
-# AmigaOS
-@AMIGAOS_ONLY@OBJS += amiga.o
-@AMIGAOS_ONLY@ifeq ($(shell $(CC) -dumpmachine), m68k-amigaos)
-@AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -W -m68020 -noixemul -fbaserel -msmall-code
-@AMIGAOS_ONLY@LDFLAGS += -m68020 -noixemul -fbaserel
-@AMIGAOS_ONLY@LIBS = -lm /gg/lib/libb/libm020/libnix/swapstack.o
-@AMIGAOS_ONLY@else
-@AMIGAOS_ONLY@CFLAGS += -D__AMIGAVERSION__=\"$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_POINT)\" -D__AMIGADATE__=\"`date +%d.%m.%Y`\" -Wextra -D__USE_INLINE__ -D__NO_INTUITION_RJ_MACROS
-@AMIGAOS_ONLY@endif
-@AMIGAOS_ONLY@amiga.o: amiga.c amiga.h config.h
-
-
$(PROGRAM): $(OBJS) $(W32_FILES)
$(LD) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
+++ /dev/null
-/*********************************************************************
- *
- * File : $Source: /cvsroot/ijbswa/current/amiga.c,v $
- *
- * Purpose : Amiga-specific declarations.
- *
- * Copyright : Written by and Copyright (C) 2001 members of the
- * Privoxy team. http://www.privoxy.org/
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will
- * be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * The GNU General Public License should be included with
- * this file. If not, you can view it at
- * http://www.gnu.org/copyleft/gpl.html
- * or write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- *********************************************************************/
-
-
-#include "config.h"
-
-#ifdef AMIGA
-
-#include <stdio.h>
-#include <signal.h>
-
-#include "project.h"
-
-static char *ver USED = "$VER: Privoxy " __AMIGAVERSION__ " (" __AMIGADATE__ ")";
-#ifdef __amigaos4__
-static char *stack USED = "$STACK: 524288";
-#else
-unsigned long __stack = 100*1024;
-#endif
-struct Task *main_task = NULL;
-int childs = 0;
-
-void serve(struct client_state *csp);
-
-SAVEDS ULONG server_thread(void)
-{
- struct client_state *local_csp;
- struct UserData UserData;
- struct Task *me=FindTask(NULL);
-#ifdef __amigaos4__
- struct Library *SocketBase;
-#endif
-
- Wait(SIGF_SINGLE);
- local_csp=(struct client_state *)(me->tc_UserData);
- me->tc_UserData=&UserData;
- SocketBase=(APTR)OpenLibrary("bsdsocket.library",3);
- if (SocketBase)
-#ifdef __amigaos4__
- {
- ISocket = (struct SocketIFace *)GetInterface(SocketBase, "main", 1, NULL);
- }
- if (ISocket)
-#endif
- {
- SetErrnoPtr(&(UserData.eno),sizeof(int));
- local_csp->cfd=ObtainSocket(local_csp->cfd, AF_INET, SOCK_STREAM, 0);
- if (JB_INVALID_SOCKET!=local_csp->cfd)
- {
- Signal(main_task,SIGF_SINGLE);
- serve((struct client_state *) local_csp);
- } else {
- local_csp->flags &= ~CSP_FLAG_ACTIVE;
- Signal(main_task,SIGF_SINGLE);
- }
-#ifdef __amigaos4__
- DropInterface((struct Interface *)ISocket);
-#endif
- CloseLibrary(SocketBase);
- } else {
-#ifdef __amigaos4__
- CloseLibrary(SocketBase);
-#endif
- local_csp->flags &= ~CSP_FLAG_ACTIVE;
- Signal(main_task,SIGF_SINGLE);
- }
- childs--;
- return 0;
-}
-
-static BPTR olddir;
-
-void amiga_exit(void)
-{
-#ifdef __amigaos4__
- if (ISocket)
-#else
- if (SocketBase)
-#endif
- {
-#ifdef __amigaos4__
- struct Library *SocketBase = ISocket->Data.LibBase;
- DropInterface((struct Interface *)ISocket);
-#endif
- CloseLibrary(SocketBase);
- }
- CurrentDir(olddir);
-}
-
-#ifndef __amigaos4__
-static struct SignalSemaphore memsem;
-static struct SignalSemaphore *memsemptr = NULL;
-#endif
-static struct UserData GlobalUserData;
-
-void InitAmiga(void)
-{
-#ifdef __amigaos4__
- struct Library *SocketBase;
-#endif
-
- main_task = FindTask(NULL);
- main_task->tc_UserData = &GlobalUserData;
-
- if (((struct Library *)SysBase)->lib_Version < 39)
- {
- exit(RETURN_FAIL);
- }
-
- signal(SIGINT,SIG_IGN);
- SocketBase = (APTR)OpenLibrary("bsdsocket.library",3);
-#ifdef __amigaos4__
- if (SocketBase)
- {
- ISocket = (struct SocketIFace *)GetInterface(SocketBase, "main", 1, NULL);
- }
- if (!ISocket)
-#else
- if (!SocketBase)
-#endif
- {
-#ifdef __amigaos4__
- CloseLibrary(SocketBase);
-#endif
- fprintf(stderr, "Can't open bsdsocket.library V3+\n");
- exit(RETURN_ERROR);
- }
- SetErrnoPtr(&(GlobalUserData.eno),sizeof(int));
-#ifndef __amigaos4__
- InitSemaphore(&memsem);
- memsemptr = &memsem;
-#endif
-
- olddir=CurrentDir(GetProgramDir());
- atexit(amiga_exit);
-}
-
-#ifndef __amigaos4__
-#ifdef __GNUC__
-#ifdef libnix
-/* multithreadingsafe libnix replacements */
-static void *memPool=NULL;
-
-void *malloc (size_t s)
-{
- ULONG *mem;
- LONG size = s;
-
- if (size<=0)
- {
- return NULL;
- }
- if (!memPool)
- {
- if (!(memPool=CreatePool(MEMF_ANY,32*1024,8*1024)))
- {
- return NULL;
- }
- }
- size += sizeof(ULONG) + MEM_BLOCKMASK;
- size &= ~MEM_BLOCKMASK;
- if (memsemptr)
- {
- ObtainSemaphore(memsemptr);
- }
- if ((mem=AllocPooled(memPool,size)))
- {
- *mem++=size;
- }
- if (memsemptr)
- {
- ReleaseSemaphore(memsemptr);
- }
- return mem;
-}
-
-void free (void *m)
-{
- ULONG *mem = m;
-
- if (mem && memPool)
- {
- ULONG size=*--mem;
-
- if (memsemptr)
- {
- ObtainSemaphore(memsemptr);
- }
- FreePooled(memPool,mem,size);
- if (memsemptr)
- {
- ReleaseSemaphore(memsemptr);
- }
- }
-}
-
-void *realloc (void *old, size_t ns)
-{
- void *new;
- LONG osize, *o = old;
- LONG nsize = ns;
-
- if (!old)
- {
- return malloc(nsize);
- }
- osize = (*(o-1)) - sizeof(ULONG);
- if (nsize <= osize)
- {
- return old;
- }
- if ((new = malloc(nsize)))
- {
- ULONG *n = new;
-
- osize >>= 2;
- while(osize--)
- {
- *n++ = *o++;
- }
- free(old);
- }
- return new;
-}
-
-void __memCleanUp (void)
-{
- if (memsemptr)
- {
- ObtainSemaphore(memsemptr);
- }
- if (memPool)
- {
- DeletePool(memPool);
- }
- if (memsemptr)
- {
- ReleaseSemaphore(memsemptr);
- }
-}
-
-#define ADD2LIST(a,b,c) asm(".stabs \"_" #b "\"," #c ",0,0,_" #a)
-#define ADD2EXIT(a,pri) ADD2LIST(a,__EXIT_LIST__,22); \
- asm(".stabs \"___EXIT_LIST__\",20,0,0," #pri "+128")
-ADD2EXIT(__memCleanUp,-50);
-#elif !defined(ixemul)
-#error No libnix and no ixemul!?
-#endif /* libnix */
-#else
-#error Only GCC is supported, multithreading safe malloc/free required.
-#endif /* __GNUC__ */
-#endif /* !__amigaos4__ */
-
-#endif /* def AMIGA */
+++ /dev/null
-#ifdef AMIGA
-#ifndef AMIGA_H_INCLUDED
-#define AMIGA_H_INCLUDED
-/*********************************************************************
- *
- * File : $Source: /cvsroot/ijbswa/current/amiga.h,v $
- *
- * Purpose : Amiga-specific declarations.
- *
- * Copyright : Written by and Copyright (C) 2001 members of the
- * Privoxy team. http://www.privoxy.org/
- *
- * This program is free software; you can redistribute it
- * and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will
- * be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU General Public
- * License for more details.
- *
- * The GNU General Public License should be included with
- * this file. If not, you can view it at
- * http://www.gnu.org/copyleft/gpl.html
- * or write to the Free Software Foundation, Inc., 59
- * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- *********************************************************************/
-
-
-#define _KERNEL
-#include <sys/socket.h>
-#undef _KERNEL
-
-#define __NOLIBBASE__
-#define __NOGLOBALIFACE__
-#include <proto/socket.h>
-#undef __NOLIBBASE__
-#undef __NOGLOBALIFACE__
-
-#define __CONSTLIBBASEDECL__ const
-#include <proto/exec.h>
-#include <exec/tasks.h>
-#include <proto/dos.h>
-#include <dos/dostags.h>
-
-struct UserData
-{
-#ifdef __amigaos4__
- struct SocketIFace *si;
-#else
- struct Library *sb;
-#endif
- int eno;
-};
-
-#ifdef __amigaos4__
-#define ISocket (((struct UserData *)(FindTask(NULL)->tc_UserData))->si)
-#undef errno
-#else
-#define SocketBase ((struct Library *)(((struct UserData *)(FindTask(NULL)->tc_UserData))->sb))
-#endif
-#define errno (((struct UserData *)(FindTask(NULL)->tc_UserData))->eno)
-#define select(a,b,c,d,e) WaitSelect(a,b,c,d,e,NULL)
-#define inet_ntoa(x) Inet_NtoA(x.s_addr)
-
-extern int childs;
-extern struct Task *main_task;
-
-void InitAmiga(void);
-void amiga_exit(void);
-void __memCleanUp(void);
-SAVEDS ULONG server_thread(void);
-
-#ifdef __amigaos4__
-#define exit(x) \
-{ \
- if(main_task) \
- { \
- if(main_task == FindTask(NULL)) \
- { \
- while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \
- } \
- else \
- { \
- if (ISocket) \
- { \
- struct Library *sb = ISocket->Data.LibBase; \
- DropInterface((struct Interface *)ISocket); \
- CloseLibrary(sb); \
- } \
- childs--; \
- RemTask(NULL); \
- } \
- } \
- else \
- { \
- exit(x); \
- } \
-}
-#else
-#define exit(x) \
-{ \
- if(main_task) \
- { \
- if(main_task == FindTask(NULL)) \
- { \
- while(childs) Delay(10*TICKS_PER_SECOND); exit(x); \
- } \
- else \
- { \
- CloseLibrary(SocketBase); \
- childs--; \
- RemTask(NULL); \
- } \
- } \
- else \
- { \
- exit(x); \
- } \
-}
-
-#undef HAVE_RANDOM
-#define h_errno 0
-#define HAVE_TIMEGM
-#define timegm(tm) mktime(tm)
-#endif /* __amigaos4__ */
-
-#undef EINTR
-#define EINTR 0
-
-#endif /* ndef AMIGA_H_INCLUDED */
-#endif /* def AMIGA */
;;
esac
-dnl =================================================================
-dnl AmigaOS specific
-dnl =================================================================
-
-AMIGAOS_ONLY=#
-
-case "$host" in
-*-amigaos) AMIGAOS_ONLY=
-;;
-esac
-
-AC_SUBST(AMIGAOS_ONLY)
-
dnl =================================================================
dnl Haiku specific
dnl =================================================================
fd_set wfds;
struct timeval timeout;
#endif
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
int flags;
#endif
int connect_failed;
set_no_delay_flag(fd);
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
if ((flags = fcntl(fd, F_GETFL, 0)) != -1)
{
flags |= O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
connect_failed = 0;
while (connect(fd, rp->ai_addr, rp->ai_addrlen) == JB_INVALID_SOCKET)
continue;
}
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
if (flags != -1)
{
flags &= ~O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
#ifdef HAVE_POLL
poll_fd[0].fd = fd;
fd_set wfds;
struct timeval tv[1];
#endif
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
int flags;
#endif
set_no_delay_flag(fd);
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
if ((flags = fcntl(fd, F_GETFL, 0)) != -1)
{
flags |= O_NDELAY;
mark_socket_for_close_on_execute(fd);
#endif
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
while (connect(fd, (struct sockaddr *) & inaddr, sizeof inaddr) == JB_INVALID_SOCKET)
{
}
}
-#if !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
if (flags != -1)
{
flags &= ~O_NDELAY;
fcntl(fd, F_SETFL, flags);
}
-#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__) */
+#endif /* !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__) */
#ifdef HAVE_POLL
poll_fd[0].fd = fd;
* nonzero on error.
*
*********************************************************************/
-#ifdef AMIGA
-int write_socket(jb_socket fd, const char *buf, ssize_t len)
-#else
int write_socket(jb_socket fd, const char *buf, size_t len)
-#endif
{
if (len == 0)
{
#if defined(_WIN32)
return (send(fd, buf, (int)len, 0) != (int)len);
-#elif defined(__BEOS__) || defined(AMIGA)
+#elif defined(__BEOS__)
return (send(fd, buf, len, 0) != len);
#elif defined(__OS2__)
/*
#if defined(_WIN32)
ret = recv(fd, buf, len, 0);
-#elif defined(__BEOS__) || defined(AMIGA) || defined(__OS2__)
+#elif defined(__BEOS__) || defined(__OS2__)
ret = recv(fd, buf, (size_t)len, 0);
#else
ret = (int)read(fd, buf, (size_t)len);
{
#if defined(_WIN32) || defined(__BEOS__)
closesocket(fd);
-#elif defined(AMIGA)
- CloseSocket(fd);
#elif defined(__OS2__)
soclose(fd);
#else
struct sockaddr_in server;
struct hostent *host = NULL;
#endif /* HAVE_RFC2553 */
-#if defined(_WIN32) || defined(__OS2__) || defined(AMIGA)
+#if defined(_WIN32) || defined(__OS2__)
/* according to accept_connection() this fixes a warning. */
int s_length, s_length_provided;
#else
struct sockaddr_in client;
#endif
jb_socket afd;
-#if defined(_WIN32) || defined(__OS2__) || defined(AMIGA)
+#if defined(_WIN32) || defined(__OS2__)
/* Wierdness - fix a warning. */
int c_length;
#else
struct client_state;
extern jb_socket connect_to(const char *host, int portnum, struct client_state *csp);
-#ifdef AMIGA
-extern int write_socket(jb_socket fd, const char *buf, ssize_t n);
-#else
extern int write_socket(jb_socket fd, const char *buf, size_t n);
-#endif
extern int read_socket(jb_socket fd, char *buf, int n);
extern int data_is_available(jb_socket fd, int seconds_to_wait);
extern void close_socket(jb_socket fd);
int g_terminate = 0;
#endif
-#if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA)
+#if !defined(_WIN32) && !defined(__OS2__)
static void sig_handler(int the_signal);
#endif
static int client_protocol_is_unsupported(const struct client_state *csp, char *req);
static void bind_ports_helper(struct configuration_spec *config, jb_socket sockets[]);
static void close_ports_helper(jb_socket sockets[]);
static void listen_loop(void);
-
-#ifdef AMIGA
-void serve(struct client_state *csp);
-#else /* ifndef AMIGA */
static void serve(struct client_state *csp);
-#endif /* def AMIGA */
#ifdef __BEOS__
static int32 server_thread(void *data);
*
* here?
*/
-#if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA)
+#if !defined(_WIN32) && !defined(__OS2__)
/*********************************************************************
*
* Function : sig_handler
* Returns : N/A
*
*********************************************************************/
-#ifdef AMIGA
-void serve(struct client_state *csp)
-#else /* ifndef AMIGA */
static void serve(struct client_state *csp)
-#endif /* def AMIGA */
{
int config_file_change_detected = 0; /* Only used for debugging */
#ifdef FEATURE_CONNECTION_KEEP_ALIVE
clients->next = NULL;
/* XXX: factor out initialising after the next stable release. */
-#ifdef AMIGA
- InitAmiga();
-#elif defined(_WIN32)
+#ifdef _WIN32
InitWin32();
#endif
* are handled when and where they occur without relying
* on a signal.
*/
-#if !defined(_WIN32) && !defined(__OS2__) && !defined(AMIGA)
+#if !defined(_WIN32) && !defined(__OS2__)
{
int idx;
const int catched_signals[] = { SIGTERM, SIGINT, SIGHUP };
for (;;)
#endif
{
-#if !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) && !defined(__OS2__)
+#if !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) && !defined(__OS2__)
while (waitpid(-1, NULL, WNOHANG) > 0)
{
/* zombie children */
}
-#endif /* !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) && !defined(AMIGA) */
+#endif /* !defined(FEATURE_PTHREAD) && !defined(_WIN32) && !defined(__BEOS__) */
/*
* Free data that was used by died threads
if (!accept_connection(csp, bfds))
{
log_error(LOG_LEVEL_CONNECT, "accept failed: %E");
-
-#ifdef AMIGA
- if (!childs)
- {
- exit(1);
- }
-#endif
freez(csp_list);
continue;
}
}
#endif
-#if defined(AMIGA) && !defined(SELECTED_ONE_OPTION)
-#define SELECTED_ONE_OPTION
- csp->cfd = ReleaseSocket(csp->cfd, -1);
-
-#ifdef __amigaos4__
- child_id = (int)CreateNewProcTags(NP_Entry, (ULONG)server_thread,
- NP_Output, Output(),
- NP_CloseOutput, FALSE,
- NP_Name, (ULONG)"privoxy child",
- NP_Child, TRUE,
- TAG_DONE);
-#else
- child_id = (int)CreateNewProcTags(NP_Entry, (ULONG)server_thread,
- NP_Output, Output(),
- NP_CloseOutput, FALSE,
- NP_Name, (ULONG)"privoxy child",
- NP_StackSize, 200*1024,
- TAG_DONE);
-#endif
- if (0 != child_id)
- {
- childs++;
- ((struct Task *)child_id)->tc_UserData = csp;
- Signal((struct Task *)child_id, SIGF_SINGLE);
- Wait(SIGF_SINGLE);
- }
-#endif
-
#if !defined(SELECTED_ONE_OPTION)
child_id = fork();
* On platforms were we use poll() we don't have to enforce
* an upper connection limit either.
*
- * XXX: Do OS/2, Amiga etc. belong here as well?
+ * XXX: Do OS/2 etc. belong here as well?
*/
if (max_client_connections < 1)
{
*********************************************************************/
char * make_path(const char * dir, const char * file)
{
-#ifdef AMIGA
- char path[512];
-
- if (dir)
- {
- if (dir[0] == '.')
- {
- if (dir[1] == '/')
- {
- strncpy(path,dir+2,512);
- }
- else
- {
- strncpy(path,dir+1,512);
- }
- }
- else
- {
- strncpy(path,dir,512);
- }
- path[511]=0;
- }
- else
- {
- path[0]=0;
- }
- if (AddPart(path,file,512))
- {
- return strdup(path);
- }
- else
- {
- return NULL;
- }
-#else /* ndef AMIGA */
-
if ((file == NULL) || (*file == '\0'))
{
return NULL; /* Error */
return path;
}
-#endif /* ndef AMIGA */
}
# endif
#endif
-#ifdef AMIGA
-#include "amiga.h"
-#endif /* def AMIGA */
-
#ifdef _WIN32
/*
* I don't want to have to #include all this just for the declaration