input stringlengths 16 454k | output stringlengths 13 350k | function_name stringlengths 1 100 | repo_name stringlengths 6 43 | category stringclasses 76
values | sample_id stringlengths 22 88 | decompiler stringclasses 1
value | opt_level stringclasses 1
value |
|---|---|---|---|---|---|---|---|
bool parse_char(re_parse *parse, int quoted, char *c) {
if (!more(parse))
return 0;
if (!quoted || *parse->rx != 92)
return next(parse, c);
++parse->rx;
return next(parse, c);
} | static bool parse_char(struct re_parse *parse, int quoted, char *c) {
if (!more(parse))
return false;
if (quoted && *parse->rx == '\\') {
parse->rx += 1;
return next(parse, c);
} else {
return next(parse, c);
}
} | parse_char | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void parse_char_class(re_parse *parse, re *re) {
char from;
char to;
unsigned long v4;
v4 = __readfsqword(0x28u);
if (!more(parse)) {
parse->error = 7;
return;
}
parse_char(parse, 0, &from);
to = from;
if (match(parse, 45)) {
if (!more(parse)) {
parse->error = 7;
return;
}... | static void parse_char_class(struct re_parse *parse, struct re *re) {
if (!more(parse)) {
parse->error = REG_EBRACK;
goto error;
}
char from, to;
parse_char(parse, 0, &from);
to = from;
if (match(parse, '-')) {
if (... | parse_char_class | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
re *parse_concat_exp(re_parse *parse) {
re *re;
re *re2;
re = parse_repeated_exp(parse);
if (!re)
goto error;
if (!more(parse) || peek(parse, ")|"))
return re;
re2 = parse_concat_exp(parse);
if (!re2)
goto error;
re = make_re_binop(re_type_CONCAT, re, re2);
if (re)
return re;
parse-... | static struct re *parse_concat_exp(struct re_parse *parse) {
struct re *re = parse_repeated_exp(parse);
if (re == NULL)
goto error;
if (more(parse) && !peek(parse, ")|")) {
struct re *re2 = parse_concat_exp(parse);
if (re2 == NULL)
... | parse_concat_exp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int parse_int(re_parse *parse) {
char *end;
const char *lim;
size_t used;
long l;
char *s;
unsigned long v7;
v7 = __readfsqword(0x28u);
for (lim = parse->rx; lim < parse->rend && *lim > 47 && *lim <= 57; ++lim)
;
if (lim >= parse->rend) {
s = strndup(parse->rx, parse->rend - parse->rx);
i... | static int parse_int(struct re_parse *parse) {
const char *lim;
char *end;
size_t used;
long l;
for (lim = parse->rx;
lim < parse->rend && *lim >= '0' && *lim <= '9'; lim++)
;
if (lim < parse->rend) {
l = strtou... | parse_int | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
re *parse_regexp(re_parse *parse) {
re *re;
re *re2;
if (peek(parse, "|"))
re = make_re(re_type_EPSILON);
else
re = parse_concat_exp(parse);
if (re) {
if (!match(parse, 124))
return re;
if (peek(parse, ")"))
re2 = make_re(re_type_EPSILON);
else
re2 = parse_regexp(parse);... | static struct re *parse_regexp(struct re_parse *parse) {
struct re *re = NULL;
if (peek(parse, "|"))
re = make_re(EPSILON);
else
re = parse_concat_exp(parse);
if (re == NULL)
goto error;
if (match(parse, '|')) {
... | parse_regexp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
re *parse_repeated_exp(re_parse *parse) {
int max;
int min;
re *re;
re = parse_simple_exp(parse);
if (re) {
if (match(parse, 63)) {
re = make_re_rep(re, 0, 1);
LABEL_22:
if (!re)
parse->error = 12;
return re;
}
if (match(parse, 42)) {
re = make_re_rep(re, 0, -1... | static struct re *parse_repeated_exp(struct re_parse *parse) {
struct re *re = parse_simple_exp(parse);
if (re == NULL)
goto error;
if (match(parse, '?')) {
re = make_re_rep(re, 0, 1);
} else if (match(parse, '*')) {
re = make_re_rep(re,... | parse_repeated_exp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
re *parse_simple_exp(re_parse *parse) {
char c;
bool negate;
re *re;
unsigned long v5;
v5 = __readfsqword(0x28u);
re = 0;
if (match(parse, 91)) {
negate = match(parse, 94);
re = make_re_char_set(negate, (*((_BYTE *)parse + 20) & 1) != 0);
if (!re) {
parse->error = 12;
goto error;
... | static struct re *parse_simple_exp(struct re_parse *parse) {
struct re *re = NULL;
if (match(parse, '[')) {
bool negate = match(parse, '^');
re = make_re_char_set(negate, parse->no_ranges);
if (re == NULL) {
parse->error = REG_ESPACE;
... | parse_simple_exp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
bool peek(re_parse *parse, const char *chars) {
return *parse->rx && strchr(chars, *parse->rx);
} | static bool peek(struct re_parse *parse, const char *chars) {
return *parse->rx != '\0' && strchr(chars, *parse->rx) != NULL;
} | peek | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
char pick_char(trans *t) {
int c;
int c_0;
int c_1;
for (c = t->min; c <= t->max; ++c) {
if (((*__ctype_b_loc())[c] & 0x400) != 0)
return c;
}
for (c_0 = t->min; c_0 <= t->max; ++c_0) {
if (((*__ctype_b_loc())[c_0] & 8) != 0)
return c_0;
}
for (c_1 = t->min; c_1 <= t->max; ++c_1) {
... | static char pick_char(struct trans *t) {
for (int c = t->min; c <= t->max; c++)
if (isalpha(c))
return c;
for (int c = t->min; c <= t->max; c++)
if (isalnum(c))
return c;
for (int c = t->min; c <= t->max; c++)
if (ispr... | pick_char | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void print_char(FILE *out, uchar c) {
char *p;
p = strchr(asc_2E601, c);
if (p) {
fprintf(out, "\\\\%c",
(unsigned int)aSntvbrfa0[(_DWORD)p - (unsigned int)asc_2E601]);
} else if (((*__ctype_b_loc())[c] & 0x4000) != 0) {
if (c == 34)
fwrite("\\\"", 1u, 2u, out);
else
fputc(c... | static void print_char(FILE *out, uchar c) {
static const char *const escape_from = " \n\t\v\b\r\f\a/\0";
static const char *const escape_to = "sntvbrfa/0";
char *p = strchr(escape_from, c);
if (p != NULL) {
int i = p - escape_from;
fprintf(out, "\\... | print_char | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void print_char_set(re *set) {
int from;
int to;
if (set->negate)
printf("[^");
else
putchar(91);
for (from = 0; from <= 255; from = to + 1) {
while (bitset_get(set->cset, from) == set->c)
++from;
if (from > 255)
break;
for (to = from; to <= 254 && bitset_get(set->cset, to + 1... | static void print_char_set(struct re *set) {
int from, to;
if (set->negate)
printf("[^");
else
printf("[");
for (from = UCHAR_MIN; from <= UCHAR_MAX; from = to + 1) {
while (bitset_get(set->cset, from) == set->negate)
fro... | print_char_set | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void print_re(re *re) {
switch (re->type) {
case re_type_UNION:
print_re(re->exp1);
putchar(124);
print_re(re->exp2);
break;
case re_type_CONCAT:
print_re(re->exp1);
putchar(46);
print_re(re->exp2);
break;
case re_type_CSET:
print_char_set(re);
break;
case re_type_CHAR:... | ATTRIBUTE_UNUSED
static void print_re(struct re *re) {
switch (re->type) {
case UNION:
print_re(re->exp1);
printf("|");
print_re(re->exp2);
break;
case CONCAT:
print_re(re->exp1);
printf(".");
... | print_re | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
hash_val_t ptr_hash(const void *p) {
const void *pa;
int i;
hash_val_t hash;
char *c;
pa = p;
hash = 0;
c = (char *)&pa;
for (i = 0; (unsigned int)i <= 7; ++i) {
hash += c[i];
hash *= 1025LL;
hash ^= hash >> 6;
}
return 32769 * (((9 * hash) >> 11) ^ (9 * hash));
} | static hash_val_t ptr_hash(const void *p) {
hash_val_t hash = 0;
char *c = (char *)&p;
for (int i = 0; i < sizeof(p); i++) {
hash += c[i];
hash += (hash << 10);
hash ^= (hash >> 6);
}
hash += (hash << 3);
hash ^= (h... | ptr_hash | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_as_string(const re *re, re_str *str) {
int result;
result = 0;
switch (re->type) {
case re_type_UNION:
return re_union_as_string(re, str);
case re_type_CONCAT:
return re_concat_as_string(re, str);
case re_type_CSET:
return re_cset_as_string(re, str);
case re_type_CHAR:
if (re->nega... | static int re_as_string(const struct re *re, struct re_str *str) {
static const char *const special_chars = ".()[]{}*|+?\\^$";
int result = 0;
switch (re->type) {
case UNION:
result = re_union_as_string(re, str);
break;
case CONCAT:
... | re_as_string | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_binop_count(re_type type, const re *re) {
int v2;
if ((unsigned int)type >= re_type_CSET)
__assert_fail("type == CONCAT || type == UNION", "fa.c", 0xDEDu,
"re_binop_count");
if (type != re->type)
return 1;
v2 = re_binop_count(type, re->exp1);
return v2 + re_binop_count(type, ... | static int re_binop_count(enum re_type type, const struct re *re) {
assert(type == CONCAT || type == UNION);
if (re->type == type) {
return re_binop_count(type, re->exp1) +
re_binop_count(type, re->exp2);
} else {
return 1;
}
... | re_binop_count | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_binop_store(re_type type, const re *re, const re **list) {
int posa;
if (type == re->type) {
posa = re_binop_store(type, re->exp1, list);
return re_binop_store(type, re->exp2, &list[posa]) + posa;
} else {
*list = re;
return 1;
}
} | static int re_binop_store(enum re_type type, const struct re *re,
const struct re **list) {
int pos = 0;
if (type == re->type) {
pos = re_binop_store(type, re->exp1, list);
pos += re_binop_store(type, re->exp2, list + pos);
} ... | re_binop_store | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_case_expand(re *re) {
unsigned int v2;
unsigned int v3;
unsigned int v5;
unsigned int v6;
int result;
int c;
int c_0;
int c_1;
int r1;
int r2;
result = 0;
switch (re->type) {
case re_type_UNION:
case re_type_CONCAT:
r1 = re_case_expand(re->exp1);
r2 = re_case_expand(re->exp2)... | static int re_case_expand(struct re *re) {
int result = 0, r1, r2;
switch (re->type) {
case UNION:
case CONCAT:
r1 = re_case_expand(re->exp1);
r2 = re_case_expand(re->exp2);
result = (r1 != 0) ? r1 : r2;
break;
c... | re_case_expand | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_collapse_trans(state *s1, state *s2, re *r1, re *loop, re *r2) {
re *v5;
re *v6;
re *v7;
re *v8;
re *v9;
re *v10;
re *v11;
re *v12;
re *loopa;
re *re;
trans *t;
loopa = loop;
if (loop->type != re_type_EPSILON) {
if (!loop || loop->ref == -1) {
v5 = loop;
} else {
++... | static int re_collapse_trans(struct state *s1, struct state *s2,
struct re *r1, struct re *loop,
struct re *r2) {
struct re *re = NULL;
if (loop->type != EPSILON) {
loop = make_re_rep(ref(loop), 0, -1);
... | re_collapse_trans | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_concat_as_string(const re *re, re_str *str) {
char *v2;
char *v3;
int result;
int i;
int i_0;
int i_1;
int nre;
const re **res;
re_str *strings;
char *p;
unsigned long v13;
v13 = __readfsqword(0x28u);
if (re->type != re_type_CONCAT)
__assert_fail("re->type == CONCAT", "fa.c", 0xE3E... | static int re_concat_as_string(const struct re *re,
struct re_str *str) {
assert(re->type == CONCAT);
const struct re **res = NULL;
struct re_str *strings = NULL;
int nre = 0, r;
int result = -1;
nre = re_binop_c... | re_concat_as_string | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_cset_as_string(const re *re, re_str *str) {
bool v2;
long v3;
char *v4;
char *v5;
char *v6;
char *v7;
char *v8;
char *v9;
_BYTE *v10;
char *v11;
int from;
int froma;
int fromb;
int fromc;
int fromd;
int frome;
int to;
int toa;
_BOOL4 incl_rbrack;
_BOOL4 incl_dash;
int ne... | static int re_cset_as_string(const struct re *re, struct re_str *str) {
const uchar rbrack = ']';
const uchar dash = '-';
const uchar nul = '\0';
static const char *const empty_set = "[]";
static const char *const total_set = "(.|\n)";
static const char... | re_cset_as_string | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_iter_as_string(const re *re, re_str *str) {
size_t v3;
size_t v4;
size_t v5;
size_t len;
size_t v7;
size_t v8;
int result;
char *iter;
const char *quant;
unsigned long v12;
v12 = __readfsqword(0x28u);
quant = 0;
iter = 0;
result = -1;
if (re_as_string(re->exp1, str) < 0)
return... | static int re_iter_as_string(const struct re *re, struct re_str *str) {
const char *quant = NULL;
char *iter = NULL;
int r, result = -1;
if (re_as_string(re->exp, str) < 0)
return -1;
if (re->min == 0 && re->max == -1) {
quant = "*";
... | re_iter_as_string | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_needs_parens_in_concat(const re *re) {
return re->type != re_type_CHAR && re->type != re_type_CSET &&
re->type != re_type_ITER;
} | ATTRIBUTE_PURE
static int re_needs_parens_in_concat(const struct re *re) {
return (re->type != CHAR && re->type != CSET && re->type != ITER);
} | re_needs_parens_in_concat | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_restrict_alphabet(re *re, uchar from, uchar to) {
int v3;
int result;
signed int i;
int r1;
int r2;
result = 0;
switch (re->type) {
case re_type_UNION:
case re_type_CONCAT:
r1 = re_restrict_alphabet(re->exp1, from, to);
r2 = re_restrict_alphabet(re->exp2, from, to);
if (r1)
v... | static int re_restrict_alphabet(struct re *re, uchar from, uchar to) {
int r1, r2;
int result = 0;
switch (re->type) {
case UNION:
case CONCAT:
r1 = re_restrict_alphabet(re->exp1, from, to);
r2 = re_restrict_alphabet(re->exp2, from, to);
... | re_restrict_alphabet | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_str_alloc(re_str *str) { return mem_alloc_n(str, 1u, str->len + 1); } | static int re_str_alloc(struct re_str *str) {
return ALLOC_N(str->rx, str->len + 1);
} | re_str_alloc | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int re_union_as_string(const re *re, re_str *str) {
char *v2;
int result;
int i;
int i_0;
int i_1;
int nre;
const re **res;
re_str *strings;
char *p;
unsigned long v12;
v12 = __readfsqword(0x28u);
if (re->type)
__assert_fail("re->type == UNION", "fa.c", 0xE03u, "re_union_as_string");
resu... | static int re_union_as_string(const struct re *re,
struct re_str *str) {
assert(re->type == UNION);
int result = -1;
const struct re **res = NULL;
struct re_str *strings = NULL;
int nre = 0, r;
nre = re_binop_coun... | re_union_as_string | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void reduce(fa *fa) {
int i;
int j;
state *s;
trans *t;
for (s = fa->initial; s; s = s->next) {
if (s->tused) {
qsort(s->trans, s->tused, 0x10u, (__compar_fn_t)trans_to_cmp);
i = 0;
j = 1;
t = s->trans;
while (j < s->tused) {
if (t[i].to == t[j].to && t[j].min <= t[i... | static void reduce(struct fa *fa) {
list_for_each(s, fa->initial) {
if (s->tused == 0)
continue;
qsort(s->trans, s->tused, sizeof(*s->trans), trans_to_cmp);
int i = 0, j = 1;
struct trans *t = s->trans;
while (j < s->tused) {
... | reduce | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int ref_make_ref(void *ptrptr, size_t size, size_t ref_ofs) {
*(_QWORD *)ptrptr = calloc(1u, size);
if (!*(_QWORD *)ptrptr)
return -1;
*(_DWORD *)(*(_QWORD *)ptrptr + ref_ofs) = 1;
return 0;
} | int ref_make_ref(void *ptrptr, size_t size, size_t ref_ofs) {
*(void **)ptrptr = calloc(1, size);
if (*(void **)ptrptr == NULL) {
return -1;
} else {
void *ptr = *(void **)ptrptr;
*((ref_t *)((char *)ptr + ref_ofs)) = 1;
return 0;
... | ref_make_ref | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void release_re_str(re_str *str) {
if (str) {
free(str->rx);
str->rx = 0;
str->len = 0;
}
} | static void release_re_str(struct re_str *str) {
if (str == NULL)
return;
FREE(str->rx);
str->len = 0;
} | release_re_str | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
fa *repeat(fa *fa, int n) {
int na;
fa *tfa;
fa *cfa;
unsigned long v6;
na = n;
v6 = __readfsqword(0x28u);
if (!n)
return fa_make_epsilon();
if (n == 1)
return fa_clone(fa);
cfa = fa_clone(fa);
if (!cfa)
return 0;
while (na > 1) {
tfa = fa_clone(fa);
if (!tfa) {
fa_free(... | static struct fa *repeat(struct fa *fa, int n) {
if (n == 0) {
return fa_make_epsilon();
} else if (n == 1) {
return fa_clone(fa);
} else {
struct fa *cfa = fa_clone(fa);
if (cfa == NULL)
return NULL;
while ... | repeat | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
size_t rpl_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) {
wchar_t *pwca;
wchar_t wc;
size_t ret;
unsigned long v9;
pwca = pwc;
v9 = __readfsqword(0x28u);
if (!pwc)
pwca = &wc;
ret = mbrtowc(pwca, s, n, ps);
if (ret <= 0xFFFFFFFFFFFFFFFDLL || !n || hard_locale(0))
return ret;
... | size_t rpl_mbrtowc(wchar_t *pwc, const char *s, size_t n,
mbstate_t *ps) {
size_t ret;
wchar_t wc;
#if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || \
MBRTOWC_EMPTY_INPUT_BUG
if (s == NULL) {
pwc = NULL;
... | rpl_mbrtowc | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int safe_alloc_alloc_n(void *ptrptr, size_t size, size_t count, int zeroed) {
bool v5;
void *v6;
if (size && count) {
v5 = !is_mul_ok(size, count);
if (((size * count) & 0x8000000000000000LL) != 0LL)
v5 = 1;
if (v5) {
*__errno_location() = 12;
return -1;
} else {
if (zeroe... | int safe_alloc_alloc_n(void *ptrptr, size_t size, size_t count,
int zeroed) {
if (size == 0 || count == 0) {
*(void **)ptrptr = NULL;
return 0;
}
if (xalloc_oversized(count, size)) {
errno = ENOMEM;
ret... | safe_alloc_alloc_n | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int safe_alloc_realloc_n(void *ptrptr, size_t size, size_t count) {
bool v4;
void *tmp;
if (size && count) {
v4 = !is_mul_ok(size, count);
if (((size * count) & 0x8000000000000000LL) != 0LL)
v4 = 1;
if (v4) {
*__errno_location() = 12;
return -1;
} else {
tmp = realloc(*(vo... | int safe_alloc_realloc_n(void *ptrptr, size_t size, size_t count) {
void *tmp;
if (size == 0 || count == 0) {
free(*(void **)ptrptr);
*(void **)ptrptr = NULL;
return 0;
}
if (xalloc_oversized(count, size)) {
errno = ENOMEM;
... | safe_alloc_realloc_n | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int set_cmp(const void *key1, const void *key2) {
return state_set_equal((const state_set *)key1, (const state_set *)key2) == 0;
} | static int set_cmp(const void *key1, const void *key2) {
const struct state_set *set1 = key1;
const struct state_set *set2 = key2;
return state_set_equal(set1, set2) ? 0 : 1;
} | set_cmp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void set_destroy(hnode_t *node, void *ctx) {
state_set_free((state_set *)node->hash_key);
free(node);
} | static void set_destroy(hnode_t *node, ATTRIBUTE_UNUSED void *ctx) {
struct state_set *set = (struct state_set *)hnode_getkey(node);
state_set_free(set);
free(node);
} | set_destroy | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
hash_val_t set_hash(const void *key) {
int i;
hash_val_t hash;
hash = 0;
for (i = 0; (unsigned long)i < *((_QWORD *)key + 1); ++i)
hash += *(_QWORD *)(*(_QWORD *)(*((_QWORD *)key + 3) + 8LL * i) + 8LL);
return hash;
} | static hash_val_t set_hash(const void *key) {
hash_val_t hash = 0;
const struct state_set *set = key;
for (int i = 0; i < set->used; i++) {
hash += set->states[i]->hash;
}
return hash;
} | set_hash | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void set_initial(fa *fa, state *s) {
state *_p;
if (s == fa->initial) {
fa->initial = s->next;
} else {
for (_p = fa->initial; _p && s != _p->next; _p = _p->next)
;
if (_p)
_p->next = s->next;
}
s->next = 0;
s->next = fa->initial;
fa->initial = s;
} | static void set_initial(struct fa *fa, struct state *s) {
list_remove(s, fa->initial);
list_cons(fa->initial, s);
} | set_initial | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void shrink_table(hash_t *hash) {
hash_val_t hash_chain;
hnode_t *low_tail;
hash_val_t hash_nchains;
hnode_t **newtable;
hnode_t *high_chain;
if (hash->hash_nchains <= 1)
__assert_fail("hash->nchains >= 2", "hash.c", 0xF8u, "shrink_table");
hash_nchains = hash->hash_nchains >> 1;
for (hash_chain = ... | static void shrink_table(hash_t *hash) {
hash_val_t chain, nchains;
hnode_t **newtable, *low_tail, *low_chain, *high_chain;
assert(hash->nchains >= 2);
nchains = hash->nchains / 2;
for (chain = 0; chain < nchains; chain++) {
low_chain = hash->table[c... | shrink_table | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void sort_transition_intervals(fa *fa) {
state *s;
for (s = fa->initial; s; s = s->next)
qsort(s->trans, s->tused, 0x10u, (__compar_fn_t)trans_intv_cmp);
} | static void sort_transition_intervals(struct fa *fa) {
list_for_each(s, fa->initial) {
qsort(s->trans, s->tused, sizeof(*s->trans), trans_intv_cmp);
}
} | sort_transition_intervals | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
uchar *start_points(fa *fa, int *npoints) {
int v2;
int i;
int i_0;
int n;
uchar *points;
state *s;
trans *t;
char pointset[264];
unsigned long v11;
v11 = __readfsqword(0x28u);
points = 0;
if (mark_reachable(fa) < 0)
goto error;
memset(pointset, 0, 0x100u);
for (s = fa->initial; s; s = ... | static uchar *start_points(struct fa *fa, int *npoints) {
char pointset[UCHAR_NUM];
uchar *points = NULL;
F(mark_reachable(fa));
MEMZERO(pointset, UCHAR_NUM);
list_for_each(s, fa->initial) {
if (!s->reachable)
continue;
poi... | start_points | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state_list_node *state_list_add(state_list *sl, state *s) {
unsigned int size;
state_list_node *n[2];
n[1] = (state_list_node *)__readfsqword(0x28u);
if (mem_alloc_n(n, 0x20u, 1u) < 0)
return 0;
n[0]->state = s;
n[0]->sl = sl;
size = sl->size;
sl->size = size + 1;
if (size) {
sl->last->next =... | static struct state_list_node *state_list_add(struct state_list *sl,
struct state *s) {
struct state_list_node *n;
if (ALLOC(n) < 0)
return NULL;
n->state = s;
n->sl = sl;
if (sl->size++ == 0) {... | state_list_add | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_list_free(state_list *sl) {
state_list_node *_p;
if (sl) {
while (sl->first) {
_p = sl->first;
sl->first = sl->first->next;
free(_p);
}
}
free(sl);
} | static void state_list_free(struct state_list *sl) {
if (sl)
list_free(sl->first);
free(sl);
} | state_list_free | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_list_remove(state_list_node *n) {
state_list *sl;
sl = n->sl;
--sl->size;
if (n == sl->first)
sl->first = n->next;
else
n->prev->next = n->next;
if (n == sl->last)
sl->last = n->prev;
else
n->next->prev = n->prev;
free(n);
} | static void state_list_remove(struct state_list_node *n) {
struct state_list *sl = n->sl;
sl->size -= 1;
if (sl->first == n)
sl->first = n->next;
else
n->prev->next = n->next;
if (sl->last == n)
sl->last = n->prev;
... | state_list_remove | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_pair_find(state_set *set, state *fst, state *snd) {
int i;
for (i = 0; i < set->used; ++i) {
if (fst == set->states[i] && snd == set->data[i])
return i;
}
return -1;
} | static int state_pair_find(struct state_set *set, struct state *fst,
struct state *snd) {
for (int i = 0; i < set->used; i++)
if (set->states[i] == fst && set->data[i] == snd)
return i;
return -1;
} | state_pair_find | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_pair_push(state_set **set, state *fst, state *snd) {
int i;
if (!*set)
*set = state_set_init(-1, 2);
if (!*set)
return -1;
i = state_set_push(*set, fst);
if (i == -1)
return -1;
(*set)->data[i] = snd;
return 0;
} | ATTRIBUTE_RETURN_CHECK
static int state_pair_push(struct state_set **set, struct state *fst,
struct state *snd) {
if (*set == NULL)
*set = state_set_init(-1, S_DATA);
if (*set == NULL)
return -1;
int i = state_set_pu... | state_pair_push | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_add(state_set *set, state *s) {
int p;
if ((*((_BYTE *)set + 16) & 1) != 0) {
p = state_set_pos(set, s);
if (p < set->used && s == set->states[p])
return 0;
if (set->size == set->used && state_set_expand(set) < 0)
return -1;
while (p < set->used && s >= set->states[p])
... | ATTRIBUTE_RETURN_CHECK
static int state_set_add(struct state_set *set, struct state *s) {
if (set->sorted) {
int p = state_set_pos(set, s);
if (p < set->used && set->states[p] == s)
return 0;
if (set->size == set->used)
if (state_s... | state_set_add | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_equal(const state_set *set1, const state_set *set2) {
int i;
int i_0;
if (set1->used != set2->used)
return 0;
if ((*((_BYTE *)set1 + 16) & 1) != 0 && (*((_BYTE *)set2 + 16) & 1) != 0) {
for (i = 0; i < set1->used; ++i) {
if (set1->states[i] != set2->states[i])
return 0;
... | static int state_set_equal(const struct state_set *set1,
const struct state_set *set2) {
if (set1->used != set2->used)
return 0;
if (set1->sorted && set2->sorted) {
for (int i = 0; i < set1->used; i++)
if (set1->states[i]... | state_set_equal | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_expand(state_set *set) {
size_t v1;
if (set->size) {
if (set->size <= 0x80)
v1 = 2 * set->size;
else
v1 = set->size + 128;
set->size = v1;
} else {
set->size = 4;
}
if (mem_realloc_n(&set->states, 8u, set->size) >= 0 &&
((*((_BYTE *)set + 16) & 2) == 0 ||
... | ATTRIBUTE_RETURN_CHECK
static int state_set_expand(struct state_set *set) {
if (set->size == 0)
set->size = array_initial_size;
else if (set->size > array_max_expansion)
set->size += array_max_expansion;
else
set->size *= 2;
if ... | state_set_expand | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void *state_set_find_data(state_set *set, state *s) {
int i;
i = state_set_index(set, s);
if (i < 0)
return 0;
else
return set->data[i];
} | static void *state_set_find_data(struct state_set *set,
struct state *s) {
int i = state_set_index(set, s);
if (i >= 0)
return set->data[i];
else
return NULL;
} | state_set_find_data | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_set_free(state_set *set) {
if (set) {
free(set->states);
free(set->data);
free(set);
}
} | static void state_set_free(struct state_set *set) {
if (set == NULL)
return;
free(set->states);
free(set->data);
free(set);
} | state_set_free | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_hash_add(state_set_hash **smap, state_set *set, fa *fa) {
state *s;
if (!*smap) {
*smap = hash_create(0xFFFFFFFFFFFFFFFFLL, (hash_comp_t)set_cmp,
(hash_fun_t)set_hash);
if (!*smap)
return -1;
hash_set_allocator(*smap, 0, (hnode_free_t)set_destroy, 0);
}
s... | ATTRIBUTE_RETURN_CHECK
static int state_set_hash_add(state_set_hash **smap,
struct state_set *set, struct fa *fa) {
if (*smap == NULL) {
*smap = hash_create(HASHCOUNT_T_MAX, set_cmp, set_hash);
E(*smap == NULL);
hash_set_a... | state_set_hash_add | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_hash_contains(state_set_hash *smap, state_set *set) {
return hash_lookup(smap, set) != 0;
} | static int state_set_hash_contains(state_set_hash *smap,
struct state_set *set) {
return hash_lookup(smap, set) != NULL;
} | state_set_hash_contains | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_set_hash_free(state_set_hash *smap, state_set *protect) {
hnode_t *node;
if (protect) {
node = hash_lookup(smap, protect);
hash_delete(smap, node);
node->hash_key = 0;
set_destroy(node, 0);
}
hash_free_nodes(smap);
hash_destroy(smap);
} | static void state_set_hash_free(state_set_hash *smap,
struct state_set *protect) {
if (protect != NULL) {
hnode_t *node = hash_lookup(smap, protect);
hash_delete(smap, node);
hnode_getkey(node) = NULL;
set_destroy(no... | state_set_hash_free | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state *state_set_hash_get_state(state_set_hash *smap, state_set *set) {
return (state *)hash_lookup(smap, set)->hash_data;
} | static struct state *state_set_hash_get_state(state_set_hash *smap,
struct state_set *set) {
hnode_t *node = hash_lookup(smap, set);
return (struct state *)hnode_get(node);
} | state_set_hash_get_state | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state_set *state_set_hash_uniq(state_set_hash *smap, state_set *set) {
state_set *orig_set;
orig_set = (state_set *)hash_lookup(smap, set)->hash_key;
if (orig_set != set)
state_set_free(set);
return orig_set;
} | static struct state_set *state_set_hash_uniq(state_set_hash *smap,
struct state_set *set) {
hnode_t *node = hash_lookup(smap, set);
const struct state_set *orig_set = hnode_getkey(node);
if (orig_set != set) {
state_set_... | state_set_hash_uniq | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_index(const state_set *set, const state *s) {
int i;
int p;
if ((*((_BYTE *)set + 16) & 1) != 0) {
p = state_set_pos(set, s);
if (p < set->used && s == set->states[p])
return p;
else
return -1;
} else {
for (i = 0; i < set->used; ++i) {
if (s == set->states[i])
... | static int state_set_index(const struct state_set *set,
const struct state *s) {
if (set->sorted) {
int p = state_set_pos(set, s);
return (p < set->used && set->states[p] == s) ? p : -1;
} else {
for (int i = 0; i < set->us... | state_set_index | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state_set *state_set_init(int size, int flags) {
state_set *set[2];
set[1] = (state_set *)__readfsqword(0x28u);
set[0] = 0;
if (mem_alloc_n(set, 0x28u, 1u) >= 0) {
*((_BYTE *)set[0] + 16) = flags & 1 | *((_BYTE *)set[0] + 16) & 0xFE;
*((_BYTE *)set[0] + 16) =
(2 * ((flags >> 1) & 1)) | *((_BYTE... | static struct state_set *state_set_init(int size, int flags) {
struct state_set *set = NULL;
F(ALLOC(set));
set->sorted = (flags & S_SORTED) ? 1 : 0;
set->with_data = (flags & S_DATA) ? 1 : 0;
if (size > 0) {
set->size = size;
F(ALLOC_N(... | state_set_init | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_init_data(state_set *set) {
*((_BYTE *)set + 16) |= 2u;
if (set->data)
return 0;
else
return mem_alloc_n(&set->data, 8u, set->size);
} | static int state_set_init_data(struct state_set *set) {
set->with_data = 1;
if (set->data == NULL)
return ALLOC_N(set->data, set->size);
else
return 0;
} | state_set_init_data | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_list_add(state_set_list **list, state_set *set) {
state_set_list *elt;
state_set_list *_e;
unsigned long v5;
v5 = __readfsqword(0x28u);
if (mem_alloc_n(&elt, 0x10u, 1u) < 0)
return -1;
elt->set = set;
_e = elt;
elt->next = *list;
*list = _e;
return 0;
} | static int state_set_list_add(struct state_set_list **list,
struct state_set *set) {
struct state_set_list *elt;
if (ALLOC(elt) < 0)
return -1;
elt->set = set;
list_cons(*list, elt);
return 0;
} | state_set_list_add | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state_set *state_set_list_pop(state_set_list **list) {
state_set_list *elt;
state_set *set;
elt = *list;
set = (*list)->set;
*list = (*list)->next;
free(elt);
return set;
} | static struct state_set *
state_set_list_pop(struct state_set_list **list) {
struct state_set_list *elt = *list;
struct state_set *set = elt->set;
*list = elt->next;
free(elt);
return set;
} | state_set_list_pop | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state *state_set_pop(state_set *set) {
state **states;
state *s;
s = 0;
if (set->used) {
states = set->states;
return states[--set->used];
}
return s;
} | static struct state *state_set_pop(struct state_set *set) {
struct state *s = NULL;
if (set->used > 0)
s = set->states[--set->used];
return s;
} | state_set_pop | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state *state_set_pop_data(state_set *set, void **d) {
state *result;
result = state_set_pop(set);
*d = set->data[set->used];
return result;
} | static struct state *state_set_pop_data(struct state_set *set,
void **d) {
struct state *s = NULL;
s = state_set_pop(set);
*d = set->data[set->used];
return s;
} | state_set_pop_data | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_pos(const state_set *set, const state *s) {
int l;
int h;
int m;
l = 0;
h = set->used;
while (l < h) {
m = (l + h) / 2;
if (s >= set->states[m]) {
if (s <= set->states[m])
return (l + h) / 2;
l = m + 1;
} else {
h = (l + h) / 2;
}
}
return l;
} | static int state_set_pos(const struct state_set *set,
const struct state *s) {
int l = 0, h = set->used;
while (l < h) {
int m = (l + h) / 2;
if (set->states[m] > s)
h = m;
else if (set->states[m] < s)
... | state_set_pos | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_push(state_set *set, state *s) {
state **states;
size_t used;
int p;
if (set->size == set->used && state_set_expand(set) < 0)
return -1;
if ((*((_BYTE *)set + 16) & 1) != 0) {
p = state_set_pos(set, s);
if (set->size == set->used && state_set_expand(set) < 0) {
return -1;
... | ATTRIBUTE_RETURN_CHECK
static int state_set_push(struct state_set *set, struct state *s) {
if (set->size == set->used)
if (state_set_expand(set) < 0)
return -1;
if (set->sorted) {
int p = state_set_pos(set, s);
if (set->size == set->us... | state_set_push | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_set_push_data(state_set *set, state *s, void *d) {
int i;
i = state_set_push(set, s);
if (i == -1)
return -1;
set->data[i] = d;
return i;
} | ATTRIBUTE_RETURN_CHECK
static int state_set_push_data(struct state_set *set, struct state *s,
void *d) {
int i = state_set_push(set, s);
if (i == -1)
return -1;
set->data[i] = d;
return i;
} | state_set_push_data | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_set_remove(state_set *set, const state *s) {
state **states;
int p_0;
int p;
if ((*((_BYTE *)set + 16) & 1) != 0) {
p = state_set_index(set, s);
if (p != -1) {
memmove(&set->states[p], &set->states[p + 1], 8 * (set->used - p - 1));
if (set->data)
memmove(&set->data[p], &s... | static void state_set_remove(struct state_set *set,
const struct state *s) {
if (set->sorted) {
int p = state_set_index(set, s);
if (p == -1)
return;
memmove(set->states + p, set->states + p + 1,
... | state_set_remove | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_triple_free(state_triple_hash *hash) {
if (hash) {
hash_free_nodes(hash);
hash_destroy(hash);
}
} | static void state_triple_free(state_triple_hash *hash) {
if (hash != NULL) {
hash_free_nodes(hash);
hash_destroy(hash);
}
} | state_triple_free | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state_triple_hash *state_triple_init() {
hash_t *hash;
hash = hash_create(0xFFFFFFFFFFFFFFFFLL, (hash_comp_t)pair_cmp,
(hash_fun_t)pair_hash);
if (!hash)
return 0;
hash_set_allocator(hash, 0, (hnode_free_t)state_triple_node_free, 0);
return hash;
} | static state_triple_hash *state_triple_init(void) {
state_triple_hash *hash;
hash = hash_create(HASHCOUNT_T_MAX, pair_cmp, pair_hash);
if (hash == NULL)
return NULL;
hash_set_allocator(hash, NULL, state_triple_node_free, NULL);
return hash;
} | state_triple_init | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void state_triple_node_free(hnode_t *node, void *ctx) {
free((void *)node->hash_key);
free(node);
} | static void state_triple_node_free(hnode_t *node,
ATTRIBUTE_UNUSED void *ctx) {
free((void *)hnode_getkey(node));
free(node);
} | state_triple_node_free | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int state_triple_push(state_triple_hash *hash, state *s1, state *s2,
state *s3) {
state **pair[2];
pair[1] = (state **)__readfsqword(0x28u);
if (mem_alloc_n(pair, 8u, 2u) < 0)
return -1;
*pair[0] = s1;
pair[0][1] = s2;
return hash_alloc_insert(hash, pair[0], s3);
} | ATTRIBUTE_RETURN_CHECK
static int state_triple_push(state_triple_hash *hash, struct state *s1,
struct state *s2, struct state *s3) {
struct state **pair;
if (ALLOC_N(pair, 2) < 0)
return -1;
pair[0] = s1;
pair[1] = s... | state_triple_push | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state *state_triple_thd(state_triple_hash *hash, state *s1, state *s2) {
hnode_t *node;
state *pair[2];
unsigned long v6;
v6 = __readfsqword(0x28u);
pair[0] = s1;
pair[1] = s2;
node = hash_lookup(hash, pair);
if (node)
return (state *)node->hash_data;
else
return 0;
} | static struct state *state_triple_thd(state_triple_hash *hash,
struct state *s1,
struct state *s2) {
struct state *pair[2];
hnode_t *node;
pair[0] = s1;
pair[1] = s2;
node... | state_triple_thd | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
state *step(state *s, uchar c) {
trans *t;
for (t = s->trans; t - s->trans < s->tused; ++t) {
if (c >= t->min && c <= t->max)
return t->to;
}
return 0;
} | static struct state *step(struct state *s, uchar c) {
for_each_trans(t, s) {
if (t->min <= c && c <= t->max)
return t->to;
}
return NULL;
} | step | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
unsigned int str_score(const re_str *str) {
unsigned int score;
int i;
score = 0;
for (i = 0; i < str->len; ++i)
score += chr_score(str->rx[i]);
return score;
} | static unsigned int str_score(const struct re_str *str) {
unsigned int score = 0;
for (int i = 0; i < str->len; i++) {
score += chr_score(str->rx[i]);
}
return score;
} | str_score | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
re_str *string_extend(re_str *dst, const re_str *src, char c) {
unsigned int v3;
unsigned int v4;
re_str *dsta;
int slen;
dsta = dst;
if (!dst || !dst->len ||
(v3 = str_score(src), v4 = chr_score(c) + v3, v4 < str_score(dst))) {
slen = src->len;
if (!dst)
dsta = make_re_str(0);
if (... | static struct re_str *string_extend(struct re_str *dst,
const struct re_str *src, char c) {
if (dst == NULL || dst->len == 0 ||
str_score(src) + chr_score(c) < str_score(dst)) {
int slen = src->len;
if (dst == NULL)
... | string_extend | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
bool strip_trailing_slashes(char *file) {
char v1;
char *base;
char *base_lim;
base = last_component(file);
if (!*base)
base = file;
base_lim = &base[base_len(base)];
v1 = *base_lim;
*base_lim = 0;
return v1 != 0;
} | bool strip_trailing_slashes(char *file) {
char *base = last_component(file);
char *base_lim;
bool had_slash;
if (!*base)
base = file;
base_lim = base + base_len(base);
had_slash = (*base_lim != '\0');
*base_lim = '\0';
... | strip_trailing_slashes | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
size_t strnlen1(const char *string, size_t maxlen) {
const char *end;
end = (const char *)memchr(string, 0, maxlen);
if (end)
return end - string + 1;
else
return maxlen;
} | size_t strnlen1(const char *string, size_t maxlen) {
const char *end = (const char *)memchr(string, '\0', maxlen);
if (end != NULL)
return end - string + 1;
else
return maxlen;
} | strnlen1 | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
void swap_initial(fa *fa) {
state *s;
s = fa->initial;
if (fa->initial->next) {
fa->initial = s->next;
s->next = fa->initial->next;
fa->initial->next = s;
}
} | static void swap_initial(struct fa *fa) {
struct state *s = fa->initial;
if (s->next != NULL) {
fa->initial = s->next;
s->next = fa->initial->next;
fa->initial->next = s;
}
} | swap_initial | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int totalize(fa *fa) {
uchar min;
uchar max;
int next;
int i;
int tused;
state *s;
state *crash;
crash = add_state(fa, 0);
if (!crash || mark_reachable(fa) < 0)
return -1;
sort_transition_intervals(fa);
if (add_crash_trans(fa, crash, crash, 0, 255) < 0)
return -1;
for (s = fa->initial; ... | static int totalize(struct fa *fa) {
int r;
struct state *crash = add_state(fa, 0);
E(crash == NULL);
F(mark_reachable(fa));
sort_transition_intervals(fa);
r = add_crash_trans(fa, crash, crash, UCHAR_MIN, UCHAR_MAX);
if (r < 0)
... | totalize | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int trans_intv_cmp(const void *v1, const void *v2) {
if (*((_BYTE *)v1 + 8) < *((_BYTE *)v2 + 8))
return -1;
if (*((_BYTE *)v1 + 8) > *((_BYTE *)v2 + 8))
return 1;
if (*((_BYTE *)v1 + 9) > *((_BYTE *)v2 + 9))
return -1;
if (*((_BYTE *)v1 + 9) < *((_BYTE *)v2 + 9))
return 1;
if (*(_QWORD *)v1 =... | static int trans_intv_cmp(const void *v1, const void *v2) {
const struct trans *t1 = v1;
const struct trans *t2 = v2;
if (t1->min < t2->min)
return -1;
if (t1->min > t2->min)
return 1;
if (t1->max > t2->max)
return -1;
... | trans_intv_cmp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int trans_to_cmp(const void *v1, const void *v2) {
if (*(_QWORD *)v1 == *(_QWORD *)v2) {
if (*((_BYTE *)v1 + 8) >= *((_BYTE *)v2 + 8)) {
if (*((_BYTE *)v1 + 8) <= *((_BYTE *)v2 + 8)) {
if (*((_BYTE *)v1 + 9) <= *((_BYTE *)v2 + 9))
return *((_BYTE *)v1 + 9) < *((_BYTE *)v2 + 9);
els... | static int trans_to_cmp(const void *v1, const void *v2) {
const struct trans *t1 = v1;
const struct trans *t2 = v2;
if (t1->to != t2->to) {
return (t1->to < t2->to) ? -1 : 1;
}
if (t1->min < t2->min)
return -1;
if (t1->min > t2... | trans_to_cmp | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
int union_in_place(fa *fa1, fa **fa2) {
state *s;
if (((*((_BYTE *)fa1 + 8) & 4) != 0) == ((*((_BYTE *)*fa2 + 8) & 4) != 0))
goto LABEL_6;
if (case_expand(fa1) < 0)
return -1;
if (case_expand(*fa2) < 0)
return -1;
LABEL_6:
s = add_state(fa1, 0);
if (!s)
return -1;
if (add_epsilon_trans(s,... | ATTRIBUTE_RETURN_CHECK
static int union_in_place(struct fa *fa1, struct fa **fa2) {
struct state *s;
int r;
if (fa1->nocase != (*fa2)->nocase) {
if (case_expand(fa1) < 0)
return -1;
if (case_expand(*fa2) < 0)
return -1;
... | union_in_place | augeas-1.12.0 | app-admin | O0/app-admin/augeas-1.12.0/libfa.so.1.5.3 | ida | O0 |
element *addelement(void *newp, int size, element *chain) {
element *head;
element *newe;
element *temp;
newe = (element *)malloc(0x20u);
newe->prev = chain;
temp = chain->next;
chain->next = newe;
newe->next = temp;
newe->cur = (element *)malloc(size);
memcpy(newe->cur, newp, size);
if (newe->pr... | struct element *addelement(void *newp, int size, struct element *chain) {
struct element *newe;
void *temp;
newe = malloc(sizeof(element));
newe->prev = chain;
temp = chain->next;
chain->next = newe;
newe->next = temp;
newe->cur = malloc(size);
memcpy(newe->cur, newp, size);
if (newe->prev != NU... | addelement | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
element *addelement_nocpy(void *newp, element *chain) {
element *head;
element *newe;
element *temp;
newe = (element *)malloc(0x20u);
newe->prev = chain;
temp = chain->next;
chain->next = newe;
newe->next = temp;
newe->cur = (element *)newp;
if (newe->prev)
head = newe->prev->head;
else
h... | struct element *addelement_nocpy(void *newp, struct element *chain) {
struct element *newe;
void *temp;
newe = malloc(sizeof(element));
newe->prev = chain;
temp = chain->next;
chain->next = newe;
newe->next = temp;
newe->cur = newp;
if (newe->prev != NULL)
newe->head = newe->prev->head;
else... | addelement_nocpy | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void addfile(char *s, element *filechain) {
element *e;
fileent ent;
stat buf;
unsigned long v5;
v5 = __readfsqword(0x28u);
e = head(filechain);
if (!stat(s, &buf)) {
ent.name = strdup(s);
ent.mtime = buf.st_mtim.tv_sec;
ent.size = buf.st_size;
ent.wasmod = 1;
while (e->next && strcom... | void addfile(char *s, element *filechain) {
int i;
element *e = head(filechain);
fileent ent;
struct stat buf;
if (stat(s, &buf) == 0) {
ent.name = (char *)strdup(s);
ent.mtime = buf.st_mtime;
ent.size = buf.st_size;
ent.wasmod = 1;
while (e->next != NULL) {
i = strcomp(((fileent *)... | addfile | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void addfolder(Twatchfolder *f, char *dir, char *prg, uid_t uid, int interval,
int flags) {
Twatchfolder *v6;
Twatchfolder *fa;
fa = f;
if (!f) {
folders = addelement(&defaultfolder, 64, folders);
folders = tail(folders);
curfolder = (Twatchfolder *)folders->cur;
v6 = curfolder;
... | void addfolder(Twatchfolder *f, char *dir, char *prg, uid_t uid, int interval,
int flags) {
if (f == NULL) {
folders = addelement(&defaultfolder, sizeof(defaultfolder), folders);
folders = tail(folders);
curfolder = (Twatchfolder *)folders->cur;
curfolder->filechain = newchain();
f... | addfolder | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
int chainlen(element *chain) {
int r;
element *e;
e = head(chain);
r = 0;
while (e->next) {
e = e->next;
++r;
}
return r;
} | int chainlen(struct element *chain) {
struct element *e = head(chain);
int r = 0;
while (e->next != NULL) {
e = e->next;
r++;
}
return (r);
} | chainlen | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
int checkfile(char *s, int run, element *filechain) {
fileent *cur;
int r;
element *e;
fileent *fe;
stat buf;
unsigned long v10;
v10 = __readfsqword(0x28u);
e = findfile(s, filechain);
if (e)
cur = (fileent *)e->cur;
else
cur = 0;
fe = cur;
if (stat(s, &buf)) {
r = -2;
removefil... | int checkfile(char *s, int run, element *filechain) {
int r;
struct stat buf;
element *e = findfile(s, filechain);
fileent *fe;
fe = (e != NULL) ? ((fileent *)e->cur) : NULL;
#ifdef DEBUG
printf("checkfile(s='%s', run=%d, filechain) called..\n", s, run);
#endif
if (stat(s, &buf) == 0) {
if (e != NU... | checkfile | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void clearlst(element *chain) {
element *tmp;
for (tmp = head(chain); tmp->next; tmp = unchain(tmp))
;
unchain(tmp);
} | void clearlst(struct element *chain) {
struct element *tmp;
tmp = head(chain);
while (tmp->next != NULL) {
tmp = unchain(tmp);
}
unchain(tmp);
} | clearlst | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void consolidate() {
element *c;
c = head(folders);
while (c->next) {
c = c->next;
curfolder = (Twatchfolder *)c->cur;
if (!c->cur->cur) {
folders = unchain(c);
c = head(folders);
}
}
} | void consolidate() {
element *c = head(folders);
while (c->next != NULL) {
c = c->next;
curfolder = (Twatchfolder *)c->cur;
if (((Twatchfolder *)c->cur)->dir == NULL) {
folders = unchain(c);
c = head(folders);
}
}
} | consolidate | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void defraglst() { ; } | void defraglst() {} | defraglst | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void deinit() {
element *e;
Twatchfolder *w;
for (e = head(folders); e; e = unchain(e)) {
w = (Twatchfolder *)e->cur;
if (w) {
free(w->runprg);
free(w->dir);
killfilechain(w->filechain);
}
}
} | void deinit() {
element *e = head(folders);
Twatchfolder *w;
#ifdef DEBUG
printf("deinit");
#endif
while (e != NULL) {
#ifdef DEBUG
printf(".");
#endif
w = (Twatchfolder *)e->cur;
if (w != NULL) {
free(w->runprg);
free(w->dir);
killfilechain(w->filechain);
}
e = unchain(e... | deinit | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void dumpfolders() {
element *c;
c = head(folders);
while (c->next) {
c = c->next;
curfolder = (Twatchfolder *)c->cur;
if (c->cur)
printf("Will watch dir '%s' for files and run '%s' on them with uid='%d' "
"flags: %d\n",
curfolder->dir, curfolder->runprg, curfolder->us... | void dumpfolders() {
element *c = head(folders);
while (c->next != NULL) {
c = c->next;
curfolder = (Twatchfolder *)c->cur;
if (c->cur != NULL)
printf("Will watch dir '%s' for files and run '%s' on them with uid='%d' "
"flags: %d\n",
curfolder->dir, curfolder->runprg, cu... | dumpfolders | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
element *e_next(element *chain) { return chain->next; } | struct element *e_next(struct element *chain) { return (chain->next); } | e_next | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
element *e_prev(element *chain) { return chain->prev; } | struct element *e_prev(struct element *chain) { return (chain->prev); } | e_prev | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void finalize_logfd(int fd, int r, Twatchfolder *folder, char *logname) {
size_t v4;
int v5;
int fda;
int l;
int log;
FILE *f;
char buf[520];
unsigned long v13;
fda = fd;
v13 = __readfsqword(0x28u);
if (fd > 0) {
if (folder->flags & 0x200 | (r != 0)) {
if ((folder->flags & 0x80) != 0) {... | void finalize_logfd(int fd, int r, Twatchfolder *folder, char *logname) {
int log, l;
char buf[512];
FILE *f;
#ifdef DEBUG
printf("Entering finalize_logfd(fd=%i, r=%d, folder, logname='%s');\n", fd,
r, logname);
#endif
if (fd > 0) {
if ((folder->flags & FL_LOG_ALWAYS) | (r != 0)) {
if (f... | finalize_logfd | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
element *findfile(char *s, element *filechain) {
int i;
element *r;
r = head(filechain);
while (r->next) {
r = r->next;
if (r->cur) {
i = strcomp((char *)r->cur->prev, s);
if (i >= 0)
break;
}
}
if (i)
return 0;
else
return r;
} | element *findfile(char *s, element *filechain) {
element *r = head(filechain);
int i;
#ifdef DEBUG
printf("findfile called!!!\n");
#endif
while (r->next != NULL) {
r = r->next;
if (r->cur != NULL) {
i = strcomp(((fileent *)r->cur)->name, s);
#ifdef DEBUG
printf("comparing '%s' and '%s'... i... | findfile | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
int flags2int(char *c) {
size_t v1;
int r;
char *s;
char *i;
char *p;
r = 0;
v1 = strlen(c);
i = (char *)malloc(v1 + 3);
s = i;
strcpy(i, c);
*(_WORD *)&i[strlen(i)] = 32;
while (1) {
p = strchr(s, 32);
if (!p)
break;
*p = 0;
if (!strncasecmp("CHANGE", s, 6u))
r |= 1... | int flags2int(char *c) {
int r = 0;
char *i = (char *)malloc(strlen(c) + 3);
char *s = i;
char *p;
strcpy(s, c);
strcat(s, " ");
while ((p = strstr(s, " ")) != NULL) {
p[0] = 0x00;
if (strncasecmp("CHANGE", s, 6) == 0)
r |= FL_ACT_CHANGE;
if (strncasecmp("EXIST", s, 5) == 0)
r |... | flags2int | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
int get_filestate(char *fn) {
int fd;
flock fl;
unsigned long v4;
v4 = __readfsqword(0x28u);
fd = open(fn, 2);
fl.l_type = 1;
fl.l_whence = 0;
memset(&fl.l_start, 0, 20);
if (fd <= 0) {
if (isdir(fn))
return 2;
else
return 1;
} else {
fl.l_pid = getpid();
fl.l_type = 1;
... | int get_filestate(char *fn) {
int fd = open(fn, O_RDWR);
struct flock fl = {F_WRLCK, SEEK_SET, 0, 0, 0};
if (fd > 0) {
fl.l_pid = getpid();
fl.l_type = F_WRLCK;
if (fcntl(fd, F_SETLK, &fl) == -1) {
close(fd);
#ifdef DEBUG
printf("get_filestate(%s)=%d\n", fn, 0);
#endif
return (0);... | get_filestate | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
element *head(element *chain) { return chain->head; } | struct element *head(struct element *chain) {
struct element *tmp;
tmp = chain->head;
return (tmp);
} | head | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
int ini_classify(char *s) {
int v1;
int r;
char *w;
w = ini_trim(s);
r = 0;
if (!*s)
return 3;
v1 = *w;
if (v1 == 91)
return 1;
if (v1 <= 91) {
if (v1 == 35) {
return 2;
} else if (v1 == 59) {
return 2;
}
}
return r;
} | int ini_classify(char *s) {
char *w = ini_trim(s);
int r = INI_CLS_DATA;
if (strlen(s) > 0) {
switch (w[0]) {
case '[':
r = INI_CLS_GRP;
break;
case '#':
r = INI_CLS_CMNT;
break;
case ';':
r = INI_CLS_CMNT;
break;
}
} else {
r = INI_CLS_NULL;
}
... | ini_classify | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
void ini_close(inifile *i) {
fclose(i->f);
free(i->name);
free(i);
} | void ini_close(inifile *i) {
fclose(i->f);
free(i->name);
free(i);
} | ini_close | watchfolder-0.3.3-r1 | app-admin | O0/app-admin/watchfolder-0.3.3-r1/watchd | ida | O0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.