X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Fproc.h;h=4a80edfcce70b3cb261827c28f3290384f337bee;hb=27b9d32bf2a851c4acbfdc4d9aa5a55d12c92c10;hp=c342e1dfa568ab17c16eeb236d53a8e83ea15694;hpb=54e67ea9ee6c2b00c43f759edc55b57b969c9e2d;p=ngircd-alex.git diff --git a/src/ngircd/proc.h b/src/ngircd/proc.h index c342e1df..4a80edfc 100644 --- a/src/ngircd/proc.h +++ b/src/ngircd/proc.h @@ -1,34 +1,45 @@ /* * ngIRCd -- The Next Generation IRC Daemon - * Copyright (c)2001-2010 Alexander Barton (alex@barton.de) + * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors. * * 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. * Please read the file COPYING, README and AUTHORS for more information. - * - * Process management (header) */ #ifndef __proc_h__ #define __proc_h__ -/* This struct must not be accessed directly! */ +/** + * @file + * Process management (header) + */ + +/** Process status. This struct must not be accessed directly! */ typedef struct _Proc_Stat { - pid_t pid; /* PID of the child process or 0 if none */ - int pipe_fd; /* Pipe file descriptor or -1 if none */ + pid_t pid; /**< PID of the child process or 0 if none */ + int pipe_fd; /**< Pipe file descriptor or -1 if none */ } PROC_STAT; +/** Return true if sub-process is still running */ #define Proc_InProgress(x) ((x)->pid != 0) + +/** Return file descriptor of pipe to sub-process (or -1 if none open) */ #define Proc_GetPipeFd(x) ((x)->pipe_fd) GLOBAL void Proc_InitStruct PARAMS((PROC_STAT *proc)); GLOBAL pid_t Proc_Fork PARAMS((PROC_STAT *proc, int *pipefds, - void (*cbfunc)(int, short))); + void (*cbfunc)(int, short), int timeout)); + +GLOBAL void Proc_GenericSignalHandler PARAMS((int Signal)); + +GLOBAL size_t Proc_Read PARAMS((PROC_STAT *proc, void *buffer, size_t buflen)); + +GLOBAL void Proc_Close PARAMS((PROC_STAT *proc)); -GLOBAL void Proc_Kill PARAMS((PROC_STAT *proc)); #endif