| 1 | /** |
| 2 | * @file sexp-manip.h |
| 3 | * @brief S-expression object manipulation functions - public header |
| 4 | * @author "Daniel Kopecek" <[email protected]> |
| 5 | * |
| 6 | * @addtogroup OVAL |
| 7 | * @{ |
| 8 | * @addtogroup PROBES |
| 9 | * @{ |
| 10 | * @addtogroup SEXPRESSIONS |
| 11 | * @{ |
| 12 | */ |
| 13 | /* |
| 14 | * Copyright 2009 Red Hat Inc., Durham, North Carolina. |
| 15 | * All Rights Reserved. |
| 16 | * |
| 17 | * This library is free software; you can redistribute it and/or |
| 18 | * modify it under the terms of the GNU Lesser General Public |
| 19 | * License as published by the Free Software Foundation; either |
| 20 | * version 2.1 of the License, or (at your option) any later version. |
| 21 | * |
| 22 | * This library is distributed in the hope that it will be useful, |
| 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 25 | * Lesser General Public License for more details. |
| 26 | * |
| 27 | * You should have received a copy of the GNU Lesser General Public |
| 28 | * License along with this library; if not, write to the Free Software |
| 29 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 30 | * |
| 31 | * Authors: |
| 32 | * Daniel Kopecek <[email protected]> |
| 33 | */ |
| 34 | |
| 35 | #pragma once |
| 36 | #ifndef SEXP_MANIP_H |
| 37 | #define SEXP_MANIP_Hcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:37:9`! |
| 38 | |
| 39 | #include <stdarg.h> |
| 40 | #include <stddef.h> |
| 41 | #include <stdint.h> |
| 42 | #include <stdbool.h> |
| 43 | #include <sexp-types.h>cxx . . $ `<file>/src/OVAL/probes/SEAP/public/sexp-types.h`/ |
| 44 | #include <helpers.h>cxx . . $ `<file>/src/XCCDF/helpers.h`/ |
| 45 | #include "oscap_export.h"cxx . . $ `<file>/src/common/public/oscap_export.h`/ |
| 46 | #include <common/util.h>cxx . . $ `<file>/src/common/util.h`/ |
| 47 | |
| 48 | #ifdef __cplusplus |
| 49 | extern "C" { |
| 50 | #endif |
| 51 | |
| 52 | /* |
| 53 | * number |
| 54 | */ |
| 55 | |
| 56 | /** |
| 57 | * Create a new sexp object from a value and a number type |
| 58 | * @param t the desired number type |
| 59 | * @param n pointer to the number value |
| 60 | */ |
| 61 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newcxx . . $ SEXP_number_new(426dbdcc6de6061e). (SEXP_numtype_tcxx . . $ SEXP_numtype_t# t, const void *n) __attribute__ ((nonnull (2))); |
| 62 | |
| 63 | /** |
| 64 | * Create a new sexp object from a boolean value. |
| 65 | * @param n the boolean value to store |
| 66 | */ |
| 67 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newbcxx . . $ SEXP_number_newb(f1e7d218d08e4133). (boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! n); |
| 68 | |
| 69 | /** |
| 70 | * Create a new sexp object from an integer. |
| 71 | * @param n the integer value to store |
| 72 | */ |
| 73 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newi_8cxx . . $ SEXP_number_newi_8(e1e561dc7d355b59). (int8_tcxx . . $ int8_t# n); |
| 74 | |
| 75 | /** |
| 76 | * Create a new sexp object from an unsigned integer. |
| 77 | * @param n the unsigned integer value to store |
| 78 | */ |
| 79 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newu_8cxx . . $ SEXP_number_newu_8(3b2d7d83fcb64ea8). (uint8_tcxx . . $ uint8_t# n); |
| 80 | |
| 81 | /** |
| 82 | * Get unsigned integer value from a sexp object. |
| 83 | * @param s_exp the queried sexp object |
| 84 | */ |
| 85 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! uint8_tcxx . . $ uint8_t# SEXP_number_getu_8cxx . . $ SEXP_number_getu_8(dfe0d2bfa8d6f3af). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 86 | |
| 87 | /** |
| 88 | * Create a new sexp object from an integer. |
| 89 | * @param n the integer value to store |
| 90 | */ |
| 91 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newi_16cxx . . $ SEXP_number_newi_16(22ab18c604af2454). (int16_tcxx . . $ int16_t# n); |
| 92 | |
| 93 | /** |
| 94 | * Create a new sexp object from an unsigned integer. |
| 95 | * @param n the unsigned integer value to store |
| 96 | */ |
| 97 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newu_16cxx . . $ SEXP_number_newu_16(d369128c9e25efab). (uint16_tcxx . . $ uint16_t# n); |
| 98 | |
| 99 | /** |
| 100 | * Create a new sexp object from an integer. |
| 101 | * The size of the integer may be architecture dependent. |
| 102 | */ |
| 103 | #define SEXP_number_newicxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:103:9`! SEXP_number_newi_32 |
| 104 | |
| 105 | /** |
| 106 | * Create a new sexp object from an integer. |
| 107 | * @param n the integer value to store |
| 108 | */ |
| 109 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newi_32cxx . . $ SEXP_number_newi_32(ac44525e09ce977a). (int32_tcxx . . $ int32_t# n); |
| 110 | |
| 111 | /** |
| 112 | * Get integer value from a sexp object. |
| 113 | * The size of the integer may be architecture dependent. |
| 114 | */ |
| 115 | #define SEXP_number_geticxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:115:9`! SEXP_number_geti_32 |
| 116 | |
| 117 | /** |
| 118 | * Get integer value from a sexp object. |
| 119 | * @param s_exp the queried sexp object |
| 120 | */ |
| 121 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int32_tcxx . . $ int32_t# SEXP_number_geti_32cxx . . $ SEXP_number_geti_32(e77439d026b7e3ce). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 122 | |
| 123 | /** |
| 124 | * Get boolean value from a sexp object. |
| 125 | * @param s_exp the queried sexp object |
| 126 | */ |
| 127 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_number_getbcxx . . $ SEXP_number_getb(85f078d1f48ac431). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 128 | |
| 129 | /** |
| 130 | * Create a new sexp object from an unsigned integer. |
| 131 | * The size of the integer may be architecture dependent. |
| 132 | */ |
| 133 | #define SEXP_number_newucxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:133:9`! SEXP_number_newu_32 |
| 134 | |
| 135 | /** |
| 136 | * Create a new sexp object from an unsigned integer. |
| 137 | * @param n the integer value to store |
| 138 | */ |
| 139 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newu_32cxx . . $ SEXP_number_newu_32(8a1232211d6fd92a). (uint32_tcxx . . $ uint32_t# n); |
| 140 | |
| 141 | /** |
| 142 | * Get unsigned integer value from a sexp object. |
| 143 | * The size of the integer may be architecture dependent. |
| 144 | */ |
| 145 | #define SEXP_number_getucxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:145:10`! SEXP_number_getu_32 |
| 146 | |
| 147 | /** |
| 148 | * Get unsigned integer value from a sexp object. |
| 149 | * @param s_exp the queried sexp object |
| 150 | */ |
| 151 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! uint32_tcxx . . $ uint32_t# SEXP_number_getu_32cxx . . $ SEXP_number_getu_32(60e3bd3ad0f89996). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 152 | |
| 153 | /** |
| 154 | * Create a new sexp object from an integer. |
| 155 | * @param n the integer value to store |
| 156 | */ |
| 157 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newi_64cxx . . $ SEXP_number_newi_64(986154d47f221621). (int64_tcxx . . $ int64_t# n); |
| 158 | |
| 159 | /** |
| 160 | * Get integer value from a sexp object. |
| 161 | * @param s_exp the queried sexp object |
| 162 | */ |
| 163 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int64_tcxx . . $ int64_t# SEXP_number_geti_64cxx . . $ SEXP_number_geti_64(f56a5dddf3580f63). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 164 | |
| 165 | /** |
| 166 | * Create a new sexp object from an unsigned integer. |
| 167 | * @param n the integer value to store |
| 168 | */ |
| 169 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newu_64cxx . . $ SEXP_number_newu_64(6d23cce3a40f89fa). (uint64_tcxx . . $ uint64_t# n); |
| 170 | |
| 171 | /** |
| 172 | * Get unsigned integer value from a sexp object. |
| 173 | * @param s_exp the queried sexp object |
| 174 | */ |
| 175 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! uint64_tcxx . . $ uint64_t# SEXP_number_getu_64cxx . . $ SEXP_number_getu_64(7b7039adf1662ab5). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 176 | |
| 177 | /** |
| 178 | * Create a new sexp object from an floating point value. |
| 179 | * @param n the floating point value to store |
| 180 | */ |
| 181 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_number_newfcxx . . $ SEXP_number_newf(653b1881b211aa0d). (double n); |
| 182 | |
| 183 | /** |
| 184 | * Get floating point value from a sexp object. |
| 185 | * @param s_exp the queried sexp object |
| 186 | */ |
| 187 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! double SEXP_number_getfcxx . . $ SEXP_number_getf(6d586db1a89708ed). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 188 | |
| 189 | /** |
| 190 | * Get a value from a sexp object according to a specified type |
| 191 | * @param s_exp the queried sexp object |
| 192 | * @param dst buffer for the value |
| 193 | * @param type the desired number type |
| 194 | */ |
| 195 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_number_getcxx . . $ SEXP_number_get(c0d0e7c7d139d7d9). (const SEXP_tcxx . . $ SEXP_t# *s_exp, void *dst, SEXP_numtype_tcxx . . $ SEXP_numtype_t# type); |
| 196 | |
| 197 | /** |
| 198 | * Get unsigned integer value from a sexp object. |
| 199 | * @param s_exp the queried sexp object |
| 200 | */ |
| 201 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! uint16_tcxx . . $ uint16_t# SEXP_number_getu_16cxx . . $ SEXP_number_getu_16(65d2c8d3088f8738). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 202 | |
| 203 | /** |
| 204 | * Free the specified sexp object. |
| 205 | * @param s_exp the object to be freed |
| 206 | */ |
| 207 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void SEXP_number_freecxx . . $ SEXP_number_free(c6b28547479798f4). (SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 208 | |
| 209 | /** |
| 210 | * Check whether the provided sexp object is a number. |
| 211 | * @param s_exp the sexp object to be tested |
| 212 | */ |
| 213 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_numberpcxx . . $ SEXP_numberp(85f078d1f48ac431). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 214 | |
| 215 | /** |
| 216 | * Get the number type of an object. |
| 217 | * @param sexp the queried sexp object |
| 218 | */ |
| 219 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_numtype_tcxx . . $ SEXP_numtype_t# SEXP_number_typecxx . . $ SEXP_number_type(dfe0d2bfa8d6f3af). (const SEXP_tcxx . . $ SEXP_t# *sexp); |
| 220 | |
| 221 | /* |
| 222 | * string |
| 223 | */ |
| 224 | |
| 225 | /** |
| 226 | * Create a new sexp object from a string. |
| 227 | * @param string the string to be stored |
| 228 | * @param strlen the length of the string in bytes |
| 229 | */ |
| 230 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_string_newcxx . . $ SEXP_string_new(a588a58d7514eee2). (const void *string, size_tcxx . . $ size_t# strlen) __attribute__ ((nonnull (1))); |
| 231 | |
| 232 | /** |
| 233 | * Create a new sexp object from a format string. |
| 234 | * @param format the format of the new string |
| 235 | * @param ... arguments for the format |
| 236 | */ |
| 237 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_string_newfcxx . . $ SEXP_string_newf(b2137ed863725962). (const char *format, ...) __attribute__ ((format (printf, 1, 2), nonnull (1))); |
| 238 | |
| 239 | /** |
| 240 | * Free the specified sexp object. |
| 241 | * @param s_exp the object to be freed |
| 242 | */ |
| 243 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void SEXP_string_freecxx . . $ SEXP_string_free(c6b28547479798f4). (SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 244 | |
| 245 | /** |
| 246 | * Check whether the provided sexp object is a string. |
| 247 | * @param s_exp the sexp object to be tested |
| 248 | */ |
| 249 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_stringpcxx . . $ SEXP_stringp(85f078d1f48ac431). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 250 | |
| 251 | /** |
| 252 | * Get the length of a string in a sexp object. |
| 253 | * @param s_exp the queried sexp object |
| 254 | */ |
| 255 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! size_tcxx . . $ size_t# SEXP_string_lengthcxx . . $ SEXP_string_length(7b7039adf1662ab5). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 256 | |
| 257 | /** |
| 258 | * Compare a string in a sexp object with a C string. |
| 259 | * @param s_exp the sexp object to be compared |
| 260 | * @param str the C string to be compared |
| 261 | */ |
| 262 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_strcmpcxx . . $ SEXP_strcmp(3ef1a37bcb3c2a). (const SEXP_tcxx . . $ SEXP_t# *s_exp, const char *str) __attribute__ ((nonnull (2))); |
| 263 | |
| 264 | /** |
| 265 | * Compare a string in a sexp object with a C string. |
| 266 | * @param s_exp the sexp object to be compared |
| 267 | * @param str the C string to be compared |
| 268 | * @param n compare at most n bytes |
| 269 | */ |
| 270 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_strncmpcxx . . $ SEXP_strncmp(209fd5a59eedb5e1). (const SEXP_tcxx . . $ SEXP_t# *s_exp, const char *str, size_tcxx . . $ size_t# n) __attribute__ ((nonnull (2))); |
| 271 | |
| 272 | /** |
| 273 | * Get the n-th byte of a string. |
| 274 | * @param s_exp the sexp object holding the string |
| 275 | * @param n the index of the desired character |
| 276 | */ |
| 277 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_string_nthcxx . . $ SEXP_string_nth(229c2c0bb207cd4a). (const SEXP_tcxx . . $ SEXP_t# *s_exp, size_tcxx . . $ size_t# n); |
| 278 | |
| 279 | /** |
| 280 | * Get a C string from a sexp object. |
| 281 | */ |
| 282 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! char *SEXP_string_cstrcxx . . $ SEXP_string_cstr(c831a2fa12818dfe). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 283 | |
| 284 | /** |
| 285 | * Get a C string from a sexp object. |
| 286 | * The name is stored in the provided buffer. |
| 287 | * @param s_exp the queried object |
| 288 | * @param buf the buffer to store the name in |
| 289 | * @param len the length of the buffer |
| 290 | */ |
| 291 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! size_tcxx . . $ size_t# SEXP_string_cstr_rcxx . . $ SEXP_string_cstr_r(ca07af91a4fa826f). (const SEXP_tcxx . . $ SEXP_t# *s_exp, char *buf, size_tcxx . . $ size_t# len) __attribute__ ((nonnull (2))); |
| 292 | |
| 293 | /** |
| 294 | * Obsolete function. |
| 295 | */ |
| 296 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! char *SEXP_string_cstrpcxx . . $ SEXP_string_cstrp(c831a2fa12818dfe). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 297 | |
| 298 | /** |
| 299 | * Get a C substring from a sexp object. |
| 300 | * @param s_sexp the queried sexp object |
| 301 | * @param beg the position of the fisrt character of the substring |
| 302 | * @param len the length of the substring |
| 303 | */ |
| 304 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! char *SEXP_string_subcstrcxx . . $ SEXP_string_subcstr(362276acbc9e7b81). (const SEXP_tcxx . . $ SEXP_t# *s_exp, size_tcxx . . $ size_t# beg, size_tcxx . . $ size_t# len); |
| 305 | |
| 306 | /** |
| 307 | * Compare two sexp strings. |
| 308 | * @param str_a the first string to compare |
| 309 | * @param str_b the second string to compare |
| 310 | */ |
| 311 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_string_cmpcxx . . $ SEXP_string_cmp(40f0d25f01d6dc5f). (const SEXP_tcxx . . $ SEXP_t# *str_a, const SEXP_tcxx . . $ SEXP_t# *str_b); |
| 312 | |
| 313 | /** |
| 314 | * Try to cast the supplied sexp string to a boolean. |
| 315 | * @param s_ext the string to be cast |
| 316 | */ |
| 317 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_string_getbcxx . . $ SEXP_string_getb(85f078d1f48ac431). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 318 | |
| 319 | /* |
| 320 | * list |
| 321 | */ |
| 322 | |
| 323 | /** |
| 324 | * Create a new sexp list, optionally initialized with the provided sexp arguments. |
| 325 | * The argument list needs to be terminated with NULL. |
| 326 | * @param memb the first sexp object to be inserted into the new list. can be NULL. |
| 327 | * @param ... arbitrary number of elements to be inserted |
| 328 | */ |
| 329 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_newcxx . . $ SEXP_list_new(902e4f76566c8810). (SEXP_tcxx . . $ SEXP_t# *memb, ...); |
| 330 | |
| 331 | /** |
| 332 | * Free the specified sexp object. |
| 333 | * @param s_exp the object to be freed |
| 334 | */ |
| 335 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void SEXP_list_freecxx . . $ SEXP_list_free(c6b28547479798f4). (SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 336 | |
| 337 | /** |
| 338 | * Check whether the provided sexp object is a list. |
| 339 | * @param s_exp the sexp object to be tested |
| 340 | */ |
| 341 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_listpcxx . . $ SEXP_listp(85f078d1f48ac431). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 342 | |
| 343 | /** |
| 344 | * Get the length of the sexp list. |
| 345 | * @param s_sexp the queried sexp object |
| 346 | */ |
| 347 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! size_tcxx . . $ size_t# SEXP_list_lengthcxx . . $ SEXP_list_length(7b7039adf1662ab5). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 348 | |
| 349 | /** |
| 350 | * Get the first element of a list. |
| 351 | * This function increments element's reference count |
| 352 | * @param list the queried sexp object |
| 353 | */ |
| 354 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_firstcxx . . $ SEXP_list_first(2f7f980afaaae0f0). (const SEXP_tcxx . . $ SEXP_t# *list); |
| 355 | |
| 356 | /** |
| 357 | * Get the rest of a list. |
| 358 | * This function increments elements' reference count. |
| 359 | * @param list the queried sexp object |
| 360 | */ |
| 361 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_restcxx . . $ SEXP_list_rest(2f7f980afaaae0f0). (const SEXP_tcxx . . $ SEXP_t# *list); |
| 362 | |
| 363 | /** |
| 364 | * Get the last element of a list. |
| 365 | * This function increments element's reference count. |
| 366 | * @param list the queried sexp object |
| 367 | */ |
| 368 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_lastcxx . . $ SEXP_list_last(2f7f980afaaae0f0). (const SEXP_tcxx . . $ SEXP_t# *list); |
| 369 | |
| 370 | /** |
| 371 | * Get the n-th element of a list. |
| 372 | * This function increments element's reference count. |
| 373 | * @param list the queried sexp object |
| 374 | * @param n the position of the element in the list |
| 375 | */ |
| 376 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_nthcxx . . $ SEXP_list_nth(8cad6aa883a18669). (const SEXP_tcxx . . $ SEXP_t# *list, uint32_tcxx . . $ uint32_t# n); |
| 377 | |
| 378 | /** |
| 379 | * Add an element to a list. |
| 380 | * This function increments element's reference count. |
| 381 | * @param list the modified sexp object |
| 382 | * @param s_exp the element to be added |
| 383 | */ |
| 384 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_addcxx . . $ SEXP_list_add(35a066576d9f6ea6). (SEXP_tcxx . . $ SEXP_t# *list, const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 385 | |
| 386 | /** |
| 387 | * Create a new list containing the concatenated contents of two lists. |
| 388 | * This function increments element's reference count. |
| 389 | * @param list_a the first list to be contatenated |
| 390 | * @param list_b the list to be attached to the first one |
| 391 | */ |
| 392 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_joincxx . . $ SEXP_list_join(fcf1a664115faa7). (const SEXP_tcxx . . $ SEXP_t# *list_a, const SEXP_tcxx . . $ SEXP_t# *list_b); |
| 393 | |
| 394 | /** |
| 395 | * Push an element to the head of a list. |
| 396 | * This function increments element's reference count. |
| 397 | * @param list the modified sexp object |
| 398 | * @param s_exp the element to be added |
| 399 | */ |
| 400 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_pushcxx . . $ SEXP_list_push(35a066576d9f6ea6). (SEXP_tcxx . . $ SEXP_t# *list, const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 401 | |
| 402 | /** |
| 403 | * Extract the first element of a list. |
| 404 | * This function increments element's reference count. |
| 405 | * @param list the modified sexp object |
| 406 | */ |
| 407 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_popcxx . . $ SEXP_list_pop(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *list); |
| 408 | |
| 409 | /** |
| 410 | * Sort a list using `compare' as the comparison function. |
| 411 | */ |
| 412 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_sortcxx . . $ SEXP_list_sort(f1a1abf038bb4496).(SEXP_tcxx . . $ SEXP_t# *list, int(*compare)(const SEXP_tcxx . . $ SEXP_t# *, const SEXP_tcxx . . $ SEXP_t# *)); |
| 413 | |
| 414 | /** |
| 415 | * Replace the n-th element of a list. |
| 416 | * This function increments element's reference count. |
| 417 | * @param list the modified sexp object |
| 418 | * @param n the index of the element to be replaced |
| 419 | * @param s_exp the element to be added |
| 420 | * @return the replaced element |
| 421 | */ |
| 422 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_replacecxx . . $ SEXP_list_replace(e5ee5adb82430ce5). (SEXP_tcxx . . $ SEXP_t# *list, uint32_tcxx . . $ uint32_t# n, const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 423 | |
| 424 | /** |
| 425 | * Get the first element of a list. |
| 426 | * This function creates a soft reference to the element. |
| 427 | * @param list the queried sexp object |
| 428 | */ |
| 429 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_listref_firstcxx . . $ SEXP_listref_first(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *list); |
| 430 | |
| 431 | /** |
| 432 | * Get the rest of a list. |
| 433 | * This function creates a soft reference to the list. |
| 434 | * @param list the queried sexp object |
| 435 | */ |
| 436 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_listref_restcxx . . $ SEXP_listref_rest(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *list); |
| 437 | |
| 438 | /** |
| 439 | * Get the last element of a list. |
| 440 | * This function creates a soft reference to the element. |
| 441 | * @param list the queried sexp object |
| 442 | */ |
| 443 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_listref_lastcxx . . $ SEXP_listref_last(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *list); |
| 444 | |
| 445 | /** |
| 446 | * Get the n-th element of a list. |
| 447 | * This function creates a soft reference to the element. |
| 448 | * @param list the queried sexp object |
| 449 | * @param n the position of the element in the list |
| 450 | */ |
| 451 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_listref_nthcxx . . $ SEXP_listref_nth(3d152c928d5432a1). (SEXP_tcxx . . $ SEXP_t# *list, uint32_tcxx . . $ uint32_t# n); |
| 452 | |
| 453 | typedef struct SEXP_itcxx . . $ SEXP_it# SEXP_it_tcxx . . $ SEXP_it_t#; |
| 454 | |
| 455 | #define SEXP_IT_RECURSIVEcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:455:9`! 0x01 |
| 456 | #define SEXP_IT_HARDREFcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:456:9`! 0x02 |
| 457 | |
| 458 | typedef struct SEXP_list_itcxx . . $ SEXP_list_it# SEXP_list_itcxx . . $ SEXP_list_it#; |
| 459 | |
| 460 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_list_itcxx . . $ SEXP_list_it# *SEXP_list_it_newcxx . . $ SEXP_list_it_new(2de72d43957235bf).(const SEXP_tcxx . . $ SEXP_t# *list); |
| 461 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_list_it_nextcxx . . $ SEXP_list_it_next(f72e6ecf0b5bba25).(SEXP_list_itcxx . . $ SEXP_list_it# *it); |
| 462 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void SEXP_list_it_freecxx . . $ SEXP_list_it_free(d620acf0ef959856).(SEXP_list_itcxx . . $ SEXP_list_it# *it); |
| 463 | |
| 464 | /* TODO: use alloca & softref_r here */ |
| 465 | /** |
| 466 | * Iterate through a list, assigning each element to a variable. |
| 467 | * @param var the var variable is assigned one value from the list in each cycle |
| 468 | * @param list the list the loop iterates through |
| 469 | */ |
| 470 | #define SEXP_list_foreachcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:470:9`!(var, list) \ |
| 471 | for (uint32_t OSCAP_CONCAT(i,__LINE__) = 1; ((var) = SEXP_list_nth (list, OSCAP_CONCAT(i,__LINE__))) != NULL; ++OSCAP_CONCAT(i,__LINE__), SEXP_free (var), (var) = NULL) |
| 472 | |
| 473 | /** |
| 474 | * Iterate through a sublist, assigning each element to a variable. |
| 475 | * @param var the var variable is assigned one value from the list in each cycle |
| 476 | * @param list the list the loop iterates through |
| 477 | * @param beg the index of the first element of the sublist |
| 478 | * @param end the index of the last element of the sublist |
| 479 | */ |
| 480 | #define SEXP_sublist_foreachcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:480:9`!(var, list, beg, end) \ |
| 481 | for (uint32_t OSCAP_CONCAT(i,__LINE__) = (beg); OSCAP_CONCAT(i,__LINE__) <= ((size_t)(end)) && ((var) = SEXP_list_nth (list, OSCAP_CONCAT(i,__LINE__))) != NULL; ++OSCAP_CONCAT(i,__LINE__), SEXP_free (var), (var) = NULL) |
| 482 | |
| 483 | #define SEXP_LIST_ENDcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:483:9`! (UINT32_MAX - 1) |
| 484 | |
| 485 | /* |
| 486 | * generic |
| 487 | */ |
| 488 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_newcxx . . $ SEXP_new(37a05408ab6be3bf). (void); |
| 489 | |
| 490 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_emptypcxx . . $ SEXP_emptyp(48c7cf01dfc2748d).(SEXP_tcxx . . $ SEXP_t# *sexp); |
| 491 | |
| 492 | /** |
| 493 | * Create a new reference to a sexp object. |
| 494 | * @param s_exp the object of which to increment the reference count |
| 495 | */ |
| 496 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_refcxx . . $ SEXP_ref(2f7f980afaaae0f0). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 497 | |
| 498 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_unrefcxx . . $ SEXP_unref(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *s_exp_o); |
| 499 | |
| 500 | /** |
| 501 | * Create a new soft reference to a sexp object. |
| 502 | * @param s_exp the object to which create the soft reference |
| 503 | */ |
| 504 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_softrefcxx . . $ SEXP_softref(478b347fcbbad3c5). (SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 505 | |
| 506 | /** |
| 507 | * Check whether an S-exp reference is a "soft" reference |
| 508 | * @param s_exp the S-exp reference |
| 509 | */ |
| 510 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_softrefpcxx . . $ SEXP_softrefp(85f078d1f48ac431).(const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 511 | |
| 512 | /** |
| 513 | * Return the value of the reference counter |
| 514 | * @param ref |
| 515 | */ |
| 516 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! uint32_tcxx . . $ uint32_t# SEXP_refscxx . . $ SEXP_refs(60e3bd3ad0f89996). (const SEXP_tcxx . . $ SEXP_t# *ref); |
| 517 | |
| 518 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_eqcxx . . $ SEXP_eq(24018bafaaa94db3). (const SEXP_tcxx . . $ SEXP_t# *a, const SEXP_tcxx . . $ SEXP_t# *b); |
| 519 | |
| 520 | /** |
| 521 | * Compare reference pointers. |
| 522 | */ |
| 523 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_refcmpcxx . . $ SEXP_refcmp(40f0d25f01d6dc5f).(const SEXP_tcxx . . $ SEXP_t# *a, const SEXP_tcxx . . $ SEXP_t# *b); |
| 524 | |
| 525 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! SEXP_deepcmpcxx . . $ SEXP_deepcmp(24018bafaaa94db3).(const SEXP_tcxx . . $ SEXP_t# *a, const SEXP_tcxx . . $ SEXP_t# *b); |
| 526 | |
| 527 | /** |
| 528 | * Free a sexp object. |
| 529 | * @param s_exp the object to be freed |
| 530 | */ |
| 531 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! void SEXP_freecxx . . $ SEXP_free(c6b28547479798f4). (SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 532 | |
| 533 | /** |
| 534 | * Get the user data type of a sexp object. |
| 535 | * @param s_exp the object to be queried |
| 536 | */ |
| 537 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! const char *SEXP_datatypecxx . . $ SEXP_datatype(d49ba2cc1d178e85). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 538 | |
| 539 | /** |
| 540 | * Set the user data type of a sexp object. |
| 541 | * @param s_exp the object to be modified |
| 542 | */ |
| 543 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_datatype_setcxx . . $ SEXP_datatype_set(a2348636b07aef22). (SEXP_tcxx . . $ SEXP_t# *s_exp, const char *name) __attribute__ ((nonnull (2))); |
| 544 | |
| 545 | /** |
| 546 | * Set the user data type of the nth sexp object in a list. |
| 547 | * @param list list containing the object to be modified |
| 548 | * @param n the position of the object |
| 549 | * @param name name of the user data type |
| 550 | */ |
| 551 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! int SEXP_datatype_set_nthcxx . . $ SEXP_datatype_set_nth(672bcb818e734bb1). (SEXP_tcxx . . $ SEXP_t# *list, uint32_tcxx . . $ uint32_t# n, const char *name) __attribute__ ((nonnull (3))); |
| 552 | |
| 553 | /** |
| 554 | * Get the type of a sexp object. |
| 555 | * @param s_exp the object to be queried |
| 556 | */ |
| 557 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_type_tcxx . . $ SEXP_type_t# SEXP_typeofcxx . . $ SEXP_typeof(dfe0d2bfa8d6f3af). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 558 | |
| 559 | /** |
| 560 | * Get a text description of the sexp object's type. |
| 561 | * @param s_exp the object to be queried |
| 562 | */ |
| 563 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! const char *SEXP_strtypecxx . . $ SEXP_strtype(d49ba2cc1d178e85). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 564 | |
| 565 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! SEXP_tcxx . . $ SEXP_t# *SEXP_buildcxx . . $ SEXP_build(b2137ed863725962). (const char *s_str, ...); |
| 566 | |
| 567 | OSCAP_APIcxx . . $ `src/common/public/oscap_export.h:42:15`! size_tcxx . . $ size_t# SEXP_sizeofcxx . . $ SEXP_sizeof(7b7039adf1662ab5). (const SEXP_tcxx . . $ SEXP_t# *s_exp); |
| 568 | |
| 569 | #if !defined(NDEBUGcxx . . $ `<built-in>:425:9`!) |
| 570 | # define SEXP_VALIDATE(s) __SEXP_VALIDATE(s, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
| 571 | # include <stdlib.h> |
| 572 | |
| 573 | OSCAP_API void __SEXP_VALIDATE(const SEXP_t *s_exp, const char *file, uint32_t line, const char *func); |
| 574 | |
| 575 | #else |
| 576 | # define SEXP_VALIDATEcxx . . $ `src/OVAL/probes/SEAP/public/sexp-manip.h:576:10`!(s) |
| 577 | #endif |
| 578 | |
| 579 | #ifdef __cplusplus |
| 580 | } |
| 581 | #endif |
| 582 | |
| 583 | #endif /* SEXP_MANIP_H */ |
| 584 | /// @} |
| 585 | /// @} |
| 586 | /// @} |