]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
New source files: fd.c/fd.h
authorAndre <maan@p133.(none)>
Fri, 7 Apr 2006 11:23:57 +0000 (13:23 +0200)
committerAndre <maan@p133.(none)>
Fri, 7 Apr 2006 11:23:57 +0000 (13:23 +0200)
ATM, they only contain the file_exists() function which was pulled
out from exec.c. More to follow.

Makefile.in
audiod.c
configure.ac
error.h
exec.c
fade.c
fd.c [new file with mode: 0644]
fd.h [new file with mode: 0644]
gui.c
para.h
sdl_gui.c

index 834e446352d7d256ad816a1524faf0006d9896ea..2c64d19dd692f262ebebe52044679ca033c43062 100644 (file)
@@ -88,7 +88,8 @@ web_misc := $(patsubst %,web/sync/%,$(web_misc))
 misc := bash_completion
 headers := para.h server.h SFont.h crypt.h list.h http.h send.h ortp.h rc4.h \
        close_on_fork.h afs.h db.h gcc-compat.h recv.h filter.h audiod.h \
-       grab_client.h error.h net.h ringbuffer.h daemon.h string.h ipc.h dccp.h
+       grab_client.h error.h net.h ringbuffer.h daemon.h string.h ipc.h dccp.h \
+       fd.h
 scripts := install-sh configure
 autocrap := Makefile.in config.h.in configure.ac autogen.sh
 tarball := web/sync/doc pics fonts $(c_sources) $(sample_conf) $(headers) \
@@ -100,10 +101,12 @@ all: $(BINARIES)
 www: $(gen_html) $(gruta_html) $(web_pics) $(web_misc) $(shots) tags doxygen
 
 client_objs = client.cmdline.o client.o net.o string.o crypt.o
-gui_objs = gui.cmdline.o gui.o gui_common.o exec.o close_on_fork.o signal.o string.o gui_theme.o stat.o ringbuffer.o
-sdl_gui_objs = sdl_gui.cmdline.o SFont.o sdl_gui.o gui_common.o exec.o close_on_fork.o string.o stat.o
+gui_objs = gui.cmdline.o gui.o gui_common.o exec.o close_on_fork.o signal.o \
+       string.o gui_theme.o stat.o ringbuffer.o fd.o
+sdl_gui_objs = sdl_gui.cmdline.o SFont.o sdl_gui.o gui_common.o exec.o \
+       close_on_fork.o string.o stat.o fd.o
 dbadm_objs = dbadm.o exec.o close_on_fork.o string.o
-fade_objs = fade.cmdline.o fade.o exec.o close_on_fork.o string.o
+fade_objs = fade.cmdline.o fade.o exec.o close_on_fork.o string.o fd.o
 krell_objs = krell.o string.o
 slider_objs = slider.o string.o
 audioc_objs = audioc.cmdline.o audioc.o string.o net.o
index 695a6cfd32077e0ee0477078076ab2f8b8f11d29..581cec154bb80493ae007b59a2d7b29d7b84c3dd 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -34,6 +34,7 @@
 #include "net.h"
 #include "daemon.h"
 #include "string.h"
+#include "fd.h"
 
 /** define the array of error lists needed by para_audiod */
 INIT_AUDIOD_ERRLISTS;
index f95a1682442bc3decdce4743dd31cb90e01671e6..19c2ae43831625644b7100b8778bb8450bd01a37 100644 (file)
@@ -68,7 +68,7 @@ filter_ldflags=""
 audiod_cmdline_objs="audiod.cmdline grab_client.cmdline compress_filter.cmdline
        http_recv.cmdline dccp_recv.cmdline"
 audiod_errlist_objs="audiod exec close_on_fork signal string daemon stat net
-       time grab_client filter_chain wav compress http_recv dccp dccp_recv recv_common"
+       time grab_client filter_chain wav compress http_recv dccp dccp_recv recv_common fd"
 audiod_ldflags=""
 
 server_cmdline_objs="server.cmdline"
