[Liboss-commit] CVS: liboss/lib esddsp.c,1.3,1.4
Brought to you by:
thesin
|
From: Alexander S. <mrv...@us...> - 2002-10-23 01:28:16
|
Update of /cvsroot/liboss/liboss/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23624/lib
Modified Files:
esddsp.c
Log Message:
Now soundcard.h uses inline functions. We need to write liboss-config or use pkgconfig, but arts may compile (manually) now
Index: esddsp.c
===================================================================
RCS file: /cvsroot/liboss/liboss/lib/esddsp.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- esddsp.c 22 Oct 2002 19:27:22 -0000 1.3
+++ esddsp.c 23 Oct 2002 01:28:13 -0000 1.4
@@ -19,13 +19,6 @@
#define DSP_DEBUG
-/* This lets you run multiple instances of x11amp by setting the X11AMPNUM
- environment variable. Only works on glibc2.
- */
-/* #define MULTIPLE_X11AMP */
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-
#ifdef DSP_DEBUG
#define DPRINTF(format, args...) printf(format, ## args)
#else
@@ -51,11 +44,7 @@
/* BSDI has this functionality, but not define :() */
#define REAL_LIBC libSystem_handle
-#if defined(__FreeBSD__) || defined(__bsdi__)
typedef unsigned long request_t;
-#else
-typedef int request_t;
-#endif
static int sndfd = -1, mixfd = -1;
static int settings = 0, done = 0;
@@ -166,21 +155,18 @@
}
}
-int
-oss_open (const char *pathname, int flags, ...)
+int oss_open (const char *pathname, int flags, va_list args)
{
static int (*func) (const char *, int, mode_t) = NULL;
- va_list args;
mode_t mode;
liboss_init ();
if (!func)
- func = (int (*) (const char *, int, mode_t)) dlsym (REAL_LIBC, "open");
+ func = (int (*) (const char *, int, mode_t)) dlsym (REAL_LIBC, "_open");
dsp_init ();
- va_start (args, flags);
mode = va_arg (args, int);
va_end (args);
@@ -378,17 +364,16 @@
}
int
-oss_ioctl (int fd, request_t request, ...)
+oss_ioctl (int fd, request_t request, va_list args)
{
static int (*func) (int, request_t, void *) = NULL;
- va_list args;
void *argp;
liboss_init ();
if (!func)
- func = (int (*) (int, request_t, void *)) dlsym (REAL_LIBC, "ioctl");
- va_start (args, request);
+ func = (int (*) (int, request_t, void *)) dlsym (REAL_LIBC, "_ioctl");
+
argp = va_arg (args, void *);
va_end (args);
@@ -409,7 +394,7 @@
static int (*func) (int) = NULL;
if (!func)
- func = (int (*) (int)) dlsym (REAL_LIBC, "close");
+ func = (int (*) (int)) dlsym (REAL_LIBC, "_close");
if (fd == sndfd)
sndfd = -1;
@@ -418,90 +403,3 @@
return (*func) (fd);
}
-
-#ifdef MULTIPLE_X11AMP
-
-#include <socketbits.h>
-#include <sys/param.h>
-#include <sys/un.h>
-
-#define ENVSET "X11AMPNUM"
-
-int
-unlink (const char *filename)
-{
- static int (*func) (const char *) = NULL;
- char *num;
-
- if (!func)
- func = (int (*) (const char *)) dlsym (REAL_LIBC, "unlink");
-
- if (!strcmp (filename, "/tmp/X11Amp_CTRL") && (num = getenv (ENVSET)))
- {
- char buf[PATH_MAX] = "/tmp/X11Amp_CTRL";
- strcat (buf, num);
- return (*func) (buf);
- }
- else
- return (*func) (filename);
-}
-
-typedef int (*sa_func_t) (int, struct sockaddr *, int);
-
-static int
-sockaddr_mangle (sa_func_t func, int fd, struct sockaddr *addr, int len)
-{
- char *num;
-
- if (!strcmp (((struct sockaddr_un *) addr)->sun_path, "/tmp/X11Amp_CTRL")
- && (num = getenv(ENVSET)))
- {
- int ret;
- char buf[PATH_MAX] = "/tmp/X11Amp_CTRL";
-
- struct sockaddr_un *new_addr = malloc (len);
-
- strcat (buf, num);
- memcpy (new_addr, addr, len);
- strcpy (new_addr->sun_path, buf);
-
- ret = (*func) (fd, (struct sockaddr *) new_addr, len);
-
- free (new_addr);
- return ret;
- }
- else
- return (*func) (fd, addr, len);
-}
-
-int
-bind (int fd, struct sockaddr *addr, int len)
-{
- static sa_func_t func = NULL;
-
- if (!func)
- func = (sa_func_t) dlsym (REAL_LIBC, "bind");
- return sockaddr_mangle (func, fd, addr, len);
-}
-
-int
-connect (int fd, struct sockaddr *addr, int len)
-{
- static sa_func_t func = NULL;
-
- if (!func)
- func = (sa_func_t) dlsym (REAL_LIBC, "connect");
- return sockaddr_mangle (func, fd, addr, len);
-}
-
-#endif /* MULTIPLE_X11AMP */
-
-#else /* __GNUC__ */
-
-void
-nogcc (void)
-{
- ident = NULL;
-}
-
-#endif /* __GNUC__ */
|