C Standard Library Extensions  1.0.5
cxutils.h
00001 /* $Id: cxutils.h,v 1.5 2009/12/07 15:48:15 llundin Exp $
00002  *
00003  * This file is part of the ESO C Extension Library
00004  * Copyright (C) 2001-2006 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00021 /*
00022  * $Author: llundin $
00023  * $Date: 2009/12/07 15:48:15 $
00024  * $Revision: 1.5 $
00025  * $Name: cpl-5_3_0-BRANCH $
00026  */
00027 
00028 #ifndef CX_UTILS_H
00029 #define CX_UTILS_H
00030 
00031 #include <stdarg.h>
00032 #include <cxtypes.h>
00033 
00034 
00035 CX_BEGIN_DECLS
00036 
00037 /*
00038  * Static information retrieval
00039  */
00040 
00041 const cxchar *cx_program_get_name(void);
00042 void cx_program_set_name(const cxchar *);
00043 
00044 cxlong cx_line_max(void);
00045 
00046 
00047 /*
00048  * Bit tests
00049  */
00050 
00051 cxint cx_bits_find(cxuint32, cxint);
00052 cxint cx_bits_rfind(cxuint32, cxint);
00053 
00054 
00055 /*
00056  * Miscellaneous utility functions
00057  */
00058 
00059 cxint cx_snprintf(cxchar *, cxsize, const cxchar *, ...)
00060 #ifdef __GNUC__
00061     __attribute__((format (printf, 3, 4)))
00062 #endif
00063     ;
00064 cxint cx_vsnprintf(cxchar *, cxsize, const cxchar *, va_list)
00065 #ifdef __GNUC__
00066     __attribute__((format (printf, 3, 0)))
00067 #endif
00068      ;
00069 cxint cx_asprintf(cxchar **, const cxchar *, ...)
00070 #ifdef __GNUC__
00071     __attribute__((format (printf, 2, 3)))
00072 #endif
00073     ;
00074 cxint cx_vasprintf(cxchar **, const cxchar *, va_list)
00075 #ifdef __GNUC__
00076     __attribute__((format (printf, 2, 0)))
00077 #endif
00078      ;
00079 
00080 cxchar *cx_line_alloc(void);
00081 
00082 CX_END_DECLS
00083 
00084 #endif /* CX_UTILS_H */