safe.h

00001 /********************************************************************\
00002  * This program is free software; you can redistribute it and/or    *
00003  * modify it under the terms of the GNU General Public License as   *
00004  * published by the Free Software Foundation; either version 2 of   *
00005  * the License, or (at your option) any later version.              *
00006  *                                                                  *
00007  * This program is distributed in the hope that it will be useful,  *
00008  * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
00009  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
00010  * GNU General Public License for more details.                     *
00011  *                                                                  *
00012  * You should have received a copy of the GNU General Public License*
00013  * along with this program; if not, contact:                        *
00014  *                                                                  *
00015  * Free Software Foundation           Voice:  +1-617-542-5942       *
00016  * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
00017  * Boston, MA  02111-1307,  USA       gnu@gnu.org                   *
00018  *                                                                  *
00019 \********************************************************************/
00020 
00021 /* $Id: safe.h 901 2006-01-17 18:58:13Z mina $ */
00027 #ifndef _SAFE_H_
00028 #define _SAFE_H_
00029 
00030 #include <stdarg.h> /* For va_list */
00031 #include <sys/types.h> /* For fork */
00032 #include <unistd.h> /* For fork */
00033 
00036 void * safe_malloc (size_t size);
00037 
00038 /* @brief Safe version of strdup
00039  */
00040 char * safe_strdup(const char *s);
00041 
00042 /* @brief Safe version of asprintf
00043  */
00044 int safe_asprintf(char **strp, const char *fmt, ...);
00045 
00046 /* @brief Safe version of vasprintf
00047  */
00048 int safe_vasprintf(char **strp, const char *fmt, va_list ap);
00049 
00050 /* @brief Safe version of fork
00051  */
00052 
00053 pid_t safe_fork(void);
00054 
00055 #endif /* _SAFE_H_ */
00056 

Generated on Sat Jan 6 18:51:44 2007 for WifiDog by  doxygen 1.5.1