id
int64
0
79.7k
docstring_tokens
sequence
code_tokens
sequence
fun_name
stringlengths
1
108
repo
stringlengths
7
49
starting
stringclasses
3 values
partition
stringclasses
3 values
__index_level_0__
int64
0
58.8k
78,636
[ "Run", "the", "given", "brainfuck", "string" ]
[ "'int", "run_string", "(", "char", "*", "code", ")", "{", "BrainfuckState", "*", "state", "=", "brainfuck_state", "()", ";", "BrainfuckExecutionContext", "*", "context", "=", "brainfuck_context", "(", "BRAINFUCK_TAPE_SIZE", ")", ";", "BrainfuckInstruction", "*", "instruction", "=", "brainfuck_parse_string", "(", "code", ")", ";", "brainfuck_add", "(", "state", ",", "instruction", ")", ";", "brainfuck_execute", "(", "state", "->", "root", ",", "context", ")", ";", "brainfuck_destroy_context", "(", "context", ")", ";", "brainfuck_destroy_state", "(", "state", ")", ";", "return", "EXIT_SUCCESS", ";", "}'" ]
run_string
fabianishere/brainfuck
multi_line
valid
9,446
78,637
[ "Run", "the", "given", "brainfuck", "file" ]
[ "'int", "run_file", "(", "FILE", "*", "file", ")", "{", "BrainfuckState", "*", "state", "=", "brainfuck_state", "()", ";", "BrainfuckExecutionContext", "*", "context", "=", "brainfuck_context", "(", "BRAINFUCK_TAPE_SIZE", ")", ";", "if", "(", "file", "==", "NULL", ")", "{", "brainfuck_destroy_context", "(", "context", ")", ";", "brainfuck_destroy_state", "(", "state", ")", ";", "return", "EXIT_FAILURE", ";", "}", "brainfuck_add", "(", "state", ",", "brainfuck_parse_stream", "(", "file", ")", ")", ";", "brainfuck_execute", "(", "state", "->", "root", ",", "context", ")", ";", "brainfuck_destroy_context", "(", "context", ")", ";", "brainfuck_destroy_state", "(", "state", ")", ";", "fclose", "(", "file", ")", ";", "return", "EXIT_SUCCESS", ";", "}'" ]
run_file
fabianishere/brainfuck
multi_line
valid
9,447
78,638
[ "API", "function", "manipulating", "'table_flags'" ]
[ "'unsigned", "int", "ENGINE_get_table_flags", "(", "void", ")", "{", "return", "table_flags", ";", "}'" ]
ENGINE_get_table_flags
rbsec/sslscan
single_line
valid
9,448
78,643
[ "a", "simple", "log", "function,", "works", "similar", "to", "printf" ]
[ "'void", "glog", "(", "const", "char", "*", "format", ",", "...", ")", "{", "va_list", "args", ";", "//", "argument", "list", "static", "FILE", "*", "logfile", "=", "NULL", ";", "//", "file", "pointer", "to", "the", "logfile", "char", "*", "fformat", ";", "//", "the", "modified", "format", "of", "the", "string", "which", "will", "be", "written", "to", "the", "logfile", "int", "length", ";", "//", "length", "of", "the", "format", "if", "(", "!", "(", "format", "==", "NULL", "&&", "logfile", "==", "NULL", ")", ")", "{", "//", "open", "the", "logfile", "if", "not", "already", "opened", "if", "(", "logfile", "==", "NULL", ")", "{", "logfile", "=", "fopen", "(", "LOG_FILE", ",", "\"w\"", ")", ";", "//", "if", "that", "doesn\\'t", "work", "exit", "with", "an", "error", "message", "if", "(", "logfile", "==", "NULL", ")", "{", "fprintf", "(", "stderr", ",", "\"Cannot", "open", "logfile", "%s\\\"", ",", "LOG_FILE", ")", ";", "exit", "(", "EXIT_FAILURE", ")", ";", "}", "}", "//", "if", "NULL", "is", "given", "as", "format,", "close", "the", "opened", "file", "if", "(", "format", "!=", "NULL", ")", "{", "//", "increase", "length", "by", "2", "(for", "\\\\\\0", "length", "=", "strlen", "(", "format", ")", "+", "2", ";", "//", "allocate", "memory", "fformat", "=", "malloc", "(", "sizeof", "(", "char", ")", "*", "length", ")", ";", "//", "copy", "the", "format", "over", "strncpy", "(", "fformat", ",", "format", ",", "length", "-", "2", ")", ";", "//", "append", "\\\\\\0", "fformat", "[", "length", "-", "2", "]", "=", "\\'\\\\'", ";", "fformat", "[", "length", "-", "1", "]", "=", "\\'\\\\0\\'", ";", "//", "get", "the", "rest", "of", "the", "arguments", "va_start", "(", "args", ",", "format", ")", ";", "//", "use", "vfprintf()", "to", "vfprintf", "(", "logfile", ",", "fformat", ",", "args", ")", ";", "//", "forces", "the", "logmessage", "to", "be", "written", "into", "the", "file", "right", "now", "fflush", "(", "logfile", ")", ";", "va_end", "(", "args", ")", ";", "//", "free", "the", "allocated", "memory", "for", "the", "format", "string", "free", "(", "fformat", ")", ";", "}", "else", "{", "//", "close", "the", "logfile", "fclose", "(", "logfile", ")", ";", "}", "}", "}'" ]
glog
mogria/msnake
double_slash
valid
9,449
78,668
[ "32point", "inverse", "transform", "(32", "rows)" ]
[ "'static", "void", "InvTransform32_SSE2", "(", "EB_S16", "*", "src", ",", "EB_U32", "src_stride", ",", "EB_S16", "*", "dst", ",", "EB_U32", "dst_stride", ",", "EB_U32", "shift", ")", "{", "EB_U32", "i", ";", "__m128i", "s0", "=", "_mm_cvtsi32_si128", "(", "shift", ")", ";", "__m128i", "o0", "=", "_mm_set1_epi32", "(", "1", "<<", "(", "shift", "-", "1", ")", ")", ";", "const", "__m128i", "*", "coeff32", "=", "(", "const", "__m128i", "*", ")", "EbHevcCoeff_tbl2", ";", "for", "(", "i", "=", "0", ";", "i", "<", "32", ";", "i", "++", ")", "{", "__m128i", "x0", ",", "<type", "ref=\"prev\"/>", "x1", ",", "<type", "ref=\"prev\"/>", "x2", ",", "<type", "ref=\"prev\"/>", "x3", ";", "__m128i", "y0", ",", "<type", "ref=\"prev\"/>", "y1", ",", "<type", "ref=\"prev\"/>", "y2", ",", "<type", "ref=\"prev\"/>", "y3", ";", "__m128i", "a0", ",", "<type", "ref=\"prev\"/>", "a1", ",", "<type", "ref=\"prev\"/>", "a2", ",", "<type", "ref=\"prev\"/>", "a3", ",", "<type", "ref=\"prev\"/>", "a4", ",", "<type", "ref=\"prev\"/>", "a5", ",", "<type", "ref=\"prev\"/>", "a6", ",", "<type", "ref=\"prev\"/>", "a7", ";", "__m128i", "b0", ",", "<type", "ref=\"prev\"/>", "b1", ",", "<type", "ref=\"prev\"/>", "b2", ",", "<type", "ref=\"prev\"/>", "b3", ",", "<type", "ref=\"prev\"/>", "b4", ",", "<type", "ref=\"prev\"/>", "b5", ",", "<type", "ref=\"prev\"/>", "b6", ",", "<type", "ref=\"prev\"/>", "b7", ";", "x0", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "i", "*", "src_stride", "+", "0x00", ")", ")", ";", "//", "00", "01", "02", "03", "04", "05", "06", "07", "x1", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "i", "*", "src_stride", "+", "0x08", ")", ")", ";", "//", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "x2", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "i", "*", "src_stride", "+", "0x10", ")", ")", ";", "//", "10", "11", "12", "13", "14", "15", "16", "17", "x3", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "i", "*", "src_stride", "+", "0x18", ")", ")", ";", "//", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "y0", "=", "_mm_unpacklo_epi16", "(", "x0", ",", "x1", ")", ";", "//", "00", "08", "01", "09", "02", "0a", "03", "0b", "y1", "=", "_mm_unpackhi_epi16", "(", "x0", ",", "x1", ")", ";", "//", "04", "0c", "05", "0d", "06", "0e", "07", "0f", "y2", "=", "_mm_unpacklo_epi16", "(", "x2", ",", "x3", ")", ";", "//", "10", "18", "y3", "=", "_mm_unpackhi_epi16", "(", "x2", ",", "x3", ")", ";", "//", "24", "2c", "x0", "=", "_mm_unpacklo_epi16", "(", "y0", ",", "y1", ")", ";", "//", "00", "04", "08", "0c", "01", "05", "09", "0d", "x1", "=", "_mm_unpackhi_epi16", "(", "y0", ",", "y1", ")", ";", "//", "02", "06", "0a", "0e", "03", "07", "0b", "0f", "x2", "=", "_mm_unpacklo_epi16", "(", "y2", ",", "y3", ")", ";", "//", "10", "14", "x3", "=", "_mm_unpackhi_epi16", "(", "y2", ",", "y3", ")", ";", "//", "12", "16", "y0", "=", "_mm_unpacklo_epi64", "(", "x0", ",", "x2", ")", ";", "//", "00", "04", "08", "0c", "10", "14", "18", "1c", "y1", "=", "_mm_unpacklo_epi64", "(", "x1", ",", "x3", ")", ";", "//", "02", "06", "0a", "0e", "12", "16", "1a", "1e", "y2", "=", "_mm_unpackhi_epi16", "(", "x0", ",", "x1", ")", ";", "//", "01", "03", "05", "07", "09", "0b", "0d", "0f", "y3", "=", "_mm_unpackhi_epi16", "(", "x2", ",", "x3", ")", ";", "//", "11", "13", "15", "17", "19", "1b", "1d", "1f", "x0", "=", "y0", ";", "x1", "=", "y1", ";", "x2", "=", "y2", ";", "x3", "=", "y3", ";", "a0", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0x00", ")", ",", "coeff32", "[", "0", "]", ")", ";", "a0", "=", "_mm_add_epi32", "(", "a0", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0x55", ")", ",", "coeff32", "[", "2", "]", ")", ")", ";", "a0", "=", "_mm_add_epi32", "(", "a0", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0xaa", ")", ",", "coeff32", "[", "4", "]", ")", ")", ";", "a0", "=", "_mm_add_epi32", "(", "a0", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0xff", ")", ",", "coeff32", "[", "6", "]", ")", ")", ";", "a1", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0x00", ")", ",", "coeff32", "[", "1", "]", ")", ";", "a1", "=", "_mm_add_epi32", "(", "a1", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0x55", ")", ",", "coeff32", "[", "3", "]", ")", ")", ";", "a1", "=", "_mm_add_epi32", "(", "a1", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0xaa", ")", ",", "coeff32", "[", "5", "]", ")", ")", ";", "a1", "=", "_mm_add_epi32", "(", "a1", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x0", ",", "0xff", ")", ",", "coeff32", "[", "7", "]", ")", ")", ";", "a2", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0x00", ")", ",", "coeff32", "[", "8", "]", ")", ";", "a2", "=", "_mm_add_epi32", "(", "a2", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0x55", ")", ",", "coeff32", "[", "10", "]", ")", ")", ";", "a2", "=", "_mm_add_epi32", "(", "a2", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0xaa", ")", ",", "coeff32", "[", "12", "]", ")", ")", ";", "a2", "=", "_mm_add_epi32", "(", "a2", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0xff", ")", ",", "coeff32", "[", "14", "]", ")", ")", ";", "a3", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0x00", ")", ",", "coeff32", "[", "9", "]", ")", ";", "a3", "=", "_mm_add_epi32", "(", "a3", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0x55", ")", ",", "coeff32", "[", "11", "]", ")", ")", ";", "a3", "=", "_mm_add_epi32", "(", "a3", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0xaa", ")", ",", "coeff32", "[", "13", "]", ")", ")", ";", "a3", "=", "_mm_add_epi32", "(", "a3", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x1", ",", "0xff", ")", ",", "coeff32", "[", "15", "]", ")", ")", ";", "a4", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x00", ")", ",", "coeff32", "[", "16", "]", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x55", ")", ",", "coeff32", "[", "20", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xaa", ")", ",", "coeff32", "[", "24", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xff", ")", ",", "coeff32", "[", "28", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x00", ")", ",", "coeff32", "[", "32", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x55", ")", ",", "coeff32", "[", "36", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xaa", ")", ",", "coeff32", "[", "40", "]", ")", ")", ";", "a4", "=", "_mm_add_epi32", "(", "a4", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xff", ")", ",", "coeff32", "[", "44", "]", ")", ")", ";", "a5", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x00", ")", ",", "coeff32", "[", "17", "]", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x55", ")", ",", "coeff32", "[", "21", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xaa", ")", ",", "coeff32", "[", "25", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xff", ")", ",", "coeff32", "[", "29", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x00", ")", ",", "coeff32", "[", "33", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x55", ")", ",", "coeff32", "[", "37", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xaa", ")", ",", "coeff32", "[", "41", "]", ")", ")", ";", "a5", "=", "_mm_add_epi32", "(", "a5", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xff", ")", ",", "coeff32", "[", "45", "]", ")", ")", ";", "a6", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x00", ")", ",", "coeff32", "[", "18", "]", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x55", ")", ",", "coeff32", "[", "22", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xaa", ")", ",", "coeff32", "[", "26", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xff", ")", ",", "coeff32", "[", "30", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x00", ")", ",", "coeff32", "[", "34", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x55", ")", ",", "coeff32", "[", "38", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xaa", ")", ",", "coeff32", "[", "42", "]", ")", ")", ";", "a6", "=", "_mm_add_epi32", "(", "a6", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xff", ")", ",", "coeff32", "[", "46", "]", ")", ")", ";", "a7", "=", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x00", ")", ",", "coeff32", "[", "19", "]", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0x55", ")", ",", "coeff32", "[", "23", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xaa", ")", ",", "coeff32", "[", "27", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x2", ",", "0xff", ")", ",", "coeff32", "[", "31", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x00", ")", ",", "coeff32", "[", "35", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0x55", ")", ",", "coeff32", "[", "39", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xaa", ")", ",", "coeff32", "[", "43", "]", ")", ")", ";", "a7", "=", "_mm_add_epi32", "(", "a7", ",", "_mm_madd_epi16", "(", "_mm_shuffle_epi32", "(", "x3", ",", "0xff", ")", ",", "coeff32", "[", "47", "]", ")", ")", ";", "a0", "=", "_mm_add_epi32", "(", "a0", ",", "o0", ")", ";", "a1", "=", "_mm_add_epi32", "(", "a1", ",", "o0", ")", ";", "b0", "=", "_mm_add_epi32", "(", "a0", ",", "a2", ")", ";", "b1", "=", "_mm_add_epi32", "(", "a1", ",", "a3", ")", ";", "b2", "=", "_mm_sub_epi32", "(", "a0", ",", "a2", ")", ";", "b3", "=", "_mm_sub_epi32", "(", "a1", ",", "a3", ")", ";", "a0", "=", "b0", ";", "a1", "=", "b1", ";", "a2", "=", "_mm_shuffle_epi32", "(", "b3", ",", "0x1b", ")", ";", "//", "00011011", "a3", "=", "_mm_shuffle_epi32", "(", "b2", ",", "0x1b", ")", ";", "b0", "=", "_mm_add_epi32", "(", "a0", ",", "a4", ")", ";", "b1", "=", "_mm_add_epi32", "(", "a1", ",", "a5", ")", ";", "b2", "=", "_mm_add_epi32", "(", "a2", ",", "a6", ")", ";", "b3", "=", "_mm_add_epi32", "(", "a3", ",", "a7", ")", ";", "b4", "=", "_mm_sub_epi32", "(", "a0", ",", "a4", ")", ";", "b5", "=", "_mm_sub_epi32", "(", "a1", ",", "a5", ")", ";", "b6", "=", "_mm_sub_epi32", "(", "a2", ",", "a6", ")", ";", "b7", "=", "_mm_sub_epi32", "(", "a3", ",", "a7", ")", ";", "a0", "=", "_mm_sra_epi32", "(", "b0", ",", "s0", ")", ";", "a1", "=", "_mm_sra_epi32", "(", "b1", ",", "s0", ")", ";", "a2", "=", "_mm_sra_epi32", "(", "b2", ",", "s0", ")", ";", "a3", "=", "_mm_sra_epi32", "(", "b3", ",", "s0", ")", ";", "a4", "=", "_mm_sra_epi32", "(", "_mm_shuffle_epi32", "(", "b7", ",", "0x1b", ")", ",", "s0", ")", ";", "a5", "=", "_mm_sra_epi32", "(", "_mm_shuffle_epi32", "(", "b6", ",", "0x1b", ")", ",", "s0", ")", ";", "a6", "=", "_mm_sra_epi32", "(", "_mm_shuffle_epi32", "(", "b5", ",", "0x1b", ")", ",", "s0", ")", ";", "a7", "=", "_mm_sra_epi32", "(", "_mm_shuffle_epi32", "(", "b4", ",", "0x1b", ")", ",", "s0", ")", ";", "x0", "=", "_mm_packs_epi32", "(", "a0", ",", "a1", ")", ";", "x1", "=", "_mm_packs_epi32", "(", "a2", ",", "a3", ")", ";", "x2", "=", "_mm_packs_epi32", "(", "a4", ",", "a5", ")", ";", "x3", "=", "_mm_packs_epi32", "(", "a6", ",", "a7", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "i", "*", "dst_stride", "+", "0x00", ")", ",", "x0", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "i", "*", "dst_stride", "+", "0x08", ")", ",", "x1", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "i", "*", "dst_stride", "+", "0x10", ")", ",", "x2", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "i", "*", "dst_stride", "+", "0x18", ")", ",", "x3", ")", ";", "}", "}'" ]
InvTransform32_SSE2
OpenVisualCloud/SVT-HEVC
double_slash
valid
9,450
78,669
[ "transpose", "16x16", "block", "of", "data" ]
[ "'static", "void", "Transpose16", "(", "EB_S16", "*", "src", ",", "EB_U32", "src_stride", ",", "EB_S16", "*", "dst", ",", "EB_U32", "dst_stride", ")", "{", "int", "i", ",", "<type", "ref=\"prev\"/>", "j", ";", "for", "(", "i", "=", "0", ";", "i", "<", "2", ";", "i", "++", ")", "{", "for", "(", "j", "=", "0", ";", "j", "<", "2", ";", "j", "++", ")", "{", "__m128i", "a0", ",", "<type", "ref=\"prev\"/>", "a1", ",", "<type", "ref=\"prev\"/>", "a2", ",", "<type", "ref=\"prev\"/>", "a3", ",", "<type", "ref=\"prev\"/>", "a4", ",", "<type", "ref=\"prev\"/>", "a5", ",", "<type", "ref=\"prev\"/>", "a6", ",", "<type", "ref=\"prev\"/>", "a7", ";", "__m128i", "b0", ",", "<type", "ref=\"prev\"/>", "b1", ",", "<type", "ref=\"prev\"/>", "b2", ",", "<type", "ref=\"prev\"/>", "b3", ",", "<type", "ref=\"prev\"/>", "b4", ",", "<type", "ref=\"prev\"/>", "b5", ",", "<type", "ref=\"prev\"/>", "b6", ",", "<type", "ref=\"prev\"/>", "b7", ";", "a0", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "0", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a1", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "1", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a2", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "2", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a3", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "3", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a4", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "4", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a5", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "5", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a6", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "6", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "a7", "=", "_mm_loadu_si128", "(", "(", "const", "__m128i", "*", ")", "(", "src", "+", "(", "8", "*", "i", "+", "7", ")", "*", "src_stride", "+", "8", "*", "j", ")", ")", ";", "b0", "=", "_mm_unpacklo_epi16", "(", "a0", ",", "a4", ")", ";", "b1", "=", "_mm_unpacklo_epi16", "(", "a1", ",", "a5", ")", ";", "b2", "=", "_mm_unpacklo_epi16", "(", "a2", ",", "a6", ")", ";", "b3", "=", "_mm_unpacklo_epi16", "(", "a3", ",", "a7", ")", ";", "b4", "=", "_mm_unpackhi_epi16", "(", "a0", ",", "a4", ")", ";", "b5", "=", "_mm_unpackhi_epi16", "(", "a1", ",", "a5", ")", ";", "b6", "=", "_mm_unpackhi_epi16", "(", "a2", ",", "a6", ")", ";", "b7", "=", "_mm_unpackhi_epi16", "(", "a3", ",", "a7", ")", ";", "a0", "=", "_mm_unpacklo_epi16", "(", "b0", ",", "b2", ")", ";", "a1", "=", "_mm_unpacklo_epi16", "(", "b1", ",", "b3", ")", ";", "a2", "=", "_mm_unpackhi_epi16", "(", "b0", ",", "b2", ")", ";", "a3", "=", "_mm_unpackhi_epi16", "(", "b1", ",", "b3", ")", ";", "a4", "=", "_mm_unpacklo_epi16", "(", "b4", ",", "b6", ")", ";", "a5", "=", "_mm_unpacklo_epi16", "(", "b5", ",", "b7", ")", ";", "a6", "=", "_mm_unpackhi_epi16", "(", "b4", ",", "b6", ")", ";", "a7", "=", "_mm_unpackhi_epi16", "(", "b5", ",", "b7", ")", ";", "b0", "=", "_mm_unpacklo_epi16", "(", "a0", ",", "a1", ")", ";", "b1", "=", "_mm_unpackhi_epi16", "(", "a0", ",", "a1", ")", ";", "b2", "=", "_mm_unpacklo_epi16", "(", "a2", ",", "a3", ")", ";", "b3", "=", "_mm_unpackhi_epi16", "(", "a2", ",", "a3", ")", ";", "b4", "=", "_mm_unpacklo_epi16", "(", "a4", ",", "a5", ")", ";", "b5", "=", "_mm_unpackhi_epi16", "(", "a4", ",", "a5", ")", ";", "b6", "=", "_mm_unpacklo_epi16", "(", "a6", ",", "a7", ")", ";", "b7", "=", "_mm_unpackhi_epi16", "(", "a6", ",", "a7", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "0", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b0", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "1", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b1", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "2", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b2", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "3", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b3", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "4", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b4", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "5", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b5", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "6", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b6", ")", ";", "_mm_storeu_si128", "(", "(", "__m128i", "*", ")", "(", "dst", "+", "(", "8", "*", "j", "+", "7", ")", "*", "dst_stride", "+", "8", "*", "i", ")", ",", "b7", ")", ";", "}", "}", "}'" ]
Transpose16
OpenVisualCloud/SVT-HEVC
double_slash
valid
9,451
78,696
[ "Add", "BB", "to", "cluster", "C" ]
[ "'static", "void", "add_bb_to_cluster", "(", "bb_cluster", "*", "c", ",", "basic_block", "bb", ")", "{", "edge", "e", ";", "edge_iterator", "ei", ";", "bitmap_set_bit", "(", "c", "->", "bbs", ",", "bb", "->", "index", ")", ";", "FOR_EACH_EDGE", "(", "e", ",", "ei", ",", "bb->preds", ")", "bitmap_set_bit", "(", "c", "->", "preds", ",", "e", "->", "src", "->", "index", ")", ";", "update_rep_bb", "(", "c", ",", "bb", ")", ";", "}'" ]
add_bb_to_cluster
KevinOConnor/klipper
single_line
valid
9,452
78,697
[ "Return", "true", "if", "gimple", "operands", "T1", "and", "T2", "have", "the", "same", "value" ]
[ "'static", "bool", "gimple_operand_equal_value_p", "(", "tree", "t1", ",", "tree", "t2", ")", "{", "if", "(", "t1", "==", "t2", ")", "return", "true", ";", "if", "(", "t1", "==", "NULL_TREE", "||", "t2", "==", "NULL_TREE", ")", "return", "false", ";", "if", "(", "operand_equal_p", "(", "t1", ",", "t2", ",", "OEP_MATCH_SIDE_EFFECTS", ")", ")", "return", "true", ";", "return", "gvn_uses_equal", "(", "t1", ",", "t2", ")", ";", "}'" ]
gimple_operand_equal_value_p
KevinOConnor/klipper
single_line
valid
9,453
78,698
[ "Adds", "SAME", "to", "worklist" ]
[ "'static", "void", "add_to_worklist", "(", "same_succ", "*", "same", ")", "{", "if", "(", "same", "->", "in_worklist", ")", "return", ";", "if", "(", "bitmap_count_bits", "(", "same", "->", "bbs", ")", "<", "2", ")", "return", ";", "same", "->", "in_worklist", "=", "true", ";", "worklist", ".", "safe_push", "(", "same", ")", ";", "}'" ]
add_to_worklist
KevinOConnor/klipper
single_line
valid
9,454
78,699
[ "Alloc", "and", "init", "a", "new", "SAME_SUCC" ]
[ "'same_succ", "*", "same_succ_alloc", "(", "void", ")", "{", "same_succ", "*", "same", "=", "XNEW", "(", "struct", "same_succ", ")", ";", "same", "->", "bbs", "=", "BITMAP_ALLOC", "(", "NULL", ")", ";", "same", "->", "succs", "=", "BITMAP_ALLOC", "(", "NULL", ")", ";", "same", "->", "inverse", "=", "BITMAP_ALLOC", "(", "NULL", ")", ";", "same", "->", "succ_flags", ".", "create", "(", "10", ")", ";", "same", "->", "in_worklist", "=", "false", ";", "return", "same", ";", "}'" ]
same_succ_alloc
KevinOConnor/klipper
single_line
valid
9,455
78,700
[ "Let", "GSI", "skip", "forwards", "over", "local", "defs" ]
[ "'static", "void", "gsi_advance_fw_nondebug_nonlocal", "(", "gimple_stmt_iterator", "*", "gsi", ")", "{", "gimple", "*", "stmt", ";", "while", "(", "true", ")", "{", "if", "(", "gsi_end_p", "(", "*", "gsi", ")", ")", "return", ";", "stmt", "=", "gsi_stmt", "(", "*", "gsi", ")", ";", "if", "(", "!", "stmt_local_def", "(", "stmt", ")", ")", "return", ";", "gsi_next_nondebug", "(", "gsi", ")", ";", "}", "}'" ]
gsi_advance_fw_nondebug_nonlocal
KevinOConnor/klipper
single_line
valid
9,456
78,701
[ "Removes", "BB", "from", "its", "corresponding", "same_succ" ]
[ "'static", "void", "same_succ_flush_bb", "(", "basic_block", "bb", ")", "{", "same_succ", "*", "same", "=", "BB_SAME_SUCC", "(", "bb", ")", ";", "if", "(", "!", "same", ")", "return", ";", "BB_SAME_SUCC", "(", "bb", ")", "=", "NULL", ";", "if", "(", "bitmap_single_bit_set_p", "(", "same", "->", "bbs", ")", ")", "same_succ_htab", "->", "remove_elt_with_hash", "(", "same", ",", "same", "->", "hashval", ")", ";", "else", "bitmap_clear_bit", "(", "same", "->", "bbs", ",", "bb", "->", "index", ")", ";", "}'" ]
same_succ_flush_bb
KevinOConnor/klipper
single_line
valid
9,457
78,702
[ "Returns", "the", "vop", "phi", "of", "BB,", "if", "any" ]
[ "'static", "gphi", "*", "vop_phi", "(", "basic_block", "bb", ")", "{", "gphi", "*", "stmt", ";", "gphi_iterator", "gsi", ";", "for", "(", "gsi", "=", "gsi_start_phis", "(", "bb", ")", ";", "!", "gsi_end_p", "(", "gsi", ")", ";", "gsi_next", "(", "&", "gsi", ")", ")", "{", "stmt", "=", "gsi", ".", "phi", "()", ";", "if", "(", "!", "virtual_operand_p", "(", "gimple_phi_result", "(", "stmt", ")", ")", ")", "continue;", "return", "stmt", ";", "}", "return", "NULL", ";", "}'" ]
vop_phi
KevinOConnor/klipper
single_line
valid
9,458
78,703
[ "Update", "C>rep_bb,", "given", "that", "BB", "is", "added", "to", "the", "cluster" ]
[ "'static", "void", "update_rep_bb", "(", "bb_cluster", "*", "c", ",", "basic_block", "bb", ")", "{", "/*", "Initial.", "*/", "if", "(", "c", "->", "rep_bb", "==", "NULL", ")", "{", "c", "->", "rep_bb", "=", "bb", ";", "return", ";", "}", "/*", "Current", "needs", "no", "deps,", "keep", "it.", "*/", "if", "(", "BB_DEP_BB", "(", "c", "->", "rep_bb", ")", "==", "NULL", ")", "return", ";", "/*", "Bb", "needs", "no", "deps,", "change", "rep_bb.", "*/", "if", "(", "BB_DEP_BB", "(", "bb", ")", "==", "NULL", ")", "{", "c", "->", "rep_bb", "=", "bb", ";", "return", ";", "}", "/*", "Bb", "needs", "last", "deps", "earlier", "than", "current,", "change", "rep_bb.", "A", "potential", "problem", "with", "this,", "is", "that", "the", "first", "deps", "might", "also", "be", "earlier,", "which", "would", "mean", "we", "prefer", "longer", "lifetimes", "for", "the", "deps.", "To", "be", "able", "to", "check", "for", "this,", "we", "would", "have", "to", "trace", "BB_FIRST_DEP_BB", "as", "well,", "besides", "BB_DEP_BB,", "which", "is", "really", "BB_LAST_DEP_BB.", "The", "benefit", "of", "choosing", "the", "bb", "with", "last", "deps", "earlier,", "is", "that", "it", "can", "potentially", "be", "used", "as", "replacement", "for", "more", "bbs.", "*/", "if", "(", "dominated_by_p", "(", "CDI_DOMINATORS", ",", "BB_DEP_BB", "(", "c", "->", "rep_bb", ")", ",", "BB_DEP_BB", "(", "bb", ")", ")", ")", "c", "->", "rep_bb", "=", "bb", ";", "}'" ]
update_rep_bb
KevinOConnor/klipper
single_line
valid
9,459
78,704
[ "Prints", "E", "to", "FILE" ]
[ "'static", "void", "same_succ_print", "(", "FILE", "*", "file", ",", "const", "same_succ", "*", "e", ")", "{", "unsigned", "int", "i", ";", "bitmap_print", "(", "file", ",", "e", "->", "bbs", ",", "\"bbs:\"", ",", "\"\\\"", ")", ";", "bitmap_print", "(", "file", ",", "e", "->", "succs", ",", "\"succs:\"", ",", "\"\\\"", ")", ";", "bitmap_print", "(", "file", ",", "e", "->", "inverse", ",", "\"inverse:\"", ",", "\"\\\"", ")", ";", "fprintf", "(", "file", ",", "\"flags:\"", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "e", "->", "succ_flags", ".", "length", "()", ";", "++", "i", ")", "fprintf", "(", "file", ",", "\"", "%x\"", ",", "e", "->", "succ_flags", "[", "i", "]", ")", ";", "fprintf", "(", "file", ",", "\"\\\"", ")", ";", "}'" ]
same_succ_print
KevinOConnor/klipper
single_line
valid
9,460
78,705
[ "Runs", "tail", "merge", "optimization" ]
[ "'unsigned", "int", "tail_merge_optimize", "(", "unsigned", "int", "todo", ")", "{", "int", "nr_bbs_removed_total", "=", "0", ";", "int", "nr_bbs_removed", ";", "bool", "loop_entered", "=", "false", ";", "int", "iteration_nr", "=", "0", ";", "int", "max_iterations", "=", "PARAM_VALUE", "(", "PARAM_MAX_TAIL_MERGE_ITERATIONS", ")", ";", "if", "(", "!", "flag_tree_tail_merge", "||", "max_iterations", "==", "0", ")", "return", "0", ";", "timevar_push", "(", "TV_TREE_TAIL_MERGE", ")", ";", "/*", "We", "enter", "from", "PRE", "which", "has", "critical", "edges", "split.", "Elimination", "does", "not", "process", "trivially", "dead", "code", "so", "cleanup", "the", "CFG", "if", "we", "are", "told", "so.", "And", "re-split", "critical", "edges", "then.", "*/", "if", "(", "todo", "&", "TODO_cleanup_cfg", ")", "{", "cleanup_tree_cfg", "()", ";", "todo", "&=", "~", "TODO_cleanup_cfg", ";", "split_critical_edges", "()", ";", "}", "if", "(", "!", "dom_info_available_p", "(", "CDI_DOMINATORS", ")", ")", "{", "/*", "PRE", "can", "leave", "us", "with", "unreachable", "blocks,", "remove", "them", "now.", "*/", "delete_unreachable_blocks", "()", ";", "calculate_dominance_info", "(", "CDI_DOMINATORS", ")", ";", "}", "init_worklist", "()", ";", "while", "(", "!", "worklist", ".", "is_empty", "()", ")", "{", "if", "(", "!", "loop_entered", ")", "{", "loop_entered", "=", "true", ";", "alloc_cluster_vectors", "()", ";", "update_bbs", "=", "BITMAP_ALLOC", "(", "NULL", ")", ";", "}", "else", "reset_cluster_vectors", "()", ";", "iteration_nr", "++", ";", "if", "(", "dump_file", "&&", "(", "dump_flags", "&", "TDF_DETAILS", ")", ")", "fprintf", "(", "dump_file", ",", "\"worklist", "iteration", "#%d\\\"", ",", "iteration_nr", ")", ";", "find_clusters", "()", ";", "gcc_assert", "(", "worklist", ".", "is_empty", "()", ")", ";", "if", "(", "all_clusters", ".", "is_empty", "()", ")", "break;", "nr_bbs_removed", "=", "apply_clusters", "()", ";", "nr_bbs_removed_total", "+=", "nr_bbs_removed", ";", "if", "(", "nr_bbs_removed", "==", "0", ")", "break;", "free_dominance_info", "(", "CDI_DOMINATORS", ")", ";", "if", "(", "iteration_nr", "==", "max_iterations", ")", "break;", "calculate_dominance_info", "(", "CDI_DOMINATORS", ")", ";", "update_worklist", "()", ";", "}", "if", "(", "dump_file", "&&", "(", "dump_flags", "&", "TDF_DETAILS", ")", ")", "fprintf", "(", "dump_file", ",", "\"htab", "collision", "/", "search:", "%f\\\"", ",", "same_succ_htab", "->", "collisions", "()", ")", ";", "if", "(", "nr_bbs_removed_total", ">", "0", ")", "{", "if", "(", "MAY_HAVE_DEBUG_BIND_STMTS", ")", "{", "calculate_dominance_info", "(", "CDI_DOMINATORS", ")", ";", "update_debug_stmts", "()", ";", "}", "if", "(", "dump_file", "&&", "(", "dump_flags", "&", "TDF_DETAILS", ")", ")", "{", "fprintf", "(", "dump_file", ",", "\"Before", "TODOs.\\\"", ")", ";", "dump_function_to_file", "(", "current_function_decl", ",", "dump_file", ",", "dump_flags", ")", ";", "}", "mark_virtual_operands_for_renaming", "(", "cfun", ")", ";", "}", "delete_worklist", "()", ";", "if", "(", "loop_entered", ")", "{", "delete_cluster_vectors", "()", ";", "BITMAP_FREE", "(", "update_bbs", ")", ";", "}", "timevar_pop", "(", "TV_TREE_TAIL_MERGE", ")", ";", "return", "todo", ";", "}'" ]
tail_merge_optimize
KevinOConnor/klipper
single_line
valid
9,461
78,706
[ "Return", "true", "if", "BB", "has", "nonvop", "phis" ]
[ "'static", "bool", "bb_has_non_vop_phi", "(", "basic_block", "bb", ")", "{", "gimple_seq", "phis", "=", "phi_nodes", "(", "bb", ")", ";", "gimple", "*", "phi", ";", "if", "(", "phis", "==", "NULL", ")", "return", "false", ";", "if", "(", "!", "gimple_seq_singleton_p", "(", "phis", ")", ")", "return", "true", ";", "phi", "=", "gimple_seq_first_stmt", "(", "phis", ")", ";", "return", "!", "virtual_operand_p", "(", "gimple_phi_result", "(", "phi", ")", ")", ";", "}'" ]
bb_has_non_vop_phi
KevinOConnor/klipper
single_line
valid
9,462
78,727
[ "Wrapper", "around", "simplify_gen_subreg", "which", "handles", "CONCATN" ]
[ "\"static", "rtx", "simplify_gen_subreg_concatn", "(", "machine_mode", "outermode", ",", "rtx", "op", ",", "machine_mode", "innermode", ",", "unsigned", "int", "byte", ")", "{", "rtx", "ret", ";", "/*", "We", "have", "to", "handle", "generating", "a", "SUBREG", "of", "a", "SUBREG", "of", "a", "CONCATN.", "If", "OP", "is", "a", "SUBREG", "of", "a", "CONCATN,", "then", "it", "must", "be", "a", "simple", "mode", "change", "with", "the", "same", "size", "and", "offset", "0,", "or", "it", "must", "extract", "a", "part.", "We", "shouldn't", "see", "anything", "else", "here.", "*/", "if", "(", "GET_CODE", "(", "op", ")", "==", "SUBREG", "&&", "GET_CODE", "(", "SUBREG_REG", "(", "op", ")", ")", "==", "CONCATN", ")", "{", "rtx", "op2", ";", "if", "(", "known_eq", "(", "GET_MODE_SIZE", "(", "GET_MODE", "(", "op", ")", ")", ",", "GET_MODE_SIZE", "(", "GET_MODE", "(", "SUBREG_REG", "(", "op", ")", ")", ")", ")", "&&", "known_eq", "(", "SUBREG_BYTE", "(", "op", ")", ",", "0", ")", ")", "return", "simplify_gen_subreg_concatn", "(", "outermode", ",", "SUBREG_REG", "(", "op", ")", ",", "GET_MODE", "(", "SUBREG_REG", "(", "op", ")", ")", ",", "byte", ")", ";", "op2", "=", "simplify_subreg_concatn", "(", "GET_MODE", "(", "op", ")", ",", "SUBREG_REG", "(", "op", ")", ",", "SUBREG_BYTE", "(", "op", ")", ")", ";", "if", "(", "op2", "==", "NULL_RTX", ")", "{", "/*", "We", "don't", "handle", "paradoxical", "subregs", "here.", "*/", "gcc_assert", "(", "!", "paradoxical_subreg_p", "(", "outermode", ",", "GET_MODE", "(", "op", ")", ")", ")", ";", "gcc_assert", "(", "!", "paradoxical_subreg_p", "(", "op", ")", ")", ";", "op2", "=", "simplify_subreg_concatn", "(", "outermode", ",", "SUBREG_REG", "(", "op", ")", ",", "byte", "+", "SUBREG_BYTE", "(", "op", ")", ")", ";", "gcc_assert", "(", "op2", "!=", "NULL_RTX", ")", ";", "return", "op2", ";", "}", "op", "=", "op2", ";", "gcc_assert", "(", "op", "!=", "NULL_RTX", ")", ";", "gcc_assert", "(", "innermode", "==", "GET_MODE", "(", "op", ")", ")", ";", "}", "if", "(", "GET_CODE", "(", "op", ")", "==", "CONCATN", ")", "return", "simplify_subreg_concatn", "(", "outermode", ",", "op", ",", "byte", ")", ";", "ret", "=", "simplify_gen_subreg", "(", "outermode", ",", "op", ",", "innermode", ",", "byte", ")", ";", "/*", "If", "we", "see", "an", "insn", "like", "(set", "(reg:DI)", "(subreg:DI", "(reg:SI)", "0))", "then", "resolve_simple_move", "will", "ask", "for", "the", "high", "part", "of", "the", "paradoxical", "subreg,", "which", "does", "not", "have", "a", "value.", "Just", "return", "a", "zero.", "*/", "if", "(", "ret", "==", "NULL_RTX", "&&", "paradoxical_subreg_p", "(", "op", ")", ")", "return", "CONST0_RTX", "(", "outermode", ")", ";", "gcc_assert", "(", "ret", "!=", "NULL_RTX", ")", ";", "return", "ret", ";", "}\"" ]
simplify_gen_subreg_concatn
KevinOConnor/klipper
single_line
valid
9,463
78,728
[ "Get", "a", "SUBREG", "of", "a", "CONCATN" ]
[ "'static", "rtx", "simplify_subreg_concatn", "(", "machine_mode", "outermode", ",", "rtx", "op", ",", "poly_uint64", "orig_byte", ")", "{", "unsigned", "int", "outer_size", ",", "<type", "ref=\"prev\"/>", "outer_words", ",", "<type", "ref=\"prev\"/>", "inner_size", ",", "<type", "ref=\"prev\"/>", "inner_words", ";", "machine_mode", "innermode", ",", "<type", "ref=\"prev\"/>", "partmode", ";", "rtx", "part", ";", "unsigned", "int", "final_offset", ";", "unsigned", "int", "byte", ";", "innermode", "=", "GET_MODE", "(", "op", ")", ";", "if", "(", "!", "interesting_mode_p", "(", "outermode", ",", "&", "outer_size", ",", "&", "outer_words", ")", "||", "!", "interesting_mode_p", "(", "innermode", ",", "&", "inner_size", ",", "&", "inner_words", ")", ")", "gcc_unreachable", "()", ";", "/*", "Must", "be", "constant", "if", "interesting_mode_p", "passes.", "*/", "byte", "=", "orig_byte", ".", "to_constant", "()", ";", "gcc_assert", "(", "GET_CODE", "(", "op", ")", "==", "CONCATN", ")", ";", "gcc_assert", "(", "byte", "%", "outer_size", "==", "0", ")", ";", "gcc_assert", "(", "byte", "<", "inner_size", ")", ";", "if", "(", "outer_size", ">", "inner_size", ")", "return", "NULL_RTX", ";", "inner_size", "/=", "XVECLEN", "(", "op", ",", "0", ")", ";", "part", "=", "XVECEXP", "(", "op", ",", "0", ",", "byte", "/", "inner_size", ")", ";", "partmode", "=", "GET_MODE", "(", "part", ")", ";", "final_offset", "=", "byte", "%", "inner_size", ";", "if", "(", "final_offset", "+", "outer_size", ">", "inner_size", ")", "return", "NULL_RTX", ";", "/*", "VECTOR_CSTs", "in", "debug", "expressions", "are", "expanded", "into", "CONCATN", "instead", "of", "regular", "CONST_VECTORs.", "They", "have", "vector", "or", "integer", "modes,", "depending", "on", "the", "capabilities", "of", "the", "target.", "Cope", "with", "them.", "*/", "if", "(", "partmode", "==", "VOIDmode", "&&", "VECTOR_MODE_P", "(", "innermode", ")", ")", "partmode", "=", "GET_MODE_INNER", "(", "innermode", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "partmode", "==", "VOIDmode", ")", "partmode", "=", "mode_for_size", "(", "inner_size", "*", "BITS_PER_UNIT", ",", "GET_MODE_CLASS", "(", "innermode", ")", ",", "0", ")", ".", "require", "()", ";", "return", "simplify_gen_subreg", "(", "outermode", ",", "part", ",", "partmode", ",", "final_offset", ")", ";", "}'" ]
simplify_subreg_concatn
KevinOConnor/klipper
single_line
valid
9,464
78,729
[ "Return", "whether", "X", "can", "be", "decomposed", "into", "subwords" ]
[ "'static", "bool", "can_decompose_p", "(", "rtx", "x", ")", "{", "if", "(", "REG_P", "(", "x", ")", ")", "{", "unsigned", "int", "regno", "=", "REGNO", "(", "x", ")", ";", "if", "(", "HARD_REGISTER_NUM_P", "(", "regno", ")", ")", "{", "unsigned", "int", "byte", ",", "<type", "ref=\"prev\"/>", "num_bytes", ",", "<type", "ref=\"prev\"/>", "num_words", ";", "if", "(", "!", "interesting_mode_p", "(", "GET_MODE", "(", "x", ")", ",", "&", "num_bytes", ",", "&", "num_words", ")", ")", "return", "false", ";", "for", "(", "byte", "=", "0", ";", "byte", "<", "num_bytes", ";", "byte", "+=", "UNITS_PER_WORD", ")", "if", "(", "simplify_subreg_regno", "(", "regno", ",", "GET_MODE", "(", "x", ")", ",", "byte", ",", "word_mode", ")", "<", "0", ")", "return", "false", ";", "return", "true", ";", "}", "else", "return", "!", "bitmap_bit_p", "(", "subreg_context", ",", "regno", ")", ";", "}", "return", "true", ";", "}'" ]
can_decompose_p
KevinOConnor/klipper
single_line
valid
9,465
78,730
[ "Look", "for", "SUBREGs", "in", "LOC", "which", "need", "to", "be", "decomposed" ]
[ "'static", "bool", "resolve_subreg_use", "(", "rtx", "*", "loc", ",", "rtx", "insn", ")", "{", "subrtx_ptr_iterator", "::", "array_type", "array", ";", "FOR_EACH_SUBRTX_PTR", "(", "iter", ",", "array", ",", "loc", ",", "NONCONST", ")", "{", "rtx", "*", "loc", "=", "*", "iter", ";", "rtx", "x", "=", "*", "loc", ";", "if", "(", "resolve_subreg_p", "(", "x", ")", ")", "{", "x", "=", "simplify_subreg_concatn", "(", "GET_MODE", "(", "x", ")", ",", "SUBREG_REG", "(", "x", ")", ",", "SUBREG_BYTE", "(", "x", ")", ")", ";", "/*", "It", "is", "possible", "for", "a", "note", "to", "contain", "a", "reference", "which", "we", "can", "decompose.", "In", "this", "case,", "return", "1", "to", "the", "caller", "to", "indicate", "that", "the", "note", "must", "be", "removed.", "*/", "if", "(", "!", "x", ")", "{", "gcc_assert", "(", "!", "insn", ")", ";", "return", "true", ";", "}", "validate_change", "(", "insn", ",", "loc", ",", "x", ",", "1", ")", ";", "iter", ".", "skip_subrtxes", "()", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "resolve_reg_p", "(", "x", ")", ")", "/*", "Return", "1", "to", "the", "caller", "to", "indicate", "that", "we", "found", "a", "direct", "reference", "to", "a", "register", "which", "is", "being", "decomposed.", "This", "can", "happen", "inside", "notes,", "multiword", "shift", "or", "zero-extend", "instructions.", "*/", "return", "true", ";", "}", "return", "false", ";", "}'" ]
resolve_subreg_use
KevinOConnor/klipper
single_line
valid
9,466
78,781
[ "Check", "if", "a", "specific", "string", "is", "numeric", "(like", "\"129544\")" ]
[ "\"int", "OS_StrIsNum", "(", "const", "char", "*", "str", ")", "{", "if", "(", "str", "==", "NULL", ")", "{", "return", "(", "FALSE", ")", ";", "}", "while", "(", "*", "str", "!=", "'\\\\0'", ")", "{", "if", "(", "!", "_IsD", "(", "*", "str", ")", ")", "{", "return", "(", "FALSE", ")", ";", "}", "str", "++", ";", "}", "return", "(", "TRUE", ")", ";", "}\"" ]
OS_StrIsNum
ossec/ossec-hids
single_line
valid
9,467
78,782
[ "Return", "the", "number", "of", "characters", "that", "both", "strings", "have", "in", "common" ]
[ "\"size_t", "OS_StrHowClosedMatch", "(", "const", "char", "*", "str1", ",", "const", "char", "*", "str2", ")", "{", "size_t", "count", "=", "0", ";", "/*", "They", "don't", "match", "if", "any", "of", "them", "is", "null", "*/", "if", "(", "!", "str1", "||", "!", "str2", ")", "{", "return", "(", "0", ")", ";", "}", "do", "{", "if", "(", "str1", "[", "count", "]", "!=", "str2", "[", "count", "]", ")", "{", "break;", "}", "count", "++", ";", "}", "while", "(", "(", "str1", "[", "count", "]", "!=", "'\\\\0'", ")", "&&", "(", "str2", "[", "count", "]", "!=", "'\\\\0'", ")", ")", ";", "return", "(", "count", ")", ";", "}\"" ]
OS_StrHowClosedMatch
ossec/ossec-hids
single_line
valid
9,468
78,783
[ "Convert", "Eventinfo", "to", "json" ]
[ "'char", "*", "Eventinfo_to_jsonstr", "(", "const", "Eventinfo", "*", "lf", ")", "{", "cJSON", "*", "root", ";", "cJSON", "*", "rule", ";", "cJSON", "*", "file_diff", ";", "char", "*", "out", ";", "int", "i", ";", "extern", "long", "int", "__crt_ftell", ";", "root", "=", "cJSON_CreateObject", "()", ";", "cJSON_AddItemToObject", "(", "root", ",", "\"rule\"", ",", "rule", "=", "cJSON_CreateObject", "()", ")", ";", "if", "(", "lf", "->", "time", ")", "{", "char", "alert_id", "[", "23", "]", ";", "double", "timestamp_ms", ";", "timestamp_ms", "=", "(", "(", "double", ")", "lf", "->", "time", ")", "*", "1000", ";", "alert_id", "[", "22", "]", "=", "\\'\\\\0\\'", ";", "if", "(", "(", "snprintf", "(", "alert_id", ",", "22", ",", "\"%ld.%ld\"", ",", "(", "long", "int", ")", "lf", "->", "time", ",", "__crt_ftell", ")", ")", "<", "0", ")", "{", "merror", "(", "\"snprintf", "failed\"", ")", ";", "}", "cJSON_AddStringToObject", "(", "root", ",", "\"id\"", ",", "alert_id", ")", ";", "cJSON_AddNumberToObject", "(", "root", ",", "\"TimeStamp\"", ",", "timestamp_ms", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", ")", "{", "if", "(", "lf", "->", "generated_rule", "->", "level", ")", "{", "cJSON_AddNumberToObject", "(", "rule", ",", "\"level\"", ",", "lf", "->", "generated_rule", "->", "level", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "comment", ")", "{", "cJSON_AddStringToObject", "(", "rule", ",", "\"comment\"", ",", "lf", "->", "generated_rule", "->", "comment", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "sigid", ")", "{", "cJSON_AddNumberToObject", "(", "rule", ",", "\"sidid\"", ",", "lf", "->", "generated_rule", "->", "sigid", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "cve", ")", "{", "cJSON_AddStringToObject", "(", "rule", ",", "\"cve\"", ",", "lf", "->", "generated_rule", "->", "cve", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "info", ")", "{", "cJSON_AddStringToObject", "(", "rule", ",", "\"info\"", ",", "lf", "->", "generated_rule", "->", "info", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "frequency", ")", "{", "cJSON_AddNumberToObject", "(", "rule", ",", "\"frequency\"", ",", "lf", "->", "generated_rule", "->", "frequency", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "firedtimes", ")", "{", "cJSON_AddNumberToObject", "(", "rule", ",", "\"firedtimes\"", ",", "lf", "->", "generated_rule", "->", "firedtimes", ")", ";", "}", "}", "if", "(", "lf", "->", "decoder_info", "->", "name", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"decoder\"", ",", "lf", "->", "decoder_info", "->", "name", ")", ";", "}", "if", "(", "lf", "->", "decoder_info", "->", "parent", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"decoder_parent\"", ",", "lf", "->", "decoder_info", "->", "parent", ")", ";", "}", "if", "(", "lf", "->", "action", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"action\"", ",", "lf", "->", "action", ")", ";", "}", "if", "(", "lf", "->", "protocol", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"protocol\"", ",", "lf", "->", "protocol", ")", ";", "}", "if", "(", "lf", "->", "srcip", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"srcip\"", ",", "lf", "->", "srcip", ")", ";", "}", "#", "ifdef", "LIBGEOIP_ENABLED", "if", "(", "lf", "->", "srcgeoip", "&&", "Config", ".", "geoip_jsonout", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"srcgeoip\"", ",", "lf", "->", "srcgeoip", ")", ";", "}", "#", "endif", "if", "(", "lf", "->", "srcport", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"srcport\"", ",", "lf", "->", "srcport", ")", ";", "}", "if", "(", "lf", "->", "srcuser", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"srcuser\"", ",", "lf", "->", "srcuser", ")", ";", "}", "if", "(", "lf", "->", "dstip", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"dstip\"", ",", "lf", "->", "dstip", ")", ";", "}", "#", "ifdef", "LIBGEOIP_ENABLED", "if", "(", "lf", "->", "dstgeoip", "&&", "Config", ".", "geoip_jsonout", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"dstgeoip\"", ",", "lf", "->", "dstgeoip", ")", ";", "}", "#", "endif", "if", "(", "lf", "->", "dstport", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"dstport\"", ",", "lf", "->", "dstport", ")", ";", "}", "if", "(", "lf", "->", "dstuser", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"dstuser\"", ",", "lf", "->", "dstuser", ")", ";", "}", "if", "(", "lf", "->", "location", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"location\"", ",", "lf", "->", "location", ")", ";", "}", "if", "(", "lf", "->", "full_log", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"full_log\"", ",", "lf", "->", "full_log", ")", ";", "}", "if", "(", "lf", "->", "generated_rule", "->", "last_events", "&&", "lf", "->", "generated_rule", "->", "last_events", "[", "1", "]", "&&", "lf", "->", "generated_rule", "->", "last_events", "[", "1", "]", "[", "0", "]", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"previous_output\"", ",", "lf", "->", "generated_rule", "->", "last_events", "[", "1", "]", ")", ";", "}", "if", "(", "lf", "->", "filename", ")", "{", "file_diff", "=", "cJSON_CreateObject", "()", ";", "cJSON_AddItemToObject", "(", "root", ",", "\"SyscheckFile\"", ",", "file_diff", ")", ";", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"path\"", ",", "lf", "->", "filename", ")", ";", "if", "(", "lf", "->", "md5_before", "&&", "lf", "->", "md5_after", "&&", "strcmp", "(", "lf", "->", "md5_before", ",", "lf", "->", "md5_after", ")", "!=", "0", ")", "{", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"md5_before\"", ",", "lf", "->", "md5_before", ")", ";", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"md5_after\"", ",", "lf", "->", "md5_after", ")", ";", "}", "if", "(", "lf", "->", "sha1_before", "&&", "lf", "->", "sha1_after", "&&", "strcmp", "(", "lf", "->", "sha1_before", ",", "lf", "->", "sha1_after", ")", "!=", "0", ")", "{", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"sha1_before\"", ",", "lf", "->", "sha1_before", ")", ";", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"sha1_after\"", ",", "lf", "->", "sha1_after", ")", ";", "}", "if", "(", "lf", "->", "owner_before", "&&", "lf", "->", "owner_after", "&&", "strcmp", "(", "lf", "->", "owner_before", ",", "lf", "->", "owner_after", ")", "!=", "0", ")", "{", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"owner_before\"", ",", "lf", "->", "owner_before", ")", ";", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"owner_after\"", ",", "lf", "->", "owner_after", ")", ";", "}", "if", "(", "lf", "->", "gowner_before", "&&", "lf", "->", "gowner_after", "&&", "strcmp", "(", "lf", "->", "gowner_before", ",", "lf", "->", "gowner_after", ")", "!=", "0", ")", "{", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"gowner_before\"", ",", "lf", "->", "gowner_before", ")", ";", "cJSON_AddStringToObject", "(", "file_diff", ",", "\"gowner_after\"", ",", "lf", "->", "gowner_after", ")", ";", "}", "if", "(", "lf", "->", "perm_before", "&&", "lf", "->", "perm_after", "&&", "(", "lf", "->", "perm_before", "!=", "lf", "->", "perm_after", ")", ")", "{", "cJSON_AddNumberToObject", "(", "file_diff", ",", "\"perm_before\"", ",", "lf", "->", "perm_before", ")", ";", "cJSON_AddNumberToObject", "(", "file_diff", ",", "\"perm_after\"", ",", "lf", "->", "perm_after", ")", ";", "}", "}", "if", "(", "lf", "->", "hostname", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"hostname\"", ",", "lf", "->", "hostname", ")", ";", "}", "if", "(", "lf", "->", "program_name", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"program_name\"", ",", "lf", "->", "program_name", ")", ";", "}", "if", "(", "lf", "->", "status", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"status\"", ",", "lf", "->", "status", ")", ";", "}", "if", "(", "lf", "->", "command", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"command\"", ",", "lf", "->", "command", ")", ";", "if", "(", "lf", "->", "url", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"url\"", ",", "lf", "->", "url", ")", ";", "}", "if", "(", "lf", "->", "data", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"data\"", ",", "lf", "->", "data", ")", ";", "}", "if", "(", "lf", "->", "systemname", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"systemname\"", ",", "lf", "->", "systemname", ")", ";", "}", "//", "DecoderInfo", "if", "(", "lf", "->", "decoder_info", ")", "{", "cJSON", "*", "decoder", ";", "//", "Dynamic", "fields", "if", "(", "lf", "->", "decoder_info", "->", "fields", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "Config", ".", "decoder_order_size", ";", "i", "++", ")", "{", "if", "(", "lf", "->", "decoder_info", "->", "fields", "[", "i", "]", "&&", "lf", "->", "fields", "[", "i", "]", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "lf", "->", "decoder_info", "->", "fields", "[", "i", "]", ",", "lf", "->", "fields", "[", "i", "]", ")", ";", "}", "}", "}", "cJSON_AddItemToObject", "(", "root", ",", "\"decoder_desc\"", ",", "decoder", "=", "cJSON_CreateObject", "()", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "fts", ")", "cJSON_AddNumberToObject", "(", "decoder", ",", "\"fts\"", ",", "lf", "->", "decoder_info", "->", "fts", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "accumulate", ")", "cJSON_AddNumberToObject", "(", "decoder", ",", "\"accumulate\"", ",", "lf", "->", "decoder_info", "->", "accumulate", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "parent", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"parent\"", ",", "lf", "->", "decoder_info", "->", "parent", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "name", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"name\"", ",", "lf", "->", "decoder_info", "->", "name", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "ftscomment", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"ftscomment\"", ",", "lf", "->", "decoder_info", "->", "ftscomment", ")", ";", "}", "W_ParseJSON", "(", "root", ",", "lf", ")", ";", "out", "=", "cJSON_PrintUnformatted", "(", "root", ")", ";", "cJSON_Delete", "(", "root", ")", ";", "return", "out", ";", "}'" ]
Eventinfo_to_jsonstr
ossec/ossec-hids
single_line
valid
9,469
78,784
[ "Convert", "Archiveinfo", "to", "json" ]
[ "'char", "*", "Archiveinfo_to_jsonstr", "(", "const", "Eventinfo", "*", "lf", ")", "{", "cJSON", "*", "root", ";", "char", "*", "out", ";", "int", "i", ";", "root", "=", "cJSON_CreateObject", "()", ";", "if", "(", "lf", "->", "program_name", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"program_name\"", ",", "lf", "->", "program_name", ")", ";", "if", "(", "lf", "->", "log", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"log\"", ",", "lf", "->", "log", ")", ";", "if", "(", "lf", "->", "srcip", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"srcip\"", ",", "lf", "->", "srcip", ")", ";", "if", "(", "lf", "->", "dstip", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"dstip\"", ",", "lf", "->", "dstip", ")", ";", "if", "(", "lf", "->", "srcport", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"srcport\"", ",", "lf", "->", "srcport", ")", ";", "if", "(", "lf", "->", "dstport", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"dstport\"", ",", "lf", "->", "dstport", ")", ";", "if", "(", "lf", "->", "protocol", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"protocol\"", ",", "lf", "->", "protocol", ")", ";", "if", "(", "lf", "->", "action", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"action\"", ",", "lf", "->", "action", ")", ";", "if", "(", "lf", "->", "srcuser", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"srcuser\"", ",", "lf", "->", "srcuser", ")", ";", "if", "(", "lf", "->", "dstuser", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"dstuser\"", ",", "lf", "->", "dstuser", ")", ";", "if", "(", "lf", "->", "id", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"id\"", ",", "lf", "->", "id", ")", ";", "if", "(", "lf", "->", "status", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"status\"", ",", "lf", "->", "status", ")", ";", "if", "(", "lf", "->", "command", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"command\"", ",", "lf", "->", "command", ")", ";", "if", "(", "lf", "->", "url", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"url\"", ",", "lf", "->", "url", ")", ";", "if", "(", "lf", "->", "data", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"data\"", ",", "lf", "->", "data", ")", ";", "if", "(", "lf", "->", "systemname", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"systemname\"", ",", "lf", "->", "systemname", ")", ";", "if", "(", "lf", "->", "filename", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"filename\"", ",", "lf", "->", "filename", ")", ";", "if", "(", "lf", "->", "md5_before", "&&", "lf", "->", "md5_after", "&&", "(", "strcmp", "(", "lf", "->", "md5_before", ",", "lf", "->", "md5_after", ")", "!=", "0", ")", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"md5_before\"", ",", "lf", "->", "md5_before", ")", ";", "cJSON_AddStringToObject", "(", "root", ",", "\"md5_after\"", ",", "lf", "->", "md5_after", ")", ";", "}", "if", "(", "lf", "->", "sha1_before", "&&", "lf", "->", "sha1_after", "&&", "!", "(", "strcmp", "(", "lf", "->", "sha1_before", ",", "lf", "->", "sha1_after", ")", "!=", "0", ")", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"sha1_before\"", ",", "lf", "->", "sha1_before", ")", ";", "cJSON_AddStringToObject", "(", "root", ",", "\"sha1_after\"", ",", "lf", "->", "sha1_after", ")", ";", "}", "if", "(", "lf", "->", "owner_before", "&&", "lf", "->", "owner_after", "&&", "!", "(", "strcmp", "(", "lf", "->", "owner_before", ",", "lf", "->", "owner_after", ")", "!=", "0", ")", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"owner_before\"", ",", "lf", "->", "owner_before", ")", ";", "cJSON_AddStringToObject", "(", "root", ",", "\"owner_after\"", ",", "lf", "->", "owner_after", ")", ";", "}", "if", "(", "lf", "->", "gowner_before", "&&", "lf", "->", "gowner_after", "&&", "!", "(", "strcmp", "(", "lf", "->", "gowner_before", ",", "lf", "->", "gowner_after", ")", "!=", "0", ")", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "\"gowner_before\"", ",", "lf", "->", "gowner_before", ")", ";", "cJSON_AddStringToObject", "(", "root", ",", "\"gowner_after\"", ",", "lf", "->", "gowner_after", ")", ";", "}", "if", "(", "lf", "->", "perm_before", "&&", "lf", "->", "perm_after", "&&", "lf", "->", "perm_before", "!=", "lf", "->", "perm_after", ")", "{", "cJSON_AddNumberToObject", "(", "root", ",", "\"perm_before\"", ",", "lf", "->", "perm_before", ")", ";", "cJSON_AddNumberToObject", "(", "root", ",", "\"perm_after\"", ",", "lf", "->", "perm_after", ")", ";", "}", "}", "//", "RuleInfo", "if", "(", "lf", "->", "generated_rule", ")", "{", "cJSON", "*", "rule", ";", "cJSON_AddItemToObject", "(", "root", ",", "\"rule\"", ",", "rule", "=", "cJSON_CreateObject", "()", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "level", ")", "cJSON_AddNumberToObject", "(", "rule", ",", "\"level\"", ",", "lf", "->", "generated_rule", "->", "level", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "comment", ")", "cJSON_AddStringToObject", "(", "rule", ",", "\"comment\"", ",", "lf", "->", "generated_rule", "->", "comment", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "sigid", ")", "cJSON_AddNumberToObject", "(", "rule", ",", "\"sidid\"", ",", "lf", "->", "generated_rule", "->", "sigid", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "cve", ")", "cJSON_AddStringToObject", "(", "rule", ",", "\"cve\"", ",", "lf", "->", "generated_rule", "->", "cve", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "info", ")", "cJSON_AddStringToObject", "(", "rule", ",", "\"info\"", ",", "lf", "->", "generated_rule", "->", "info", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "frequency", ")", "cJSON_AddNumberToObject", "(", "rule", ",", "\"frequency\"", ",", "lf", "->", "generated_rule", "->", "frequency", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "firedtimes", ")", "cJSON_AddNumberToObject", "(", "rule", ",", "\"firedtimes\"", ",", "lf", "->", "generated_rule", "->", "firedtimes", ")", ";", "if", "(", "lf", "->", "generated_rule", "->", "group", ")", "{", "W_JSON_ParseGroups", "(", "root", ",", "lf", ",", "1", ")", ";", "}", "if", "(", "lf", "->", "full_log", "&&", "W_isRootcheck", "(", "root", ",", "1", ")", ")", "{", "W_JSON_ParseRootcheck", "(", "root", ",", "lf", ",", "1", ")", ";", "}", "}", "//", "DecoderInfo", "if", "(", "lf", "->", "decoder_info", ")", "{", "cJSON", "*", "decoder", ";", "//", "Dynamic", "fields", "if", "(", "lf", "->", "decoder_info", "->", "fields", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "Config", ".", "decoder_order_size", ";", "i", "++", ")", "{", "if", "(", "lf", "->", "decoder_info", "->", "fields", "[", "i", "]", "&&", "lf", "->", "fields", "[", "i", "]", ")", "{", "cJSON_AddStringToObject", "(", "root", ",", "lf", "->", "decoder_info", "->", "fields", "[", "i", "]", ",", "lf", "->", "fields", "[", "i", "]", ")", ";", "}", "}", "}", "cJSON_AddItemToObject", "(", "root", ",", "\"decoder\"", ",", "decoder", "=", "cJSON_CreateObject", "()", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "fts", ")", "cJSON_AddNumberToObject", "(", "decoder", ",", "\"fts\"", ",", "lf", "->", "decoder_info", "->", "fts", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "accumulate", ")", "cJSON_AddNumberToObject", "(", "decoder", ",", "\"accumulate\"", ",", "lf", "->", "decoder_info", "->", "accumulate", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "parent", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"parent\"", ",", "lf", "->", "decoder_info", "->", "parent", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "name", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"name\"", ",", "lf", "->", "decoder_info", "->", "name", ")", ";", "if", "(", "lf", "->", "decoder_info", "->", "ftscomment", ")", "cJSON_AddStringToObject", "(", "decoder", ",", "\"ftscomment\"", ",", "lf", "->", "decoder_info", "->", "ftscomment", ")", ";", "}", "if", "(", "lf", "->", "full_log", ")", "cJSON_AddStringToObject", "(", "root", ",", "\"full_log\"", ",", "lf", "->", "full_log", ")", ";", "if", "(", "lf", "->", "year", "&&", "strnlen", "(", "lf", "->", "mon", ",", "4", ")", "&&", "lf", "->", "day", "&&", "strnlen", "(", "lf", "->", "hour", ",", "10", ")", ")", "W_JSON_ParseTimestamp", "(", "root", ",", "lf", ")", ";", "if", "(", "lf", "->", "hostname", ")", "{", "W_JSON_ParseHostname", "(", "root", ",", "lf", "->", "hostname", ")", ";", "W_JSON_ParseAgentIP", "(", "root", ",", "lf", ")", ";", "}", "if", "(", "lf", "->", "location", ")", "W_JSON_ParseLocation", "(", "root", ",", "lf", ",", "0", ")", ";", "out", "=", "cJSON_PrintUnformatted", "(", "root", ")", ";", "cJSON_Delete", "(", "root", ")", ";", "return", "out", ";", "}'" ]
Archiveinfo_to_jsonstr
ossec/ossec-hids
single_line
valid
9,470
78,825
[ "Produce", "a", "warning", "for", "each", "option", "previously", "buffered" ]
[ "'void", "print_ignored_options", "(", "void", ")", "{", "while", "(", "!", "ignored_options", ".", "is_empty", "()", ")", "{", "const", "char", "*", "opt", ";", "opt", "=", "ignored_options", ".", "pop", "()", ";", "warning_at", "(", "UNKNOWN_LOCATION", ",", "0", ",", "\"unrecognized", "command", "line", "option", "%qs\"", ",", "opt", ")", ";", "}", "}'" ]
print_ignored_options
KevinOConnor/klipper
single_line
valid
9,471
78,826
[ "Initialize", "global", "optionsrelated", "settings", "at", "startup" ]
[ "'void", "init_options_once", "(", "void", ")", "{", "/*", "Perform", "language-specific", "options", "initialization.", "*/", "initial_lang_mask", "=", "lang_hooks", ".", "option_lang_mask", "()", ";", "lang_hooks", ".", "initialize_diagnostics", "(", "global_dc", ")", ";", "/*", "???", "Ideally,", "we", "should", "do", "this", "earlier", "and", "the", "FEs", "will", "override", "it", "if", "desired", "(none", "do", "it", "so", "far).", "However,", "the", "way", "the", "FEs", "construct", "their", "pretty-printers", "means", "that", "all", "previous", "settings", "are", "overriden.", "*/", "diagnostic_color_init", "(", "global_dc", ")", ";", "}'" ]
init_options_once
KevinOConnor/klipper
single_line
valid
9,472
78,827
[ "Return", "a", "malloced", "slashseparated", "list", "of", "languages", "in", "MASK" ]
[ "'char", "*", "write_langs", "(", "unsigned", "int", "mask", ")", "{", "unsigned", "int", "n", "=", "0", ",", "<type", "ref=\"prev\"/>", "len", "=", "0", ";", "const", "char", "*", "lang_name", ";", "char", "*", "result", ";", "for", "(", "n", "=", "0", ";", "(", "lang_name", "=", "lang_names", "[", "n", "]", ")", "!=", "0", ";", "n", "++", ")", "if", "(", "mask", "&", "(", "1U", "<<", "n", ")", ")", "len", "+=", "strlen", "(", "lang_name", ")", "+", "1", ";", "result", "=", "XNEWVEC", "(", "char", ",", "len", ")", ";", "len", "=", "0", ";", "for", "(", "n", "=", "0", ";", "(", "lang_name", "=", "lang_names", "[", "n", "]", ")", "!=", "0", ";", "n", "++", ")", "if", "(", "mask", "&", "(", "1U", "<<", "n", ")", ")", "{", "if", "(", "len", ")", "result", "[", "len", "++", "]", "=", "\\'/\\'", ";", "strcpy", "(", "result", "+", "len", ",", "lang_name", ")", ";", "len", "+=", "strlen", "(", "lang_name", ")", ";", "}", "result", "[", "len", "]", "=", "0", ";", "return", "result", ";", "}'" ]
write_langs
KevinOConnor/klipper
single_line
valid
9,473
78,895
[ "Free", "the", "saved", "stab", "strings" ]
[ "'static", "void", "free_saved_stabs", "(", "void", ")", "{", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "SAVE_STABS_COUNT", ";", "i", "++", ")", "{", "if", "(", "saved_stabs", "[", "i", "]", ".", "string", "!=", "NULL", ")", "{", "free", "(", "saved_stabs", "[", "i", "]", ".", "string", ")", ";", "saved_stabs", "[", "i", "]", ".", "string", "=", "NULL", ";", "}", "}", "saved_stabs_index", "=", "0", ";", "}'" ]
free_saved_stabs
KevinOConnor/klipper
single_line
valid
9,474
78,896
[ "Provide", "context", "for", "an", "error" ]
[ "'static", "void", "stab_context", "(", "void", ")", "{", "int", "i", ";", "fprintf", "(", "stderr", ",", "_", "(", "\"Last", "stabs", "entries", "before", "error:\\\"", ")", ")", ";", "fprintf", "(", "stderr", ",", "\"n_type", "n_desc", "n_value", "string\\\"", ")", ";", "i", "=", "saved_stabs_index", ";", "do", "{", "struct", "saved_stab", "*", "stabp", ";", "stabp", "=", "saved_stabs", "+", "i", ";", "if", "(", "stabp", "->", "string", "!=", "NULL", ")", "{", "const", "char", "*", "s", ";", "s", "=", "bfd_get_stab_name", "(", "stabp", "->", "type", ")", ";", "if", "(", "s", "!=", "NULL", ")", "fprintf", "(", "stderr", ",", "\"%-6s\"", ",", "s", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "stabp", "->", "type", "==", "0", ")", "fprintf", "(", "stderr", ",", "\"HdrSym\"", ")", ";", "else", "fprintf", "(", "stderr", ",", "\"%-6d\"", ",", "stabp", "->", "type", ")", ";", "fprintf", "(", "stderr", ",", "\"", "%-6d", "\"", ",", "stabp", "->", "desc", ")", ";", "fprintf_vma", "(", "stderr", ",", "stabp", "->", "value", ")", ";", "if", "(", "stabp", "->", "type", "!=", "0", ")", "fprintf", "(", "stderr", ",", "\"", "%s\"", ",", "stabp", "->", "string", ")", ";", "fprintf", "(", "stderr", ",", "\"\\\"", ")", ";", "}", "i", "=", "(", "i", "+", "1", ")", "%", "SAVE_STABS_COUNT", ";", "}", "while", "(", "i", "!=", "saved_stabs_index", ")", ";", "}'" ]
stab_context
KevinOConnor/klipper
single_line
valid
9,475
78,898
[ "the", "stable", "insertion", "sort" ]
[ "'void", "ngx_queue_sort", "(", "ngx_queue_t", "*", "queue", ",", "ngx_int_t", "(", "*", "cmp", ")", "(", "const", "ngx_queue_t", "*", ",", "const", "ngx_queue_t", "*", ")", ")", "{", "ngx_queue_t", "*", "q", ",", "<type", "ref=\"prev\">", "*", "prev", ",", "<type", "ref=\"prev\">", "*", "next", ";", "q", "=", "ngx_queue_head", "(", "queue", ")", ";", "if", "(", "q", "==", "ngx_queue_last", "(", "queue", ")", ")", "{", "return", ";", "}", "for", "(", "q", "=", "ngx_queue_next", "(", "q", ")", ";", "q", "!=", "ngx_queue_sentinel", "(", "queue", ")", ";", "q", "=", "next", ")", "{", "prev", "=", "ngx_queue_prev", "(", "q", ")", ";", "next", "=", "ngx_queue_next", "(", "q", ")", ";", "ngx_queue_remove", "(", "q", ")", ";", "do", "{", "if", "(", "cmp", "(", "prev", ",", "q", ")", "<=", "0", ")", "{", "break;", "}", "prev", "=", "ngx_queue_prev", "(", "prev", ")", ";", "}", "while", "(", "prev", "!=", "ngx_queue_sentinel", "(", "queue", ")", ")", ";", "ngx_queue_insert_after", "(", "prev", ",", "q", ")", ";", "}", "}'" ]
ngx_queue_sort
ZigzagAK/ngx_zookeeper_lua
single_line
valid
9,476
78,922
[ "Log", "statistical", "informantion", "about", "the", "use", "of", "this", "module" ]
[ "'void", "_gcry_rndjent_dump_stats", "(", "void", ")", "{", "/*", "In", "theory", "we", "would", "need", "to", "lock", "the", "stats", "here.", "However", "this", "*", "function", "is", "usually", "called", "during", "cleanup", "and", "then", "we", "_might_", "run", "*", "into", "problems.", "*/", "#", "ifdef", "USE_JENT", "if", "(", "is_rng_available", "()", ")", "{", "log_info", "(", "\"rndjent", "stat:", "collector=%p", "calls=%lu", "bytes=%lu\\\"", ",", "jent_rng_collector", ",", "jent_rng_totalcalls", ",", "jent_rng_totalbytes", ")", ";", "}", "#", "endif", "/*USE_JENT*/", "}'" ]
_gcry_rndjent_dump_stats
LLNL/STAT
single_line
valid
9,477
78,923
[ "read", "an", "X", "event" ]
[ "'void", "ReadXServer", "(", "void", ")", "{", "static", "XEvent", "event", ";", "int", "keypress", ";", "Item", "*", "item", ",", "<type", "ref=\"prev\">", "*", "old_item", ";", "KeySym", "ks", ";", "char", "*", "sp", ",", "<type", "ref=\"prev\">", "*", "dp", ";", "static", "unsigned", "char", "buf", "[", "10", "]", ";", "/*", "unsigned", "for", "international", "*/", "static", "int", "n", ";", "while", "(", "FEventsQueued", "(", "dpy", ",", "QueuedAfterReading", ")", ")", "{", "FNextEvent", "(", "dpy", ",", "&", "event", ")", ";", "if", "(", "event", ".", "xany", ".", "window", "==", "CF", ".", "frame", ")", "{", "switch", "(", "event", ".", "type", ")", "{", "case", "ClientMessage", ":", "{", "if", "(", "event", ".", "xclient", ".", "format", "==", "32", "&&", "event", ".", "xclient", ".", "data", ".", "l", "[", "0", "]", "==", "wm_del_win", ")", "{", "exit", "(", "0", ")", ";", "}", "}", "break;", "case", "ConfigureNotify", ":", "/*", "has", "window", "be", "reconfigured", "*/", "{", "XEvent", "tmpe", ";", "fev_sanitise_configure_notify", "(", "&", "event", ".", "xconfigure", ")", ";", "while", "(", "FCheckTypedWindowEvent", "(", "dpy", ",", "CF", ".", "frame", ",", "ConfigureNotify", ",", "&", "tmpe", ")", ")", "{", "fev_sanitise_configure_notify", "(", "&", "tmpe", ".", "xconfigure", ")", ";", "if", "(", "!", "tmpe", ".", "xconfigure", ".", "send_event", ")", "continue;", "event", ".", "xconfigure", ".", "x", "=", "tmpe", ".", "xconfigure", ".", "x", ";", "event", ".", "xconfigure", ".", "y", "=", "tmpe", ".", "xconfigure", ".", "y", ";", "event", ".", "xconfigure", ".", "send_event", "=", "True", ";", "}", "if", "(", "CF", ".", "max_width", "!=", "event", ".", "xconfigure", ".", "width", "||", "CF", ".", "total_height", "!=", "event", ".", "xconfigure", ".", "height", ")", "{", "/*", "adjust", "yourself...", "do", "noting", "*/", "ResizeFrame", "()", ";", "CF", ".", "max_width", "=", "event", ".", "xconfigure", ".", "width", ";", "CF", ".", "total_height", "=", "event", ".", "xconfigure", ".", "height", ";", "UpdateRootTransapency", "(", "False", ",", "True", ")", ";", "if", "(", "!", "CSET_IS_TRANSPARENT", "(", "colorset", ")", ")", "{", "RedrawFrame", "(", "NULL", ")", ";", "}", "}", "<if", "type=\"elseif\">", "else", "if", "(", "event", ".", "xconfigure", ".", "send_event", ")", "{", "UpdateRootTransapency", "(", "False", ",", "True", ")", ";", "}", "}", "break;", "#", "if", "0", "case", "SelectionClear:", "selection_clear", "();", "break;", "case", "SelectionNotify:", "selection_paste", "();", "break;", "case", "SelectionRequest:", "selection_send", "();", "break;", "#", "endif", "case", "Expose", ":", "{", "int", "ex", "=", "event", ".", "xexpose", ".", "x", ";", "int", "ey", "=", "event", ".", "xexpose", ".", "y", ";", "int", "ex2", "=", "event", ".", "xexpose", ".", "x", "+", "event", ".", "xexpose", ".", "width", ";", "int", "ey2", "=", "event", ".", "xexpose", ".", "y", "+", "event", ".", "xexpose", ".", "height", ";", "while", "(", "FCheckTypedWindowEvent", "(", "dpy", ",", "CF", ".", "frame", ",", "Expose", ",", "&", "event", ")", ")", "{", "ex", "=", "min", "(", "ex", ",", "event", ".", "xexpose", ".", "x", ")", ";", "ey", "=", "min", "(", "ey", ",", "event", ".", "xexpose", ".", "y", ")", ";", "ex2", "=", "max", "(", "ex2", ",", "event", ".", "xexpose", ".", "x", "+", "event", ".", "xexpose", ".", "width", ")", ";", "ey2", "=", "max", "(", "ey2", ",", "event", ".", "xexpose", ".", "y", "+", "event", ".", "xexpose", ".", "height", ")", ";", "}", "event", ".", "xexpose", ".", "x", "=", "ex", ";", "event", ".", "xexpose", ".", "y", "=", "ey", ";", "event", ".", "xexpose", ".", "width", "=", "ex2", "-", "ex", ";", "event", ".", "xexpose", ".", "height", "=", "ey2", "-", "ey", ";", "RedrawFrame", "(", "&", "event", ")", ";", "if", "(", "CF", ".", "grab_server", "&&", "!", "CF", ".", "server_grabbed", ")", "{", "if", "(", "GrabSuccess", "==", "XGrabPointer", "(", "dpy", ",", "CF", ".", "frame", ",", "True", ",", "0", ",", "GrabModeAsync", ",", "GrabModeAsync", ",", "None", ",", "None", ",", "CurrentTime", ")", ")", "CF", ".", "server_grabbed", "=", "1", ";", "}", "}", "break;", "case", "VisibilityNotify", ":", "if", "(", "CF", ".", "server_grabbed", "&&", "event", ".", "xvisibility", ".", "state", "!=", "VisibilityUnobscured", ")", "{", "/*", "raise", "our", "window", "to", "the", "top", "*/", "XRaiseWindow", "(", "dpy", ",", "CF", ".", "frame", ")", ";", "XSync", "(", "dpy", ",", "0", ")", ";", "}", "break;", "case", "KeyPress", ":", "/*", "we", "do", "text", "input", "here", "*/", "n", "=", "XLookupString", "(", "&", "event", ".", "xkey", ",", "(", "char", "*", ")", "buf", ",", "sizeof", "(", "buf", ")", ",", "&", "ks", ",", "NULL", ")", ";", "keypress", "=", "buf", "[", "0", "]", ";", "myfprintf", "(", "(", "stderr", ",", "\"Keypress", "[%s]\\\"", ",", "buf", ")", ")", ";", "if", "(", "n", "==", "0", ")", "{", "/*", "not", "a", "regular", "key,", "translate", "it", "into", "one", "*/", "switch", "(", "ks", ")", "{", "case", "XK_Home", ":", "case", "XK_Begin", ":", "buf", "[", "0", "]", "=", "\\'\\\\001\\'", ";", "/*", "^A", "*/", "break;", "case", "XK_End", ":", "buf", "[", "0", "]", "=", "\\'\\\\005\\'", ";", "/*", "^E", "*/", "break;", "case", "XK_Left", ":", "buf", "[", "0", "]", "=", "\\'\\\\002\\'", ";", "/*", "^B", "*/", "break;", "case", "XK_Right", ":", "buf", "[", "0", "]", "=", "\\'\\\\006\\'", ";", "/*", "^F", "*/", "break;", "case", "XK_Up", ":", "buf", "[", "0", "]", "=", "\\'\\\\020\\'", ";", "/*", "^P", "*/", "break;", "case", "XK_Down", ":", "buf", "[", "0", "]", "=", "\\'\\\\016\\'", ";", "/*", "^N", "*/", "break;", "default:", "if", "(", "ks", ">=", "XK_F1", "&&", "ks", "<=", "XK_F35", ")", "{", "buf", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "keypress", "=", "257", "+", "ks", "-", "XK_F1", ";", "}", "else", "goto", "no_redraw", ";", "/*", "no", "action", "for", "this", "event", "*/", "}", "}", "switch", "(", "ks", ")", "{", "/*", "regular", "key,", "may", "need", "adjustment", "*/", "case", "XK_Tab", ":", "#", "ifdef", "XK_XKB_KEYS", "case", "XK_ISO_Left_Tab", ":", "#", "endif", "if", "(", "event", ".", "xkey", ".", "state", "&", "ShiftMask", ")", "{", "/*", "shifted", "key", "*/", "buf", "[", "0", "]", "=", "\\'\\\\020\\'", ";", "/*", "chg", "shift", "tab", "to", "^P", "*/", "}", "break;", "case", "\\'>\\'", ":", "if", "(", "event", ".", "xkey", ".", "state", "&", "Mod1Mask", ")", "{", "/*", "Meta,", "shift", ">", "*/", "process_history", "(", "1", ")", ";", "goto", "redraw_newcursor", ";", "}", "break;", "case", "\\'<\\'", ":", "if", "(", "event", ".", "xkey", ".", "state", "&", "Mod1Mask", ")", "{", "/*", "Meta,", "shift", "<", "*/", "process_history", "(", "-", "1", ")", ";", "goto", "redraw_newcursor", ";", "}", "break;", "}", "if", "(", "!", "CF", ".", "cur_input", ")", "{", "/*", "no", "text", "input", "fields", "*/", "for", "(", "item", "=", "root_item_ptr", ";", "item", "!=", "0", ";", "item", "=", "item", "->", "header", ".", "next", ")", "{", "/*", "all", "items", "*/", "if", "(", "item", "->", "type", "==", "I_BUTTON", "&&", "item", "->", "button", ".", "keypress", "==", "keypress", ")", "{", "RedrawItem", "(", "item", ",", "1", ",", "NULL", ")", ";", "usleep", "(", "MICRO_S_FOR_10MS", ")", ";", "RedrawItem", "(", "item", ",", "0", ",", "NULL", ")", ";", "DoCommand", "(", "item", ")", ";", "goto", "no_redraw", ";", "}", "}", "break;", "}", "<if", "type=\"elseif\">", "else", "if", "(", "CF", ".", "cur_input", "==", "CF", ".", "cur_input", "->", "input", ".", "next_input", ")", "{", "/*", "1", "ip", "field", "*/", "switch", "(", "buf", "[", "0", "]", ")", "{", "case", "\\'\\\\020\\'", ":", "/*", "^P", "previous", "field", "*/", "process_history", "(", "-", "1", ")", ";", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\016\\'", ":", "/*", "^N", "next", "field", "*/", "process_history", "(", "1", ")", ";", "goto", "redraw_newcursor", ";", "break;", "}", "/*", "end", "switch", "*/", "}", "/*", "end", "one", "input", "field", "*/", "switch", "(", "buf", "[", "0", "]", ")", "{", "case", "\\'\\\\001\\'", ":", "/*", "^A", "*/", "CF", ".", "rel_cursor", "=", "0", ";", "CF", ".", "abs_cursor", "=", "0", ";", "CF", ".", "cur_input", "->", "input", ".", "left", "=", "0", ";", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\005\\'", ":", "/*", "^E", "*/", "CF", ".", "rel_cursor", "=", "CF", ".", "cur_input", "->", "input", ".", "n", ";", "if", "(", "(", "CF", ".", "cur_input", "->", "input", ".", "left", "=", "CF", ".", "rel_cursor", "-", "CF", ".", "cur_input", "->", "input", ".", "size", ")", "<", "0", ")", "CF", ".", "cur_input", "->", "input", ".", "left", "=", "0", ";", "CF", ".", "abs_cursor", "=", "CF", ".", "rel_cursor", "-", "CF", ".", "cur_input", "->", "input", ".", "left", ";", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\002\\'", ":", "/*", "^B", "*/", "if", "(", "CF", ".", "rel_cursor", ">", "0", ")", "{", "CF", ".", "rel_cursor", "--", ";", "CF", ".", "abs_cursor", "--", ";", "if", "(", "CF", ".", "abs_cursor", "<=", "0", "&&", "CF", ".", "rel_cursor", ">", "0", ")", "{", "CF", ".", "abs_cursor", "++", ";", "CF", ".", "cur_input", "->", "input", ".", "left", "--", ";", "}", "}", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\006\\'", ":", "/*", "^F", "*/", "if", "(", "CF", ".", "rel_cursor", "<", "CF", ".", "cur_input", "->", "input", ".", "n", ")", "{", "CF", ".", "rel_cursor", "++", ";", "CF", ".", "abs_cursor", "++", ";", "if", "(", "CF", ".", "abs_cursor", ">=", "CF", ".", "cur_input", "->", "input", ".", "size", "&&", "CF", ".", "rel_cursor", "<", "CF", ".", "cur_input", "->", "input", ".", "n", ")", "{", "CF", ".", "abs_cursor", "--", ";", "CF", ".", "cur_input", "->", "input", ".", "left", "++", ";", "}", "}", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\010\\'", ":", "/*", "^H", "*/", "if", "(", "CF", ".", "rel_cursor", ">", "0", ")", "{", "sp", "=", "CF", ".", "cur_input", "->", "input", ".", "value", "+", "CF", ".", "rel_cursor", ";", "dp", "=", "sp", "-", "1", ";", "for", "(", ";", "*", "dp", "=", "*", "sp", ",", "*", "sp", "!=", "\\'\\\\0\\'", ";", "dp", "++", ",", "sp", "++", ")", ";", "CF", ".", "cur_input", "->", "input", ".", "n", "--", ";", "CF", ".", "rel_cursor", "--", ";", "if", "(", "CF", ".", "rel_cursor", "<", "CF", ".", "abs_cursor", ")", "{", "CF", ".", "abs_cursor", "--", ";", "if", "(", "CF", ".", "abs_cursor", "<=", "0", "&&", "CF", ".", "rel_cursor", ">", "0", ")", "{", "CF", ".", "abs_cursor", "++", ";", "CF", ".", "cur_input", "->", "input", ".", "left", "--", ";", "}", "}", "else", "CF", ".", "cur_input", "->", "input", ".", "left", "--", ";", "}", "goto", "redraw_newcursor", ";", "break;", "case", "\\'\\\\177\\'", ":", "/*", "DEL", "*/", "case", "\\'\\\\004\\'", ":", "/*", "^D", "*/", "if", "(", "CF", ".", "rel_cursor", "<", "CF", ".", "cur_input", "->", "input", ".", "n", ")", "{", "sp", "=", "CF", ".", "cur_input", "->", "input", ".", "value", "+", "CF", ".", "rel_cursor", "+", "1", ";", "dp", "=", "sp", "-", "1", ";", "for", "(", ";", "*", "dp", "=", "*", "sp", ",", "*", "sp", "!=", "\\'\\\\0\\'", ";", "dp", "++", ",", "sp", "++", ")", ";", "CF", ".", "cur_input", "->", "input", ".", "n", "--", ";", "goto", "redraw_newcursor", ";", "}", "break;", "case", "\\'\\\\013\\'", ":", "/*", "^K", "*/", "CF", ".", "cur_input", "->", "input", ".", "value", "[", "CF", ".", "rel_cursor", "]", "=", "\\'\\\\0\\'", ";", "CF", ".", "cur_input", "->", "input", ".", "n", "=", "CF", ".", "rel_cursor", ";", "goto", "redraw_newcursor", ";", "case", "\\'\\\\025\\'", ":", "/*", "^U", "*/", "CF", ".", "cur_input", "->", "input", ".", "value", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "CF", ".", "cur_input", "->", "input", ".", "n", "=", "CF", ".", "cur_input", "->", "input", ".", "left", "=", "0", ";", "CF", ".", "rel_cursor", "=", "CF", ".", "abs_cursor", "=", "0", ";", "goto", "redraw_newcursor", ";", "case", "\\'\\\\020\\'", ":", "/*", "^P", "previous", "field", "*/", "old_item", "=", "CF", ".", "cur_input", ";", "CF", ".", "cur_input", "=", "old_item", "->", "input", ".", "prev_input", ";", "/*", "new", "current", "input", "fld", "*/", "RedrawItem", "(", "old_item", ",", "1", ",", "NULL", ")", ";", "CF", ".", "rel_cursor", "=", "CF", ".", "abs_cursor", "=", "0", ";", "/*", "home", "cursor", "in", "new", "input", "field", "*/", "goto", "redraw", ";", "break;", "case", "\\'\\\\t\\'", ":", "case", "\\'\\\\'", ":", "case", "\\'\\\\015\\'", ":", "case", "\\'\\\\016\\'", ":", "/*", "LINEFEED,", "TAB,", "RETURN,", "^N,", "jump", "to", "the", "next", "field", "*/", "switch", "(", "process_tabtypes", "(", "&", "buf", "[", "0", "]", ")", ")", "{", "case", "0", ":", "goto", "no_redraw", ";", "break;", "case", "1", ":", "goto", "redraw", ";", "break;", "}", "break;", "default:", "if", "(", "(", "buf", "[", "0", "]", ">=", "\\'", "\\'", "&&", "buf", "[", "0", "]", "<", "\\'\\\\177\\'", ")", "||", "(", "buf", "[", "0", "]", ">=", "160", ")", ")", "{", "/*", "regular", "or", "intl", "char", "*/", "process_regular_char_input", "(", "&", "buf", "[", "0", "]", ")", ";", "/*", "insert", "into", "input", "field", "*/", "goto", "redraw_newcursor", ";", "}", "/*", "unrecognized", "key", "press,", "check", "for", "buttons", "*/", "for", "(", "item", "=", "root_item_ptr", ";", "item", "!=", "0", ";", "item", "=", "item", "->", "header", ".", "next", ")", "{", "/*", "all", "items", "*/", "myfprintf", "(", "(", "stderr", ",", "\"Button:", "keypress==%d\\\"", ",", "item", "->", "button", ".", "keypress", ")", ")", ";", "if", "(", "item", "->", "type", "==", "I_BUTTON", "&&", "item", "->", "button", ".", "keypress", "==", "keypress", ")", "{", "RedrawItem", "(", "item", ",", "1", ",", "NULL", ")", ";", "usleep", "(", "MICRO_S_FOR_10MS", ")", ";", "/*", ".1", "seconds", "*/", "RedrawItem", "(", "item", ",", "0", ",", "NULL", ")", ";", "DoCommand", "(", "item", ")", ";", "goto", "no_redraw", ";", "}", "}", "break;", "}", "redraw_newcursor", ":", "{", "XSetForeground", "(", "dpy", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_item_GC", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_colors", "[", "c_item_bg", "]", ")", ";", "/*", "Since", "DrawString", "is", "being", "used,", "I", "changed", "this", "to", "clear", "the", "entire", "input", "field.", "dje", "10/24/99.", "*/", "XClearArea", "(", "dpy", ",", "CF", ".", "cur_input", "->", "header", ".", "win", ",", "BOX_SPC", "+", "TEXT_SPC", "-", "1", ",", "BOX_SPC", ",", "CF", ".", "cur_input", "->", "header", ".", "size_x", "-", "(", "2", "*", "BOX_SPC", ")", "-", "2", "-", "TEXT_SPC", ",", "(", "CF", ".", "cur_input", "->", "header", ".", "size_y", "-", "1", ")", "-", "2", "*", "BOX_SPC", "+", "1", ",", "False", ")", ";", "}", "redraw", ":", "{", "int", "len", ",", "<type", "ref=\"prev\"/>", "x", ",", "<type", "ref=\"prev\"/>", "dy", ";", "len", "=", "CF", ".", "cur_input", "->", "input", ".", "n", "-", "CF", ".", "cur_input", "->", "input", ".", "left", ";", "XSetForeground", "(", "dpy", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_item_GC", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_colors", "[", "c_item_fg", "]", ")", ";", "if", "(", "len", ">", "CF", ".", "cur_input", "->", "input", ".", "size", ")", "len", "=", "CF", ".", "cur_input", "->", "input", ".", "size", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "win", "=", "CF", ".", "cur_input", "->", "header", ".", "win", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "gc", "=", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_item_GC", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "flags", ".", "has_colorset", "=", "False", ";", "if", "(", "itemcolorset", ">=", "0", ")", "{", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "colorset", "=", "&", "Colorset", "[", "itemcolorset", "]", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "flags", ".", "has_colorset", "=", "True", ";", "}", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "str", "=", "CF", ".", "cur_input", "->", "input", ".", "value", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "x", "=", "BOX_SPC", "+", "TEXT_SPC", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "y", "=", "BOX_SPC", "+", "TEXT_SPC", "+", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Ffont", "->", "ascent", ";", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", "->", "len", "=", "len", ";", "FlocaleDrawString", "(", "dpy", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Ffont", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Fstr", ",", "FWS_HAVE_LENGTH", ")", ";", "x", "=", "BOX_SPC", "+", "TEXT_SPC", "+", "FlocaleTextWidth", "(", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_Ffont", ",", "CF", ".", "cur_input", "->", "input", ".", "value", ",", "CF", ".", "abs_cursor", ")", "-", "1", ";", "dy", "=", "CF", ".", "cur_input", "->", "header", ".", "size_y", "-", "1", ";", "XDrawLine", "(", "dpy", ",", "CF", ".", "cur_input", "->", "header", ".", "win", ",", "CF", ".", "cur_input", "->", "header", ".", "dt_ptr", "->", "dt_item_GC", ",", "x", ",", "BOX_SPC", ",", "x", ",", "dy", "-", "BOX_SPC", ")", ";", "myfprintf", "(", "(", "stderr", ",", "\"Line", "%d/%d", "-", "%d/%d", "(char)\\\"", ",", "x", ",", "BOX_SPC", ",", "x", ",", "dy", "-", "BOX_SPC", ")", ")", ";", "}", "no_redraw", ":", "break;", "/*", "end", "of", "case", "KeyPress", "*/", "}", "/*", "end", "of", "switch", "(event.type)", "*/", "continue;", "}", "/*", "end", "of", "if", "(event.xany.window", "==", "CF.frame)", "*/", "for", "(", "item", "=", "root_item_ptr", ";", "item", "!=", "0", ";", "item", "=", "item", "->", "header", ".", "next", ")", "{", "/*", "all", "items", "*/", "if", "(", "event", ".", "xany", ".", "window", "==", "item", "->", "header", ".", "win", ")", "{", "switch", "(", "event", ".", "type", ")", "{", "case", "Expose", ":", "{", "int", "ex", "=", "event", ".", "xexpose", ".", "x", ";", "int", "ey", "=", "event", ".", "xexpose", ".", "y", ";", "int", "ex2", "=", "event", ".", "xexpose", ".", "x", "+", "event", ".", "xexpose", ".", "width", ";", "int", "ey2", "=", "event", ".", "xexpose", ".", "y", "+", "event", ".", "xexpose", ".", "height", ";", "while", "(", "FCheckTypedWindowEvent", "(", "dpy", ",", "item", "->", "header", ".", "win", ",", "Expose", ",", "&", "event", ")", ")", "{", "ex", "=", "min", "(", "ex", ",", "event", ".", "xexpose", ".", "x", ")", ";", "ey", "=", "min", "(", "ey", ",", "event", ".", "xexpose", ".", "y", ")", ";", "ex2", "=", "max", "(", "ex2", ",", "event", ".", "xexpose", ".", "x", "+", "event", ".", "xexpose", ".", "width", ")", ";", "ey2", "=", "max", "(", "ey2", ",", "event", ".", "xexpose", ".", "y", "+", "event", ".", "xexpose", ".", "height", ")", ";", "}", "event", ".", "xexpose", ".", "x", "=", "ex", ";", "event", ".", "xexpose", ".", "y", "=", "ey", ";", "event", ".", "xexpose", ".", "width", "=", "ex2", "-", "ex", ";", "event", ".", "xexpose", ".", "height", "=", "ey2", "-", "ey", ";", "RedrawItem", "(", "item", ",", "0", ",", "&", "event", ")", ";", "}", "break;", "case", "ButtonPress", ":", "if", "(", "item", "->", "type", "==", "I_INPUT", ")", "{", "old_item", "=", "CF", ".", "cur_input", ";", "CF", ".", "cur_input", "=", "item", ";", "RedrawItem", "(", "old_item", ",", "1", ",", "NULL", ")", ";", "{", "Bool", "done", "=", "False", ";", "CF", ".", "abs_cursor", "=", "0", ";", "while", "(", "CF", ".", "abs_cursor", "<=", "item", "->", "input", ".", "size", "&&", "!", "done", ")", "{", "if", "(", "FlocaleTextWidth", "(", "item", "->", "header", ".", "dt_ptr", "->", "dt_Ffont", ",", "item", "->", "input", ".", "value", ",", "CF", ".", "abs_cursor", ")", ">=", "event", ".", "xbutton", ".", "x", "-", "BOX_SPC", "-", "TEXT_SPC", ")", "{", "done", "=", "True", ";", "CF", ".", "abs_cursor", "--", ";", "}", "else", "{", "CF", ".", "abs_cursor", "++", ";", "}", "}", "}", "if", "(", "CF", ".", "abs_cursor", "<", "0", ")", "CF", ".", "abs_cursor", "=", "0", ";", "if", "(", "CF", ".", "abs_cursor", ">", "item", "->", "input", ".", "size", ")", "CF", ".", "abs_cursor", "=", "item", "->", "input", ".", "size", ";", "CF", ".", "rel_cursor", "=", "CF", ".", "abs_cursor", "+", "item", "->", "input", ".", "left", ";", "if", "(", "CF", ".", "rel_cursor", "<", "0", ")", "CF", ".", "rel_cursor", "=", "0", ";", "if", "(", "CF", ".", "rel_cursor", ">", "item", "->", "input", ".", "n", ")", "CF", ".", "rel_cursor", "=", "item", "->", "input", ".", "n", ";", "if", "(", "CF", ".", "rel_cursor", ">", "0", "&&", "CF", ".", "rel_cursor", "==", "item", "->", "input", ".", "left", ")", "item", "->", "input", ".", "left", "--", ";", "if", "(", "CF", ".", "rel_cursor", "<", "item", "->", "input", ".", "n", "&&", "CF", ".", "rel_cursor", "==", "item", "->", "input", ".", "left", "+", "item", "->", "input", ".", "size", ")", "item", "->", "input", ".", "left", "++", ";", "CF", ".", "abs_cursor", "=", "CF", ".", "rel_cursor", "-", "item", "->", "input", ".", "left", ";", "if", "(", "event", ".", "xbutton", ".", "button", "==", "Button2", ")", "{", "/*", "if", "paste", "request", "*/", "process_paste_request", "(", "&", "event", ",", "item", ")", ";", "}", "RedrawItem", "(", "item", ",", "0", ",", "NULL", ")", ";", "}", "if", "(", "item", "->", "type", "==", "I_CHOICE", ")", "ToggleChoice", "(", "item", ")", ";", "if", "(", "item", "->", "type", "==", "I_BUTTON", ")", "{", "RedrawItem", "(", "item", ",", "1", ",", "NULL", ")", ";", "/*", "push", "button", "in", "*/", "if", "(", "CF", ".", "activate_on_press", ")", "{", "usleep", "(", "MICRO_S_FOR_10MS", ")", ";", "/*", "make", "sure", "its", "visible", "*/", "RedrawItem", "(", "item", ",", "0", ",", "NULL", ")", ";", "/*", "pop", "button", "out", "*/", "DoCommand", "(", "item", ")", ";", "/*", "execute", "the", "button", "command", "*/", "}", "else", "{", "XGrabPointer", "(", "dpy", ",", "item", "->", "header", ".", "win", ",", "False", ",", "/*", "owner", "of", "events", "*/", "ButtonReleaseMask", ",", "/*", "events", "to", "report", "*/", "GrabModeAsync", ",", "/*", "keyboard", "mode", "*/", "GrabModeAsync", ",", "/*", "pointer", "mode", "*/", "None", ",", "/*", "confine", "to", "*/", "/*", "I", "sort", "of", "like", "this,", "the", "hand", "points", "in", "the", "other", "direction", "and", "the", "color", "is", "reversed.", "I", "don\\'t", "know", "what", "other", "GUIs", "do,", "Java", "doesn\\'t", "do", "anything,", "neither", "does", "anything", "else", "I", "can", "find...dje", "*/", "CF", ".", "pointer", "[", "button_in_pointer", "]", ",", "/*", "cursor", "*/", "CurrentTime", ")", ";", "}", "/*", "end", "activate", "on", "press", "*/", "}", "break;", "case", "ButtonRelease", ":", "if", "(", "!", "CF", ".", "activate_on_press", ")", "{", "RedrawItem", "(", "item", ",", "0", ",", "NULL", ")", ";", "if", "(", "CF", ".", "grab_server", "&&", "CF", ".", "server_grabbed", ")", "{", "/*", "You", "have", "to", "regrab", "the", "pointer,", "or", "focus", "can", "go", "to", "another", "window.", "grab...", "*/", "XGrabPointer", "(", "dpy", ",", "CF", ".", "frame", ",", "True", ",", "0", ",", "GrabModeAsync", ",", "GrabModeAsync", ",", "None", ",", "None", ",", "CurrentTime", ")", ";", "XFlush", "(", "dpy", ")", ";", "}", "else", "{", "XUngrabPointer", "(", "dpy", ",", "CurrentTime", ")", ";", "XFlush", "(", "dpy", ")", ";", "}", "if", "(", "event", ".", "xbutton", ".", "x", ">=", "0", "&&", "event", ".", "xbutton", ".", "x", "<", "item", "->", "header", ".", "size_x", "&&", "event", ".", "xbutton", ".", "y", ">=", "0", "&&", "event", ".", "xbutton", ".", "y", "<", "item", "->", "header", ".", "size_y", ")", "{", "DoCommand", "(", "item", ")", ";", "}", "}", "break;", "}", "}", "}", "/*", "end", "of", "for", "(i", "=", "0)", "*/", "}", "/*", "while", "loop", "*/", "}'" ]
ReadXServer
fvwmorg/fvwm
single_line
valid
9,478
78,941
[ "Entry", "point:", "Take", "whatever", "voting", "actions", "are", "pending", "as", "of", "<b>now<", "b>" ]
[ "'void", "dirvote_act", "(", "const", "or_options_t", "*", "options", ",", "time_t", "now", ")", "{", "if", "(", "!", "authdir_mode_v3", "(", "options", ")", ")", "return", ";", "if", "(", "!", "voting_schedule", ".", "voting_starts", ")", "{", "char", "*", "keys", "=", "list_v3_auth_ids", "()", ";", "authority_cert_t", "*", "c", "=", "get_my_v3_authority_cert", "()", ";", "log_notice", "(", "LD_DIR", ",", "\"Scheduling", "voting.", "Known", "authority", "IDs", "are", "%s.", "\"", "\"Mine", "is", "%s.\"", ",", "keys", ",", "hex_str", "(", "c", "->", "cache_info", ".", "identity_digest", ",", "DIGEST_LEN", ")", ")", ";", "tor_free", "(", "keys", ")", ";", "dirvote_recalculate_timing", "(", "options", ",", "now", ")", ";", "}", "if", "(", "voting_schedule", ".", "voting_starts", "<", "now", "&&", "!", "voting_schedule", ".", "have_voted", ")", "{", "log_notice", "(", "LD_DIR", ",", "\"Time", "to", "vote.\"", ")", ";", "dirvote_perform_vote", "()", ";", "voting_schedule", ".", "have_voted", "=", "1", ";", "}", "if", "(", "voting_schedule", ".", "fetch_missing_votes", "<", "now", "&&", "!", "voting_schedule", ".", "have_fetched_missing_votes", ")", "{", "log_notice", "(", "LD_DIR", ",", "\"Time", "to", "fetch", "any", "votes", "that", "we\\'re", "missing.\"", ")", ";", "dirvote_fetch_missing_votes", "()", ";", "voting_schedule", ".", "have_fetched_missing_votes", "=", "1", ";", "}", "if", "(", "voting_schedule", ".", "voting_ends", "<", "now", "&&", "!", "voting_schedule", ".", "have_built_consensus", ")", "{", "log_notice", "(", "LD_DIR", ",", "\"Time", "to", "compute", "a", "consensus.\"", ")", ";", "dirvote_compute_consensuses", "()", ";", "/*", "XXXX", "We", "will", "want", "to", "try", "again", "later", "if", "we", "haven\\'t", "got", "enough", "*", "votes", "yet.", "Implement", "this", "if", "it", "turns", "out", "to", "ever", "happen.", "*/", "voting_schedule", ".", "have_built_consensus", "=", "1", ";", "}", "if", "(", "voting_schedule", ".", "fetch_missing_signatures", "<", "now", "&&", "!", "voting_schedule", ".", "have_fetched_missing_signatures", ")", "{", "log_notice", "(", "LD_DIR", ",", "\"Time", "to", "fetch", "any", "signatures", "that", "we\\'re", "missing.\"", ")", ";", "dirvote_fetch_missing_signatures", "()", ";", "voting_schedule", ".", "have_fetched_missing_signatures", "=", "1", ";", "}", "if", "(", "voting_schedule", ".", "interval_starts", "<", "now", "&&", "!", "voting_schedule", ".", "have_published_consensus", ")", "{", "log_notice", "(", "LD_DIR", ",", "\"Time", "to", "publish", "the", "consensus", "and", "discard", "old", "votes\"", ")", ";", "dirvote_publish_consensus", "()", ";", "dirvote_clear_votes", "(", "0", ")", ";", "voting_schedule", ".", "have_published_consensus", "=", "1", ";", "/*", "Update", "our", "shared", "random", "state", "with", "the", "consensus", "just", "published.", "*/", "sr_act_post_consensus", "(", "networkstatus_get_latest_consensus_by_flavor", "(", "FLAV_NS", ")", ")", ";", "/*", "XXXX", "We", "will", "want", "to", "try", "again", "later", "if", "we", "haven\\'t", "got", "enough", "*", "signatures", "yet.", "Implement", "this", "if", "it", "turns", "out", "to", "ever", "happen.", "*/", "dirvote_recalculate_timing", "(", "options", ",", "now", ")", ";", "}", "}'" ]
dirvote_act
carsenk/denarius
single_line
valid
9,479
78,942
[ "Drop", "all", "currently", "pending", "votes,", "consensus,", "and", "detached", "signatures" ]
[ "'static", "void", "dirvote_clear_votes", "(", "int", "all_votes", ")", "{", "if", "(", "!", "previous_vote_list", ")", "previous_vote_list", "=", "smartlist_new", "()", ";", "if", "(", "!", "pending_vote_list", ")", "pending_vote_list", "=", "smartlist_new", "()", ";", "/*", "All", "\"previous\"", "votes", "are", "now", "junk.", "*/", "SMARTLIST_FOREACH", "(", "previous_vote_list", ",", "pending_vote_t", "*", ",", "v", ",", "{", "cached_dir_decref(v->vote_body);", "v->vote_body", "=", "NULL;", "networkstatus_vote_free(v->vote);", "tor_free(v);", "}", ")", ";", "smartlist_clear", "(", "previous_vote_list", ")", ";", "if", "(", "all_votes", ")", "{", "/*", "If", "we\\'re", "dumping", "all", "the", "votes,", "we", "delete", "the", "pending", "ones.", "*/", "SMARTLIST_FOREACH", "(", "pending_vote_list", ",", "pending_vote_t", "*", ",", "v", ",", "{", "cached_dir_decref(v->vote_body);", "v->vote_body", "=", "NULL;", "networkstatus_vote_free(v->vote);", "tor_free(v);", "}", ")", ";", "}", "else", "{", "/*", "Otherwise,", "we", "move", "them", "into", "\"previous\".", "*/", "smartlist_add_all", "(", "previous_vote_list", ",", "pending_vote_list", ")", ";", "}", "smartlist_clear", "(", "pending_vote_list", ")", ";", "if", "(", "pending_consensus_signature_list", ")", "{", "SMARTLIST_FOREACH", "(", "pending_consensus_signature_list", ",", "char", "*", ",", "cp", ",", "tor_free", "(", "cp", ")", ")", ";", "smartlist_clear", "(", "pending_consensus_signature_list", ")", ";", "}", "tor_free", "(", "pending_consensus_signatures", ")", ";", "dirvote_clear_pending_consensuses", "()", ";", "}'" ]
dirvote_clear_votes
carsenk/denarius
single_line
valid
9,480
78,943
[ "Using", "the", "time", "<b>now<", "b>,", "return", "the", "next", "voting", "validafter", "time" ]
[ "'time_t", "get_next_valid_after_time", "(", "time_t", "now", ")", "{", "time_t", "next_valid_after_time", ";", "const", "or_options_t", "*", "options", "=", "get_options", "()", ";", "voting_schedule_t", "*", "new_voting_schedule", "=", "get_voting_schedule", "(", "options", ",", "now", ",", "LOG_INFO", ")", ";", "tor_assert", "(", "new_voting_schedule", ")", ";", "next_valid_after_time", "=", "new_voting_schedule", "->", "interval_starts", ";", "voting_schedule_free", "(", "new_voting_schedule", ")", ";", "return", "next_valid_after_time", ";", "}'" ]
get_next_valid_after_time
carsenk/denarius
single_line
valid
9,481
78,944
[ "Release", "all", "static", "storage", "held", "in", "dirvote" ]
[ "'void", "dirvote_free_all", "(", "void", ")", "{", "dirvote_clear_votes", "(", "1", ")", ";", "/*", "now", "empty", "as", "a", "result", "of", "dirvote_clear_votes().", "*/", "smartlist_free", "(", "pending_vote_list", ")", ";", "pending_vote_list", "=", "NULL", ";", "smartlist_free", "(", "previous_vote_list", ")", ";", "previous_vote_list", "=", "NULL", ";", "dirvote_clear_pending_consensuses", "()", ";", "tor_free", "(", "pending_consensus_signatures", ")", ";", "if", "(", "pending_consensus_signature_list", ")", "{", "/*", "now", "empty", "as", "a", "result", "of", "dirvote_clear_votes().", "*/", "smartlist_free", "(", "pending_consensus_signature_list", ")", ";", "pending_consensus_signature_list", "=", "NULL", ";", "}", "}'" ]
dirvote_free_all
carsenk/denarius
single_line
valid
9,482
78,945
[ "Helper", "for", "sorting", "OR", "ports" ]
[ "'static", "int", "compare_orports_", "(", "const", "void", "*", "*", "_a", ",", "const", "void", "*", "*", "_b", ")", "{", "const", "tor_addr_port_t", "*", "a", "=", "*", "_a", ",", "<type", "ref=\"prev\">", "*", "b", "=", "*", "_b", ";", "int", "r", ";", "if", "(", "(", "r", "=", "tor_addr_compare", "(", "&", "a", "->", "addr", ",", "&", "b", "->", "addr", ",", "CMP_EXACT", ")", ")", ")", "return", "r", ";", "if", "(", "(", "r", "=", "(", "(", "(", "int", ")", "b", "->", "port", ")", "-", "(", "(", "int", ")", "a", "->", "port", ")", ")", ")", ")", "return", "r", ";", "return", "0", ";", "}'" ]
compare_orports_
carsenk/denarius
single_line
valid
9,483
78,946
[ "Release", "all", "storage", "held", "in", "<b>s<", "b>" ]
[ "'void", "ns_detached_signatures_free", "(", "ns_detached_signatures_t", "*", "s", ")", "{", "if", "(", "!", "s", ")", "return", ";", "if", "(", "s", "->", "signatures", ")", "{", "STRMAP_FOREACH", "(", "s->signatures", ",", "flavor", ",", "smartlist_t", "*", ",", "sigs", ")", "{", "SMARTLIST_FOREACH", "(", "sigs", ",", "document_signature_t", "*", ",", "sig", ",", "document_signature_free", "(", "sig", ")", ")", ";", "smartlist_free", "(", "sigs", ")", ";", "}", "STRMAP_FOREACH_END", ";", "strmap_free", "(", "s", "->", "signatures", ",", "NULL", ")", ";", "strmap_free", "(", "s", "->", "digests", ",", "tor_free_", ")", ";", "}", "tor_free", "(", "s", ")", ";", "}'" ]
ns_detached_signatures_free
carsenk/denarius
single_line
valid
9,484
78,960
[ "Frees", "CT", "log", "and", "associated", "structures" ]
[ "'void", "CTLOG_free", "(", "CTLOG", "*", "log", ")", "{", "if", "(", "log", "!=", "NULL", ")", "{", "OPENSSL_free", "(", "log", "->", "name", ")", ";", "EVP_PKEY_free", "(", "log", "->", "public_key", ")", ";", "OPENSSL_free", "(", "log", ")", ";", "}", "}'" ]
CTLOG_free
rbsec/sslscan
single_line
valid
9,485
78,979
[ "Inject", "X", "into", "the", "local", "scope", "just", "before", "the", "function", "parms" ]
[ "'tree", "pushdecl_outermost_localscope", "(", "tree", "x", ")", "{", "cp_binding_level", "*", "b", "=", "NULL", ";", "bool", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "/*", "Find", "the", "scope", "just", "inside", "the", "function", "parms.", "*/", "for", "(", "cp_binding_level", "*", "n", "=", "current_binding_level", ";", "n", "->", "kind", "!=", "sk_function_parms", ";", "n", "=", "b", "->", "level_chain", ")", "b", "=", "n", ";", "tree", "ret", "=", "b", "?", "do_pushdecl_with_scope", "(", "x", ",", "b", ",", "false", ")", ":", "error_mark_node", ";", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "return", "ret", ";", "}'" ]
pushdecl_outermost_localscope
KevinOConnor/klipper
single_line
valid
9,486
78,980
[ "External", "entry", "points", "for", "do_{push_to", "pop_from}_top_level" ]
[ "'void", "push_to_top_level", "(", "void", ")", "{", "bool", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "do_push_to_top_level", "()", ";", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "}'" ]
push_to_top_level
KevinOConnor/klipper
single_line
valid
9,487
78,981
[ "Return", "true", "if", "ID", "has", "not", "already", "been", "marked" ]
[ "'static", "inline", "bool", "store_binding_p", "(", "tree", "id", ")", "{", "if", "(", "!", "id", "||", "!", "IDENTIFIER_BINDING", "(", "id", ")", ")", "return", "false", ";", "if", "(", "IDENTIFIER_MARKED", "(", "id", ")", ")", "return", "false", ";", "return", "true", ";", "}'" ]
store_binding_p
KevinOConnor/klipper
single_line
valid
9,488
78,982
[ "Diagnose", "a", "name", "conflict", "between", "DECL", "and", "BVAL" ]
[ "'static", "void", "diagnose_name_conflict", "(", "tree", "decl", ",", "tree", "bval", ")", "{", "if", "(", "TREE_CODE", "(", "decl", ")", "==", "TREE_CODE", "(", "bval", ")", "&&", "TREE_CODE", "(", "decl", ")", "!=", "NAMESPACE_DECL", "&&", "!", "DECL_DECLARES_FUNCTION_P", "(", "decl", ")", "&&", "(", "TREE_CODE", "(", "decl", ")", "!=", "TYPE_DECL", "||", "DECL_ARTIFICIAL", "(", "decl", ")", "==", "DECL_ARTIFICIAL", "(", "bval", ")", ")", "&&", "CP_DECL_CONTEXT", "(", "decl", ")", "==", "CP_DECL_CONTEXT", "(", "bval", ")", ")", "error", "(", "\"redeclaration", "of", "%q#D\"", ",", "decl", ")", ";", "else", "error", "(", "\"%q#D", "conflicts", "with", "a", "previous", "declaration\"", ",", "decl", ")", ";", "inform", "(", "location_of", "(", "bval", ")", ",", "\"previous", "declaration", "%q#D\"", ",", "bval", ")", ";", "}'" ]
diagnose_name_conflict
KevinOConnor/klipper
single_line
valid
9,489
78,983
[ "Do", "a", "pushlevel", "for", "class", "declarations" ]
[ "'void", "pushlevel_class", "(", "void", ")", "{", "class_binding_level", "=", "begin_scope", "(", "sk_class", ",", "current_class_type", ")", ";", "}'" ]
pushlevel_class
KevinOConnor/klipper
single_line
valid
9,490
78,984
[ "Return", "the", "type", "associated", "with", "ID" ]
[ "'static", "tree", "identifier_type_value_1", "(", "tree", "id", ")", "{", "/*", "There", "is", "no", "type", "with", "that", "name,", "anywhere.", "*/", "if", "(", "REAL_IDENTIFIER_TYPE_VALUE", "(", "id", ")", "==", "NULL_TREE", ")", "return", "NULL_TREE", ";", "/*", "This", "is", "not", "the", "type", "marker,", "but", "the", "real", "thing.", "*/", "if", "(", "REAL_IDENTIFIER_TYPE_VALUE", "(", "id", ")", "!=", "global_type_node", ")", "return", "REAL_IDENTIFIER_TYPE_VALUE", "(", "id", ")", ";", "/*", "Have", "to", "search", "for", "it.", "It", "must", "be", "on", "the", "global", "level,", "now.", "Ask", "lookup_name", "not", "to", "return", "non-types.", "*/", "id", "=", "lookup_name_real", "(", "id", ",", "2", ",", "1", ",", "/*block_p=*/", "true", ",", "0", ",", "0", ")", ";", "if", "(", "id", ")", "return", "TREE_TYPE", "(", "id", ")", ";", "return", "NULL_TREE", ";", "}'" ]
identifier_type_value_1
KevinOConnor/klipper
single_line
valid
9,491
78,985
[ "Pushes", "X", "into", "the", "global", "namespace" ]
[ "'tree", "pushdecl_top_level", "(", "tree", "x", ",", "bool", "is_friend", ")", "{", "bool", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "do_push_to_top_level", "()", ";", "x", "=", "pushdecl_namespace_level", "(", "x", ",", "is_friend", ")", ";", "do_pop_from_top_level", "()", ";", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "return", "x", ";", "}'" ]
pushdecl_top_level
KevinOConnor/klipper
single_line
valid
9,492
78,986
[ "Temporarily", "set", "the", "namespace", "for", "the", "current", "declaration" ]
[ "'void", "push_decl_namespace", "(", "tree", "decl", ")", "{", "if", "(", "TREE_CODE", "(", "decl", ")", "!=", "NAMESPACE_DECL", ")", "decl", "=", "decl_namespace_context", "(", "decl", ")", ";", "vec_safe_push", "(", "decl_namespace_list", ",", "ORIGINAL_NAMESPACE", "(", "decl", ")", ")", ";", "}'" ]
push_decl_namespace
KevinOConnor/klipper
single_line
valid
9,493
78,987
[ "Return", "true", "if", "we", "are", "in", "the", "global", "binding", "level" ]
[ "'bool", "global_bindings_p", "(", "void", ")", "{", "return", "global_scope_p", "(", "current_binding_level", ")", ";", "}'" ]
global_bindings_p
KevinOConnor/klipper
single_line
valid
9,494
78,988
[ "Process", "a", "functionscope", "usingdirective" ]
[ "'void", "finish_local_using_directive", "(", "tree", "target", ",", "tree", "attribs", ")", "{", "gcc_checking_assert", "(", "local_bindings_p", "()", ")", ";", "if", "(", "target", "==", "error_mark_node", ")", "return", ";", "if", "(", "attribs", ")", "warning", "(", "OPT_Wattributes", ",", "\"attributes", "ignored", "on", "local", "using", "directive\"", ")", ";", "add_stmt", "(", "build_stmt", "(", "input_location", ",", "USING_STMT", ",", "target", ")", ")", ";", "add_using_namespace", "(", "current_binding_level", "->", "using_directives", ",", "ORIGINAL_NAMESPACE", "(", "target", ")", ")", ";", "}'" ]
finish_local_using_directive
KevinOConnor/klipper
single_line
valid
9,495
78,989
[ "External", "entry", "points", "for", "do_{push,pop}_nested_namespace" ]
[ "'void", "push_nested_namespace", "(", "tree", "ns", ")", "{", "bool", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "do_push_nested_namespace", "(", "ns", ")", ";", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "}'" ]
push_nested_namespace
KevinOConnor/klipper
single_line
valid
9,496
78,990
[ "True", "if", "the", "current", "level", "needs", "to", "have", "a", "BLOCK", "made" ]
[ "'bool", "kept_level_p", "(", "void", ")", "{", "return", "(", "current_binding_level", "->", "blocks", "!=", "NULL_TREE", "||", "current_binding_level", "->", "keep", "||", "current_binding_level", "->", "kind", "==", "sk_cleanup", "||", "current_binding_level", "->", "names", "!=", "NULL_TREE", "||", "current_binding_level", "->", "using_directives", ")", ";", "}'" ]
kept_level_p
KevinOConnor/klipper
single_line
valid
9,497
78,991
[ "Insert", "lately", "defined", "enum", "ENUMTYPE", "into", "KLASS", "for", "the", "sorted", "case" ]
[ "'void", "insert_late_enum_def_bindings", "(", "tree", "klass", ",", "tree", "enumtype", ")", "{", "int", "n_fields", ";", "vec", "<argument_list", "type=\"generic\">", "<", "tree", ",", "va_gc", ">", "*", "member_vec", "=", "CLASSTYPE_MEMBER_VEC", "(", "klass", ")", ";", "/*", "The", "enum", "bindings", "will", "already", "be", "on", "the", "TYPE_FIELDS,", "so", "don\\'t", "count", "them", "twice.", "*/", "if", "(", "!", "member_vec", ")", "n_fields", "=", "count_class_fields", "(", "klass", ")", ";", "else", "n_fields", "=", "list_length", "(", "TYPE_VALUES", "(", "enumtype", ")", ")", ";", "if", "(", "member_vec", "||", "n_fields", ">=", "8", ")", "{", "vec_safe_reserve_exact", "(", "member_vec", ",", "n_fields", ")", ";", "if", "(", "CLASSTYPE_MEMBER_VEC", "(", "klass", ")", ")", "member_vec_append_enum_values", "(", "member_vec", ",", "enumtype", ")", ";", "else", "member_vec_append_class_fields", "(", "member_vec", ",", "klass", ")", ";", "CLASSTYPE_MEMBER_VEC", "(", "klass", ")", "=", "member_vec", ";", "member_vec", "->", "qsort", "(", "member_name_cmp", ")", ";", "member_vec_dedup", "(", "member_vec", ")", ";", "}", "}'" ]
insert_late_enum_def_bindings
KevinOConnor/klipper
single_line
valid
9,498
78,992
[ "Add", "DECL", "to", "the", "list", "of", "things", "declared", "in", "B" ]
[ "\"static", "void", "add_decl_to_level", "(", "cp_binding_level", "*", "b", ",", "tree", "decl", ")", "{", "gcc_assert", "(", "b", "->", "kind", "!=", "sk_class", ")", ";", "/*", "Make", "sure", "we", "don't", "create", "a", "circular", "list.", "xref_tag", "can", "end", "up", "pushing", "the", "same", "artificial", "decl", "more", "than", "once.", "We", "should", "have", "already", "detected", "that", "in", "update_binding.", "*/", "gcc_assert", "(", "b", "->", "names", "!=", "decl", ")", ";", "/*", "We", "build", "up", "the", "list", "in", "reverse", "order,", "and", "reverse", "it", "later", "if", "necessary.", "*/", "TREE_CHAIN", "(", "decl", ")", "=", "b", "->", "names", ";", "b", "->", "names", "=", "decl", ";", "/*", "If", "appropriate,", "add", "decl", "to", "separate", "list", "of", "statics.", "We", "include", "extern", "variables", "because", "they", "might", "turn", "out", "to", "be", "static", "later.", "It's", "OK", "for", "this", "list", "to", "contain", "a", "few", "false", "positives.", "*/", "if", "(", "b", "->", "kind", "==", "sk_namespace", "&&", "(", "(", "VAR_P", "(", "decl", ")", "&&", "(", "TREE_STATIC", "(", "decl", ")", "||", "DECL_EXTERNAL", "(", "decl", ")", ")", ")", "||", "(", "TREE_CODE", "(", "decl", ")", "==", "FUNCTION_DECL", "&&", "(", "!", "TREE_PUBLIC", "(", "decl", ")", "||", "decl_anon_ns_mem_p", "(", "decl", ")", "||", "DECL_DECLARED_INLINE_P", "(", "decl", ")", ")", ")", ")", ")", "vec_safe_push", "(", "static_decls", ",", "decl", ")", ";", "}\"" ]
add_decl_to_level
KevinOConnor/klipper
single_line
valid
9,499
78,993
[ "Enter", "the", "namespaces", "from", "current_namerspace", "to", "NS" ]
[ "'static", "int", "push_inline_namespaces", "(", "tree", "ns", ")", "{", "int", "count", "=", "0", ";", "if", "(", "ns", "!=", "current_namespace", ")", "{", "gcc_assert", "(", "ns", "!=", "global_namespace", ")", ";", "count", "+=", "push_inline_namespaces", "(", "CP_DECL_CONTEXT", "(", "ns", ")", ")", ";", "resume_scope", "(", "NAMESPACE_LEVEL", "(", "ns", ")", ")", ";", "current_namespace", "=", "ns", ";", "count", "++", ";", "}", "return", "count", ";", "}'" ]
push_inline_namespaces
KevinOConnor/klipper
single_line
valid
9,500
78,994
[ "(GC)allocate", "a", "binding", "object", "with", "VALUE", "and", "TYPE", "member", "initialized" ]
[ "'static", "cxx_binding", "*", "cxx_binding_make", "(", "tree", "value", ",", "tree", "type", ")", "{", "cxx_binding", "*", "binding", ";", "if", "(", "free_bindings", ")", "{", "binding", "=", "free_bindings", ";", "free_bindings", "=", "binding", "->", "previous", ";", "}", "else", "binding", "=", "ggc_alloc", "<argument_list", "type=\"generic\">", "<", "cxx_binding", ">", "()", ";", "cxx_binding_init", "(", "binding", ",", "value", ",", "type", ")", ";", "return", "binding", ";", "}'" ]
cxx_binding_make
KevinOConnor/klipper
single_line
valid
9,501
78,995
[ "Process", "a", "namespacescope", "using", "directive" ]
[ "'void", "finish_namespace_using_directive", "(", "tree", "target", ",", "tree", "attribs", ")", "{", "gcc_checking_assert", "(", "namespace_bindings_p", "()", ")", ";", "if", "(", "target", "==", "error_mark_node", ")", "return", ";", "add_using_namespace", "(", "DECL_NAMESPACE_USING", "(", "current_namespace", ")", ",", "ORIGINAL_NAMESPACE", "(", "target", ")", ")", ";", "emit_debug_info_using_namespace", "(", "current_namespace", ",", "ORIGINAL_NAMESPACE", "(", "target", ")", ",", "false", ")", ";", "if", "(", "attribs", "==", "error_mark_node", ")", "return", ";", "for", "(", "tree", "a", "=", "attribs", ";", "a", ";", "a", "=", "TREE_CHAIN", "(", "a", ")", ")", "{", "tree", "name", "=", "get_attribute_name", "(", "a", ")", ";", "if", "(", "is_attribute_p", "(", "\"strong\"", ",", "name", ")", ")", "{", "warning", "(", "0", ",", "\"strong", "using", "directive", "no", "longer", "supported\"", ")", ";", "if", "(", "CP_DECL_CONTEXT", "(", "target", ")", "==", "current_namespace", ")", "inform", "(", "DECL_SOURCE_LOCATION", "(", "target", ")", ",", "\"you", "may", "use", "an", "inline", "namespace", "instead\"", ")", ";", "}", "else", "warning", "(", "OPT_Wattributes", ",", "\"%qD", "attribute", "directive", "ignored\"", ",", "name", ")", ";", "}", "}'" ]
finish_namespace_using_directive
KevinOConnor/klipper
single_line
valid
9,502
78,996
[ "Make", "the", "declaration", "of", "X", "appear", "in", "CLASS", "scope" ]
[ "'bool", "pushdecl_class_level", "(", "tree", "x", ")", "{", "bool", "is_valid", "=", "true", ";", "bool", "subtime", ";", "/*", "Do", "nothing", "if", "we\\'re", "adding", "to", "an", "outer", "lambda", "closure", "type,", "outer_binding", "will", "add", "it", "later", "if", "it\\'s", "needed.", "*/", "if", "(", "current_class_type", "!=", "class_binding_level", "->", "this_entity", ")", "return", "true", ";", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "/*", "Get", "the", "name", "of", "X.", "*/", "tree", "name", "=", "OVL_NAME", "(", "x", ")", ";", "if", "(", "name", ")", "{", "is_valid", "=", "push_class_level_binding", "(", "name", ",", "x", ")", ";", "if", "(", "TREE_CODE", "(", "x", ")", "==", "TYPE_DECL", ")", "set_identifier_type_value", "(", "name", ",", "x", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "ANON_AGGR_TYPE_P", "(", "TREE_TYPE", "(", "x", ")", ")", ")", "{", "/*", "If", "X", "is", "an", "anonymous", "aggregate,", "all", "of", "its", "members", "are", "treated", "as", "if", "they", "were", "members", "of", "the", "class", "containing", "the", "aggregate,", "for", "naming", "purposes.", "*/", "tree", "f", ";", "for", "(", "f", "=", "TYPE_FIELDS", "(", "TREE_TYPE", "(", "x", ")", ")", ";", "f", ";", "f", "=", "DECL_CHAIN", "(", "f", ")", ")", "{", "location_t", "save_location", "=", "input_location", ";", "input_location", "=", "DECL_SOURCE_LOCATION", "(", "f", ")", ";", "if", "(", "!", "pushdecl_class_level", "(", "f", ")", ")", "is_valid", "=", "false", ";", "input_location", "=", "save_location", ";", "}", "}", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "return", "is_valid", ";", "}'" ]
pushdecl_class_level
KevinOConnor/klipper
single_line
valid
9,503
78,997
[ "Insert", "SCOPE", "as", "the", "innermost", "binding", "level" ]
[ "'void", "push_binding_level", "(", "cp_binding_level", "*", "scope", ")", "{", "/*", "Add", "it", "to", "the", "front", "of", "currently", "active", "scopes", "stack.", "*/", "scope", "->", "level_chain", "=", "current_binding_level", ";", "current_binding_level", "=", "scope", ";", "keep_next_level_flag", "=", "false", ";", "if", "(", "ENABLE_SCOPE_CHECKING", ")", "{", "scope", "->", "binding_depth", "=", "binding_depth", ";", "indent", "(", "binding_depth", ")", ";", "cp_binding_level_debug", "(", "scope", ",", "LOCATION_LINE", "(", "input_location", ")", ",", "\"push\"", ")", ";", "binding_depth", "++", ";", "}", "}'" ]
push_binding_level
KevinOConnor/klipper
single_line
valid
9,504
78,998
[ "True", "if", "the", "innermost", "nonclass", "scope", "is", "a", "block", "scope" ]
[ "'bool", "local_bindings_p", "(", "void", ")", "{", "cp_binding_level", "*", "b", "=", "innermost_nonclass_level", "()", ";", "return", "b", "->", "kind", "<", "sk_function_parms", "||", "b", "->", "kind", "==", "sk_omp", ";", "}'" ]
local_bindings_p
KevinOConnor/klipper
single_line
valid
9,505
78,999
[ "Process", "a", "usingdeclaration", "appearing", "in", "namespace", "scope" ]
[ "'void", "finish_namespace_using_decl", "(", "tree", "decl", ",", "tree", "scope", ",", "tree", "name", ")", "{", "tree", "orig_decl", "=", "decl", ";", "gcc_checking_assert", "(", "current_binding_level", "->", "kind", "==", "sk_namespace", "&&", "!", "processing_template_decl", ")", ";", "decl", "=", "validate_nonmember_using_decl", "(", "decl", ",", "scope", ",", "name", ")", ";", "if", "(", "decl", "==", "NULL_TREE", ")", "return", ";", "tree", "*", "slot", "=", "find_namespace_slot", "(", "current_namespace", ",", "name", ",", "true", ")", ";", "tree", "val", "=", "slot", "?", "MAYBE_STAT_DECL", "(", "*", "slot", ")", ":", "NULL_TREE", ";", "tree", "type", "=", "slot", "?", "MAYBE_STAT_TYPE", "(", "*", "slot", ")", ":", "NULL_TREE", ";", "do_nonmember_using_decl", "(", "scope", ",", "name", ",", "&", "val", ",", "&", "type", ")", ";", "if", "(", "STAT_HACK_P", "(", "*", "slot", ")", ")", "{", "STAT_DECL", "(", "*", "slot", ")", "=", "val", ";", "STAT_TYPE", "(", "*", "slot", ")", "=", "type", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "type", ")", "*", "slot", "=", "stat_hack", "(", "val", ",", "type", ")", ";", "else", "*", "slot", "=", "val", ";", "/*", "Emit", "debug", "info.", "*/", "cp_emit_debug_info_for_using", "(", "orig_decl", ",", "current_namespace", ")", ";", "}'" ]
finish_namespace_using_decl
KevinOConnor/klipper
single_line
valid
9,506
79,000
[ "Return", "how", "many", "function", "prototypes", "we", "are", "currently", "nested", "inside" ]
[ "'int", "function_parm_depth", "(", "void", ")", "{", "int", "level", "=", "0", ";", "cp_binding_level", "*", "b", ";", "for", "(", "b", "=", "current_binding_level", ";", "b", "->", "kind", "==", "sk_function_parms", ";", "b", "=", "b", "->", "level_chain", ")", "++", "level", ";", "return", "level", ";", "}'" ]
function_parm_depth
KevinOConnor/klipper
single_line
valid
9,507
79,001
[ "Leave", "scope", "pushed", "by", "push_scope" ]
[ "'void", "pop_scope", "(", "tree", "t", ")", "{", "if", "(", "t", "==", "NULL_TREE", ")", "return", ";", "if", "(", "TREE_CODE", "(", "t", ")", "==", "NAMESPACE_DECL", ")", "pop_decl_namespace", "()", ";", "<if", "type=\"elseif\">", "else", "if", "CLASS_TYPE_P", "(", "t", ")", "pop_nested_class", "()", ";", "}'" ]
pop_scope
KevinOConnor/klipper
single_line
valid
9,508
79,002
[ "Process", "a", "namespacealias", "declaration" ]
[ "'void", "do_namespace_alias", "(", "tree", "alias", ",", "tree", "name_space", ")", "{", "if", "(", "name_space", "==", "error_mark_node", ")", "return", ";", "gcc_assert", "(", "TREE_CODE", "(", "name_space", ")", "==", "NAMESPACE_DECL", ")", ";", "name_space", "=", "ORIGINAL_NAMESPACE", "(", "name_space", ")", ";", "/*", "Build", "the", "alias.", "*/", "alias", "=", "build_lang_decl", "(", "NAMESPACE_DECL", ",", "alias", ",", "void_type_node", ")", ";", "DECL_NAMESPACE_ALIAS", "(", "alias", ")", "=", "name_space", ";", "DECL_EXTERNAL", "(", "alias", ")", "=", "1", ";", "DECL_CONTEXT", "(", "alias", ")", "=", "FROB_CONTEXT", "(", "current_scope", "()", ")", ";", "pushdecl", "(", "alias", ")", ";", "/*", "Emit", "debug", "info", "for", "namespace", "alias.", "*/", "if", "(", "!", "building_stmt_list_p", "()", ")", "(", "*", "debug_hooks", "->", "early_global_decl", ")", "(", "alias", ")", ";", "}'" ]
do_namespace_alias
KevinOConnor/klipper
single_line
valid
9,509
79,003
[ "Return", "true", "if", "OVL", "is", "an", "overload", "for", "an", "anticipated", "builtin" ]
[ "'static", "bool", "anticipated_builtin_p", "(", "tree", "ovl", ")", "{", "if", "(", "TREE_CODE", "(", "ovl", ")", "!=", "OVERLOAD", ")", "return", "false", ";", "if", "(", "!", "OVL_HIDDEN_P", "(", "ovl", ")", ")", "return", "false", ";", "tree", "fn", "=", "OVL_FUNCTION", "(", "ovl", ")", ";", "gcc_checking_assert", "(", "DECL_ANTICIPATED", "(", "fn", ")", ")", ";", "if", "(", "DECL_HIDDEN_FRIEND_P", "(", "fn", ")", ")", "return", "false", ";", "return", "true", ";", "}'" ]
anticipated_builtin_p
KevinOConnor/klipper
single_line
valid
9,510
79,004
[ "Insert", "a", "binding", "for", "NAME", "to", "TYPE", "into", "TABLE" ]
[ "'static", "void", "binding_table_insert", "(", "binding_table", "table", ",", "tree", "name", ",", "tree", "type", ")", "{", "const", "unsigned", "int", "hash", "=", "IDENTIFIER_HASH_VALUE", "(", "name", ")", ";", "const", "size_t", "i", "=", "ENTRY_INDEX", "(", "hash", ",", "table", "->", "chain_count", ")", ";", "binding_entry", "entry", "=", "binding_entry_make", "(", "name", ",", "type", ")", ";", "entry", "->", "chain", "=", "table", "->", "chain", "[", "i", "]", ";", "table", "->", "chain", "[", "i", "]", "=", "entry", ";", "++", "table", "->", "entry_count", ";", "if", "(", "3", "*", "table", "->", "chain_count", "<", "5", "*", "table", "->", "entry_count", ")", "binding_table_expand", "(", "table", ")", ";", "}'" ]
binding_table_insert
KevinOConnor/klipper
single_line
valid
9,511
79,005
[ "Exit", "the", "current", "scope", "INNER", "back", "to", "scope", "OUTER" ]
[ "'void", "pop_inner_scope", "(", "tree", "outer", ",", "tree", "inner", ")", "{", "if", "(", "outer", "==", "inner", "||", "(", "TREE_CODE", "(", "inner", ")", "!=", "NAMESPACE_DECL", "&&", "!", "CLASS_TYPE_P", "(", "inner", ")", ")", ")", "return", ";", "while", "(", "outer", "!=", "inner", ")", "{", "if", "(", "TREE_CODE", "(", "inner", ")", "==", "NAMESPACE_DECL", ")", "{", "cp_binding_level", "*", "save_template_parm", "=", "0", ";", "/*", "Temporary", "take", "out", "template", "parameter", "scopes.", "They", "are", "saved", "in", "reversed", "order", "in", "save_template_parm.", "*/", "while", "(", "current_binding_level", "->", "kind", "==", "sk_template_parms", ")", "{", "cp_binding_level", "*", "b", "=", "current_binding_level", ";", "current_binding_level", "=", "b", "->", "level_chain", ";", "b", "->", "level_chain", "=", "save_template_parm", ";", "save_template_parm", "=", "b", ";", "}", "pop_namespace", "()", ";", "/*", "Restore", "template", "parameter", "scopes.", "*/", "while", "(", "save_template_parm", ")", "{", "cp_binding_level", "*", "b", "=", "save_template_parm", ";", "save_template_parm", "=", "b", "->", "level_chain", ";", "b", "->", "level_chain", "=", "current_binding_level", ";", "current_binding_level", "=", "b", ";", "}", "}", "else", "popclass", "()", ";", "inner", "=", "CP_DECL_CONTEXT", "(", "TREE_CODE", "(", "inner", ")", "==", "NAMESPACE_DECL", "?", "inner", ":", "TYPE_NAME", "(", "inner", ")", ")", ";", "}", "}'" ]
pop_inner_scope
KevinOConnor/klipper
single_line
valid
9,512
79,006
[ "Return", "the", "declarations", "that", "are", "members", "of", "the", "namespace", "NS" ]
[ "'tree", "cp_namespace_decls", "(", "tree", "ns", ")", "{", "return", "NAMESPACE_LEVEL", "(", "ns", ")", "->", "names", ";", "}'" ]
cp_namespace_decls
KevinOConnor/klipper
single_line
valid
9,513
79,007
[ "Apply", "PROC", "with", "DATA", "to", "all", "entries", "in", "TABLE" ]
[ "'void", "binding_table_foreach", "(", "binding_table", "table", ",", "bt_foreach_proc", "proc", ",", "void", "*", "data", ")", "{", "size_t", "chain_count", ";", "size_t", "i", ";", "if", "(", "!", "table", ")", "return", ";", "chain_count", "=", "table", "->", "chain_count", ";", "for", "(", "i", "=", "0", ";", "i", "<", "chain_count", ";", "++", "i", ")", "{", "binding_entry", "entry", "=", "table", "->", "chain", "[", "i", "]", ";", "for", "(", ";", "entry", "!=", "NULL", ";", "entry", "=", "entry", "->", "chain", ")", "proc", "(", "entry", ",", "data", ")", ";", "}", "}'" ]
binding_table_foreach
KevinOConnor/klipper
single_line
valid
9,514
79,008
[ "Find", "the", "binding", "for", "NAME", "in", "the", "local", "binding", "level", "B" ]
[ "'static", "cxx_binding", "*", "find_local_binding", "(", "cp_binding_level", "*", "b", ",", "tree", "name", ")", "{", "if", "(", "cxx_binding", "*", "binding", "=", "IDENTIFIER_BINDING", "(", "name", ")", ")", "for", "(", ";", ";", "b", "=", "b", "->", "level_chain", ")", "{", "if", "(", "binding", "->", "scope", "==", "b", "&&", "!", "(", "VAR_P", "(", "binding", "->", "value", ")", "&&", "DECL_DEAD_FOR_LOCAL", "(", "binding", "->", "value", ")", ")", ")", "return", "binding", ";", "/*", "Cleanup", "contours", "are", "transparent", "to", "the", "language.", "*/", "if", "(", "b", "->", "kind", "!=", "sk_cleanup", ")", "break;", "}", "return", "NULL", ";", "}'" ]
find_local_binding
KevinOConnor/klipper
single_line
valid
9,515
79,009
[ "Return", "the", "binding_entry,", "if", "any,", "that", "maps", "NAME" ]
[ "'binding_entry", "binding_table_find", "(", "binding_table", "table", ",", "tree", "name", ")", "{", "const", "unsigned", "int", "hash", "=", "IDENTIFIER_HASH_VALUE", "(", "name", ")", ";", "binding_entry", "entry", "=", "table", "->", "chain", "[", "ENTRY_INDEX", "(", "hash", ",", "table", "->", "chain_count", ")", "]", ";", "while", "(", "entry", "!=", "NULL", "&&", "entry", "->", "name", "!=", "name", ")", "entry", "=", "entry", "->", "chain", ";", "return", "entry", ";", "}'" ]
binding_table_find
KevinOConnor/klipper
single_line
valid
9,516
79,010
[ "Pop", "from", "the", "scope", "of", "the", "current", "namespace" ]
[ "'void", "pop_namespace", "(", "void", ")", "{", "bool", "subtime", "=", "timevar_cond_start", "(", "TV_NAME_LOOKUP", ")", ";", "gcc_assert", "(", "current_namespace", "!=", "global_namespace", ")", ";", "current_namespace", "=", "CP_DECL_CONTEXT", "(", "current_namespace", ")", ";", "/*", "The", "binding", "level", "is", "not", "popped,", "as", "it", "might", "be", "re-opened", "later.", "*/", "leave_scope", "()", ";", "timevar_cond_stop", "(", "TV_NAME_LOOKUP", ",", "subtime", ")", ";", "}'" ]
pop_namespace
KevinOConnor/klipper
single_line
valid
9,517
79,011
[ "Process", "a", "usingdeclaration", "at", "function", "scope" ]
[ "'void", "finish_local_using_decl", "(", "tree", "decl", ",", "tree", "scope", ",", "tree", "name", ")", "{", "tree", "orig_decl", "=", "decl", ";", "gcc_checking_assert", "(", "current_binding_level", "->", "kind", "!=", "sk_class", "&&", "current_binding_level", "->", "kind", "!=", "sk_namespace", ")", ";", "decl", "=", "validate_nonmember_using_decl", "(", "decl", ",", "scope", ",", "name", ")", ";", "if", "(", "decl", "==", "NULL_TREE", ")", "return", ";", "add_decl_expr", "(", "decl", ")", ";", "cxx_binding", "*", "binding", "=", "find_local_binding", "(", "current_binding_level", ",", "name", ")", ";", "tree", "value", "=", "binding", "?", "binding", "->", "value", ":", "NULL_TREE", ";", "tree", "type", "=", "binding", "?", "binding", "->", "type", ":", "NULL_TREE", ";", "do_nonmember_using_decl", "(", "scope", ",", "name", ",", "&", "value", ",", "&", "type", ")", ";", "if", "(", "!", "value", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "binding", "&&", "value", "==", "binding", "->", "value", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "binding", "&&", "binding", "->", "value", "&&", "TREE_CODE", "(", "value", ")", "==", "OVERLOAD", ")", "{", "update_local_overload", "(", "IDENTIFIER_BINDING", "(", "name", ")", ",", "value", ")", ";", "IDENTIFIER_BINDING", "(", "name", ")", "->", "value", "=", "value", ";", "}", "else", "/*", "Install", "the", "new", "binding.", "*/", "push_local_binding", "(", "name", ",", "value", ",", "true", ")", ";", "if", "(", "!", "type", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "binding", "&&", "type", "==", "binding", "->", "type", ")", ";", "else", "{", "push_local_binding", "(", "name", ",", "type", ",", "true", ")", ";", "set_identifier_type_value", "(", "name", ",", "type", ")", ";", "}", "/*", "Emit", "debug", "info.", "*/", "if", "(", "!", "processing_template_decl", ")", "cp_emit_debug_info_for_using", "(", "orig_decl", ",", "current_scope", "()", ")", ";", "}'" ]
finish_local_using_decl
KevinOConnor/klipper
single_line
valid
9,518
79,012
[ "Resort", "CLASSTYPE_MEMBER_VEC", "because", "pointers", "have", "been", "reordered" ]
[ "'void", "resort_type_member_vec", "(", "void", "*", "obj", ",", "void", "*", "/*orig_obj*/", ",", "gt_pointer_operator", "new_value", ",", "void", "*", "cookie", ")", "{", "if", "(", "vec", "<argument_list", "type=\"generic\">", "<", "tree", ",", "va_gc", ">", "*", "member_vec", "=", "(", "vec", "<argument_list", "type=\"generic\">", "<", "tree", ",", "va_gc", ">", "*", ")", "obj", ")", "{", "resort_data", ".", "new_value", "=", "new_value", ";", "resort_data", ".", "cookie", "=", "cookie", ";", "member_vec", "->", "qsort", "(", "resort_member_name_cmp", ")", ";", "}", "}'" ]
resort_type_member_vec
KevinOConnor/klipper
single_line
valid
9,519
79,013
[ "Return", "the", "list", "of", "declarations", "of", "the", "current", "local", "scope" ]
[ "'tree", "get_local_decls", "(", "void", ")", "{", "gcc_assert", "(", "current_binding_level", "->", "kind", "!=", "sk_namespace", "&&", "current_binding_level", "->", "kind", "!=", "sk_class", ")", ";", "return", "current_binding_level", "->", "names", ";", "}'" ]
get_local_decls
KevinOConnor/klipper
single_line
valid
9,520
79,014
[ "Returns", "true", "if", "this", "scope", "was", "created", "to", "store", "template", "parameters" ]
[ "'bool", "template_parm_scope_p", "(", "void", ")", "{", "return", "innermost_scope_kind", "()", "==", "sk_template_parms", ";", "}'" ]
template_parm_scope_p
KevinOConnor/klipper
single_line
valid
9,521
79,015
[ "Checks", "if", "we", "have", "decrypted", "unread", "record", "data", "pending" ]
[ "'int", "RECORD_LAYER_processed_read_pending", "(", "const", "RECORD_LAYER", "*", "rl", ")", "{", "size_t", "curr_rec", "=", "0", ",", "<type", "ref=\"prev\"/>", "num_recs", "=", "RECORD_LAYER_get_numrpipes", "(", "rl", ")", ";", "const", "SSL3_RECORD", "*", "rr", "=", "rl", "->", "rrec", ";", "while", "(", "curr_rec", "<", "num_recs", "&&", "SSL3_RECORD_is_read", "(", "&", "rr", "[", "curr_rec", "]", ")", ")", "curr_rec", "++", ";", "return", "curr_rec", "<", "num_recs", ";", "}'" ]
RECORD_LAYER_processed_read_pending
rbsec/sslscan
single_line
valid
9,522
79,016
[ "Checks", "if", "we", "have", "unprocessed", "read", "ahead", "data", "pending" ]
[ "'int", "RECORD_LAYER_read_pending", "(", "const", "RECORD_LAYER", "*", "rl", ")", "{", "return", "SSL3_BUFFER_get_left", "(", "&", "rl", "->", "rbuf", ")", "!=", "0", ";", "}'" ]
RECORD_LAYER_read_pending
rbsec/sslscan
single_line
valid
9,523
79,017
[ "Sept", "2016:", "returns", "DW_DLV_OK", "or", "DW_DLV_ERROR" ]
[ "'int", "_dwarf_pro_add_AT_macro_info", "(", "Dwarf_P_Debug", "dbg", ",", "Dwarf_P_Die", "die", ",", "Dwarf_Unsigned", "offset", ",", "Dwarf_Error", "*", "error", ")", "{", "Dwarf_P_Attribute", "new_attr", ";", "int", "uwordb_size", "=", "dbg", "->", "de_offset_size", ";", "if", "(", "die", "==", "NULL", ")", "{", "DWARF_P_DBG_ERROR", "(", "NULL", ",", "DW_DLE_DIE_NULL", ",", "DW_DLV_ERROR", ")", ";", "}", "new_attr", "=", "(", "Dwarf_P_Attribute", ")", "_dwarf_p_get_alloc", "(", "dbg", ",", "sizeof", "(", "struct", "Dwarf_P_Attribute_s", ")", ")", ";", "if", "(", "new_attr", "==", "NULL", ")", "{", "DWARF_P_DBG_ERROR", "(", "NULL", ",", "DW_DLE_ATTR_ALLOC", ",", "DW_DLV_ERROR", ")", ";", "}", "/*", "fill", "in", "the", "information", "*/", "new_attr", "->", "ar_attribute", "=", "DW_AT_macro_info", ";", "new_attr", "->", "ar_attribute_form", "=", "dbg", "->", "de_ar_data_attribute_form", ";", "new_attr", "->", "ar_rel_type", "=", "dbg", "->", "de_offset_reloc", ";", "new_attr", "->", "ar_nbytes", "=", "uwordb_size", ";", "new_attr", "->", "ar_next", "=", "NULL", ";", "new_attr", "->", "ar_reloc_len", "=", "uwordb_size", ";", "new_attr", "->", "ar_data", "=", "(", "char", "*", ")", "_dwarf_p_get_alloc", "(", "dbg", ",", "uwordb_size", ")", ";", "if", "(", "new_attr", "->", "ar_data", "==", "NULL", ")", "{", "DWARF_P_DBG_ERROR", "(", "NULL", ",", "DW_DLE_ADDR_ALLOC", ",", "DW_DLV_ERROR", ")", ";", "}", "{", "Dwarf_Unsigned", "du", "=", "offset", ";", "WRITE_UNALIGNED", "(", "dbg", ",", "(", "void", "*", ")", "new_attr", "->", "ar_data", ",", "(", "const", "void", "*", ")", "&", "du", ",", "sizeof", "(", "du", ")", ",", "uwordb_size", ")", ";", "}", "_dwarf_pro_add_at_to_die", "(", "die", ",", "new_attr", ")", ";", "return", "DW_DLV_OK", ";", "}'" ]
_dwarf_pro_add_AT_macro_info
LLNL/STAT
single_line
valid
9,524
79,018
[ "don't", "use", "this", "oneintended", "for", "nonblocking", "send" ]
[ "'int", "PeerNode_send", "(", "PeerNode_t", "*", "UNUSED", "(", "peer", ")", ",", "/*const*/", "Packet_t", "*", "UNUSED", "(", "ipacket", ")", ")", "{", "mrn_dbg", "(", "1", ",", "mrn_printf", "(", "FLF", ",", "stderr", ",", "\"PeerNode_send", "is", "not", "intended", "for", "blocking", "send\\\"", ")", ")", ";", "return", "-", "1", ";", "}'" ]
PeerNode_send
LLNL/STAT
double_slash
valid
9,525
79,034
[ "Generate", "a", "list", "with", "all", "active", "responses" ]
[ "'int", "ReadActiveResponses", "(", "XML_NODE", "node", ",", "void", "*", "d1", ",", "void", "*", "d2", ")", "{", "OSList", "*", "l1", "=", "(", "OSList", "*", ")", "d1", ";", "OSList", "*", "l2", "=", "(", "OSList", "*", ")", "d2", ";", "FILE", "*", "fp", ";", "int", "i", "=", "0", ";", "int", "r_ar", "=", "0", ";", "int", "l_ar", "=", "0", ";", "int", "rpt", "=", "0", ";", "/*", "Xml", "options", "*/", "const", "char", "*", "xml_ar_command", "=", "\"command\"", ";", "const", "char", "*", "xml_ar_location", "=", "\"location\"", ";", "const", "char", "*", "xml_ar_agent_id", "=", "\"agent_id\"", ";", "const", "char", "*", "xml_ar_rules_id", "=", "\"rules_id\"", ";", "const", "char", "*", "xml_ar_rules_group", "=", "\"rules_group\"", ";", "const", "char", "*", "xml_ar_level", "=", "\"level\"", ";", "const", "char", "*", "xml_ar_timeout", "=", "\"timeout\"", ";", "const", "char", "*", "xml_ar_disabled", "=", "\"disabled\"", ";", "const", "char", "*", "xml_ar_repeated", "=", "\"repeated_offenders\"", ";", "char", "*", "tmp_location", ";", "/*", "Currently", "active", "response", "*/", "active_response", "*", "tmp_ar", ";", "/*", "Open", "shared", "ar", "file", "*/", "fp", "=", "fopen", "(", "DEFAULTARPATH", ",", "\"a\"", ")", ";", "if", "(", "!", "fp", ")", "{", "merror", "(", "FOPEN_ERROR", ",", "__local_name", ",", "DEFAULTARPATH", ",", "errno", ",", "strerror", "(", "errno", ")", ")", ";", "return", "(", "-", "1", ")", ";", "}", "#", "ifndef", "WIN32", "struct", "group", "*", "os_group", ";", "if", "(", "(", "os_group", "=", "getgrnam", "(", "USER", ")", ")", "==", "NULL", ")", "{", "merror", "(", "\"Could", "not", "get", "ossec", "gid.\"", ")", ";", "fclose", "(", "fp", ")", ";", "return", "(", "-", "1", ")", ";", "}", "if", "(", "(", "chown", "(", "DEFAULTARPATH", ",", "(", "uid_t", ")", "-", "1", ",", "os_group", "->", "gr_gid", ")", ")", "==", "-", "1", ")", "{", "merror", "(", "\"Could", "not", "change", "the", "group", "to", "ossec:", "%d\"", ",", "errno", ")", ";", "fclose", "(", "fp", ")", ";", "return", "(", "-", "1", ")", ";", "}", "#", "endif", "if", "(", "(", "chmod", "(", "DEFAULTARPATH", ",", "0440", ")", ")", "==", "-", "1", ")", "{", "merror", "(", "\"Could", "not", "chmod", "to", "0440:", "%d\"", ",", "errno", ")", ";", "fclose", "(", "fp", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "Allocate", "for", "the", "active-response", "*/", "tmp_ar", "=", "(", "active_response", "*", ")", "calloc", "(", "1", ",", "sizeof", "(", "active_response", ")", ")", ";", "if", "(", "!", "tmp_ar", ")", "{", "merror", "(", "MEM_ERROR", ",", "__local_name", ",", "errno", ",", "strerror", "(", "errno", ")", ")", ";", "fclose", "(", "fp", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "Initialize", "variables", "*/", "tmp_ar", "->", "name", "=", "NULL", ";", "tmp_ar", "->", "command", "=", "NULL", ";", "tmp_ar", "->", "location", "=", "0", ";", "tmp_ar", "->", "timeout", "=", "0", ";", "tmp_ar", "->", "level", "=", "0", ";", "tmp_ar", "->", "agent_id", "=", "NULL", ";", "tmp_ar", "->", "rules_id", "=", "NULL", ";", "tmp_ar", "->", "rules_group", "=", "NULL", ";", "tmp_ar", "->", "ar_cmd", "=", "NULL", ";", "tmp_location", "=", "NULL", ";", "/*", "Search", "for", "the", "commands", "*/", "while", "(", "node", "[", "i", "]", ")", "{", "if", "(", "!", "node", "[", "i", "]", "->", "element", ")", "{", "merror", "(", "XML_ELEMNULL", ",", "__local_name", ")", ";", "goto", "error_invalid", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "!", "node", "[", "i", "]", "->", "content", ")", "{", "merror", "(", "XML_VALUENULL", ",", "__local_name", ",", "node", "[", "i", "]", "->", "element", ")", ";", "goto", "error_invalid", ";", "}", "/*", "Command", "*/", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_command", ")", "==", "0", ")", "{", "tmp_ar", "->", "command", "=", "strdup", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "/*", "Target", "*/", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_location", ")", "==", "0", ")", "{", "free", "(", "tmp_location", ")", ";", "tmp_location", "=", "strdup", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_agent_id", ")", "==", "0", ")", "{", "tmp_ar", "->", "agent_id", "=", "strdup", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_rules_id", ")", "==", "0", ")", "{", "tmp_ar", "->", "rules_id", "=", "strdup", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_rules_group", ")", "==", "0", ")", "{", "tmp_ar", "->", "rules_group", "=", "strdup", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_level", ")", "==", "0", ")", "{", "/*", "Level", "must", "be", "numeric", "*/", "if", "(", "!", "OS_StrIsNum", "(", "node", "[", "i", "]", "->", "content", ")", ")", "{", "merror", "(", "XML_VALUEERR", ",", "__local_name", ",", "node", "[", "i", "]", "->", "element", ",", "node", "[", "i", "]", "->", "content", ")", ";", "goto", "error_invalid", ";", "}", "tmp_ar", "->", "level", "=", "atoi", "(", "node", "[", "i", "]", "->", "content", ")", ";", "/*", "Make", "sure", "the", "level", "is", "valid", "*/", "if", "(", "(", "tmp_ar", "->", "level", "<", "0", ")", "||", "(", "tmp_ar", "->", "level", ">", "20", ")", ")", "{", "merror", "(", "XML_VALUEERR", ",", "__local_name", ",", "node", "[", "i", "]", "->", "element", ",", "node", "[", "i", "]", "->", "content", ")", ";", "goto", "error_invalid", ";", "}", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_timeout", ")", "==", "0", ")", "{", "tmp_ar", "->", "timeout", "=", "atoi", "(", "node", "[", "i", "]", "->", "content", ")", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_disabled", ")", "==", "0", ")", "{", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "content", ",", "\"yes\"", ")", "==", "0", ")", "{", "ar_flag", "=", "-", "1", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "content", ",", "\"no\"", ")", "==", "0", ")", "{", "/*", "Don\\'t", "do", "anything", "if", "disabled", "is", "set", "to", "\"no\"", "*/", "}", "else", "{", "merror", "(", "XML_VALUEERR", ",", "__local_name", ",", "node", "[", "i", "]", "->", "element", ",", "node", "[", "i", "]", "->", "content", ")", ";", "goto", "error_invalid", ";", "}", "}", "<if", "type=\"elseif\">", "else", "if", "(", "strcmp", "(", "node", "[", "i", "]", "->", "element", ",", "xml_ar_repeated", ")", "==", "0", ")", "{", "/*", "Nothing", "-", "we", "deal", "with", "it", "on", "execd", "*/", "rpt", "=", "1", ";", "}", "else", "{", "merror", "(", "XML_INVELEM", ",", "__local_name", ",", "node", "[", "i", "]", "->", "element", ")", ";", "goto", "error_invalid", ";", "}", "i", "++", ";", "}", "/*", "Check", "if", "ar", "is", "disabled", "*/", "if", "(", "ar_flag", "==", "-", "1", ")", "{", "/*", "reset", "ar_flag,", "the", "next", "ar", "command", "may", "not", "be", "disabled", "*/", "ar_flag", "=", "0", ";", "debug1", "(", "\"active", "response", "command", "\\'%s\\'", "is", "disabled\"", ",", "tmp_ar", "->", "command", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "free", "(", "tmp_location", ")", ";", "return", "(", "0", ")", ";", "}", "/*", "Command", "and", "location", "must", "be", "there", "*/", "if", "(", "!", "tmp_ar", "->", "command", "||", "!", "tmp_location", ")", "{", "debug1", "(", "\"command", "or", "location", "missing\"", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "free", "(", "tmp_location", ")", ";", "if", "(", "rpt", "==", "1", ")", "{", "return", "(", "0", ")", ";", "}", "merror", "(", "AR_MISS", ",", "__local_name", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "analysisd", "*/", "if", "(", "OS_Regex", "(", "\"AS|analysisd|analysis-server|server\"", ",", "tmp_location", ")", ")", "{", "tmp_ar", "->", "location", "|=", "AS_ONLY", ";", "}", "if", "(", "OS_Regex", "(", "\"local\"", ",", "tmp_location", ")", ")", "{", "tmp_ar", "->", "location", "|=", "REMOTE_AGENT", ";", "}", "if", "(", "OS_Regex", "(", "\"defined-agent\"", ",", "tmp_location", ")", ")", "{", "if", "(", "!", "tmp_ar", "->", "agent_id", ")", "{", "debug1", "(", "\"\\'defined-agent\\'", "agent_id", "not", "defined\"", ")", ";", "merror", "(", "AR_DEF_AGENT", ",", "__local_name", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "free", "(", "tmp_location", ")", ";", "return", "(", "-", "1", ")", ";", "}", "tmp_ar", "->", "location", "|=", "SPECIFIC_AGENT", ";", "}", "if", "(", "OS_Regex", "(", "\"all|any\"", ",", "tmp_location", ")", ")", "{", "tmp_ar", "->", "location", "|=", "ALL_AGENTS", ";", "}", "/*", "If", "we", "didn\\'t", "set", "any", "value", "for", "the", "location", "*/", "if", "(", "tmp_ar", "->", "location", "==", "0", ")", "{", "debug1", "(", "\"no", "location", "defined\"", ")", ";", "merror", "(", "AR_INV_LOC", ",", "__local_name", ",", "tmp_location", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "free", "(", "tmp_location", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "Clean", "tmp_location", "*/", "free", "(", "tmp_location", ")", ";", "tmp_location", "=", "NULL", ";", "/*", "Check", "if", "command", "name", "is", "valid", "*/", "{", "OSListNode", "*", "my_commands_node", ";", "my_commands_node", "=", "OSList_GetFirstNode", "(", "l1", ")", ";", "while", "(", "my_commands_node", ")", "{", "ar_command", "*", "my_command", ";", "my_command", "=", "(", "ar_command", "*", ")", "my_commands_node", "->", "data", ";", "if", "(", "strcmp", "(", "my_command", "->", "name", ",", "tmp_ar", "->", "command", ")", "==", "0", ")", "{", "tmp_ar", "->", "ar_cmd", "=", "my_command", ";", "break;", "}", "my_commands_node", "=", "OSList_GetNextNode", "(", "l1", ")", ";", "}", "/*", "Didn\\'t", "find", "a", "valid", "command", "*/", "if", "(", "tmp_ar", "->", "ar_cmd", "==", "NULL", ")", "{", "debug1", "(", "\"invalid", "command\"", ")", ";", "merror", "(", "AR_INV_CMD", ",", "__local_name", ",", "tmp_ar", "->", "command", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "return", "(", "-", "1", ")", ";", "}", "}", "/*", "Check", "if", "timeout", "is", "allowed", "*/", "if", "(", "tmp_ar", "->", "timeout", "&&", "!", "tmp_ar", "->", "ar_cmd", "->", "timeout_allowed", ")", "{", "debug1", "(", "\"timeout", "is", "not", "allowed\"", ")", ";", "merror", "(", "AR_NO_TIMEOUT", ",", "__local_name", ",", "tmp_ar", "->", "ar_cmd", "->", "name", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "d1", "is", "the", "active", "response", "list", "*/", "if", "(", "!", "OSList_AddData", "(", "l2", ",", "(", "void", "*", ")", "tmp_ar", ")", ")", "{", "merror", "(", "LIST_ADD_ERROR", ",", "__local_name", ")", ";", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "return", "(", "-", "1", ")", ";", "}", "/*", "Set", "a", "unique", "active", "response", "name", "*/", "tmp_ar", "->", "name", "=", "(", "char", "*", ")", "calloc", "(", "OS_FLSIZE", "+", "1", ",", "sizeof", "(", "char", ")", ")", ";", "if", "(", "!", "tmp_ar", "->", "name", ")", "{", "ErrorExit", "(", "MEM_ERROR", ",", "__local_name", ",", "errno", ",", "strerror", "(", "errno", ")", ")", ";", "}", "snprintf", "(", "tmp_ar", "->", "name", ",", "OS_FLSIZE", ",", "\"%s%d\"", ",", "tmp_ar", "->", "ar_cmd", "->", "name", ",", "tmp_ar", "->", "timeout", ")", ";", "/*", "Add", "to", "shared", "file", "*/", "debug1", "(", "\"writing", "command", "\\'%s\\'", "to", "\\'%s\\'\"", ",", "tmp_ar", "->", "command", ",", "DEFAULTARPATH", ")", ";", "fprintf", "(", "fp", ",", "\"%s", "-", "%s", "-", "%d\\\"", ",", "tmp_ar", "->", "name", ",", "tmp_ar", "->", "ar_cmd", "->", "executable", ",", "tmp_ar", "->", "timeout", ")", ";", "/*", "Set", "the", "configs", "to", "start", "the", "right", "queues", "*/", "if", "(", "tmp_ar", "->", "location", "&", "AS_ONLY", ")", "{", "l_ar", "=", "1", ";", "}", "if", "(", "tmp_ar", "->", "location", "&", "ALL_AGENTS", ")", "{", "r_ar", "=", "1", ";", "}", "if", "(", "tmp_ar", "->", "location", "&", "REMOTE_AGENT", ")", "{", "r_ar", "=", "1", ";", "l_ar", "=", "1", ";", "}", "if", "(", "tmp_ar", "->", "location", "&", "SPECIFIC_AGENT", ")", "{", "r_ar", "=", "1", ";", "}", "/*", "Set", "the", "configuration", "for", "the", "active", "response", "*/", "if", "(", "r_ar", "&&", "(", "!", "(", "ar_flag", "&", "REMOTE_AR", ")", ")", ")", "{", "ar_flag", "|=", "REMOTE_AR", ";", "}", "if", "(", "l_ar", "&&", "(", "!", "(", "ar_flag", "&", "LOCAL_AR", ")", ")", ")", "{", "ar_flag", "|=", "LOCAL_AR", ";", "}", "/*", "Close", "shared", "file", "for", "active", "response", "*/", "fclose", "(", "fp", ")", ";", "/*", "Done", "over", "here", "*/", "return", "(", "0", ")", ";", "error_invalid", ":", "/*", "In", "case", "of", "an", "error", "clean", "up", "first*/", "fclose", "(", "fp", ")", ";", "free", "(", "tmp_ar", ")", ";", "free", "(", "tmp_location", ")", ";", "return", "(", "OS_INVALID", ")", ";", "}'" ]
ReadActiveResponses
ossec/ossec-hids
single_line
valid
9,526
79,046
[ "Clean", "up", "the", "Dwarf_Obj_Access_Interface", "returned", "by", "elf_access_init" ]
[ "'void", "dwarf_elf_object_access_finish", "(", "Dwarf_Obj_Access_Interface", "*", "obj", ")", "{", "if", "(", "!", "obj", ")", "{", "return", ";", "}", "if", "(", "obj", "->", "object", ")", "{", "dwarf_elf_object_access_internals_t", "*", "internals", "=", "(", "dwarf_elf_object_access_internals_t", "*", ")", "obj", "->", "object", ";", "if", "(", "internals", "->", "libdwarf_owns_elf", ")", "{", "elf_end", "(", "internals", "->", "elf", ")", ";", "}", "}", "free", "(", "obj", "->", "object", ")", ";", "free", "(", "obj", ")", ";", "}'" ]
dwarf_elf_object_access_finish
LLNL/STAT
single_line
valid
9,527
79,088
[ "Once", "per", "rd_kafka_t", "handle", "initialization", "of", "OpenSSL" ]
[ "'int", "rd_kafka_ssl_ctx_init", "(", "rd_kafka_t", "*", "rk", ",", "char", "*", "errstr", ",", "size_t", "errstr_size", ")", "{", "int", "r", ";", "SSL_CTX", "*", "ctx", ";", "const", "char", "*", "linking", "=", "#", "if", "WITH_STATIC_LIB_libcrypto", "\"statically", "linked", "\"", "#", "else", "\"\"", "#", "endif", ";", "#", "if", "OPENSSL_VERSION_NUMBER", ">=", "0x10100000", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"OPENSSL\"", ",", "\"Using", "%sOpenSSL", "version", "%s", "\"", "\"(0x%lx,", "librdkafka", "built", "with", "0x%lx)\"", ",", "linking", ",", "OpenSSL_version", "(", "OPENSSL_VERSION", ")", ",", "OpenSSL_version_num", "()", ",", "OPENSSL_VERSION_NUMBER", ")", ";", "#", "else", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"OPENSSL\"", ",", "\"librdkafka", "built", "with", "%sOpenSSL", "version", "0x%lx\"", ",", "linking", ",", "OPENSSL_VERSION_NUMBER", ")", ";", "#", "endif", "if", "(", "errstr_size", ">", "0", ")", "errstr", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "ctx", "=", "SSL_CTX_new", "(", "SSLv23_client_method", "()", ")", ";", "if", "(", "!", "ctx", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"SSLv23_client_method()", "failed:", "\"", ")", ";", "goto", "fail", ";", "}", "#", "ifdef", "SSL_OP_NO_SSLv3", "/*", "Disable", "SSLv3", "(unsafe)", "*/", "SSL_CTX_set_options", "(", "ctx", ",", "SSL_OP_NO_SSLv3", ")", ";", "#", "endif", "/*", "Key", "file", "password", "callback", "*/", "SSL_CTX_set_default_passwd_cb", "(", "ctx", ",", "rd_kafka_transport_ssl_passwd_cb", ")", ";", "SSL_CTX_set_default_passwd_cb_userdata", "(", "ctx", ",", "rk", ")", ";", "/*", "Ciphers", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "cipher_suites", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Setting", "cipher", "list:", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cipher_suites", ")", ";", "if", "(", "!", "SSL_CTX_set_cipher_list", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cipher_suites", ")", ")", "{", "/*", "Set", "a", "string", "that", "will", "prefix", "the", "*", "the", "OpenSSL", "error", "message", "(which", "is", "lousy)", "*", "to", "make", "it", "more", "meaningful.", "*/", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.cipher.suites", "failed:", "\"", ")", ";", "goto", "fail", ";", "}", "}", "/*", "Set", "up", "broker", "certificate", "verification.", "*/", "SSL_CTX_set_verify", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "enable_verify", "?", "SSL_VERIFY_PEER", ":", "SSL_VERIFY_NONE", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_verify_cb", "?", "rd_kafka_transport_ssl_cert_verify_cb", ":", "NULL", ")", ";", "#", "if", "OPENSSL_VERSION_NUMBER", ">=", "0x1000200fL", "&&", "!", "defined", "(", "LIBRESSL_VERSION_NUMBER", ")", "/*", "Curves", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "curves_list", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Setting", "curves", "list:", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "curves_list", ")", ";", "if", "(", "!", "SSL_CTX_set1_curves_list", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "curves_list", ")", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.curves.list", "failed:", "\"", ")", ";", "goto", "fail", ";", "}", "}", "/*", "Certificate", "signature", "algorithms", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "sigalgs_list", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Setting", "signature", "algorithms", "list:", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "sigalgs_list", ")", ";", "if", "(", "!", "SSL_CTX_set1_sigalgs_list", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "sigalgs_list", ")", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.sigalgs.list", "failed:", "\"", ")", ";", "goto", "fail", ";", "}", "}", "#", "endif", "/*", "Register", "certificates,", "keys,", "etc.", "*/", "if", "(", "rd_kafka_ssl_set_certs", "(", "rk", ",", "ctx", ",", "errstr", ",", "errstr_size", ")", "==", "-", "1", ")", "goto", "fail", ";", "SSL_CTX_set_mode", "(", "ctx", ",", "SSL_MODE_ENABLE_PARTIAL_WRITE", ")", ";", "rk", "->", "rk_conf", ".", "ssl", ".", "ctx", "=", "ctx", ";", "return", "0", ";", "fail", ":", "r", "=", "(", "int", ")", "strlen", "(", "errstr", ")", ";", "rd_kafka_ssl_error", "(", "rk", ",", "NULL", ",", "errstr", "+", "r", ",", "(", "int", ")", "errstr_size", ">", "r", "?", "(", "int", ")", "errstr_size", "-", "r", ":", "0", ")", ";", "SSL_CTX_free", "(", "ctx", ")", ";", "return", "-", "1", ";", "}'" ]
rd_kafka_ssl_ctx_init
edenhill/kafkacat
multi_line
valid
9,528
79,089
[ "Registers", "certificates,", "keys,", "etc,", "on", "the", "SSL_CTX" ]
[ "'static", "int", "rd_kafka_ssl_set_certs", "(", "rd_kafka_t", "*", "rk", ",", "SSL_CTX", "*", "ctx", ",", "char", "*", "errstr", ",", "size_t", "errstr_size", ")", "{", "rd_bool_t", "check_pkey", "=", "rd_false", ";", "int", "r", ";", "/*", "*", "ssl_ca,", "ssl.ca.location,", "or", "Windows", "cert", "root", "store,", "*", "or", "default", "paths.", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca", ")", "{", "/*", "CA", "certificate", "chain", "set", "with", "conf_set_ssl_cert()", "*/", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "CA", "certificate(s)", "from", "memory\"", ")", ";", "SSL_CTX_set_cert_store", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "ca", "->", "store", ")", ";", "/*", "OpenSSL", "takes", "ownership", "of", "the", "store", "*/", "rk", "->", "rk_conf", ".", "ssl", ".", "ca", "->", "store", "=", "NULL", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", "&&", "strcmp", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ",", "\"probe\"", ")", ")", "{", "/*", "CA", "certificate", "location,", "either", "file", "or", "directory.", "*/", "int", "is_dir", "=", "rd_kafka_path_is_dir", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ")", ";", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "CA", "certificate(s)", "from", "%s", "%s\"", ",", "is_dir", "?", "\"directory\"", ":", "\"file\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ")", ";", "r", "=", "SSL_CTX_load_verify_locations", "(", "ctx", ",", "!", "is_dir", "?", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ":", "NULL", ",", "is_dir", "?", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ":", "NULL", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.ca.location", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "}", "else", "{", "#", "if", "_MSC_VER", "/*", "Attempt", "to", "load", "CA", "root", "certificates", "from", "the", "*", "Windows", "crypto", "Root", "cert", "store.", "*/", "r", "=", "rd_kafka_ssl_win_load_root_certs", "(", "rk", ",", "ctx", ")", ";", "#", "else", "r", "=", "-", "1", ";", "#", "endif", "if", "(", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", "&&", "!", "strcmp", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "ca_location", ",", "\"probe\"", ")", ")", "#", "if", "WITH_STATIC_LIB_libcrypto", "||", "r", "==", "-", "1", "#", "endif", ")", "{", "/*", "If", "OpenSSL", "was", "linked", "statically", "there", "is", "a", "risk", "*", "that", "the", "system", "installed", "CA", "certificate", "path", "*", "doesn\\'t", "match", "the", "cert", "path", "of", "OpenSSL.", "*", "To", "circumvent", "this", "we", "check", "for", "the", "existence", "*", "of", "standard", "CA", "certificate", "paths", "and", "use", "the", "*", "first", "one", "that", "is", "found.", "*", "Ignore", "failures.", "*/", "r", "=", "rd_kafka_ssl_probe_and_set_default_ca_location", "(", "rk", ",", "ctx", ")", ";", "}", "if", "(", "r", "==", "-", "1", ")", "{", "/*", "Use", "default", "CA", "certificate", "paths", "from", "linked", "OpenSSL:", "*", "ignore", "failures", "*/", "r", "=", "SSL_CTX_set_default_verify_paths", "(", "ctx", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "char", "errstr2", "[", "512", "]", ";", "/*", "Read", "error", "and", "clear", "the", "error", "stack.", "*/", "rd_kafka_ssl_error", "(", "rk", ",", "NULL", ",", "errstr2", ",", "sizeof", "(", "errstr2", ")", ")", ";", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"SSL_CTX_set_default_verify_paths()", "\"", "\"failed:", "%s:", "ignoring\"", ",", "errstr2", ")", ";", "}", "r", "=", "0", ";", "}", "}", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "crl_location", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "CRL", "from", "file", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "crl_location", ")", ";", "r", "=", "SSL_CTX_load_verify_locations", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "crl_location", ",", "NULL", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.crl.location", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Enabling", "CRL", "checks\"", ")", ";", "X509_STORE_set_flags", "(", "SSL_CTX_get_cert_store", "(", "ctx", ")", ",", "X509_V_FLAG_CRL_CHECK", ")", ";", "}", "/*", "*", "ssl_cert,", "ssl.certificate.location", "and", "ssl.certificate.pem", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "cert", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "public", "key", "from", "memory\"", ")", ";", "rd_assert", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "cert", "->", "x509", ")", ";", "r", "=", "SSL_CTX_use_certificate", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cert", "->", "x509", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl_cert", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "}", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_location", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "public", "key", "from", "file", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_location", ")", ";", "r", "=", "SSL_CTX_use_certificate_chain_file", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_location", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.certificate.location", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "}", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_pem", ")", "{", "X509", "*", "x509", ";", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "public", "key", "from", "string\"", ")", ";", "x509", "=", "rd_kafka_ssl_X509_from_string", "(", "rk", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_pem", ")", ";", "if", "(", "!", "x509", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.certificate.pem", "failed:", "\"", "\"not", "in", "PEM", "format?:", "\"", ")", ";", "return", "-", "1", ";", "}", "r", "=", "SSL_CTX_use_certificate", "(", "ctx", ",", "x509", ")", ";", "X509_free", "(", "x509", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.certificate.pem", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "}", "/*", "*", "ssl_key,", "ssl.key.location", "and", "ssl.key.pem", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "key", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "private", "key", "file", "from", "memory\"", ")", ";", "rd_assert", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "key", "->", "pkey", ")", ";", "r", "=", "SSL_CTX_use_PrivateKey", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "key", "->", "pkey", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl_key", "(in-memory)", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "check_pkey", "=", "rd_true", ";", "}", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "key_location", ")", "{", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "private", "key", "file", "from", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "key_location", ")", ";", "r", "=", "SSL_CTX_use_PrivateKey_file", "(", "ctx", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "key_location", ",", "SSL_FILETYPE_PEM", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.key.location", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "check_pkey", "=", "rd_true", ";", "}", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "key_pem", ")", "{", "EVP_PKEY", "*", "pkey", ";", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "private", "key", "from", "string\"", ")", ";", "pkey", "=", "rd_kafka_ssl_PKEY_from_string", "(", "rk", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "key_pem", ")", ";", "if", "(", "!", "pkey", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.key.pem", "failed:", "\"", "\"not", "in", "PEM", "format?:", "\"", ")", ";", "return", "-", "1", ";", "}", "r", "=", "SSL_CTX_use_PrivateKey", "(", "ctx", ",", "pkey", ")", ";", "EVP_PKEY_free", "(", "pkey", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"ssl.key.pem", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "/*", "We", "no", "longer", "need", "the", "PEM", "key", "(it", "is", "cached", "in", "the", "CTX),", "*", "clear", "its", "memory.", "*/", "rd_kafka_desensitize_str", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "key_pem", ")", ";", "check_pkey", "=", "rd_true", ";", "}", "/*", "*", "ssl.keystore.location", "*/", "if", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_location", ")", "{", "FILE", "*", "fp", ";", "EVP_PKEY", "*", "pkey", ";", "X509", "*", "cert", ";", "STACK_OF", "(", "X509", ")", "*", "ca", "=", "NULL", ";", "PKCS12", "*", "p12", ";", "rd_kafka_dbg", "(", "rk", ",", "SECURITY", ",", "\"SSL\"", ",", "\"Loading", "client\\'s", "keystore", "file", "from", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_location", ")", ";", "if", "(", "!", "(", "fp", "=", "fopen", "(", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_location", ",", "\"rb\"", ")", ")", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Failed", "to", "open", "ssl.keystore.location:", "\"", "\"%s:", "%s\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_location", ",", "rd_strerror", "(", "errno", ")", ")", ";", "return", "-", "1", ";", "}", "p12", "=", "d2i_PKCS12_fp", "(", "fp", ",", "NULL", ")", ";", "fclose", "(", "fp", ")", ";", "if", "(", "!", "p12", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Error", "reading", "PKCS#12", "file:", "\"", ")", ";", "return", "-", "1", ";", "}", "pkey", "=", "EVP_PKEY_new", "()", ";", "cert", "=", "X509_new", "()", ";", "if", "(", "!", "PKCS12_parse", "(", "p12", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_password", ",", "&", "pkey", ",", "&", "cert", ",", "&", "ca", ")", ")", "{", "EVP_PKEY_free", "(", "pkey", ")", ";", "X509_free", "(", "cert", ")", ";", "PKCS12_free", "(", "p12", ")", ";", "if", "(", "ca", "!=", "NULL", ")", "sk_X509_pop_free", "(", "ca", ",", "X509_free", ")", ";", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Failed", "to", "parse", "PKCS#12", "file:", "%s:", "\"", ",", "rk", "->", "rk_conf", ".", "ssl", ".", "keystore_location", ")", ";", "return", "-", "1", ";", "}", "if", "(", "ca", "!=", "NULL", ")", "sk_X509_pop_free", "(", "ca", ",", "X509_free", ")", ";", "PKCS12_free", "(", "p12", ")", ";", "r", "=", "SSL_CTX_use_certificate", "(", "ctx", ",", "cert", ")", ";", "X509_free", "(", "cert", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "EVP_PKEY_free", "(", "pkey", ")", ";", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Failed", "to", "use", "ssl.keystore.location", "\"", "\"certificate:", "\"", ")", ";", "return", "-", "1", ";", "}", "r", "=", "SSL_CTX_use_PrivateKey", "(", "ctx", ",", "pkey", ")", ";", "EVP_PKEY_free", "(", "pkey", ")", ";", "if", "(", "r", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Failed", "to", "use", "ssl.keystore.location", "\"", "\"private", "key:", "\"", ")", ";", "return", "-", "1", ";", "}", "check_pkey", "=", "rd_true", ";", "}", "/*", "Check", "that", "a", "valid", "private/public", "key", "combo", "was", "set.", "*/", "if", "(", "check_pkey", "&&", "SSL_CTX_check_private_key", "(", "ctx", ")", "!=", "1", ")", "{", "rd_snprintf", "(", "errstr", ",", "errstr_size", ",", "\"Private", "key", "check", "failed:", "\"", ")", ";", "return", "-", "1", ";", "}", "return", "0", ";", "}'" ]
rd_kafka_ssl_set_certs
edenhill/kafkacat
multi_line
valid
9,529
79,090
[ "OpenSSL", "callback", "to", "perform", "additional", "broker", "certificate" ]
[ "'static", "int", "rd_kafka_transport_ssl_cert_verify_cb", "(", "int", "preverify_ok", ",", "X509_STORE_CTX", "*", "x509_ctx", ")", "{", "rd_kafka_transport_t", "*", "rktrans", "=", "rd_kafka_curr_transport", ";", "rd_kafka_broker_t", "*", "rkb", ";", "rd_kafka_t", "*", "rk", ";", "X509", "*", "cert", ";", "char", "*", "buf", "=", "NULL", ";", "int", "buf_size", ";", "int", "depth", ";", "int", "x509_orig_error", ",", "<type", "ref=\"prev\"/>", "x509_error", ";", "char", "errstr", "[", "512", "]", ";", "int", "ok", ";", "rd_assert", "(", "rktrans", "!=", "NULL", ")", ";", "rkb", "=", "rktrans", "->", "rktrans_rkb", ";", "rk", "=", "rkb", "->", "rkb_rk", ";", "cert", "=", "X509_STORE_CTX_get_current_cert", "(", "x509_ctx", ")", ";", "if", "(", "!", "cert", ")", "{", "rd_rkb_log", "(", "rkb", ",", "LOG_ERR", ",", "\"SSLCERTVRFY\"", ",", "\"Failed", "to", "get", "current", "certificate", "to", "verify\"", ")", ";", "return", "0", ";", "}", "depth", "=", "X509_STORE_CTX_get_error_depth", "(", "x509_ctx", ")", ";", "x509_orig_error", "=", "x509_error", "=", "X509_STORE_CTX_get_error", "(", "x509_ctx", ")", ";", "buf_size", "=", "i2d_X509", "(", "cert", ",", "(", "unsigned", "char", "*", "*", ")", "&", "buf", ")", ";", "if", "(", "buf_size", "<", "0", "||", "!", "buf", ")", "{", "rd_rkb_log", "(", "rkb", ",", "LOG_ERR", ",", "\"SSLCERTVRFY\"", ",", "\"Unable", "to", "convert", "certificate", "to", "X509", "format\"", ")", ";", "return", "0", ";", "}", "*", "errstr", "=", "\\'\\\\0\\'", ";", "/*", "Call", "application\\'s", "verification", "callback.", "*/", "ok", "=", "rk", "->", "rk_conf", ".", "ssl", ".", "cert_verify_cb", "(", "rk", ",", "rkb", "->", "rkb_nodename", ",", "rkb", "->", "rkb_nodeid", ",", "&", "x509_error", ",", "depth", ",", "buf", ",", "(", "size_t", ")", "buf_size", ",", "errstr", ",", "sizeof", "(", "errstr", ")", ",", "rk", "->", "rk_conf", ".", "opaque", ")", ";", "OPENSSL_free", "(", "buf", ")", ";", "if", "(", "!", "ok", ")", "{", "char", "subject", "[", "128", "]", ";", "char", "issuer", "[", "128", "]", ";", "X509_NAME_oneline", "(", "X509_get_subject_name", "(", "cert", ")", ",", "subject", ",", "sizeof", "(", "subject", ")", ")", ";", "X509_NAME_oneline", "(", "X509_get_issuer_name", "(", "cert", ")", ",", "issuer", ",", "sizeof", "(", "issuer", ")", ")", ";", "rd_rkb_log", "(", "rkb", ",", "LOG_ERR", ",", "\"SSLCERTVRFY\"", ",", "\"Certificate", "(subject=%s,", "issuer=%s)", "verification", "\"", "\"callback", "failed:", "%s\"", ",", "subject", ",", "issuer", ",", "errstr", ")", ";", "X509_STORE_CTX_set_error", "(", "x509_ctx", ",", "x509_error", ")", ";", "return", "0", ";", "/*", "verification", "failed", "*/", "}", "/*", "Clear", "error", "*/", "if", "(", "x509_orig_error", "!=", "0", "&&", "x509_error", "==", "0", ")", "X509_STORE_CTX_set_error", "(", "x509_ctx", ",", "0", ")", ";", "return", "1", ";", "/*", "verification", "successful", "*/", "}'" ]
rd_kafka_transport_ssl_cert_verify_cb
edenhill/kafkacat
multi_line
valid
9,530
79,091
[ "Global", "(once", "per", "process)", "OpenSSL", "init" ]
[ "'void", "rd_kafka_ssl_init", "(", "void", ")", "{", "#", "if", "OPENSSL_VERSION_NUMBER", "<", "0x10100000L", "int", "i", ";", "if", "(", "!", "CRYPTO_get_locking_callback", "()", ")", "{", "rd_kafka_ssl_locks_cnt", "=", "CRYPTO_num_locks", "()", ";", "rd_kafka_ssl_locks", "=", "rd_malloc", "(", "rd_kafka_ssl_locks_cnt", "*", "sizeof", "(", "*", "rd_kafka_ssl_locks", ")", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "rd_kafka_ssl_locks_cnt", ";", "i", "++", ")", "mtx_init", "(", "&", "rd_kafka_ssl_locks", "[", "i", "]", ",", "mtx_plain", ")", ";", "CRYPTO_set_locking_callback", "(", "rd_kafka_transport_ssl_lock_cb", ")", ";", "#", "ifdef", "HAVE_OPENSSL_CRYPTO_THREADID_SET_CALLBACK", "CRYPTO_THREADID_set_callback", "(", "rd_kafka_transport_libcrypto_THREADID_callback", ")", ";", "#", "else", "CRYPTO_set_id_callback", "(", "rd_kafka_transport_ssl_threadid_cb", ")", ";", "#", "endif", "}", "/*", "OPENSSL_init_ssl(3)", "and", "OPENSSL_init_crypto(3)", "say:", "*", "\"As", "of", "version", "1.1.0", "OpenSSL", "will", "automatically", "allocate", "*", "all", "resources", "that", "it", "needs", "so", "no", "explicit", "initialisation", "*", "is", "required.", "Similarly", "it", "will", "also", "automatically", "*", "deinitialise", "as", "required.\"", "*/", "SSL_load_error_strings", "()", ";", "SSL_library_init", "()", ";", "ERR_load_BIO_strings", "()", ";", "ERR_load_crypto_strings", "()", ";", "OpenSSL_add_all_algorithms", "()", ";", "#", "endif", "}'" ]
rd_kafka_ssl_init
edenhill/kafkacat
multi_line
valid
9,531
79,092
[ "Set", "up", "SSL", "for", "a", "newly", "connected", "connection" ]
[ "'int", "rd_kafka_transport_ssl_connect", "(", "rd_kafka_broker_t", "*", "rkb", ",", "rd_kafka_transport_t", "*", "rktrans", ",", "char", "*", "errstr", ",", "size_t", "errstr_size", ")", "{", "int", "r", ";", "rktrans", "->", "rktrans_ssl", "=", "SSL_new", "(", "rkb", "->", "rkb_rk", "->", "rk_conf", ".", "ssl", ".", "ctx", ")", ";", "if", "(", "!", "rktrans", "->", "rktrans_ssl", ")", "goto", "fail", ";", "if", "(", "!", "SSL_set_fd", "(", "rktrans", "->", "rktrans_ssl", ",", "(", "int", ")", "rktrans", "->", "rktrans_s", ")", ")", "goto", "fail", ";", "if", "(", "rd_kafka_transport_ssl_set_endpoint_id", "(", "rktrans", ",", "errstr", ",", "errstr_size", ")", "==", "-", "1", ")", "return", "-", "1", ";", "rd_kafka_transport_ssl_clear_error", "(", "rktrans", ")", ";", "r", "=", "SSL_connect", "(", "rktrans", "->", "rktrans_ssl", ")", ";", "if", "(", "r", "==", "1", ")", "{", "/*", "Connected,", "highly", "unlikely", "since", "this", "is", "a", "*", "non-blocking", "operation.", "*/", "rd_kafka_transport_connect_done", "(", "rktrans", ",", "NULL", ")", ";", "return", "0", ";", "}", "if", "(", "rd_kafka_transport_ssl_io_update", "(", "rktrans", ",", "r", ",", "errstr", ",", "errstr_size", ")", "==", "-", "1", ")", "return", "-", "1", ";", "return", "0", ";", "fail", ":", "rd_kafka_ssl_error", "(", "NULL", ",", "rkb", ",", "errstr", ",", "errstr_size", ")", ";", "return", "-", "1", ";", "}'" ]
rd_kafka_transport_ssl_connect
edenhill/kafkacat
multi_line
valid
9,532
79,093
[ "resize", "hash", "table;", "new_size", "must", "be", "a", "power", "of", "2,", "can", "be", "larger", "or", "smaller", "than", "current", "size" ]
[ "'static", "bool", "hash_resize", "(", "zip_hash_t", "*", "hash", ",", "zip_uint32_t", "new_size", ",", "zip_error_t", "*", "error", ")", "{", "zip_hash_entry_t", "*", "*", "new_table", ";", "if", "(", "new_size", "==", "hash", "->", "table_size", ")", "{", "return", "true", ";", "}", "if", "(", "(", "new_table", "=", "(", "zip_hash_entry_t", "*", "*", ")", "calloc", "(", "new_size", ",", "sizeof", "(", "zip_hash_entry_t", "*", ")", ")", ")", "==", "NULL", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_MEMORY", ",", "0", ")", ";", "return", "false", ";", "}", "if", "(", "hash", "->", "nentries", ">", "0", ")", "{", "zip_uint32_t", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "hash", "->", "table_size", ";", "i", "++", ")", "{", "zip_hash_entry_t", "*", "entry", "=", "hash", "->", "table", "[", "i", "]", ";", "while", "(", "entry", ")", "{", "zip_hash_entry_t", "*", "next", "=", "entry", "->", "next", ";", "zip_uint32_t", "new_index", "=", "entry", "->", "hash_value", "%", "new_size", ";", "entry", "->", "next", "=", "new_table", "[", "new_index", "]", ";", "new_table", "[", "new_index", "]", "=", "entry", ";", "entry", "=", "next", ";", "}", "}", "}", "free", "(", "hash", "->", "table", ")", ";", "hash", "->", "table", "=", "new_table", ";", "hash", "->", "table_size", "=", "new_size", ";", "return", "true", ";", "}'" ]
hash_resize
vitasdk/vita-toolchain
single_line
valid
9,533
79,094
[ "find", "value", "for", "entry", "in", "hash,", "1", "if", "not", "found" ]
[ "'zip_int64_t", "_zip_hash_lookup", "(", "zip_hash_t", "*", "hash", ",", "const", "zip_uint8_t", "*", "name", ",", "zip_flags_t", "flags", ",", "zip_error_t", "*", "error", ")", "{", "zip_uint32_t", "hash_value", ",", "<type", "ref=\"prev\"/>", "index", ";", "zip_hash_entry_t", "*", "entry", ";", "if", "(", "hash", "==", "NULL", "||", "name", "==", "NULL", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_INVAL", ",", "0", ")", ";", "return", "-", "1", ";", "}", "if", "(", "hash", "->", "nentries", ">", "0", ")", "{", "hash_value", "=", "hash_string", "(", "name", ")", ";", "index", "=", "hash_value", "%", "hash", "->", "table_size", ";", "for", "(", "entry", "=", "hash", "->", "table", "[", "index", "]", ";", "entry", "!=", "NULL", ";", "entry", "=", "entry", "->", "next", ")", "{", "if", "(", "strcmp", "(", "(", "const", "char", "*", ")", "name", ",", "(", "const", "char", "*", ")", "entry", "->", "name", ")", "==", "0", ")", "{", "if", "(", "flags", "&", "ZIP_FL_UNCHANGED", ")", "{", "if", "(", "entry", "->", "orig_index", "!=", "-", "1", ")", "{", "return", "entry", "->", "orig_index", ";", "}", "}", "else", "{", "if", "(", "entry", "->", "current_index", "!=", "-", "1", ")", "{", "return", "entry", "->", "current_index", ";", "}", "}", "break;", "}", "}", "}", "zip_error_set", "(", "error", ",", "ZIP_ER_NOENT", ",", "0", ")", ";", "return", "-", "1", ";", "}'" ]
_zip_hash_lookup
vitasdk/vita-toolchain
single_line
valid
9,534
79,095
[ "compute", "hash", "of", "string,", "full", "32", "bit", "value" ]
[ "'static", "zip_uint32_t", "hash_string", "(", "const", "zip_uint8_t", "*", "name", ")", "{", "zip_uint64_t", "value", "=", "HASH_START", ";", "if", "(", "name", "==", "NULL", ")", "{", "return", "0", ";", "}", "while", "(", "*", "name", "!=", "0", ")", "{", "value", "=", "(", "zip_uint64_t", ")", "(", "(", "(", "value", "*", "HASH_MULTIPLIER", ")", "+", "(", "zip_uint8_t", ")", "*", "name", ")", "%", "0x100000000ul", ")", ";", "name", "++", ";", "}", "return", "(", "zip_uint32_t", ")", "value", ";", "}'" ]
hash_string
vitasdk/vita-toolchain
single_line
valid
9,535
79,096
[ "insert", "into", "hash,", "return", "error", "on", "existence", "or", "memory", "issues" ]
[ "'bool", "_zip_hash_add", "(", "zip_hash_t", "*", "hash", ",", "const", "zip_uint8_t", "*", "name", ",", "zip_uint64_t", "index", ",", "zip_flags_t", "flags", ",", "zip_error_t", "*", "error", ")", "{", "zip_uint32_t", "hash_value", ",", "<type", "ref=\"prev\"/>", "table_index", ";", "zip_hash_entry_t", "*", "entry", ";", "if", "(", "hash", "==", "NULL", "||", "name", "==", "NULL", "||", "index", ">", "ZIP_INT64_MAX", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_INVAL", ",", "0", ")", ";", "return", "false", ";", "}", "if", "(", "hash", "->", "table_size", "==", "0", ")", "{", "if", "(", "!", "hash_resize", "(", "hash", ",", "HASH_MIN_SIZE", ",", "error", ")", ")", "{", "return", "false", ";", "}", "}", "hash_value", "=", "hash_string", "(", "name", ")", ";", "table_index", "=", "hash_value", "%", "hash", "->", "table_size", ";", "for", "(", "entry", "=", "hash", "->", "table", "[", "table_index", "]", ";", "entry", "!=", "NULL", ";", "entry", "=", "entry", "->", "next", ")", "{", "if", "(", "entry", "->", "hash_value", "==", "hash_value", "&&", "strcmp", "(", "(", "const", "char", "*", ")", "name", ",", "(", "const", "char", "*", ")", "entry", "->", "name", ")", "==", "0", ")", "{", "if", "(", "(", "(", "flags", "&", "ZIP_FL_UNCHANGED", ")", "&&", "entry", "->", "orig_index", "!=", "-", "1", ")", "||", "entry", "->", "current_index", "!=", "-", "1", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_EXISTS", ",", "0", ")", ";", "return", "false", ";", "}", "else", "{", "break;", "}", "}", "}", "if", "(", "entry", "==", "NULL", ")", "{", "if", "(", "(", "entry", "=", "(", "zip_hash_entry_t", "*", ")", "malloc", "(", "sizeof", "(", "zip_hash_entry_t", ")", ")", ")", "==", "NULL", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_MEMORY", ",", "0", ")", ";", "return", "false", ";", "}", "entry", "->", "name", "=", "name", ";", "entry", "->", "next", "=", "hash", "->", "table", "[", "table_index", "]", ";", "hash", "->", "table", "[", "table_index", "]", "=", "entry", ";", "entry", "->", "hash_value", "=", "hash_value", ";", "entry", "->", "orig_index", "=", "-", "1", ";", "hash", "->", "nentries", "++", ";", "if", "(", "hash", "->", "nentries", ">", "hash", "->", "table_size", "*", "HASH_MAX_FILL", "&&", "hash", "->", "table_size", "<", "HASH_MAX_SIZE", ")", "{", "if", "(", "!", "hash_resize", "(", "hash", ",", "hash", "->", "table_size", "*", "2", ",", "error", ")", ")", "{", "return", "false", ";", "}", "}", "}", "if", "(", "flags", "&", "ZIP_FL_UNCHANGED", ")", "{", "entry", "->", "orig_index", "=", "(", "zip_int64_t", ")", "index", ";", "}", "entry", "->", "current_index", "=", "(", "zip_int64_t", ")", "index", ";", "return", "true", ";", "}'" ]
_zip_hash_add
vitasdk/vita-toolchain
single_line
valid
9,536
79,097
[ "remove", "entry", "from", "hash,", "error", "if", "not", "found" ]
[ "'bool", "_zip_hash_delete", "(", "zip_hash_t", "*", "hash", ",", "const", "zip_uint8_t", "*", "name", ",", "zip_error_t", "*", "error", ")", "{", "zip_uint32_t", "hash_value", ",", "<type", "ref=\"prev\"/>", "index", ";", "zip_hash_entry_t", "*", "entry", ",", "<type", "ref=\"prev\">", "*", "previous", ";", "if", "(", "hash", "==", "NULL", "||", "name", "==", "NULL", ")", "{", "zip_error_set", "(", "error", ",", "ZIP_ER_INVAL", ",", "0", ")", ";", "return", "false", ";", "}", "if", "(", "hash", "->", "nentries", ">", "0", ")", "{", "hash_value", "=", "hash_string", "(", "name", ")", ";", "index", "=", "hash_value", "%", "hash", "->", "table_size", ";", "previous", "=", "NULL", ";", "entry", "=", "hash", "->", "table", "[", "index", "]", ";", "while", "(", "entry", ")", "{", "if", "(", "entry", "->", "hash_value", "==", "hash_value", "&&", "strcmp", "(", "(", "const", "char", "*", ")", "name", ",", "(", "const", "char", "*", ")", "entry", "->", "name", ")", "==", "0", ")", "{", "if", "(", "entry", "->", "orig_index", "==", "-", "1", ")", "{", "if", "(", "previous", ")", "{", "previous", "->", "next", "=", "entry", "->", "next", ";", "}", "else", "{", "hash", "->", "table", "[", "index", "]", "=", "entry", "->", "next", ";", "}", "free", "(", "entry", ")", ";", "hash", "->", "nentries", "--", ";", "if", "(", "hash", "->", "nentries", "<", "hash", "->", "table_size", "*", "HASH_MIN_FILL", "&&", "hash", "->", "table_size", ">", "HASH_MIN_SIZE", ")", "{", "if", "(", "!", "hash_resize", "(", "hash", ",", "hash", "->", "table_size", "/", "2", ",", "error", ")", ")", "{", "return", "false", ";", "}", "}", "}", "else", "{", "entry", "->", "current_index", "=", "-", "1", ";", "}", "return", "true", ";", "}", "previous", "=", "entry", ";", "entry", "=", "entry", "->", "next", ";", "}", "}", "zip_error_set", "(", "error", ",", "ZIP_ER_NOENT", ",", "0", ")", ";", "return", "false", ";", "}'" ]
_zip_hash_delete
vitasdk/vita-toolchain
single_line
valid
9,537
79,098
[ "free", "list", "of", "entries" ]
[ "'static", "void", "free_list", "(", "zip_hash_entry_t", "*", "entry", ")", "{", "while", "(", "entry", "!=", "NULL", ")", "{", "zip_hash_entry_t", "*", "next", "=", "entry", "->", "next", ";", "free", "(", "entry", ")", ";", "entry", "=", "next", ";", "}", "}'" ]
free_list
vitasdk/vita-toolchain
single_line
valid
9,538
79,102
[ "geo", "range", "is", "AF_INET", "only" ]
[ "'static", "ngx_int_t", "ngx_http_geo_cidr_variable", "(", "ngx_http_request_t", "*", "r", ",", "ngx_http_variable_value_t", "*", "v", ",", "uintptr_t", "data", ")", "{", "ngx_http_geo_ctx_t", "*", "ctx", "=", "(", "ngx_http_geo_ctx_t", "*", ")", "data", ";", "in_addr_t", "inaddr", ";", "ngx_addr_t", "addr", ";", "struct", "sockaddr_in", "*", "sin", ";", "ngx_http_variable_value_t", "*", "vv", ";", "#", "if", "(", "NGX_HAVE_INET6", ")", "u_char", "*", "p", ";", "struct", "in6_addr", "*", "inaddr6", ";", "#", "endif", "if", "(", "ngx_http_geo_addr", "(", "r", ",", "ctx", ",", "&", "addr", ")", "!=", "NGX_OK", ")", "{", "vv", "=", "(", "ngx_http_variable_value_t", "*", ")", "ngx_radix32tree_find", "(", "ctx", "->", "u", ".", "trees", ".", "tree", ",", "INADDR_NONE", ")", ";", "goto", "done", ";", "}", "switch", "(", "addr", ".", "sockaddr", "->", "sa_family", ")", "{", "#", "if", "(", "NGX_HAVE_INET6", ")", "case", "AF_INET6", ":", "inaddr6", "=", "&", "(", "(", "struct", "sockaddr_in6", "*", ")", "addr", ".", "sockaddr", ")", "->", "sin6_addr", ";", "p", "=", "inaddr6", "->", "s6_addr", ";", "if", "(", "IN6_IS_ADDR_V4MAPPED", "(", "inaddr6", ")", ")", "{", "inaddr", "=", "p", "[", "12", "]", "<<", "24", ";", "inaddr", "+=", "p", "[", "13", "]", "<<", "16", ";", "inaddr", "+=", "p", "[", "14", "]", "<<", "8", ";", "inaddr", "+=", "p", "[", "15", "]", ";", "vv", "=", "(", "ngx_http_variable_value_t", "*", ")", "ngx_radix32tree_find", "(", "ctx", "->", "u", ".", "trees", ".", "tree", ",", "inaddr", ")", ";", "}", "else", "{", "vv", "=", "(", "ngx_http_variable_value_t", "*", ")", "ngx_radix128tree_find", "(", "ctx", "->", "u", ".", "trees", ".", "tree6", ",", "p", ")", ";", "}", "break;", "#", "endif", "#", "if", "(", "NGX_HAVE_UNIX_DOMAIN", ")", "case", "AF_UNIX", ":", "vv", "=", "(", "ngx_http_variable_value_t", "*", ")", "ngx_radix32tree_find", "(", "ctx", "->", "u", ".", "trees", ".", "tree", ",", "INADDR_NONE", ")", ";", "break;", "#", "endif", "default:", "/*", "AF_INET", "*/", "sin", "=", "(", "struct", "sockaddr_in", "*", ")", "addr", ".", "sockaddr", ";", "inaddr", "=", "ntohl", "(", "sin", "->", "sin_addr", ".", "s_addr", ")", ";", "vv", "=", "(", "ngx_http_variable_value_t", "*", ")", "ngx_radix32tree_find", "(", "ctx", "->", "u", ".", "trees", ".", "tree", ",", "inaddr", ")", ";", "break;", "}", "done", ":", "*", "v", "=", "*", "vv", ";", "ngx_log_debug1", "(", "NGX_LOG_DEBUG_HTTP", ",", "r", "->", "connection", "->", "log", ",", "0", ",", "\"http", "geo:", "%v\"", ",", "v", ")", ";", "return", "NGX_OK", ";", "}'" ]
ngx_http_geo_cidr_variable
ZigzagAK/ngx_zookeeper_lua
single_line
valid
9,539
79,121
[ "Sockem", "connect,", "called", "from", "internal", "librdkafka", "thread", "through" ]
[ "'static", "int", "connect_cb", "(", "struct", "test", "*", "test", ",", "sockem_t", "*", "skm", ",", "const", "char", "*", "id", ")", "{", "if", "(", "rd_atomic32_get", "(", "&", "refuse_connect", ")", ">", "0", ")", "return", "-", "1", ";", "else", "return", "0", ";", "}'" ]
connect_cb
edenhill/librdkafka
multi_line
valid
9,540
79,142
[ "XOR", "an", "existing", "buffer", "with", "random", "data" ]
[ "'void", "rand_hw_xor", "(", "unsigned", "char", "*", "buf", ",", "size_t", "num", ")", "{", "return", ";", "}'" ]
rand_hw_xor
guanzhi/GmSSL
single_line
valid
9,541
79,143
[ "Parse", "#pragma", "GCC", "target", "(xxx)", "to", "set", "target", "specific", "options" ]
[ "'static", "void", "handle_pragma_target", "(", "cpp_reader", "*", "ARG_UNUSED", "(", "dummy", ")", ")", "{", "enum", "cpp_ttype", "token", ";", "tree", "x", ";", "bool", "close_paren_needed_p", "=", "false", ";", "if", "(", "cfun", ")", "{", "error", "(", "\"#pragma", "GCC", "option", "is", "not", "allowed", "inside", "functions\"", ")", ";", "return", ";", "}", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "if", "(", "token", "==", "CPP_OPEN_PAREN", ")", "{", "close_paren_needed_p", "=", "true", ";", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "}", "if", "(", "token", "!=", "CPP_STRING", ")", "{", "GCC_BAD", "(", "\"%<#pragma", "GCC", "option%>", "is", "not", "a", "string\"", ")", ";", "return", ";", "}", "/*", "Strings", "are", "user", "options.", "*/", "else", "{", "tree", "args", "=", "NULL_TREE", ";", "do", "{", "/*", "Build", "up", "the", "strings", "now", "as", "a", "tree", "linked", "list.", "Skip", "empty", "strings.", "*/", "if", "(", "TREE_STRING_LENGTH", "(", "x", ")", ">", "0", ")", "args", "=", "tree_cons", "(", "NULL_TREE", ",", "x", ",", "args", ")", ";", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "while", "(", "token", "==", "CPP_COMMA", ")", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "}", "while", "(", "token", "==", "CPP_STRING", ")", ";", "if", "(", "close_paren_needed_p", ")", "{", "if", "(", "token", "==", "CPP_CLOSE_PAREN", ")", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "else", "GCC_BAD", "(", "\"%<#pragma", "GCC", "target", "(string", "[,string]...)%>", "does", "\"", "\"not", "have", "a", "final", "%<)%>\"", ")", ";", "}", "if", "(", "token", "!=", "CPP_EOF", ")", "{", "error", "(", "\"#pragma", "GCC", "target", "string...", "is", "badly", "formed\"", ")", ";", "return", ";", "}", "/*", "put", "arguments", "in", "the", "order", "the", "user", "typed", "them.", "*/", "args", "=", "nreverse", "(", "args", ")", ";", "if", "(", "targetm", ".", "target_option", ".", "pragma_parse", "(", "args", ",", "NULL_TREE", ")", ")", "current_target_pragma", "=", "chainon", "(", "current_target_pragma", ",", "args", ")", ";", "}", "}'" ]
handle_pragma_target
KevinOConnor/klipper
single_line
valid
9,542
79,144
[ "Handle", "#pragma", "GCC", "optimize", "to", "set", "optimization", "options" ]
[ "'static", "void", "handle_pragma_optimize", "(", "cpp_reader", "*", "ARG_UNUSED", "(", "dummy", ")", ")", "{", "enum", "cpp_ttype", "token", ";", "tree", "x", ";", "bool", "close_paren_needed_p", "=", "false", ";", "tree", "optimization_previous_node", "=", "optimization_current_node", ";", "if", "(", "cfun", ")", "{", "error", "(", "\"#pragma", "GCC", "optimize", "is", "not", "allowed", "inside", "functions\"", ")", ";", "return", ";", "}", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "if", "(", "token", "==", "CPP_OPEN_PAREN", ")", "{", "close_paren_needed_p", "=", "true", ";", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "}", "if", "(", "token", "!=", "CPP_STRING", "&&", "token", "!=", "CPP_NUMBER", ")", "{", "GCC_BAD", "(", "\"%<#pragma", "GCC", "optimize%>", "is", "not", "a", "string", "or", "number\"", ")", ";", "return", ";", "}", "/*", "Strings/numbers", "are", "user", "options.", "*/", "else", "{", "tree", "args", "=", "NULL_TREE", ";", "do", "{", "/*", "Build", "up", "the", "numbers/strings", "now", "as", "a", "list.", "*/", "if", "(", "token", "!=", "CPP_STRING", "||", "TREE_STRING_LENGTH", "(", "x", ")", ">", "0", ")", "args", "=", "tree_cons", "(", "NULL_TREE", ",", "x", ",", "args", ")", ";", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "while", "(", "token", "==", "CPP_COMMA", ")", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "}", "while", "(", "token", "==", "CPP_STRING", "||", "token", "==", "CPP_NUMBER", ")", ";", "if", "(", "close_paren_needed_p", ")", "{", "if", "(", "token", "==", "CPP_CLOSE_PAREN", ")", "token", "=", "pragma_lex", "(", "&", "x", ")", ";", "else", "GCC_BAD", "(", "\"%<#pragma", "GCC", "optimize", "(string", "[,string]...)%>", "does", "\"", "\"not", "have", "a", "final", "%<)%>\"", ")", ";", "}", "if", "(", "token", "!=", "CPP_EOF", ")", "{", "error", "(", "\"#pragma", "GCC", "optimize", "string...", "is", "badly", "formed\"", ")", ";", "return", ";", "}", "/*", "put", "arguments", "in", "the", "order", "the", "user", "typed", "them.", "*/", "args", "=", "nreverse", "(", "args", ")", ";", "parse_optimize_options", "(", "args", ",", "false", ")", ";", "current_optimize_pragma", "=", "chainon", "(", "current_optimize_pragma", ",", "args", ")", ";", "optimization_current_node", "=", "build_optimization_node", "(", "&", "global_options", ")", ";", "c_cpp_builtins_optimize_pragma", "(", "parse_in", ",", "optimization_previous_node", ",", "optimization_current_node", ")", ";", "}", "}'" ]
handle_pragma_optimize
KevinOConnor/klipper
single_line
valid
9,543
79,145
[ "#pragma", "weak", "name", "[", "value]" ]
[ "'static", "void", "handle_pragma_weak", "(", "cpp_reader", "*", "ARG_UNUSED", "(", "dummy", ")", ")", "{", "tree", "name", ",", "<type", "ref=\"prev\"/>", "value", ",", "<type", "ref=\"prev\"/>", "x", ",", "<type", "ref=\"prev\"/>", "decl", ";", "enum", "cpp_ttype", "t", ";", "value", "=", "0", ";", "if", "(", "pragma_lex", "(", "&", "name", ")", "!=", "CPP_NAME", ")", "GCC_BAD", "(", "\"malformed", "#pragma", "weak,", "ignored\"", ")", ";", "t", "=", "pragma_lex", "(", "&", "x", ")", ";", "if", "(", "t", "==", "CPP_EQ", ")", "{", "if", "(", "pragma_lex", "(", "&", "value", ")", "!=", "CPP_NAME", ")", "GCC_BAD", "(", "\"malformed", "#pragma", "weak,", "ignored\"", ")", ";", "t", "=", "pragma_lex", "(", "&", "x", ")", ";", "}", "if", "(", "t", "!=", "CPP_EOF", ")", "warning", "(", "OPT_Wpragmas", ",", "\"junk", "at", "end", "of", "%<#pragma", "weak%>\"", ")", ";", "decl", "=", "identifier_global_value", "(", "name", ")", ";", "if", "(", "decl", "&&", "DECL_P", "(", "decl", ")", ")", "{", "if", "(", "!", "VAR_OR_FUNCTION_DECL_P", "(", "decl", ")", ")", "GCC_BAD2", "(", "\"%<#pragma", "weak%>", "declaration", "of", "%q+D", "not", "allowed,\"", "\"", "ignored\"", ",", "decl", ")", ";", "apply_pragma_weak", "(", "decl", ",", "value", ")", ";", "if", "(", "value", ")", "{", "DECL_EXTERNAL", "(", "decl", ")", "=", "0", ";", "if", "(", "VAR_P", "(", "decl", ")", ")", "TREE_STATIC", "(", "decl", ")", "=", "1", ";", "assemble_alias", "(", "decl", ",", "value", ")", ";", "}", "}", "else", "{", "pending_weak", "pe", "=", "{", "name", ",", "value", "}", ";", "vec_safe_push", "(", "pending_weaks", ",", "pe", ")", ";", "}", "}'" ]
handle_pragma_weak
KevinOConnor/klipper
single_line
valid
9,544
79,146
[ "#pragma", "redefine_extname", "oldname", "newname" ]
[ "'static", "void", "handle_pragma_redefine_extname", "(", "cpp_reader", "*", "ARG_UNUSED", "(", "dummy", ")", ")", "{", "tree", "oldname", ",", "<type", "ref=\"prev\"/>", "newname", ",", "<type", "ref=\"prev\"/>", "decls", ",", "<type", "ref=\"prev\"/>", "x", ";", "enum", "cpp_ttype", "t", ";", "bool", "found", ";", "if", "(", "pragma_lex", "(", "&", "oldname", ")", "!=", "CPP_NAME", ")", "GCC_BAD", "(", "\"malformed", "#pragma", "redefine_extname,", "ignored\"", ")", ";", "if", "(", "pragma_lex", "(", "&", "newname", ")", "!=", "CPP_NAME", ")", "GCC_BAD", "(", "\"malformed", "#pragma", "redefine_extname,", "ignored\"", ")", ";", "t", "=", "pragma_lex", "(", "&", "x", ")", ";", "if", "(", "t", "!=", "CPP_EOF", ")", "warning", "(", "OPT_Wpragmas", ",", "\"junk", "at", "end", "of", "%<#pragma", "redefine_extname%>\"", ")", ";", "found", "=", "false", ";", "for", "(", "decls", "=", "c_linkage_bindings", "(", "oldname", ")", ";", "decls", ";", ")", "{", "tree", "decl", ";", "if", "(", "TREE_CODE", "(", "decls", ")", "==", "TREE_LIST", ")", "{", "decl", "=", "TREE_VALUE", "(", "decls", ")", ";", "decls", "=", "TREE_CHAIN", "(", "decls", ")", ";", "}", "else", "{", "decl", "=", "decls", ";", "decls", "=", "NULL_TREE", ";", "}", "if", "(", "(", "TREE_PUBLIC", "(", "decl", ")", "||", "DECL_EXTERNAL", "(", "decl", ")", ")", "&&", "VAR_OR_FUNCTION_DECL_P", "(", "decl", ")", ")", "{", "found", "=", "true", ";", "if", "(", "DECL_ASSEMBLER_NAME_SET_P", "(", "decl", ")", ")", "{", "const", "char", "*", "name", "=", "IDENTIFIER_POINTER", "(", "DECL_ASSEMBLER_NAME", "(", "decl", ")", ")", ";", "name", "=", "targetm", ".", "strip_name_encoding", "(", "name", ")", ";", "if", "(", "!", "id_equal", "(", "newname", ",", "name", ")", ")", "warning", "(", "OPT_Wpragmas", ",", "\"#pragma", "redefine_extname", "ignored", "due", "to", "\"", "\"conflict", "with", "previous", "rename\"", ")", ";", "}", "else", "symtab", "->", "change_decl_assembler_name", "(", "decl", ",", "newname", ")", ";", "}", "}", "if", "(", "!", "found", ")", "/*", "We", "have", "to", "add", "this", "to", "the", "rename", "list", "even", "if", "there\\'s", "already", "a", "global", "value", "that", "doesn\\'t", "meet", "the", "above", "criteria,", "because", "in", "C++", "\"struct", "foo", "{...};\"", "puts", "\"foo\"", "in", "the", "current", "namespace", "but", "does", "*not*", "conflict", "with", "a", "subsequent", "declaration", "of", "a", "function", "or", "variable", "foo.", "See", "g++.dg/other/pragma-re-2.C.", "*/", "add_to_renaming_pragma_list", "(", "oldname", ",", "newname", ")", ";", "}'" ]
handle_pragma_redefine_extname
KevinOConnor/klipper
single_line
valid
9,545