Dataset Viewer
Auto-converted to Parquet Duplicate
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
optipng-0.7.8#png_prep#png_user_version_check.c
optipng-0.7.8
png.c
png_user_version_check
34
int png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver) { if (user_png_ver != ((void *)0)) { int i = -1; int found_dots = 0; do { i++; if (user_png_ver[i] != "1.6.40"[i]) png_ptr->flags |= 0x20000U; if (user_png_ver[i] == '.') ...
{ "array_type": 2, "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": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2,...
uucp-1.07#protz_prep#fzsendcmd.c
uucp-1.07
protz.c
fzsendcmd
27
boolean fzsendcmd(qdaemon, z, ilocal, iremote) struct sdaemon *qdaemon; const char *z; int ilocal __attribute__ ((__unused__)); int iremote __attribute__ ((__unused__)); { size_t n,clen; long lredo; char *zbuf; clen = strlen (z) + 1; do { if (((iDebug & ((020))) != 0)) ulog (LOG_DEBUG, ("fzsendcmd: sending command...
{ "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": 0, "pointer_type": 1, "return_statement": 5, "struct_type": 1, "switch_statement": 0, "type_casting": 1,...
make-4.4.1#remote-stub_prep#remote_kill.c
make-4.4.1
remote-stub.c
remote_kill
5
int remote_kill (pid_t id __attribute__ ((unused)), int sig __attribute__ ((unused))) { return -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": 0,...
libxml2#uri_prep#xmlCanonicPath.c
libxml2
uri.c
xmlCanonicPath
13
xmlChar * xmlCanonicPath(const xmlChar *path) { xmlChar *ret; if (path == ((void *)0)) return(((void *)0)); if (xmlStrstr(path, (xmlChar *) "://") != ((void *)0)) { ret = xmlURIEscapeStr(path, (xmlChar *) ":/?#[]@!$&()*+,;='%"); } else { ret = xmlStrdup((const xmlChar *) path); } ...
{ "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": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3,...
transcoder-set#COMPUTE_N_UNDER_MODULO_P_prep#f_gold.c
transcoder-set
COMPUTE_N_UNDER_MODULO_P.c
f_gold
8
int f_gold ( int n, int p ) { if ( n >= p ) return 0; int result = 1; for ( int i = 1; i <= n; i ++ ) result = ( result * i ) % p; return result; }
{ "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": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0,...
libxml2#xpath_prep#xmlXPathCastNodeSetToBoolean.c
libxml2
xpath.c
xmlXPathCastNodeSetToBoolean
6
int xmlXPathCastNodeSetToBoolean (xmlNodeSetPtr ns) { if ((ns == ((void *)0)) || (ns->nodeNr == 0)) return(0); return(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": 1,...
tulipindicators-0.9.1#tiamalgamation_prep#ti_marketfi.c
tulipindicators-0.9.1
tiamalgamation.c
ti_marketfi
14
int ti_marketfi(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *high = inputs[0]; const double *low = inputs[1]; const double *volume = inputs[2]; (void)options; double *output = outputs[0]; if (size <= ti_marketfi_start(options)) return 0; ...
{ "array_type": 5, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 4, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2,...
transcoder-set#COUNTS_PATHS_POINT_REACH_ORIGIN_1_prep#f_filled.c
transcoder-set
COUNTS_PATHS_POINT_REACH_ORIGIN_1.c
f_filled
1
int f_filled ( int n, int m ) {}
{ "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,...
transcoder-set#COUNT_STRINGS_WITH_CONSECUTIVE_1S_prep#len.c
transcoder-set
COUNT_STRINGS_WITH_CONSECUTIVE_1S.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,...
less-633#xbuf_prep#xbuf_add_byte.c
less-633
xbuf.c
xbuf_add_byte
17
void xbuf_add_byte(struct xbuffer *xbuf, unsigned char b) { if (xbuf->end >= xbuf->size) { unsigned char *data; if (help_ckd_add(&xbuf->size, xbuf->size, xbuf->size ? xbuf->size : 16, sizeof *(&xbuf->size), ((1 ? 0 : *(&xbuf->size)) - 1 < 0))) out_of_memory(); data = (unsigned char *) ecalloc(xbuf->size, siz...
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 1, "memory_operation": 1, "pointer_type": 1, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 1,...
tmux#layout_prep#layout_init.c
tmux
layout.c
layout_init
9
void layout_init(struct window *w, struct window_pane *wp) { struct layout_cell *lc; lc = w->layout_root = layout_create_cell(((void *)0)); layout_set_size(lc, w->sx, w->sy, 0, 0); layout_make_leaf(lc, wp); layout_fix_panes(w, w->sx, w->sy); }
{ "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": 0, "struct_type": 2, "switch_statement": 0, "type_casting": 1,...
transcoder-set#CHECK_IF_X_CAN_GIVE_CHANGE_TO_EVERY_PERSON_IN_THE_QUEUE_prep#main.c
transcoder-set
CHECK_IF_X_CAN_GIVE_CHANGE_TO_EVERY_PERSON_IN_THE_QUEUE.c
main
25
int main(void) { int n_success = 0; int param0_0[] = {20}; int param0_1[] = {5,5,5,20,10}; int param0_2[] = {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10,10,10,10,10,10,10,10,10,10,10,10,10}; int param0_3[] = {10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,18}; int param0_4[] = {5,5,20}; int param0_5[] = {10,5,5...
{ "array_type": 2, "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,...
transcoder-set#CHOCOLATE_DISTRIBUTION_PROBLEM_prep#len.c
transcoder-set
CHOCOLATE_DISTRIBUTION_PROBLEM.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,...
transcoder-set#FIND_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT_1_prep#min.c
transcoder-set
FIND_WHETHER_A_GIVEN_NUMBER_IS_A_POWER_OF_4_OR_NOT_1.c
min
1
int min(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,...
make-4.4.1#remote-stub_prep#start_remote_job.c
make-4.4.1
remote-stub.c
start_remote_job
7
int start_remote_job (char **argv __attribute__ ((unused)), char **envp __attribute__ ((unused)), int stdin_fd __attribute__ ((unused)), int *is_remote __attribute__ ((unused)), pid_t *id_ptr __attribute__ ((unused)), int *used_stdin __attribute__ ((unused))) { return -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": 0,...
diffutils-3.10#test-localcharset_prep#main.c
diffutils-3.10
test-localcharset.c
main
7
int main (void) { setlocale (6, ""); printf ("%s\n", locale_charset ()); 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,...
mcsim-6.2.0#matutil_prep#InitlVector.c
mcsim-6.2.0
matutil.c
InitlVector
9
long *InitlVector (long cVectors) { if (cVectors == 0) { printf ("Error: zero length array allocation in InitlVector - Exiting\n"); exit (0); } else return (long *) malloc (cVectors * sizeof(long)); }
{ "array_type": 0, "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": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
libosip2-5.3.1#osip_authentication_info_prep#osip_authentication_info_set_srand.c
libosip2-5.3.1
osip_authentication_info.c
osip_authentication_info_set_srand
3
void osip_authentication_info_set_srand(osip_authentication_info_t *authentication_info, char *srand) { authentication_info->srand = (char *) srand; }
{ "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,...
transcoder-set#MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1_prep#main.c
transcoder-set
MAXIMUM_POSSIBLE_DIFFERENCE_TWO_SUBSETS_ARRAY_1.c
main
25
int main(void) { int n_success = 0; int param0_0[] = {19,20,22,23,25,28,33,33,35,35,36,44,44,52,54,54,56,57,57,63,78,78,79,81,89,93,93,93,93,93,93,97}; int param0_1[] = {-20,96,-32,-8,4,14,-26,-58,-68,-68,42,-12,-28,-68,-72,88,-94,-84,20,-58,-50,-78,-4,-22,-54,90,78,2,40,-78,98,52,-48,40,12,6,54,28,-96,-88,98,-...
{ "array_type": 2, "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,...
transcoder-set#CONVERT_STRICTLY_INCREASING_ARRAY_MINIMUM_CHANGES_prep#len.c
transcoder-set
CONVERT_STRICTLY_INCREASING_ARRAY_MINIMUM_CHANGES.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,...
nettle-3.9.1#sha3-256_prep#nettle_sha3_256_init.c
nettle-3.9.1
sha3-256.c
nettle_sha3_256_init
5
void nettle_sha3_256_init (struct sha3_256_ctx *ctx) { memset (ctx, 0, __builtin_offsetof (struct sha3_256_ctx, block)); }
{ "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": 1, "pointer_type": 0, "return_statement": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0,...
libxml2#libxml2-py_prep#libxml_htmlReadFd.c
libxml2
libxml2-py.c
libxml_htmlReadFd
14
PyObject * libxml_htmlReadFd(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; htmlDocPtr c_retval; int fd; char * url; char * encoding; int options; if (!_PyArg_ParseTuple_SizeT(args, (char *)"izzi:htmlReadFd", &fd, &url, &encoding, &options)) retur...
{ "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": 2,...
tmux#environ_prep#environ_next.c
tmux
environ.c
environ_next
5
struct environ_entry * environ_next(struct environ_entry *envent) { return (environ_RB_NEXT(envent)); }
{ "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,...
transcoder-set#PYTHON_PROGRAM_FIND_PERIMETER_CIRCUMFERENCE_SQUARE_RECTANGLE_1_prep#sort.c
transcoder-set
PYTHON_PROGRAM_FIND_PERIMETER_CIRCUMFERENCE_SQUARE_RECTANGLE_1.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,...
libxml2#libxml2-py_prep#libxml_xmlInitGlobals.c
libxml2
libxml2-py.c
libxml_xmlInitGlobals
8
PyObject * libxml_xmlInitGlobals(PyObject *self __attribute__ ((__unused__)), PyObject *args __attribute__ ((__unused__))) { if (libxml_deprecationWarning("xmlInitGlobals") == -1) return(((void *)0)); xmlInitGlobals(); _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": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
libxml2#globals_prep#__xmlDeregisterNodeDefaultValue.c
libxml2
globals.c
__xmlDeregisterNodeDefaultValue
1
xmlDeregisterNodeFunc *__xmlDeregisterNodeDefaultValue(void) { return (&xmlGetThreadLocalStorage(0)->gs_xmlDeregisterNodeDefaultValue); }
{ "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,...
avl#avl_prep#leftRotate.c
avl
avl.c
leftRotate
10
struct Node *leftRotate(struct Node *x) { struct Node *y = x->right; struct Node *T2 = y->left; x->right = T2; x->height = max(height(x->left), height(x->right))+1; y->left = x; y->height = max(height(y->left), height(y->right))+1; return 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": 2, "return_statement": 1, "struct_type": 3, "switch_statement": 0, "type_casting": 0,...
tulipindicators-0.9.1#tiamalgamation_prep#ti_sma.c
tulipindicators-0.9.1
tiamalgamation.c
ti_sma
21
int ti_sma(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *input = inputs[0]; const int period = (int)options[0]; double *output = outputs[0]; const double scale = 1.0 / period; if (period < 1) return 1; if (size <= ti_sma_start(options)) ret...
{ "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,...
bc-1.07.1#number_prep#bc_init_numbers.c
bc-1.07.1
number.c
bc_init_numbers
9
void bc_init_numbers (void) { _zero_ = bc_new_num (1,0); _one_ = bc_new_num (1,0); _one_->n_value[0] = 1; _two_ = bc_new_num (1,0); _two_->n_value[0] = 2; }
{ "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": 1,...
libxml2#libxml2-py_prep#libxml_xmlLoadCatalog.c
libxml2
libxml2-py.c
libxml_xmlLoadCatalog
11
PyObject * libxml_xmlLoadCatalog(PyObject *self __attribute__ ((__unused__)), PyObject *args) { PyObject *py_retval; int c_retval; char * filename; if (!_PyArg_ParseTuple_SizeT(args, (char *)"z:xmlLoadCatalog", &filename)) return(((void *)0)); c_retval = xmlLoadCatalog(filename); py_retv...
{ "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": 3,...
transcoder-set#COUNT_NUMBERS_THAT_DONT_CONTAIN_3_prep#main.c
transcoder-set
COUNT_NUMBERS_THAT_DONT_CONTAIN_3.c
main
14
int main(void) { int n_success = 0; int param0[] = {85,86,3,35,59,38,33,15,75,74}; 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,...
tar-1.34#hash_prep#hash_table_ok.c
tar-1.34
hash.c
hash_table_ok
21
_Bool hash_table_ok (const Hash_table *table) { struct hash_entry const *bucket; size_t n_buckets_used = 0; size_t n_entries = 0; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { struct hash_entry const *cursor = bucket; n_buckets_u...
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 2, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0,...
nano-7.2#history_prep#find_in_history.c
nano-7.2
history.c
find_in_history
10
linestruct *find_in_history(const linestruct *start, const linestruct *end, const char *text, size_t len) { const linestruct *item; for (item = start; item != end->prev && item != ((void *)0); item = item->prev) { if (strncmp(item->data, text, len) == 0) return (linestruct *)item; } return ((void *)0); }
{ "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": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2,...
wget-1.21.4#hash_prep#hash_table_iterate.c
wget-1.21.4
hash.c
hash_table_iterate
6
void hash_table_iterate (struct hash_table *ht, hash_table_iterator *iter) { iter->pos = ht->cells; iter->end = ht->cells + ht->size; }
{ "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,...
libxml2#list_prep#xmlListPushBack.c
libxml2
list.c
xmlListPushBack
17
int xmlListPushBack(xmlListPtr l, void *data) { xmlLinkPtr lkPlace, lkNew; if (l == ((void *)0)) return(0); lkPlace = l->sentinel->prev; lkNew = (xmlLinkPtr)xmlMalloc(sizeof(xmlLink)); if (lkNew == ((void *)0)) return (0); lkNew->data = data; lkNew->next = lkPlace->next; ...
{ "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": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 2,...
gawk-5.2.2#regex_prep#regexec.c
gawk-5.2.2
regex.c
regexec
29
int regexec (const regex_t *__restrict preg, const char *__restrict string, size_t nmatch, regmatch_t pmatch[nmatch], int eflags) { reg_errcode_t err; Idx start, length; re_dfa_t *dfa = preg->buffer; if (eflags & ~(1 | (1 << 1) | (1 << 2))) return _REG_BADPAT; if (eflags & (1 << 2)) { start = ...
{ "array_type": 1, "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": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3,...
diffutils-3.10#ed_prep#pr_forward_ed_script.c
diffutils-3.10
ed.c
pr_forward_ed_script
5
void pr_forward_ed_script (struct change *script) { print_script (script, find_change, pr_forward_ed_hunk); }
{ "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,...
patch-2.7.6#hash_prep#hash_get_n_buckets.c
patch-2.7.6
hash.c
hash_get_n_buckets
5
size_t hash_get_n_buckets (const Hash_table *table) { return table->n_buckets; }
{ "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,...
transcoder-set#SUM_SERIES_12_32_52_2N_12_prep#f_filled.c
transcoder-set
SUM_SERIES_12_32_52_2N_12.c
f_filled
1
int f_filled ( int n ) {}
{ "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,...
transcoder-set#NUMBER_TRIANGLES_N_MOVES_1_prep#f_filled.c
transcoder-set
NUMBER_TRIANGLES_N_MOVES_1.c
f_filled
1
int f_filled ( int n ) {}
{ "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,...
tinycc#tccrun_prep#rt_get_caller_pc.c
tinycc
tccrun.c
rt_get_caller_pc
18
int rt_get_caller_pc(Elf64_Addr *paddr, ucontext_t *uc, int level) { Elf64_Addr fp; int i; if (level == 0) { *paddr = uc->uc_mcontext.gregs[REG_RIP]; return 0; } else { fp = uc->uc_mcontext.gregs[REG_RBP]; for(i=1;i<level;i++) { if (fp <= 0x1000) ...
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 0,...
gawk-5.2.2#eval_prep#update_ERRNO_int.c
gawk-5.2.2
eval.c
update_ERRNO_int
13
void update_ERRNO_int(int errcode) { const char *cp; update_PROCINFO_num("errno", errcode); if (errcode) { cp = strerror(errcode); cp = gettext(cp); } else cp = ""; unref(ERRNO_node->sub.nodep.l.lptr); ERRNO_node->sub.nodep.l.lptr = make_str_node((cp), (strlen(cp)), 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": 1, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 0,...
wget-1.21.4#utils_prep#match_tail.c
wget-1.21.4
utils.c
match_tail
11
_Bool match_tail (const char *string, const char *tail, _Bool fold_case) { int pos = (int) strlen (string) - (int) strlen (tail); if (pos < 0) return 0; if (!fold_case) return !strcmp (string + pos, tail); else return !strcasecmp (string + pos, tail); }
{ "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": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
transcoder-set#FLOOR_IN_A_SORTED_ARRAY_prep#max.c
transcoder-set
FLOOR_IN_A_SORTED_ARRAY.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,...
json.h#allow_multi_line_strings_prep#json_write_minified_array.c
json.h
allow_multi_line_strings.c
json_write_minified_array
15
char *json_write_minified_array(const struct json_array_s *array, char *data) { struct json_array_element_s *element = 0; *data++ = '['; for (element = array->start; 0 != element; element = element->next) { if (element != array->start) { *data++ = ','; } data = json_write_minified_value(element-...
{ "array_type": 0, "break_continue_statement": 0, "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": 2, "switch_statement": 0, "type_casting": 0,...
transcoder-set#NUMBER_WAYS_NODE_MAKE_LOOP_SIZE_K_UNDIRECTED_COMPLETE_CONNECTED_GRAPH_N_NODES_prep#f_gold.c
transcoder-set
NUMBER_WAYS_NODE_MAKE_LOOP_SIZE_K_UNDIRECTED_COMPLETE_CONNECTED_GRAPH_N_NODES.c
f_gold
5
int f_gold ( int n, int k ) { int p = 1; if ( k % 2 ) p = - 1; return ( pow ( n - 1, k ) + p * ( n - 1 ) ) / n; }
{ "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": 0,...
tinycc#tccpp_prep#parse_comment.c
tinycc
tccpp.c
parse_comment
69
uint8_t *parse_comment(uint8_t *p) { int c; p++; for(;;) { for(;;) { c = *p; if (c == '\n' || c == '*' || c == '\\') break; p++; c = *p; if (c == '\n' || c == '*' || c == '\\') break; p++; ...
{ "array_type": 0, "break_continue_statement": 3, "enum_type": 0, "for_loop": 3, "function_pointer": 0, "goto_statement": 2, "if_statement": 18, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 0...
rcs-5.10.1#b-divvy_prep#brush_off.c
rcs-5.10.1
b-divvy.c
brush_off
6
void brush_off (struct divvy *divvy, void *ptr) { divvy->count--; __extension__ ({ struct obstack *__o = (&divvy->space); void *__obj = (void *) (ptr); if (__obj > (void *) __o->chunk && __obj < (void *) __o->chunk_limit) __o->next_free = __o->object_base = (char *) __obj; else _obstack_free (__o, __obj); }); }
{ "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": 2, "switch_statement": 0, "type_casting": 1,...
transcoder-set#PROGRAM_CHECK_ARRAY_SORTED_NOT_ITERATIVE_RECURSIVE_1_prep#cmpfunc.c
transcoder-set
PROGRAM_CHECK_ARRAY_SORTED_NOT_ITERATIVE_RECURSIVE_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,...
libxml2#libxml2-py_prep#libxml_xmlParsePEReference.c
libxml2
libxml2-py.c
libxml_xmlParsePEReference
13
PyObject * libxml_xmlParsePEReference(PyObject *self __attribute__ ((__unused__)), PyObject *args) { xmlParserCtxtPtr ctxt; PyObject *pyobj_ctxt; if (libxml_deprecationWarning("xmlParsePEReference") == -1) return(((void *)0)); if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlParsePEReference", &...
{ "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,...
transcoder-set#PROGRAM_FOR_FACTORIAL_OF_A_NUMBER_prep#f_gold.c
transcoder-set
PROGRAM_FOR_FACTORIAL_OF_A_NUMBER.c
f_gold
4
unsigned int f_gold ( unsigned int n ) { if ( n == 0 ) return 1; return n * f_gold ( n - 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,...
libxml2#xmlunicode_prep#xmlUCSIsHighPrivateUseSurrogates.c
libxml2
xmlunicode.c
xmlUCSIsHighPrivateUseSurrogates
4
int xmlUCSIsHighPrivateUseSurrogates(int code) { return(((code >= 0xDB80) && (code <= 0xDBFF))); }
{ "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,...
libxml2#tree_prep#xmlDOMWrapNewCtxt.c
libxml2
tree.c
xmlDOMWrapNewCtxt
10
xmlDOMWrapCtxtPtr xmlDOMWrapNewCtxt(void) { xmlDOMWrapCtxtPtr ret; ret = xmlMalloc(sizeof(xmlDOMWrapCtxt)); if (ret == ((void *)0)) return (((void *)0)); memset(ret, 0, sizeof(xmlDOMWrapCtxt)); 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": 1, "pointer_type": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3,...
less-633#charset_prep#is_composing_char.c
less-633
charset.c
is_composing_char
7
int is_composing_char(LWCHAR ch) { if (is_in_table(ch, &user_prt_table)) return 0; return is_in_table(ch, &user_compose_table) || is_in_table(ch, &compose_table) || (bs_mode != 2 && is_in_table(ch, &fmt_table)); }
{ "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,...
libxml2#xmlunicode_prep#xmlUCSIsBopomofoExtended.c
libxml2
xmlunicode.c
xmlUCSIsBopomofoExtended
4
int xmlUCSIsBopomofoExtended(int code) { return(((code >= 0x31A0) && (code <= 0x31BF))); }
{ "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,...
libosip2-5.3.1#osip_port_prep#osip_build_random_number.c
libosip2-5.3.1
osip_port.c
osip_build_random_number
34
unsigned int osip_build_random_number() { if (!random_seed_set) { unsigned int ticks; struct timeval tv; int fd; gettimeofday(&tv, ((void *)0)); ticks = (unsigned int) (tv.tv_sec + tv.tv_usec); fd = open("/dev/urandom", 00); if (fd > 0) { unsigned int r; int i; for (i = 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": 0, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 3,...
libxml2#dict_prep#xmlRandom.c
libxml2
dict.c
xmlRandom
4
unsigned xmlRandom(void) { return(xoroshiro64ss(xmlGetLocalRngState())); }
{ "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,...
transcoder-set#MAXIMUM_SUM_PAIRS_SPECIFIC_DIFFERENCE_1_prep#f_filled.c
transcoder-set
MAXIMUM_SUM_PAIRS_SPECIFIC_DIFFERENCE_1.c
f_filled
1
int f_filled ( int arr [ ], int N, int k ) {}
{ "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,...
findutils-4.9.0#pred_prep#pred_inum.c
findutils-4.9.0
pred.c
pred_inum
21
_Bool pred_inum (const char *pathname, struct stat *stat_buf, struct predicate *pred_ptr) { (void) pathname; switch (pred_ptr->args.numinfo.kind) { case COMP_GT: if (stat_buf->st_ino > pred_ptr->args.numinfo.l_val) return (1); break; case COMP_LT: if (stat_buf->st_ino < pred_ptr->args...
{ "array_type": 0, "break_continue_statement": 3, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 3, "memory_management": 0, "memory_operation": 0, "pointer_type": 0, "return_statement": 4, "struct_type": 1, "switch_statement": 1, "type_casting": 1,...
screen-4.9.0#process_prep#SwitchWindow.c
screen-4.9.0
process.c
SwitchWindow
34
void SwitchWindow(n) int n; { struct win *p; do {} while (0); if (n < 0 || n >= maxwin) { ShowWindows(-1); return; } if ((p = wtab[n]) == 0) { ShowWindows(n); return; } if (display == 0) { fore = p; return; } if (p == display->d_fore) { M...
{ "array_type": 1, "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": 1, "return_statement": 5, "struct_type": 1, "switch_statement": 0, "type_casting": 0,...
libxml2#threads_prep#xmlInitRMutex.c
libxml2
threads.c
xmlInitRMutex
8
void xmlInitRMutex(xmlRMutexPtr tok) { (void) tok; pthread_mutex_init(&tok->lock, ((void *)0)); tok->held = 0; tok->waiters = 0; pthread_cond_init(&tok->cv, ((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": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 3,...
json.h#allow_leading_plus_sign_prep#json_get_key_size.c
json.h
allow_leading_plus_sign.c
json_get_key_size
31
int json_get_key_size(struct json_parse_state_s *state) { const size_t flags_bitset = state->flags_bitset; if (json_parse_flags_allow_unquoted_keys & flags_bitset) { size_t offset = state->offset; const size_t size = state->size; const char *const src = state->src; size_t data_size = state->data_siz...
{ "array_type": 1, "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": 1, "switch_statement": 0, "type_casting": 2,...
heman#aabb3_prep#kmAABB3ExpandToContain.c
heman
aabb3.c
kmAABB3ExpandToContain
11
kmAABB3* kmAABB3ExpandToContain(kmAABB3* pOut, const kmAABB3* pIn, const kmAABB3* other) { kmAABB3 result; result.min.x = (pIn->min.x < other->min.x)?pIn->min.x:other->min.x; result.max.x = (pIn->max.x > other->max.x)?pIn->max.x:other->max.x; result.min.y = (pIn->min.y < other->min.y)?pIn->min.y:other->...
{ "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,...
gprolog-1.5.0#callinf_supp_prep#Pl_Load_Call_Info_Arg_1.c
gprolog-1.5.0
callinf_supp.c
Pl_Load_Call_Info_Arg_1
7
void Pl_Load_Call_Info_Arg_1(WamWord arg_no_word) { int arg_no; arg_no = Pl_Rd_Integer(arg_no_word); (pl_reg_bank[arg_no]) = (((PlULong) (save_call_info) << 3) | (PlULong)0x7); }
{ "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,...
wget-1.21.4#asnprintf_prep#asnprintf.c
wget-1.21.4
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,...
tar-1.34#save-cwd_prep#save_cwd.c
tar-1.34
save-cwd.c
save_cwd
14
int save_cwd (struct saved_cwd *cwd) { cwd->name = ((void *)0); cwd->desc = open_safer (".", 00 | 02000000); if (!1) cwd->desc = fd_safer_flag (cwd->desc, 02000000); if (cwd->desc < 0) { cwd->name = getcwd (((void *)0), 0); return cwd->name ? 0 : -1; } return 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": 2, "struct_type": 1, "switch_statement": 0, "type_casting": 2,...
less-633#forwback_prep#get_one_screen.c
less-633
forwback.c
get_one_screen
11
int get_one_screen(void) { int nlines; POSITION pos = ((POSITION)0); for (nlines = 0; nlines < sc_height; nlines++) { pos = forw_line(pos); if (pos == ((POSITION)(-1))) break; } return (nlines < sc_height); }
{ "array_type": 0, "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,...
nano-7.2#move_prep#do_center.c
nano-7.2
move.c
do_center
6
void do_center(void) { adjust_viewport(CENTERING); draw_all_subwindows(); full_refresh(); }
{ "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,...
transcoder-set#DYNAMIC_PROGRAMMING_SUBSET_SUM_PROBLEM_1_prep#min.c
transcoder-set
DYNAMIC_PROGRAMMING_SUBSET_SUM_PROBLEM_1.c
min
1
int min(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,...
transcoder-set#COUNT_NUMBER_OF_WAYS_TO_COVER_A_DISTANCE_1_prep#len.c
transcoder-set
COUNT_NUMBER_OF_WAYS_TO_COVER_A_DISTANCE_1.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,...
transcoder-set#MAXIMUM_TRIPLET_SUM_ARRAY_1_prep#len.c
transcoder-set
MAXIMUM_TRIPLET_SUM_ARRAY_1.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,...
tmux#tty_prep#tty_region_off.c
tmux
tty.c
tty_region_off
5
void tty_region_off(struct tty *tty) { tty_region(tty, 0, tty->sy - 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": 0, "struct_type": 1, "switch_statement": 0, "type_casting": 0,...
transcoder-set#LONGEST_COMMON_SUBSTRING_SPACE_OPTIMIZED_DP_SOLUTION_prep#sort.c
transcoder-set
LONGEST_COMMON_SUBSTRING_SPACE_OPTIMIZED_DP_SOLUTION.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,...
json.h#allow_hexadecimal_numbers_prep#json_parse_object.c
json.h
allow_hexadecimal_numbers.c
json_parse_object
89
void json_parse_object(struct json_parse_state_s *state, int is_global_object, struct json_object_s *object) { const size_t flags_bitset = state->flags_bitset; const size_t size = state->size; const char *const src = state->src; size_t elements = 0; int allow_comma = 0; struct json_ob...
{ "array_type": 0, "break_continue_statement": 3, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 13, "memory_management": 0, "memory_operation": 0, "pointer_type": 6, "return_statement": 0, "struct_type": 8, "switch_statement": 0, "type_casting": 1...
gawk-5.2.2#gawkfts_prep#gawk_fts_read.c
gawk-5.2.2
gawkfts.c
gawk_fts_read
124
FTSENT * gawk_fts_read(FTS *sp) { FTSENT *p, *tmp; int instr; char *t; int saved_errno; ; if (sp->fts_cur == ((void *)0) || (sp->fts_options & (0x200))) return (((void *)0)); p = sp->fts_cur; instr = p->fts_instr; p->fts_instr = 3; if (instr == 1) { p->fts_info = fts_stat(sp, p, 0); return (p); } if (...
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 2, "if_statement": 27, "memory_management": 0, "memory_operation": 1, "pointer_type": 3, "return_statement": 14, "struct_type": 0, "switch_statement": 0, "type_casting": ...
tulipindicators-0.9.1#candles_prep#tc_marubozu.c
tulipindicators-0.9.1
candles.c
tc_marubozu
5
int tc_marubozu(int size, TC_REAL const *const *inputs, tc_config const *options, tc_result *output) { const TC_REAL *open = inputs[0]; const TC_REAL *high = inputs[1]; const TC_REAL *low = inputs[2]; const TC_REAL *close = inputs[3]; const int period = options->period; const TC_REAL div = 1.0 / period; TC_REAL...
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 4, "return_statement": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
libxml2#xinclude_prep#xmlXIncludeSetFlags.c
libxml2
xinclude.c
xmlXIncludeSetFlags
7
int xmlXIncludeSetFlags(xmlXIncludeCtxtPtr ctxt, int flags) { if (ctxt == ((void *)0)) return(-1); ctxt->parseFlags = flags; return(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": 1,...
nettle-3.9.1#dsa-sha256-sign_prep#nettle_dsa_sha256_sign_digest.c
nettle-3.9.1
dsa-sha256-sign.c
nettle_dsa_sha256_sign_digest
11
int nettle_dsa_sha256_sign_digest(const struct dsa_public_key *pub, const struct dsa_private_key *key, void *random_ctx, nettle_random_func *random, const uint8_t *digest, struct dsa_signature *signature) { return nettle_dsa_sign((const struct dsa_params *) pub, key->x, random_...
{ "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": 3, "switch_statement": 0, "type_casting": 0,...
transcoder-set#TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS_1_prep#len.c
transcoder-set
TOTAL_NUMBER_OF_NON_DECREASING_NUMBERS_WITH_N_DIGITS_1.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,...
libxml2#xmlreader_prep#xmlNewTextReaderFilename.c
libxml2
xmlreader.c
xmlNewTextReaderFilename
15
xmlTextReaderPtr xmlNewTextReaderFilename(const char *URI) { xmlParserInputBufferPtr input; xmlTextReaderPtr ret; input = xmlParserInputBufferCreateFilename(URI, XML_CHAR_ENCODING_NONE); if (input == ((void *)0)) return(((void *)0)); ret = xmlNewTextReader(input, URI); if (ret == ((void *)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": 3, "struct_type": 0, "switch_statement": 0, "type_casting": 4,...
gawk-5.2.2#dfa_prep#xmalloc.c
gawk-5.2.2
dfa.c
xmalloc
10
void * xmalloc(size_t bytes) { void *p; if (bytes == 0) bytes = 1; if ((p = pma_malloc(bytes)) == ((void *)0)) xalloc_die (); return p; }
{ "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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
binn-3.0#binn_prep#binn_list_int16.c
binn-3.0
binn.c
binn_list_int16
5
short binn_list_int16(void *list, int pos) { short value; binn_list_get(list, pos, 0x41, &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,...
transcoder-set#FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN_prep#main.c
transcoder-set
FIND_HARMONIC_MEAN_USING_ARITHMETIC_MEAN_GEOMETRIC_MEAN.c
main
15
int main(void) { int n_success = 0; int param0[] = {54,42,63,19,41,7,39,11,96,15}; int param1[] = {83,56,12,76,50,26,42,64,81,54}; for(int i = 0; i < len(param0); ++i) { if(abs(1 - (0.0000001 + abs(f_gold(param0[i],param1[i])) )/ (abs(f_filled(param0[i],param1[i])) + 0.0000001)) < 0.001) ...
{ "array_type": 2, "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,...
transcoder-set#NEXT_POWER_OF_2_2_prep#len.c
transcoder-set
NEXT_POWER_OF_2_2.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,...
transcoder-set#GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM_prep#main.c
transcoder-set
GIVEN_A_SORTED_AND_ROTATED_ARRAY_FIND_IF_THERE_IS_A_PAIR_WITH_A_GIVEN_SUM.c
main
25
int main(void) { int n_success = 0; int param0_0[] = {3,8,10,15,18,19,20,20,21,22,26,30,32,34,43,45,50,50,51,52,53,56,57,58,62,63,65,82,86,91,91,92,92,93,97}; int param0_1[] = {30,-34,86,-30,-26,2,90,8,26,-8,-8,0,-86,68,22,72,-76,48,-24,90,-22,-58,-54,90,-12,-12,88,72,-58,68,84,22,60,66,-52,-38,-90,62,30,-26,88...
{ "array_type": 3, "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": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
transcoder-set#DISTRIBUTING_ITEMS_PERSON_CANNOT_TAKE_TWO_ITEMS_TYPE_prep#max.c
transcoder-set
DISTRIBUTING_ITEMS_PERSON_CANNOT_TAKE_TWO_ITEMS_TYPE.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,...
tar-1.34#dirname-lgpl_prep#mdir_name.c
tar-1.34
dirname-lgpl.c
mdir_name
17
char * mdir_name (char const *file) { size_t length = dir_len (file); _Bool append_dot = (length == 0 || (0 && length == ((void) (file), 0) && file[2] != '\0' && ! ((file[2]) == '/'))); char *dir = malloc (length + append_dot + 1); if (!dir)...
{ "array_type": 2, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 1, "memory_operation": 1, "pointer_type": 1, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 2,...
buffer-0.4.0#buffer_prep#buffer_indexof.c
buffer-0.4.0
buffer.c
buffer_indexof
6
ssize_t buffer_indexof(buffer_t *self, char *str) { char *sub = strstr(self->data, str); if (!sub) return -1; return sub - self->data; }
{ "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": 0,...
gprolog-1.5.0#stream_supp_prep#Pl_Add_Mirror_To_Stream.c
gprolog-1.5.0
stream_supp.c
Pl_Add_Mirror_To_Stream
20
void Pl_Add_Mirror_To_Stream(int stm, int m_stm) { StmInf *pstm = pl_stm_tbl[stm]; StmInf *m_pstm = pl_stm_tbl[m_stm]; StmLst *m; if (stm == m_stm) return; for(m = pstm->mirror; m ; m = m->next) if (m->stm == m_stm) return; m = (StmLst *) Pl_Malloc_Check(sizeof(StmLst), "stream_supp.c", 619); ...
{ "array_type": 1, "break_continue_statement": 0, "enum_type": 0, "for_loop": 1, "function_pointer": 0, "goto_statement": 0, "if_statement": 2, "memory_management": 0, "memory_operation": 0, "pointer_type": 3, "return_statement": 2, "struct_type": 0, "switch_statement": 0, "type_casting": 0,...
transcoder-set#COUNT_PALINDROMIC_SUBSEQUENCE_GIVEN_STRING_prep#f_filled.c
transcoder-set
COUNT_PALINDROMIC_SUBSEQUENCE_GIVEN_STRING.c
f_filled
1
int f_filled ( char str [] ) {}
{ "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,...
cflow-1.7#c_prep#yyfree.c
cflow-1.7
c.c
yyfree
4
void yyfree (void * ptr ) { free( (char *) ptr ); }
{ "array_type": 0, "break_continue_statement": 0, "enum_type": 0, "for_loop": 0, "function_pointer": 0, "goto_statement": 0, "if_statement": 0, "memory_management": 1, "memory_operation": 0, "pointer_type": 0, "return_statement": 0, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
libxml2#chvalid_prep#xmlIsCombining.c
libxml2
chvalid.c
xmlIsCombining
4
int xmlIsCombining(unsigned int ch) { return((((ch) < 0x100) ? 0 : xmlCharInRange((ch), &xmlIsCombiningGroup))); }
{ "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,...
mcsim-6.2.0#mod_prep#AnnounceProgram.c
mcsim-6.2.0
mod.c
AnnounceProgram
8
void AnnounceProgram (void) { printf ("\n________________________________________\n"); printf ("\nMod " "v6.2.0" " - Model Generator for MCSim\n\n"); printf ("MCSim and associated software comes with ABSOLUTELY NO WARRANTY;\n" "This is free software, and you are welcome to redistribute it\n" "...
{ "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,...
tulipindicators-0.9.1#min_prep#ti_min_ref.c
tulipindicators-0.9.1
min.c
ti_min_ref
16
int ti_min_ref(int size, double const *const *inputs, double const *options, double *const *outputs) { const double *input = inputs[0]; const int period = (int)options[0]; double *output = outputs[0]; if (period < 1) return 1; if (size <= ti_min_start(options)) return 0; for (int i = period-1; i...
{ "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,...
libxml2#xmlwriter_prep#xmlTextWriterWriteBase64.c
libxml2
xmlwriter.c
xmlTextWriterWriteBase64
31
int xmlTextWriterWriteBase64(xmlTextWriterPtr writer, const char *data, int start, int len) { int count; int sum; xmlLinkPtr lk; xmlTextWriterStackEntry *p; if ((writer == ((void *)0)) || (data == ((void *)0)) || (start < 0) || (len < 0)) return -1; sum = 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": 0, "pointer_type": 1, "return_statement": 4, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
transcoder-set#TRIANGULAR_MATCHSTICK_NUMBER_prep#f_gold.c
transcoder-set
TRIANGULAR_MATCHSTICK_NUMBER.c
f_gold
3
int f_gold ( int x ) { return ( 3 * x * ( x + 1 ) ) / 2; }
{ "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,...
libxml2#xmlwriter_prep#xmlTextWriterWriteVFormatElement.c
libxml2
xmlwriter.c
xmlTextWriterWriteVFormatElement
16
int xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer, const xmlChar * name, const char *format, va_list argptr) { int rc; xmlChar *buf; if (writer == ((void *)0)) return -1; buf = xmlTextWriterVSprintf(format, argptr); ...
{ "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": 2,...
transcoder-set#MAXIMUM_SUM_ALTERNATING_SUBSEQUENCE_SUM_prep#cmpfunc.c
transcoder-set
MAXIMUM_SUM_ALTERNATING_SUBSEQUENCE_SUM.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,...
mcsim-6.2.0#matutil_prep#InitiVector.c
mcsim-6.2.0
matutil.c
InitiVector
9
int *InitiVector (long cVectors) { if (cVectors == 0) { printf ("Error: zero length array allocation in InitiVector - Exiting\n"); exit (0); } else return (int *) malloc (cVectors * sizeof(int)); }
{ "array_type": 0, "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": 0, "return_statement": 1, "struct_type": 0, "switch_statement": 0, "type_casting": 1,...
libxml2#libxml2-py_prep#libxml_xmlNextChar.c
libxml2
libxml2-py.c
libxml_xmlNextChar
13
PyObject * libxml_xmlNextChar(PyObject *self __attribute__ ((__unused__)), PyObject *args) { xmlParserCtxtPtr ctxt; PyObject *pyobj_ctxt; if (libxml_deprecationWarning("xmlNextChar") == -1) return(((void *)0)); if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlNextChar", &pyobj_ctxt)) ret...
{ "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,...
End of preview. Expand in Data Studio

This repository contains the C2Rust-Bench dataset that is a minimized set of representative C functions for C-to-Rust transpilation. The C2Rust-Bench dataset is proposed for evaluating the C-to-Rust transpilers. This repo contains two files as following:

1. benchmark.json

This file contains a description of the C2Rust-Bench dataset, which includes:

  • 2,905 C functions and
  • detailed metadata about each of them.

2. Benchmark.tar

The Benchmark.tar file contains the C and Rust files used in the experiments. The Benchmark folder located in Benchmark.tar file contains following subfolders:

  • microbenchmark_set: This folder contains a small set of C and Rust functions transpiled using 9 different LLMs. This microbenchmarking set is used for a preliminary experiment.
  • large_set: This folder contains 15,503 C functions derived from 65 different programs and corresponding Rust functions transpiled using the selected LLM.
  • C2Rust-Bench: This folder contains the proposed C2Rust-Bench and includes the following subfolders:
    • C_functions: This folder contains C code for the selected C functions obtained after segmentation, with one individual function per C file. These individual C funtions are used in transpilation to obtain corresponding Rust functions under Rust_functions folder. Note that these C files may not be individually compilable.
    • C_files: This folder contains the original C files after preprocessing and before the segmentation process. These C files contain additional C code (such as other functions, global variables, struct definitions etc.) in addition to the C code for the selected function. The C files are named the same as their corresponding file in the C_functions folder. These C files are individually compilable.
    • Rust_functions: This folder contains the individual Rust functions obtained from transpilation of C functions in C_functions folder.
Downloads last month
11