Lines Matching refs:tbl

63 static int syscalltbl__init_native(struct syscalltbl *tbl)  in syscalltbl__init_native()  argument
72 entries = tbl->syscalls.entries = malloc(sizeof(struct syscall) * nr_entries); in syscalltbl__init_native()
73 if (tbl->syscalls.entries == NULL) in syscalltbl__init_native()
84 qsort(tbl->syscalls.entries, nr_entries, sizeof(struct syscall), syscallcmp); in syscalltbl__init_native()
85 tbl->syscalls.nr_entries = nr_entries; in syscalltbl__init_native()
86 tbl->syscalls.max_id = syscalltbl_native_max_id; in syscalltbl__init_native()
92 struct syscalltbl *tbl = malloc(sizeof(*tbl)); in syscalltbl__new() local
93 if (tbl) { in syscalltbl__new()
94 if (syscalltbl__init_native(tbl)) { in syscalltbl__new()
95 free(tbl); in syscalltbl__new()
99 return tbl; in syscalltbl__new()
102 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
104 zfree(&tbl->syscalls.entries); in syscalltbl__delete()
105 free(tbl); in syscalltbl__delete()
108 const char *syscalltbl__name(const struct syscalltbl *tbl __maybe_unused, int id) in syscalltbl__name()
113 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
115 struct syscall *sc = bsearch(name, tbl->syscalls.entries, in syscalltbl__id()
116 tbl->syscalls.nr_entries, sizeof(*sc), in syscalltbl__id()
122 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_next() argument
125 struct syscall *syscalls = tbl->syscalls.entries; in syscalltbl__strglobmatch_next()
127 for (i = *idx + 1; i < tbl->syscalls.nr_entries; ++i) { in syscalltbl__strglobmatch_next()
137 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
140 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()
149 struct syscalltbl *tbl = zalloc(sizeof(*tbl)); in syscalltbl__new() local
150 if (tbl) in syscalltbl__new()
151 tbl->audit_machine = audit_detect_machine(); in syscalltbl__new()
152 return tbl; in syscalltbl__new()
155 void syscalltbl__delete(struct syscalltbl *tbl) in syscalltbl__delete() argument
157 free(tbl); in syscalltbl__delete()
160 const char *syscalltbl__name(const struct syscalltbl *tbl, int id) in syscalltbl__name() argument
162 return audit_syscall_to_name(id, tbl->audit_machine); in syscalltbl__name()
165 int syscalltbl__id(struct syscalltbl *tbl, const char *name) in syscalltbl__id() argument
167 return audit_name_to_syscall(name, tbl->audit_machine); in syscalltbl__id()
170 int syscalltbl__strglobmatch_next(struct syscalltbl *tbl __maybe_unused, in syscalltbl__strglobmatch_next()
176 int syscalltbl__strglobmatch_first(struct syscalltbl *tbl, const char *syscall_glob, int *idx) in syscalltbl__strglobmatch_first() argument
178 return syscalltbl__strglobmatch_next(tbl, syscall_glob, idx); in syscalltbl__strglobmatch_first()