Open SCAP Library
/home/pvrabec/project/openscap/openscap-0.8.0/src/OVAL/probes/SEAP/public/sexp-manip_r.h
00001 /*
00002  * Copyright 2011 Red Hat Inc., Durham, North Carolina.
00003  * All Rights Reserved.
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Lesser General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2.1 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public
00016  * License along with this library; if not, write to the Free Software
00017  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  * Authors:
00020  *      Daniel Kopecek <dkopecek@redhat.com>
00021  */
00022 
00023 #ifndef SEXP_MANIP_R_H
00024 #define SEXP_MANIP_R_H
00025 
00026 #include <stdarg.h>
00027 #include <stddef.h>
00028 #include <stdint.h>
00029 #include <stdbool.h>
00030 #include "sexp-types.h"
00031 
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035 
00036 #if     __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
00037 #define _GNUC_PRINTF( format_idx, arg_idx )    \
00038   __attribute__((__format__ (__printf__, format_idx, arg_idx)))
00039 #else   /* !__GNUC__ */
00040 #define _GNUC_PRINTF( format_idx, arg_idx )
00041 #endif  /* __GNUC__ */
00042 
00043 SEXP_t *SEXP_init(SEXP_t *sexp_mem);
00044 
00045 SEXP_t *SEXP_number_newb_r(SEXP_t *sexp_mem, bool n);
00046 #define SEXP_number_newi_r SEXP_number_newi_32_r
00047 SEXP_t *SEXP_number_newi_32_r(SEXP_t *sexp_mem, int32_t n);
00048 SEXP_t *SEXP_number_newu_32_r(SEXP_t *sexp_mem, uint32_t n);
00049 SEXP_t *SEXP_number_newu_64_r(SEXP_t *sexp_mem, uint64_t n);
00050 SEXP_t *SEXP_number_newi_64_r(SEXP_t *sexp_mem, int64_t n);
00051 SEXP_t *SEXP_number_newf_r(SEXP_t *sexp_mem, double n);
00052 
00053 SEXP_t *SEXP_string_new_r(SEXP_t *sexp_mem, const void *string, size_t length);
00054 SEXP_t *SEXP_string_newf_r(SEXP_t *sexp_mem, const char *format, ...) _GNUC_PRINTF (2,3);
00055 SEXP_t *SEXP_string_newf_rv(SEXP_t *sexp_mem, const char *format, va_list ap);
00056 
00057 SEXP_t *SEXP_list_new_rv(SEXP_t *sexp_mem, SEXP_t *memb, va_list alist);
00058 SEXP_t *SEXP_list_new_r(SEXP_t *sexp_mem, SEXP_t *memb, ...);
00059 
00060 SEXP_t *SEXP_list_rest_r (SEXP_t *rest, const SEXP_t *list);
00061 
00062 int SEXP_unref_r(SEXP_t *s_exp);
00063 
00064 #if defined(NDEBUG)
00065 void SEXP_free_r (SEXP_t *s_exp);
00066 #else
00067 #include <stdint.h>
00068 void __SEXP_free_r(SEXP_t *s_exp, const char *file, uint32_t line, const char *func);
00069 
00070 __attribute__ ((unused)) static void SEXP_free_r(SEXP_t *sexp)
00071 {
00072         __SEXP_free_r(sexp, __FILE__, __LINE__, __PRETTY_FUNCTION__);
00073 }
00074 
00075 #define SEXP_free_r(ptr) __SEXP_free_r(ptr, __FILE__, __LINE__, __PRETTY_FUNCTION__)
00076 
00077 #endif
00078 
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 
00083 #endif /* SEXP_MANIP_R_H */