Open SCAP Library
|
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 SEXP_t *SEXP_init(SEXP_t *sexp_mem); 00037 00038 SEXP_t *SEXP_number_newb_r(SEXP_t *sexp_mem, bool n); 00039 #define SEXP_number_newi_r SEXP_number_newi_32_r 00040 SEXP_t *SEXP_number_newi_32_r(SEXP_t *sexp_mem, int32_t n); 00041 SEXP_t *SEXP_number_newu_32_r(SEXP_t *sexp_mem, uint32_t n); 00042 SEXP_t *SEXP_number_newu_64_r(SEXP_t *sexp_mem, uint64_t n); 00043 SEXP_t *SEXP_number_newi_64_r(SEXP_t *sexp_mem, int64_t n); 00044 SEXP_t *SEXP_number_newf_r(SEXP_t *sexp_mem, double n); 00045 00046 SEXP_t *SEXP_string_new_r(SEXP_t *sexp_mem, const void *string, size_t length); 00047 SEXP_t *SEXP_string_newf_r(SEXP_t *sexp_mem, const char *format, ...); 00048 SEXP_t *SEXP_string_newf_rv(SEXP_t *sexp_mem, const char *format, va_list ap); 00049 00050 SEXP_t *SEXP_list_new_rv(SEXP_t *sexp_mem, SEXP_t *memb, va_list alist); 00051 SEXP_t *SEXP_list_new_r(SEXP_t *sexp_mem, SEXP_t *memb, ...); 00052 00053 int SEXP_unref_r(SEXP_t *s_exp); 00054 00055 #if defined(NDEBUG) 00056 void SEXP_free_r (SEXP_t *s_exp); 00057 #else 00058 #include <stdint.h> 00059 void __SEXP_free_r(SEXP_t *s_exp, const char *file, uint32_t line, const char *func); 00060 00061 __attribute__ ((unused)) static void SEXP_free_r(SEXP_t *sexp) 00062 { 00063 __SEXP_free_r(sexp, __FILE__, __LINE__, __PRETTY_FUNCTION__); 00064 } 00065 00066 #define SEXP_free_r(ptr) __SEXP_free_r(ptr, __FILE__, __LINE__, __PRETTY_FUNCTION__) 00067 00068 #endif 00069 00070 #ifdef __cplusplus 00071 } 00072 #endif 00073 00074 #endif /* SEXP_MANIP_R_H */