| 1 | /* |
| 2 | * Copyright 2010 Red Hat Inc., Durham, North Carolina. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This library is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU Lesser General Public |
| 7 | * License as published by the Free Software Foundation; either |
| 8 | * version 2.1 of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This library is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * Lesser General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU Lesser General Public |
| 16 | * License along with this library; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | * |
| 19 | * Authors: |
| 20 | * "Daniel Kopecek" <[email protected]> |
| 21 | */ |
| 22 | |
| 23 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:409:9`! |
| 24 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 25 | #endif |
| 26 | |
| 27 | #include <stddef.h> |
| 28 | #include <errno.h> |
| 29 | |
| 30 | #include "_seap-command.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/_seap-command.h`/ |
| 31 | #include "generic/rbt/rbt.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/generic/rbt/rbt.h`/ |
| 32 | #include "seap-command-backendT.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/seap-command-backendT.h`/ |
| 33 | |
| 34 | typedef rbt_tcxx . . $ rbt_t# Ttable_tcxx . . $ Ttable_t#; |
| 35 | |
| 36 | static Ttable_tcxx . . $ Ttable_t# *Ttable_newcxx . . $ Ttable_new(cfbd02820be58510). (size_tcxx . . $ size_t# capacity) |
| 37 | { |
| 38 | Ttable_tcxx . . $ Ttable_t# *t; |
| 39 | |
| 40 | t = rbt_i32_newcxx . . $ rbt_i32_new(557e4aca7c153cb).(); |
| 41 | |
| 42 | return (t); |
| 43 | } |
| 44 | |
| 45 | static int Ttable_addcxx . . $ Ttable_add(e8c8a72fe07e4abe). (Ttable_tcxx . . $ Ttable_t# *t, SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *r) |
| 46 | { |
| 47 | return rbt_i32_addcxx . . $ rbt_i32_add(3215e2e734e57b31).(t, (int32_tcxx . . $ int32_t#) r->codecxx . . $ $anonymous_type_a585f4dc5f186eef_0#code., (void *)r, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 48 | } |
| 49 | |
| 50 | static SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *Ttable_getcxx . . $ Ttable_get(5decd91182034495). (Ttable_tcxx . . $ Ttable_t# *t, SEAP_cmdcode_tcxx . . $ SEAP_cmdcode_t# c) |
| 51 | { |
| 52 | SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *r = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 53 | |
| 54 | rbt_i32_getcxx . . $ rbt_i32_get(fbdfcf5a3c6c46ec).(t, (int32_tcxx . . $ int32_t#)c, (void *)&r); |
| 55 | |
| 56 | return (r); |
| 57 | } |
| 58 | |
| 59 | int SEAP_cmdtbl_backendT_addcxx . . $ SEAP_cmdtbl_backendT_add(91a94bcfad148675). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t, SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *r) |
| 60 | { |
| 61 | if (t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 62 | t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table. = Ttable_newcxx . . $ Ttable_new(cfbd02820be58510).(-1); |
| 63 | |
| 64 | if (t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 65 | return -1; |
| 66 | } |
| 67 | |
| 68 | return Ttable_addcxx . . $ Ttable_add(e8c8a72fe07e4abe). ((Ttable_tcxx . . $ Ttable_t# *)t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table., r); |
| 69 | } |
| 70 | |
| 71 | int SEAP_cmdtbl_backendT_inscxx . . $ SEAP_cmdtbl_backendT_ins(91a94bcfad148675). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t, SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *r) |
| 72 | { |
| 73 | errnocxx . . $ `<external>/17633486526465735210/errno.h:38:10`! = EOPNOTSUPPcxx . . $ `<external>/17922322188510340118/errno.h:79:9`!; |
| 74 | return (-1); |
| 75 | } |
| 76 | |
| 77 | int SEAP_cmdtbl_backendT_delcxx . . $ SEAP_cmdtbl_backendT_del(c318b9daec7b3026). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t, SEAP_cmdcode_tcxx . . $ SEAP_cmdcode_t# c) |
| 78 | { |
| 79 | SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *tr = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 80 | |
| 81 | if (rbt_i32_delcxx . . $ rbt_i32_del(fbdfcf5a3c6c46ec).((Ttable_tcxx . . $ Ttable_t#*)t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table., (int32_tcxx . . $ int32_t#)c, (void *)&tr) != 0) |
| 82 | return (-1); |
| 83 | |
| 84 | SEAP_cmdrec_freecxx . . $ SEAP_cmdrec_free(5f039f4040bea21b).(tr); |
| 85 | |
| 86 | return(0); |
| 87 | } |
| 88 | |
| 89 | SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *SEAP_cmdtbl_backendT_getcxx . . $ SEAP_cmdtbl_backendT_get(e4b5e91c7ff4ee30). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t, SEAP_cmdcode_tcxx . . $ SEAP_cmdcode_t# c) |
| 90 | { |
| 91 | return (t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! ? NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`! : Ttable_getcxx . . $ Ttable_get(5decd91182034495). ((Ttable_tcxx . . $ Ttable_t# *)t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table., c)); |
| 92 | } |
| 93 | |
| 94 | static void backendT_free_callbackcxx . . $ backendT_free_callback(5d3939e05c3402e7).(struct rbt_i32_nodecxx . . $ rbt_i32_node# *n) |
| 95 | { |
| 96 | SEAP_cmdrec_freecxx . . $ SEAP_cmdrec_free(5f039f4040bea21b).(n->datacxx . . $ rbt_i32_node#data.); |
| 97 | } |
| 98 | |
| 99 | void SEAP_cmdtbl_backendT_freecxx . . $ SEAP_cmdtbl_backendT_free(52f2919cbb21a2a). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t) |
| 100 | { |
| 101 | if (t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table. != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 102 | rbt_i32_free_cbcxx . . $ rbt_i32_free_cb(bb6fef081ac885b3).((Ttable_tcxx . . $ Ttable_t# *)(t->tablecxx . . $ $anonymous_type_5317b32fcdb93fc7_1#table.), &backendT_free_callbackcxx . . $ backendT_free_callback(5d3939e05c3402e7).); |
| 103 | } |
| 104 | |
| 105 | int SEAP_cmdtbl_backendT_applycxx . . $ SEAP_cmdtbl_backendT_apply(cadb4b706dc75322). (SEAP_cmdtbl_tcxx . . $ SEAP_cmdtbl_t# *t, int (*func) (SEAP_cmdrec_tcxx . . $ SEAP_cmdrec_t# *r, void *), void *arg) |
| 106 | { |
| 107 | /* |
| 108 | size_t i, l; |
| 109 | int ret; |
| 110 | |
| 111 | Ttable_t *St; |
| 112 | |
| 113 | St = (Ttable_t *)(t->table); |
| 114 | */ |
| 115 | |
| 116 | return (-1); |
| 117 | } |