id stringlengths 21 132 | codebase stringclasses 57
values | c_file stringlengths 3 108 | function stringlengths 3 74 | sloc stringclasses 134
values | c_code stringlengths 25 52.1k | c_constructs dict |
|---|---|---|---|---|---|---|
libxml2#libxml2-py_prep#libxml_xmlUCSIsCatSo.c | libxml2 | libxml2-py.c | libxml_xmlUCSIsCatSo | 13 | PyObject *
libxml_xmlUCSIsCatSo(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
int code;
if (libxml_deprecationWarning("xmlUCSIsCatSo") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"i:xmlUCSIsCatSo", &code))
return(((void *)0));
c_retval = xmlUCSIsCatSo(code);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN_prep#f_gold.c | transcoder-set | FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN.c | f_gold | 7 | double f_gold ( int a, int b ) {
double AM, GM, HM;
AM = ( a + b ) / 2;
GM = sqrt ( a * b );
HM = ( GM * GM ) / AM;
return HM;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#tree_prep#xmlNewPI.c | libxml2 | tree.c | xmlNewPI | 4 | xmlNodePtr
xmlNewPI(const xmlChar *name, const xmlChar *content) {
return(xmlNewDocPI(((void *)0), name, content));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_extract_get_value_size.c | json.h | allow_inf_and_nan.c | json_extract_get_value_size | 26 | struct json_extract_result_s
json_extract_get_value_size(const struct json_value_s *const value) {
struct json_extract_result_s result = {0, 0};
switch (value->type) {
default:
break;
case json_type_object:
result = json_extract_get_object_size(
(const struct json_object_s *)value->payload);
break;
case json_type_array:
result = json_extract_get_array_size(
(const struct json_array_s *)value->payload);
break;
case json_type_number:
result = json_extract_get_number_size(
(const struct json_number_s *)value->payload);
break;
case json_type_string:
result = json_extract_get_string_size(
(const struct json_string_s *)value->payload);
break;
}
result.dom_size += sizeof(struct json_value_s);
return result;
}
| {
"array_type": 0,
"break_continue_statement": 5,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#mark_prep#MakePaster.c | screen-4.9.0 | mark.c | MakePaster | 11 | void
MakePaster(struct paster *pa, char *buf, int len, int bufiscopy)
{
FreePaster(pa);
pa->pa_pasteptr = buf;
pa->pa_pastelen = len;
if (bufiscopy)
pa->pa_pastebuf = buf;
pa->pa_pastelayer = flayer;
DoProcess(((struct win *)(flayer)->l_bottom->l_data), &pa->pa_pasteptr, &pa->pa_pastelen, pa);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
patch-2.7.6#pch_prep#pch_says_nonexistent.c | patch-2.7.6 | pch.c | pch_says_nonexistent | 5 | int
pch_says_nonexistent (_Bool which)
{
return p_says_nonexistent[which];
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#globals_prep#__xmlParserInputBufferCreateFilenameValue.c | libxml2 | globals.c | __xmlParserInputBufferCreateFilenameValue | 1 | xmlParserInputBufferCreateFilenameFunc *__xmlParserInputBufferCreateFilenameValue(void) { return (&xmlGetThreadLocalStorage(0)->gs_xmlParserInputBufferCreateFilenameValue); }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NTH_NON_FIBONACCI_NUMBER_prep#sort.c | transcoder-set | NTH_NON_FIBONACCI_NUMBER.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#gcm-aes192_prep#nettle_gcm_aes192_update.c | nettle-3.9.1 | gcm-aes192.c | nettle_gcm_aes192_update | 6 | void
nettle_gcm_aes192_update (struct gcm_aes192_ctx *ctx,
size_t length, const uint8_t *data)
{
nettle_gcm_update(&(ctx)->gcm, &(ctx)->key, (length), (data));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#retr_prep#fd_read_line.c | wget-1.21.4 | retr.c | fd_read_line | 5 | char *
fd_read_line (int fd)
{
return fd_read_hunk (fd, line_terminator, 128, 4096);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_from_prep#osip_from_parse.c | libosip2-5.3.1 | osip_from.c | osip_from_parse | 133 | int osip_from_parse(osip_from_t *from, const char *hvalue) {
const char *displayname = ((void *)0);
const char *url = ((void *)0);
const char *url_end = ((void *)0);
const char *gen_params;
const char *ptr;
int i;
if (from == ((void *)0) || hvalue == ((void *)0))
return -2;
ptr = hvalue;
while (ptr[0] != '\0') {
if (ptr[0] == ' ') {
ptr++;
continue;
}
if (ptr[0] == '"') {
displayname = ptr;
break;
}
break;
}
if (ptr[0] == '\0')
return 0;
if (displayname != ((void *)0)) {
const char *second = ((void *)0);
second = __osip_quote_find(displayname + 1);
if (second == ((void *)0))
return -5;
if (second - displayname + 2 >= 2) {
from->displayname = (char *) (osip_malloc_func ? osip_malloc_func(second - displayname + 2) : malloc(second - displayname + 2));
if (from->displayname == ((void *)0))
return -4;
osip_strncpy(from->displayname, displayname, second - displayname + 1);
}
ptr = second + 1;
while (ptr[0] != '\0') {
if (ptr[0] == ' ') {
ptr++;
continue;
}
if (ptr[0] == '<') {
url = ptr;
break;
}
break;
}
if (url == ((void *)0))
return -5;
if (ptr[1] == '\0')
return -5;
} else {
const char *beg = ptr;
while (ptr[0] != '\0') {
if (ptr[0] == ' ') {
ptr++;
continue;
}
if (ptr[0] >= 'a' && ptr[0] <= 'z') {
ptr++;
continue;
}
if (ptr[0] >= 'A' && ptr[0] <= 'Z') {
ptr++;
continue;
}
if (ptr[0] >= '0' && ptr[0] <= '9') {
ptr++;
continue;
}
if (ptr[0] == '-' || ptr[0] == '.' || ptr[0] == '!' || ptr[0] == '%' || ptr[0] == '*' || ptr[0] == '_' || ptr[0] == '+' || ptr[0] == '`' || ptr[0] == '\'' || ptr[0] == '~') {
ptr++;
continue;
}
url = ptr;
break;
}
if (ptr[0] == '\0' || url == ((void *)0))
return -5;
if (ptr[0] == '<') {
if (ptr[1] == '\0')
return -5;
if (url - beg > 0) {
from->displayname = (char *) (osip_malloc_func ? osip_malloc_func(url - beg + 1) : malloc(url - beg + 1));
if (from->displayname == ((void *)0))
return -4;
osip_clrncpy(from->displayname, hvalue, url - beg);
}
} else if (ptr[0] == ':') {
url = beg;
} else {
url = beg;
}
}
if (url[0] == '<') {
url++;
ptr = url;
url_end = strchr(ptr, '>');
if (url_end == ((void *)0))
return -5;
url_end--;
gen_params = strchr(url_end, ';');
}
if (url_end == ((void *)0)) {
gen_params = strchr(url, ';');
if (gen_params != ((void *)0))
url_end = gen_params - 1;
else
url_end = url + strlen(url);
}
if (gen_params != ((void *)0)) {
i = __osip_generic_param_parseall(&from->gen_params, gen_params);
if (i != 0) {
return i;
}
}
{
char *tmp;
if (url_end - url + 2 < 7)
return -5;
i = osip_uri_init(&(from->url));
if (i != 0)
return i;
tmp = (char *) (osip_malloc_func ? osip_malloc_func(url_end - url + 2) : malloc(url_end - url + 2));
if (tmp == ((void *)0))
return -4;
osip_strncpy(tmp, url, url_end - url + 1);
i = osip_uri_parse(from->url, tmp);
{ if (tmp != ((void *)0)) { if (osip_free_func) osip_free_func(tmp); else free(tmp); } };
if (i != 0)
return i;
}
return 0;
}
| {
"array_type": 2,
"break_continue_statement": 12,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 34,
"memory_management": 4,
"memory_operation": 0,
"pointer_type": 8,
"return_statement": 16,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 20,
"union_type": 0,
"while_loop": 3
} |
wget-1.21.4#iri_prep#set_content_encoding.c | wget-1.21.4 | iri.c | set_content_encoding | 14 | void
set_content_encoding (struct iri *i, const char *charset)
{
do { if (__builtin_expect ((opt.debug), 0)) { debug_logprintf ("URI content encoding = %s\n", charset ? quote (charset) : "None"); } } while (0);
if (opt.encoding_remote)
return;
if (i->content_encoding)
{
if (charset && !c_strcasecmp (i->content_encoding, charset))
return;
do { free ((void *) (i->content_encoding)); i->content_encoding = ((void *)0); } while (0);
}
i->content_encoding = charset ? xstrdup (charset) : ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 2
} |
libxml2#libxml2-py_prep#libxml_xmlGetDtdQAttrDesc.c | libxml2 | libxml2-py.c | libxml_xmlGetDtdQAttrDesc | 16 | PyObject *
libxml_xmlGetDtdQAttrDesc(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlAttributePtr c_retval;
xmlDtdPtr dtd;
PyObject *pyobj_dtd;
xmlChar * elem;
xmlChar * name;
xmlChar * prefix;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"Ozzz:xmlGetDtdQAttrDesc", &pyobj_dtd, &elem, &name, &prefix))
return(((void *)0));
dtd = (xmlDtdPtr) (((pyobj_dtd) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_dtd))->obj));
c_retval = xmlGetDtdQAttrDesc(dtd, elem, name, prefix);
py_retval = libxml_xmlAttributePtrWrap((xmlAttributePtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_proxy_authentication_info_prep#osip_message_get_proxy_authentication_info.c | libosip2-5.3.1 | osip_proxy_authentication_info.c | osip_message_get_proxy_authentication_info | 9 | int osip_message_get_proxy_authentication_info(const osip_message_t *sip, int pos, osip_proxy_authentication_info_t **dest) {
osip_proxy_authentication_info_t *proxy_authentication_info;
*dest = ((void *)0);
if (osip_list_size(&sip->proxy_authentication_infos) <= pos)
return -1;
proxy_authentication_info = (osip_proxy_authentication_info_t *) osip_list_get(&sip->proxy_authentication_infos, pos);
*dest = proxy_authentication_info;
return pos;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#pred_c_prep#Pl_Pred_Prop_User_2.c | gprolog-1.5.0 | pred_c.c | Pl_Pred_Prop_User_2 | 8 | Bool
Pl_Pred_Prop_User_2(WamWord func_word, WamWord arity_word)
{
int func = Pl_Rd_Atom(func_word);
int arity = Pl_Rd_Integer(arity_word);
PredInf *pred = Pl_Lookup_Pred(func, arity);
return pred != ((void *)0) && (pred->prop & 8) == 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES_prep#cmpfunc.c | transcoder-set | FIND_THE_NUMBER_OCCURRING_ODD_NUMBER_OF_TIMES.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_write_minified.c | json.h | allow_inf_and_nan.c | json_write_minified | 26 | void *json_write_minified(const struct json_value_s *value, size_t *out_size) {
size_t size = 0;
char *data = 0;
char *data_end = 0;
if (0 == value) {
return 0;
}
if (json_write_minified_get_value_size(value, &size)) {
return 0;
}
size += 1;
data = (char *)malloc(size);
if (0 == data) {
return 0;
}
data_end = json_write_minified_value(value, data);
if (0 == data_end) {
free(data);
return 0;
}
*data_end = '\0';
if (0 != out_size) {
*out_size = size;
}
return data;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 5,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#int_array_prep#int_kilobytes.c | gawk-5.2.2 | int_array.c | int_kilobytes | 17 | double
int_kilobytes(NODE *symbol)
{
unsigned long i, bucket_cnt = 0;
BUCKET *b;
double kb;
extern double str_kilobytes(NODE *symbol);
for (i = 0; i < symbol->sub.nodep.cnt; i++) {
for (b = symbol->sub.nodep.r.bv[i]; b != ((void *)0); b = b->hi.next)
bucket_cnt++;
}
kb = (((double) bucket_cnt) * sizeof (BUCKET) +
((double) symbol->sub.nodep.cnt) * sizeof (BUCKET *)) / 1024.0;
if (symbol->sub.nodep.rn != ((void *)0))
kb += str_kilobytes(symbol->sub.nodep.rn);
return kb;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#LONGEST_INCREASING_ODD_EVEN_SUBSEQUENCE_prep#len.c | transcoder-set | LONGEST_INCREASING_ODD_EVEN_SUBSEQUENCE.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MAXIMUM_SUM_POSSIBLE_EQUAL_SUM_THREE_STACKS_prep#f_filled.c | transcoder-set | FIND_MAXIMUM_SUM_POSSIBLE_EQUAL_SUM_THREE_STACKS.c | f_filled | 1 | int f_filled ( int stack1 [ ], int stack2 [ ], int stack3 [ ], int n1, int n2, int n3 ) {}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
pth-2.0.7#pth_high_prep#pth_read.c | pth-2.0.7 | pth_high.c | pth_read | 4 | ssize_t pth_read(int fd, void *buf, size_t nbytes)
{
return pth_read_ev(fd, buf, nbytes, ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1_prep#cmpfunc.c | transcoder-set | FIND_WHETHER_AN_ARRAY_IS_SUBSET_OF_ANOTHER_ARRAY_SET_1.c | cmpfunc | 1 | int cmpfunc (const void * a, const void * b) {return ( *(int*)a - *(int*)b );}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#screen-write_prep#screen_write_deletecharacter.c | tmux | screen-write.c | screen_write_deletecharacter | 20 | void
screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx, u_int bg)
{
struct screen *s = ctx->s;
struct tty_ctx ttyctx;
if (nx == 0)
nx = 1;
if (nx > ((s)->grid->sx) - s->cx)
nx = ((s)->grid->sx) - s->cx;
if (nx == 0)
return;
if (s->cx > ((s)->grid->sx) - 1)
return;
screen_write_initctx(ctx, &ttyctx);
ttyctx.bg = bg;
grid_view_delete_cells(s->grid, s->cx, s->cy, nx, bg);
screen_write_collect_flush(ctx, 0);
ttyctx.num = nx;
tty_write(tty_cmd_deletecharacter, &ttyctx);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#volatility_prep#ti_volatility.c | tulipindicators-0.9.1 | volatility.c | ti_volatility | 29 | int ti_volatility(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *input = inputs[0];
double *output = outputs[0];
const int period = (int)options[0];
const double scale = 1.0 / period;
const double annual = sqrt(252);
if (period < 1) return 1;
if (size <= ti_volatility_start(options)) return 0;
double sum = 0;
double sum2 = 0;
int i;
for (i = 1; i <= period; ++i) {
const double c = (input[i]/input[i-1]-1.0);
sum += c;
sum2 += c * c;
}
*output++ = sqrt(sum2 * scale - (sum * scale) * (sum * scale)) * annual;
for (i = period+1; i < size; ++i) {
const double c = (input[i]/input[i-1]-1.0);
sum += c;
sum2 += c * c;
const double cp = (input[i-period]/input[i-period-1]-1.0);
sum -= cp;
sum2 -= cp * cp;
*output++ = sqrt(sum2 * scale - (sum * scale) * (sum * scale)) * annual;
}
((void) sizeof ((output - outputs[0] == size - ti_volatility_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_volatility_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_volatility_start(options)", "indicators/volatility.c", 69, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#sdp_accessor_prep#sdp_message_i_info_get.c | libosip2-5.3.1 | sdp_accessor.c | sdp_message_i_info_get | 12 | char *sdp_message_i_info_get(sdp_message_t *sdp, int pos_media) {
sdp_media_t *med;
if (sdp == ((void *)0))
return ((void *)0);
if (pos_media == -1) {
return sdp->i_info;
}
med = osip_list_get(&sdp->m_medias, pos_media);
if (med == ((void *)0))
return ((void *)0);
return med->i_info;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_DIFFERENCE_MAX_MIN_K_SIZE_SUBSETS_prep#max.c | transcoder-set | MINIMUM_DIFFERENCE_MAX_MIN_K_SIZE_SUBSETS.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#fd_range_prep#Pl_Vector_Mod_Vector.c | gprolog-1.5.0 | fd_range.c | Pl_Vector_Mod_Vector | 19 | void
Pl_Vector_Mod_Vector(Vector vec, Vector vec1)
{
Vector aux_vec;
int vec_elem, vec_elem1;
int x;
do { aux_vec = (Vector) (((WamWordP *) pl_reg_bank)[256 +3]); (((WamWordP *) pl_reg_bank)[256 +3]) += pl_vec_size; } while (0);
Pl_Vector_Copy(aux_vec, vec);
Pl_Vector_Empty(vec);
{ Vector enum_end = aux_vec + pl_vec_size, enum_i = aux_vec; int enum_j; VecWord enum_word; vec_elem = 0; do { enum_word = *enum_i; for (enum_j = 0; enum_j++ < (8 * 8); enum_word >>= 1, vec_elem++) { if (enum_word & 1) {;
{ Vector enum_end = vec1 + pl_vec_size, enum_i = vec1; int enum_j; VecWord enum_word; vec_elem1 = 0; do { enum_word = *enum_i; for (enum_j = 0; enum_j++ < (8 * 8); enum_word >>= 1, vec_elem1++) { if (enum_word & 1) {;
if (vec_elem1 != 0)
{
x = vec_elem % vec_elem1;
(vec[((VecWord) (x) >> 6)] |= ((VecWord) 1 << ((x) & (((VecWord) 1 << 6)-1))));
}
} } } while (++enum_i < enum_end); };
} } } while (++enum_i < enum_end); };
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 3
} |
findutils-4.9.0#printf-args_prep#printf_fetchargs.c | findutils-4.9.0 | printf-args.c | printf_fetchargs | 95 | int
printf_fetchargs (va_list args, arguments *a)
{
size_t i;
argument *ap;
for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
switch (ap->type)
{
case TYPE_SCHAR:
ap->a.a_schar = __builtin_va_arg(args,int);
break;
case TYPE_UCHAR:
ap->a.a_uchar = __builtin_va_arg(args,int);
break;
case TYPE_SHORT:
ap->a.a_short = __builtin_va_arg(args,int);
break;
case TYPE_USHORT:
ap->a.a_ushort = __builtin_va_arg(args,int);
break;
case TYPE_INT:
ap->a.a_int = __builtin_va_arg(args,int);
break;
case TYPE_UINT:
ap->a.a_uint = __builtin_va_arg(args,unsigned int);
break;
case TYPE_LONGINT:
ap->a.a_longint = __builtin_va_arg(args,long int);
break;
case TYPE_ULONGINT:
ap->a.a_ulongint = __builtin_va_arg(args,unsigned long int);
break;
case TYPE_LONGLONGINT:
ap->a.a_longlongint = __builtin_va_arg(args,long long int);
break;
case TYPE_ULONGLONGINT:
ap->a.a_ulonglongint = __builtin_va_arg(args,unsigned long long int);
break;
case TYPE_DOUBLE:
ap->a.a_double = __builtin_va_arg(args,double);
break;
case TYPE_LONGDOUBLE:
ap->a.a_longdouble = __builtin_va_arg(args,long double);
break;
case TYPE_CHAR:
ap->a.a_char = __builtin_va_arg(args,int);
break;
case TYPE_WIDE_CHAR:
ap->a.a_wide_char =
(sizeof (wint_t) < sizeof (int)
? (wint_t) __builtin_va_arg(args,int)
: __builtin_va_arg(args,wint_t));
break;
case TYPE_STRING:
ap->a.a_string = __builtin_va_arg(args,const char *);
if (ap->a.a_string == ((void *)0))
ap->a.a_string = "(NULL)";
break;
case TYPE_WIDE_STRING:
ap->a.a_wide_string = __builtin_va_arg(args,const wchar_t *);
if (ap->a.a_wide_string == ((void *)0))
{
static const wchar_t wide_null_string[] =
{
(wchar_t)'(',
(wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
(wchar_t)')',
(wchar_t)0
};
ap->a.a_wide_string = wide_null_string;
}
break;
case TYPE_POINTER:
ap->a.a_pointer = __builtin_va_arg(args,void *);
break;
case TYPE_COUNT_SCHAR_POINTER:
ap->a.a_count_schar_pointer = __builtin_va_arg(args,signed char *);
break;
case TYPE_COUNT_SHORT_POINTER:
ap->a.a_count_short_pointer = __builtin_va_arg(args,short *);
break;
case TYPE_COUNT_INT_POINTER:
ap->a.a_count_int_pointer = __builtin_va_arg(args,int *);
break;
case TYPE_COUNT_LONGINT_POINTER:
ap->a.a_count_longint_pointer = __builtin_va_arg(args,long int *);
break;
case TYPE_COUNT_LONGLONGINT_POINTER:
ap->a.a_count_longlongint_pointer = __builtin_va_arg(args,long long int *);
break;
default:
return -1;
}
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 22,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#stream_supp_prep#Del_Aliases_Of_Stream.c | gprolog-1.5.0 | stream_supp.c | Del_Aliases_Of_Stream | 10 | void
Del_Aliases_Of_Stream(int stm)
{
HashScan scan;
AliasInf *alias;
for (alias = (AliasInf *) Pl_Hash_First(pl_alias_tbl, &scan); alias;
alias = (AliasInf *) Pl_Hash_Next(&scan))
if (alias->stm == stm)
Pl_Hash_Delete(pl_alias_tbl, alias->atom);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SUM_DIVISORS_1_N_1_prep#f_gold.c | transcoder-set | SUM_DIVISORS_1_N_1.c | f_gold | 7 | int f_gold ( int n ) {
int sum = 0;
for ( int i = 1;
i <= n;
++ i ) sum += ( n / i ) * i;
return sum;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#b-fro_prep#fro_tello.c | rcs-5.10.1 | b-fro.c | fro_tello | 16 | off_t
fro_tello (struct fro *f)
{
off_t rv = 0;
switch (f->rm)
{
case RM_MMAP:
case RM_MEM:
rv = f->ptr - f->base;
break;
case RM_STDIO:
rv = ftello (f->stream);
break;
}
return rv;
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_location_information_prep#json_write_minified_object.c | json.h | allow_location_information.c | json_write_minified_object | 21 | char *json_write_minified_object(const struct json_object_s *object,
char *data) {
struct json_object_element_s *element = 0;
*data++ = '{';
for (element = object->start; 0 != element; element = element->next) {
if (element != object->start) {
*data++ = ',';
}
data = json_write_string(element->name, data);
if (0 == data) {
return 0;
}
*data++ = ':';
data = json_write_minified_value(element->value, data);
if (0 == data) {
return 0;
}
}
*data++ = '}';
return data;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#torad_prep#ti_torad.c | tulipindicators-0.9.1 | torad.c | ti_torad | 1 | int ti_torad(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *in1 = inputs[0]; (void)options; double *output = outputs[0]; int i; for (i = 0; i < size; ++i) { output[i] = ((in1[i] * (3.14159265358979323846 / 180.0))); } return 0; }
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_unquoted_keys_prep#json_write_minified_value.c | json.h | allow_unquoted_keys.c | json_write_minified_value | 35 | char *json_write_minified_value(const struct json_value_s *value, char *data) {
switch (value->type) {
default:
return 0;
case json_type_number:
return json_write_number((struct json_number_s *)value->payload, data);
case json_type_string:
return json_write_string((struct json_string_s *)value->payload, data);
case json_type_array:
return json_write_minified_array((struct json_array_s *)value->payload,
data);
case json_type_object:
return json_write_minified_object((struct json_object_s *)value->payload,
data);
case json_type_true:
data[0] = 't';
data[1] = 'r';
data[2] = 'u';
data[3] = 'e';
return data + 4;
case json_type_false:
data[0] = 'f';
data[1] = 'a';
data[2] = 'l';
data[3] = 's';
data[4] = 'e';
return data + 5;
case json_type_null:
data[0] = 'n';
data[1] = 'u';
data[2] = 'l';
data[3] = 'l';
return data + 4;
}
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 1,
"switch_statement": 1,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
json-c#json_object_prep#json_object_get_int.c | json-c | json_object.c | json_object_get_int | 48 | int32_t json_object_get_int(const struct json_object *jso)
{
int64_t cint64 = 0;
double cdouble;
enum json_type o_type;
if (!jso)
return 0;
o_type = jso->o_type;
if (o_type == json_type_int)
{
const struct json_object_int *jsoint = JC_INT_C(jso);
if (jsoint->cint_type == json_object_int_type_int64)
{
cint64 = jsoint->cint.c_int64;
}
else
{
if (jsoint->cint.c_uint64 >= (9223372036854775807L))
cint64 = (9223372036854775807L);
else
cint64 = (int64_t)jsoint->cint.c_uint64;
}
}
else if (o_type == json_type_string)
{
if (json_parse_int64(get_string_component(jso), &cint64) != 0)
return 0;
o_type = json_type_int;
}
switch (o_type)
{
case json_type_int:
if (cint64 <= (-2147483647-1))
return (-2147483647-1);
if (cint64 >= (2147483647))
return (2147483647);
return (int32_t)cint64;
case json_type_double:
cdouble = JC_DOUBLE_C(jso)->c_double;
if (cdouble <= (-2147483647-1))
return (-2147483647-1);
if (cdouble >= (2147483647))
return (2147483647);
return (int32_t)cdouble;
case json_type_boolean: return JC_BOOL_C(jso)->c_boolean;
default: return 0;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 1,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 10,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 10,
"struct_type": 2,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#invfnlookup.c | units-2.22 | units.c | invfnlookup | 8 | struct func *
invfnlookup(char *str)
{
if (*str != '~')
return 0;
removespaces(str+1);
return fnlookup(str+1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
brotli-1.0.9#encode_prep#BrotliEncoderCompress.c | brotli-1.0.9 | encode.c | BrotliEncoderCompress | 63 | int BrotliEncoderCompress(
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
const uint8_t* input_buffer, size_t* encoded_size,
uint8_t* encoded_buffer) {
BrotliEncoderState* s;
size_t out_size = *encoded_size;
const uint8_t* input_start = input_buffer;
uint8_t* output_start = encoded_buffer;
size_t max_out_size = BrotliEncoderMaxCompressedSize(input_size);
if (out_size == 0) {
return 0;
}
if (input_size == 0) {
*encoded_size = 1;
*encoded_buffer = 6;
return 1;
}
if (quality == 10) {
const int lg_win = (brotli_min_int((30), ((brotli_max_int((16), (lgwin))))));
int ok = BrotliCompressBufferQuality10(lg_win, input_size, input_buffer,
encoded_size, encoded_buffer);
if (!ok || (max_out_size && *encoded_size > max_out_size)) {
goto fallback;
}
return 1;
}
s = BrotliEncoderCreateInstance(0, 0, 0);
if (!s) {
return 0;
} else {
size_t available_in = input_size;
const uint8_t* next_in = input_buffer;
size_t available_out = *encoded_size;
uint8_t* next_out = encoded_buffer;
size_t total_out = 0;
int result = 0;
BrotliEncoderSetParameter(s, BROTLI_PARAM_QUALITY, (uint32_t)quality);
BrotliEncoderSetParameter(s, BROTLI_PARAM_LGWIN, (uint32_t)lgwin);
BrotliEncoderSetParameter(s, BROTLI_PARAM_MODE, (uint32_t)mode);
BrotliEncoderSetParameter(s, BROTLI_PARAM_SIZE_HINT, (uint32_t)input_size);
if (lgwin > 24) {
BrotliEncoderSetParameter(s, BROTLI_PARAM_LARGE_WINDOW, 1);
}
result = BrotliEncoderCompressStream(s, BROTLI_OPERATION_FINISH,
&available_in, &next_in, &available_out, &next_out, &total_out);
if (!BrotliEncoderIsFinished(s)) result = 0;
*encoded_size = total_out;
BrotliEncoderDestroyInstance(s);
if (!result || (max_out_size && *encoded_size > max_out_size)) {
goto fallback;
}
return 1;
}
fallback:
*encoded_size = 0;
if (!max_out_size) return 0;
if (out_size >= max_out_size) {
*encoded_size =
MakeUncompressedStream(input_start, input_size, output_start);
return 1;
}
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 2,
"if_statement": 10,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 8,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
pth-2.0.7#pth_high_prep#pth_writev.c | pth-2.0.7 | pth_high.c | pth_writev | 4 | ssize_t pth_writev(int fd, const struct iovec *iov, int iovcnt)
{
return pth_writev_ev(fd, iov, iovcnt, ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tmux#imsg_prep#imsg_free.c | tmux | imsg.c | imsg_free | 5 | void
imsg_free(struct imsg *imsg)
{
freezero(imsg->data, imsg->hdr.len - sizeof(struct imsg_hdr));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
cpio-2.14#paxerror_prep#write_error_details.c | cpio-2.14 | paxerror.c | write_error_details | 8 | void
write_error_details (char const *name, size_t status, size_t size)
{
if (status == 0)
write_error (name);
else
do { if (error_hook) error_hook (); error (0, 0, ngettext ("%s: Wrote only %zu of %zu byte", "%s: Wrote only %zu of %zu bytes", size), name, status, size); exit_status = 2; } while (0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
nettle-3.9.1#eddsa-pubkey_prep#_nettle_eddsa_public_key_itch.c | nettle-3.9.1 | eddsa-pubkey.c | _nettle_eddsa_public_key_itch | 6 | mp_size_t
_nettle_eddsa_public_key_itch (const struct ecc_curve *ecc)
{
((void) sizeof ((ecc->mul_g_itch <= _nettle_eddsa_compress_itch (ecc)) ? 1 : 0), __extension__ ({ if (ecc->mul_g_itch <= _nettle_eddsa_compress_itch (ecc)) ; else __assert_fail ("ecc->mul_g_itch <= _eddsa_compress_itch (ecc)", "eddsa-pubkey.c", 46, __extension__ __PRETTY_FUNCTION__); }));
return 3*ecc->p.size + _nettle_eddsa_compress_itch (ecc);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_leading_plus_sign_prep#json_write_pretty.c | json.h | allow_leading_plus_sign.c | json_write_pretty | 42 | void *json_write_pretty(const struct json_value_s *value, const char *indent,
const char *newline, size_t *out_size) {
size_t size = 0;
size_t indent_size = 0;
size_t newline_size = 0;
char *data = 0;
char *data_end = 0;
if (0 == value) {
return 0;
}
if (0 == indent) {
indent = " ";
}
if (0 == newline) {
newline = "\n";
}
while ('\0' != indent[indent_size]) {
++indent_size;
}
while ('\0' != newline[newline_size]) {
++newline_size;
}
if (json_write_pretty_get_value_size(value, 0, indent_size, newline_size,
&size)) {
return 0;
}
size += 1;
data = (char *)malloc(size);
if (0 == data) {
return 0;
}
data_end = json_write_pretty_value(value, 0, indent, newline, data);
if (0 == data_end) {
free(data);
return 0;
}
*data_end = '\0';
if (0 != out_size) {
*out_size = size;
}
return data;
}
| {
"array_type": 2,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 7,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 5,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 2
} |
mcsim-6.2.0#mh_prep#NextDown.c | mcsim-6.2.0 | mh.c | NextDown | 12 | double NextDown (double Perk)
{
int i;
static double PTable[21] = {0, 1E-6, 1E-5, 1E-4, 1E-3, 1E-2,
0.1, 0.2, 0.3, 0.5, 0.6, 0.7, 0.8, 0.9,
0.95, 0.97, 0.99, 0.999, 0.9999, 0.99999, 1};
i = 0;
while (Perk > PTable[i]) {
i++;
}
return (i == 0 ? PTable[i] : PTable[i-1]);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
libxml2#parserInternals_prep#xmlFreeInputStream.c | libxml2 | parserInternals.c | xmlFreeInputStream | 11 | void
xmlFreeInputStream(xmlParserInputPtr input) {
if (input == ((void *)0)) return;
if (input->filename != ((void *)0)) xmlFree((char *) input->filename);
if (input->version != ((void *)0)) xmlFree((char *) input->version);
if ((input->free != ((void *)0)) && (input->base != ((void *)0)))
input->free((xmlChar *) input->base);
if (input->buf != ((void *)0))
xmlFreeParserInputBuffer(input->buf);
xmlFree(input);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#utils_prep#is_separate_word.c | nano-7.2 | utils.c | is_separate_word | 7 | _Bool is_separate_word(size_t position, size_t length, const char *text)
{
const char *before = text + step_left(text, position);
const char *after = text + position + length;
return ((position == 0 || !is_alpha_char(before)) &&
(*after == '\0' || !is_alpha_char(after)));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
less-633#ch_prep#ch_beg_seek.c | less-633 | ch.c | ch_beg_seek | 18 | int ch_beg_seek(void)
{
struct bufnode *bn;
struct bufnode *firstbn;
if (ch_seek(((POSITION)0)) == 0)
return (0);
firstbn = thisfile->buflist.next;
if (firstbn == (&thisfile->buflist))
return (1);
for (bn = thisfile->buflist.next; bn != (&thisfile->buflist); bn = bn->next)
{
if (((struct buf *) bn)->block < ((struct buf *) firstbn)->block)
firstbn = bn;
}
thisfile->block = ((struct buf *) firstbn)->block;
thisfile->offset = 0;
return (0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_multi_line_strings_prep#json_write_minified_object.c | json.h | allow_multi_line_strings.c | json_write_minified_object | 21 | char *json_write_minified_object(const struct json_object_s *object,
char *data) {
struct json_object_element_s *element = 0;
*data++ = '{';
for (element = object->start; 0 != element; element = element->next) {
if (element != object->start) {
*data++ = ',';
}
data = json_write_string(element->name, data);
if (0 == data) {
return 0;
}
*data++ = ':';
data = json_write_minified_value(element->value, data);
if (0 == data) {
return 0;
}
}
*data++ = '}';
return data;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#alerts_prep#alerts_reset_all.c | tmux | alerts.c | alerts_reset_all | 7 | void
alerts_reset_all(void)
{
struct window *w;
for ((w) = windows_RB_MINMAX(&windows, -1); (w) != ((void *)0); (w) = windows_RB_NEXT(w))
alerts_reset(w);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#le_interf_c_prep#Pl_Add_Linedit_Completion_1.c | gprolog-1.5.0 | le_interf_c.c | Pl_Add_Linedit_Completion_1 | 19 | Bool
Pl_Add_Linedit_Completion_1(WamWord compl_word)
{
int atom;
AtomProp prop;
char *p;
atom = Pl_Rd_Atom_Check(compl_word);
prop = pl_atom_tbl[atom].prop;
if (prop.length == 0)
return 0;
if (prop.type != 0)
{
for (p = pl_atom_tbl[atom].name; *p; p++)
if (!((*__ctype_b_loc ())[(int) ((*p))] & (unsigned short int) _ISalnum) && *p != '_')
return 0;
}
Pl_LE_Compl_Add_Word(pl_atom_tbl[atom].name, prop.length);
return 1;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1_prep#main.c | transcoder-set | PROGRAM_PRINT_SUM_GIVEN_NTH_TERM_1.c | main | 14 | int main(void) {
int n_success = 0;
long param0[] = {42,40,67,73,18,16,74,33,92,22};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#AREA_SQUARE_CIRCUMSCRIBED_CIRCLE_prep#max.c | transcoder-set | AREA_SQUARE_CIRCUMSCRIBED_CIRCLE.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#ROUND_THE_GIVEN_NUMBER_TO_NEAREST_MULTIPLE_OF_10_prep#sort.c | transcoder-set | ROUND_THE_GIVEN_NUMBER_TO_NEAREST_MULTIPLE_OF_10.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlmemory_prep#xmlInitMemory.c | libxml2 | xmlmemory.c | xmlInitMemory | 5 | int
xmlInitMemory(void) {
xmlInitParser();
return(0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlValidateDtdFinal.c | libxml2 | libxml2-py.c | libxml_xmlValidateDtdFinal | 18 | PyObject *
libxml_xmlValidateDtdFinal(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
int c_retval;
xmlValidCtxtPtr ctxt;
PyObject *pyobj_ctxt;
xmlDocPtr doc;
PyObject *pyobj_doc;
if (libxml_deprecationWarning("xmlValidateDtdFinal") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"OO:xmlValidateDtdFinal", &pyobj_ctxt, &pyobj_doc))
return(((void *)0));
ctxt = (xmlValidCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyValidCtxt_Object *)(pyobj_ctxt))->obj));
doc = (xmlDocPtr) (((pyobj_doc) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_doc))->obj));
c_retval = xmlValidateDtdFinal(ctxt, doc);
py_retval = libxml_intWrap((int) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_cos.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_cos | 1 | int ti_cos(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *in1 = inputs[0]; (void)options; double *output = outputs[0]; int i; for (i = 0; i < size; ++i) { output[i] = (cos(in1[i])); } return 0; }
| {
"array_type": 4,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlNewProp.c | libxml2 | libxml2-py.c | libxml_xmlNewProp | 15 | PyObject *
libxml_xmlNewProp(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlAttrPtr c_retval;
xmlNodePtr node;
PyObject *pyobj_node;
xmlChar * name;
xmlChar * value;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"Ozz:xmlNewProp", &pyobj_node, &name, &value))
return(((void *)0));
node = (xmlNodePtr) (((pyobj_node) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_node))->obj));
c_retval = xmlNewProp(node, name, value);
py_retval = libxml_xmlNodePtrWrap((xmlNodePtr) c_retval);
return(py_retval);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#read_prep#parse_file_seq.c | make-4.4.1 | read.c | parse_file_seq | 194 | void *
parse_file_seq (char **stringp, size_t size, int stopmap,
const char *prefix, int flags)
{
static char *tmpbuf = ((void *)0);
int cachep = (! ((((flags))&((0x0010))) != 0));
struct nameseq *new = 0;
struct nameseq **newp = &new;
char *p;
glob_t gl;
char *tp;
int findmap = stopmap|0x0000|0x0001;
int found_wait = 0;
if ((! ((((flags))&((0x0020))) != 0)))
findmap |= 0x0002;
stopmap |= 0x0001;
if (size < sizeof (struct nameseq))
size = sizeof (struct nameseq);
if ((! ((((flags))&((0x0004))) != 0)))
dir_setup_glob (&gl);
{
static size_t tmpbuf_len = 0;
size_t l = strlen (*stringp) + 1;
if (l > tmpbuf_len)
{
tmpbuf = xrealloc (tmpbuf, l);
tmpbuf_len = l;
}
}
tp = tmpbuf;
p = *stringp;
while (1)
{
const char *name;
const char **nlist = 0;
char *tildep = 0;
int globme = 1;
char *arname = 0;
char *memname = 0;
char *s;
size_t nlen;
int tot, i;
while ((((stopchar_map[(unsigned char)((*(p)))])&(((0x0002|0x0004)))) != 0)) ++(p);
if ((((stopchar_map[(unsigned char)(*p)])&((stopmap))) != 0))
break;
s = p;
p = find_map_unquote (p, findmap);
if (!p)
p = s + strlen (s);
if ((((flags)&(0x0040)) != 0) && p - s == (sizeof (".WAIT")-1)
&& memcmp (s, ".WAIT", (sizeof (".WAIT")-1)) == 0)
{
found_wait = 1;
continue;
}
if ((! ((((flags))&((0x0001))) != 0)))
while (p - s > 2 && s[0] == '.' && s[1] == '/')
{
s += 2;
while (*s == '/')
++s;
}
if (s == p)
{
tp[0] = '.';
tp[1] = '/';
tp[2] = '\0';
nlen = 2;
}
else
{
nlen = p - s;
memcpy (tp, s, nlen);
tp[nlen] = '\0';
}
if ((! ((((flags))&((0x0002))) != 0))
&& tp == tmpbuf && tp[0] != '(' && tp[nlen-1] != ')')
{
char *n = strchr (tp, '(');
if (n)
{
const char *e = p;
do
{
const char *o = e;
while ((((stopchar_map[(unsigned char)((*(e)))])&(((0x0002|0x0004)))) != 0)) ++(e);
while (! (((stopchar_map[(unsigned char)(*e)])&((findmap))) != 0))
++e;
if (e == o)
break;
if (e[-1] == ')')
{
nlen -= (n + 1) - tp;
tp = n + 1;
break;
}
}
while (*e != '\0');
if (! nlen)
continue;
}
}
if (tp > tmpbuf)
{
if (tp[nlen-1] == ')')
{
tp = tmpbuf;
if (nlen == 1)
continue;
}
else
{
tp[nlen++] = ')';
tp[nlen] = '\0';
}
}
if ((((flags)&(0x0004)) != 0))
{
do { struct nameseq *_ns = xcalloc (size); const char *__n = (concat (2, prefix, tmpbuf)); _ns->name = (cachep ? strcache_add (__n) : xstrdup (__n)); if (found_wait) { ((struct dep*)_ns)->wait_here = 1; found_wait = 0; } *newp = _ns; newp = &_ns->next; } while(0);
continue;
}
name = tmpbuf;
if (tmpbuf[0] == '~')
{
tildep = tilde_expand (tmpbuf);
if (tildep != 0)
name = tildep;
}
if ((! ((((flags))&((0x0002))) != 0)) && ar_name (name))
{
ar_parse_name (name, &arname, &memname);
name = arname;
}
if ((! ((((flags))&((0x0008))) != 0)) && strpbrk (name, "?*[") == ((void *)0))
{
globme = 0;
tot = 1;
nlist = &name;
}
else
switch (glob (name, (1 << 9), ((void *)0), &gl))
{
case 1:
out_of_memory ();
case 0:
tot = gl.gl_pathc;
nlist = (const char **)gl.gl_pathv;
break;
case 3:
if ((((flags)&(0x0008)) != 0))
{
tot = 0;
break;
}
default:
tot = 1;
nlist = &name;
break;
}
for (i = 0; i < tot; ++i)
if (memname != 0)
{
struct nameseq *found = ar_glob (nlist[i], memname, size);
if (! found)
do { struct nameseq *_ns = xcalloc (size); const char *__n = (concat (5, prefix, nlist[i], "(", memname, ")")); _ns->name = (cachep ? strcache_add (__n) : xstrdup (__n)); if (found_wait) { ((struct dep*)_ns)->wait_here = 1; found_wait = 0; } *newp = _ns; newp = &_ns->next; } while(0);
else
{
if (*newp)
(*newp)->next = found;
else
*newp = found;
while (1)
{
if (! cachep)
found->name = xstrdup (concat (2, prefix, name));
else if (prefix)
found->name = strcache_add (concat (2, prefix, name));
if (found->next == 0)
break;
found = found->next;
}
newp = &found->next;
}
}
else
do { struct nameseq *_ns = xcalloc (size); const char *__n = (concat (2, prefix, nlist[i])); _ns->name = (cachep ? strcache_add (__n) : xstrdup (__n)); if (found_wait) { ((struct dep*)_ns)->wait_here = 1; found_wait = 0; } *newp = _ns; newp = &_ns->next; } while(0);
if (globme)
globfree (&gl);
free (arname);
free (tildep);
}
*stringp = p;
return new;
}
| {
"array_type": 4,
"break_continue_statement": 11,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 33,
"memory_management": 2,
"memory_operation": 1,
"pointer_type": 17,
"return_statement": 1,
"struct_type": 5,
"switch_statement": 1,
"type_casting": 8,
"union_type": 0,
"while_loop": 11
} |
libxml2#debugXML_prep#xmlDebugDumpAttrList.c | libxml2 | debugXML.c | xmlDebugDumpAttrList | 11 | void
xmlDebugDumpAttrList(FILE * output, xmlAttrPtr attr, int depth)
{
xmlDebugCtxt ctxt;
if (output == ((void *)0)) return;
xmlCtxtDumpInitCtxt(&ctxt);
ctxt.output = output;
ctxt.depth = depth;
xmlCtxtDumpAttrList(&ctxt, attr);
xmlCtxtDumpCleanCtxt(&ctxt);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_single_quoted_strings_prep#utest_run_allow_single_quoted_strings_read_write_pretty_read.c | json.h | allow_single_quoted_strings.c | utest_run_allow_single_quoted_strings_read_write_pretty_read | 7 | void utest_run_allow_single_quoted_strings_read_write_pretty_read(int *utest_result, struct allow_single_quoted_strings *utest_fixture) {
size_t size = 0;
void *json = json_write_pretty(utest_fixture->value, " ", "\n", &size);
free(utest_fixture->value);
utest_fixture->value = json_parse(json, size - 1);
free(json);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
bzip2#bzlib_prep#BZ2_bzdopen.c | bzip2 | bzlib.c | BZ2_bzdopen | 6 | BZFILE * BZ2_bzdopen
( int fd,
const char *mode )
{
return bzopen_or_bzdopen(((void *)0),fd,mode, 1);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlcatalog_prep#main.c | libxml2 | xmlcatalog.c | main | 260 | int main(int argc, char **argv) {
int i;
int ret;
int exit_value = 0;
if (argc <= 1) {
usage(argv[0]);
return(1);
}
xmlCheckVersion(21400);
for (i = 1; i < argc ; i++) {
if (!strcmp(argv[i], "-"))
break;
if (argv[i][0] != '-')
break;
if ((!strcmp(argv[i], "-verbose")) ||
(!strcmp(argv[i], "-v")) ||
(!strcmp(argv[i], "--verbose"))) {
verbose++;
xmlCatalogSetDebug(verbose);
} else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout"))) {
noout = 1;
} else if ((!strcmp(argv[i], "-shell")) ||
(!strcmp(argv[i], "--shell"))) {
shell++;
noout = 1;
} else if ((!strcmp(argv[i], "-sgml")) ||
(!strcmp(argv[i], "--sgml"))) {
sgml++;
} else if ((!strcmp(argv[i], "-create")) ||
(!strcmp(argv[i], "--create"))) {
create++;
} else if ((!strcmp(argv[i], "-convert")) ||
(!strcmp(argv[i], "--convert"))) {
convert++;
} else if ((!strcmp(argv[i], "-no-super-update")) ||
(!strcmp(argv[i], "--no-super-update"))) {
no_super_update++;
} else if ((!strcmp(argv[i], "-add")) ||
(!strcmp(argv[i], "--add"))) {
if (sgml)
i += 2;
else
i += 3;
add++;
} else if ((!strcmp(argv[i], "-del")) ||
(!strcmp(argv[i], "--del"))) {
i += 1;
del++;
} else {
fprintf(stderr, "Unknown option %s\n", argv[i]);
usage(argv[0]);
return(1);
}
}
for (i = 1; i < argc; i++) {
if ((!strcmp(argv[i], "-add")) ||
(!strcmp(argv[i], "--add"))) {
if (sgml)
i += 2;
else
i += 3;
continue;
} else if ((!strcmp(argv[i], "-del")) ||
(!strcmp(argv[i], "--del"))) {
i += 1;
if (i == argc || (sgml && i + 1 == argc)) {
fprintf(stderr, "No catalog entry specified to remove from\n");
usage (argv[0]);
return(1);
}
continue;
} else if (argv[i][0] == '-')
continue;
if (filename == ((void *)0) && argv[i][0] == '\0') {
xmlInitializeCatalog();
} else {
filename = argv[i];
ret = xmlLoadCatalog(argv[i]);
if ((ret < 0) && (create)) {
xmlCatalogAdd((xmlChar *) "catalog", (xmlChar *) argv[i], ((void *)0));
}
xmlCatalogResolvePublic((xmlChar *) "");
}
break;
}
if (convert)
ret = xmlCatalogConvert();
if ((add) || (del)) {
for (i = 1; i < argc ; i++) {
if (!strcmp(argv[i], "-"))
break;
if (argv[i][0] != '-')
continue;
if (strcmp(argv[i], "-add") && strcmp(argv[i], "--add") &&
strcmp(argv[i], "-del") && strcmp(argv[i], "--del"))
continue;
if (sgml) {
xmlCatalogPtr catal = ((void *)0);
xmlCatalogPtr super = ((void *)0);
catal = xmlLoadSGMLSuperCatalog(argv[i + 1]);
if ((!strcmp(argv[i], "-add")) ||
(!strcmp(argv[i], "--add"))) {
if (catal == ((void *)0))
catal = xmlNewCatalog(1);
xmlACatalogAdd(catal, (xmlChar *) "CATALOG",
(xmlChar *) argv[i + 2], ((void *)0));
if (!no_super_update) {
super = xmlLoadSGMLSuperCatalog("/usr/local/etc" "/sgml/catalog");
if (super == ((void *)0))
super = xmlNewCatalog(1);
xmlACatalogAdd(super, (xmlChar *) "CATALOG",
(xmlChar *) argv[i + 1], ((void *)0));
}
} else {
if (catal != ((void *)0))
ret = xmlACatalogRemove(catal, (xmlChar *) argv[i + 2]);
else
ret = -1;
if (ret < 0) {
fprintf(stderr, "Failed to remove entry from %s\n",
argv[i + 1]);
exit_value = 1;
}
if ((!no_super_update) && (noout) && (catal != ((void *)0)) &&
(xmlCatalogIsEmpty(catal))) {
super = xmlLoadSGMLSuperCatalog(
"/usr/local/etc" "/sgml/catalog");
if (super != ((void *)0)) {
ret = xmlACatalogRemove(super,
(xmlChar *) argv[i + 1]);
if (ret < 0) {
fprintf(stderr,
"Failed to remove entry from %s\n",
"/usr/local/etc" "/sgml/catalog");
exit_value = 1;
}
}
}
}
if (noout) {
FILE *out;
if (xmlCatalogIsEmpty(catal)) {
remove(argv[i + 1]);
} else {
out = fopen(argv[i + 1], "wb");
if (out == ((void *)0)) {
fprintf(stderr, "could not open %s for saving\n",
argv[i + 1]);
exit_value = 2;
noout = 0;
} else {
xmlACatalogDump(catal, out);
fclose(out);
}
}
if (!no_super_update && super != ((void *)0)) {
if (xmlCatalogIsEmpty(super)) {
remove("/usr/local/etc" "/sgml/catalog");
} else {
out = fopen("/usr/local/etc" "/sgml/catalog", "wb");
if (out == ((void *)0)) {
fprintf(stderr,
"could not open %s for saving\n",
"/usr/local/etc" "/sgml/catalog");
exit_value = 2;
noout = 0;
} else {
xmlACatalogDump(super, out);
fclose(out);
}
}
}
} else {
xmlACatalogDump(catal, stdout);
}
i += 2;
xmlFreeCatalog(catal);
xmlFreeCatalog(super);
} else {
if ((!strcmp(argv[i], "-add")) ||
(!strcmp(argv[i], "--add"))) {
if ((argv[i + 3] == ((void *)0)) || (argv[i + 3][0] == 0))
ret = xmlCatalogAdd((xmlChar *) argv[i + 1], ((void *)0),
(xmlChar *) argv[i + 2]);
else
ret = xmlCatalogAdd((xmlChar *) argv[i + 1],
(xmlChar *) argv[i + 2],
(xmlChar *) argv[i + 3]);
if (ret != 0) {
printf("add command failed\n");
exit_value = 3;
}
i += 3;
} else if ((!strcmp(argv[i], "-del")) ||
(!strcmp(argv[i], "--del"))) {
ret = xmlCatalogRemove((xmlChar *) argv[i + 1]);
if (ret < 0) {
fprintf(stderr, "Failed to remove entry %s\n",
argv[i + 1]);
exit_value = 1;
}
i += 1;
}
}
}
} else if (shell) {
usershell();
} else {
for (i++; i < argc; i++) {
xmlURIPtr uri;
xmlChar *ans;
uri = xmlParseURI(argv[i]);
if (uri == ((void *)0)) {
ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]);
if (ans == ((void *)0)) {
printf("No entry for PUBLIC %s\n", argv[i]);
exit_value = 4;
} else {
printf("%s\n", (char *) ans);
xmlFree(ans);
}
} else {
xmlFreeURI(uri);
ans = xmlCatalogResolveSystem((const xmlChar *) argv[i]);
if (ans == ((void *)0)) {
printf("No entry for SYSTEM %s\n", argv[i]);
ans = xmlCatalogResolveURI ((const xmlChar *) argv[i]);
if (ans == ((void *)0)) {
printf ("No entry for URI %s\n", argv[i]);
exit_value = 4;
} else {
printf("%s\n", (char *) ans);
xmlFree (ans);
}
} else {
printf("%s\n", (char *) ans);
xmlFree(ans);
}
}
}
}
if ((!sgml) && ((add) || (del) || (create) || (convert))) {
if (noout && filename && *filename) {
FILE *out;
out = fopen(filename, "wb");
if (out == ((void *)0)) {
fprintf(stderr, "could not open %s for saving\n", filename);
exit_value = 2;
noout = 0;
} else {
xmlCatalogDump(out);
}
} else {
xmlCatalogDump(stdout);
}
}
xmlCleanupParser();
return(exit_value);
}
| {
"array_type": 1,
"break_continue_statement": 9,
"enum_type": 0,
"for_loop": 4,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 54,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 24,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH_1_prep#main.c | transcoder-set | FIND_MAXIMUM_AVERAGE_SUBARRAY_OF_K_LENGTH_1.c | main | 26 | int main(void) {
int n_success = 0;
int param0_0[] = {2,5,11,37,41,49,49,63,98};
int param0_1[] = {84,-72,12,0,86,-32,-18,48,60,42,8,-6,-10,-6,-52,-84,-98,76,-10,-14,-94,-48,94,-10,-20,40,-52,0,94,-68,44,-34,-26,-6,-94,34,-80,-62,-40,56,52,-20,74,-46,-88,-26,22};
int param0_2[] = {0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_3[] = {94,97,74,88,14,66,65,50,76,55,70,93,53,30,2,60,65,24,80,73,84,95,49,32,55,70,17,26,96,20,36,2,89,49,83,67,42,51,71,11,61,78,17,78,94,68};
int param0_4[] = {-98,-90,-60,-38,38,42};
int param0_5[] = {1,0,0,1,1,1,1};
int param0_6[] = {4,9,17,17,19,32,35,36,37,40,44,45,47,48,48,56,56,60,61,65,66,79,83,91,93,99};
int param0_7[] = {78,82,-92,-46,-16,-64,28,60,64,52,54,-84,70,22,24,0,-14,20,-90,30,0,86,12,72,-64,-52,86,16,-42};
int param0_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_9[] = {81,77,6,3,72,24,75,47,17,29,69,15,15,50,30,83,11,7,59,7,12,82,45,76,9,48,98,49,29,66,3,53,37,13,72,58,37,87,55};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1[] = {8,34,11,35,3,3,22,25,25,34};
int param2[] = {7,43,18,33,5,4,24,27,20,23};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#layer_prep#LCursorVisibility.c | screen-4.9.0 | layer.c | LCursorVisibility | 12 | void LCursorVisibility(struct layer *l, int vis)
{
struct canvas *cv;
for (cv = l->l_cvlist; cv; cv = cv->c_lnext) {
display = cv->c_display;
if (display->d_blocked)
continue;
if (cv != display->d_forecv)
continue;
CursorVisibility(vis);
}
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_global_object_prep#utest_run_allow_global_object_read_write_minified_read.c | json.h | allow_global_object.c | utest_run_allow_global_object_read_write_minified_read | 7 | void utest_run_allow_global_object_read_write_minified_read(int *utest_result, struct allow_global_object *utest_fixture) {
size_t size = 0;
void *json = json_write_minified(utest_fixture->value, &size);
free(utest_fixture->value);
utest_fixture->value = json_parse(json, size - 1);
free(json);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DIFFERENCE_BETWEEN_HIGHEST_AND_LEAST_FREQUENCIES_IN_AN_ARRAY_prep#sort.c | transcoder-set | DIFFERENCE_BETWEEN_HIGHEST_AND_LEAST_FREQUENCIES_IN_AN_ARRAY.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_map_int32.c | binn-3.0 | binn.c | binn_map_int32 | 5 | int binn_map_int32(void *map, int id) {
int value;
binn_map_get(map, id, 0x61, &value, ((void *)0));
return value;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
ed-1.19#signal_prep#set_window_lines.c | ed-1.19 | signal.c | set_window_lines | 1 | void set_window_lines( const int lines ) { window_lines_ = lines; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json-c#json_object_prep#json_object_new_null.c | json-c | json_object.c | json_object_new_null | 4 | struct json_object *json_object_new_null(void)
{
return ((void *)0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#buf_prep#xmlBufGrow.c | libxml2 | buf.c | xmlBufGrow | 12 | int
xmlBufGrow(xmlBufPtr buf, size_t len) {
if ((buf == ((void *)0)) || (((buf)->flags & ((1u << 0) | (1u << 1)))) || (((buf)->flags & (1u << 2))))
return(-1);
if (buf->size != (size_t) buf->compat_size) if (buf->compat_size < 0x7fffffff) buf->size = buf->compat_size; if (buf->use != (size_t) buf->compat_use) if (buf->compat_use < 0x7fffffff) buf->use = buf->compat_use;
if (len <= buf->size - buf->use)
return(0);
if (xmlBufGrowInternal(buf, len) < 0)
return(-1);
if (buf->size < 0x7fffffff) buf->compat_size = buf->size; else buf->compat_size = 0x7fffffff; if (buf->use < 0x7fffffff) buf->compat_use = buf->use; else buf->compat_use = 0x7fffffff;
return(0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
units-2.22#parse.tab_prep#makenumunit.c | units-2.22 | parse.tab.c | makenumunit | 13 | struct unittype *
makenumunit(double num,int *myerr)
{
struct unittype *ret;
ret=getnewunit();
if (!ret){
*myerr = 14;
return 0;
}
ret->factor = num;
*myerr = 0;
return ret;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#history_prep#get_history_completion.c | nano-7.2 | history.c | get_history_completion | 30 | char *get_history_completion(linestruct **here, char *string, size_t len)
{
linestruct *htop = ((void *)0), *hbot = ((void *)0);
linestruct *item;
if (*here == search_history) {
htop = searchtop;
hbot = searchbot;
} else if (*here == replace_history) {
htop = replacetop;
hbot = replacebot;
} else if (*here == execute_history) {
htop = executetop;
hbot = executebot;
}
item = find_in_history((*here)->prev, htop, string, len);
while (item != ((void *)0) && strcmp(item->data, string) == 0)
item = find_in_history(item->prev, htop, string, len);
if (item) {
*here = item;
return mallocstrcpy(string, item->data);
}
item = find_in_history(hbot, *here, string, len);
while (item != ((void *)0) && strcmp(item->data, string) == 0)
item = find_in_history(item->prev, *here, string, len);
if (item) {
*here = item;
return mallocstrcpy(string, item->data);
}
return (char *)string;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 2
} |
json.h#test_prep#json_extract_value.c | json.h | test.c | json_extract_value | 3 | struct json_value_s *json_extract_value(const struct json_value_s *value) {
return json_extract_value_ex(value, 0, 0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#proti_prep#fisendcmd.c | uucp-1.07 | proti.c | fisendcmd | 28 | boolean
fisendcmd (qdaemon, z, ilocal, iremote)
struct sdaemon *qdaemon;
const char *z;
int ilocal;
int iremote;
{
size_t clen;
do { if (((iDebug & ((010))) != 0)) ulog (LOG_DEBUG, ("fisendcmd: Sending command \"%s\""), (z)); } while (0);
clen = strlen (z);
while ((1))
{
char *zpacket;
size_t csize;
zpacket = zigetspace (qdaemon, &csize);
if (clen < csize)
{
memcpy (zpacket, z, clen + 1);
return fisenddata (qdaemon, zpacket, clen + 1, ilocal, iremote,
(long) -1);
}
memcpy (zpacket, z, csize);
z += csize;
clen -= csize;
if (! fisenddata (qdaemon, zpacket, csize, ilocal, iremote, (long) -1))
return (0);
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 0,
"memory_operation": 2,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 2
} |
tar-1.34#misc_prep#xpipe.c | tar-1.34 | misc.c | xpipe | 6 | void
xpipe (int fd[2])
{
if (pipe (fd) < 0)
call_arg_fatal ("pipe", gettext ("interprocess channel"));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
patch-2.7.6#asnprintf_prep#asnprintf.c | patch-2.7.6 | asnprintf.c | asnprintf | 10 | char *
asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
{
va_list args;
char *result;
__builtin_va_start(args,format);
result = vasnprintf (resultbuf, lengthp, format, args);
__builtin_va_end(args);
return result;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#display_prep#RedisplayDisplays.c | screen-4.9.0 | display.c | RedisplayDisplays | 9 | void
RedisplayDisplays(cur_only)
int cur_only;
{
struct display *olddisplay = display;
for (display = displays; display; display = display->d_next)
Redisplay(cur_only);
display = olddisplay;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#utils_prep#compile_pcre2_regex.c | wget-1.21.4 | utils.c | compile_pcre2_regex | 13 | void *
compile_pcre2_regex (const char *str)
{
int errornumber;
size_t erroroffset;
pcre2_code_8 *regex = pcre2_compile_8((PCRE2_SPTR8) str, (~(size_t)0), 0, &errornumber, &erroroffset, ((void *)0));
if (! regex)
{
fprintf (stderr, gettext("Invalid regular expression %s, PCRE2 error %d\n"),
quote (str), errornumber);
}
return regex;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPathCastBooleanToNumber.c | libxml2 | xpath.c | xmlXPathCastBooleanToNumber | 6 | double
xmlXPathCastBooleanToNumber(int val) {
if (val)
return(1.0);
return(0.0);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_route_prep#osip_route_parse.c | libosip2-5.3.1 | osip_route.c | osip_route_parse | 3 | int osip_route_parse(osip_route_t *route, const char *hvalue) {
return osip_from_parse((osip_from_t *) route, hvalue);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#misc_prep#Pl_Popcount.c | gprolog-1.5.0 | misc.c | Pl_Popcount | 32 | int
Pl_Popcount(PlLong x)
{
static int nb_bits_in_byte[256] =
{ 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3,
4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6,
4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6,
4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6,
4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7,
5, 6, 6, 7, 6, 7, 7, 8
};
int n = 0;
n += nb_bits_in_byte[x & 0xFF];
n += nb_bits_in_byte[(x >> 8) & 0xFF];
n += nb_bits_in_byte[(x >> 16) & 0xFF];
n += nb_bits_in_byte[(x >> 24) & 0xFF];
n += nb_bits_in_byte[(x >> 32) & 0xFF];
n += nb_bits_in_byte[(x >> 40) & 0xFF];
n += nb_bits_in_byte[(x >> 48) & 0xFF];
n += nb_bits_in_byte[(x >> 56) & 0xFF];
return n;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
bc-1.07.1#misc_prep#dc_system.c | bc-1.07.1 | misc.c | dc_system | 20 | const char *
dc_system (
const char *s )
{
const char *p;
char *tmpstr;
size_t len;
p = strchr(s, '\n');
if (p != ((void *)0)) {
len = (size_t) (p - s);
tmpstr = dc_malloc(len + 1);
strncpy(tmpstr, s, len);
tmpstr[len] = '\0';
system(tmpstr);
free(tmpstr);
return p + 1;
}
system(s);
return s + strlen(s);
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS_prep#len.c | transcoder-set | HOW_TO_PRINT_MAXIMUM_NUMBER_OF_A_USING_GIVEN_FOUR_KEYS.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#modelu_prep#IsOutput.c | mcsim-6.2.0 | modelu.c | IsOutput | 4 | BOOL IsOutput (HVAR hvar)
{
return (GetVarType(hvar) == 0x30000);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#fgetscont.c | units-2.22 | units.c | fgetscont | 20 | char *
fgetscont(char *buf, int size, FILE *file, int *count)
{
if (!fgets(buf,size,file))
return 0;
(*count)++;
while(strlen(buf)>=2 && 0==strcmp(buf+strlen(buf)-2,"\\\n")){
(*count)++;
buf[strlen(buf)-2] = 0;
if (strlen(buf)>=size-1)
return buf;
if (!fgets(buf+strlen(buf), size - strlen(buf), file))
return buf;
}
if ((*((buf)+strlen(buf)-1)) == '\\') {
ungetc('\\', file);
(*((buf)+strlen(buf)-1)) = 0;
}
return buf;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
mcsim-6.2.0#matutil_prep#InitlMatrix.c | mcsim-6.2.0 | matutil.c | InitlMatrix | 20 | long **InitlMatrix (long cVectors, long cElemsEach)
{
register long i;
long **rgp;
if ((cVectors == 0) || (cElemsEach == 0)) {
printf ("Error: zero length array allocation in InitlMatrix - Exiting\n");
exit (0);
}
rgp = (long **) malloc (cVectors * sizeof(long *));
if (rgp) {
for (i = 0; i < cVectors; i++) {
rgp[i] = (long *) malloc (cElemsEach * sizeof(long));
if (!rgp[i]) {
rgp = 0;
break;
}
}
}
return (rgp);
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 3,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
tmux#arguments_prep#args_has.c | tmux | arguments.c | args_has | 5 | int
args_has(struct args *args, u_char ch)
{
return (args_find(args, ch) != ((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_PATTERNS_101_GIVEN_STRING_prep#main.c | transcoder-set | FIND_PATTERNS_101_GIVEN_STRING.c | main | 14 | int main(void) {
int n_success = 0;
char param0[][100] = {"fkyso nGZSLfhj","3841","0100001110111","zXZkptcbnQot","4364264685264","10","wDgox","1215572","1","bftZvRTamdUvL"};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_TIME_WRITE_CHARACTERS_USING_INSERT_DELETE_COPY_OPERATION_prep#max.c | transcoder-set | MINIMUM_TIME_WRITE_CHARACTERS_USING_INSERT_DELETE_COPY_OPERATION.c | max | 1 | int max(int x, int y) { return (x > y)? x: y; }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_atr_ref.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_atr_ref | 20 | int ti_atr_ref(int size, double const *const *inputs, double const *options, double *const *outputs) {
const int period = (int)options[0];
if (period < 1) return 1;
if (size <= ti_atr_start(options)) return 0;
const int tr_start = ti_tr_start(options);
const int tr_size = size - tr_start;
double *truerange = malloc((unsigned int)tr_size * sizeof(double));
if (!truerange) {return 2;}
double *tr_outputs[1] = {truerange};
const int tr_ret = ti_tr(size, inputs, 0, tr_outputs);
if (tr_ret != 0) {
free(truerange);
return tr_ret;
}
const double *wilders_inputs[1] = {truerange};
const int wilders_ret = ti_wilders(tr_size, wilders_inputs, options, outputs);
free(truerange);
((void) sizeof ((size - ti_atr_start(options) == size - ti_wilders_start(options)) ? 1 : 0), __extension__ ({ if (size - ti_atr_start(options) == size - ti_wilders_start(options)) ; else __assert_fail ("size - ti_atr_start(options) == size - ti_wilders_start(options)", "tiamalgamation.c", 1931, __extension__ __PRETTY_FUNCTION__); }));
return wilders_ret;
}
| {
"array_type": 3,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 5,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 3,
"return_statement": 5,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlSetNs.c | libxml2 | libxml2-py.c | libxml_xmlSetNs | 14 | PyObject *
libxml_xmlSetNs(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlNodePtr node;
PyObject *pyobj_node;
xmlNsPtr ns;
PyObject *pyobj_ns;
if (!_PyArg_ParseTuple_SizeT(args, (char *)"OO:xmlSetNs", &pyobj_node, &pyobj_ns))
return(((void *)0));
node = (xmlNodePtr) (((pyobj_node) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_node))->obj));
ns = (xmlNsPtr) (((pyobj_ns) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyxmlNode_Object *)(pyobj_ns))->obj));
xmlSetNs(node, ns);
_Py_INCREF(((PyObject*)((&_Py_NoneStruct))));
return((&_Py_NoneStruct));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 2,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#fat-x86_64_prep#nettle_aes256_decrypt.c | nettle-3.9.1 | fat-x86_64.c | nettle_aes256_decrypt | 1 | void nettle_aes256_decrypt (const struct aes256_ctx *ctx, size_t length, uint8_t *dst,const uint8_t *src) { return nettle_aes256_decrypt_vec (ctx, length, dst, src); }
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#dynarray_finalize_prep#__libc_dynarray_finalize.c | gawk-5.2.2 | dynarray_finalize.c | __libc_dynarray_finalize | 30 | _Bool
__libc_dynarray_finalize (struct dynarray_header *list,
void *scratch, size_t element_size,
struct dynarray_finalize_result *result)
{
if (__dynarray_error (list))
return 0;
size_t used = list->used;
if (used == 0)
{
if (list->array != scratch)
pma_free (list->array);
*result = (struct dynarray_finalize_result) { ((void *)0), 0 };
return 1;
}
size_t allocation_size = used * element_size;
void *heap_array = pma_malloc (allocation_size);
if (heap_array != ((void *)0))
{
if (list->array != ((void *)0))
memcpy (heap_array, list->array, allocation_size);
if (list->array != scratch)
pma_free (list->array);
*result = (struct dynarray_finalize_result)
{ .array = heap_array, .length = used };
return 1;
}
else
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 6,
"memory_management": 0,
"memory_operation": 1,
"pointer_type": 1,
"return_statement": 4,
"struct_type": 2,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_CIRCUMFERENCE_PARALLELOGRAM_prep#f_gold.c | transcoder-set | PROGRAM_CIRCUMFERENCE_PARALLELOGRAM.c | f_gold | 3 | float f_gold ( float a, float b ) {
return ( ( 2 * a ) + ( 2 * b ) );
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FLOOR_IN_A_SORTED_ARRAY_prep#sort.c | transcoder-set | FLOOR_IN_A_SORTED_ARRAY.c | sort | 1 | void sort (int arr [ ], int n) {qsort (arr, n, sizeof(int), cmpfunc);}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_ROTATION_COUNT_ROTATED_SORTED_ARRAY_1_prep#main.c | transcoder-set | FIND_ROTATION_COUNT_ROTATED_SORTED_ARRAY_1.c | main | 26 | int main(void) {
int n_success = 0;
int param0_0[] = {4,16,38,39,48,74,79};
int param0_1[] = {-46,72,72,-66,96,92,40,8,94,-84,6,-90,38,-6,48,-20,-86,-76,88,-50,-44,-14,54,-6,-2,72,8,-64,-46,44,-88,50,86,38,42,-56};
int param0_2[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_3[] = {48,74,59,57,95,11,25,61,46,54,34,84,7,97,62,57,99,93,76,5,76,93,35,84,37,60,65,16,30,73,42,61,74,77,48,62,84,93,64,57,68,46,28,77};
int param0_4[] = {-72,-68,-66,-66,-62,-62,-52,-48,-42,-42,-42,-38,-30,-22,-20,-20,-16,-16,-14,0,2,2,2,4,12,20,22,26,32,34,46,46,64,64,64,66,68,68,68,74,80,84,84,88,88,90,96,98};
int param0_5[] = {1};
int param0_6[] = {7,11,20,21,22,27,30,30,34,35,36,37,38,60,61,63,63,69,70,75,80,84,88,97};
int param0_7[] = {-2,70,-40};
int param0_8[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
int param0_9[] = {71,71,27,10,97,43,55,71,6,6,77,48,77,2,83,51,61,19,2,51,26,70,20,23,54,15,6,92,35,75,8,57,50,49,88,21,36};
int *param0[10] = {param0_0,param0_1,param0_2,param0_3,param0_4,param0_5,param0_6,param0_7,param0_8,param0_9};
int param1[] = {6,32,16,24,29,0,23,2,30,24};
int param2[] = {6,21,29,26,43,0,22,1,17,22};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i]) == f_gold(param0[i],param1[i],param2[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 3,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#chacha-set-nonce_prep#nettle_chacha_set_counter32.c | nettle-3.9.1 | chacha-set-nonce.c | nettle_chacha_set_counter32 | 5 | void
nettle_chacha_set_counter32(struct chacha_ctx *ctx, const uint8_t *counter)
{
ctx->state[12] = ( (((uint32_t) (counter + 0)[3]) << 24) | (((uint32_t) (counter + 0)[2]) << 16) | (((uint32_t) (counter + 0)[1]) << 8) | ((uint32_t) (counter + 0)[0]));
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#TAIL_RECURSION_prep#main.c | transcoder-set | TAIL_RECURSION.c | main | 14 | int main(void) {
int n_success = 0;
int param0[] = {77,62,42,16,82,37,29,32,82,91};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i]) == f_gold(param0[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 1,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 1,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR_prep#len.c | transcoder-set | PROGRAM_TO_FIND_REMAINDER_WITHOUT_USING_MODULO_OR_OPERATOR.c | len | 1 | int len (int arr [ ]) {return ((int) (sizeof (arr) / sizeof (arr)[0]));}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#paxerror_prep#rmdir_error.c | tar-1.34 | paxerror.c | rmdir_error | 5 | void
rmdir_error (char const *name)
{
call_arg_error ("rmdir", name);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#read_c_prep#Pl_Char_Conversion_2.c | gprolog-1.5.0 | read_c.c | Pl_Char_Conversion_2 | 8 | void
Pl_Char_Conversion_2(WamWord in_char_word, WamWord out_char_word)
{
int c_in, c_out;
c_in = Pl_Rd_Char_Check(in_char_word);
c_out = Pl_Rd_Char_Check(out_char_word);
pl_char_conv[c_in] = c_out;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 0,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.