| 1 | /* |
| 2 | * AIDE (Advanced Intrusion Detection Environment) |
| 3 | * |
| 4 | * Copyright (C) 1999-2002, 2006, 2013, 2020-2024 Rami Lehti, Pablo Virolainen, |
| 5 | * Richard van den Berg, Hannes von Haugwitz |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License as |
| 9 | * published by the Free Software Foundation; either version 2 of the |
| 10 | * License, or (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, but |
| 13 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 | * General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | */ |
| 21 | |
| 22 | #ifndef _UTIL_H_INCLUDED |
| 23 | #define _UTIL_H_INCLUDEDcxx . . $ `include/util.h:23:9`! |
| 24 | #include "config.h"cxx . . $ `<file>/include/config.h`/ |
| 25 | #include <string.h> |
| 26 | #include <stdbool.h> |
| 27 | #include <inttypes.h> |
| 28 | #include <sys/types.h> |
| 29 | #include <stdarg.h> |
| 30 | #include <time.h> |
| 31 | #include "url.h"cxx . . $ `<file>/include/url.h`/ |
| 32 | |
| 33 | #define HEXD2ASCcxx . . $ `include/util.h:33:9`!(x) (((x) < 10) ? ((x) + '0') : ((x) - 10 + 'A')) |
| 34 | |
| 35 | #define ASC2HEXDcxx . . $ `include/util.h:35:9`!(x) (((x) >= '0' && (x) <= '9') ? \ |
| 36 | ((x) - '0') : (toupper(x) - 'A' + 10)) |
| 37 | |
| 38 | #define ISXDIGITcxx . . $ `include/util.h:38:9`!(x) isxdigit ((unsigned char)(x)) |
| 39 | |
| 40 | #ifndef HAVE_STRICMP |
| 41 | # define stricmpcxx . . $ `include/util.h:41:11`!(a,b) strcasecmp( (a), (b) ) |
| 42 | #endif |
| 43 | |
| 44 | #ifndef HAVE_BYTE |
| 45 | typedef uint8_tcxx . . $ uint8_t# bytecxx . . $ byte#; |
| 46 | #endif |
| 47 | |
| 48 | #define COLOR_L_BLACKcxx . . $ `include/util.h:48:9`! "\x1B[0;30m" |
| 49 | #define COLOR_L_REDcxx . . $ `include/util.h:49:9`! "\x1B[0;31m" |
| 50 | #define COLOR_L_GREENcxx . . $ `include/util.h:50:9`! "\x1B[0;32m" |
| 51 | #define COLOR_L_ORANGEcxx . . $ `include/util.h:51:9`! "\x1B[0;33m" |
| 52 | #define COLOR_L_BLUEcxx . . $ `include/util.h:52:9`! "\x1B[0;34m" |
| 53 | #define COLOR_L_PURPLEcxx . . $ `include/util.h:53:9`! "\x1B[0;35m" |
| 54 | #define COLOR_L_CYANcxx . . $ `include/util.h:54:9`! "\x1B[0;36m" |
| 55 | #define COLOR_L_GRAYcxx . . $ `include/util.h:55:9`! "\x1B[0;37m" |
| 56 | |
| 57 | #define COLOR_B_GRAYcxx . . $ `include/util.h:57:9`! "\x1B[1;30m" |
| 58 | #define COLOR_B_REDcxx . . $ `include/util.h:58:9`! "\x1B[1;31m" |
| 59 | #define COLOR_B_GREENcxx . . $ `include/util.h:59:9`! "\x1B[1;32m" |
| 60 | #define COLOR_B_YELLOWcxx . . $ `include/util.h:60:9`! "\x1B[1;33m" |
| 61 | #define COLOR_B_BLUEcxx . . $ `include/util.h:61:9`! "\x1B[1;34m" |
| 62 | #define COLOR_B_PURPLEcxx . . $ `include/util.h:62:9`! "\x1B[1;35m" |
| 63 | #define COLOR_B_CYANcxx . . $ `include/util.h:63:9`! "\x1B[1;36m" |
| 64 | #define COLOR_B_WHITEcxx . . $ `include/util.h:64:9`! "\x1B[1;37m" |
| 65 | |
| 66 | #define COLOR_RESETcxx . . $ `include/util.h:66:9`! "\x1B[0m" |
| 67 | |
| 68 | void stderr_msgcxx . . $ stderr_msg(326aeb464d16410c).(const char* format, ...) |
| 69 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 70 | __attribute__ ((format (printf, 1, 2))) |
| 71 | #endif |
| 72 | ; |
| 73 | void vstderr_prefix_linecxx . . $ vstderr_prefix_line(b6c459c43e1e83c7).(const char*, const char*, va_listcxx . . $ va_list#) |
| 74 | #ifdef __GNUC__cxx . . $ `<built-in>:8:9`! |
| 75 | __attribute__ ((format (printf, 1, 0))) |
| 76 | #endif |
| 77 | ; |
| 78 | void stderr_set_line_erasurecxx . . $ stderr_set_line_erasure(b45ddcbc8423892c).(boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!); |
| 79 | |
| 80 | const char* btoacxx . . $ btoa(626eec357d49c77e).(boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`!); |
| 81 | |
| 82 | void* checked_malloccxx . . $ checked_malloc(bfcfa4d6b7f7ef64).(size_tcxx . . $ size_t#); |
| 83 | void* checked_calloccxx . . $ checked_calloc(63a7bf2941bfcd7a).(size_tcxx . . $ size_t#, size_tcxx . . $ size_t#); |
| 84 | void* checked_strdupcxx . . $ checked_strdup(42228c1987407501).(const char *); |
| 85 | void* checked_strndupcxx . . $ checked_strndup(4fa1592a5e6de496).(const char *, size_tcxx . . $ size_t#); |
| 86 | void* checked_realloccxx . . $ checked_realloc(417ab160f6baadc6).(void *, size_tcxx . . $ size_t#); |
| 87 | |
| 88 | int cmpurlcxx . . $ cmpurl(4d6c4d40bb1e144a).(url_tcxx . . $ url_t#*, url_tcxx . . $ url_t#*); |
| 89 | |
| 90 | int contains_unsafecxx . . $ contains_unsafe(5c4306d8553b3696).(const char*); |
| 91 | |
| 92 | char *strnesccxx . . $ strnesc(eabdfdef77619b3d).(const char *, size_tcxx . . $ size_t#); |
| 93 | char *stresccxx . . $ stresc(a8b8e32347182212).(const char *); |
| 94 | |
| 95 | void decode_stringcxx . . $ decode_string(fda57c8427c60377).(char*); |
| 96 | |
| 97 | char* encode_stringcxx . . $ encode_string(a8b8e32347182212).(const char*); |
| 98 | |
| 99 | char *get_progress_bar_stringcxx . . $ get_progress_bar_string(567eccb82e01d0a1).(const char *, const char *, long unsigned, long unsigned, int, int); |
| 100 | |
| 101 | char* perm_to_charcxx . . $ perm_to_char(f109d7e0a0ca42b3).(mode_tcxx . . $ mode_t# perm); |
| 102 | |
| 103 | char *expand_tildecxx . . $ expand_tilde(7a9722d75b371431).(char * path); |
| 104 | |
| 105 | char* byte_to_base16cxx . . $ byte_to_base16(422350ec2b3c7f).(const bytecxx . . $ byte#*, size_tcxx . . $ size_t#); |
| 106 | |
| 107 | char* pipe2stringcxx . . $ pipe2string(ff224f080444ee45).(int); |
| 108 | |
| 109 | char* get_time_stringcxx . . $ get_time_string(4e4bbfda8d4b3d77).(const time_tcxx . . $ time_t# *); |
| 110 | |
| 111 | void mask_sigcxx . . $ mask_sig(85c52e162fed56f9).(const char*); |
| 112 | |
| 113 | #ifndef HAVE_STRNSTR |
| 114 | char* strnstrcxx . . $ strnstr(4b1661a75e253f1d).(char* haystack,char* needle,int n); |
| 115 | #endif |
| 116 | |
| 117 | #ifndef HAVE_STRNLENcxx . . $ `include/config.h:98:9`! |
| 118 | size_t strnlen(const char *s, size_t maxlen); |
| 119 | #endif |
| 120 | |
| 121 | #ifdef HAVE_SYSLOGcxx . . $ `include/config.h:110:9`! |
| 122 | int syslog_facility_lookupcxx . . $ syslog_facility_lookup(1ef8e6ec083aabb9).(char *); |
| 123 | #endif |
| 124 | |
| 125 | #endif |