diff --git a/error.h b/error.h
index c72bdae4fd12cc1df36f96f9ca9ba1678affb66a..ceaa6b38b2c6b6102ef6689e9be1d46ec48b6baf 100644 (file)
--- a/error.h
+++ b/error.h
@@ -56,6 +56,7 @@ enum para_subsystem {
        SS_DCCP,
        SS_DCCP_RECV,
        SS_DCCP_SEND,
+       SS_FD,
        SS_RINGBUFFER};
 
 #define NUM_SS (SS_RINGBUFFER + 1)
@@ -296,6 +297,7 @@ extern const char **para_errlist[];
 #define DAEMON_ERRORS
 #define ORTP_SEND_ERRORS
 #define RINGBUFFER_ERRORS
+#define FD_ERRORS
 
 
 /**
@@ -404,6 +406,7 @@ SS_ENUM(IPC);
 SS_ENUM(DCCP);
 SS_ENUM(DCCP_RECV);
 SS_ENUM(DCCP_SEND);
+SS_ENUM(FD);
 SS_ENUM(RINGBUFFER);
 /** \endcond */
 #undef PARA_ERROR
diff --git a/exec.c b/exec.c
index 1a302c16bf07dba2e8ae51cc706980487950bf88..b8f2df57f8c3c5768bb586aa34a5427decd29eae 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -154,16 +154,3 @@ int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds)
        return ret;
 }
 
-/**
- * check whether a file exists
- *
- * \param fn the file name
- *
- * \return Non-zero iff file exists.
- */
-int file_exists(const char *fn)
-{
-       struct stat statbuf;
-
-       return !stat(fn, &statbuf);
-}
diff --git a/fade.c b/fade.c
index b385cee7d8a7942d0edd86e69f8306b9b220b5fd..33a6fa055b7e00c4852c79b4daba207e2acdebe6 100644 (file)
--- a/fade.c
+++ b/fade.c
@@ -20,6 +20,7 @@
 
 #include "fade.cmdline.h"
 #include "para.h"
+#include "fd.h"
 
 #include <ctype.h>
 #include <curses.h>
diff --git a/fd.c b/fd.c
new file mode 100644 (file)
index 0000000..5db30b6
--- /dev/null
+++ b/fd.c
@@ -0,0 +1,14 @@
+#include "para.h"
+/**
+ * check whether a file exists
+ *
+ * \param fn the file name
+ *
+ * \return Non-zero iff file exists.
+ */
+int file_exists(const char *fn)
+{
+       struct stat statbuf;
+
+       return !stat(fn, &statbuf);
+}
diff --git a/fd.h b/fd.h
new file mode 100644 (file)
index 0000000..30ab085
--- /dev/null
+++ b/fd.h
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2006 Andre Noll <maan@systemlinux.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.
+ *
+ *     You should have received a copy of the GNU General Public License
+ *     along with this program; if not, write to the Free Software
+ *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ */
+
+/** \file fd.h file handling functions */
+
+int file_exists(const char *);
diff --git a/gui.c b/gui.c
index 7b10992c8d0b7282a3854b473ed38cebbca83d67..f63e99bd2c2e3363351f37a0b1b6afe591dd7ca5 100644 (file)
--- a/gui.c
+++ b/gui.c
@@ -23,6 +23,7 @@
 #include <curses.h>
 #include "ringbuffer.h"
 #include "string.h"
+#include "fd.h"
 
 extern const char *status_item_list[NUM_STAT_ITEMS];
 static char *stat_content[NUM_STAT_ITEMS];
diff --git a/para.h b/para.h
index 87c52d03dd93bef287ba71b5ca10c32497b967c9..ef358c539446bf108b201b054baf4d3b1e8c376d 100644 (file)
--- a/para.h
+++ b/para.h
@@ -122,7 +122,6 @@ int para_open_audiod_pipe(char *);
 int read_audiod_pipe(int, void (*)(char *));
 
 /* exec */
-int file_exists(const char *);
 int para_exec_cmdline_pid(pid_t *pid, const char *cmdline, int *fds);
 
 /* signal */
index d0bf2fbf65ae24df22e8224b3154f0720ff58286..d0b83f09a3cf8a9b81b2f2e5f78d3465be3d998d 100644 (file)
--- a/sdl_gui.c
+++ b/sdl_gui.c
@@ -20,6 +20,7 @@
 
 #include "para.h"
 #include "string.h"
+#include "fd.h"
 
 
 #include <SDL/SDL.h>