From: Jürg Billeter Date: Fri, 20 Feb 2009 10:13:04 +0000 (+0000) Subject: Add libdaemon bindings, patch by Jukka-Pekka Iivonen, fixes bug 568758 X-Git-Tag: 0.5.7~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55ddcd8abd49dc404cd3ff424493d1c67798364d;p=thirdparty%2Fvala.git Add libdaemon bindings, patch by Jukka-Pekka Iivonen, fixes bug 568758 2009-02-20 Jürg Billeter * vapi/Makefile.am: * vapi/libdaemon.vapi: Add libdaemon bindings, patch by Jukka-Pekka Iivonen, fixes bug 568758 svn path=/trunk/; revision=2460 --- diff --git a/ChangeLog b/ChangeLog index ae918c15e..ca5e2c0da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-02-20 Jürg Billeter + + * vapi/Makefile.am: + * vapi/libdaemon.vapi: + + Add libdaemon bindings, patch by Jukka-Pekka Iivonen, + fixes bug 568758 + 2009-02-20 Jürg Billeter * vapi/glib-2.0.vapi: diff --git a/vapi/Makefile.am b/vapi/Makefile.am index b34056d91..6782d2478 100644 --- a/vapi/Makefile.am +++ b/vapi/Makefile.am @@ -81,6 +81,7 @@ dist_vapi_DATA = \ hildon-fm-2.vapi \ json-glib-1.0.vapi \ libbonoboui-2.0.vapi \ + libdaemon.vapi \ libepc-1.0.vapi \ libftdi.deps \ libftdi.vapi \ diff --git a/vapi/libdaemon.vapi b/vapi/libdaemon.vapi new file mode 100644 index 000000000..db242d9e9 --- /dev/null +++ b/vapi/libdaemon.vapi @@ -0,0 +1,124 @@ +/* daemon.vapi + * + * Copyright (C) 2009 Jukka-Pekka Iivonen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: + * Jukka-Pekka Iivonen + */ + +[CCode (lower_case_cprefix = "daemon_", cheader_filename = "signal.h,libdaemon/daemon.h")] +namespace Daemon { + [CCode (cname = "int", cprefix = "DAEMON_LOG_")] + public enum LogFlags { + SYSLOG, + STDERR, + STDOUT, + AUTO + } + + [CCode (cname = "int", cprefix = "LOG_")] + public enum LogPriority { + EMERG, + ALERT, + CRIT, + ERR, + WARNING, + NOTICE, + INFO, + DEBUG + } + + [CCode (cname = "int", cprefix = "SIG")] + public enum Sig { + HUP, + INT, + QUIT, + ILL, + TRAP, + ABRT, + IOT, + BUS, + FPE, + KILL, + USR1, + SEGV, + USR2, + PIPE, + ALRM, + TERM, + STKFLT, + CLD, + CHLD, + CONT, + STOP, + TSTP, + TTIN, + TTOU, + URG, + XCPU, + XFSZ, + VTALRM, + PROF, + WINCH, + POLL, + IO, + PWR, + SYS, + UNUSED + } + + public int exec (string dir, out int ret, string prog, ...); + + public int fork (); + public int retval_init (); + public void retval_done (); + public int retval_wait (int timeout); + public int retval_send (int s); + public int close_all (int except_fd, ...); + public int close_allv ([CCode (array_length = false)] int[] except_fds); + public int unblock_sigs (int except, ...); + public int unblock_sigsv ([CCode (array_length = false)] int[] except); + public int reset_sigs (int except, ...); + public int reset_sigsv ([CCode (array_length = false)] int[] except); + + public static LogFlags log_use; + public static string log_ident; + + public void log (int prio, string t, ...); + public weak string ident_from_argv0 (string argv0); + + public int nonblock (int fd, int b); + + public delegate string PidFileProc (); + + public static string pid_file_ident; + public static PidFileProc pid_file_proc; + + public weak string pid_file_proc_default (); + public int pid_file_create (); + public int pid_file_remove (); + public int pid_file_is_running (); + public int pid_file_kill (Sig s); + public int pid_file_kill_wait (Sig s, int m); + + public int signal_init (Sig s, ...); + public int signal_install (Sig s); + public void signal_done (); + public int signal_next (); + public int signal_fd (); +} +