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 |
|---|---|---|---|---|---|---|
libosip2-5.3.1#osip_message_parse_prep#__osip_find_next_occurence.c | libosip2-5.3.1 | osip_message_parse.c | __osip_find_next_occurence | 15 | int __osip_find_next_occurence(const char *str, const char *buf, const char **index_of_str, const char *end_of_buf) {
size_t slen;
*index_of_str = ((void *)0);
if (str == ((void *)0) || buf == ((void *)0))
return -2;
slen = strlen(str);
while (slen < (size_t)(end_of_buf - buf)) {
if (!memcmp(str, buf, slen)) {
*index_of_str = buf;
return 0;
}
++buf;
}
return -5;
}
| {
"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": 3,
"union_type": 0,
"while_loop": 1
} |
mtools-4.0.43#file_prep#getDirentry.c | mtools-4.0.43 | file.c | getDirentry | 4 | direntry_t *getDirentry(Stream_t *Stream)
{
return &getUnbufferedFile(Stream)->direntry;
}
| {
"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#NUMBER_DIGITS_PRODUCT_TWO_NUMBERS_prep#f_gold.c | transcoder-set | NUMBER_DIGITS_PRODUCT_TWO_NUMBERS.c | f_gold | 10 | int f_gold ( int a, int b ) {
int count = 0;
int p = abs ( a * b );
if ( p == 0 ) return 1;
while ( p > 0 ) {
count ++;
p = p / 10;
}
return count;
}
| {
"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": 1
} |
libxml2#tree_prep#xmlDocCopyNode.c | libxml2 | tree.c | xmlDocCopyNode | 6 | xmlNodePtr
xmlDocCopyNode(xmlNodePtr node, xmlDocPtr doc, int extended) {
xmlNodePtr ret;
ret = xmlStaticCopyNode(node, doc, ((void *)0), extended);
return(ret);
}
| {
"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
} |
bc-1.07.1#numeric_prep#dc_add.c | bc-1.07.1 | numeric.c | dc_add | 11 | int
dc_add (
dc_num a ,
dc_num b ,
int kscale __attribute__((unused)) ,
dc_num *result )
{
bc_init_num((result));
bc_add((a), (b), (result), 0);
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": 0,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#parser_prep#nexttoken.c | cflow-1.7 | parser.c | nexttoken | 14 | int
nexttoken()
{
int type;
if (curs == tos) {
type = get_token();
tokpush(type, line_num, yylval.str);
yylval.str = ((void *)0);
}
tok = token_stack[curs];
curs++;
debugtoken(&tok, "next token");
return tok.type;
}
| {
"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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_tanh_start.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_tanh_start | 1 | int ti_tanh_start(double const *options) { (void)options; 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
} |
lodepng#lodepng_prep#lodepng_chunk_find.c | lodepng | lodepng.c | lodepng_chunk_find | 7 | unsigned char* lodepng_chunk_find(unsigned char* chunk, unsigned char* end, const char type[5]) {
for(;;) {
if(chunk >= end || end - chunk < 12) return 0;
if(lodepng_chunk_type_equals(chunk, type)) return chunk;
chunk = lodepng_chunk_next(chunk, end);
}
}
| {
"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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_MINIMUM_DISTANCE_BETWEEN_TWO_NUMBERS_1_prep#min.c | transcoder-set | FIND_THE_MINIMUM_DISTANCE_BETWEEN_TWO_NUMBERS_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,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#input_prep#Input.c | screen-4.9.0 | input.c | Input | 45 | void
Input(istr, len, mode, finfunc, priv, data)
char *istr;
int len;
int mode;
void (*finfunc) (char *buf, int len, char *priv);
char *priv;
int data;
{
int maxlen;
struct inpdata *inpdata;
if (!flayer)
return;
if (len > 768)
len = 768;
if (!(mode & 1))
{
maxlen = flayer->l_width - 1 - strlen(istr);
if (len > maxlen)
len = maxlen;
}
if (len < 0)
{
LMsg(0, "Width %d chars too small", -len);
return;
}
if (InitOverlayPage(sizeof(*inpdata), &InpLf, 1))
return;
flayer->l_mode = 1;
inpdata = (struct inpdata *)flayer->l_data;
inpdata->inpmaxlen = len;
inpdata->inpfinfunc = finfunc;
inpdata->inp.pos = inpdata->inp.len = 0;
inpdata->inp.prev = inphist.prev;
inpdata->inpmode = mode;
inpdata->privdata = data;
if (!priv)
priv = (char*)&inpdata->privdata;
inpdata->priv = priv;
inpdata->inpstringlen = 0;
inpdata->inpstring = ((void *)0);
inpdata->search = ((void *)0);
if (istr)
inp_setprompt(istr, (char *)((void *)0));
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 1,
"goto_statement": 0,
"if_statement": 8,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
rcs-5.10.1#b-excwho_prep#getcaller.c | rcs-5.10.1 | b-excwho.c | getcaller | 5 | char const *
getcaller (void)
{
return getusername (currently_setuid_p ());
}
| {
"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#CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER_prep#cmpfunc.c | transcoder-set | CHECK_IF_A_NUMBER_IS_POWER_OF_ANOTHER_NUMBER.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
} |
libosip2-5.3.1#osip_content_disposition_prep#osip_content_disposition_parse.c | libosip2-5.3.1 | osip_content_disposition.c | osip_content_disposition_parse | 18 | int osip_content_disposition_parse(osip_content_disposition_t *cd, const char *hvalue) {
const char *cd_params;
int i;
cd_params = strchr(hvalue, ';');
if (cd_params != ((void *)0)) {
i = __osip_generic_param_parseall(&cd->gen_params, cd_params);
if (i != 0)
return i;
} else
cd_params = hvalue + strlen(hvalue);
if (cd_params - hvalue + 1 < 2)
return -5;
cd->element = (char *) (osip_malloc_func ? osip_malloc_func(cd_params - hvalue + 1) : malloc(cd_params - hvalue + 1));
if (cd->element == ((void *)0))
return -4;
osip_clrncpy(cd->element, hvalue, cd_params - hvalue);
return 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": 1,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
libxml2#valid_prep#xmlCopyEnumeration.c | libxml2 | valid.c | xmlCopyEnumeration | 20 | xmlEnumerationPtr
xmlCopyEnumeration(xmlEnumerationPtr cur) {
xmlEnumerationPtr ret = ((void *)0);
xmlEnumerationPtr last = ((void *)0);
while (cur != ((void *)0)) {
xmlEnumerationPtr copy = xmlCreateEnumeration(cur->name);
if (copy == ((void *)0)) {
xmlFreeEnumeration(ret);
return(((void *)0));
}
if (ret == ((void *)0)) {
ret = last = copy;
} else {
last->next = copy;
last = copy;
}
cur = cur->next;
}
return(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": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 1
} |
rcs-5.10.1#b-anchor_prep#looking_at.c | rcs-5.10.1 | b-anchor.c | looking_at | 5 | _Bool
looking_at (struct tinysym const *sym, char const *start)
{
return (0 == memcmp ((start), (sym->bytes), (sym->len)));
}
| {
"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
} |
uucp-1.07#conn_prep#fconn_set.c | uucp-1.07 | conn.c | fconn_set | 14 | boolean
fconn_set (qconn, tparity, tstrip, txonxoff)
struct sconnection *qconn;
enum tparitysetting tparity;
enum tstripsetting tstrip;
enum txonxoffsetting txonxoff;
{
boolean (*pfset) (struct sconnection *, enum tparitysetting, enum tstripsetting, enum txonxoffsetting);
pfset = qconn->qcmds->pfset;
if (pfset == ((void *)0))
return (1);
do { if (((iDebug & ((040))) != 0)) ulog (LOG_DEBUG, ("fconn_set: Changing setting to %d, %d, %d"), ((int) tparity), ((int) tstrip), ((int) txonxoff)); } while (0);
return (*pfset) (qconn, tparity, tstrip, txonxoff);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 3,
"for_loop": 0,
"function_pointer": 2,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 1
} |
rcs-5.10.1#b-isr_prep#access_page.c | rcs-5.10.1 | b-isr.c | access_page | 10 | char
access_page (struct isr_scratch *scratch,
char const *filename, char const *p)
{
char volatile t;
(scratch->access_name) = filename;
t = *p;
(scratch->access_name) = ((void *)0);
return t;
}
| {
"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
} |
libxml2#libxml2-py_prep#libxml_xmlParseEncName.c | libxml2 | libxml2-py.c | libxml_xmlParseEncName | 15 | PyObject *
libxml_xmlParseEncName(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
PyObject *py_retval;
xmlChar * c_retval;
xmlParserCtxtPtr ctxt;
PyObject *pyobj_ctxt;
if (libxml_deprecationWarning("xmlParseEncName") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlParseEncName", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyparserCtxt_Object *)(pyobj_ctxt))->obj));
c_retval = xmlParseEncName(ctxt);
py_retval = libxml_xmlCharPtrWrap((xmlChar *) 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": 2,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 4,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#help_prep#ZmodemPage.c | screen-4.9.0 | help.c | ZmodemPage | 7 | void ZmodemPage() {
if (InitOverlayPage(1, &ZmodemLf, 1))
return;
LRefreshAll(flayer, 0);
flayer->l_x = flayer->l_width > 32 ? 32 : 0;
flayer->l_y = 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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlreader_prep#xmlTextReaderXmlLang.c | libxml2 | xmlreader.c | xmlTextReaderXmlLang | 8 | xmlChar *
xmlTextReaderXmlLang(xmlTextReaderPtr reader) {
if (reader == ((void *)0))
return(((void *)0));
if (reader->node == ((void *)0))
return(((void *)0));
return(xmlNodeGetLang(reader->node));
}
| {
"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,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#create_prep#simple_finish_header.c | tar-1.34 | create.c | simple_finish_header | 14 | void
simple_finish_header (union block *header)
{
size_t i;
int sum;
char *p;
memcpy (header->header.chksum, " ", sizeof header->header.chksum);
sum = 0;
p = header->buffer;
for (i = sizeof *header; i-- != 0; )
sum += 0xFF & *p++;
uintmax_to_chars ((uintmax_t) sum, header->header.chksum, 7);
set_next_block_after (header);
}
| {
"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": 1,
"pointer_type": 1,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 1,
"while_loop": 0
} |
hello-2.12.1#xmalloc_prep#xrealloc.c | hello-2.12.1 | xmalloc.c | xrealloc | 13 | void *
xrealloc (void *p, size_t n)
{
if (!HAVE_GNU_REALLOC && !n && p)
{
free (p);
return ((void *)0);
}
void *r = realloc (p, n);
if (!r && (n || (HAVE_GNU_REALLOC && !p)))
xalloc_die ();
return r;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 2,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
buffer-0.4.0#buffer_prep#buffer_length.c | buffer-0.4.0 | buffer.c | buffer_length | 4 | size_t
buffer_length(buffer_t *self) {
return strlen(self->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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
less-633#search_prep#chg_hilite.c | less-633 | search.c | chg_hilite | 7 | void chg_hilite(void)
{
clr_hilite();
hide_hilite = 0;
if (hilite_search == 2)
hilite_screen();
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#pkcs1-sec-decrypt_prep#_nettle_pkcs1_sec_decrypt.c | nettle-3.9.1 | pkcs1-sec-decrypt.c | _nettle_pkcs1_sec_decrypt | 20 | int
_nettle_pkcs1_sec_decrypt (size_t length, uint8_t *message,
size_t padded_message_length,
const volatile uint8_t *padded_message)
{
volatile int ok;
size_t i, t;
if (length + 11 > padded_message_length)
return 0;
t = padded_message_length - length - 1;
ok = ((((uint32_t)(padded_message[0]) ^ (uint32_t)(0)) - 1U) >> 31);
ok &= ((((uint32_t)(padded_message[1]) ^ (uint32_t)(2)) - 1U) >> 31);
for (i = 2; i < t; i++)
{
ok &= ((0U - ((uint32_t)(padded_message[i]) ^ (uint32_t)(0))) >> 31);
}
ok &= ((((uint32_t)(padded_message[t]) ^ (uint32_t)(0)) - 1U) >> 31);
nettle_cnd_memcpy(ok, message, padded_message + t + 1, length);
return ok;
}
| {
"array_type": 1,
"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,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#ti_pvi.c | tulipindicators-0.9.1 | tiamalgamation.c | ti_pvi | 18 | int ti_pvi(int size, double const *const *inputs, double const *options, double *const *outputs) {
const double *close = inputs[0];
const double *volume = inputs[1];
(void)options;
double *output = outputs[0];
if (size <= ti_pvi_start(options)) return 0;
double pvi = 1000;
*output++ = pvi;
int i;
for (i = 1; i < size; ++i) {
if (volume[i] > volume[i-1]) {
pvi += ((close[i] - close[i-1])/close[i-1]) * pvi;
}
*output++ = pvi;
}
((void) sizeof ((output - outputs[0] == size - ti_pvi_start(options)) ? 1 : 0), __extension__ ({ if (output - outputs[0] == size - ti_pvi_start(options)) ; else __assert_fail ("output - outputs[0] == size - ti_pvi_start(options)", "tiamalgamation.c", 3256, __extension__ __PRETTY_FUNCTION__); }));
return 0;
}
| {
"array_type": 4,
"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": 3,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#ADD_1_TO_A_GIVEN_NUMBER_1_prep#f_gold.c | transcoder-set | ADD_1_TO_A_GIVEN_NUMBER_1.c | f_gold | 3 | int f_gold ( int x ) {
return ( - ( ~ x ) );
}
| {
"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
} |
tmux#session_prep#session_group_contains.c | tmux | session.c | session_group_contains | 13 | struct session_group *
session_group_contains(struct session *target)
{
struct session_group *sg;
struct session *s;
for ((sg) = session_groups_RB_MINMAX(&session_groups, -1); (sg) != ((void *)0); (sg) = session_groups_RB_NEXT(sg)) {
for((s) = ((&sg->sessions)->tqh_first); (s) != ((void *)0); (s) = ((s)->gentry.tqe_next)) {
if (s == target)
return (sg);
}
}
return (((void *)0));
}
| {
"array_type": 0,
"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": 2,
"return_statement": 2,
"struct_type": 3,
"switch_statement": 0,
"type_casting": 3,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#move_prep#to_para_end.c | nano-7.2 | move.c | to_para_end | 12 | void to_para_end(void)
{
linestruct *was_current = openfile->current;
do_para_end(&openfile->current);
if (openfile->current->next != ((void *)0)) {
openfile->current = openfile->current->next;
openfile->current_x = 0;
} else
openfile->current_x = strlen(openfile->current->data);
edit_redraw(was_current, CENTERING);
recook |= perturbed;
}
| {
"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": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlsave_prep#xmlSaveTree.c | libxml2 | xmlsave.c | xmlSaveTree | 19 | long
xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur)
{
long ret = 0;
if ((ctxt == ((void *)0)) || (cur == ((void *)0))) return(-1);
if (ctxt->options & XML_SAVE_XHTML) {
xhtmlNodeDumpOutput(ctxt, cur);
return(ret);
}
if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != ((void *)0)) &&
(cur->doc->type == XML_HTML_DOCUMENT_NODE) &&
((ctxt->options & XML_SAVE_AS_XML) == 0)) ||
(ctxt->options & XML_SAVE_AS_HTML)) {
htmlNodeDumpOutputInternal(ctxt, cur);
return(ret);
}
xmlNodeDumpOutputInternal(ctxt, cur);
return(ret);
}
| {
"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": 0,
"return_statement": 4,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS_prep#max.c | transcoder-set | FIND_MAXIMUM_HEIGHT_PYRAMID_FROM_THE_GIVEN_ARRAY_OF_OBJECTS.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#SQUARE_ROOT_OF_AN_INTEGER_prep#max.c | transcoder-set | SQUARE_ROOT_OF_AN_INTEGER.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
} |
less-633#filename_prep#homefile.c | less-633 | filename.c | homefile | 8 | char * homefile(char *filename)
{
char *pathname;
pathname = dirfile(lgetenv("HOME"), filename, 1);
if (pathname != ((void *)0))
return (pathname);
return (((void *)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": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
make-4.4.1#variable_prep#init_hash_global_variable_set.c | make-4.4.1 | variable.c | init_hash_global_variable_set | 6 | void
init_hash_global_variable_set (void)
{
hash_init (&global_variable_set.table, 523,
variable_hash_1, variable_hash_2, variable_hash_cmp);
}
| {
"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
} |
tmux#session_prep#session_find.c | tmux | session.c | session_find | 7 | struct session *
session_find(const char *name)
{
struct session s;
s.name = (char *) name;
return (sessions_RB_FIND(&sessions, &s));
}
| {
"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_unquoted_keys_prep#json_value_is_true.c | json.h | allow_unquoted_keys.c | json_value_is_true | 3 | int json_value_is_true(const struct json_value_s *const value) {
return value->type == json_type_true;
}
| {
"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
} |
transcoder-set#PROGRAM_FOR_SURFACE_AREA_OF_OCTAHEDRON_prep#cmpfunc.c | transcoder-set | PROGRAM_FOR_SURFACE_AREA_OF_OCTAHEDRON.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
} |
tinycc#tccpp_prep#inp.c | tinycc | tccpp.c | inp | 6 | void inp(void)
{
ch = *(++(file->buf_ptr));
if (ch == '\\')
ch = handle_eob();
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#FIND_THE_FIRST_MISSING_NUMBER_prep#len.c | transcoder-set | FIND_THE_FIRST_MISSING_NUMBER.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
} |
bc-1.07.1#storage_prep#init_storage.c | bc-1.07.1 | storage.c | init_storage | 18 | void
init_storage (void)
{
f_count = 0;
more_functions ();
f_names[0] = strdup("(main)");
v_count = 0;
more_variables ();
a_count = 0;
more_arrays ();
ex_stack = ((void *)0);
fn_stack = ((void *)0);
i_base = 10;
o_base = 10;
scale = 0;
c_code = 0;
bc_init_numbers();
}
| {
"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": 3,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#HEIGHT_COMPLETE_BINARY_TREE_HEAP_N_NODES_prep#min.c | transcoder-set | HEIGHT_COMPLETE_BINARY_TREE_HEAP_N_NODES.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,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#NUMBER_SUBSEQUENCES_STRING_DIVISIBLE_N_prep#min.c | transcoder-set | NUMBER_SUBSEQUENCES_STRING_DIVISIBLE_N.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,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#ist_fsm_prep#ist_snd_1xx.c | libosip2-5.3.1 | ist_fsm.c | ist_snd_1xx | 14 | void ist_snd_1xx(osip_transaction_t *ist, osip_event_t *evt) {
int i;
if (ist->last_response != ((void *)0)) {
osip_message_free(ist->last_response);
}
ist->last_response = evt->sip;
i = __osip_transaction_snd_xxx(ist, evt->sip);
if (i != 0) {
ist_handle_transport_error(ist, i);
return;
} else
__osip_message_callback(OSIP_IST_STATUS_1XX_SENT, ist, ist->last_response);
return;
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#SEARCH_AN_ELEMENT_IN_A_SORTED_AND_PIVOTED_ARRAY_prep#min.c | transcoder-set | SEARCH_AN_ELEMENT_IN_A_SORTED_AND_PIVOTED_ARRAY.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,
"union_type": 0,
"while_loop": 0
} |
libxml2#xpath_prep#xmlXPatherror.c | libxml2 | xpath.c | xmlXPatherror | 5 | void
xmlXPatherror(xmlXPathParserContextPtr ctxt, const char *file __attribute__((unused)),
int line __attribute__((unused)), int no) {
xmlXPathErr(ctxt, no);
}
| {
"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
} |
mtools-4.0.43#force_io_prep#force_write.c | mtools-4.0.43 | force_io.c | force_write | 4 | ssize_t force_write(Stream_t *Stream, char *buf, size_t len)
{
return force_pio(Stream, buf, 0, len, write_wrapper);
}
| {
"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
} |
wget-1.21.4#connect_prep#retryable_socket_connect_error.c | wget-1.21.4 | connect.c | retryable_socket_connect_error | 20 | _Bool
retryable_socket_connect_error (int err)
{
if (0
|| err == 97
|| err == 96
|| err == 94
|| err == 93
|| err == 92
|| err == 22
)
return 0;
if (!opt.retry_connrefused)
if (err == 111
|| err == 101
|| err == 113
)
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": 3,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
hello-2.12.1#quotearg_prep#quotearg_colon_mem.c | hello-2.12.1 | quotearg.c | quotearg_colon_mem | 5 | char *
quotearg_colon_mem (char const *arg, size_t argsize)
{
return quotearg_char_mem (arg, argsize, ':');
}
| {
"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
} |
cflow-1.7#c_prep#yyget_lineno.c | cflow-1.7 | c.c | yyget_lineno | 4 | int yyget_lineno (void)
{
return yylineno;
}
| {
"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
} |
patch-2.7.6#xmalloc_prep#xstrdup.c | patch-2.7.6 | xmalloc.c | xstrdup | 5 | char *
xstrdup (char const *string)
{
return xmemdup (string, strlen (string) + 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,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#xattrs_prep#xattrs_acls_set.c | tar-1.34 | xattrs.c | xattrs_acls_set | 12 | void
xattrs_acls_set (struct tar_stat_info const *st,
char const *file_name, char typeflag)
{
if (acls_option > 0 && typeflag != '2')
{
static int done = 0;
if (!done)
do { if (error_hook) error_hook (); error (0, 0, gettext ("POSIX ACL support is not available")); } while (0);
done = 1;
}
}
| {
"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": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_1_prep#min.c | transcoder-set | FIND_INDEX_GIVEN_FIBONACCI_NUMBER_CONSTANT_TIME_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,
"union_type": 0,
"while_loop": 0
} |
cflow-1.7#getopt1_prep#_getopt_long_only_r.c | cflow-1.7 | getopt1.c | _getopt_long_only_r | 8 | int
_getopt_long_only_r (int argc, char **argv, const char *options,
const struct rpl_option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
1, d, 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": 2,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
nano-7.2#files_prep#outside_of_confinement.c | nano-7.2 | files.c | outside_of_confinement | 14 | _Bool outside_of_confinement(const char *somepath, _Bool tabbing)
{
_Bool is_inside, begins_to_be;
char *fullpath;
if (operating_dir == ((void *)0))
return 0;
fullpath = get_full_path(somepath);
if (fullpath == ((void *)0))
return tabbing;
is_inside = (strstr(fullpath, operating_dir) == fullpath);
begins_to_be = (tabbing && strstr(operating_dir, fullpath) == operating_dir);
free(fullpath);
return (!is_inside && !begins_to_be);
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 2,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 3,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#MINIMUM_XOR_VALUE_PAIR_1_prep#main.c | transcoder-set | MINIMUM_XOR_VALUE_PAIR_1.c | main | 25 | int main(void) {
int n_success = 0;
int param0_0[] = {8,11,12,27,32,32,36,56,57,66,68,70,74,78,82,83,96};
int param0_1[] = {40,48,66,4,-60,42,-8,38};
int param0_2[] = {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,1,1};
int param0_3[] = {98,6,82,95,87,20,11,63,78,70,37,12,57,67,10,49,38,28,86,7,61,50,32,68,91,66,57,29,2,64,65,15,16,4,7,76,44,52,81,89,3,36,57,95,48,24};
int param0_4[] = {-88,-84,-76,-58,-40,-38,-28,-24,-20,-14,-12,16,20,28,28,30,40,44,56,58,60,92,92};
int param0_5[] = {0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0,1,1,0,1,0};
int param0_6[] = {6,6,19,31,41,45,49,56,78,96,98};
int param0_7[] = {62,-90,22,-84,-4};
int param0_8[] = {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};
int param0_9[] = {83,13,43,99,34,74,56,20,93,65,92,58,91,72,37,10,39,7,29,69,42,28};
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[] = {10,7,19,36,13,20,6,3,21,14};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i]) == f_gold(param0[i],param1[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"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,
"union_type": 0,
"while_loop": 0
} |
nettle-3.9.1#hmac-streebog_prep#nettle_hmac_streebog256_digest.c | nettle-3.9.1 | hmac-streebog.c | nettle_hmac_streebog256_digest | 6 | void
nettle_hmac_streebog256_digest(struct hmac_streebog512_ctx *ctx,
size_t length, uint8_t *digest)
{
nettle_hmac_digest( &(ctx)->outer, &(ctx)->inner, &(ctx)->state, (&nettle_streebog256), (length), (digest) );
}
| {
"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
} |
libxml2#globals_prep#xmlThrDefDoValidityCheckingDefaultValue.c | libxml2 | globals.c | xmlThrDefDoValidityCheckingDefaultValue | 8 | int xmlThrDefDoValidityCheckingDefaultValue(int v) {
int ret;
xmlMutexLock(&xmlThrDefMutex);
ret = xmlDoValidityCheckingDefaultValueThrDef;
xmlDoValidityCheckingDefaultValueThrDef = v;
xmlMutexUnlock(&xmlThrDefMutex);
return ret;
}
| {
"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
} |
libcsv#libcsv_prep#csv_get_delim.c | libcsv | libcsv.c | csv_get_delim | 6 | unsigned char
csv_get_delim(const struct csv_parser *p)
{
((void) sizeof ((p && "received null csv_parser") ? 1 : 0), __extension__ ({ if (p && "received null csv_parser") ; else __assert_fail ("p && \"received null csv_parser\"", "libcsv.c", 222, __extension__ __PRETTY_FUNCTION__); }));
return p->delim_char;
}
| {
"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
} |
nettle-3.9.1#ccm-aes256_prep#nettle_ccm_aes256_encrypt_message.c | nettle-3.9.1 | ccm-aes256.c | nettle_ccm_aes256_encrypt_message | 11 | void
nettle_ccm_aes256_encrypt_message(struct ccm_aes256_ctx *ctx,
size_t nlength, const uint8_t *nonce,
size_t alength, const uint8_t *adata,
size_t tlength,
size_t clength, uint8_t *dst, const uint8_t *src)
{
nettle_ccm_encrypt_message(&ctx->cipher, (nettle_cipher_func *) nettle_aes256_encrypt,
nlength, nonce, alength, adata,
tlength, clength, 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": 0,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
mtools-4.0.43#fat_prep#fatDecode.c | mtools-4.0.43 | fat.c | fatDecode | 10 | unsigned int fatDecode(Fs_t *This, unsigned int pos)
{
unsigned int ret;
ret = This->fat_decode(This, pos);
if(ret && (ret < 2 || ret > This->num_clus+1) && ret < This->last_fat) {
fprintf(stderr, "Bad FAT entry %d at %d\n", ret, pos);
This->fat_error++;
}
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": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_no_commas_prep#json_write_string.c | json.h | allow_no_commas.c | json_write_string | 41 | char *json_write_string(const struct json_string_s *string, char *data) {
size_t i;
*data++ = '"';
for (i = 0; i < string->string_size; i++) {
switch (string->string[i]) {
case '"':
*data++ = '\\';
*data++ = '"';
break;
case '\\':
*data++ = '\\';
*data++ = '\\';
break;
case '\b':
*data++ = '\\';
*data++ = 'b';
break;
case '\f':
*data++ = '\\';
*data++ = 'f';
break;
case '\n':
*data++ = '\\';
*data++ = 'n';
break;
case '\r':
*data++ = '\\';
*data++ = 'r';
break;
case '\t':
*data++ = '\\';
*data++ = 't';
break;
default:
*data++ = string->string[i];
break;
}
}
*data++ = '"';
return data;
}
| {
"array_type": 1,
"break_continue_statement": 8,
"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": 1,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#CEILING_IN_A_SORTED_ARRAY_1_prep#main.c | transcoder-set | CEILING_IN_A_SORTED_ARRAY_1.c | main | 27 | int main(void) {
int n_success = 0;
int param0_0[] = {2,6,13,16,23,24,24,27,30,32,34,34,55,56,56,63,66,81,83,96};
int param0_1[] = {-28,-96,48,22,-12,72,48,-70,-96,-84,-62,22,18,-92,-74,14,28,52,64,72,16,-76,46};
int param0_2[] = {0,1};
int param0_3[] = {51,98,25,10,43,91,33,25,85,51,94,6,35,48,11,97,67,21,50,9,11,51,86,61,22,88,89,11};
int param0_4[] = {-94,-92,-88,-74,-52,-50,-48,-44,-40,-36,-32,-26,20,22,30,32,46,56,56,60,62,64,80,84,86,94,96,96};
int param0_5[] = {1,0,0,1,1,0,0,1,0,1,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0};
int param0_6[] = {4,5,5,13,26,40,46,51,58,60,64,66,68,69,71,74,78,81,83,88,88,90,98,99};
int param0_7[] = {92,6,-54,84,-10,32,50,40,-38,64,-64,-10,70,-68,-6,-16,68,34,-66,-82,84,98,50,82,78,4,34,-34,78,64,32,58,-94,40,50,0,-92,-36,10,-54,58,-78,-88,32,6};
int param0_8[] = {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_9[] = {80,67,30,35,9};
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[] = {13,11,1,20,20,15,12,23,24,2};
int param2[] = {11,18,1,20,15,17,17,28,17,3};
int param3[] = {18,21,1,15,15,22,14,28,22,2};
for(int i = 0; i < len(param0); ++i)
{
if(f_filled(param0[i],param1[i],param2[i],param3[i]) == f_gold(param0[i],param1[i],param2[i],param3[i]))
{
n_success+=1;
}
break;
}
printf("#Results:", " ", n_success, ", ", len(param0));
return 0;
}
| {
"array_type": 4,
"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
} |
gprolog-1.5.0#foreign_supp_prep#Pl_Get_Exception.c | gprolog-1.5.0 | foreign_supp.c | Pl_Get_Exception | 5 | WamWord
Pl_Get_Exception(void)
{
return pl_query_exception;
}
| {
"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#xmlunicode_prep#xmlUCSIsByzantineMusicalSymbols.c | libxml2 | xmlunicode.c | xmlUCSIsByzantineMusicalSymbols | 4 | int
xmlUCSIsByzantineMusicalSymbols(int code) {
return(((code >= 0x1D000) && (code <= 0x1D0FF)));
}
| {
"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#xmlreader_prep#xmlTextReaderNormalization.c | libxml2 | xmlreader.c | xmlTextReaderNormalization | 6 | int
xmlTextReaderNormalization(xmlTextReaderPtr reader) {
if (reader == ((void *)0))
return(-1);
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,
"union_type": 0,
"while_loop": 0
} |
gawk-5.2.2#str_array_prep#init_env_array.c | gawk-5.2.2 | str_array.c | init_env_array | 7 | void
init_env_array(NODE *env_node)
{
if ((do_flags & DO_POSIX))
return;
env_node->sub.nodep.l.lp = & env_array_func;
}
| {
"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,
"union_type": 0,
"while_loop": 0
} |
indent-2.2.13#globs_prep#do_exit.c | indent-2.2.13 | globs.c | do_exit | 6 | extern void do_exit(int code)
{
uninit_parser();
cleanup_user_specials();
exit(code);
}
| {
"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
} |
transcoder-set#FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_ARRAY_prep#max.c | transcoder-set | FIND_SMALLEST_VALUE_REPRESENTED_SUM_SUBSET_GIVEN_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,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlschemastypes_prep#xmlSchemaValidateLengthFacetWhtsp.c | libxml2 | xmlschemastypes.c | xmlSchemaValidateLengthFacetWhtsp | 11 | int
xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
xmlSchemaValType valType,
const xmlChar *value,
xmlSchemaValPtr val,
unsigned long *length,
xmlSchemaWhitespaceValueType ws)
{
return (xmlSchemaValidateLengthFacetInternal(facet, valType, value, val,
length, ws));
}
| {
"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
} |
tar-1.34#xattr-at_prep#llistxattrat.c | tar-1.34 | xattr-at.c | llistxattrat | 53 | ssize_t
llistxattrat (int fd, char const *file , char *list , size_t size)
{
;
if (fd == -100 || (((file)[0]) == '/'))
return (llistxattr (file , list , size));
{
struct saved_cwd saved_cwd;
int saved_errno;
ssize_t err;
{
char proc_buf[((4096) < (4096 - 64) ? (4096) : (4096 - 64))];
char *proc_file = openat_proc_name (proc_buf, fd, file);
if (proc_file)
{
ssize_t proc_result = (llistxattr (proc_file , list , size));
int proc_errno = (*__errno_location ());
if (proc_file != proc_buf)
free (proc_file);
if (-1 != proc_result)
return proc_result;
if (! ((proc_errno) == 20 || (proc_errno) == 2 || (proc_errno) == 1 || (proc_errno) == 13 || (proc_errno) == 38 || (proc_errno) == 95 ))
{
(*__errno_location ()) = proc_errno;
return proc_result;
}
}
}
if (save_cwd (&saved_cwd) != 0)
openat_save_fail ((*__errno_location ()));
if (0 <= fd && fd == saved_cwd.desc)
{
free_cwd (&saved_cwd);
(*__errno_location ()) = 9;
return -1;
}
if (fchdir (fd) != 0)
{
saved_errno = (*__errno_location ());
free_cwd (&saved_cwd);
(*__errno_location ()) = saved_errno;
return -1;
}
err = (llistxattr (file , list , size));
saved_errno = (err == -1 ? (*__errno_location ()) : 0);
if (restore_cwd (&saved_cwd) != 0)
openat_restore_fail ((*__errno_location ()));
free_cwd (&saved_cwd);
if (saved_errno)
(*__errno_location ()) = saved_errno;
return err;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 10,
"memory_management": 1,
"memory_operation": 0,
"pointer_type": 1,
"return_statement": 6,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
binn-3.0#binn_prep#binn_is_valid_ex.c | binn-3.0 | binn.c | binn_is_valid_ex | 46 | BOOL binn_is_valid_ex(void *ptr, int *ptype, int *pcount, int *psize) {
int i, type, count, size, header_size;
unsigned char *p, *plimit, *base, len;
void *pbuf;
pbuf = binn_ptr(ptr);
if (pbuf == ((void *)0)) return 0;
if (psize && *psize > 0) {
size = *psize;
} else {
size = 0;
}
if (!IsValidBinnHeader(pbuf, &type, &count, &size, &header_size)) return 0;
if (psize && *psize > 0) {
if (size != *psize) return 0;
}
if (pcount && *pcount > 0) {
if (count != *pcount) return 0;
}
if (ptype && *ptype != 0) {
if (type != *ptype) return 0;
}
p = (unsigned char *)pbuf;
base = p;
plimit = p + size;
p += header_size;
for (i = 0; i < count; i++) {
switch (type) {
case 0xE2:
len = *p;
p++;
p += len;
break;
case 0xE1:
read_map_id(&p, plimit);
break;
}
p = AdvanceDataPos(p, plimit);
if ((p == 0) || (p < base)) goto Invalid;
}
if (ptype && *ptype==0) *ptype = type;
if (pcount && *pcount==0) *pcount = count;
if (psize && *psize==0) *psize = size;
return 1;
Invalid:
return 0;
}
| {
"array_type": 0,
"break_continue_statement": 2,
"enum_type": 0,
"for_loop": 1,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 13,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 7,
"struct_type": 0,
"switch_statement": 1,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
mcsim-6.2.0#modelu_prep#IsModelVar.c | mcsim-6.2.0 | modelu.c | IsModelVar | 5 | BOOL IsModelVar (HVAR hvar)
{
int iType = GetVarType(hvar);
return (iType == 0x10000 || iType == 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
} |
json.h#allow_json5_prep#json_extract_get_value_size.c | json.h | allow_json5.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
} |
tar-1.34#buffer_prep#reset_eof.c | tar-1.34 | buffer.c | reset_eof | 11 | void
reset_eof (void)
{
if (hit_eof)
{
hit_eof = 0;
current_block = record_start;
record_end = record_start + blocking_factor;
access_mode = ACCESS_WRITE;
}
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
dap-3.10#ps_prep#pict_end.c | dap-3.10 | ps.c | pict_end | 7 | void pict_end()
{
fputs("gr\n", pict_out);
fputs("showpage\n", pict_out);
fputs("%%Trailer\n", pict_out);
fflush(pict_out);
}
| {
"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
} |
transcoder-set#POSSIBLE_FORM_TRIANGLE_ARRAY_VALUES_prep#max.c | transcoder-set | POSSIBLE_FORM_TRIANGLE_ARRAY_VALUES.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
} |
nano-7.2#prompt_prep#handle_editing.c | nano-7.2 | prompt.c | handle_editing | 38 | _Bool handle_editing(functionptrtype function)
{
if (function == do_left)
do_statusbar_left();
else if (function == do_right)
do_statusbar_right();
else if (function == to_prev_word)
do_statusbar_prev_word();
else if (function == to_next_word)
do_statusbar_next_word();
else if (function == do_home)
do_statusbar_home();
else if (function == do_end)
do_statusbar_end();
else if (((flags[((RESTRICTED) / (sizeof(unsigned) * 8))] & ((unsigned)1 << ((RESTRICTED) % (sizeof(unsigned) * 8)))) != 0) && currmenu == (1<<5) &&
openfile->filename[0] != '\0' &&
(function == do_verbatim_input ||
function == do_delete || function == do_backspace ||
function == cut_text || function == paste_text))
;
else if (function == do_verbatim_input)
do_statusbar_verbatim_input();
else if (function == do_delete)
do_statusbar_delete();
else if (function == do_backspace)
do_statusbar_backspace();
else if (function == cut_text)
lop_the_answer();
else if (function == copy_text)
copy_the_answer();
else if (function == paste_text) {
if (cutbuffer != ((void *)0))
paste_into_answer();
}
else
return 0;
return 1;
}
| {
"array_type": 1,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 14,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 2,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 2,
"union_type": 0,
"while_loop": 0
} |
tinycc#libtcc_prep#tcc_define_symbol.c | tinycc | libtcc.c | tcc_define_symbol | 15 | void tcc_define_symbol(TCCState *s1, const char *sym, const char *value)
{
int len1, len2;
if (!value)
value = "1";
len1 = strlen(sym);
len2 = strlen(value);
tcc_open_bf(s1, "<define>", len1 + len2 + 1);
memcpy(file->buffer, sym, len1);
file->buffer[len1] = ' ';
memcpy(file->buffer + len1 + 1, value, len2);
next_nomacro();
parse_define();
tcc_close();
}
| {
"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": 2,
"pointer_type": 0,
"return_statement": 0,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
libosip2-5.3.1#osip_content_type_prep#osip_content_type_free.c | libosip2-5.3.1 | osip_content_type.c | osip_content_type_free | 10 | void osip_content_type_free(osip_content_type_t *content_type) {
if (content_type == ((void *)0))
return;
{ if (content_type->type != ((void *)0)) { if (osip_free_func) osip_free_func(content_type->type); else free(content_type->type); } };
{ if (content_type->subtype != ((void *)0)) { if (osip_free_func) osip_free_func(content_type->subtype); else free(content_type->subtype); } };
osip_uri_param_freelist(&content_type->gen_params);
content_type->type = ((void *)0);
content_type->subtype = ((void *)0);
{ if (content_type != ((void *)0)) { if (osip_free_func) osip_free_func(content_type); else free(content_type); } };
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 4,
"memory_management": 3,
"memory_operation": 0,
"pointer_type": 0,
"return_statement": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 6,
"union_type": 0,
"while_loop": 0
} |
uucp-1.07#xqtsub_prep#fsysdep_unlock_uuxqt_dir.c | uucp-1.07 | xqtsub.c | fsysdep_unlock_uuxqt_dir | 15 | boolean
fsysdep_unlock_uuxqt_dir (iseq)
int iseq;
{
const char *zxqtdir;
char abxqtdir[sizeof ".Xqtdir" + 4];
if (iseq == 0)
zxqtdir = ".Xqtdir";
else
{
sprintf (abxqtdir, "%s%04d", ".Xqtdir", iseq);
zxqtdir = abxqtdir;
}
return fclean_uuxqt_dir (zxqtdir);
}
| {
"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": 0,
"union_type": 0,
"while_loop": 0
} |
tar-1.34#safe-write_prep#safe_write.c | tar-1.34 | safe-write.c | safe_write | 16 | size_t
safe_write (int fd, void const *buf, size_t count)
{
for (;;)
{
ssize_t result = write (fd, buf, count);
if (0 <= result)
return result;
else if ((((*__errno_location ())) == 4))
continue;
else if ((*__errno_location ()) == 22 && SYS_BUFSIZE_MAX < count)
count = SYS_BUFSIZE_MAX;
else
return result;
}
}
| {
"array_type": 0,
"break_continue_statement": 1,
"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": 0,
"union_type": 0,
"while_loop": 0
} |
units-2.22#units_prep#round_digits.c | units-2.22 | units.c | round_digits | 16 | double
round_digits(double value, int digits, int base)
{
double mult_factor;
double (*logfunc)(double);
if (digits == 0)
return 0.0;
if (base == 2)
logfunc = log2;
else
logfunc = log10;
if (value != 0)
digits -= ceil(logfunc(fabs(value)));
mult_factor = pow((double) base, digits);
return round(value*mult_factor)/mult_factor;
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 0,
"function_pointer": 1,
"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": 2,
"union_type": 0,
"while_loop": 0
} |
libxml2#libxml2-py_prep#libxml_xmlParseEntityDecl.c | libxml2 | libxml2-py.c | libxml_xmlParseEntityDecl | 13 | PyObject *
libxml_xmlParseEntityDecl(PyObject *self __attribute__ ((__unused__)), PyObject *args) {
xmlParserCtxtPtr ctxt;
PyObject *pyobj_ctxt;
if (libxml_deprecationWarning("xmlParseEntityDecl") == -1)
return(((void *)0));
if (!_PyArg_ParseTuple_SizeT(args, (char *)"O:xmlParseEntityDecl", &pyobj_ctxt))
return(((void *)0));
ctxt = (xmlParserCtxtPtr) (((pyobj_ctxt) == (&_Py_NoneStruct)) ? ((void *)0) : (((PyparserCtxt_Object *)(pyobj_ctxt))->obj));
xmlParseEntityDecl(ctxt);
_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": 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#PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND_prep#f_gold.c | transcoder-set | PRODUCT_MAXIMUM_FIRST_ARRAY_MINIMUM_SECOND.c | f_gold | 5 | int f_gold ( int arr1 [ ], int arr2 [ ], int n1, int n2 ) {
sort ( arr1, arr1 + n1 );
sort ( arr2, arr2 + n2 );
return arr1 [ n1 - 1 ] * arr2 [ 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": 1,
"struct_type": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
json.h#allow_inf_and_nan_prep#json_write_pretty_get_array_size.c | json.h | allow_inf_and_nan.c | json_write_pretty_get_array_size | 22 | int json_write_pretty_get_array_size(const struct json_array_s *array,
size_t depth, size_t indent_size,
size_t newline_size, size_t *size) {
struct json_array_element_s *element;
*size += 1;
if (0 < array->length) {
*size += newline_size;
*size += array->length - 1;
for (element = array->start; 0 != element;
element = element->next) {
*size += (depth + 1) * indent_size;
if (json_write_pretty_get_value_size(element->value, depth + 1,
indent_size, newline_size, size)) {
return 1;
}
*size += newline_size;
}
*size += depth * indent_size;
}
*size += 1;
return 0;
}
| {
"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,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#DELANNOY_NUMBER_1_prep#len.c | transcoder-set | DELANNOY_NUMBER_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,
"union_type": 0,
"while_loop": 0
} |
libxml2#xmlreader_prep#xmlTextReaderGetLastError.c | libxml2 | xmlreader.c | xmlTextReaderGetLastError | 7 | const xmlError *
xmlTextReaderGetLastError(xmlTextReaderPtr reader)
{
if (reader == ((void *)0))
return(((void *)0));
return(&reader->ctxt->lastError);
}
| {
"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": 2,
"union_type": 0,
"while_loop": 0
} |
wget-1.21.4#hash_prep#hash_table_remove.c | wget-1.21.4 | hash.c | hash_table_remove | 30 | int
hash_table_remove (struct hash_table *ht, const void *key)
{
struct cell *c = find_cell (ht, key);
if (!((c)->key != ((void *) ~(uintptr_t) 0)))
return 0;
else
{
int size = ht->size;
struct cell *cells = ht->cells;
hashfun_t hasher = ht->hash_function;
((c)->key = ((void *) ~(uintptr_t) 0));
--ht->count;
c = (c != cells + (size - 1) ? c + 1 : cells);
for (; ((c)->key != ((void *) ~(uintptr_t) 0)); c = (c != cells + (size - 1) ? c + 1 : cells))
{
const void *key2 = c->key;
struct cell *c_new;
c_new = cells + ((hasher) (key2) % size);
for (; ((c_new)->key != ((void *) ~(uintptr_t) 0)); c_new = (c_new != cells + (size - 1) ? c_new + 1 : cells))
if (key2 == c_new->key)
goto next_rehash;
*c_new = *c;
((c)->key = ((void *) ~(uintptr_t) 0));
next_rehash:
;
}
return 1;
}
}
| {
"array_type": 0,
"break_continue_statement": 0,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 1,
"if_statement": 2,
"memory_management": 0,
"memory_operation": 0,
"pointer_type": 4,
"return_statement": 2,
"struct_type": 4,
"switch_statement": 0,
"type_casting": 5,
"union_type": 0,
"while_loop": 0
} |
screen-4.9.0#screen_prep#main.c | screen-4.9.0 | screen.c | main | 723 | int main(int ac, char** av)
{
register int n;
char *ap;
char *av0;
char socknamebuf[2 * 768];
int mflag = 0;
char *myname = (ac == 0) ? "screen" : av[0];
char *SockDir;
struct stat st;
int oumask;
struct NewWindow nwin;
int detached = 0;
char *sockp;
char *sty = 0;
closeallfiles(0);
snprintf(version, 59, "%d.%.2d.%.2d%s (%s%s) %s", 4, 9,
0, "", "GNU", "", "30-Jan-22");
nversion = 4 * 10000 + 9 * 100 + 0;
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
do {} while (0);
BellString = SaveStr("Bell in window %n");
VisualBellString = SaveStr(" Wuff, Wuff!! ");
ActivityString = SaveStr("Activity in window %n");
screenlogfile = SaveStr("screenlog.%n");
logtstamp_string = SaveStr("-- %n:%t -- time-stamp -- %M/%d/%y %c:%s --\n");
hstatusstring = SaveStr("%h");
captionstring = SaveStr("%4n %t");
timestring = SaveStr("%c:%s %M %d %H%? %l%?");
wlisttit = SaveStr(" Num Name%=Flags");
wliststr = SaveStr("%4n %t%=%f");
BufferFile = SaveStr("/tmp/screen-exchange");
ShellProg = ((void *)0);
PowDetachString = 0;
default_startup = (ac > 1) ? 0 : 1;
adaptflag = 0;
VBellWait = 1 * 1000;
MsgWait = 5 * 1000;
MsgMinWait = 1 * 1000;
SilenceWait = 30;
zmodem_sendcmd = SaveStr("!!! sz -vv -b ");
zmodem_recvcmd = SaveStr("!!! rz -vv -b -E");
CompileKeys((char *)0, 0, mark_key_tab);
InitBuiltinTabs();
screenencodings = SaveStr("/usr/share/screen/utf8encodings");
cjkwidth = 0;
nwin = nwin_undef;
nwin_options = nwin_undef;
strncpy(screenterm, "screen", 32);
screenterm[32] = '\0';
real_uid = getuid();
real_gid = getgid();
eff_uid = geteuid();
eff_gid = getegid();
logreopen_register(lf_secreopen);
av0 = *av;
if (*av0 == '-') {
rflag = 4;
xflag = 1;
ShellProg = SaveStr(DefaultShell);
}
while (ac > 0){
ap = *++av;
if (--ac > 0 && *ap == '-') {
if (ap[1] == '-' && ap[2] == 0) {
av++;
ac--;
break;
}
if (ap[1] == '-' && !strcmp(ap, "--version")) {
printf("Screen version %s\n", version);
exit(0);
}
if (ap[1] == '-' && !strcmp(ap, "--help"))
exit_with_usage(myname, ((void *)0), ((void *)0));
while (ap && *ap && *++ap) {
switch (*ap) {
case 'a':
nwin_options.aflag = 1;
break;
case 'A':
adaptflag = 1;
break;
case 'p':
if (*++ap)
preselect = ap;
else {
if (!--ac)
exit_with_usage(myname, "Specify a window to preselect with -p", ((void *)0));
preselect = *++av;
}
ap = ((void *)0);
break;
case 'c':
if (*++ap)
RcFileName = ap;
else {
if (--ac == 0)
exit_with_usage(myname, "Specify an alternate rc-filename with -c", ((void *)0));
RcFileName = *++av;
}
ap = ((void *)0);
break;
case 'e':
if (!*++ap) {
if (--ac == 0)
exit_with_usage(myname, "Specify command characters with -e", ((void *)0));
ap = *++av;
}
if (ParseEscape(ap))
Panic(0, "Two characters are required with -e option, not '%s'.", ap);
ap = ((void *)0);
break;
case 'f':
ap++;
switch (*ap++) {
case 'n':
case '0':
nwin_options.flowflag = (1<<0) * 0;
break;
case '\0':
ap--;
case 'y':
case '1':
nwin_options.flowflag = (1<<0) * 1;
break;
case 'a':
nwin_options.flowflag = (1<<2);
break;
default:
exit_with_usage(myname, "Unknown flow option -%s", --ap);
}
break;
case 'h':
if (--ac == 0)
exit_with_usage(myname, ((void *)0), ((void *)0));
nwin_options.histheight = atoi(*++av);
if (nwin_options.histheight < 0)
exit_with_usage(myname, "-h: %s: negative scrollback size?", *av);
break;
case 'i':
iflag = 1;
break;
case 't':
if (--ac == 0)
exit_with_usage(myname, "Specify a new window-name with -t", ((void *)0));
nwin_options.aka = *++av;
break;
case 'l':
ap++;
switch (*ap++) {
case 'n':
case '0':
nwin_options.lflag = 0;
break;
case '\0':
ap--;
case 'y':
case '1':
nwin_options.lflag = 1;
break;
case 'a':
nwin_options.lflag = 3;
break;
case 's':
case 'i':
lsflag = 1;
if (ac > 1 && !SockMatch) {
SockMatch = *++av;
ac--;
}
ap = ((void *)0);
break;
default:
exit_with_usage(myname, "%s: Unknown suboption to -l", --ap);
}
break;
case 'w':
if (strcmp(ap+1, "ipe"))
exit_with_usage(myname, "Unknown option %s", --ap);
lsflag = 1;
wipeflag = 1;
if (ac > 1 && !SockMatch) {
SockMatch = *++av;
ac--;
}
break;
case 'L':
if (!strcmp(ap + 1, "ogfile")) {
if (--ac == 0)
exit_with_usage(myname, "Specify logfile path with -Logfile", ((void *)0));
if (strlen(*++av) > 4096)
Panic(1, "-Logfile name too long. (max. %d char)", 4096);
free(screenlogfile);
screenlogfile = SaveStr(*av);
ap = ((void *)0);
} else if (!strcmp(ap, "L"))
nwin_options.Lflag = 1;
break;
case 'm':
mflag = 1;
break;
case 'O':
force_vt = 0;
break;
case 'T':
if (--ac == 0)
exit_with_usage(myname, "Specify terminal-type with -T", ((void *)0));
if (strlen(*++av) < 32) {
strncpy(screenterm, *av, 32);
screenterm[32] = '\0';
} else
Panic(0, "-T: terminal name too long. (max. %d char)", 32);
nwin_options.term = screenterm;
break;
case 'q':
quietflag = 1;
break;
case 'Q':
queryflag = 1;
cmdflag = 1;
break;
case 'r':
case 'R':
case 'x':
if (ac > 1 && *av[1] != '-' && !SockMatch) {
SockMatch = *++av;
ac--;
do {} while (0);
}
if (*ap == 'x')
xflag = 1;
if (rflag)
rflag = 2;
rflag += (*ap == 'R') ? 2 : 1;
break;
case 'd':
dflag = 1;
case 'D':
if (!dflag)
dflag = 2;
if (ac == 2) {
if (*av[1] != '-' && !SockMatch) {
SockMatch = *++av;
ac--;
do {} while (0);
}
}
break;
case 's':
if (--ac == 0)
exit_with_usage(myname, "Specify shell with -s", ((void *)0));
if (ShellProg)
free(ShellProg);
ShellProg = SaveStr(*++av);
do {} while (0);
break;
case 'S':
if (!SockMatch) {
if (--ac == 0)
exit_with_usage(myname, "Specify session-name with -S", ((void *)0));
SockMatch = *++av;
do {} while (0);
do {} while (0);
if (strlen(SockMatch) > 80)
exit_with_usage(myname, "Session-name is too long (max length is 80 symbols)", ((void *)0));
}
if (!*SockMatch)
exit_with_usage(myname, "Empty session-name?", ((void *)0));
break;
case 'X':
cmdflag = 1;
break;
case 'v':
printf("Screen version %s\n", version);
exit(0);
case 'U':
nwin_options.encoding = nwin_options.encoding == -1 ? 8 : 0;
break;
default:
exit_with_usage(myname, "Unknown option %s", --ap);
}
}
}
else
break;
}
xsignal(7, CoreDump);
xsignal(11, CoreDump);
setlocale(6, "");
if (nwin_options.encoding == -1) {
nwin_options.encoding = FindEncoding(nl_langinfo(CODESET));
do {} while (0);
}
{
char *s;
if ((s = locale_name())) {
if(!strncmp(s, "zh_", 3) || !strncmp(s, "ja_", 3) || !strncmp(s, "ko_", 3)) {
cjkwidth = 1;
}
}
}
if (nwin_options.aka) {
if (nwin_options.encoding > 0) {
size_t len = strlen(nwin_options.aka);
size_t newsz;
char *newbuf = malloc(3 * len);
if (!newbuf)
Panic(0, "%s", strnomem);
newsz = RecodeBuf((unsigned char *)nwin_options.aka, len,
nwin_options.encoding, 0, (unsigned char *)newbuf);
newbuf[newsz] = '\0';
nwin_options.aka = newbuf;
} else
{
nwin_options.aka = SaveStr(nwin_options.aka);
}
}
if (SockMatch && strlen(SockMatch) >= 768)
Panic(0, "Ridiculously long socketname - try again.");
if (cmdflag && !rflag && !dflag && !xflag)
xflag = 1;
if (!cmdflag && dflag && mflag && !(rflag || xflag))
detached = 1;
nwin = nwin_options;
nwin.encoding = nwin_undef.encoding;
if (ac)
nwin.args = av;
xsignal(25, ((__sighandler_t) 1));
xsignal(13, ((__sighandler_t) 1));
if (!ShellProg) {
register char *sh;
sh = getenv("SHELL");
ShellProg = SaveStr(sh ? sh : DefaultShell);
}
ShellArgs[0] = ShellProg;
home = getenv("HOME");
if (!mflag && !SockMatch) {
sty = getenv("STY");
if (sty && *sty == 0)
sty = 0;
}
if (!(nethackflag = (getenv("NETHACKOPTIONS") != ((void *)0)))) {
char nethackrc[4096];
if (home && (strlen(home) < (4096 - 20))) {
sprintf(nethackrc,"%s/.nethackrc", home);
nethackflag = !access(nethackrc, 0);
}
}
own_uid = multi_uid = real_uid;
if (SockMatch && (sockp = index(SockMatch, '/'))) {
*sockp = 0;
multi = SockMatch;
SockMatch = sockp + 1;
if (*multi) {
struct passwd *mppp;
if ((mppp = getpwnam(multi)) == (struct passwd *)0)
Panic(0, "Cannot identify account '%s'.", multi);
multi_uid = mppp->pw_uid;
multi_home = SaveStr(mppp->pw_dir);
if (strlen(multi_home) > 4096 - 10)
Panic(0, "home directory path too long");
if (rflag || lsflag)
xflag = 1;
detached = 0;
multiattach = 1;
}
if (eff_uid && (multi_uid != eff_uid))
Panic(0, "Must run suid root for multiuser support.");
}
if (SockMatch && *SockMatch == 0)
SockMatch = 0;
if ((LoginName = getlogin()) && LoginName[0] != '\0') {
if ((ppp = getpwnam(LoginName)) != (struct passwd *) 0)
if ((int)ppp->pw_uid != real_uid)
ppp = (struct passwd *) 0;
}
if (ppp == 0) {
if ((ppp = getpwuid(real_uid)) == 0) {
Panic(0, "getpwuid() can't identify your account!");
exit(1);
}
LoginName = ppp->pw_name;
}
LoginName = SaveStr(LoginName);
ppp = getpwbyname(LoginName, ppp);
if (home == 0 || *home == '\0')
home = ppp->pw_dir;
if (strlen(LoginName) > 256)
Panic(0, "LoginName too long - sorry.");
if (multi && strlen(multi) > 256)
Panic(0, "Screen owner name too long - sorry.");
if (strlen(home) > 4096 - 25)
Panic(0, "$HOME too long - sorry.");
attach_tty = "";
if (!detached && !lsflag && !cmdflag && !(dflag && !mflag && !rflag && !xflag) &&
!(sty && !SockMatch && !mflag && !rflag && !xflag)) {
int fl;
SetTtyname(1, &st);
tty_mode = (int)st.st_mode & 0777;
fl = fcntl(0, 3, 0);
if (fl != -1 && (fl & (02|00|01)) == 02)
attach_fd = 0;
if (attach_fd == -1) {
if ((n = secopen(attach_tty, 02 | 04000, 0)) < 0)
Panic(0, "Cannot open your terminal '%s' - please check.", attach_tty);
attach_fd = n;
}
do {} while (0);
if ((attach_term = getenv("TERM")) == 0 || *attach_term == 0)
Panic(0, "Please set a terminal type.");
if (strlen(attach_term) > 32)
Panic(0, "$TERM too long - sorry.");
GetTTY(0, &attach_Mode);
}
if ((oumask = (int)umask(0)) == -1)
Panic((*__errno_location ()), "Cannot change umask to zero");
SockDir = getenv("SCREENDIR");
if (SockDir) {
if (strlen(SockDir) >= 4096 - 1)
Panic(0, "Ridiculously long $SCREENDIR - try again.");
if (multi)
Panic(0, "No $SCREENDIR with multi screens, please.");
}
if (multiattach) {
SockDir = (eff_uid ? "/tmp/uscreens" : "/tmp/screens");
sprintf(SockPath, "%s/S-%s", SockDir, multi);
} else
{
if (SockDir) {
if (access(SockDir, 0)) {
do {} while (0);
if (UserContext() > 0) {
if (mkdir(SockDir, 0700))
UserReturn(0);
UserReturn(1);
}
if (UserStatus() <= 0)
Panic(0, "Cannot make directory '%s'.", SockDir);
}
if (SockDir != SockPath)
strcpy(SockPath, SockDir);
}
else {
SockDir = (eff_uid ? "/tmp/uscreens" : "/tmp/screens");
if (stat(SockDir, &st)) {
n = (eff_uid == 0 && (real_uid || eff_gid == real_gid)) ? 0755 :
(eff_gid != real_gid) ? 0775 :
0777|01000;
if (mkdir(SockDir, n) == -1)
Panic((*__errno_location ()), "Cannot make directory '%s'", SockDir);
}
else {
if (!((((st.st_mode)) & 0170000) == (0040000)))
Panic(0, "'%s' must be a directory.", SockDir);
if (eff_uid == 0 && real_uid && (int)st.st_uid != eff_uid)
Panic(0, "Directory '%s' must be owned by root.", SockDir);
n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 :
(eff_gid == (int)st.st_gid && eff_gid != real_gid) ? 0775 : 0777;
if (((int)st.st_mode & 0777) != n)
Panic(0, "Directory '%s' must have mode %03o.", SockDir, n);
}
sprintf(SockPath, "%s/S-%s", SockDir, LoginName);
if (access(SockPath, 0)) {
if (mkdir(SockPath, 0700) == -1 && (*__errno_location ()) != 17)
Panic((*__errno_location ()), "Cannot make directory '%s'", SockPath);
(void) chown(SockPath, real_uid, real_gid);
}
}
}
if (stat(SockPath, &st) == -1)
Panic((*__errno_location ()), "Cannot access %s", SockPath);
else
if (!((((st.st_mode)) & 0170000) == (0040000)))
Panic(0, "%s is not a directory.", SockPath);
if (multi) {
if ((int)st.st_uid != multi_uid)
Panic(0, "%s is not the owner of %s.", multi, SockPath);
}
else
{
if ((int)st.st_uid != real_uid)
Panic(0, "You are not the owner of %s.", SockPath);
}
if ((st.st_mode & 0777) != 0700)
Panic(0, "Directory %s must have mode 700.", SockPath);
if (SockMatch && index(SockMatch, '/'))
Panic(0, "Bad session name '%s'", SockMatch);
SockName = SockPath + strlen(SockPath) + 1;
*SockName = 0;
(void) umask(oumask);
do {} while (0);
(void) gethostname(HostName, 768);
HostName[768 - 1] = '\0';
if ((ap = index(HostName, '.')) != ((void *)0))
*ap = '\0';
if (lsflag) {
int i, fo, oth;
_Bool sock;
if (multi)
real_uid = multi_uid;
do { setgid(real_gid); setuid(real_uid); eff_uid = real_uid; eff_gid = real_gid; } while (0);
i = FindSocket((int *)((void *)0), &fo, &oth, SockMatch, &sock);
if (quietflag) {
if (rflag)
exit(10 + i);
else
exit(9 + (fo || oth ? 1 : 0) + fo);
}
if (fo == 0)
Panic(0, "No Sockets found in %s.\n", SockPath);
Msg(0, "%d Socket%s in %s.", fo, fo > 1 ? "s" : "", SockPath);
eexit(0);
}
xsignal(1, AttacherFinit);
if (cmdflag) {
if (multi)
real_uid = multi_uid;
SetTtyname(0, &st);
if (!*av)
Panic(0, "Please specify a command.");
if (!strncmp("sessionname", *av, 11)) {
if (!*++av)
Panic(0, "Please specify a parameter.");
if (strlen(*av) > 80)
Panic(0, "Parameter of command 'sessionname' is too long.");
*--av;
}
do { setgid(real_gid); setuid(real_uid); eff_uid = real_uid; eff_gid = real_gid; } while (0);
SendCmdMessage(sty, SockMatch, av, queryflag >= 0);
exit(0);
}
else if (rflag || xflag) {
do {} while (0);
if (Attach(2)) {
Attacher();
}
if (multiattach)
Panic(0, "Can't create sessions of other users.");
do {} while (0);
}
else if (dflag && !mflag) {
SetTtyname(0, &st);
Attach(4);
Msg(0, "[%s %sdetached.]\n", SockName, (dflag > 1 ? "power " : ""));
eexit(0);
}
if (!SockMatch && !mflag && sty) {
SetTtyname(0, &st);
do { setgid(real_gid); setuid(real_uid); eff_uid = real_uid; eff_gid = real_gid; } while (0);
nwin_options.args = av;
SendCreateMsg(sty, &nwin);
exit(0);
}
nwin_compose(&nwin_default, &nwin_options, &nwin_default);
if (!detached || dflag != 2)
MasterPid = fork();
else
MasterPid = 0;
switch (MasterPid) {
case -1:
Panic((*__errno_location ()), "fork");
case 0:
break;
default:
if (detached)
exit(0);
if (SockMatch)
sprintf(socknamebuf, "%d.%s", MasterPid, SockMatch);
else
sprintf(socknamebuf, "%d.%s.%s", MasterPid, stripdev(attach_tty), HostName);
for (ap = socknamebuf; *ap; ap++)
if (*ap == '/')
*ap = '-';
if (strlen(socknamebuf) > 255)
socknamebuf[255] = 0;
sprintf(SockPath + strlen(SockPath), "/%s", socknamebuf);
do { setgid(real_gid); setuid(real_uid); eff_uid = real_uid; eff_gid = real_gid; } while (0);
Attacher();
}
if (!detached)
PanicPid = getppid();
if (DefaultEsc == -1)
DefaultEsc = (('a')&037);
if (DefaultMetaEsc == -1)
DefaultMetaEsc = 'a';
ap = av0 + strlen(av0) - 1;
while (ap >= av0) {
if (!strncmp("screen", ap, 6)) {
memcpy(ap, "SCREEN", 6);
break;
}
ap--;
}
if (ap < av0)
*av0 = 'S';
if (!detached) {
if (attach_fd == -1) {
if ((n = secopen(attach_tty, 02 | 04000, 0)) < 0)
Panic(0, "Cannot reopen '%s' - please check.", attach_tty);
}
else
n = dup(attach_fd);
}
else
n = -1;
freopen("/dev/null", "r", stdin);
freopen("/dev/null", "w", stdout);
freopen("/dev/null", "w", stderr);
do {} while (0);
if (UserAdd(LoginName, (char *)0, (struct acluser **)0) < 0)
Panic(0, "Could not create user info");
if (!detached) {
if (MakeDisplay(LoginName, attach_tty, attach_term, n, getppid(), &attach_Mode) == 0)
Panic(0, "Could not alloc display");
PanicPid = 0;
display->d_encoding = nwin_options.encoding > 0 ? nwin_options.encoding : 0;
do {} while (0);
}
if (SockMatch) {
sprintf(socknamebuf, "%d.%s", (int)getpid(), SockMatch);
}
else {
sprintf(socknamebuf, "%d.%s.%s", (int)getpid(), stripdev(attach_tty), HostName);
}
for (ap = socknamebuf; *ap; ap++)
if (*ap == '/')
*ap = '-';
if (strlen(socknamebuf) > 255) {
do {} while (0);
socknamebuf[255] = 0;
}
sprintf(SockPath + strlen(SockPath), "/%s", socknamebuf);
ServerSocket = MakeServerSocket(1);
if ((ap = getenv("SYSSCREENRC")))
(void)StartRc(ap, 0);
else
(void)StartRc("/usr/etc/screenrc", 0);
(void)StartRc(RcFileName, 0);
InitUtmp();
if (display) {
if (InitTermcap(0, 0)) {
do {} while (0);
fcntl(display->d_userfd, 4, 0);
freetty();
if (display->d_userpid)
Kill(display->d_userpid, 1);
eexit(1);
}
MakeDefaultCanvas();
InitTerm(0);
RemoveLoginSlot();
}
else
MakeTermcap(1);
InitLoadav();
InitKeytab();
MakeNewEnv();
xsignal(1, SigHup);
xsignal(2, FinitHandler);
xsignal(3, FinitHandler);
xsignal(15, FinitHandler);
xsignal(21, ((__sighandler_t) 1));
xsignal(22, ((__sighandler_t) 1));
if (display) {
brktty(display->d_userfd);
SetMode(&display->d_OldMode, &display->d_NewMode, display->d_flow, iflag);
SetTTY(display->d_userfd, &display->d_NewMode);
if (fcntl(display->d_userfd, 4, 04000))
Msg((*__errno_location ()), "Warning: NBLOCK fcntl failed");
}
else
brktty(-1);
xsignal(17, SigChld);
if ((ap = getenv("SYSSCREENRC")))
FinishRc(ap);
else
FinishRc("/usr/etc/screenrc");
FinishRc(RcFileName);
do {} while (0);
if (windows == ((void *)0)) {
do {} while (0);
if (MakeWindow(&nwin) == -1) {
fd_set rfd;
struct timeval tv = { MsgWait/1000, 1000*(MsgWait%1000) };
((void) (((&rfd)->__fds_bits)[((0) / (8 * (int) sizeof (__fd_mask)))] |= ((__fd_mask) (1UL << ((0) % (8 * (int) sizeof (__fd_mask)))))));
Msg(0, "Sorry, could not find a PTY or TTY.");
select(1, &rfd, ((void *)0), ((void *)0), &tv);
Finit(0);
}
}
else if (ac)
MakeWindow(&nwin);
if (display && default_startup)
display_copyright();
xsignal(2, SigInt);
if (rflag && (rflag & 1) == 0 && !quietflag) {
Msg(0, "New screen...");
rflag = 0;
}
serv_read.type = 1;
serv_read.fd = ServerSocket;
serv_read.handler = serv_read_fn;
evenq(&serv_read);
serv_select.pri = -10;
serv_select.type = 3;
serv_select.handler = serv_select_fn;
evenq(&serv_select);
logflushev.type = 0;
logflushev.handler = logflush_fn;
sched();
return 0;
}
| {
"array_type": 8,
"break_continue_statement": 34,
"enum_type": 0,
"for_loop": 2,
"function_pointer": 0,
"goto_statement": 0,
"if_statement": 146,
"memory_management": 3,
"memory_operation": 1,
"pointer_type": 10,
"return_statement": 1,
"struct_type": 2,
"switch_statement": 4,
"type_casting": 45,
"union_type": 0,
"while_loop": 36
} |
uucp-1.07#prott_prep#ftsendcmd.c | uucp-1.07 | prott.c | ftsendcmd | 21 | boolean
ftsendcmd (qdaemon, z, ilocal, iremote)
struct sdaemon *qdaemon;
const char *z;
int ilocal __attribute__ ((__unused__));
int iremote __attribute__ ((__unused__));
{
size_t clen, csend;
char *zalc;
boolean fret;
do { if (((iDebug & ((010))) != 0)) ulog (LOG_DEBUG, ("ftsendcmd: Sending command \"%s\""), (z)); } while (0);
clen = strlen (z);
csend = ((clen / (512)) + 1) * (512);
zalc = zbufalc (csend);
memcpy (zalc, z, clen);
if (csend > clen)
bzero (zalc + clen, csend - clen);
fret = fsend_data (qdaemon->qconn, zalc, csend, (1));
ubuffree (zalc);
return fret;
}
| {
"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": 1,
"pointer_type": 1,
"return_statement": 1,
"struct_type": 1,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 1
} |
transcoder-set#MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_K_TIMES_prep#f_filled.c | transcoder-set | MAXIMUM_PROFIT_BY_BUYING_AND_SELLING_A_SHARE_AT_MOST_K_TIMES.c | f_filled | 1 | int f_filled ( int price [ ], 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,
"union_type": 0,
"while_loop": 0
} |
transcoder-set#EFFICIENT_WAY_CHECK_WHETHER_N_TH_FIBONACCI_NUMBER_MULTIPLE_10_prep#cmpfunc.c | transcoder-set | EFFICIENT_WAY_CHECK_WHETHER_N_TH_FIBONACCI_NUMBER_MULTIPLE_10.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
} |
transcoder-set#MINIMUM_PERIMETER_N_BLOCKS_prep#sort.c | transcoder-set | MINIMUM_PERIMETER_N_BLOCKS.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
} |
gzip-1.12#util_prep#gzip_error.c | gzip-1.12 | util.c | gzip_error | 6 | void
gzip_error (char const *m)
{
fprintf (stderr, "\n%s: %s: %s\n", program_name, ifname, m);
abort_gzip();
}
| {
"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.h#allow_inf_and_nan_prep#json_write_get_string_size.c | json.h | allow_inf_and_nan.c | json_write_get_string_size | 22 | int json_write_get_string_size(const struct json_string_s *string,
size_t *size) {
size_t i;
for (i = 0; i < string->string_size; i++) {
switch (string->string[i]) {
case '"':
case '\\':
case '\b':
case '\f':
case '\n':
case '\r':
case '\t':
*size += 2;
break;
default:
*size += 1;
break;
}
}
*size += 2;
return 0;
}
| {
"array_type": 1,
"break_continue_statement": 2,
"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": 1,
"switch_statement": 1,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
gprolog-1.5.0#error_supp_prep#Pl_Err_Instantiation.c | gprolog-1.5.0 | error_supp.c | Pl_Err_Instantiation | 6 | void
Pl_Err_Instantiation(void)
{
Update_Cur_From_C_Bip();
Pl_Execute_A_Continuation(X1_24706C5F6572725F696E7374616E74696174696F6E__a0);
}
| {
"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
} |
units-2.22#units_prep#write_files_sig.c | units-2.22 | units.c | write_files_sig | 9 | void
write_files_sig(int sig)
{
if (historyfile)
save_history();
close_logfile();
signal(sig, ((__sighandler_t) 0));
raise(sig);
}
| {
"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": 0,
"switch_statement": 0,
"type_casting": 0,
"union_type": 0,
"while_loop": 0
} |
tmux#notify_prep#notify_winlink.c | tmux | notify.c | notify_winlink | 7 | void
notify_winlink(const char *name, struct winlink *wl)
{
struct cmd_find_state fs;
cmd_find_from_winlink(&fs, wl, 0);
notify_add(name, &fs, ((void *)0), wl->session, wl->window, ((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": 1,
"switch_statement": 0,
"type_casting": 1,
"union_type": 0,
"while_loop": 0
} |
tulipindicators-0.9.1#tiamalgamation_prep#tc_result_pattern_count.c | tulipindicators-0.9.1 | tiamalgamation.c | tc_result_pattern_count | 3 | int tc_result_pattern_count(const tc_result *result) {
return result->pattern_count;
}
| {
"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
} |
heman#mat4_prep#kmMat4RotationTranslation.c | heman | mat4.c | kmMat4RotationTranslation | 20 | kmMat4* kmMat4RotationTranslation(kmMat4* pOut, const kmMat3* rotation, const kmVec3* translation)
{
pOut->mat[0] = rotation->mat[0];
pOut->mat[1] = rotation->mat[1];
pOut->mat[2] = rotation->mat[2];
pOut->mat[3] = 0.0f;
pOut->mat[4] = rotation->mat[3];
pOut->mat[5] = rotation->mat[4];
pOut->mat[6] = rotation->mat[5];
pOut->mat[7] = 0.0f;
pOut->mat[8] = rotation->mat[6];
pOut->mat[9] = rotation->mat[7];
pOut->mat[10] = rotation->mat[8];
pOut->mat[11] = 0.0f;
pOut->mat[12] = translation->x;
pOut->mat[13] = translation->y;
pOut->mat[14] = translation->z;
pOut->mat[15] = 1.0f;
return pOut;
}
| {
"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
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.