Debian Codegraph @

src/OVAL/probes/SEAP/generic/common.c

raw symbols SCIP
1 /*
2 * Copyright 2009 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 <string.h>
28 #include <stdlib.h>
29 #include <stdint.h>
30 #include <assert.h>
31
32 #include "common.h"cxx . . $ `<file>/src/OVAL/probes/SEAP/generic/common.h`/
33 #include "debug_priv.h"cxx . . $ `<file>/src/common/debug_priv.h`/
34
35 void *xmemdupcxx . . $ xmemdup(7ca5e6a2fd1baf31). (const void *src, size_t len)
36 {
37 void *new;
38
39 _Acxx . . $ `src/common/debug_priv.h:43:9`!(src != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
40
41 new = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(len);
42 memcpycxx . . $ memcpy(cc817cb175f282d). (new, src, len);
43
44 return (new);
45 }
46
47 uint32_tcxx . . $ uint32_t# xnumdigitscxx . . $ xnumdigits(ea88b852781e8a38). (size_t size)
48 {
49 uint32_tcxx . . $ uint32_t# i = 0;
50
51 do {
52 ++i;
53 size /= 10;
54 } while (size > 0);
55
56 return (i);
57 }
58
59 int xstrncollcxx . . $ xstrncoll(72b392de286a3a71). (const char *a, size_t alen,
60 const char *b, size_t blen)
61 {
62 int cmp;
63
64 _Acxx . . $ `src/common/debug_priv.h:43:9`!(a != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
65 _Acxx . . $ `src/common/debug_priv.h:43:9`!(b != NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!);
66
67 if (alen > blen) {
68 cmp = strncmpcxx . . $ strncmp(fd278af2f295fa2e). (a, b, blen);
69 return (cmp == 0 ? 1 : cmp);
70 } else if (blen > alen) {
71 cmp = strncmpcxx . . $ strncmp(fd278af2f295fa2e). (a, b, alen);
72 return (cmp == 0 ? -1 : cmp);
73 } else {
74 return strncmpcxx . . $ strncmp(fd278af2f295fa2e). (a, b, alen);
75 }
76 }
77
78 void xsrandomcxx . . $ xsrandom(2c44cd906ae4e829). (unsigned long seed)
79 {
80 srandcxx . . $ srand(cb2f890c2fdad230).(seed);
81 }
82
83 long xrandomcxx . . $ xrandom(da6335ded91d79c2). (void)
84 {
85 return randcxx . . $ rand(b126dc7c1de90089).();
86 }