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
1,135
[ "Reset", "a", "symbol", "table", "entry", "to", "an", "empty", "state" ]
[ "'void", "H5G__ent_reset", "(", "H5G_entry_t", "*", "ent", ")", "{", "FUNC_ENTER_PACKAGE_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "ent", ")", ";", "/*", "Clear", "the", "symbol", "table", "entry", "to", "an", "empty", "state", "*/", "HDmemset", "(", "ent", ",", "0", ",", "sizeof", "(", "H5G_entry_t", ")", ")", ";", "ent", "->", "header", "=", "HADDR_UNDEF", ";", "FUNC_LEAVE_NOAPI_VOID", "}'" ]
H5G__ent_reset
gsjaardema/seacas
multi_line
train
900
1,136
[ "Encodes", "the", "specified", "symbol", "table", "entry", "into", "the", "buffer", "pointed", "to", "by", "pp" ]
[ "'herr_t", "H5G_ent_encode", "(", "const", "H5F_t", "*", "f", ",", "uint8_t", "*", "*", "pp", ",", "const", "H5G_entry_t", "*", "ent", ")", "{", "uint8_t", "*", "p_ret", "=", "*", "pp", "+", "H5G_SIZEOF_ENTRY_FILE", "(", "f", ")", ";", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI", "(", "FAIL", ")", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "pp", ")", ";", "/*", "Check", "for", "actual", "entry", "to", "encode", "*/", "if", "(", "ent", ")", "{", "/*", "encode", "header", "*/", "H5F_ENCODE_LENGTH", "(", "f", ",", "*", "pp", ",", "ent", "->", "name_off", ")", ";", "H5F_addr_encode", "(", "f", ",", "pp", ",", "ent", "->", "header", ")", ";", "UINT32ENCODE", "(", "*", "pp", ",", "ent", "->", "type", ")", ";", "UINT32ENCODE", "(", "*", "pp", ",", "0", ")", ";", "/*reserved*/", "/*", "encode", "scratch-pad", "*/", "switch", "(", "ent", "->", "type", ")", "{", "case", "H5G_NOTHING_CACHED", ":", "break;", "case", "H5G_CACHED_STAB", ":", "HDassert", "(", "2", "*", "H5F_SIZEOF_ADDR", "(", "f", ")", "<=", "H5G_SIZEOF_SCRATCH", ")", ";", "H5F_addr_encode", "(", "f", ",", "pp", ",", "ent", "->", "cache", ".", "stab", ".", "btree_addr", ")", ";", "H5F_addr_encode", "(", "f", ",", "pp", ",", "ent", "->", "cache", ".", "stab", ".", "heap_addr", ")", ";", "break;", "case", "H5G_CACHED_SLINK", ":", "UINT32ENCODE", "(", "*", "pp", ",", "ent", "->", "cache", ".", "slink", ".", "lval_offset", ")", ";", "break;", "case", "H5G_CACHED_ERROR", ":", "case", "H5G_NCACHED", ":", "default:", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"unknown", "symbol", "table", "entry", "cache", "type\"", ")", "}", "/*", "end", "switch", "*/", "}", "/*", "end", "if", "*/", "else", "{", "H5F_ENCODE_LENGTH", "(", "f", ",", "*", "pp", ",", "0", ")", ";", "H5F_addr_encode", "(", "f", ",", "pp", ",", "HADDR_UNDEF", ")", ";", "UINT32ENCODE", "(", "*", "pp", ",", "H5G_NOTHING_CACHED", ")", ";", "UINT32ENCODE", "(", "*", "pp", ",", "0", ")", ";", "/*reserved*/", "}", "/*", "end", "else", "*/", "/*", "fill", "with", "zero", "*/", "if", "(", "*", "pp", "<", "p_ret", ")", "HDmemset", "(", "*", "pp", ",", "0", ",", "(", "size_t", ")", "(", "p_ret", "-", "*", "pp", ")", ")", ";", "*", "pp", "=", "p_ret", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5G_ent_encode
gsjaardema/seacas
multi_line
train
901
1,137
[ "Prints", "debugging", "information", "about", "a", "symbol", "table", "entry" ]
[ "'herr_t", "H5G__ent_debug", "(", "const", "H5G_entry_t", "*", "ent", ",", "FILE", "*", "stream", ",", "int", "indent", ",", "int", "fwidth", ",", "const", "H5HL_t", "*", "heap", ")", "{", "const", "char", "*", "lval", "=", "NULL", ";", "int", "nested_indent", ",", "<type", "ref=\"prev\"/>", "nested_fwidth", ";", "FUNC_ENTER_PACKAGE_NOERR", "/*", "Calculate", "the", "indent", "&", "field", "width", "values", "for", "nested", "information", "*/", "nested_indent", "=", "indent", "+", "3", ";", "nested_fwidth", "=", "MAX", "(", "0", ",", "fwidth", "-", "3", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%lu\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Name", "offset", "into", "private", "heap:\"", ",", "(", "unsigned", "long", ")", "(", "ent", "->", "name_off", ")", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%a\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Object", "header", "address:\"", ",", "ent", "->", "header", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Cache", "info", "type:\"", ")", ";", "switch", "(", "ent", "->", "type", ")", "{", "case", "H5G_NOTHING_CACHED", ":", "HDfprintf", "(", "stream", ",", "\"Nothing", "Cached\\\"", ")", ";", "break;", "case", "H5G_CACHED_STAB", ":", "HDfprintf", "(", "stream", ",", "\"Symbol", "Table\\\"", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Cached", "entry", "information:\"", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%a\\\"", ",", "nested_indent", ",", "\"\"", ",", "nested_fwidth", ",", "\"B-tree", "address:\"", ",", "ent", "->", "cache", ".", "stab", ".", "btree_addr", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%a\\\"", ",", "nested_indent", ",", "\"\"", ",", "nested_fwidth", ",", "\"Heap", "address:\"", ",", "ent", "->", "cache", ".", "stab", ".", "heap_addr", ")", ";", "break;", "case", "H5G_CACHED_SLINK", ":", "HDfprintf", "(", "stream", ",", "\"Symbolic", "Link\\\"", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Cached", "information:\"", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%lu\\\"", ",", "nested_indent", ",", "\"\"", ",", "nested_fwidth", ",", "\"Link", "value", "offset:\"", ",", "(", "unsigned", "long", ")", "(", "ent", "->", "cache", ".", "slink", ".", "lval_offset", ")", ")", ";", "if", "(", "heap", ")", "{", "lval", "=", "(", "const", "char", "*", ")", "H5HL_offset_into", "(", "heap", ",", "ent", "->", "cache", ".", "slink", ".", "lval_offset", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%s\\\"", ",", "nested_indent", ",", "\"\"", ",", "nested_fwidth", ",", "\"Link", "value:\"", ",", "(", "lval", "==", "NULL", ")", "?", "\"\"", ":", "lval", ")", ";", "}", "/*", "end", "if", "*/", "else", "HDfprintf", "(", "stream", ",", "\"%*s%-*s\\\"", ",", "nested_indent", ",", "\"\"", ",", "nested_fwidth", ",", "\"Warning:", "Invalid", "heap", "address", "given,", "name", "not", "displayed!\"", ")", ";", "break;", "case", "H5G_CACHED_ERROR", ":", "case", "H5G_NCACHED", ":", "default:", "HDfprintf", "(", "stream", ",", "\"***", "Unknown", "symbol", "type", "%d\\\"", ",", "ent", "->", "type", ")", ";", "break;", "}", "/*", "end", "switch", "*/", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5G__ent_debug
gsjaardema/seacas
multi_line
train
902
1,138
[ "Same", "as", "H5G_ent_decode()", "except", "it", "does", "it", "for", "an", "array", "of", "symbol", "table", "entries" ]
[ "'herr_t", "H5G__ent_decode_vec", "(", "const", "H5F_t", "*", "f", ",", "const", "uint8_t", "*", "*", "pp", ",", "const", "uint8_t", "*", "p_end", ",", "H5G_entry_t", "*", "ent", ",", "unsigned", "n", ")", "{", "unsigned", "u", ";", "/*", "Local", "index", "variable", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_PACKAGE", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "pp", ")", ";", "HDassert", "(", "ent", ")", ";", "/*", "decode", "entries", "*/", "for", "(", "u", "=", "0", ";", "u", "<", "n", ";", "u", "++", ")", "{", "if", "(", "*", "pp", ">", "p_end", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTDECODE", ",", "FAIL", ",", "\"ran", "off", "the", "end", "of", "the", "image", "buffer\"", ")", "if", "(", "H5G_ent_decode", "(", "f", ",", "pp", ",", "ent", "+", "u", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTDECODE", ",", "FAIL", ",", "\"can\\'t", "decode\"", ")", "}", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5G__ent_decode_vec
gsjaardema/seacas
multi_line
train
903
1,139
[ "Do", "a", "deep", "copy", "of", "symbol", "table", "entries" ]
[ "'void", "H5G__ent_copy", "(", "H5G_entry_t", "*", "dst", ",", "const", "H5G_entry_t", "*", "src", ",", "H5_copy_depth_t", "depth", ")", "{", "FUNC_ENTER_PACKAGE_NOERR", "/*", "Check", "arguments", "*/", "HDassert", "(", "src", ")", ";", "HDassert", "(", "dst", ")", ";", "HDassert", "(", "depth", "==", "H5_COPY_SHALLOW", "||", "depth", "==", "H5_COPY_DEEP", ")", ";", "/*", "Copy", "the", "top", "level", "information", "*/", "HDmemcpy", "(", "dst", ",", "src", ",", "sizeof", "(", "H5G_entry_t", ")", ")", ";", "/*", "Deep", "copy", "the", "names", "*/", "if", "(", "depth", "==", "H5_COPY_DEEP", ")", "{", "/*", "Nothing", "currently", "*/", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "depth", "==", "H5_COPY_SHALLOW", ")", "{", "/*", "Discarding", "\\'const\\'", "qualifier", "OK", "-", "QAK", "*/", "H5G__ent_reset", "(", "(", "H5G_entry_t", "*", ")", "src", ")", ";", "}", "/*", "end", "if", "*/", "FUNC_LEAVE_NOAPI_VOID", "}'" ]
H5G__ent_copy
gsjaardema/seacas
multi_line
train
904
1,140
[ "Same", "as", "H5G_ent_encode()", "except", "it", "does", "it", "for", "an", "array", "of", "symbol", "table", "entries" ]
[ "'herr_t", "H5G__ent_encode_vec", "(", "const", "H5F_t", "*", "f", ",", "uint8_t", "*", "*", "pp", ",", "const", "H5G_entry_t", "*", "ent", ",", "unsigned", "n", ")", "{", "unsigned", "u", ";", "/*", "Local", "index", "variable", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_PACKAGE", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "pp", ")", ";", "HDassert", "(", "ent", ")", ";", "/*", "encode", "entries", "*/", "for", "(", "u", "=", "0", ";", "u", "<", "n", ";", "u", "++", ")", "if", "(", "H5G_ent_encode", "(", "f", ",", "pp", ",", "ent", "+", "u", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTENCODE", ",", "FAIL", ",", "\"can\\'t", "encode\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5G__ent_encode_vec
gsjaardema/seacas
multi_line
train
905
1,141
[ "Convert", "a", "link", "to", "a", "symbol", "table", "entry" ]
[ "'herr_t", "H5G__ent_convert", "(", "H5F_t", "*", "f", ",", "H5HL_t", "*", "heap", ",", "const", "char", "*", "name", ",", "const", "H5O_link_t", "*", "lnk", ",", "H5O_type_t", "obj_type", ",", "const", "void", "*", "crt_info", ",", "H5G_entry_t", "*", "ent", ")", "{", "size_t", "name_offset", ";", "/*", "Offset", "of", "name", "in", "heap", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_PACKAGE", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "heap", ")", ";", "HDassert", "(", "name", ")", ";", "HDassert", "(", "lnk", ")", ";", "/*", "Reset", "the", "new", "entry", "*/", "H5G__ent_reset", "(", "ent", ")", ";", "/*", "*", "Add", "the", "new", "name", "to", "the", "heap.", "*/", "name_offset", "=", "H5HL_insert", "(", "f", ",", "heap", ",", "HDstrlen", "(", "name", ")", "+", "1", ",", "name", ")", ";", "if", "(", "0", "==", "name_offset", "||", "UFAIL", "==", "name_offset", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTINSERT", ",", "FAIL", ",", "\"unable", "to", "insert", "symbol", "name", "into", "heap\"", ")", "ent", "->", "name_off", "=", "name_offset", ";", "/*", "Build", "correct", "information", "for", "symbol", "table", "entry", "based", "on", "link", "type", "*/", "switch", "(", "lnk", "->", "type", ")", "{", "case", "H5L_TYPE_HARD", ":", "if", "(", "obj_type", "==", "H5O_TYPE_GROUP", ")", "{", "const", "H5G_obj_create_t", "*", "gcrt_info", "=", "(", "const", "H5G_obj_create_t", "*", ")", "crt_info", ";", "ent", "->", "type", "=", "gcrt_info", "->", "cache_type", ";", "if", "(", "ent", "->", "type", "!=", "H5G_NOTHING_CACHED", ")", "ent", "->", "cache", "=", "gcrt_info", "->", "cache", ";", "#", "ifndef", "NDEBUG", "else", "{", "/*", "Make", "sure", "there", "is", "no", "stab", "message", "in", "the", "target", "object", "*/", "H5O_loc_t", "targ_oloc", ";", "/*", "Location", "of", "link", "target", "*/", "htri_t", "stab_exists", ";", "/*", "Whether", "the", "target", "symbol", "table", "exists", "*/", "/*", "Build", "target", "object", "location", "*/", "if", "(", "H5O_loc_reset", "(", "&", "targ_oloc", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTRESET", ",", "FAIL", ",", "\"unable", "to", "initialize", "target", "location\"", ")", "targ_oloc", ".", "file", "=", "f", ";", "targ_oloc", ".", "addr", "=", "lnk", "->", "u", ".", "hard", ".", "addr", ";", "/*", "Check", "if", "a", "symbol", "table", "message", "exists", "*/", "if", "(", "(", "stab_exists", "=", "H5O_msg_exists", "(", "&", "targ_oloc", ",", "H5O_STAB_ID", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_NOTFOUND", ",", "FAIL", ",", "\"unable", "to", "check", "for", "STAB", "message\"", ")", "HDassert", "(", "!", "stab_exists", ")", ";", "}", "/*", "end", "else", "*/", "#", "endif", "/*", "NDEBUG", "*/", "}", "/*", "end", "if", "*/", "<if", "type=\"elseif\">", "else", "if", "(", "obj_type", "==", "H5O_TYPE_UNKNOWN", ")", "{", "/*", "Try", "to", "retrieve", "symbol", "table", "information", "for", "caching", "*/", "H5O_loc_t", "targ_oloc", ";", "/*", "Location", "of", "link", "target", "*/", "H5O_t", "*", "oh", ";", "/*", "Link", "target", "object", "header", "*/", "H5O_stab_t", "stab", ";", "/*", "Link", "target", "symbol", "table", "*/", "htri_t", "stab_exists", ";", "/*", "Whether", "the", "target", "symbol", "table", "exists", "*/", "/*", "Build", "target", "object", "location", "*/", "if", "(", "H5O_loc_reset", "(", "&", "targ_oloc", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTRESET", ",", "FAIL", ",", "\"unable", "to", "initialize", "target", "location\"", ")", "targ_oloc", ".", "file", "=", "f", ";", "targ_oloc", ".", "addr", "=", "lnk", "->", "u", ".", "hard", ".", "addr", ";", "/*", "Get", "the", "object", "header", "*/", "if", "(", "NULL", "==", "(", "oh", "=", "H5O_protect", "(", "&", "targ_oloc", ",", "H5AC__READ_ONLY_FLAG", ",", "FALSE", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTPROTECT", ",", "FAIL", ",", "\"unable", "to", "protect", "target", "object", "header\"", ")", "/*", "Check", "if", "a", "symbol", "table", "message", "exists", "*/", "if", "(", "(", "stab_exists", "=", "H5O_msg_exists_oh", "(", "oh", ",", "H5O_STAB_ID", ")", ")", "<", "0", ")", "{", "if", "(", "H5O_unprotect", "(", "&", "targ_oloc", ",", "oh", ",", "H5AC__NO_FLAGS_SET", ")", "<", "0", ")", "HERROR", "(", "H5E_SYM", ",", "H5E_CANTUNPROTECT", ",", "\"unable", "to", "release", "object", "header\"", ")", ";", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_NOTFOUND", ",", "FAIL", ",", "\"unable", "to", "check", "for", "STAB", "message\"", ")", "}", "/*", "end", "if", "*/", "if", "(", "stab_exists", ")", "{", "/*", "Read", "symbol", "table", "message", "*/", "if", "(", "NULL", "==", "H5O_msg_read_oh", "(", "f", ",", "oh", ",", "H5O_STAB_ID", ",", "&", "stab", ")", ")", "{", "if", "(", "H5O_unprotect", "(", "&", "targ_oloc", ",", "oh", ",", "H5AC__NO_FLAGS_SET", ")", "<", "0", ")", "HERROR", "(", "H5E_SYM", ",", "H5E_CANTUNPROTECT", ",", "\"unable", "to", "release", "object", "header\"", ")", ";", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTGET", ",", "FAIL", ",", "\"unable", "to", "read", "STAB", "message\"", ")", "}", "/*", "end", "if", "*/", "/*", "Cache", "symbol", "table", "message", "*/", "ent", "->", "type", "=", "H5G_CACHED_STAB", ";", "ent", "->", "cache", ".", "stab", ".", "btree_addr", "=", "stab", ".", "btree_addr", ";", "ent", "->", "cache", ".", "stab", ".", "heap_addr", "=", "stab", ".", "heap_addr", ";", "}", "/*", "end", "if", "*/", "else", "/*", "No", "symbol", "table", "message,", "don\\'t", "cache", "anything", "*/", "ent", "->", "type", "=", "H5G_NOTHING_CACHED", ";", "if", "(", "H5O_unprotect", "(", "&", "targ_oloc", ",", "oh", ",", "H5AC__NO_FLAGS_SET", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTUNPROTECT", ",", "FAIL", ",", "\"unable", "to", "release", "object", "header\"", ")", "}", "/*", "end", "else", "*/", "else", "ent", "->", "type", "=", "H5G_NOTHING_CACHED", ";", "ent", "->", "header", "=", "lnk", "->", "u", ".", "hard", ".", "addr", ";", "break;", "case", "H5L_TYPE_SOFT", ":", "{", "size_t", "lnk_offset", ";", "/*", "Offset", "to", "sym-link", "value", "*/", "/*", "Insert", "link", "value", "into", "local", "heap", "*/", "if", "(", "UFAIL", "==", "(", "lnk_offset", "=", "H5HL_insert", "(", "f", ",", "heap", ",", "HDstrlen", "(", "lnk", "->", "u", ".", "soft", ".", "name", ")", "+", "1", ",", "lnk", "->", "u", ".", "soft", ".", "name", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"unable", "to", "write", "link", "value", "to", "local", "heap\"", ")", "ent", "->", "type", "=", "H5G_CACHED_SLINK", ";", "ent", "->", "cache", ".", "slink", ".", "lval_offset", "=", "lnk_offset", ";", "}", "/*", "end", "case", "*/", "break;", "case", "H5L_TYPE_ERROR", ":", "case", "H5L_TYPE_EXTERNAL", ":", "case", "H5L_TYPE_MAX", ":", "default:", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"unrecognized", "link", "type\"", ")", "}", "/*", "end", "switch", "*/", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5G__ent_convert
gsjaardema/seacas
multi_line
train
906
1,142
[ "Decodes", "a", "symbol", "table", "entry", "pointed", "to", "by", "`pp'" ]
[ "'herr_t", "H5G_ent_decode", "(", "const", "H5F_t", "*", "f", ",", "const", "uint8_t", "*", "*", "pp", ",", "H5G_entry_t", "*", "ent", ")", "{", "const", "uint8_t", "*", "p_ret", "=", "*", "pp", ";", "uint32_t", "tmp", ";", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI", "(", "FAIL", ")", "/*", "check", "arguments", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "pp", ")", ";", "HDassert", "(", "ent", ")", ";", "/*", "decode", "header", "*/", "H5F_DECODE_LENGTH", "(", "f", ",", "*", "pp", ",", "ent", "->", "name_off", ")", ";", "H5F_addr_decode", "(", "f", ",", "pp", ",", "&", "(", "ent", "->", "header", ")", ")", ";", "UINT32DECODE", "(", "*", "pp", ",", "tmp", ")", ";", "*", "pp", "+=", "4", ";", "/*reserved*/", "ent", "->", "type", "=", "(", "H5G_cache_type_t", ")", "tmp", ";", "/*", "decode", "scratch-pad", "*/", "switch", "(", "ent", "->", "type", ")", "{", "case", "H5G_NOTHING_CACHED", ":", "break;", "case", "H5G_CACHED_STAB", ":", "HDassert", "(", "2", "*", "H5F_SIZEOF_ADDR", "(", "f", ")", "<=", "H5G_SIZEOF_SCRATCH", ")", ";", "H5F_addr_decode", "(", "f", ",", "pp", ",", "&", "(", "ent", "->", "cache", ".", "stab", ".", "btree_addr", ")", ")", ";", "H5F_addr_decode", "(", "f", ",", "pp", ",", "&", "(", "ent", "->", "cache", ".", "stab", ".", "heap_addr", ")", ")", ";", "break;", "case", "H5G_CACHED_SLINK", ":", "UINT32DECODE", "(", "*", "pp", ",", "ent", "->", "cache", ".", "slink", ".", "lval_offset", ")", ";", "break;", "case", "H5G_CACHED_ERROR", ":", "case", "H5G_NCACHED", ":", "default:", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_BADVALUE", ",", "FAIL", ",", "\"unknown", "symbol", "table", "entry", "cache", "type\"", ")", "}", "/*", "end", "switch", "*/", "*", "pp", "=", "p_ret", "+", "H5G_SIZEOF_ENTRY_FILE", "(", "f", ")", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5G_ent_decode
gsjaardema/seacas
multi_line
train
907
1,143
[ "@file", "Fault", "injection", "Inject", "fault", "with", "a", "specified", "probability" ]
[ "\"int", "inject_fault_nonzero", "(", "unsigned", "int", "rate", ")", "{", "/*", "Do", "nothing", "unless", "we", "want", "to", "inject", "a", "fault", "now", "*/", "if", "(", "(", "random", "()", "%", "rate", ")", "!=", "0", ")", "return", "0", ";", "/*", "Generate", "error", "number", "here", "so", "that", "faults", "can", "be", "injected", "*", "into", "files", "that", "don't", "themselves", "have", "error", "file", "*", "identifiers", "(via", "errfile.h).", "*/", "return", "-", "EFAULT", ";", "}\"" ]
inject_fault_nonzero
ipxe/ipxe
multi_line
train
908
1,144
[ "Corrupt", "data", "with", "a", "specified", "probability" ]
[ "'void", "inject_corruption_nonzero", "(", "unsigned", "int", "rate", ",", "const", "void", "*", "data", ",", "size_t", "len", ")", "{", "uint8_t", "*", "writable", ";", "size_t", "offset", ";", "/*", "Do", "nothing", "if", "we", "have", "no", "data", "to", "corrupt", "*/", "if", "(", "!", "len", ")", "return", ";", "/*", "Do", "nothing", "unless", "we", "want", "to", "inject", "a", "fault", "now", "*/", "if", "(", "!", "inject_fault_nonzero", "(", "rate", ")", ")", "return", ";", "/*", "Get", "a", "writable", "pointer", "to", "the", "nominally", "read-only", "data", "*/", "writable", "=", "(", "(", "uint8_t", "*", ")", "data", ")", ";", "/*", "Pick", "a", "random", "victim", "byte", "and", "zap", "it", "*/", "offset", "=", "(", "random", "()", "%", "len", ")", ";", "writable", "[", "offset", "]", "^=", "random", "()", ";", "}'" ]
inject_corruption_nonzero
ipxe/ipxe
multi_line
train
909
1,146
[ "store", "symbol", "in", "PS", "file,", "scaled", "to", "final", "size", "and", "drawn", "with", "final", "colors" ]
[ "'int", "symbol_save", "(", "SYMBOL", "*", "Symb", ",", "PSCOLOR", "*", "color", ",", "PSCOLOR", "*", "fcolor", ",", "char", "*", "name", ")", "{", "SYMBPART", "*", "part", ";", "SYMBCHAIN", "*", "chain", ";", "int", "points", ";", "int", "i", ",", "<type", "ref=\"prev\"/>", "j", ";", "double", "s", ",", "<type", "ref=\"prev\"/>", "xo", "[", "4", "]", ",", "<type", "ref=\"prev\"/>", "yo", "[", "4", "]", ";", "points", "=", "4", ";", "xo", "[", "0", "]", "=", "0.0", ";", "yo", "[", "0", "]", "=", "0.5", ";", "xo", "[", "1", "]", "=", "-", "0.5", ";", "yo", "[", "1", "]", "=", "0.0", ";", "xo", "[", "2", "]", "=", "0.0", ";", "yo", "[", "2", "]", "=", "-", "0.5", ";", "xo", "[", "3", "]", "=", "0.5", ";", "yo", "[", "3", "]", "=", "0.0", ";", "s", "=", "1", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"\\/%s", "{\\\"", ",", "name", ")", ";", "if", "(", "Symb", "!=", "NULL", ")", "{", "s", "*=", "Symb", "->", "scale", ";", "for", "(", "i", "=", "0", ";", "i", "<", "Symb", "->", "count", ";", "i", "++", ")", "{", "part", "=", "Symb", "->", "part", "[", "i", "]", ";", "switch", "(", "part", "->", "type", ")", "{", "case", "S_POLYGON", ":", "fprintf", "(", "PS", ".", "fp", ",", "\"NP\\\"", ")", ";", "/*", "Start", "ring", "*/", "for", "(", "j", "=", "0", ";", "j", "<", "part", "->", "count", ";", "j", "++", ")", "{", "/*", "RINGS", "*/", "chain", "=", "part", "->", "chain", "[", "j", "]", ";", "draw_chain", "(", "chain", ",", "s", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"CP\\\"", ")", ";", "/*", "Close", "one", "ring", "*/", "}", "/*", "Fill", "*/", "if", "(", "part", "->", "fcolor", ".", "color", "==", "S_COL_DEFAULT", "&&", "!", "color_none", "(", "fcolor", ")", ")", "{", "set_ps_color", "(", "fcolor", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"F\\\"", ")", ";", "/*", "Fill", "polygon", "*/", "}", "<if", "type=\"elseif\">", "else", "if", "(", "part", "->", "fcolor", ".", "color", "==", "S_COL_DEFINED", ")", "{", "fprintf", "(", "PS", ".", "fp", ",", "\"%.3f", "%.3f", "%.3f", "C\\\"", ",", "part", "->", "fcolor", ".", "fr", ",", "part", "->", "fcolor", ".", "fg", ",", "part", "->", "fcolor", ".", "fb", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"F\\\"", ")", ";", "}", "/*", "Outline", "*/", "if", "(", "part", "->", "color", ".", "color", "==", "S_COL_DEFAULT", "&&", "!", "color_none", "(", "color", ")", ")", "{", "set_ps_color", "(", "color", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"D\\\"", ")", ";", "/*", "Draw", "boundary", "*/", "}", "<if", "type=\"elseif\">", "else", "if", "(", "part", "->", "color", ".", "color", "==", "S_COL_DEFINED", ")", "{", "fprintf", "(", "PS", ".", "fp", ",", "\"%.3f", "%.3f", "%.3f", "C\\\"", ",", "part", "->", "color", ".", "fr", ",", "part", "->", "color", ".", "fg", ",", "part", "->", "color", ".", "fb", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"D\\\"", ")", ";", "}", "break;", "case", "S_STRING", ":", "/*", "string", "has", "1", "chain", "*/", "if", "(", "part", "->", "color", ".", "color", "!=", "S_COL_NONE", ")", "{", "fprintf", "(", "PS", ".", "fp", ",", "\"NP\\\"", ")", ";", "chain", "=", "part", "->", "chain", "[", "0", "]", ";", "draw_chain", "(", "chain", ",", "s", ")", ";", "/*", "Color", "*/", "if", "(", "part", "->", "color", ".", "color", "==", "S_COL_DEFAULT", "&&", "!", "color_none", "(", "color", ")", ")", "{", "set_ps_color", "(", "color", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"D\\\"", ")", ";", "}", "else", "{", "fprintf", "(", "PS", ".", "fp", ",", "\"%.3f", "%.3f", "%.3f", "C\\\"", ",", "part", "->", "color", ".", "fr", ",", "part", "->", "color", ".", "fg", ",", "part", "->", "color", ".", "fb", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"D\\\"", ")", ";", "}", "}", "break;", "}", "}", "}", "else", "{", "fprintf", "(", "PS", ".", "fp", ",", "\"%.4f", "%.4f", "NM\\\"", ",", "s", "*", "xo", "[", "0", "]", ",", "s", "*", "yo", "[", "0", "]", ")", ";", "for", "(", "j", "=", "1", ";", "j", "<", "points", ";", "j", "++", ")", "fprintf", "(", "PS", ".", "fp", ",", "\"%.4f", "%.4f", "LN\\\"", ",", "s", "*", "xo", "[", "j", "]", ",", "s", "*", "yo", "[", "j", "]", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"CP\\\"", ")", ";", "set_ps_color", "(", "fcolor", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"F\\\"", ")", ";", "set_ps_color", "(", "color", ")", ";", "fprintf", "(", "PS", ".", "fp", ",", "\"D\\\"", ")", ";", "}", "fprintf", "(", "PS", ".", "fp", ",", "\"}", "def\\\"", ")", ";", "return", "0", ";", "}'" ]
symbol_save
OSGeo/grass
single_line
train
910
1,147
[ "Parse", "and", "allocate", "PXE", "boot", "menu" ]
[ "'static", "int", "pxe_menu_parse", "(", "struct", "pxe_menu", "*", "*", "menu", ")", "{", "struct", "setting", "pxe_boot_menu_prompt_setting", "=", "{", ".", "tag", "=", "DHCP_PXE_BOOT_MENU_PROMPT", "}", ";", "struct", "setting", "pxe_boot_menu_setting", "=", "{", ".", "tag", "=", "DHCP_PXE_BOOT_MENU", "}", ";", "uint8_t", "raw_menu", "[", "256", "]", ";", "int", "raw_prompt_len", ";", "int", "raw_menu_len", ";", "struct", "dhcp_pxe_boot_menu", "*", "raw_menu_item", ";", "struct", "dhcp_pxe_boot_menu_prompt", "*", "raw_menu_prompt", ";", "void", "*", "raw_menu_end", ";", "unsigned", "int", "num_menu_items", ";", "unsigned", "int", "i", ";", "int", "rc", ";", "/*", "Fetch", "raw", "menu", "*/", "memset", "(", "raw_menu", ",", "0", ",", "sizeof", "(", "raw_menu", ")", ")", ";", "if", "(", "(", "raw_menu_len", "=", "fetch_raw_setting", "(", "NULL", ",", "&", "pxe_boot_menu_setting", ",", "raw_menu", ",", "sizeof", "(", "raw_menu", ")", ")", ")", "<", "0", ")", "{", "rc", "=", "raw_menu_len", ";", "DBG", "(", "\"Could", "not", "retrieve", "raw", "PXE", "boot", "menu:", "%s\\\"", ",", "strerror", "(", "rc", ")", ")", ";", "return", "rc", ";", "}", "if", "(", "raw_menu_len", ">=", "(", "int", ")", "sizeof", "(", "raw_menu", ")", ")", "{", "DBG", "(", "\"Raw", "PXE", "boot", "menu", "too", "large", "for", "buffer\\\"", ")", ";", "return", "-", "ENOSPC", ";", "}", "raw_menu_end", "=", "(", "raw_menu", "+", "raw_menu_len", ")", ";", "/*", "Fetch", "raw", "prompt", "length", "*/", "raw_prompt_len", "=", "fetch_raw_setting", "(", "NULL", ",", "&", "pxe_boot_menu_prompt_setting", ",", "NULL", ",", "0", ")", ";", "if", "(", "raw_prompt_len", "<", "0", ")", "raw_prompt_len", "=", "0", ";", "/*", "Count", "menu", "items", "*/", "num_menu_items", "=", "0", ";", "raw_menu_item", "=", "(", "(", "void", "*", ")", "raw_menu", ")", ";", "while", "(", "1", ")", "{", "if", "(", "(", "(", "(", "void", "*", ")", "raw_menu_item", ")", "+", "sizeof", "(", "*", "raw_menu_item", ")", ")", ">", "raw_menu_end", ")", "break;", "if", "(", "(", "(", "(", "void", "*", ")", "raw_menu_item", ")", "+", "sizeof", "(", "*", "raw_menu_item", ")", "+", "raw_menu_item", "->", "desc_len", ")", ">", "raw_menu_end", ")", "break;", "num_menu_items", "++", ";", "raw_menu_item", "=", "(", "(", "(", "void", "*", ")", "raw_menu_item", ")", "+", "sizeof", "(", "*", "raw_menu_item", ")", "+", "raw_menu_item", "->", "desc_len", ")", ";", "}", "/*", "Allocate", "space", "for", "parsed", "menu", "*/", "*", "menu", "=", "zalloc", "(", "sizeof", "(", "*", "*", "menu", ")", "+", "(", "num_menu_items", "*", "sizeof", "(", "(", "*", "menu", ")", "->", "items", "[", "0", "]", ")", ")", "+", "raw_menu_len", "+", "1", "/*", "NUL", "*/", "+", "raw_prompt_len", "+", "1", "/*", "NUL", "*/", ")", ";", "if", "(", "!", "*", "menu", ")", "{", "DBG", "(", "\"Could", "not", "allocate", "PXE", "boot", "menu\\\"", ")", ";", "return", "-", "ENOMEM", ";", "}", "/*", "Fill", "in", "parsed", "menu", "*/", "(", "*", "menu", ")", "->", "num_items", "=", "num_menu_items", ";", "raw_menu_item", "=", "(", "(", "(", "void", "*", ")", "(", "*", "menu", ")", ")", "+", "sizeof", "(", "*", "*", "menu", ")", "+", "(", "num_menu_items", "*", "sizeof", "(", "(", "*", "menu", ")", "->", "items", "[", "0", "]", ")", ")", ")", ";", "memcpy", "(", "raw_menu_item", ",", "raw_menu", ",", "raw_menu_len", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "num_menu_items", ";", "i", "++", ")", "{", "(", "*", "menu", ")", "->", "items", "[", "i", "]", ".", "type", "=", "le16_to_cpu", "(", "raw_menu_item", "->", "type", ")", ";", "(", "*", "menu", ")", "->", "items", "[", "i", "]", ".", "desc", "=", "raw_menu_item", "->", "desc", ";", "/*", "Set", "type", "to", "0;", "this", "ensures", "that", "the", "description", "*", "for", "the", "previous", "menu", "item", "is", "NUL-terminated.", "*", "(Final", "item", "is", "NUL-terminated", "anyway.)", "*/", "raw_menu_item", "->", "type", "=", "0", ";", "raw_menu_item", "=", "(", "(", "(", "void", "*", ")", "raw_menu_item", ")", "+", "sizeof", "(", "*", "raw_menu_item", ")", "+", "raw_menu_item", "->", "desc_len", ")", ";", "}", "if", "(", "raw_prompt_len", ")", "{", "raw_menu_prompt", "=", "(", "(", "(", "void", "*", ")", "raw_menu_item", ")", "+", "1", "/*", "NUL", "*/", ")", ";", "fetch_raw_setting", "(", "NULL", ",", "&", "pxe_boot_menu_prompt_setting", ",", "raw_menu_prompt", ",", "raw_prompt_len", ")", ";", "(", "*", "menu", ")", "->", "timeout", "=", "(", "(", "raw_menu_prompt", "->", "timeout", "==", "0xff", ")", "?", "-", "1", ":", "raw_menu_prompt", "->", "timeout", ")", ";", "(", "*", "menu", ")", "->", "prompt", "=", "raw_menu_prompt", "->", "prompt", ";", "}", "else", "{", "(", "*", "menu", ")", "->", "timeout", "=", "-", "1", ";", "}", "return", "0", ";", "}'" ]
pxe_menu_parse
ipxe/ipxe
multi_line
train
911
1,148
[ "Draw", "PXE", "boot", "menu", "item" ]
[ "'static", "void", "pxe_menu_draw_item", "(", "struct", "pxe_menu", "*", "menu", ",", "unsigned", "int", "index", ",", "int", "selected", ")", "{", "char", "buf", "[", "COLS", "+", "1", "]", ";", "size_t", "len", ";", "unsigned", "int", "row", ";", "/*", "Prepare", "space-padded", "row", "content", "*/", "len", "=", "snprintf", "(", "buf", ",", "sizeof", "(", "buf", ")", ",", "\"", "%c.", "%s\"", ",", "(", "\\'A\\'", "+", "index", ")", ",", "menu", "->", "items", "[", "index", "]", ".", "desc", ")", ";", "while", "(", "len", "<", "(", "sizeof", "(", "buf", ")", "-", "1", ")", ")", "buf", "[", "len", "++", "]", "=", "\\'", "\\'", ";", "buf", "[", "sizeof", "(", "buf", ")", "-", "1", "]", "=", "\\'\\\\0\\'", ";", "/*", "Draw", "row", "*/", "row", "=", "(", "LINES", "-", "menu", "->", "num_items", "+", "index", ")", ";", "color_set", "(", "(", "selected", "?", "CPAIR_PXE", ":", "CPAIR_DEFAULT", ")", ",", "NULL", ")", ";", "mvprintw", "(", "row", ",", "0", ",", "\"%s\"", ",", "buf", ")", ";", "move", "(", "row", ",", "1", ")", ";", "}'" ]
pxe_menu_draw_item
ipxe/ipxe
multi_line
train
912
1,149
[ "Make", "selection", "from", "PXE", "boot", "menu" ]
[ "'static", "int", "pxe_menu_select", "(", "struct", "pxe_menu", "*", "menu", ")", "{", "int", "key", ";", "unsigned", "int", "key_selection", ";", "unsigned", "int", "i", ";", "int", "rc", "=", "0", ";", "/*", "Initialise", "UI", "*/", "initscr", "()", ";", "start_color", "()", ";", "color_set", "(", "CPAIR_DEFAULT", ",", "NULL", ")", ";", "/*", "Draw", "initial", "menu", "*/", "for", "(", "i", "=", "0", ";", "i", "<", "menu", "->", "num_items", ";", "i", "++", ")", "printf", "(", "\"\\\"", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "menu", "->", "num_items", ";", "i", "++", ")", "pxe_menu_draw_item", "(", "menu", ",", "(", "menu", "->", "num_items", "-", "i", "-", "1", ")", ",", "0", ")", ";", "while", "(", "1", ")", "{", "/*", "Highlight", "currently", "selected", "item", "*/", "pxe_menu_draw_item", "(", "menu", ",", "menu", "->", "selection", ",", "1", ")", ";", "/*", "Wait", "for", "keyboard", "input", "*/", "key", "=", "getkey", "(", "0", ")", ";", "/*", "Unhighlight", "currently", "selected", "item", "*/", "pxe_menu_draw_item", "(", "menu", ",", "menu", "->", "selection", ",", "0", ")", ";", "/*", "Act", "upon", "key", "*/", "if", "(", "(", "key", "==", "CR", ")", "||", "(", "key", "==", "LF", ")", ")", "{", "pxe_menu_draw_item", "(", "menu", ",", "menu", "->", "selection", ",", "1", ")", ";", "break;", "}", "<if", "type=\"elseif\">", "else", "if", "(", "(", "key", "==", "CTRL_C", ")", "||", "(", "key", "==", "ESC", ")", ")", "{", "rc", "=", "-", "ECANCELED", ";", "break;", "}", "<if", "type=\"elseif\">", "else", "if", "(", "key", "==", "KEY_UP", ")", "{", "if", "(", "menu", "->", "selection", ">", "0", ")", "menu", "->", "selection", "--", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "key", "==", "KEY_DOWN", ")", "{", "if", "(", "menu", "->", "selection", "<", "(", "menu", "->", "num_items", "-", "1", ")", ")", "menu", "->", "selection", "++", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "(", "key", "<", "KEY_MIN", ")", "&&", "(", "(", "key_selection", "=", "(", "toupper", "(", "key", ")", "-", "\\'A\\'", ")", ")", "<", "menu", "->", "num_items", ")", ")", "{", "menu", "->", "selection", "=", "key_selection", ";", "pxe_menu_draw_item", "(", "menu", ",", "menu", "->", "selection", ",", "1", ")", ";", "break;", "}", "}", "/*", "Shut", "down", "UI", "*/", "endwin", "()", ";", "return", "rc", ";", "}'" ]
pxe_menu_select
ipxe/ipxe
multi_line
train
913
1,150
[ "Caller", "loses", "ownership", "of", "PKCS7", "and", "TS_TST_INFO", "objects" ]
[ "'void", "TS_RESP_set_tst_info", "(", "TS_RESP", "*", "a", ",", "PKCS7", "*", "p7", ",", "TS_TST_INFO", "*", "tst_info", ")", "{", "/*", "Set", "new", "PKCS7", "and", "TST_INFO", "objects.", "*/", "PKCS7_free", "(", "a", "->", "token", ")", ";", "a", "->", "token", "=", "p7", ";", "TS_TST_INFO_free", "(", "a", "->", "tst_info", ")", ";", "a", "->", "tst_info", "=", "tst_info", ";", "}'" ]
TS_RESP_set_tst_info
tpm2-software/tpm2-tss-engine
single_line
train
914
1,153
[ "Function", "for", "polling", "SoC", "events" ]
[ "'static", "void", "nrf_sdh_soc_evts_poll", "(", "void", "*", "p_context", ")", "{", "ret_code_t", "ret_code", ";", "UNUSED_VARIABLE", "(", "p_context", ")", ";", "while", "(", "true", ")", "{", "uint32_t", "evt_id", ";", "ret_code", "=", "sd_evt_get", "(", "&", "evt_id", ")", ";", "if", "(", "ret_code", "!=", "NRF_SUCCESS", ")", "{", "break;", "}", "NRF_LOG_DEBUG", "(", "\"SoC", "event:", "0x%x.\"", ",", "evt_id", ")", ";", "//", "Forward", "the", "event", "to", "SoC", "observers.", "nrf_section_iter_t", "iter", ";", "for", "(", "nrf_section_iter_init", "(", "&", "iter", ",", "&", "sdh_soc_observers", ")", ";", "nrf_section_iter_get", "(", "&", "iter", ")", "!=", "NULL", ";", "nrf_section_iter_next", "(", "&", "iter", ")", ")", "{", "nrf_sdh_soc_evt_observer_t", "*", "p_observer", ";", "nrf_sdh_soc_evt_handler_t", "handler", ";", "p_observer", "=", "(", "nrf_sdh_soc_evt_observer_t", "*", ")", "nrf_section_iter_get", "(", "&", "iter", ")", ";", "handler", "=", "p_observer", "->", "handler", ";", "handler", "(", "evt_id", ",", "p_observer", "->", "p_context", ")", ";", "}", "}", "if", "(", "ret_code", "!=", "NRF_ERROR_NOT_FOUND", ")", "{", "APP_ERROR_HANDLER", "(", "ret_code", ")", ";", "}", "}'" ]
nrf_sdh_soc_evts_poll
Lotlab/nrf52-keyboard
multi_line
train
915
1,154
[ "do", "the", "com", "port", "and", "configuration", "stuff" ]
[ "'static", "GOOD_OR_BAD", "DS2480_big_reset_serial", "(", "struct", "connection_in", "*", "in", ")", "{", "BYTE", "reset_byte", "=", "(", "BYTE", ")", "(", "CMD_COMM", "|", "FUNCTSEL_RESET", "|", "SPEEDSEL_STD", ")", ";", "//", "Open", "the", "com", "port", "in", "9600", "Baud.", "RETURN_BAD_IF_BAD", "(", "COM_open", "(", "in", ")", ")", ";", "//", "send", "a", "break", "to", "reset", "the", "DS2480", "COM_break", "(", "in", ")", ";", "//", "It\\'s", "in", "command", "mode", "now", "in", "->", "master", ".", "serial", ".", "mode", "=", "ds2480b_command_mode", ";", "//", "send", "the", "timing", "byte", "(A", "reset", "command", "at", "9600", "baud)", "DS2480_write", "(", "&", "reset_byte", ",", "1", ",", "in", ")", ";", "//", "delay", "to", "let", "line", "settle", "UT_delay", "(", "4", ")", ";", "//", "flush", "the", "buffers", "DS2480_flush", "(", "in", ")", ";", "//", "ignore", "response", "DS2480_slurp", "(", "in", ")", ";", "//", "Now", "set", "desired", "baud", "and", "polarity", "//", "BUS_reset", "will", "do", "the", "actual", "changes", "in", "->", "changed_bus_settings", "=", "1", ";", "//", "Force", "a", "mode", "change", "//", "Send", "a", "reset", "again", "LEVEL_DEBUG", "(", "\"Send", "the", "initial", "reset", "to", "the", "bus", "master.\"", ")", ";", "DS2480_reset_in", "(", "in", ")", ";", "//", "delay", "to", "let", "line", "settle", "UT_delay", "(", "400", ")", ";", "//", "flush", "the", "buffers", "DS2480_flush", "(", "in", ")", ";", "//", "ignore", "response", "DS2480_slurp", "(", "in", ")", ";", "//", "Now", "set", "desired", "baud", "and", "polarity", "return", "DS2480_big_configuration", "(", "in", ")", ";", "}'" ]
DS2480_big_reset_serial
owfs/owfs
double_slash
train
916
1,155
[ "setting", "for", "serial", "port", "already", "made" ]
[ "'static", "GOOD_OR_BAD", "DS2480_detect_serial", "(", "struct", "connection_in", "*", "in", ")", "{", "in", "->", "pown", "->", "state", "=", "cs_virgin", ";", "if", "(", "BAD", "(", "DS2480_initialize_repeatedly", "(", "in", ")", ")", ")", "{", "LEVEL_DEBUG", "(", "\"Could", "not", "initialize", "the", "DS9097U", "even", "after", "several", "tries\"", ")", ";", "COM_close", "(", "in", ")", ";", "return", "gbBAD", ";", "}", "DS2480_adapter", "(", "in", ")", ";", "return", "gbGOOD", ";", "}'" ]
DS2480_detect_serial
owfs/owfs
double_slash
train
917
1,156
[ "search", "normal", "and", "alarm" ]
[ "'static", "enum", "search_status", "DS2480_next_both", "(", "struct", "device_search", "*", "ds", ",", "const", "struct", "parsedname", "*", "pn", ")", "{", "int", "mismatched", ";", "BYTE", "sn", "[", "SERIAL_NUMBER_SIZE", "]", ";", "BYTE", "bitpairs", "[", "SERIAL_NUMBER_SIZE", "*", "2", "]", ";", "struct", "connection_in", "*", "in", "=", "pn", "->", "selected_connection", ";", "BYTE", "searchon", "=", "(", "BYTE", ")", "(", "CMD_COMM", "|", "FUNCTSEL_SEARCHON", "|", "DS2480b_speed_byte", "(", "in", ")", ")", ";", "BYTE", "searchoff", "=", "(", "BYTE", ")", "(", "CMD_COMM", "|", "FUNCTSEL_SEARCHOFF", "|", "DS2480b_speed_byte", "(", "in", ")", ")", ";", "int", "i", ";", "if", "(", "ds", "->", "LastDevice", ")", "{", "return", "search_done", ";", "}", "if", "(", "BAD", "(", "BUS_select", "(", "pn", ")", ")", ")", "{", "return", "search_error", ";", "}", "//", "need", "the", "reset", "done", "in", "BUS-select", "to", "set", "AnyDevices", "if", "(", "in", "->", "AnyDevices", "==", "anydevices_no", ")", "{", "ds", "->", "LastDevice", "=", "1", ";", "return", "search_done", ";", "}", "//", "clear", "sn", "to", "satisfy", "static", "error", "checking", "(Coverity)", "memset", "(", "sn", ",", "0", ",", "SERIAL_NUMBER_SIZE", ")", ";", "//", "build", "the", "command", "stream", "//", "call", "a", "function", "that", "may", "add", "the", "change", "mode", "command", "to", "the", "buff", "//", "check", "if", "correct", "mode", "//", "issue", "the", "search", "command", "//", "change", "back", "to", "command", "mode", "//", "search", "mode", "on", "//", "change", "back", "to", "data", "mode", "//", "set", "the", "temp", "Last", "Descrep", "to", "none", "mismatched", "=", "-", "1", ";", "//", "add", "the", "16", "bytes", "of", "the", "search", "memset", "(", "bitpairs", ",", "0", ",", "SERIAL_NUMBER_SIZE", "*", "2", ")", ";", "//", "set", "the", "bits", "in", "the", "added", "buffer", "for", "(", "i", "=", "0", ";", "i", "<", "ds", "->", "LastDiscrepancy", ";", "i", "++", ")", "{", "//", "before", "last", "discrepancy", "UT_set2bit", "(", "bitpairs", ",", "i", ",", "UT_getbit", "(", "ds", "->", "sn", ",", "i", ")", "<<", "1", ")", ";", "}", "//", "at", "last", "discrepancy", "if", "(", "ds", "->", "LastDiscrepancy", ">", "-", "1", ")", "{", "UT_set2bit", "(", "bitpairs", ",", "ds", "->", "LastDiscrepancy", ",", "1", "<<", "1", ")", ";", "}", "//", "after", "last", "discrepancy", "so", "leave", "zeros", "//", "flush", "the", "buffers", "DS2480_flush", "(", "in", ")", ";", "//", "search", "ON", "//", "change", "back", "to", "command", "mode", "//", "send", "the", "packet", "//", "cannot", "use", "single-bit", "mode", "with", "search", "accerator", "//", "search", "OFF", "if", "(", "BAD", "(", "BUS_send_data", "(", "&", "(", "ds", "->", "search", ")", ",", "1", ",", "pn", ")", ")", "||", "BAD", "(", "DS2480_sendout_cmd", "(", "&", "searchon", ",", "1", ",", "in", ")", ")", "||", "BAD", "(", "DS2480_sendback_data", "(", "bitpairs", ",", "bitpairs", ",", "SERIAL_NUMBER_SIZE", "*", "2", ",", "pn", ")", ")", "||", "BAD", "(", "DS2480_sendout_cmd", "(", "&", "searchoff", ",", "1", ",", "in", ")", ")", ")", "{", "return", "search_error", ";", "}", "//", "interpret", "the", "bit", "stream", "for", "(", "i", "=", "0", ";", "i", "<", "SERIAL_NUMBER_BITS", ";", "i", "++", ")", "{", "//", "get", "the", "SerialNum", "bit", "UT_setbit", "(", "sn", ",", "i", ",", "UT_get2bit", "(", "bitpairs", ",", "i", ")", ">>", "1", ")", ";", "//", "check", "LastDiscrepancy", "if", "(", "UT_get2bit", "(", "bitpairs", ",", "i", ")", "==", "SEARCH_BIT_ON", ")", "{", "mismatched", "=", "i", ";", "}", "}", "if", "(", "sn", "[", "0", "]", "==", "0xFF", "&&", "sn", "[", "1", "]", "==", "0xFF", "&&", "sn", "[", "2", "]", "==", "0xFF", "&&", "sn", "[", "3", "]", "==", "0xFF", "&&", "sn", "[", "4", "]", "==", "0xFF", "&&", "sn", "[", "5", "]", "==", "0xFF", "&&", "sn", "[", "6", "]", "==", "0xFF", "&&", "sn", "[", "7", "]", "==", "0xFF", ")", "{", "//", "special", "case", "for", "no", "alarm", "present", "return", "search_done", ";", "}", "//", "CRC", "check", "if", "(", "CRC8", "(", "sn", ",", "SERIAL_NUMBER_SIZE", ")", "||", "(", "ds", "->", "LastDiscrepancy", "==", "SERIAL_NUMBER_BITS", "-", "1", ")", "||", "(", "sn", "[", "0", "]", "==", "0", ")", ")", "{", "return", "search_error", ";", "}", "//", "successful", "search", "//", "check", "for", "last", "one", "if", "(", "(", "mismatched", "==", "ds", "->", "LastDiscrepancy", ")", "||", "(", "mismatched", "==", "-", "1", ")", ")", "{", "ds", "->", "LastDevice", "=", "1", ";", "}", "//", "copy", "the", "SerialNum", "to", "the", "buffer", "memcpy", "(", "ds", "->", "sn", ",", "sn", ",", "8", ")", ";", "//", "set", "the", "count", "ds", "->", "LastDiscrepancy", "=", "mismatched", ";", "LEVEL_DEBUG", "(", "\"SN", "found:", "\"", "SNformat", ",", "SNvar", "(", "ds", "->", "sn", ")", ")", ";", "return", "search_good", ";", "}'" ]
DS2480_next_both
owfs/owfs
single_line
train
918
1,157
[ "do", "the", "com", "port", "and", "configuration", "stuff" ]
[ "'static", "GOOD_OR_BAD", "DS2480_big_reset", "(", "struct", "connection_in", "*", "in", ")", "{", "struct", "port_in", "*", "pin", "=", "in", "->", "pown", ";", "switch", "(", "pin", "->", "type", ")", "{", "case", "ct_telnet", ":", "pin", "->", "timeout", ".", "tv_sec", "=", "Globals", ".", "timeout_network", ";", "pin", "->", "timeout", ".", "tv_usec", "=", "0", ";", "return", "DS2480_big_reset_serial", "(", "in", ")", ";", "case", "ct_serial", ":", "default:", "pin", "->", "timeout", ".", "tv_sec", "=", "Globals", ".", "timeout_serial", ";", "pin", "->", "timeout", ".", "tv_usec", "=", "0", ";", "pin", "->", "flow", "=", "flow_none", ";", "RETURN_GOOD_IF_GOOD", "(", "DS2480_big_reset_serial", "(", "in", ")", ")", ";", "serial_powercycle", "(", "in", ")", ";", "RETURN_GOOD_IF_GOOD", "(", "DS2480_big_reset_serial", "(", "in", ")", ")", ";", "pin", "->", "flow", "=", "flow_none", ";", "RETURN_GOOD_IF_GOOD", "(", "DS2480_big_reset_serial", "(", "in", ")", ")", ";", "pin", "->", "flow", "=", "flow_hard", ";", "RETURN_GOOD_IF_GOOD", "(", "DS2480_big_reset_serial", "(", "in", ")", ")", ";", "return", "gbBAD", ";", "}", "}'" ]
DS2480_big_reset
owfs/owfs
double_slash
train
919
1,158
[ "keep", "a", "copy", "of", "the", "palette", "so", "that", "we", "can", "get", "the", "RGB", "value", "for", "a", "color", "index", "at", "any", "time" ]
[ "'static", "void", "LoadPalette", "(", "const", "char", "*", "lumpname", ")", "{", "lumpnum_t", "lumpnum", "=", "W_GetNumForName", "(", "lumpname", ")", ";", "size_t", "i", ",", "<type", "ref=\"prev\"/>", "palsize", "=", "W_LumpLength", "(", "lumpnum", ")", "/", "3", ";", "UINT8", "*", "pal", ";", "Cubeapply", "=", "InitCube", "()", ";", "Z_Free", "(", "pLocalPalette", ")", ";", "Z_Free", "(", "pMasterPalette", ")", ";", "pLocalPalette", "=", "Z_Malloc", "(", "sizeof", "(", "*", "pLocalPalette", ")", "*", "palsize", ",", "PU_STATIC", ",", "NULL", ")", ";", "pMasterPalette", "=", "Z_Malloc", "(", "sizeof", "(", "*", "pMasterPalette", ")", "*", "palsize", ",", "PU_STATIC", ",", "NULL", ")", ";", "pal", "=", "W_CacheLumpNum", "(", "lumpnum", ",", "PU_CACHE", ")", ";", "for", "(", "i", "=", "0", ";", "i", "<", "palsize", ";", "i", "++", ")", "{", "#", "ifdef", "BACKWARDSCOMPATCORRECTION", "pMasterPalette", "[", "i", "]", ".", "s", ".", "red", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "red", "=", "correctiontable", "[", "*", "pal", "++", "]", ";", "pMasterPalette", "[", "i", "]", ".", "s", ".", "green", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "green", "=", "correctiontable", "[", "*", "pal", "++", "]", ";", "pMasterPalette", "[", "i", "]", ".", "s", ".", "blue", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "blue", "=", "correctiontable", "[", "*", "pal", "++", "]", ";", "#", "else", "pMasterPalette", "[", "i", "]", ".", "s", ".", "red", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "red", "=", "*", "pal", "++", ";", "pMasterPalette", "[", "i", "]", ".", "s", ".", "green", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "green", "=", "*", "pal", "++", ";", "pMasterPalette", "[", "i", "]", ".", "s", ".", "blue", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "blue", "=", "*", "pal", "++", ";", "#", "endif", "pMasterPalette", "[", "i", "]", ".", "s", ".", "alpha", "=", "pLocalPalette", "[", "i", "]", ".", "s", ".", "alpha", "=", "0xFF", ";", "//", "lerp", "of", "colour", "cubing!", "if", "you", "want,", "make", "it", "smoother", "yourself", "if", "(", "Cubeapply", ")", "V_CubeApply", "(", "&", "pLocalPalette", "[", "i", "]", ".", "s", ".", "red", ",", "&", "pLocalPalette", "[", "i", "]", ".", "s", ".", "green", ",", "&", "pLocalPalette", "[", "i", "]", ".", "s", ".", "blue", ")", ";", "}", "}'" ]
LoadPalette
STJr/SRB2
double_slash
train
920
1,159
[ "Draws", "a", "small", "string", "at", "a", "fixed_t", "location" ]
[ "'void", "V_DrawSmallThinStringAtFixed", "(", "fixed_t", "x", ",", "fixed_t", "y", ",", "INT32", "option", ",", "const", "char", "*", "string", ")", "{", "fixed_t", "cx", "=", "x", ",", "<type", "ref=\"prev\"/>", "cy", "=", "y", ";", "INT32", "w", ",", "<type", "ref=\"prev\"/>", "c", ",", "<type", "ref=\"prev\"/>", "dupx", ",", "<type", "ref=\"prev\"/>", "dupy", ",", "<type", "ref=\"prev\"/>", "scrwidth", ",", "<type", "ref=\"prev\"/>", "center", "=", "0", ",", "<type", "ref=\"prev\"/>", "left", "=", "0", ";", "const", "char", "*", "ch", "=", "string", ";", "INT32", "charflags", "=", "0", ";", "const", "UINT8", "*", "colormap", "=", "NULL", ";", "INT32", "spacewidth", "=", "2", "<<", "FRACBITS", ",", "<type", "ref=\"prev\"/>", "charwidth", "=", "0", ";", "INT32", "lowercase", "=", "(", "option", "&", "V_ALLOWLOWERCASE", ")", ";", "option", "&=", "~", "V_FLIP", ";", "//", "which", "is", "also", "shared", "with", "V_ALLOWLOWERCASE...", "if", "(", "option", "&", "V_NOSCALESTART", ")", "{", "dupx", "=", "vid", ".", "dupx", "<<", "FRACBITS", ";", "dupy", "=", "vid", ".", "dupy", "<<", "FRACBITS", ";", "scrwidth", "=", "vid", ".", "width", ";", "}", "else", "{", "dupx", "=", "dupy", "=", "FRACUNIT", ";", "scrwidth", "=", "FixedDiv", "(", "vid", ".", "width", "<<", "FRACBITS", ",", "vid", ".", "dupx", ")", ";", "left", "=", "(", "(", "scrwidth", "-", "(", "BASEVIDWIDTH", "<<", "FRACBITS", ")", ")", "/", "2", ")", ";", "scrwidth", "-=", "left", ";", "}", "charflags", "=", "(", "option", "&", "V_CHARCOLORMASK", ")", ";", "switch", "(", "option", "&", "V_SPACINGMASK", ")", "{", "case", "V_MONOSPACE", ":", "spacewidth", "=", "4", "<<", "FRACBITS", ";", "/*", "FALLTHRU", "*/", "case", "V_OLDSPACING", ":", "charwidth", "=", "4", "<<", "FRACBITS", ";", "break;", "case", "V_6WIDTHSPACE", ":", "spacewidth", "=", "3", "<<", "FRACBITS", ";", "default:", "break;", "}", "for", "(", ";", ";", "ch", "++", ")", "{", "if", "(", "!", "*", "ch", ")", "break;", "if", "(", "*", "ch", "&", "0x80", ")", "//color", "parsing", "-x", "2.16.09", "{", "//", "manually", "set", "flags", "override", "color", "codes", "if", "(", "!", "(", "option", "&", "V_CHARCOLORMASK", ")", ")", "charflags", "=", "(", "(", "*", "ch", "&", "0x7f", ")", "<<", "V_CHARCOLORSHIFT", ")", "&", "V_CHARCOLORMASK", ";", "continue;", "}", "if", "(", "*", "ch", "==", "\\'\\\\'", ")", "{", "cx", "=", "x", ";", "if", "(", "option", "&", "V_RETURN8", ")", "cy", "+=", "4", "*", "dupy", ";", "else", "cy", "+=", "6", "*", "dupy", ";", "continue;", "}", "c", "=", "*", "ch", ";", "if", "(", "!", "lowercase", ")", "c", "=", "toupper", "(", "c", ")", ";", "c", "-=", "HU_FONTSTART", ";", "//", "character", "does", "not", "exist", "or", "is", "a", "space", "if", "(", "c", "<", "0", "||", "c", ">=", "HU_FONTSIZE", "||", "!", "tny_font", "[", "c", "]", ")", "{", "cx", "+=", "FixedMul", "(", "spacewidth", ",", "dupx", ")", ";", "continue;", "}", "if", "(", "charwidth", ")", "{", "w", "=", "FixedMul", "(", "charwidth", ",", "dupx", ")", ";", "center", "=", "w", "/", "2", "-", "SHORT", "(", "tny_font", "[", "c", "]", "->", "width", ")", "*", "(", "dupx", "/", "4", ")", ";", "}", "else", "w", "=", "SHORT", "(", "tny_font", "[", "c", "]", "->", "width", ")", "*", "dupx", "/", "2", ";", "if", "(", "cx", ">", "scrwidth", ")", "break;", "if", "(", "cx", "+", "left", "+", "w", "<", "0", ")", "//left", "boundary", "check", "{", "cx", "+=", "w", ";", "continue;", "}", "colormap", "=", "V_GetStringColormap", "(", "charflags", ")", ";", "V_DrawFixedPatch", "(", "cx", "+", "center", ",", "cy", ",", "FRACUNIT", "/", "2", ",", "option", ",", "tny_font", "[", "c", "]", ",", "colormap", ")", ";", "cx", "+=", "w", ";", "}", "}'" ]
V_DrawSmallThinStringAtFixed
STJr/SRB2
double_slash
train
921
1,160
[ "Very", "similar", "to", "F_DrawFadeConsBack,", "except", "we", "draw", "from", "the", "middle(ish)", "of", "the", "screen", "to", "the", "bottom" ]
[ "'void", "V_DrawPromptBack", "(", "INT32", "boxheight", ",", "INT32", "color", ")", "{", "UINT8", "*", "deststop", ",", "<type", "ref=\"prev\">", "*", "buf", ";", "if", "(", "color", ">=", "256", "&&", "color", "<", "512", ")", "{", "boxheight", "=", "(", "(", "boxheight", "*", "4", ")", "+", "(", "boxheight", "/", "2", ")", "*", "5", ")", ";", "V_DrawFill", "(", "(", "BASEVIDWIDTH", "-", "(", "vid", ".", "width", "/", "vid", ".", "dupx", ")", ")", "/", "2", ",", "BASEVIDHEIGHT", "-", "boxheight", ",", "(", "vid", ".", "width", "/", "vid", ".", "dupx", ")", ",", "boxheight", ",", "(", "color", "-", "256", ")", "|", "V_SNAPTOBOTTOM", ")", ";", "return", ";", "}", "boxheight", "*=", "vid", ".", "dupy", ";", "if", "(", "color", "==", "INT32_MAX", ")", "color", "=", "cons_backcolor", ".", "value", ";", "#", "ifdef", "HWRENDER", "if", "(", "rendermode", "!=", "render_soft", "&&", "rendermode", "!=", "render_none", ")", "{", "UINT32", "hwcolor", ";", "switch", "(", "color", ")", "{", "case", "0", ":", "hwcolor", "=", "0xffffff00", ";", "break;", "//", "White", "case", "1", ":", "hwcolor", "=", "0x00000000", ";", "break;", "//", "Black", "//", "Note", "this", "is", "different", "from", "V_DrawFadeConsBack", "case", "2", ":", "hwcolor", "=", "0xdeb88700", ";", "break;", "//", "Sepia", "case", "3", ":", "hwcolor", "=", "0x40201000", ";", "break;", "//", "Brown", "case", "4", ":", "hwcolor", "=", "0xfa807200", ";", "break;", "//", "Pink", "case", "5", ":", "hwcolor", "=", "0xff69b400", ";", "break;", "//", "Raspberry", "case", "6", ":", "hwcolor", "=", "0xff000000", ";", "break;", "//", "Red", "case", "7", ":", "hwcolor", "=", "0xffd68300", ";", "break;", "//", "Creamsicle", "case", "8", ":", "hwcolor", "=", "0xff800000", ";", "break;", "//", "Orange", "case", "9", ":", "hwcolor", "=", "0xdaa52000", ";", "break;", "//", "Gold", "case", "10", ":", "hwcolor", "=", "0x80800000", ";", "break;", "//", "Yellow", "case", "11", ":", "hwcolor", "=", "0x00ff0000", ";", "break;", "//", "Emerald", "case", "12", ":", "hwcolor", "=", "0x00800000", ";", "break;", "//", "Green", "case", "13", ":", "hwcolor", "=", "0x4080ff00", ";", "break;", "//", "Cyan", "case", "14", ":", "hwcolor", "=", "0x4682b400", ";", "break;", "//", "Steel", "case", "15", ":", "hwcolor", "=", "0x1e90ff00", ";", "break;", "//", "Periwinkle", "case", "16", ":", "hwcolor", "=", "0x0000ff00", ";", "break;", "//", "Blue", "case", "17", ":", "hwcolor", "=", "0xff00ff00", ";", "break;", "//", "Purple", "case", "18", ":", "hwcolor", "=", "0xee82ee00", ";", "break;", "//", "Lavender", "//", "Default", "green", "default:", "hwcolor", "=", "0x00800000", ";", "break;", "}", "HWR_DrawTutorialBack", "(", "hwcolor", ",", "boxheight", ")", ";", "return", ";", "}", "#", "endif", "CON_SetupBackColormapEx", "(", "color", ",", "true", ")", ";", "//", "heavily", "simplified", "--", "we", "don\\'t", "need", "to", "know", "x", "or", "y", "position,", "//", "just", "the", "start", "and", "stop", "positions", "deststop", "=", "screens", "[", "0", "]", "+", "vid", ".", "rowbytes", "*", "vid", ".", "height", ";", "buf", "=", "deststop", "-", "vid", ".", "rowbytes", "*", "(", "(", "boxheight", "*", "4", ")", "+", "(", "boxheight", "/", "2", ")", "*", "5", ")", ";", "//", "4", "lines", "of", "space", "plus", "gaps", "between", "and", "some", "leeway", "for", "(", ";", "buf", "<", "deststop", ";", "++", "buf", ")", "*", "buf", "=", "promptbgmap", "[", "*", "buf", "]", ";", "}'" ]
V_DrawPromptBack
STJr/SRB2
double_slash
train
922
1,161
[ "Count", "the", "amount", "of", "lines", "in", "name", "tag", "string" ]
[ "\"INT32", "V_CountNameTagLines", "(", "const", "char", "*", "string", ")", "{", "INT32", "ntlines", "=", "1", ";", "const", "char", "*", "text", "=", "string", ";", "const", "char", "*", "first_token", "=", "text", ";", "char", "*", "last_token", "=", "strchr", "(", "text", ",", "'\\'", ")", ";", "//", "No", "line", "breaks?", "if", "(", "!", "last_token", ")", "return", "ntlines", ";", "//", "Split", "string", "by", "the", "line", "break", "character", "else", "{", "while", "(", "true", ")", "{", "if", "(", "last_token", ")", "ntlines", "++", ";", "//", "No", "line", "break", "character", "was", "found", "else", "break;", "//", "Next", "line", "if", "(", "(", "last_token", "-", "text", ")", "+", "1", ">=", "(", "signed", ")", "strlen", "(", "text", ")", ")", "last_token", "=", "NULL", ";", "else", "{", "first_token", "=", "last_token", ";", "last_token", "=", "strchr", "(", "first_token", "+", "1", ",", "'\\'", ")", ";", "}", "}", "}", "return", "ntlines", ";", "}\"" ]
V_CountNameTagLines
STJr/SRB2
double_slash
train
923
1,162
[ "Draws", "a", "patch", "scaled", "to", "arbitrary", "size" ]
[ "'void", "V_DrawStretchyFixedPatch", "(", "fixed_t", "x", ",", "fixed_t", "y", ",", "fixed_t", "pscale", ",", "fixed_t", "vscale", ",", "INT32", "scrn", ",", "patch_t", "*", "patch", ",", "const", "UINT8", "*", "colormap", ")", "{", "UINT8", "(", "*", "patchdrawfunc", ")", "(", "const", "UINT8", "*", ",", "const", "UINT8", "*", ",", "fixed_t", ")", ";", "UINT32", "alphalevel", "=", "0", ";", "fixed_t", "col", ",", "<type", "ref=\"prev\"/>", "ofs", ",", "<type", "ref=\"prev\"/>", "colfrac", ",", "<type", "ref=\"prev\"/>", "rowfrac", ",", "<type", "ref=\"prev\"/>", "fdup", ",", "<type", "ref=\"prev\"/>", "vdup", ";", "INT32", "dupx", ",", "<type", "ref=\"prev\"/>", "dupy", ";", "const", "column_t", "*", "column", ";", "UINT8", "*", "desttop", ",", "<type", "ref=\"prev\">", "*", "dest", ",", "<type", "ref=\"prev\">", "*", "deststart", ",", "<type", "ref=\"prev\">", "*", "destend", ";", "const", "UINT8", "*", "source", ",", "<type", "ref=\"prev\">", "*", "deststop", ";", "fixed_t", "pwidth", ";", "//", "patch", "width", "fixed_t", "offx", "=", "0", ";", "//", "x", "offset", "UINT8", "perplayershuffle", "=", "0", ";", "if", "(", "rendermode", "==", "render_none", ")", "return", ";", "#", "ifdef", "HWRENDER", "//if", "(rendermode", "!=", "render_soft", "&&", "!con_startup)", "//", "Why?", "if", "(", "rendermode", "!=", "render_soft", ")", "{", "HWR_DrawStretchyFixedPatch", "(", "(", "GLPatch_t", "*", ")", "patch", ",", "x", ",", "y", ",", "pscale", ",", "vscale", ",", "scrn", ",", "colormap", ")", ";", "return", ";", "}", "#", "endif", "patchdrawfunc", "=", "standardpdraw", ";", "v_translevel", "=", "NULL", ";", "if", "(", "(", "alphalevel", "=", "(", "(", "scrn", "&", "V_ALPHAMASK", ")", ">>", "V_ALPHASHIFT", ")", ")", ")", "{", "if", "(", "alphalevel", "==", "13", ")", "alphalevel", "=", "hudminusalpha", "[", "st_translucency", "]", ";", "<if", "type=\"elseif\">", "else", "if", "(", "alphalevel", "==", "14", ")", "alphalevel", "=", "10", "-", "st_translucency", ";", "<if", "type=\"elseif\">", "else", "if", "(", "alphalevel", "==", "15", ")", "alphalevel", "=", "hudplusalpha", "[", "st_translucency", "]", ";", "if", "(", "alphalevel", ">=", "10", ")", "return", ";", "//", "invis", "if", "(", "alphalevel", ")", "{", "v_translevel", "=", "transtables", "+", "(", "(", "alphalevel", "-", "1", ")", "<<", "FF_TRANSSHIFT", ")", ";", "patchdrawfunc", "=", "translucentpdraw", ";", "}", "}", "v_colormap", "=", "NULL", ";", "if", "(", "colormap", ")", "{", "v_colormap", "=", "colormap", ";", "patchdrawfunc", "=", "(", "v_translevel", ")", "?", "transmappedpdraw", ":", "mappedpdraw", ";", "}", "dupx", "=", "vid", ".", "dupx", ";", "dupy", "=", "vid", ".", "dupy", ";", "if", "(", "scrn", "&", "V_SCALEPATCHMASK", ")", "switch", "(", "(", "scrn", "&", "V_SCALEPATCHMASK", ")", ">>", "V_SCALEPATCHSHIFT", ")", "{", "case", "1", ":", "//", "V_NOSCALEPATCH", "dupx", "=", "dupy", "=", "1", ";", "break;", "case", "2", ":", "//", "V_SMALLSCALEPATCH", "dupx", "=", "vid", ".", "smalldupx", ";", "dupy", "=", "vid", ".", "smalldupy", ";", "break;", "case", "3", ":", "//", "V_MEDSCALEPATCH", "dupx", "=", "vid", ".", "meddupx", ";", "dupy", "=", "vid", ".", "meddupy", ";", "break;", "default:", "break;", "}", "//", "only", "use", "one", "dup,", "to", "avoid", "stretching", "(har", "har)", "dupx", "=", "dupy", "=", "(", "dupx", "<", "dupy", "?", "dupx", ":", "dupy", ")", ";", "fdup", "=", "vdup", "=", "FixedMul", "(", "dupx", "<<", "FRACBITS", ",", "pscale", ")", ";", "if", "(", "vscale", "!=", "pscale", ")", "vdup", "=", "FixedMul", "(", "dupx", "<<", "FRACBITS", ",", "vscale", ")", ";", "colfrac", "=", "FixedDiv", "(", "FRACUNIT", ",", "fdup", ")", ";", "rowfrac", "=", "FixedDiv", "(", "FRACUNIT", ",", "vdup", ")", ";", "//", "So", "it", "turns", "out", "offsets", "aren\\'t", "scaled", "in", "V_NOSCALESTART", "unless", "V_OFFSET", "is", "applied", "...poo,", "that\\'s", "terrible", "//", "For", "now", "let\\'s", "just", "at", "least", "give", "V_OFFSET", "the", "ability", "to", "support", "V_FLIP", "//", "I\\'ll", "probably", "make", "a", "better", "fix", "for", "2.2", "where", "I", "don\\'t", "have", "to", "worry", "about", "breaking", "existing", "support", "for", "stuff", "//", "--", "Monster", "Iestyn", "29/10/18", "{", "fixed_t", "offsetx", "=", "0", ",", "<type", "ref=\"prev\"/>", "offsety", "=", "0", ";", "//", "left", "offset", "if", "(", "scrn", "&", "V_FLIP", ")", "offsetx", "=", "FixedMul", "(", "(", "SHORT", "(", "patch", "->", "width", ")", "-", "SHORT", "(", "patch", "->", "leftoffset", ")", ")", "<<", "FRACBITS", ",", "pscale", ")", "+", "1", ";", "else", "offsetx", "=", "FixedMul", "(", "SHORT", "(", "patch", "->", "leftoffset", ")", "<<", "FRACBITS", ",", "pscale", ")", ";", "//", "top", "offset", "//", "TODO:", "make", "some", "kind", "of", "vertical", "version", "of", "V_FLIP,", "maybe", "by", "deprecating", "V_OFFSET", "in", "future?!?", "offsety", "=", "FixedMul", "(", "SHORT", "(", "patch", "->", "topoffset", ")", "<<", "FRACBITS", ",", "vscale", ")", ";", "if", "(", "(", "scrn", "&", "(", "V_NOSCALESTART", "|", "V_OFFSET", ")", ")", "==", "(", "V_NOSCALESTART", "|", "V_OFFSET", ")", ")", "//", "Multiply", "by", "dupx/dupy", "for", "crosshairs", "{", "offsetx", "=", "FixedMul", "(", "offsetx", ",", "dupx", "<<", "FRACBITS", ")", ";", "offsety", "=", "FixedMul", "(", "offsety", ",", "dupy", "<<", "FRACBITS", ")", ";", "}", "//", "Subtract", "the", "offsets", "from", "x/y", "positions", "x", "-=", "offsetx", ";", "y", "-=", "offsety", ";", "}", "if", "(", "splitscreen", "&&", "(", "scrn", "&", "V_PERPLAYER", ")", ")", "{", "fixed_t", "adjusty", "=", "(", "(", "scrn", "&", "V_NOSCALESTART", ")", "?", "vid", ".", "height", ":", "BASEVIDHEIGHT", ")", "<<", "(", "FRACBITS", "-", "1", ")", ";", "vdup", ">>=", "1", ";", "rowfrac", "<<=", "1", ";", "y", ">>=", "1", ";", "#", "ifdef", "QUADS", "if", "(", "splitscreen", ">", "1", ")", "//", "3", "or", "4", "players", "{", "fixed_t", "adjustx", "=", "(", "(", "scrn", "&", "V_NOSCALESTART", ")", "?", "vid", ".", "height", ":", "BASEVIDHEIGHT", ")", "<<", "(", "FRACBITS", "-", "1", ")", ")", ";", "fdup", ">>=", "1", ";", "colfrac", "<<=", "1", ";", "x", ">>=", "1", ";", "if", "(", "stplyr", "==", "&", "players", "[", "displayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "1", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "4", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", "|", "V_SNAPTORIGHT", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "stplyr", "==", "&", "players", "[", "secondarydisplayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "1", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "8", ";", "x", "+=", "adjustx", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", "|", "V_SNAPTOLEFT", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "stplyr", "==", "&", "players", "[", "thirddisplayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "2", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "4", ";", "y", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", "|", "V_SNAPTORIGHT", ";", "}", "else", "//if", "(stplyr", "==", "&players[fourthdisplayplayer])", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "2", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "8", ";", "x", "+=", "adjustx", ";", "y", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", "|", "V_SNAPTOLEFT", ";", "}", "}", "else", "#", "endif", "//", "2", "players", "{", "if", "(", "stplyr", "==", "&", "players", "[", "displayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "=", "1", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", ";", "}", "else", "//if", "(stplyr", "==", "&players[secondarydisplayplayer])", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "=", "2", ";", "y", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", ";", "}", "}", "}", "desttop", "=", "screens", "[", "scrn", "&", "V_PARAMMASK", "]", ";", "if", "(", "!", "desttop", ")", "return", ";", "deststop", "=", "desttop", "+", "vid", ".", "rowbytes", "*", "vid", ".", "height", ";", "if", "(", "scrn", "&", "V_NOSCALESTART", ")", "{", "x", ">>=", "FRACBITS", ";", "y", ">>=", "FRACBITS", ";", "desttop", "+=", "(", "y", "*", "vid", ".", "width", ")", "+", "x", ";", "}", "else", "{", "x", "=", "FixedMul", "(", "x", ",", "dupx", "<<", "FRACBITS", ")", ";", "y", "=", "FixedMul", "(", "y", ",", "dupy", "<<", "FRACBITS", ")", ";", "x", ">>=", "FRACBITS", ";", "y", ">>=", "FRACBITS", ";", "//", "Center", "it", "if", "necessary", "if", "(", "!", "(", "scrn", "&", "V_SCALEPATCHMASK", ")", ")", "{", "//", "if", "it\\'s", "meant", "to", "cover", "the", "whole", "screen,", "black", "out", "the", "rest", "(ONLY", "IF", "TOP", "LEFT", "ISN\\'T", "TRANSPARENT)", "if", "(", "x", "==", "0", "&&", "SHORT", "(", "patch", "->", "width", ")", "==", "BASEVIDWIDTH", "&&", "y", "==", "0", "&&", "SHORT", "(", "patch", "->", "height", ")", "==", "BASEVIDHEIGHT", ")", "{", "column", "=", "(", "const", "column_t", "*", ")", "(", "(", "const", "UINT8", "*", ")", "(", "patch", ")", "+", "LONG", "(", "patch", "->", "columnofs", "[", "0", "]", ")", ")", ";", "if", "(", "!", "column", "->", "topdelta", ")", "{", "source", "=", "(", "const", "UINT8", "*", ")", "(", "column", ")", "+", "3", ";", "V_DrawFill", "(", "0", ",", "0", ",", "BASEVIDWIDTH", ",", "BASEVIDHEIGHT", ",", "source", "[", "0", "]", ")", ";", "}", "}", "if", "(", "vid", ".", "width", "!=", "BASEVIDWIDTH", "*", "dupx", ")", "{", "//", "dupx", "adjustments", "pretend", "that", "screen", "width", "is", "BASEVIDWIDTH", "*", "dupx,", "//", "so", "center", "this", "imaginary", "screen", "if", "(", "scrn", "&", "V_SNAPTORIGHT", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "!", "(", "scrn", "&", "V_SNAPTOLEFT", ")", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "2", ";", "if", "(", "perplayershuffle", "&", "4", ")", "x", "-=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "4", ";", "<if", "type=\"elseif\">", "else", "if", "(", "perplayershuffle", "&", "8", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "4", ";", "}", "if", "(", "vid", ".", "height", "!=", "BASEVIDHEIGHT", "*", "dupy", ")", "{", "//", "same", "thing", "here", "if", "(", "scrn", "&", "V_SNAPTOBOTTOM", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "!", "(", "scrn", "&", "V_SNAPTOTOP", ")", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "2", ";", "if", "(", "perplayershuffle", "&", "1", ")", "y", "-=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "4", ";", "<if", "type=\"elseif\">", "else", "if", "(", "perplayershuffle", "&", "2", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "4", ";", "}", "}", "desttop", "+=", "(", "y", "*", "vid", ".", "width", ")", "+", "x", ";", "}", "if", "(", "pscale", "!=", "FRACUNIT", ")", "//", "scale", "width", "properly", "{", "pwidth", "=", "SHORT", "(", "patch", "->", "width", ")", "<<", "FRACBITS", ";", "pwidth", "=", "FixedMul", "(", "pwidth", ",", "pscale", ")", ";", "pwidth", "=", "FixedMul", "(", "pwidth", ",", "dupx", "<<", "FRACBITS", ")", ";", "pwidth", ">>=", "FRACBITS", ";", "}", "else", "pwidth", "=", "SHORT", "(", "patch", "->", "width", ")", "*", "dupx", ";", "deststart", "=", "desttop", ";", "destend", "=", "desttop", "+", "pwidth", ";", "for", "(", "col", "=", "0", ";", "(", "col", ">>", "FRACBITS", ")", "<", "SHORT", "(", "patch", "->", "width", ")", ";", "col", "+=", "colfrac", ",", "++", "offx", ",", "desttop", "++", ")", "{", "INT32", "topdelta", ",", "<type", "ref=\"prev\"/>", "prevdelta", "=", "-", "1", ";", "if", "(", "scrn", "&", "V_FLIP", ")", "//", "offx", "is", "measured", "from", "right", "edge", "instead", "of", "left", "{", "if", "(", "x", "+", "pwidth", "-", "offx", "<", "0", ")", "//", "don\\'t", "draw", "off", "the", "left", "of", "the", "screen", "(WRAP", "PREVENTION)", "break;", "if", "(", "x", "+", "pwidth", "-", "offx", ">=", "vid", ".", "width", ")", "//", "don\\'t", "draw", "off", "the", "right", "of", "the", "screen", "(WRAP", "PREVENTION)", "continue;", "}", "else", "{", "if", "(", "x", "+", "offx", "<", "0", ")", "//", "don\\'t", "draw", "off", "the", "left", "of", "the", "screen", "(WRAP", "PREVENTION)", "continue;", "if", "(", "x", "+", "offx", ">=", "vid", ".", "width", ")", "//", "don\\'t", "draw", "off", "the", "right", "of", "the", "screen", "(WRAP", "PREVENTION)", "break;", "}", "column", "=", "(", "const", "column_t", "*", ")", "(", "(", "const", "UINT8", "*", ")", "(", "patch", ")", "+", "LONG", "(", "patch", "->", "columnofs", "[", "col", ">>", "FRACBITS", "]", ")", ")", ";", "while", "(", "column", "->", "topdelta", "!=", "0xff", ")", "{", "topdelta", "=", "column", "->", "topdelta", ";", "if", "(", "topdelta", "<=", "prevdelta", ")", "topdelta", "+=", "prevdelta", ";", "prevdelta", "=", "topdelta", ";", "source", "=", "(", "const", "UINT8", "*", ")", "(", "column", ")", "+", "3", ";", "dest", "=", "desttop", ";", "if", "(", "scrn", "&", "V_FLIP", ")", "dest", "=", "deststart", "+", "(", "destend", "-", "desttop", ")", ";", "dest", "+=", "FixedInt", "(", "FixedMul", "(", "topdelta", "<<", "FRACBITS", ",", "vdup", ")", ")", "*", "vid", ".", "width", ";", "for", "(", "ofs", "=", "0", ";", "dest", "<", "deststop", "&&", "(", "ofs", ">>", "FRACBITS", ")", "<", "column", "->", "length", ";", "ofs", "+=", "rowfrac", ")", "{", "if", "(", "dest", ">=", "screens", "[", "scrn", "&", "V_PARAMMASK", "]", ")", "//", "don\\'t", "draw", "off", "the", "top", "of", "the", "screen", "(CRASH", "PREVENTION)", "*", "dest", "=", "patchdrawfunc", "(", "dest", ",", "source", ",", "ofs", ")", ";", "dest", "+=", "vid", ".", "width", ";", "}", "column", "=", "(", "const", "column_t", "*", ")", "(", "(", "const", "UINT8", "*", ")", "column", "+", "column", "->", "length", "+", "4", ")", ";", "}", "}", "}'" ]
V_DrawStretchyFixedPatch
STJr/SRB2
double_slash
train
924
1,163
[ "Draws", "a", "string", "at", "a", "fixed_t", "location" ]
[ "'void", "V_DrawStringAtFixed", "(", "fixed_t", "x", ",", "fixed_t", "y", ",", "INT32", "option", ",", "const", "char", "*", "string", ")", "{", "fixed_t", "cx", "=", "x", ",", "<type", "ref=\"prev\"/>", "cy", "=", "y", ";", "INT32", "w", ",", "<type", "ref=\"prev\"/>", "c", ",", "<type", "ref=\"prev\"/>", "dupx", ",", "<type", "ref=\"prev\"/>", "dupy", ",", "<type", "ref=\"prev\"/>", "scrwidth", ",", "<type", "ref=\"prev\"/>", "center", "=", "0", ",", "<type", "ref=\"prev\"/>", "left", "=", "0", ";", "const", "char", "*", "ch", "=", "string", ";", "INT32", "charflags", "=", "0", ";", "const", "UINT8", "*", "colormap", "=", "NULL", ";", "INT32", "spacewidth", "=", "4", ",", "<type", "ref=\"prev\"/>", "charwidth", "=", "0", ";", "INT32", "lowercase", "=", "(", "option", "&", "V_ALLOWLOWERCASE", ")", ";", "option", "&=", "~", "V_FLIP", ";", "//", "which", "is", "also", "shared", "with", "V_ALLOWLOWERCASE...", "if", "(", "option", "&", "V_NOSCALESTART", ")", "{", "dupx", "=", "vid", ".", "dupx", ";", "dupy", "=", "vid", ".", "dupy", ";", "scrwidth", "=", "vid", ".", "width", ";", "}", "else", "{", "dupx", "=", "dupy", "=", "1", ";", "scrwidth", "=", "vid", ".", "width", "/", "vid", ".", "dupx", ";", "left", "=", "(", "scrwidth", "-", "BASEVIDWIDTH", ")", "/", "2", ";", "scrwidth", "-=", "left", ";", "}", "charflags", "=", "(", "option", "&", "V_CHARCOLORMASK", ")", ";", "switch", "(", "option", "&", "V_SPACINGMASK", ")", "{", "case", "V_MONOSPACE", ":", "spacewidth", "=", "8", ";", "/*", "FALLTHRU", "*/", "case", "V_OLDSPACING", ":", "charwidth", "=", "8", ";", "break;", "case", "V_6WIDTHSPACE", ":", "spacewidth", "=", "6", ";", "default:", "break;", "}", "for", "(", ";", ";", "ch", "++", ")", "{", "if", "(", "!", "*", "ch", ")", "break;", "if", "(", "*", "ch", "&", "0x80", ")", "//color", "ignoring", "{", "//", "manually", "set", "flags", "override", "color", "codes", "if", "(", "!", "(", "option", "&", "V_CHARCOLORMASK", ")", ")", "charflags", "=", "(", "(", "*", "ch", "&", "0x7f", ")", "<<", "V_CHARCOLORSHIFT", ")", "&", "V_CHARCOLORMASK", ";", "continue;", "}", "if", "(", "*", "ch", "==", "\\'\\\\'", ")", "{", "cx", "=", "x", ";", "if", "(", "option", "&", "V_RETURN8", ")", "cy", "+=", "(", "8", "*", "dupy", ")", "<<", "FRACBITS", ";", "else", "cy", "+=", "(", "12", "*", "dupy", ")", "<<", "FRACBITS", ";", "continue;", "}", "c", "=", "*", "ch", ";", "if", "(", "!", "lowercase", ")", "c", "=", "toupper", "(", "c", ")", ";", "c", "-=", "HU_FONTSTART", ";", "//", "character", "does", "not", "exist", "or", "is", "a", "space", "if", "(", "c", "<", "0", "||", "c", ">=", "HU_FONTSIZE", "||", "!", "hu_font", "[", "c", "]", ")", "{", "cx", "+=", "(", "spacewidth", "*", "dupx", ")", "<<", "FRACBITS", ";", "continue;", "}", "if", "(", "charwidth", ")", "{", "w", "=", "charwidth", "*", "dupx", ";", "center", "=", "w", "/", "2", "-", "SHORT", "(", "hu_font", "[", "c", "]", "->", "width", ")", "*", "(", "dupx", "/", "2", ")", ";", "}", "else", "w", "=", "SHORT", "(", "hu_font", "[", "c", "]", "->", "width", ")", "*", "dupx", ";", "if", "(", "(", "cx", ">>", "FRACBITS", ")", ">", "scrwidth", ")", "continue;", "if", "(", "(", "cx", ">>", "FRACBITS", ")", "+", "left", "+", "w", "<", "0", ")", "//left", "boundary", "check", "{", "cx", "+=", "w", "<<", "FRACBITS", ";", "continue;", "}", "colormap", "=", "V_GetStringColormap", "(", "charflags", ")", ";", "V_DrawFixedPatch", "(", "cx", "+", "(", "center", "<<", "FRACBITS", ")", ",", "cy", ",", "FRACUNIT", ",", "option", ",", "hu_font", "[", "c", "]", ",", "colormap", ")", ";", "cx", "+=", "w", "<<", "FRACBITS", ";", "}", "}'" ]
V_DrawStringAtFixed
STJr/SRB2
double_slash
train
925
1,164
[ "Simple", "translucency", "with", "one", "color,", "over", "a", "set", "number", "of", "lines", "starting", "from", "the", "top" ]
[ "'void", "V_DrawFadeConsBack", "(", "INT32", "plines", ")", "{", "UINT8", "*", "deststop", ",", "<type", "ref=\"prev\">", "*", "buf", ";", "#", "ifdef", "HWRENDER", "//", "not", "win32", "only", "19990829", "by", "Kin", "if", "(", "rendermode", "!=", "render_soft", "&&", "rendermode", "!=", "render_none", ")", "{", "UINT32", "hwcolor", "=", "V_GetHWConsBackColor", "()", ";", "HWR_DrawConsoleBack", "(", "hwcolor", ",", "plines", ")", ";", "return", ";", "}", "#", "endif", "//", "heavily", "simplified", "--", "we", "don\\'t", "need", "to", "know", "x", "or", "y", "position,", "//", "just", "the", "stop", "position", "deststop", "=", "screens", "[", "0", "]", "+", "vid", ".", "rowbytes", "*", "min", "(", "plines", ",", "vid", ".", "height", ")", ";", "for", "(", "buf", "=", "screens", "[", "0", "]", ";", "buf", "<", "deststop", ";", "++", "buf", ")", "*", "buf", "=", "consolebgmap", "[", "*", "buf", "]", ";", "}'" ]
V_DrawFadeConsBack
STJr/SRB2
double_slash
train
926
1,165
[ "Draws", "a", "patch", "cropped", "and", "scaled", "to", "arbitrary", "size" ]
[ "'void", "V_DrawCroppedPatch", "(", "fixed_t", "x", ",", "fixed_t", "y", ",", "fixed_t", "pscale", ",", "INT32", "scrn", ",", "patch_t", "*", "patch", ",", "fixed_t", "sx", ",", "fixed_t", "sy", ",", "fixed_t", "w", ",", "fixed_t", "h", ")", "{", "UINT8", "(", "*", "patchdrawfunc", ")", "(", "const", "UINT8", "*", ",", "const", "UINT8", "*", ",", "fixed_t", ")", ";", "UINT32", "alphalevel", "=", "0", ";", "//", "boolean", "flip", "=", "false;", "fixed_t", "col", ",", "<type", "ref=\"prev\"/>", "ofs", ",", "<type", "ref=\"prev\"/>", "colfrac", ",", "<type", "ref=\"prev\"/>", "rowfrac", ",", "<type", "ref=\"prev\"/>", "fdup", ";", "INT32", "dupx", ",", "<type", "ref=\"prev\"/>", "dupy", ";", "const", "column_t", "*", "column", ";", "UINT8", "*", "desttop", ",", "<type", "ref=\"prev\">", "*", "dest", ";", "const", "UINT8", "*", "source", ",", "<type", "ref=\"prev\">", "*", "deststop", ";", "UINT8", "perplayershuffle", "=", "0", ";", "if", "(", "rendermode", "==", "render_none", ")", "return", ";", "#", "ifdef", "HWRENDER", "//if", "(rendermode", "!=", "render_soft", "&&", "!con_startup)", "//", "Not", "this", "again", "if", "(", "rendermode", "!=", "render_soft", ")", "{", "HWR_DrawCroppedPatch", "(", "(", "GLPatch_t", "*", ")", "patch", ",", "x", ",", "y", ",", "pscale", ",", "scrn", ",", "sx", ",", "sy", ",", "w", ",", "h", ")", ";", "return", ";", "}", "#", "endif", "patchdrawfunc", "=", "standardpdraw", ";", "v_translevel", "=", "NULL", ";", "if", "(", "(", "alphalevel", "=", "(", "(", "scrn", "&", "V_ALPHAMASK", ")", ">>", "V_ALPHASHIFT", ")", ")", ")", "{", "if", "(", "alphalevel", "==", "13", ")", "alphalevel", "=", "hudminusalpha", "[", "st_translucency", "]", ";", "<if", "type=\"elseif\">", "else", "if", "(", "alphalevel", "==", "14", ")", "alphalevel", "=", "10", "-", "st_translucency", ";", "<if", "type=\"elseif\">", "else", "if", "(", "alphalevel", "==", "15", ")", "alphalevel", "=", "hudplusalpha", "[", "st_translucency", "]", ";", "if", "(", "alphalevel", ">=", "10", ")", "return", ";", "//", "invis", "if", "(", "alphalevel", ")", "{", "v_translevel", "=", "transtables", "+", "(", "(", "alphalevel", "-", "1", ")", "<<", "FF_TRANSSHIFT", ")", ";", "patchdrawfunc", "=", "translucentpdraw", ";", "}", "}", "//", "only", "use", "one", "dup,", "to", "avoid", "stretching", "(har", "har)", "dupx", "=", "dupy", "=", "(", "vid", ".", "dupx", "<", "vid", ".", "dupy", "?", "vid", ".", "dupx", ":", "vid", ".", "dupy", ")", ";", "fdup", "=", "FixedMul", "(", "dupx", "<<", "FRACBITS", ",", "pscale", ")", ";", "colfrac", "=", "FixedDiv", "(", "FRACUNIT", ",", "fdup", ")", ";", "rowfrac", "=", "FixedDiv", "(", "FRACUNIT", ",", "fdup", ")", ";", "y", "-=", "FixedMul", "(", "SHORT", "(", "patch", "->", "topoffset", ")", "<<", "FRACBITS", ",", "pscale", ")", ";", "x", "-=", "FixedMul", "(", "SHORT", "(", "patch", "->", "leftoffset", ")", "<<", "FRACBITS", ",", "pscale", ")", ";", "if", "(", "splitscreen", "&&", "(", "scrn", "&", "V_PERPLAYER", ")", ")", "{", "fixed_t", "adjusty", "=", "(", "(", "scrn", "&", "V_NOSCALESTART", ")", "?", "vid", ".", "height", ":", "BASEVIDHEIGHT", ")", "<<", "(", "FRACBITS", "-", "1", ")", ";", "fdup", ">>=", "1", ";", "rowfrac", "<<=", "1", ";", "y", ">>=", "1", ";", "sy", ">>=", "1", ";", "h", ">>=", "1", ";", "#", "ifdef", "QUADS", "if", "(", "splitscreen", ">", "1", ")", "//", "3", "or", "4", "players", "{", "fixed_t", "adjustx", "=", "(", "(", "scrn", "&", "V_NOSCALESTART", ")", "?", "vid", ".", "height", ":", "BASEVIDHEIGHT", ")", "<<", "(", "FRACBITS", "-", "1", ")", ")", ";", "colfrac", "<<=", "1", ";", "x", ">>=", "1", ";", "sx", ">>=", "1", ";", "w", ">>=", "1", ";", "if", "(", "stplyr", "==", "&", "players", "[", "displayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "1", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "4", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", "|", "V_SNAPTORIGHT", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "stplyr", "==", "&", "players", "[", "secondarydisplayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "1", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "8", ";", "x", "+=", "adjustx", ";", "sx", "+=", "adjustx", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", "|", "V_SNAPTOLEFT", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "stplyr", "==", "&", "players", "[", "thirddisplayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "2", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "4", ";", "y", "+=", "adjusty", ";", "sy", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", "|", "V_SNAPTORIGHT", ";", "}", "else", "//if", "(stplyr", "==", "&players[fourthdisplayplayer])", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "2", ";", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOLEFT", "|", "V_SNAPTORIGHT", ")", ")", ")", "perplayershuffle", "|=", "8", ";", "x", "+=", "adjustx", ";", "sx", "+=", "adjustx", ";", "y", "+=", "adjusty", ";", "sy", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", "|", "V_SNAPTOLEFT", ";", "}", "}", "else", "#", "endif", "//", "2", "players", "{", "if", "(", "stplyr", "==", "&", "players", "[", "displayplayer", "]", ")", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "1", ";", "scrn", "&=", "~", "V_SNAPTOBOTTOM", ";", "}", "else", "//if", "(stplyr", "==", "&players[secondarydisplayplayer])", "{", "if", "(", "!", "(", "scrn", "&", "(", "V_SNAPTOTOP", "|", "V_SNAPTOBOTTOM", ")", ")", ")", "perplayershuffle", "|=", "2", ";", "y", "+=", "adjusty", ";", "sy", "+=", "adjusty", ";", "scrn", "&=", "~", "V_SNAPTOTOP", ";", "}", "}", "}", "desttop", "=", "screens", "[", "scrn", "&", "V_PARAMMASK", "]", ";", "if", "(", "!", "desttop", ")", "return", ";", "deststop", "=", "desttop", "+", "vid", ".", "rowbytes", "*", "vid", ".", "height", ";", "if", "(", "scrn", "&", "V_NOSCALESTART", ")", "{", "x", ">>=", "FRACBITS", ";", "y", ">>=", "FRACBITS", ";", "desttop", "+=", "(", "y", "*", "vid", ".", "width", ")", "+", "x", ";", "}", "else", "{", "x", "=", "FixedMul", "(", "x", ",", "dupx", "<<", "FRACBITS", ")", ";", "y", "=", "FixedMul", "(", "y", ",", "dupy", "<<", "FRACBITS", ")", ";", "x", ">>=", "FRACBITS", ";", "y", ">>=", "FRACBITS", ";", "//", "Center", "it", "if", "necessary", "if", "(", "!", "(", "scrn", "&", "V_SCALEPATCHMASK", ")", ")", "{", "//", "if", "it\\'s", "meant", "to", "cover", "the", "whole", "screen,", "black", "out", "the", "rest", "//", "no", "the", "patch", "is", "cropped", "do", "not", "do", "this", "ever", "if", "(", "vid", ".", "width", "!=", "BASEVIDWIDTH", "*", "dupx", ")", "{", "//", "dupx", "adjustments", "pretend", "that", "screen", "width", "is", "BASEVIDWIDTH", "*", "dupx,", "//", "so", "center", "this", "imaginary", "screen", "if", "(", "scrn", "&", "V_SNAPTORIGHT", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "!", "(", "scrn", "&", "V_SNAPTOLEFT", ")", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "2", ";", "if", "(", "perplayershuffle", "&", "4", ")", "x", "-=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "4", ";", "<if", "type=\"elseif\">", "else", "if", "(", "perplayershuffle", "&", "8", ")", "x", "+=", "(", "vid", ".", "width", "-", "(", "BASEVIDWIDTH", "*", "dupx", ")", ")", "/", "4", ";", "}", "if", "(", "vid", ".", "height", "!=", "BASEVIDHEIGHT", "*", "dupy", ")", "{", "//", "same", "thing", "here", "if", "(", "scrn", "&", "V_SNAPTOBOTTOM", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", ";", "<if", "type=\"elseif\">", "else", "if", "(", "!", "(", "scrn", "&", "V_SNAPTOTOP", ")", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "2", ";", "if", "(", "perplayershuffle", "&", "1", ")", "y", "-=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "4", ";", "<if", "type=\"elseif\">", "else", "if", "(", "perplayershuffle", "&", "2", ")", "y", "+=", "(", "vid", ".", "height", "-", "(", "BASEVIDHEIGHT", "*", "dupy", ")", ")", "/", "4", ";", "}", "}", "desttop", "+=", "(", "y", "*", "vid", ".", "width", ")", "+", "x", ";", "}", "for", "(", "col", "=", "sx", "<<", "FRACBITS", ";", "(", "col", ">>", "FRACBITS", ")", "<", "SHORT", "(", "patch", "->", "width", ")", "&&", "(", "(", "col", ">>", "FRACBITS", ")", "-", "sx", ")", "<", "w", ";", "col", "+=", "colfrac", ",", "++", "x", ",", "desttop", "++", ")", "{", "INT32", "topdelta", ",", "<type", "ref=\"prev\"/>", "prevdelta", "=", "-", "1", ";", "if", "(", "x", "<", "0", ")", "//", "don\\'t", "draw", "off", "the", "left", "of", "the", "screen", "(WRAP", "PREVENTION)", "continue;", "if", "(", "x", ">=", "vid", ".", "width", ")", "//", "don\\'t", "draw", "off", "the", "right", "of", "the", "screen", "(WRAP", "PREVENTION)", "break;", "column", "=", "(", "const", "column_t", "*", ")", "(", "(", "const", "UINT8", "*", ")", "(", "patch", ")", "+", "LONG", "(", "patch", "->", "columnofs", "[", "col", ">>", "FRACBITS", "]", ")", ")", ";", "while", "(", "column", "->", "topdelta", "!=", "0xff", ")", "{", "topdelta", "=", "column", "->", "topdelta", ";", "if", "(", "topdelta", "<=", "prevdelta", ")", "topdelta", "+=", "prevdelta", ";", "prevdelta", "=", "topdelta", ";", "source", "=", "(", "const", "UINT8", "*", ")", "(", "column", ")", "+", "3", ";", "dest", "=", "desttop", ";", "if", "(", "topdelta", "-", "sy", ">", "0", ")", "{", "dest", "+=", "FixedInt", "(", "FixedMul", "(", "(", "topdelta", "-", "sy", ")", "<<", "FRACBITS", ",", "fdup", ")", ")", "*", "vid", ".", "width", ";", "ofs", "=", "0", ";", "}", "else", "ofs", "=", "(", "sy", "-", "topdelta", ")", "<<", "FRACBITS", ";", "for", "(", ";", "dest", "<", "deststop", "&&", "(", "ofs", ">>", "FRACBITS", ")", "<", "column", "->", "length", "&&", "(", "(", "(", "ofs", ">>", "FRACBITS", ")", "-", "sy", ")", "+", "topdelta", ")", "<", "h", ";", "ofs", "+=", "rowfrac", ")", "{", "if", "(", "dest", ">=", "screens", "[", "scrn", "&", "V_PARAMMASK", "]", ")", "//", "don\\'t", "draw", "off", "the", "top", "of", "the", "screen", "(CRASH", "PREVENTION)", "*", "dest", "=", "patchdrawfunc", "(", "dest", ",", "source", ",", "ofs", ")", ";", "dest", "+=", "vid", ".", "width", ";", "}", "column", "=", "(", "const", "column_t", "*", ")", "(", "(", "const", "UINT8", "*", ")", "column", "+", "column", "->", "length", "+", "4", ")", ";", "}", "}", "}'" ]
V_DrawCroppedPatch
STJr/SRB2
double_slash
train
927
1,166
[ "Draws", "a", "thin", "string", "at", "a", "fixed_t", "location" ]
[ "'void", "V_DrawThinStringAtFixed", "(", "fixed_t", "x", ",", "fixed_t", "y", ",", "INT32", "option", ",", "const", "char", "*", "string", ")", "{", "fixed_t", "cx", "=", "x", ",", "<type", "ref=\"prev\"/>", "cy", "=", "y", ";", "INT32", "w", ",", "<type", "ref=\"prev\"/>", "c", ",", "<type", "ref=\"prev\"/>", "dupx", ",", "<type", "ref=\"prev\"/>", "dupy", ",", "<type", "ref=\"prev\"/>", "scrwidth", ",", "<type", "ref=\"prev\"/>", "center", "=", "0", ",", "<type", "ref=\"prev\"/>", "left", "=", "0", ";", "const", "char", "*", "ch", "=", "string", ";", "INT32", "charflags", "=", "0", ";", "const", "UINT8", "*", "colormap", "=", "NULL", ";", "INT32", "spacewidth", "=", "2", ",", "<type", "ref=\"prev\"/>", "charwidth", "=", "0", ";", "INT32", "lowercase", "=", "(", "option", "&", "V_ALLOWLOWERCASE", ")", ";", "option", "&=", "~", "V_FLIP", ";", "//", "which", "is", "also", "shared", "with", "V_ALLOWLOWERCASE...", "if", "(", "option", "&", "V_NOSCALESTART", ")", "{", "dupx", "=", "vid", ".", "dupx", ";", "dupy", "=", "vid", ".", "dupy", ";", "scrwidth", "=", "vid", ".", "width", ";", "}", "else", "{", "dupx", "=", "dupy", "=", "1", ";", "scrwidth", "=", "vid", ".", "width", "/", "vid", ".", "dupx", ";", "left", "=", "(", "scrwidth", "-", "BASEVIDWIDTH", ")", "/", "2", ";", "scrwidth", "-=", "left", ";", "}", "charflags", "=", "(", "option", "&", "V_CHARCOLORMASK", ")", ";", "switch", "(", "option", "&", "V_SPACINGMASK", ")", "{", "case", "V_MONOSPACE", ":", "spacewidth", "=", "8", ";", "/*", "FALLTHRU", "*/", "case", "V_OLDSPACING", ":", "charwidth", "=", "8", ";", "break;", "case", "V_6WIDTHSPACE", ":", "spacewidth", "=", "6", ";", "default:", "break;", "}", "for", "(", ";", ";", "ch", "++", ")", "{", "if", "(", "!", "*", "ch", ")", "break;", "if", "(", "*", "ch", "&", "0x80", ")", "//color", "parsing", "-x", "2.16.09", "{", "//", "manually", "set", "flags", "override", "color", "codes", "if", "(", "!", "(", "option", "&", "V_CHARCOLORMASK", ")", ")", "charflags", "=", "(", "(", "*", "ch", "&", "0x7f", ")", "<<", "V_CHARCOLORSHIFT", ")", "&", "V_CHARCOLORMASK", ";", "continue;", "}", "if", "(", "*", "ch", "==", "\\'\\\\'", ")", "{", "cx", "=", "x", ";", "if", "(", "option", "&", "V_RETURN8", ")", "cy", "+=", "(", "8", "*", "dupy", ")", "<<", "FRACBITS", ";", "else", "cy", "+=", "(", "12", "*", "dupy", ")", "<<", "FRACBITS", ";", "continue;", "}", "c", "=", "*", "ch", ";", "if", "(", "!", "lowercase", "||", "!", "tny_font", "[", "c", "-", "HU_FONTSTART", "]", ")", "c", "=", "toupper", "(", "c", ")", ";", "c", "-=", "HU_FONTSTART", ";", "//", "character", "does", "not", "exist", "or", "is", "a", "space", "if", "(", "c", "<", "0", "||", "c", ">=", "HU_FONTSIZE", "||", "!", "tny_font", "[", "c", "]", ")", "{", "cx", "+=", "(", "spacewidth", "*", "dupx", ")", "<<", "FRACBITS", ";", "continue;", "}", "if", "(", "charwidth", ")", "{", "w", "=", "charwidth", "*", "dupx", ";", "center", "=", "w", "/", "2", "-", "SHORT", "(", "tny_font", "[", "c", "]", "->", "width", ")", "*", "(", "dupx", "/", "2", ")", ";", "}", "else", "w", "=", "SHORT", "(", "tny_font", "[", "c", "]", "->", "width", ")", "*", "dupx", ";", "if", "(", "(", "cx", ">>", "FRACBITS", ")", ">", "scrwidth", ")", "break;", "if", "(", "(", "cx", ">>", "FRACBITS", ")", "+", "left", "+", "w", "<", "0", ")", "//left", "boundary", "check", "{", "cx", "+=", "w", "<<", "FRACBITS", ";", "continue;", "}", "colormap", "=", "V_GetStringColormap", "(", "charflags", ")", ";", "V_DrawFixedPatch", "(", "cx", "+", "(", "center", "<<", "FRACBITS", ")", ",", "cy", ",", "FRACUNIT", ",", "option", ",", "tny_font", "[", "c", "]", ",", "colormap", ")", ";", "cx", "+=", "w", "<<", "FRACBITS", ";", "}", "}'" ]
V_DrawThinStringAtFixed
STJr/SRB2
double_slash
train
928
1,167
[ "Add", "a", "stack", "vector", "to", "STACK_VECS" ]
[ "'void", "register_stack_vec", "(", "void", "*", "vec", ")", "{", "stack_vecs", ".", "safe_push", "(", "vec", ")", ";", "}'" ]
register_stack_vec
SuperHouse/esp-open-rtos
single_line
train
929
1,168
[ "Return", "descriptor", "for", "given", "call", "site,", "create", "new", "one", "if", "needed" ]
[ "'static", "struct", "vec_descriptor", "*", "vec_descriptor", "(", "const", "char", "*", "name", ",", "int", "line", ",", "const", "char", "*", "function", ")", "{", "struct", "vec_descriptor", "loc", ";", "struct", "vec_descriptor", "*", "*", "slot", ";", "loc", ".", "file", "=", "name", ";", "loc", ".", "line", "=", "line", ";", "loc", ".", "function", "=", "function", ";", "if", "(", "!", "vec_desc_hash", ")", "vec_desc_hash", "=", "htab_create", "(", "10", ",", "hash_descriptor", ",", "eq_descriptor", ",", "NULL", ")", ";", "slot", "=", "(", "struct", "vec_descriptor", "*", "*", ")", "htab_find_slot", "(", "vec_desc_hash", ",", "&", "loc", ",", "INSERT", ")", ";", "if", "(", "*", "slot", ")", "return", "*", "slot", ";", "*", "slot", "=", "XCNEW", "(", "struct", "vec_descriptor", ")", ";", "(", "*", "slot", ")", "->", "file", "=", "name", ";", "(", "*", "slot", ")", "->", "line", "=", "line", ";", "(", "*", "slot", ")", "->", "function", "=", "function", ";", "(", "*", "slot", ")", "->", "allocated", "=", "0", ";", "(", "*", "slot", ")", "->", "peak", "=", "0", ";", "return", "*", "slot", ";", "}'" ]
vec_descriptor
SuperHouse/esp-open-rtos
single_line
train
930
1,169
[ "Helper", "for", "qsort;", "sort", "descriptors", "by", "amount", "of", "memory", "consumed" ]
[ "'static", "int", "cmp_statistic", "(", "const", "void", "*", "loc1", ",", "const", "void", "*", "loc2", ")", "{", "const", "struct", "vec_descriptor", "*", "const", "l1", "=", "*", "(", "const", "struct", "vec_descriptor", "*", "const", "*", ")", "loc1", ";", "const", "struct", "vec_descriptor", "*", "const", "l2", "=", "*", "(", "const", "struct", "vec_descriptor", "*", "const", "*", ")", "loc2", ";", "long", "diff", ";", "diff", "=", "l1", "->", "allocated", "-", "l2", "->", "allocated", ";", "if", "(", "!", "diff", ")", "diff", "=", "l1", "->", "peak", "-", "l2", "->", "peak", ";", "if", "(", "!", "diff", ")", "diff", "=", "l1", "->", "times", "-", "l2", "->", "times", ";", "return", "diff", ">", "0", "?", "1", ":", "diff", "<", "0", "?", "-", "1", ":", "0", ";", "}'" ]
cmp_statistic
SuperHouse/esp-open-rtos
single_line
train
931
1,170
[ "Remove", "vector", "at", "slot", "IX", "from", "the", "list", "of", "registered", "stack", "vectors" ]
[ "'void", "unregister_stack_vec", "(", "unsigned", "ix", ")", "{", "stack_vecs", ".", "unordered_remove", "(", "ix", ")", ";", "}'" ]
unregister_stack_vec
SuperHouse/esp-open-rtos
single_line
train
932
1,171
[ "DMA", "Channel", "Clear", "Interrupt", "Flag" ]
[ "'void", "dma_clear_interrupt_flags", "(", "uint32_t", "dma", ",", "uint8_t", "channel", ",", "uint32_t", "interrupts", ")", "{", "/*", "Get", "offset", "to", "interrupt", "flag", "location", "in", "channel", "field", "*/", "uint32_t", "flags", "=", "(", "interrupts", "<<", "DMA_FLAG_OFFSET", "(", "channel", ")", ")", ";", "DMA_IFCR", "(", "dma", ")", "=", "flags", ";", "}'" ]
dma_clear_interrupt_flags
blacksphere/blackmagic
multi_line
train
933
1,172
[ "DMA", "Channel", "Set", "the", "Base", "Memory", "Address" ]
[ "'void", "dma_set_memory_address", "(", "uint32_t", "dma", ",", "uint8_t", "channel", ",", "uint32_t", "address", ")", "{", "if", "(", "!", "(", "DMA_CCR", "(", "dma", ",", "channel", ")", "&", "DMA_CCR_EN", ")", ")", "{", "DMA_CMAR", "(", "dma", ",", "channel", ")", "=", "(", "uint32_t", ")", "address", ";", "}", "}'" ]
dma_set_memory_address
blacksphere/blackmagic
multi_line
train
934
1,173
[ "DMA", "Channel", "Disable", "Memory", "Increment", "after", "Transfer" ]
[ "'void", "dma_disable_memory_increment_mode", "(", "uint32_t", "dma", ",", "uint8_t", "channel", ")", "{", "DMA_CCR", "(", "dma", ",", "channel", ")", "&=", "~", "DMA_CCR_MINC", ";", "}'" ]
dma_disable_memory_increment_mode
blacksphere/blackmagic
multi_line
train
935
1,174
[ "Return", "the", "computed", "color", "string", "for", "the", "specified", "color" ]
[ "'R_API", "char", "*", "r_cons_rgb_str", "(", "char", "*", "outstr", ",", "size_t", "sz", ",", "RColor", "*", "rcolor", ")", "{", "return", "r_cons_rgb_str_mode", "(", "r_cons_singleton", "()", "->", "context", "->", "color_mode", ",", "outstr", ",", "sz", ",", "rcolor", ")", ";", "}'" ]
r_cons_rgb_str
radareorg/radare2-bindings
single_line
train
936
1,175
[ "Return", "the", "computed", "color", "string", "for", "the", "specified", "color", "in", "the", "specified", "mode" ]
[ "'R_API", "char", "*", "r_cons_rgb_str_mode", "(", "RConsColorMode", "mode", ",", "char", "*", "outstr", ",", "size_t", "sz", ",", "RColor", "*", "rcolor", ")", "{", "if", "(", "!", "rcolor", ")", "{", "return", "NULL", ";", "}", "if", "(", "!", "outstr", ")", "{", "sz", "=", "64", ";", "outstr", "=", "calloc", "(", "sz", ",", "1", ")", ";", "}", "*", "outstr", "=", "0", ";", "if", "(", "rcolor", "->", "a", "==", "ALPHA_RESET", ")", "{", "strcpy", "(", "outstr", ",", "Color_RESET", ")", ";", "return", "outstr", ";", "}", "//", "If", "the", "color", "handles", "both", "foreground", "and", "background,", "also", "add", "background", "if", "(", "rcolor", "->", "a", "==", "ALPHA_FGBG", ")", "{", "r_cons_rgb_gen", "(", "mode", ",", "outstr", ",", "sz", ",", "0", ",", "ALPHA_BG", ",", "rcolor", "->", "r2", ",", "rcolor", "->", "g2", ",", "rcolor", "->", "b2", ",", "rcolor", "->", "id16", ")", ";", "}", "//", "APPEND", "size_t", "len", "=", "strlen", "(", "outstr", ")", ";", "r_cons_rgb_gen", "(", "mode", ",", "outstr", "+", "len", ",", "sz", "-", "len", ",", "rcolor", "->", "attr", ",", "rcolor", "->", "a", ",", "rcolor", "->", "r", ",", "rcolor", "->", "g", ",", "rcolor", "->", "b", ",", "rcolor", "->", "id16", ")", ";", "return", "outstr", ";", "}'" ]
r_cons_rgb_str_mode
radareorg/radare2-bindings
single_line
train
937
1,176
[ "Compute", "color", "string", "depending", "on", "cons>color" ]
[ "'static", "void", "r_cons_rgb_gen", "(", "RConsColorMode", "mode", ",", "char", "*", "outstr", ",", "size_t", "sz", ",", "ut8", "attr", ",", "ut8", "a", ",", "ut8", "r", ",", "ut8", "g", ",", "ut8", "b", ",", "st8", "id16", ")", "{", "ut8", "fgbg", "=", "(", "a", "==", "ALPHA_BG", ")", "?", "48", ":", "38", ";", "//", "ANSI", "codes", "for", "Background/Foreground", "if", "(", "sz", "<", "4", ")", "{", "//", "must", "have", "at", "least", "room", "for", "\"<esc>[m\\\\0\"", "if", "(", "sz", ">", "0", ")", "{", "outstr", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "}", "return", ";", "}", "size_t", "i", "=", "2", ";", "outstr", "[", "0", "]", "=", "\\'\\\\x1b\\'", ";", "outstr", "[", "1", "]", "=", "\\'[\\'", ";", "for", "(", ";", "attr", ";", "attr", "&=", "attr", "-", "1", ")", "{", "if", "(", "sz", "<", "i", "+", "4", ")", "{", "//", "must", "have", "at", "least", "room", "for", "e.g.", "\"1;m\\\\0\"", "outstr", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "return", ";", "}", "switch", "(", "attr", "&", "-", "attr", ")", "{", "case", "R_CONS_ATTR_BOLD", ":", "outstr", "[", "i", "]", "=", "\\'1\\'", ";", "break;", "case", "R_CONS_ATTR_DIM", ":", "outstr", "[", "i", "]", "=", "\\'2\\'", ";", "break;", "case", "R_CONS_ATTR_ITALIC", ":", "outstr", "[", "i", "]", "=", "\\'3\\'", ";", "break;", "case", "R_CONS_ATTR_UNDERLINE", ":", "outstr", "[", "i", "]", "=", "\\'4\\'", ";", "break;", "case", "R_CONS_ATTR_BLINK", ":", "outstr", "[", "i", "]", "=", "\\'5\\'", ";", "break;", "}", "outstr", "[", "i", "+", "1", "]", "=", "\\';\\'", ";", "i", "+=", "2", ";", "}", "int", "written", "=", "-", "1", ";", "switch", "(", "mode", ")", "{", "case", "COLOR_MODE_256", ":", "//", "256", "color", "palette", "written", "=", "snprintf", "(", "outstr", "+", "i", ",", "sz", "-", "i", ",", "\"%d;5;%dm\"", ",", "fgbg", ",", "rgb", "(", "r", ",", "g", ",", "b", ")", ")", ";", "break;", "case", "COLOR_MODE_16M", ":", "//", "16M", "(truecolor)", "written", "=", "snprintf", "(", "outstr", "+", "i", ",", "sz", "-", "i", ",", "\"%d;2;%d;%d;%dm\"", ",", "fgbg", ",", "r", ",", "g", ",", "b", ")", ";", "break;", "case", "COLOR_MODE_16", ":", "{", "//", "ansi", "16", "colors", "ut8", "bright", ",", "<type", "ref=\"prev\"/>", "c", ";", "fgbg", "-=", "8", ";", "if", "(", "id16", ">=", "0", "&&", "id16", "<=", "15", ")", "{", "c", "=", "id16", "%", "8", ";", "bright", "=", "id16", ">=", "8", "?", "60", ":", "0", ";", "}", "else", "{", "bright", "=", "(", "r", "==", "0x80", "&&", "g", "==", "0x80", "&&", "b", "==", "0x80", ")", "?", "53", ":", "(", "r", "==", "0xff", "||", "g", "==", "0xff", "||", "b", "==", "0xff", ")", "?", "60", ":", "0", ";", "//", "eco", "bright-specific", "if", "(", "r", "==", "g", "&&", "g", "==", "b", ")", "{", "r", "=", "(", "r", ">", "0x7f", ")", "?", "1", ":", "0", ";", "g", "=", "(", "g", ">", "0x7f", ")", "?", "1", ":", "0", ";", "b", "=", "(", "b", ">", "0x7f", ")", "?", "1", ":", "0", ";", "}", "else", "{", "ut8", "k", "=", "(", "r", "+", "g", "+", "b", ")", "/", "3", ";", "r", "=", "(", "r", ">=", "k", ")", "?", "1", ":", "0", ";", "g", "=", "(", "g", ">=", "k", ")", "?", "1", ":", "0", ";", "b", "=", "(", "b", ">=", "k", ")", "?", "1", ":", "0", ";", "}", "c", "=", "(", "r", "?", "1", ":", "0", ")", "+", "(", "g", "?", "(", "b", "?", "6", ":", "2", ")", ":", "(", "b", "?", "4", ":", "0", ")", ")", ";", "}", "written", "=", "snprintf", "(", "outstr", "+", "i", ",", "sz", "-", "i", ",", "\"%dm\"", ",", "fgbg", "+", "bright", "+", "c", ")", ";", "break;", "}", "default:", "break;", "}", "if", "(", "written", "<", "0", "||", "written", ">=", "sz", "-", "i", ")", "{", "outstr", "[", "0", "]", "=", "\\'\\\\0\\'", ";", "}", "}'" ]
r_cons_rgb_gen
radareorg/radare2-bindings
single_line
train
938
1,177
[ "Parse", "an", "ANSI", "code", "string", "into", "RGB", "values", "Used", "by", "HTML", "filter", "only" ]
[ "'R_API", "int", "r_cons_rgb_parse", "(", "const", "char", "*", "p", ",", "ut8", "*", "r", ",", "ut8", "*", "g", ",", "ut8", "*", "b", ",", "ut8", "*", "a", ")", "{", "const", "char", "*", "q", "=", "0", ";", "ut8", "isbg", "=", "0", ",", "<type", "ref=\"prev\"/>", "bold", "=", "127", ";", "if", "(", "!", "p", ")", "{", "return", "0", ";", "}", "if", "(", "*", "p", "==", "0x1b", ")", "{", "p", "++", ";", "if", "(", "!", "*", "p", ")", "{", "return", "0", ";", "}", "}", "if", "(", "*", "p", "==", "\\'[\\'", ")", "{", "p", "++", ";", "if", "(", "!", "*", "p", ")", "{", "return", "0", ";", "}", "}", "//", "here,", "p", "should", "be", "just", "after", "the", "\\'[\\'", "switch", "(", "*", "p", ")", "{", "case", "\\'1\\'", ":", "bold", "=", "255", ";", "if", "(", "!", "p", "[", "1", "]", "||", "!", "p", "[", "2", "]", ")", "{", "return", "0", ";", "}", "p", "+=", "2", ";", "break;", "case", "\\'3\\'", ":", "isbg", "=", "0", ";", "break;", "case", "\\'4\\'", ":", "isbg", "=", "1", ";", "break;", "}", "#", "define", "SETRGB", "(", "x", ",", "y", ",", "z", ")", "if", "(r)", "*r", "=", "(x);", "if", "(g)", "*g", "=", "(y);", "if", "(b)", "*b", "=", "(z)", "if", "(", "bold", "!=", "255", "&&", "strchr", "(", "p", ",", "\\';\\'", ")", ")", "{", "if", "(", "!", "p", "[", "0", "]", "||", "!", "p", "[", "1", "]", "||", "!", "p", "[", "2", "]", ")", "{", "return", "0", ";", "}", "if", "(", "p", "[", "3", "]", "==", "\\'5\\'", ")", "{", "//", "\\\\x1b[%d;5;%dm", "is", "256", "colors", "int", "x", ",", "<type", "ref=\"prev\"/>", "y", ",", "<type", "ref=\"prev\"/>", "z", ";", "if", "(", "!", "p", "[", "3", "]", "||", "!", "p", "[", "4", "]", ")", "{", "return", "0", ";", "}", "int", "n", "=", "atoi", "(", "p", "+", "5", ")", ";", "__unrgb", "(", "n", ",", "&", "x", ",", "&", "y", ",", "&", "z", ")", ";", "SETRGB", "(", "x", ",", "y", ",", "z", ")", ";", "}", "else", "{", "//", "16M", "colors", "(truecolor)", "/*", "complex", "rgb", "*/", "if", "(", "!", "p", "[", "3", "]", "||", "!", "p", "[", "4", "]", ")", "{", "return", "0", ";", "}", "p", "+=", "5", ";", "if", "(", "r", ")", "{", "*", "r", "=", "atoi", "(", "p", ")", ";", "}", "q", "=", "strchr", "(", "p", ",", "\\';\\'", ")", ";", "if", "(", "!", "q", ")", "{", "return", "0", ";", "}", "if", "(", "g", ")", "{", "*", "g", "=", "atoi", "(", "q", "+", "1", ")", ";", "}", "q", "=", "strchr", "(", "q", "+", "1", ",", "\\';\\'", ")", ";", "if", "(", "!", "q", ")", "{", "return", "0", ";", "}", "if", "(", "b", ")", "{", "*", "b", "=", "atoi", "(", "q", "+", "1", ")", ";", "}", "}", "return", "1", ";", "}", "else", "{", "/*", "plain", "ansi", "escape", "codes", "*/", "if", "(", "a", ")", "{", "*", "a", "=", "isbg", ";", "}", "if", "(", "!", "*", "p", ")", "{", "return", "0", ";", "}", "switch", "(", "p", "[", "1", "]", ")", "{", "case", "\\'0\\'", ":", "SETRGB", "(", "0", ",", "0", ",", "0", ")", ";", "break;", "case", "\\'1\\'", ":", "SETRGB", "(", "bold", ",", "0", ",", "0", ")", ";", "break;", "case", "\\'2\\'", ":", "SETRGB", "(", "0", ",", "bold", ",", "0", ")", ";", "break;", "case", "\\'3\\'", ":", "SETRGB", "(", "bold", ",", "bold", ",", "0", ")", ";", "break;", "case", "\\'4\\'", ":", "SETRGB", "(", "0", ",", "0", ",", "bold", ")", ";", "break;", "case", "\\'5\\'", ":", "SETRGB", "(", "bold", ",", "0", ",", "bold", ")", ";", "break;", "case", "\\'6\\'", ":", "SETRGB", "(", "0", ",", "bold", ",", "bold", ")", ";", "break;", "case", "\\'7\\'", ":", "SETRGB", "(", "bold", ",", "bold", ",", "bold", ")", ";", "break;", "}", "}", "return", "1", ";", "}'" ]
r_cons_rgb_parse
radareorg/radare2-bindings
single_line
train
939
1,179
[ "Like", "gen_libfunc,", "but", "verify", "that", "FP", "and", "set", "decimal", "prefix", "if", "needed" ]
[ "'void", "gen_fp_libfunc", "(", "optab", "optable", ",", "const", "char", "*", "opname", ",", "char", "suffix", ",", "enum", "machine_mode", "mode", ")", "{", "char", "*", "dec_opname", ";", "if", "(", "GET_MODE_CLASS", "(", "mode", ")", "==", "MODE_FLOAT", ")", "gen_libfunc", "(", "optable", ",", "opname", ",", "suffix", ",", "mode", ")", ";", "if", "(", "DECIMAL_FLOAT_MODE_P", "(", "mode", ")", ")", "{", "dec_opname", "=", "XALLOCAVEC", "(", "char", ",", "sizeof", "(", "DECIMAL_PREFIX", ")", "+", "strlen", "(", "opname", ")", ")", ";", "/*", "For", "BID", "support,", "change", "the", "name", "to", "have", "either", "a", "bid_", "or", "dpd_", "prefix", "depending", "on", "the", "low", "level", "floating", "format", "used.", "*/", "memcpy", "(", "dec_opname", ",", "DECIMAL_PREFIX", ",", "sizeof", "(", "DECIMAL_PREFIX", ")", "-", "1", ")", ";", "strcpy", "(", "dec_opname", "+", "sizeof", "(", "DECIMAL_PREFIX", ")", "-", "1", ",", "opname", ")", ";", "gen_libfunc", "(", "optable", ",", "dec_opname", ",", "suffix", ",", "mode", ")", ";", "}", "}'" ]
gen_fp_libfunc
SuperHouse/esp-open-rtos
single_line
train
940
1,180
[ "Generate", "code", "to", "indirectly", "jump", "to", "a", "location", "given", "in", "the", "rtx", "LOC" ]
[ "'void", "emit_indirect_jump", "(", "rtx", "loc", ")", "{", "struct", "expand_operand", "ops", "[", "1", "]", ";", "create_address_operand", "(", "&", "ops", "[", "0", "]", ",", "loc", ")", ";", "expand_jump_insn", "(", "CODE_FOR_indirect_jump", ",", "1", ",", "ops", ")", ";", "emit_barrier", "()", ";", "}'" ]
emit_indirect_jump
SuperHouse/esp-open-rtos
single_line
train
941
1,181
[ "A", "subroutine", "of", "expand_vec_perm", "for", "expanding", "one", "vec_perm", "insn" ]
[ "\"static", "rtx", "expand_vec_perm_1", "(", "enum", "insn_code", "icode", ",", "rtx", "target", ",", "rtx", "v0", ",", "rtx", "v1", ",", "rtx", "sel", ")", "{", "enum", "machine_mode", "tmode", "=", "GET_MODE", "(", "target", ")", ";", "enum", "machine_mode", "smode", "=", "GET_MODE", "(", "sel", ")", ";", "struct", "expand_operand", "ops", "[", "4", "]", ";", "create_output_operand", "(", "&", "ops", "[", "0", "]", ",", "target", ",", "tmode", ")", ";", "create_input_operand", "(", "&", "ops", "[", "3", "]", ",", "sel", ",", "smode", ")", ";", "/*", "Make", "an", "effort", "to", "preserve", "v0", "==", "v1.", "The", "target", "expander", "is", "able", "to", "rely", "on", "this", "to", "determine", "if", "we're", "permuting", "a", "single", "input", "operand.", "*/", "if", "(", "rtx_equal_p", "(", "v0", ",", "v1", ")", ")", "{", "if", "(", "!", "insn_operand_matches", "(", "icode", ",", "1", ",", "v0", ")", ")", "v0", "=", "force_reg", "(", "tmode", ",", "v0", ")", ";", "gcc_checking_assert", "(", "insn_operand_matches", "(", "icode", ",", "1", ",", "v0", ")", ")", ";", "gcc_checking_assert", "(", "insn_operand_matches", "(", "icode", ",", "2", ",", "v0", ")", ")", ";", "create_fixed_operand", "(", "&", "ops", "[", "1", "]", ",", "v0", ")", ";", "create_fixed_operand", "(", "&", "ops", "[", "2", "]", ",", "v0", ")", ";", "}", "else", "{", "create_input_operand", "(", "&", "ops", "[", "1", "]", ",", "v0", ",", "tmode", ")", ";", "create_input_operand", "(", "&", "ops", "[", "2", "]", ",", "v1", ",", "tmode", ")", ";", "}", "if", "(", "maybe_expand_insn", "(", "icode", ",", "4", ",", "ops", ")", ")", "return", "ops", "[", "0", "]", ".", "value", ";", "return", "NULL_RTX", ";", "}\"" ]
expand_vec_perm_1
SuperHouse/esp-open-rtos
single_line
train
942
1,182
[ "Adjust", "the", "assembler", "name", "of", "libfunc", "NAME", "to", "ASMSPEC" ]
[ "'rtx", "set_user_assembler_libfunc", "(", "const", "char", "*", "name", ",", "const", "char", "*", "asmspec", ")", "{", "tree", "id", ",", "<type", "ref=\"prev\"/>", "decl", ";", "void", "*", "*", "slot", ";", "hashval_t", "hash", ";", "id", "=", "get_identifier", "(", "name", ")", ";", "hash", "=", "IDENTIFIER_HASH_VALUE", "(", "id", ")", ";", "slot", "=", "htab_find_slot_with_hash", "(", "libfunc_decls", ",", "id", ",", "hash", ",", "NO_INSERT", ")", ";", "gcc_assert", "(", "slot", ")", ";", "decl", "=", "(", "tree", ")", "*", "slot", ";", "set_user_assembler_name", "(", "decl", ",", "asmspec", ")", ";", "return", "XEXP", "(", "DECL_RTL", "(", "decl", ")", ",", "0", ")", ";", "}'" ]
set_user_assembler_libfunc
SuperHouse/esp-open-rtos
single_line
train
943
1,183
[ "Like", "gen_libfunc,", "but", "verify", "that", "FP", "or", "INT", "operation", "is", "involved" ]
[ "'void", "gen_int_fp_libfunc", "(", "optab", "optable", ",", "const", "char", "*", "name", ",", "char", "suffix", ",", "enum", "machine_mode", "mode", ")", "{", "if", "(", "DECIMAL_FLOAT_MODE_P", "(", "mode", ")", "||", "GET_MODE_CLASS", "(", "mode", ")", "==", "MODE_FLOAT", ")", "gen_fp_libfunc", "(", "optable", ",", "name", ",", "suffix", ",", "mode", ")", ";", "if", "(", "INTEGRAL_MODE_P", "(", "mode", ")", ")", "gen_int_libfunc", "(", "optable", ",", "name", ",", "suffix", ",", "mode", ")", ";", "}'" ]
gen_int_fp_libfunc
SuperHouse/esp-open-rtos
single_line
train
944
1,184
[ "Like", "expand_insn,", "but", "for", "jumps" ]
[ "'void", "expand_jump_insn", "(", "enum", "insn_code", "icode", ",", "unsigned", "int", "nops", ",", "struct", "expand_operand", "*", "ops", ")", "{", "if", "(", "!", "maybe_expand_jump_insn", "(", "icode", ",", "nops", ",", "ops", ")", ")", "gcc_unreachable", "()", ";", "}'" ]
expand_jump_insn
SuperHouse/esp-open-rtos
single_line
train
945
1,185
[ "Like", "gen_libfunc,", "but", "verify", "that", "integer", "operation", "is", "involved" ]
[ "'void", "gen_int_libfunc", "(", "optab", "optable", ",", "const", "char", "*", "opname", ",", "char", "suffix", ",", "enum", "machine_mode", "mode", ")", "{", "int", "maxsize", "=", "2", "*", "BITS_PER_WORD", ";", "if", "(", "GET_MODE_CLASS", "(", "mode", ")", "!=", "MODE_INT", ")", "return", ";", "if", "(", "maxsize", "<", "LONG_LONG_TYPE_SIZE", ")", "maxsize", "=", "LONG_LONG_TYPE_SIZE", ";", "if", "(", "GET_MODE_CLASS", "(", "mode", ")", "!=", "MODE_INT", "||", "mode", "<argument_list", "type=\"generic\">", "<", "word_mode", "||", "GET_MODE_BITSIZE", "(", "mode", ")", ">", "maxsize", ")", "return", ";", "gen_libfunc", "(", "optable", ",", "opname", ",", "suffix", ",", "mode", ")", ";", "}'" ]
gen_int_libfunc
SuperHouse/esp-open-rtos
single_line
train
946
1,186
[ "Build", "a", "decl", "for", "a", "libfunc", "named", "NAME" ]
[ "'tree", "build_libfunc_function", "(", "const", "char", "*", "name", ")", "{", "tree", "decl", "=", "build_decl", "(", "UNKNOWN_LOCATION", ",", "FUNCTION_DECL", ",", "get_identifier", "(", "name", ")", ",", "build_function_type", "(", "integer_type_node", ",", "NULL_TREE", ")", ")", ";", "/*", "???", "We", "don\\'t", "have", "any", "type", "information", "except", "for", "this", "is", "a", "function.", "Pretend", "this", "is", "\"int", "foo()\".", "*/", "DECL_ARTIFICIAL", "(", "decl", ")", "=", "1", ";", "DECL_EXTERNAL", "(", "decl", ")", "=", "1", ";", "TREE_PUBLIC", "(", "decl", ")", "=", "1", ";", "gcc_assert", "(", "DECL_ASSEMBLER_NAME", "(", "decl", ")", ")", ";", "/*", "Zap", "the", "nonsensical", "SYMBOL_REF_DECL", "for", "this.", "What", "we\\'re", "left", "with", "are", "the", "flags", "assigned", "by", "targetm.encode_section_info.", "*/", "SET_SYMBOL_REF_DECL", "(", "XEXP", "(", "DECL_RTL", "(", "decl", ")", ",", "0", ")", ",", "NULL", ")", ";", "return", "decl", ";", "}'" ]
build_libfunc_function
SuperHouse/esp-open-rtos
single_line
train
947
1,187
[ "Generate", "insns", "for", "VEC_LSHIFT_EXPR,", "VEC_RSHIFT_EXPR" ]
[ "'rtx", "expand_vec_shift_expr", "(", "sepops", "ops", ",", "rtx", "target", ")", "{", "struct", "expand_operand", "eops", "[", "3", "]", ";", "enum", "insn_code", "icode", ";", "rtx", "rtx_op1", ",", "<type", "ref=\"prev\"/>", "rtx_op2", ";", "enum", "machine_mode", "mode", "=", "TYPE_MODE", "(", "ops", "->", "type", ")", ";", "tree", "vec_oprnd", "=", "ops", "->", "op0", ";", "tree", "shift_oprnd", "=", "ops", "->", "op1", ";", "optab", "shift_optab", ";", "switch", "(", "ops", "->", "code", ")", "{", "case", "VEC_RSHIFT_EXPR", ":", "shift_optab", "=", "vec_shr_optab", ";", "break;", "case", "VEC_LSHIFT_EXPR", ":", "shift_optab", "=", "vec_shl_optab", ";", "break;", "default:", "gcc_unreachable", "()", ";", "}", "icode", "=", "optab_handler", "(", "shift_optab", ",", "mode", ")", ";", "gcc_assert", "(", "icode", "!=", "CODE_FOR_nothing", ")", ";", "rtx_op1", "=", "expand_normal", "(", "vec_oprnd", ")", ";", "rtx_op2", "=", "expand_normal", "(", "shift_oprnd", ")", ";", "create_output_operand", "(", "&", "eops", "[", "0", "]", ",", "target", ",", "mode", ")", ";", "create_input_operand", "(", "&", "eops", "[", "1", "]", ",", "rtx_op1", ",", "GET_MODE", "(", "rtx_op1", ")", ")", ";", "create_convert_operand_from_type", "(", "&", "eops", "[", "2", "]", ",", "rtx_op2", ",", "TREE_TYPE", "(", "shift_oprnd", ")", ")", ";", "expand_insn", "(", "icode", ",", "3", ",", "eops", ")", ";", "return", "eops", "[", "0", "]", ".", "value", ";", "}'" ]
expand_vec_shift_expr
SuperHouse/esp-open-rtos
single_line
train
948
1,188
[ "Like", "maybe_expand_insn,", "but", "for", "jumps" ]
[ "'bool", "maybe_expand_jump_insn", "(", "enum", "insn_code", "icode", ",", "unsigned", "int", "nops", ",", "struct", "expand_operand", "*", "ops", ")", "{", "rtx", "pat", "=", "maybe_gen_insn", "(", "icode", ",", "nops", ",", "ops", ")", ";", "if", "(", "pat", ")", "{", "emit_jump_insn", "(", "pat", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}'" ]
maybe_expand_jump_insn
SuperHouse/esp-open-rtos
single_line
train
949
1,189
[ "Expand", "a", "highpart", "multiply" ]
[ "'rtx", "expand_mult_highpart", "(", "enum", "machine_mode", "mode", ",", "rtx", "op0", ",", "rtx", "op1", ",", "rtx", "target", ",", "bool", "uns_p", ")", "{", "struct", "expand_operand", "eops", "[", "3", "]", ";", "enum", "insn_code", "icode", ";", "int", "method", ",", "<type", "ref=\"prev\"/>", "i", ",", "<type", "ref=\"prev\"/>", "nunits", ";", "enum", "machine_mode", "wmode", ";", "rtx", "m1", ",", "<type", "ref=\"prev\"/>", "m2", ",", "<type", "ref=\"prev\"/>", "perm", ";", "optab", "tab1", ",", "<type", "ref=\"prev\"/>", "tab2", ";", "rtvec", "v", ";", "method", "=", "can_mult_highpart_p", "(", "mode", ",", "uns_p", ")", ";", "switch", "(", "method", ")", "{", "case", "0", ":", "return", "NULL_RTX", ";", "case", "1", ":", "tab1", "=", "uns_p", "?", "umul_highpart_optab", ":", "smul_highpart_optab", ";", "return", "expand_binop", "(", "mode", ",", "tab1", ",", "op0", ",", "op1", ",", "target", ",", "uns_p", ",", "OPTAB_LIB_WIDEN", ")", ";", "case", "2", ":", "tab1", "=", "uns_p", "?", "vec_widen_umult_even_optab", ":", "vec_widen_smult_even_optab", ";", "tab2", "=", "uns_p", "?", "vec_widen_umult_odd_optab", ":", "vec_widen_smult_odd_optab", ";", "break;", "case", "3", ":", "tab1", "=", "uns_p", "?", "vec_widen_umult_lo_optab", ":", "vec_widen_smult_lo_optab", ";", "tab2", "=", "uns_p", "?", "vec_widen_umult_hi_optab", ":", "vec_widen_smult_hi_optab", ";", "if", "(", "BYTES_BIG_ENDIAN", ")", "{", "optab", "t", "=", "tab1", ";", "tab1", "=", "tab2", ";", "tab2", "=", "t", ";", "}", "break;", "default:", "gcc_unreachable", "()", ";", "}", "icode", "=", "optab_handler", "(", "tab1", ",", "mode", ")", ";", "nunits", "=", "GET_MODE_NUNITS", "(", "mode", ")", ";", "wmode", "=", "insn_data", "[", "icode", "]", ".", "operand", "[", "0", "]", ".", "mode", ";", "gcc_checking_assert", "(", "2", "*", "GET_MODE_NUNITS", "(", "wmode", ")", "==", "nunits", ")", ";", "gcc_checking_assert", "(", "GET_MODE_SIZE", "(", "wmode", ")", "==", "GET_MODE_SIZE", "(", "mode", ")", ")", ";", "create_output_operand", "(", "&", "eops", "[", "0", "]", ",", "gen_reg_rtx", "(", "wmode", ")", ",", "wmode", ")", ";", "create_input_operand", "(", "&", "eops", "[", "1", "]", ",", "op0", ",", "mode", ")", ";", "create_input_operand", "(", "&", "eops", "[", "2", "]", ",", "op1", ",", "mode", ")", ";", "expand_insn", "(", "icode", ",", "3", ",", "eops", ")", ";", "m1", "=", "gen_lowpart", "(", "mode", ",", "eops", "[", "0", "]", ".", "value", ")", ";", "create_output_operand", "(", "&", "eops", "[", "0", "]", ",", "gen_reg_rtx", "(", "wmode", ")", ",", "wmode", ")", ";", "create_input_operand", "(", "&", "eops", "[", "1", "]", ",", "op0", ",", "mode", ")", ";", "create_input_operand", "(", "&", "eops", "[", "2", "]", ",", "op1", ",", "mode", ")", ";", "expand_insn", "(", "optab_handler", "(", "tab2", ",", "mode", ")", ",", "3", ",", "eops", ")", ";", "m2", "=", "gen_lowpart", "(", "mode", ",", "eops", "[", "0", "]", ".", "value", ")", ";", "v", "=", "rtvec_alloc", "(", "nunits", ")", ";", "if", "(", "method", "==", "2", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "nunits", ";", "++", "i", ")", "RTVEC_ELT", "(", "v", ",", "i", ")", "=", "GEN_INT", "(", "!", "BYTES_BIG_ENDIAN", "+", "(", "i", "&", "~", "1", ")", "+", "(", "(", "i", "&", "1", ")", "?", "nunits", ":", "0", ")", ")", ";", "}", "else", "{", "for", "(", "i", "=", "0", ";", "i", "<", "nunits", ";", "++", "i", ")", "RTVEC_ELT", "(", "v", ",", "i", ")", "=", "GEN_INT", "(", "2", "*", "i", "+", "(", "BYTES_BIG_ENDIAN", "?", "0", ":", "1", ")", ")", ";", "}", "perm", "=", "gen_rtx_CONST_VECTOR", "(", "mode", ",", "v", ")", ";", "return", "expand_vec_perm", "(", "mode", ",", "m1", ",", "m2", ",", "perm", ",", "target", ")", ";", "}'" ]
expand_mult_highpart
SuperHouse/esp-open-rtos
single_line
train
950
1,190
[ "Return", "true", "if", "there", "is", "a", "compare_and_swap", "pattern" ]
[ "'bool", "can_compare_and_swap_p", "(", "enum", "machine_mode", "mode", ",", "bool", "allow_libcall", ")", "{", "enum", "insn_code", "icode", ";", "/*", "Check", "for", "__atomic_compare_and_swap.", "*/", "icode", "=", "direct_optab_handler", "(", "atomic_compare_and_swap_optab", ",", "mode", ")", ";", "if", "(", "icode", "!=", "CODE_FOR_nothing", ")", "return", "true", ";", "/*", "Check", "for", "__sync_compare_and_swap.", "*/", "icode", "=", "optab_handler", "(", "sync_compare_and_swap_optab", ",", "mode", ")", ";", "if", "(", "icode", "!=", "CODE_FOR_nothing", ")", "return", "true", ";", "if", "(", "allow_libcall", "&&", "optab_libfunc", "(", "sync_compare_and_swap_optab", ",", "mode", ")", ")", "return", "true", ";", "/*", "No", "inline", "compare", "and", "swap.", "*/", "return", "false", ";", "}'" ]
can_compare_and_swap_p
SuperHouse/esp-open-rtos
single_line
train
951
1,193
[ "Push", "a", "thread", "on", "the", "list", "of", "threads", "that", "are", "ready", "to", "be", "scheduled" ]
[ "'static", "void", "scheduler_ready_push", "(", "struct", "thrd_t", "*", "thrd_p", ")", "{", "thrd_prio_list_push_isr", "(", "&", "module", ".", "scheduler", ".", "ready", ",", "&", "thrd_p", "->", "scheduler", ".", "elem", ")", ";", "}'" ]
scheduler_ready_push
eerimoq/simba
multi_line
train
952
1,194
[ "This", "just", "adds", "the", "\"interpreterexec\"", "command" ]
[ "'void", "_initialize_interpreter", "(", "void", ")", "{", "struct", "cmd_list_element", "*", "c", ";", "c", "=", "add_cmd", "(", "\"interpreter-exec\"", ",", "class_support", ",", "interpreter_exec_cmd", ",", "_", "(", "\"\\\\", "Execute", "a", "command", "in", "an", "interpreter.", "It", "takes", "two", "arguments:\\\\\\", "The", "first", "argument", "is", "the", "name", "of", "the", "interpreter", "to", "use.\\\\\\", "The", "second", "argument", "is", "the", "command", "to", "execute.\\\"", ")", ",", "&", "cmdlist", ")", ";", "set_cmd_completer", "(", "c", ",", "interpreter_completer", ")", ";", "}'" ]
_initialize_interpreter
SuperHouse/esp-open-rtos
single_line
train
953
1,195
[ "Returns", "the", "interpreter's", "name" ]
[ "'const", "char", "*", "interp_name", "(", "struct", "interp", "*", "interp", ")", "{", "return", "interp", "->", "name", ";", "}'" ]
interp_name
SuperHouse/esp-open-rtos
single_line
train
954
1,196
[ "Run", "the", "current", "command", "interpreter's", "main", "loop" ]
[ "'void", "current_interp_command_loop", "(", "void", ")", "{", "gdb_assert", "(", "current_interpreter", "!=", "NULL", ")", ";", "current_interpreter", "->", "procs", "->", "command_loop_proc", "(", "current_interpreter", "->", "data", ")", ";", "}'" ]
current_interp_command_loop
SuperHouse/esp-open-rtos
single_line
train
955
1,197
[ "Temporarily", "overrides", "the", "current", "interpreter" ]
[ "'struct", "interp", "*", "interp_set_temp", "(", "const", "char", "*", "name", ")", "{", "struct", "interp", "*", "interp", "=", "interp_lookup", "(", "name", ")", ";", "struct", "interp", "*", "old_interp", "=", "current_interpreter", ";", "if", "(", "interp", ")", "current_interpreter", "=", "interp", ";", "return", "old_interp", ";", "}'" ]
interp_set_temp
SuperHouse/esp-open-rtos
single_line
train
956
1,198
[ "Returns", "true", "if", "the", "current", "interp", "is", "the", "passed", "in", "name" ]
[ "'int", "current_interp_named_p", "(", "const", "char", "*", "interp_name", ")", "{", "if", "(", "current_interpreter", ")", "return", "(", "strcmp", "(", "current_interpreter", "->", "name", ",", "interp_name", ")", "==", "0", ")", ";", "return", "0", ";", "}'" ]
current_interp_named_p
SuperHouse/esp-open-rtos
single_line
train
957
1,199
[ "Returns", "the", "current", "interpreter" ]
[ "'struct", "ui_out", "*", "interp_ui_out", "(", "struct", "interp", "*", "interp", ")", "{", "if", "(", "interp", "!=", "NULL", ")", "return", "interp", "->", "procs", "->", "ui_out_proc", "(", "interp", ")", ";", "return", "current_interpreter", "->", "procs", "->", "ui_out_proc", "(", "current_interpreter", ")", ";", "}'" ]
interp_ui_out
SuperHouse/esp-open-rtos
single_line
train
958
1,200
[ "Prints", "debugging", "info", "for", "a", "symbol", "table", "message" ]
[ "'static", "herr_t", "H5O_stab_debug", "(", "H5F_t", "H5_ATTR_UNUSED", "*", "f", ",", "hid_t", "H5_ATTR_UNUSED", "dxpl_id", ",", "const", "void", "*", "_mesg", ",", "FILE", "*", "stream", ",", "int", "indent", ",", "int", "fwidth", ")", "{", "const", "H5O_stab_t", "*", "stab", "=", "(", "const", "H5O_stab_t", "*", ")", "_mesg", ";", "FUNC_ENTER_NOAPI_NOINIT_NOERR", "/*", "check", "args", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "stab", ")", ";", "HDassert", "(", "stream", ")", ";", "HDassert", "(", "indent", ">=", "0", ")", ";", "HDassert", "(", "fwidth", ">=", "0", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%a\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"B-tree", "address:\"", ",", "stab", "->", "btree_addr", ")", ";", "HDfprintf", "(", "stream", ",", "\"%*s%-*s", "%a\\\"", ",", "indent", ",", "\"\"", ",", "fwidth", ",", "\"Name", "heap", "address:\"", ",", "stab", "->", "heap_addr", ")", ";", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5O_stab_debug
CGNS/CGNS
multi_line
train
959
1,201
[ "Copies", "a", "message", "from", "_MESG", "to", "_DEST", "in", "file" ]
[ "'static", "void", "*", "H5O_stab_copy_file", "(", "H5F_t", "*", "file_src", ",", "void", "*", "native_src", ",", "H5F_t", "*", "file_dst", ",", "hbool_t", "H5_ATTR_UNUSED", "*", "recompute_size", ",", "unsigned", "H5_ATTR_UNUSED", "*", "mesg_flags", ",", "H5O_copy_t", "H5_ATTR_UNUSED", "*", "cpy_info", ",", "void", "*", "_udata", ",", "hid_t", "dxpl_id", ")", "{", "H5O_stab_t", "*", "stab_src", "=", "(", "H5O_stab_t", "*", ")", "native_src", ";", "H5O_stab_t", "*", "stab_dst", "=", "NULL", ";", "H5G_copy_file_ud_t", "*", "udata", "=", "(", "H5G_copy_file_ud_t", "*", ")", "_udata", ";", "size_t", "size_hint", ";", "/*", "Local", "heap", "initial", "size", "*/", "void", "*", "ret_value", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI_NOINIT", "/*", "check", "args", "*/", "HDassert", "(", "stab_src", ")", ";", "HDassert", "(", "file_dst", ")", ";", "/*", "Allocate", "space", "for", "the", "destination", "stab", "*/", "if", "(", "NULL", "==", "(", "stab_dst", "=", "H5FL_MALLOC", "(", "H5O_stab_t", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_NOSPACE", ",", "NULL", ",", "\"memory", "allocation", "failed\"", ")", "/*", "Get", "the", "old", "local", "heap\\'s", "size", "and", "use", "that", "as", "the", "hint", "for", "the", "new", "heap", "*/", "if", "(", "H5HL_get_size", "(", "file_src", ",", "dxpl_id", ",", "stab_src", "->", "heap_addr", ",", "&", "size_hint", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTGETSIZE", ",", "NULL", ",", "\"can\\'t", "query", "local", "heap", "size\"", ")", "/*", "Create", "components", "of", "symbol", "table", "message", "*/", "if", "(", "H5G__stab_create_components", "(", "file_dst", ",", "stab_dst", ",", "size_hint", ",", "dxpl_id", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTINIT", ",", "NULL", ",", "\"can\\'t", "create", "symbol", "table", "components\"", ")", "/*", "Cache", "stab", "in", "udata", "*/", "udata", "->", "cache_type", "=", "H5G_CACHED_STAB", ";", "udata", "->", "cache", ".", "stab", ".", "btree_addr", "=", "stab_dst", "->", "btree_addr", ";", "udata", "->", "cache", ".", "stab", ".", "heap_addr", "=", "stab_dst", "->", "heap_addr", ";", "/*", "Set", "return", "value", "*/", "ret_value", "=", "stab_dst", ";", "done", ":", "if", "(", "!", "ret_value", ")", "if", "(", "stab_dst", ")", "stab_dst", "=", "H5FL_FREE", "(", "H5O_stab_t", ",", "stab_dst", ")", ";", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5O_stab_copy_file
CGNS/CGNS
multi_line
train
960
1,202
[ "Decode", "a", "symbol", "table", "message", "and", "return", "a", "pointer", "to", "a", "newly", "allocated", "one" ]
[ "'static", "void", "*", "H5O_stab_decode", "(", "H5F_t", "*", "f", ",", "hid_t", "H5_ATTR_UNUSED", "dxpl_id", ",", "H5O_t", "H5_ATTR_UNUSED", "*", "open_oh", ",", "unsigned", "H5_ATTR_UNUSED", "mesg_flags", ",", "unsigned", "H5_ATTR_UNUSED", "*", "ioflags", ",", "size_t", "H5_ATTR_UNUSED", "p_size", ",", "const", "uint8_t", "*", "p", ")", "{", "H5O_stab_t", "*", "stab", "=", "NULL", ";", "void", "*", "ret_value", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI_NOINIT", "/*", "check", "args", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "p", ")", ";", "/*", "decode", "*/", "if", "(", "NULL", "==", "(", "stab", "=", "H5FL_CALLOC", "(", "H5O_stab_t", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_NOSPACE", ",", "NULL", ",", "\"memory", "allocation", "failed\"", ")", "H5F_addr_decode", "(", "f", ",", "&", "p", ",", "&", "(", "stab", "->", "btree_addr", ")", ")", ";", "H5F_addr_decode", "(", "f", ",", "&", "p", ",", "&", "(", "stab", "->", "heap_addr", ")", ")", ";", "/*", "Set", "return", "value", "*/", "ret_value", "=", "stab", ";", "done", ":", "if", "(", "ret_value", "==", "NULL", ")", "{", "if", "(", "stab", "!=", "NULL", ")", "stab", "=", "H5FL_FREE", "(", "H5O_stab_t", ",", "stab", ")", ";", "}", "/*", "end", "if", "*/", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5O_stab_decode
CGNS/CGNS
multi_line
train
961
1,203
[ "Encodes", "a", "symbol", "table", "message" ]
[ "'static", "herr_t", "H5O_stab_encode", "(", "H5F_t", "*", "f", ",", "hbool_t", "H5_ATTR_UNUSED", "disable_shared", ",", "uint8_t", "*", "p", ",", "const", "void", "*", "_mesg", ")", "{", "const", "H5O_stab_t", "*", "stab", "=", "(", "const", "H5O_stab_t", "*", ")", "_mesg", ";", "FUNC_ENTER_NOAPI_NOINIT_NOERR", "/*", "check", "args", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "p", ")", ";", "HDassert", "(", "stab", ")", ";", "/*", "encode", "*/", "H5F_addr_encode", "(", "f", ",", "&", "p", ",", "stab", "->", "btree_addr", ")", ";", "H5F_addr_encode", "(", "f", ",", "&", "p", ",", "stab", "->", "heap_addr", ")", ";", "FUNC_LEAVE_NOAPI", "(", "SUCCEED", ")", "}'" ]
H5O_stab_encode
CGNS/CGNS
multi_line
train
962
1,204
[ "Free", "file", "space", "referenced", "by", "message" ]
[ "'static", "herr_t", "H5O_stab_delete", "(", "H5F_t", "*", "f", ",", "hid_t", "dxpl_id", ",", "H5O_t", "H5_ATTR_UNUSED", "*", "open_oh", ",", "void", "*", "mesg", ")", "{", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI_NOINIT", "/*", "check", "args", "*/", "HDassert", "(", "f", ")", ";", "HDassert", "(", "mesg", ")", ";", "/*", "Free", "the", "file", "space", "for", "the", "symbol", "table", "*/", "if", "(", "H5G__stab_delete", "(", "f", ",", "dxpl_id", ",", "(", "const", "H5O_stab_t", "*", ")", "mesg", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_OHDR", ",", "H5E_CANTFREE", ",", "FAIL", ",", "\"unable", "to", "free", "symbol", "table\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5O_stab_delete
CGNS/CGNS
multi_line
train
963
1,205
[ "Finish", "copying", "a", "message", "from", "between", "files" ]
[ "'static", "herr_t", "H5O_stab_post_copy_file", "(", "const", "H5O_loc_t", "*", "src_oloc", ",", "const", "void", "*", "mesg_src", ",", "H5O_loc_t", "*", "dst_oloc", ",", "void", "*", "mesg_dst", ",", "unsigned", "H5_ATTR_UNUSED", "*", "mesg_flags", ",", "hid_t", "dxpl_id", ",", "H5O_copy_t", "*", "cpy_info", ")", "{", "const", "H5O_stab_t", "*", "stab_src", "=", "(", "const", "H5O_stab_t", "*", ")", "mesg_src", ";", "H5O_stab_t", "*", "stab_dst", "=", "(", "H5O_stab_t", "*", ")", "mesg_dst", ";", "H5G_bt_it_cpy_t", "udata", ";", "/*", "B-tree", "user", "data", "*/", "herr_t", "ret_value", "=", "SUCCEED", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI_NOINIT", "/*", "check", "args", "*/", "HDassert", "(", "stab_src", ")", ";", "HDassert", "(", "H5F_addr_defined", "(", "dst_oloc", "->", "addr", ")", ")", ";", "HDassert", "(", "dst_oloc", "->", "file", ")", ";", "HDassert", "(", "stab_dst", ")", ";", "HDassert", "(", "cpy_info", ")", ";", "/*", "If", "we", "are", "performing", "a", "\\'shallow", "hierarchy\\'", "copy,", "get", "out", "now", "*/", "if", "(", "cpy_info", "->", "max_depth", ">=", "0", "&&", "cpy_info", "->", "curr_depth", ">=", "cpy_info", "->", "max_depth", ")", "HGOTO_DONE", "(", "SUCCEED", ")", "/*", "Set", "up", "B-tree", "iteration", "user", "data", "*/", "udata", ".", "src_oloc", "=", "src_oloc", ";", "udata", ".", "src_heap_addr", "=", "stab_src", "->", "heap_addr", ";", "udata", ".", "dst_file", "=", "dst_oloc", "->", "file", ";", "udata", ".", "dst_stab", "=", "stab_dst", ";", "udata", ".", "cpy_info", "=", "cpy_info", ";", "/*", "Iterate", "over", "objects", "in", "group,", "copying", "them", "*/", "if", "(", "(", "H5B_iterate", "(", "src_oloc", "->", "file", ",", "dxpl_id", ",", "H5B_SNODE", ",", "stab_src", "->", "btree_addr", ",", "H5G__node_copy", ",", "&", "udata", ")", ")", "<", "0", ")", "HGOTO_ERROR", "(", "H5E_SYM", ",", "H5E_CANTINIT", ",", "FAIL", ",", "\"iteration", "operator", "failed\"", ")", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5O_stab_post_copy_file
CGNS/CGNS
multi_line
train
964
1,206
[ "Copies", "a", "message", "from", "_MESG", "to", "_DEST,", "allocating", "_DEST", "if", "necessary" ]
[ "'static", "void", "*", "H5O_stab_copy", "(", "const", "void", "*", "_mesg", ",", "void", "*", "_dest", ")", "{", "const", "H5O_stab_t", "*", "stab", "=", "(", "const", "H5O_stab_t", "*", ")", "_mesg", ";", "H5O_stab_t", "*", "dest", "=", "(", "H5O_stab_t", "*", ")", "_dest", ";", "void", "*", "ret_value", ";", "/*", "Return", "value", "*/", "FUNC_ENTER_NOAPI_NOINIT", "/*", "check", "args", "*/", "HDassert", "(", "stab", ")", ";", "if", "(", "!", "dest", "&&", "NULL", "==", "(", "dest", "=", "H5FL_MALLOC", "(", "H5O_stab_t", ")", ")", ")", "HGOTO_ERROR", "(", "H5E_RESOURCE", ",", "H5E_NOSPACE", ",", "NULL", ",", "\"memory", "allocation", "failed\"", ")", ";", "/*", "copy", "*/", "*", "dest", "=", "*", "stab", ";", "/*", "Set", "return", "value", "*/", "ret_value", "=", "dest", ";", "done", ":", "FUNC_LEAVE_NOAPI", "(", "ret_value", ")", "}'" ]
H5O_stab_copy
CGNS/CGNS
multi_line
train
965
1,207
[ "CAN", "Initialize", "a", "32bit", "Message", "ID", "Mask", "Filter" ]
[ "'void", "can_filter_id_mask_32bit_init", "(", "uint32_t", "nr", ",", "uint32_t", "id", ",", "uint32_t", "mask", ",", "uint32_t", "fifo", ",", "bool", "enable", ")", "{", "can_filter_init", "(", "nr", ",", "true", ",", "false", ",", "id", ",", "mask", ",", "fifo", ",", "enable", ")", ";", "}'" ]
can_filter_id_mask_32bit_init
PX4/Bootloader
multi_line
train
966
1,208
[ "CAN", "Initialize", "a", "16bit", "Message", "ID", "List", "Filter" ]
[ "'void", "can_filter_id_list_16bit_init", "(", "uint32_t", "nr", ",", "uint16_t", "id1", ",", "uint16_t", "id2", ",", "uint16_t", "id3", ",", "uint16_t", "id4", ",", "uint32_t", "fifo", ",", "bool", "enable", ")", "{", "can_filter_init", "(", "nr", ",", "false", ",", "true", ",", "(", "(", "uint32_t", ")", "id1", "<<", "16", ")", "|", "(", "uint32_t", ")", "id2", ",", "(", "(", "uint32_t", ")", "id3", "<<", "16", ")", "|", "(", "uint32_t", ")", "id4", ",", "fifo", ",", "enable", ")", ";", "}'" ]
can_filter_id_list_16bit_init
PX4/Bootloader
multi_line
train
967
1,210
[ "Print", "token", "structurally", "(for", "debugging)", "pointing", "to", "a", "single", "character" ]
[ "'int", "lexer_dprint_tok_chr", "(", "lexer_tok_t", "*", "tok", ",", "size_t", "offs", ",", "FILE", "*", "f", ")", "{", "src_pos_t", "pos", ";", "size_t", "i", ";", "pos", "=", "tok", "->", "bpos", ";", "for", "(", "i", "=", "0", ";", "i", "<", "offs", ";", "i", "++", ")", "src_pos_fwd_char", "(", "&", "pos", ",", "tok", "->", "text", "[", "i", "]", ")", ";", "return", "lexer_dprint_tok_range", "(", "tok", ",", "&", "pos", ",", "&", "pos", ",", "f", ")", ";", "}'" ]
lexer_dprint_tok_chr
HelenOS/helenos
multi_line
train
968
1,211
[ "Print", "character,", "escaping", "special", "characters" ]
[ "'int", "lexer_dprint_char", "(", "char", "c", ",", "FILE", "*", "f", ")", "{", "int", "rc", ";", "if", "(", "!", "is_print", "(", "c", ")", ")", "{", "rc", "=", "fprintf", "(", "f", ",", "\"#%02x\"", ",", "c", ")", ";", "if", "(", "rc", "<", "0", ")", "return", "EIO", ";", "}", "<if", "type=\"elseif\">", "else", "if", "(", "c", "==", "\\'#\\'", ")", "{", "rc", "=", "fputc", "(", "\\'#\\'", ",", "f", ")", ";", "if", "(", "rc", "==", "EOF", ")", "return", "EIO", ";", "}", "else", "{", "rc", "=", "fputc", "(", "c", ",", "f", ")", ";", "if", "(", "rc", "==", "EOF", ")", "return", "EIO", ";", "}", "return", "EOK", ";", "}'" ]
lexer_dprint_char
HelenOS/helenos
multi_line
train
969
1,212
[ "Determine", "if", "character", "is", "a", "hexadecimal", "digit" ]
[ "\"static", "bool", "is_hexdigit", "(", "char", "c", ")", "{", "return", "is_num", "(", "c", ")", "||", "(", "c", ">=", "'A'", "&&", "c", "<=", "'F'", ")", "||", "(", "c", ">=", "'a'", "&&", "c", "<=", "'f'", ")", ";", "}\"" ]
is_hexdigit
HelenOS/helenos
multi_line
train
970
1,213
[ "Determine", "if", "lexer", "is", "at", "end", "of", "file" ]
[ "'static", "bool", "lexer_is_eof", "(", "lexer_t", "*", "lexer", ")", "{", "char", "*", "lc", ";", "/*", "Make", "sure", "buffer", "is", "filled,", "if", "possible*/", "lc", "=", "lexer_chars", "(", "lexer", ")", ";", "(", "void", ")", "lc", ";", "return", "lexer", "->", "buf_pos", "==", "lexer", "->", "buf_used", ";", "}'" ]
lexer_is_eof
HelenOS/helenos
multi_line
train
971
1,214
[ "Print", "token", "(in", "original", "C", "form)" ]
[ "'int", "lexer_print_tok", "(", "lexer_tok_t", "*", "tok", ",", "FILE", "*", "f", ")", "{", "if", "(", "fprintf", "(", "f", ",", "\"%s\"", ",", "tok", "->", "text", ")", "<", "0", ")", "return", "EIO", ";", "return", "EOK", ";", "}'" ]
lexer_print_tok
HelenOS/helenos
multi_line
train
972
1,215
[ "Print", "token", "structurally", "(for", "debugging)" ]
[ "'int", "lexer_dprint_tok", "(", "lexer_tok_t", "*", "tok", ",", "FILE", "*", "f", ")", "{", "return", "lexer_dprint_tok_range", "(", "tok", ",", "&", "tok", "->", "bpos", ",", "&", "tok", "->", "epos", ",", "f", ")", ";", "}'" ]
lexer_dprint_tok
HelenOS/helenos
multi_line
train
973
1,216
[ "Print", "token", "structurally", "(for", "debugging)", "with", "specified", "range" ]
[ "'static", "int", "lexer_dprint_tok_range", "(", "lexer_tok_t", "*", "tok", ",", "src_pos_t", "*", "bpos", ",", "src_pos_t", "*", "epos", ",", "FILE", "*", "f", ")", "{", "int", "rc", ";", "if", "(", "fprintf", "(", "f", ",", "\"<\"", ")", "<", "0", ")", "return", "EIO", ";", "rc", "=", "src_pos_print_range", "(", "bpos", ",", "epos", ",", "f", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "return", "rc", ";", "if", "(", "fprintf", "(", "f", ",", "\":%s\"", ",", "lexer_str_ttype", "(", "tok", "->", "ttype", ")", ")", "<", "0", ")", "return", "EIO", ";", "switch", "(", "tok", "->", "ttype", ")", "{", "case", "ltt_ident", ":", "case", "ltt_number", ":", "if", "(", "fprintf", "(", "f", ",", "\":%s\"", ",", "tok", "->", "text", ")", "<", "0", ")", "return", "EIO", ";", "break;", "case", "ltt_invalid", ":", "case", "ltt_invchar", ":", "if", "(", "fputc", "(", "\\':\\'", ",", "f", ")", "==", "EOF", ")", "return", "EIO", ";", "rc", "=", "lexer_dprint_str", "(", "tok", "->", "text", ",", "f", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "return", "EIO", ";", "break;", "default:", "break;", "}", "if", "(", "fprintf", "(", "f", ",", "\">\"", ")", "<", "0", ")", "return", "EIO", ";", "return", "EOK", ";", "}'" ]
lexer_dprint_tok_range
HelenOS/helenos
multi_line
train
974
1,217
[ "Determine", "if", "token", "type", "is", "a", "reserved", "word", "token" ]
[ "'bool", "lexer_is_resword", "(", "lexer_toktype_t", "ltt", ")", "{", "return", "ltt", ">=", "ltt_resword_first", "&&", "ltt", "<=", "ltt_resword_last", ";", "}'" ]
lexer_is_resword
HelenOS/helenos
multi_line
train
975
1,218
[ "Determine", "if", "character", "is", "printable" ]
[ "'static", "bool", "is_print", "(", "char", "c", ")", "{", "uint8_t", "b", ";", "b", "=", "(", "uint8_t", ")", "c", ";", "return", "(", "b", ">=", "32", ")", "&&", "(", "b", "<", "127", ")", ";", "}'" ]
is_print
HelenOS/helenos
multi_line
train
976
1,219
[ "Lex", "End", "of", "File" ]
[ "'static", "int", "lexer_eof", "(", "lexer_t", "*", "lexer", ",", "lexer_tok_t", "*", "tok", ")", "{", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "bpos", ")", ";", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "epos", ")", ";", "tok", "->", "ttype", "=", "ltt_eof", ";", "return", "EOK", ";", "}'" ]
lexer_eof
HelenOS/helenos
multi_line
train
977
1,220
[ "Determine", "if", "token", "type", "is", "a", "comment", "token" ]
[ "'bool", "lexer_is_comment", "(", "lexer_toktype_t", "ltt", ")", "{", "return", "ltt", "==", "ltt_copen", "||", "ltt", "==", "ltt_ctext", "||", "ltt", "==", "ltt_ccont", "||", "ltt", "==", "ltt_cclose", "||", "ltt", "==", "ltt_dscomment", "||", "ltt", "==", "ltt_dcopen", ";", "}'" ]
lexer_is_comment
HelenOS/helenos
multi_line
train
978
1,221
[ "Determine", "if", "character", "is", "a", "digit", "in", "the", "specified", "base" ]
[ "'static", "bool", "is_digit", "(", "char", "c", ",", "int", "base", ")", "{", "switch", "(", "base", ")", "{", "case", "8", ":", "return", "is_octdigit", "(", "c", ")", ";", "case", "10", ":", "return", "is_num", "(", "c", ")", ";", "case", "16", ":", "return", "is_hexdigit", "(", "c", ")", ";", "default:", "assert", "(", "false", ")", ";", "return", "false", ";", "}", "}'" ]
is_digit
HelenOS/helenos
multi_line
train
979
1,222
[ "Lex", "next", "token", "in", "normal", "state" ]
[ "'static", "int", "lexer_get_tok_normal", "(", "lexer_t", "*", "lexer", ",", "lexer_tok_t", "*", "tok", ")", "{", "char", "*", "p", ";", "memset", "(", "tok", ",", "0", ",", "sizeof", "(", "lexer_tok_t", ")", ")", ";", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "/*", "End", "of", "file", "or", "null", "character", "*/", "if", "(", "p", "[", "0", "]", "==", "\\'\\\\0\\'", ")", "{", "if", "(", "lexer_is_eof", "(", "lexer", ")", ")", "return", "lexer_eof", "(", "lexer", ",", "tok", ")", ";", "else", "return", "lexer_nonprint", "(", "lexer", ",", "tok", ")", ";", "}", "switch", "(", "p", "[", "0", "]", ")", "{", "case", "\\'\\\\t\\'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_tab", ",", "tok", ")", ";", "case", "\\'\\\\'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_", ",", "tok", ")", ";", "case", "\\'", "\\'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_space", ",", "tok", ")", ";", "case", "\\'!\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_notequal", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_lnot", ",", "tok", ")", ";", "case", "\\'\"\\'", ":", "return", "lexer_charstr", "(", "lexer", ",", "tok", ")", ";", "case", "\\'#\\'", ":", "return", "lexer_preproc", "(", "lexer", ",", "tok", ")", ";", "case", "\\'%\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_modulo_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_modulo", ",", "tok", ")", ";", "case", "\\'&\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'&\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_land", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_band_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_amper", ",", "tok", ")", ";", "case", "\\'\\\\\\'\\'", ":", "return", "lexer_charstr", "(", "lexer", ",", "tok", ")", ";", "case", "\\'(\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_lparen", ",", "tok", ")", ";", "case", "\\')\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_rparen", ",", "tok", ")", ";", "case", "\\'*\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_times_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_asterisk", ",", "tok", ")", ";", "case", "\\'+\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'+\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_inc", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_plus_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_plus", ",", "tok", ")", ";", "case", "\\',\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_comma", ",", "tok", ")", ";", "case", "\\'-\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'-\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_dec", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_minus_assign", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'>\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_arrow", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_minus", ",", "tok", ")", ";", "case", "\\'.\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'.\\'", "&&", "p", "[", "2", "]", "==", "\\'.\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_ellipsis", ",", "3", ",", "tok", ")", ";", "if", "(", "is_num", "(", "p", "[", "1", "]", ")", ")", "return", "lexer_number", "(", "lexer", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_period", ",", "tok", ")", ";", "case", "\\'/\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'*\\'", "&&", "p", "[", "2", "]", "==", "\\'*\\'", ")", "return", "lexer_dcopen", "(", "lexer", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'*\\'", ")", "return", "lexer_copen", "(", "lexer", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'/\\'", ")", "return", "lexer_dscomment", "(", "lexer", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_divide_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_slash", ",", "tok", ")", ";", "case", "\\':\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_colon", ",", "tok", ")", ";", "case", "\\';\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_scolon", ",", "tok", ")", ";", "case", "\\'<\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_lteq", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'<\\'", ")", "{", "if", "(", "p", "[", "2", "]", "==", "\\'=\\'", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_shl_assign", ",", "3", ",", "tok", ")", ";", "}", "return", "lexer_keyword", "(", "lexer", ",", "ltt_shl", ",", "2", ",", "tok", ")", ";", "}", "return", "lexer_onechar", "(", "lexer", ",", "ltt_less", ",", "tok", ")", ";", "case", "\\'=\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_equal", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_assign", ",", "tok", ")", ";", "case", "\\'>\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_gteq", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'>\\'", ")", "{", "if", "(", "p", "[", "2", "]", "==", "\\'=\\'", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_shr_assign", ",", "3", ",", "tok", ")", ";", "}", "return", "lexer_keyword", "(", "lexer", ",", "ltt_shr", ",", "2", ",", "tok", ")", ";", "}", "return", "lexer_onechar", "(", "lexer", ",", "ltt_greater", ",", "tok", ")", ";", "case", "\\'?\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_qmark", ",", "tok", ")", ";", "case", "\\'L\\'", ":", "case", "\\'U\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'\\\\\\'\\'", "||", "p", "[", "1", "]", "==", "\\'\"\\'", ")", "return", "lexer_charstr", "(", "lexer", ",", "tok", ")", ";", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'~\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_bnot", ",", "tok", ")", ";", "case", "\\'^\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_bxor_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_bxor", ",", "tok", ")", ";", "case", "\\'{\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_lbrace", ",", "tok", ")", ";", "case", "\\'|\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'|\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_lor", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'=\\'", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_bor_assign", ",", "2", ",", "tok", ")", ";", "return", "lexer_onechar", "(", "lexer", ",", "ltt_bor", ",", "tok", ")", ";", "case", "\\'}\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_rbrace", ",", "tok", ")", ";", "case", "\\'[\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_lbracket", ",", "tok", ")", ";", "case", "\\'\\\\\\\\\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'\\\\'", ")", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_elbspace", ",", "tok", ")", ";", "return", "lexer_invalid", "(", "lexer", ",", "tok", ")", ";", "case", "\\']\\'", ":", "return", "lexer_onechar", "(", "lexer", ",", "ltt_rbracket", ",", "tok", ")", ";", "case", "\\'_\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'_\\'", "&&", "p", "[", "2", "]", "==", "\\'a\\'", "&&", "p", "[", "3", "]", "==", "\\'t\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "p", "[", "5", "]", "==", "\\'r\\'", "&&", "p", "[", "6", "]", "==", "\\'i\\'", "&&", "p", "[", "7", "]", "==", "\\'b\\'", "&&", "p", "[", "8", "]", "==", "\\'u\\'", "&&", "p", "[", "9", "]", "==", "\\'t\\'", "&&", "p", "[", "10", "]", "==", "\\'e\\'", "&&", "p", "[", "11", "]", "==", "\\'_\\'", "&&", "p", "[", "12", "]", "==", "\\'_\\'", "&&", "!", "is_idcnt", "(", "p", "[", "13", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_attribute", ",", "13", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'_\\'", "&&", "p", "[", "2", "]", "==", "\\'i\\'", "&&", "p", "[", "3", "]", "==", "\\'n\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "p", "[", "5", "]", "==", "\\'1\\'", "&&", "p", "[", "6", "]", "==", "\\'2\\'", "&&", "p", "[", "7", "]", "==", "\\'8\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_int128", ",", "8", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'_\\'", "&&", "p", "[", "2", "]", "==", "\\'r\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "p", "[", "4", "]", "==", "\\'s\\'", "&&", "p", "[", "5", "]", "==", "\\'t\\'", "&&", "p", "[", "6", "]", "==", "\\'r\\'", "&&", "p", "[", "7", "]", "==", "\\'i\\'", "&&", "p", "[", "8", "]", "==", "\\'c\\'", "&&", "p", "[", "9", "]", "==", "\\'t\\'", "&&", "p", "[", "10", "]", "==", "\\'_\\'", "&&", "p", "[", "11", "]", "==", "\\'_\\'", "&&", "!", "is_idcnt", "(", "p", "[", "12", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_restrict_alt", ",", "12", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'A\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "p", "[", "3", "]", "==", "\\'o\\'", "&&", "p", "[", "4", "]", "==", "\\'m\\'", "&&", "p", "[", "5", "]", "==", "\\'i\\'", "&&", "p", "[", "6", "]", "==", "\\'c\\'", "&&", "!", "is_idcnt", "(", "p", "[", "7", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_atomic", ",", "7", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'a\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'s\\'", "&&", "p", "[", "2", "]", "==", "\\'m\\'", "&&", "!", "is_idcnt", "(", "p", "[", "3", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_asm", ",", "3", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'u\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "p", "[", "3", "]", "==", "\\'o\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_auto", ",", "4", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'b\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'r\\'", "&&", "p", "[", "2", "]", "==", "\\'e\\'", "&&", "p", "[", "3", "]", "==", "\\'a\\'", "&&", "p", "[", "4", "]", "==", "\\'k\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_break", ",", "5", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'c\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'a\\'", "&&", "p", "[", "2", "]", "==", "\\'s\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_case", ",", "4", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'h\\'", "&&", "p", "[", "2", "]", "==", "\\'a\\'", "&&", "p", "[", "3", "]", "==", "\\'r\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_char", ",", "4", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'n\\'", "&&", "p", "[", "3", "]", "==", "\\'s\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_const", ",", "5", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'n\\'", "&&", "p", "[", "3", "]", "==", "\\'t\\'", "&&", "p", "[", "4", "]", "==", "\\'i\\'", "&&", "p", "[", "5", "]", "==", "\\'n\\'", "&&", "p", "[", "6", "]", "==", "\\'u\\'", "&&", "p", "[", "7", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_continue", ",", "8", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'d\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "!", "is_idcnt", "(", "p", "[", "2", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_do", ",", "2", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'u\\'", "&&", "p", "[", "3", "]", "==", "\\'b\\'", "&&", "p", "[", "4", "]", "==", "\\'l\\'", "&&", "p", "[", "5", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_double", ",", "6", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'e\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'l\\'", "&&", "p", "[", "2", "]", "==", "\\'s\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_else", ",", "4", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'n\\'", "&&", "p", "[", "2", "]", "==", "\\'u\\'", "&&", "p", "[", "3", "]", "==", "\\'m\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_enum", ",", "4", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'x\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "p", "[", "4", "]", "==", "\\'r\\'", "&&", "p", "[", "5", "]", "==", "\\'n\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_extern", ",", "6", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'f\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'l\\'", "&&", "p", "[", "2", "]", "==", "\\'o\\'", "&&", "p", "[", "3", "]", "==", "\\'a\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_float", ",", "5", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'r\\'", "&&", "!", "is_idcnt", "(", "p", "[", "3", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_for", ",", "3", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'g\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "p", "[", "3", "]", "==", "\\'o\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_goto", ",", "4", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'i\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'f\\'", "&&", "!", "is_idcnt", "(", "p", "[", "2", "]", ")", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_if", ",", "2", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'n\\'", "&&", "p", "[", "2", "]", "==", "\\'l\\'", "&&", "p", "[", "3", "]", "==", "\\'i\\'", "&&", "p", "[", "4", "]", "==", "\\'n\\'", "&&", "p", "[", "5", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_inline", ",", "6", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'n\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "3", "]", ")", ")", "return", "lexer_keyword", "(", "lexer", ",", "ltt_int", ",", "3", ",", "tok", ")", ";", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'l\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'n\\'", "&&", "p", "[", "3", "]", "==", "\\'g\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_long", ",", "4", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'r\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'e\\'", "&&", "p", "[", "2", "]", "==", "\\'g\\'", "&&", "p", "[", "3", "]", "==", "\\'i\\'", "&&", "p", "[", "4", "]", "==", "\\'s\\'", "&&", "p", "[", "5", "]", "==", "\\'t\\'", "&&", "p", "[", "6", "]", "==", "\\'e\\'", "&&", "p", "[", "7", "]", "==", "\\'r\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_register", ",", "8", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'e\\'", "&&", "p", "[", "2", "]", "==", "\\'s\\'", "&&", "p", "[", "3", "]", "==", "\\'t\\'", "&&", "p", "[", "4", "]", "==", "\\'r\\'", "&&", "p", "[", "5", "]", "==", "\\'i\\'", "&&", "p", "[", "6", "]", "==", "\\'c\\'", "&&", "p", "[", "7", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_restrict", ",", "8", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'e\\'", "&&", "p", "[", "2", "]", "==", "\\'t\\'", "&&", "p", "[", "3", "]", "==", "\\'u\\'", "&&", "p", "[", "4", "]", "==", "\\'r\\'", "&&", "p", "[", "5", "]", "==", "\\'n\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_return", ",", "6", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'s\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'h\\'", "&&", "p", "[", "2", "]", "==", "\\'o\\'", "&&", "p", "[", "3", "]", "==", "\\'r\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_short", ",", "5", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'i\\'", "&&", "p", "[", "2", "]", "==", "\\'g\\'", "&&", "p", "[", "3", "]", "==", "\\'n\\'", "&&", "p", "[", "4", "]", "==", "\\'e\\'", "&&", "p", "[", "5", "]", "==", "\\'d\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_signed", ",", "6", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'i\\'", "&&", "p", "[", "2", "]", "==", "\\'z\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "p", "[", "4", "]", "==", "\\'o\\'", "&&", "p", "[", "5", "]", "==", "\\'f\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_sizeof", ",", "6", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'t\\'", "&&", "p", "[", "2", "]", "==", "\\'a\\'", "&&", "p", "[", "3", "]", "==", "\\'t\\'", "&&", "p", "[", "4", "]", "==", "\\'i\\'", "&&", "p", "[", "5", "]", "==", "\\'c\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_static", ",", "6", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'t\\'", "&&", "p", "[", "2", "]", "==", "\\'r\\'", "&&", "p", "[", "3", "]", "==", "\\'u\\'", "&&", "p", "[", "4", "]", "==", "\\'c\\'", "&&", "p", "[", "5", "]", "==", "\\'t\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_struct", ",", "6", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'w\\'", "&&", "p", "[", "2", "]", "==", "\\'i\\'", "&&", "p", "[", "3", "]", "==", "\\'t\\'", "&&", "p", "[", "4", "]", "==", "\\'c\\'", "&&", "p", "[", "5", "]", "==", "\\'h\\'", "&&", "!", "is_idcnt", "(", "p", "[", "6", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_switch", ",", "6", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'t\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'y\\'", "&&", "p", "[", "2", "]", "==", "\\'p\\'", "&&", "p", "[", "3", "]", "==", "\\'e\\'", "&&", "p", "[", "4", "]", "==", "\\'d\\'", "&&", "p", "[", "5", "]", "==", "\\'e\\'", "&&", "p", "[", "6", "]", "==", "\\'f\\'", "&&", "!", "is_idcnt", "(", "p", "[", "7", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_typedef", ",", "7", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'u\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'\\\\\\'\\'", "||", "p", "[", "1", "]", "==", "\\'\"\\'", ")", "return", "lexer_charstr", "(", "lexer", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'8\\'", "&&", "p", "[", "2", "]", "==", "\\'\"\\'", ")", "return", "lexer_charstr", "(", "lexer", ",", "tok", ")", ";", "if", "(", "p", "[", "1", "]", "==", "\\'n\\'", "&&", "p", "[", "2", "]", "==", "\\'i\\'", "&&", "p", "[", "3", "]", "==", "\\'o\\'", "&&", "p", "[", "4", "]", "==", "\\'n\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_union", ",", "5", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'n\\'", "&&", "p", "[", "2", "]", "==", "\\'s\\'", "&&", "p", "[", "3", "]", "==", "\\'i\\'", "&&", "p", "[", "4", "]", "==", "\\'g\\'", "&&", "p", "[", "5", "]", "==", "\\'n\\'", "&&", "p", "[", "6", "]", "==", "\\'e\\'", "&&", "p", "[", "7", "]", "==", "\\'d\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_unsigned", ",", "8", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'v\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'i\\'", "&&", "p", "[", "3", "]", "==", "\\'d\\'", "&&", "!", "is_idcnt", "(", "p", "[", "4", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_void", ",", "4", ",", "tok", ")", ";", "}", "if", "(", "p", "[", "1", "]", "==", "\\'o\\'", "&&", "p", "[", "2", "]", "==", "\\'l\\'", "&&", "p", "[", "3", "]", "==", "\\'a\\'", "&&", "p", "[", "4", "]", "==", "\\'t\\'", "&&", "p", "[", "5", "]", "==", "\\'i\\'", "&&", "p", "[", "6", "]", "==", "\\'l\\'", "&&", "p", "[", "7", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "8", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_volatile", ",", "8", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "case", "\\'w\\'", ":", "if", "(", "p", "[", "1", "]", "==", "\\'h\\'", "&&", "p", "[", "2", "]", "==", "\\'i\\'", "&&", "p", "[", "3", "]", "==", "\\'l\\'", "&&", "p", "[", "4", "]", "==", "\\'e\\'", "&&", "!", "is_idcnt", "(", "p", "[", "5", "]", ")", ")", "{", "return", "lexer_keyword", "(", "lexer", ",", "ltt_while", ",", "5", ",", "tok", ")", ";", "}", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "default:", "if", "(", "is_idbegin", "(", "p", "[", "0", "]", ")", ")", "return", "lexer_ident", "(", "lexer", ",", "tok", ")", ";", "if", "(", "is_num", "(", "p", "[", "0", "]", ")", ")", "return", "lexer_number", "(", "lexer", ",", "tok", ")", ";", "if", "(", "!", "is_print", "(", "p", "[", "0", "]", ")", ")", "return", "lexer_nonprint", "(", "lexer", ",", "tok", ")", ";", "return", "lexer_invalid", "(", "lexer", ",", "tok", ")", ";", "}", "return", "EOK", ";", "}'" ]
lexer_get_tok_normal
HelenOS/helenos
multi_line
train
980
1,223
[ "Determine", "if", "character", "is", "an", "octal", "digit" ]
[ "\"static", "bool", "is_octdigit", "(", "char", "c", ")", "{", "return", "c", ">=", "'0'", "&&", "c", "<=", "'7'", ";", "}\"" ]
is_octdigit
HelenOS/helenos
multi_line
train
981
1,224
[ "Lex", "character", "or", "string", "literal" ]
[ "'static", "int", "lexer_charstr", "(", "lexer_t", "*", "lexer", ",", "lexer_tok_t", "*", "tok", ")", "{", "lexer_toktype_t", "ltt", ";", "char", "*", "p", ";", "char", "delim", ";", "int", "rc", ";", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "bpos", ")", ";", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "if", "(", "p", "[", "0", "]", "==", "\\'u\\'", "&&", "p", "[", "1", "]", "==", "\\'8\\'", ")", "{", "rc", "=", "lexer_advance", "(", "lexer", ",", "2", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "}", "<if", "type=\"elseif\">", "else", "if", "(", "p", "[", "0", "]", "==", "\\'L\\'", "||", "p", "[", "0", "]", "==", "\\'u\\'", "||", "p", "[", "0", "]", "==", "\\'U\\'", ")", "{", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "}", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "switch", "(", "p", "[", "0", "]", ")", "{", "case", "\\'\\\\\\'\\'", ":", "delim", "=", "\\'\\\\\\'\\'", ";", "ltt", "=", "ltt_charlit", ";", "break;", "case", "\\'\"\\'", ":", "delim", "=", "\\'\"\\'", ";", "ltt", "=", "ltt_strlit", ";", "break;", "default:", "assert", "(", "false", ")", ";", "return", "EINVAL", ";", "}", "while", "(", "true", ")", "{", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "if", "(", "p", "[", "0", "]", "==", "\\'\\\\0\\'", ")", "{", "tok", "->", "ttype", "=", "ltt_invalid", ";", "return", "EOK", ";", "}", "if", "(", "p", "[", "0", "]", "==", "delim", ")", "break;", "if", "(", "p", "[", "0", "]", "==", "\\'\\\\\\\\\\'", ")", "{", "/*", "Skip", "the", "next", "character", "*/", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "if", "(", "p", "[", "0", "]", "==", "\\'\\\\0\\'", ")", "{", "tok", "->", "ttype", "=", "ltt_invalid", ";", "return", "EOK", ";", "}", "}", "}", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "epos", ")", ";", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "tok", "->", "ttype", "=", "ltt", ";", "return", "EOK", ";", "}'" ]
lexer_charstr
HelenOS/helenos
multi_line
train
982
1,225
[ "Print", "string,", "escaping", "special", "characters" ]
[ "\"static", "int", "lexer_dprint_str", "(", "const", "char", "*", "str", ",", "FILE", "*", "f", ")", "{", "const", "char", "*", "cp", ";", "char", "c", ";", "int", "rc", ";", "cp", "=", "str", ";", "while", "(", "*", "cp", "!=", "'\\\\0'", ")", "{", "c", "=", "*", "cp", "++", ";", "rc", "=", "lexer_dprint_char", "(", "c", ",", "f", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "return", "rc", ";", "}", "return", "EOK", ";", "}\"" ]
lexer_dprint_str
HelenOS/helenos
multi_line
train
983
1,226
[ "Lex", "next", "token", "in", "comment", "state" ]
[ "\"static", "int", "lexer_get_tok_comment", "(", "lexer_t", "*", "lexer", ",", "lexer_tok_t", "*", "tok", ")", "{", "char", "*", "p", ";", "memset", "(", "tok", ",", "0", ",", "sizeof", "(", "lexer_tok_t", ")", ")", ";", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "if", "(", "p", "[", "0", "]", "==", "'\\\\0'", ")", "return", "lexer_eof", "(", "lexer", ",", "tok", ")", ";", "switch", "(", "p", "[", "0", "]", ")", "{", "case", "'\\\\t'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_tab", ",", "tok", ")", ";", "case", "'\\'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_", ",", "tok", ")", ";", "case", "'", "'", ":", "return", "lexer_whitespace", "(", "lexer", ",", "ltt_space", ",", "tok", ")", ";", "case", "'*'", ":", "if", "(", "p", "[", "1", "]", "==", "'/'", ")", "return", "lexer_cclose", "(", "lexer", ",", "tok", ")", ";", "return", "lexer_ctext", "(", "lexer", ",", "tok", ")", ";", "default:", "return", "lexer_ctext", "(", "lexer", ",", "tok", ")", ";", "}", "return", "EOK", ";", "}\"" ]
lexer_get_tok_comment
HelenOS/helenos
multi_line
train
984
1,227
[ "Determine", "if", "character", "is", "a", "letter", "(C", "language)" ]
[ "\"static", "bool", "is_alpha", "(", "char", "c", ")", "{", "return", "(", "c", ">=", "'a'", "&&", "c", "<=", "'z'", ")", "||", "(", "c", ">=", "'A'", "&&", "c", "<=", "'Z'", ")", ";", "}\"" ]
is_alpha
HelenOS/helenos
multi_line
train
985
1,228
[ "Determine", "if", "character", "can", "begin", "a", "C", "identifier" ]
[ "\"static", "bool", "is_idbegin", "(", "char", "c", ")", "{", "return", "is_alpha", "(", "c", ")", "||", "(", "c", "==", "'_'", ")", ";", "}\"" ]
is_idbegin
HelenOS/helenos
multi_line
train
986
1,229
[ "Advance", "lexer", "read", "position" ]
[ "\"static", "int", "lexer_advance", "(", "lexer_t", "*", "lexer", ",", "size_t", "nchars", ",", "lexer_tok_t", "*", "tok", ")", "{", "char", "*", "p", ";", "while", "(", "nchars", ">", "0", ")", "{", "tok", "->", "text", "=", "realloc", "(", "tok", "->", "text", ",", "tok", "->", "text_size", "+", "2", ")", ";", "if", "(", "tok", "->", "text", "==", "NULL", ")", "return", "ENOMEM", ";", "p", "=", "lexer_chars", "(", "lexer", ")", ";", "tok", "->", "text", "[", "tok", "->", "text_size", "]", "=", "p", "[", "0", "]", ";", "tok", "->", "text", "[", "tok", "->", "text_size", "+", "1", "]", "=", "'\\\\0'", ";", "tok", "->", "text_size", "++", ";", "++", "lexer", "->", "buf_pos", ";", "assert", "(", "lexer", "->", "buf_pos", "<", "lexer_buf_size", ")", ";", "src_pos_fwd_char", "(", "&", "lexer", "->", "pos", ",", "p", "[", "0", "]", ")", ";", "--", "nchars", ";", "}", "return", "EOK", ";", "}\"" ]
lexer_advance
HelenOS/helenos
multi_line
train
987
1,230
[ "Determine", "if", "token", "consists", "only", "of", "allowed", "characters" ]
[ "\"bool", "lexer_tok_valid_chars", "(", "lexer_tok_t", "*", "tok", ",", "size_t", "offs", ",", "size_t", "*", "invpos", ")", "{", "size_t", "pos", ";", "if", "(", "tok", "->", "text", "==", "NULL", ")", "return", "true", ";", "pos", "=", "offs", ";", "while", "(", "tok", "->", "text", "[", "pos", "]", "!=", "'\\\\0'", ")", "{", "if", "(", "is_bad_ctrl", "(", "tok", "->", "text", "[", "pos", "]", ")", ")", "{", "*", "invpos", "=", "pos", ";", "return", "false", ";", "}", "++", "pos", ";", "}", "return", "true", ";", "}\"" ]
lexer_tok_valid_chars
HelenOS/helenos
multi_line
train
988
1,231
[ "Get", "current", "lexer", "position", "in", "source", "code" ]
[ "'static", "void", "lexer_get_pos", "(", "lexer_t", "*", "lexer", ",", "src_pos_t", "*", "pos", ")", "{", "*", "pos", "=", "lexer", "->", "pos", ";", "}'" ]
lexer_get_pos
HelenOS/helenos
multi_line
train
989
1,232
[ "Return", "string", "representation", "of", "token", "type" ]
[ "'const", "char", "*", "lexer_str_ttype", "(", "lexer_toktype_t", "ttype", ")", "{", "switch", "(", "ttype", ")", "{", "case", "ltt_space", ":", "return", "\"space\"", ";", "case", "ltt_tab", ":", "return", "\"tab\"", ";", "case", "ltt_", ":", "return", "\"\"", ";", "case", "ltt_elbspace", ":", "return", "\"\\\\\\\\\"", ";", "case", "ltt_copen", ":", "return", "\"\\'/*\\'\"", ";", "case", "ltt_ctext", ":", "return", "\"ctext\"", ";", "case", "ltt_ccont", ":", "return", "\"ccont\"", ";", "case", "ltt_cclose", ":", "return", "\"\\'*/\\'\"", ";", "case", "ltt_dcopen", ":", "return", "\"\\'/**\\'\"", ";", "case", "ltt_dscomment", ":", "return", "\"dscomment\"", ";", "case", "ltt_preproc", ":", "return", "\"preproc\"", ";", "case", "ltt_lparen", ":", "return", "\"\\'(\\'\"", ";", "case", "ltt_rparen", ":", "return", "\"\\')\\'\"", ";", "case", "ltt_lbrace", ":", "return", "\"\\'{\\'\"", ";", "case", "ltt_rbrace", ":", "return", "\"\\'}\\'\"", ";", "case", "ltt_comma", ":", "return", "\"\\',\\'\"", ";", "case", "ltt_colon", ":", "return", "\"\\':\\'\"", ";", "case", "ltt_scolon", ":", "return", "\"\\';\\'\"", ";", "case", "ltt_qmark", ":", "return", "\"\\'?\\'\"", ";", "case", "ltt_period", ":", "return", "\"\\'.\\'\"", ";", "case", "ltt_ellipsis", ":", "return", "\"\\'...\\'\"", ";", "case", "ltt_arrow", ":", "return", "\"\\'->\\'\"", ";", "case", "ltt_plus", ":", "return", "\"\\'+\\'\"", ";", "case", "ltt_minus", ":", "return", "\"\\'-\\'\"", ";", "case", "ltt_asterisk", ":", "return", "\"\\'*\\'\"", ";", "case", "ltt_slash", ":", "return", "\"\\'/\\'\"", ";", "case", "ltt_modulo", ":", "return", "\"\\'%\\'\"", ";", "case", "ltt_inc", ":", "return", "\"\\'++\\'\"", ";", "case", "ltt_dec", ":", "return", "\"\\'--\\'\"", ";", "case", "ltt_shl", ":", "return", "\"\\'<<\\'\"", ";", "case", "ltt_shr", ":", "return", "\"\\'>>\\'\"", ";", "case", "ltt_amper", ":", "return", "\"\\'&\\'\"", ";", "case", "ltt_bor", ":", "return", "\"\\'|\\'\"", ";", "case", "ltt_bxor", ":", "return", "\"\\'^\\'\"", ";", "case", "ltt_bnot", ":", "return", "\"\\'~\\'\"", ";", "case", "ltt_land", ":", "return", "\"\\'&&\\'\"", ";", "case", "ltt_lor", ":", "return", "\"\\'||\\'\"", ";", "case", "ltt_lnot", ":", "return", "\"\\'!\\'\"", ";", "case", "ltt_less", ":", "return", "\"\\'<\\'\"", ";", "case", "ltt_greater", ":", "return", "\"\\'>\\'\"", ";", "case", "ltt_equal", ":", "return", "\"\\'==\\'\"", ";", "case", "ltt_lteq", ":", "return", "\"\\'<=\\'\"", ";", "case", "ltt_gteq", ":", "return", "\"\\'>=\\'\"", ";", "case", "ltt_notequal", ":", "return", "\"\\'!=\\'\"", ";", "case", "ltt_assign", ":", "return", "\"\\'=\\'\"", ";", "case", "ltt_plus_assign", ":", "return", "\"\\'+=\\'\"", ";", "case", "ltt_minus_assign", ":", "return", "\"\\'-=\\'\"", ";", "case", "ltt_times_assign", ":", "return", "\"\\'*=\\'\"", ";", "case", "ltt_divide_assign", ":", "return", "\"\\'/=\\'\"", ";", "case", "ltt_modulo_assign", ":", "return", "\"\\'%=\\'\"", ";", "case", "ltt_shl_assign", ":", "return", "\"\\'<<=\\'\"", ";", "case", "ltt_shr_assign", ":", "return", "\"\\'>>=\\'\"", ";", "case", "ltt_band_assign", ":", "return", "\"\\'&=\\'\"", ";", "case", "ltt_bor_assign", ":", "return", "\"\\'|=\\'\"", ";", "case", "ltt_bxor_assign", ":", "return", "\"\\'^=\\'\"", ";", "case", "ltt_lbracket", ":", "return", "\"\\'[\\'\"", ";", "case", "ltt_rbracket", ":", "return", "\"\\']\\'\"", ";", "case", "ltt_atomic", ":", "return", "\"_Atomic\"", ";", "case", "ltt_attribute", ":", "return", "\"\\'__attribute__\\'\"", ";", "case", "ltt_asm", ":", "return", "\"\\'asm\\'\"", ";", "case", "ltt_auto", ":", "return", "\"\\'auto\\'\"", ";", "case", "ltt_break", ":", "return", "\"\\'break\\'\"", ";", "case", "ltt_case", ":", "return", "\"\\'case\\'\"", ";", "case", "ltt_char", ":", "return", "\"\\'char\\'\"", ";", "case", "ltt_const", ":", "return", "\"\\'const\\'\"", ";", "case", "ltt_continue", ":", "return", "\"\\'continue\\'\"", ";", "case", "ltt_do", ":", "return", "\"\\'do\\'\"", ";", "case", "ltt_double", ":", "return", "\"\\'double\\'\"", ";", "case", "ltt_else", ":", "return", "\"\\'else\\'\"", ";", "case", "ltt_enum", ":", "return", "\"\\'enum\\'\"", ";", "case", "ltt_extern", ":", "return", "\"\\'extern\\'\"", ";", "case", "ltt_float", ":", "return", "\"\\'float\\'\"", ";", "case", "ltt_for", ":", "return", "\"\\'for\\'\"", ";", "case", "ltt_goto", ":", "return", "\"\\'goto\\'\"", ";", "case", "ltt_if", ":", "return", "\"\\'if\\'\"", ";", "case", "ltt_inline", ":", "return", "\"\\'inline\\'\"", ";", "case", "ltt_int", ":", "return", "\"\\'int\\'\"", ";", "case", "ltt_int128", ":", "return", "\"\\'__int128\\'\"", ";", "case", "ltt_long", ":", "return", "\"\\'long\\'\"", ";", "case", "ltt_register", ":", "return", "\"\\'register\\'\"", ";", "case", "ltt_restrict", ":", "return", "\"\\'restrict\\'\"", ";", "case", "ltt_restrict_alt", ":", "return", "\"\\'__restrict__\\'\"", ";", "case", "ltt_return", ":", "return", "\"\\'return\\'\"", ";", "case", "ltt_signed", ":", "return", "\"\\'signed\\'\"", ";", "case", "ltt_sizeof", ":", "return", "\"\\'sizeof\\'\"", ";", "case", "ltt_short", ":", "return", "\"\\'short\\'\"", ";", "case", "ltt_static", ":", "return", "\"\\'static\\'\"", ";", "case", "ltt_struct", ":", "return", "\"\\'struct\\'\"", ";", "case", "ltt_switch", ":", "return", "\"\\'switch\\'\"", ";", "case", "ltt_typedef", ":", "return", "\"\\'typedef\\'\"", ";", "case", "ltt_union", ":", "return", "\"\\'union\\'\"", ";", "case", "ltt_unsigned", ":", "return", "\"\\'unsigned\\'\"", ";", "case", "ltt_void", ":", "return", "\"\\'void\\'\"", ";", "case", "ltt_volatile", ":", "return", "\"\\'volatile\\'\"", ";", "case", "ltt_while", ":", "return", "\"\\'while\\'\"", ";", "case", "ltt_ident", ":", "return", "\"id\"", ";", "case", "ltt_number", ":", "return", "\"num\"", ";", "case", "ltt_strlit", ":", "return", "\"str\"", ";", "case", "ltt_charlit", ":", "return", "\"char\"", ";", "case", "ltt_eof", ":", "return", "\"eof\"", ";", "case", "ltt_invalid", ":", "return", "\"invalid\"", ";", "case", "ltt_invchar", ":", "return", "\"invchar\"", ";", "case", "ltt_error", ":", "return", "\"error\"", ";", "}", "return", "EOK", ";", "}'" ]
lexer_str_ttype
HelenOS/helenos
multi_line
train
990
1,233
[ "Determine", "if", "character", "is", "alphanumeric", "(C", "language)" ]
[ "'static", "bool", "is_alnum", "(", "char", "c", ")", "{", "return", "is_alpha", "(", "c", ")", "||", "is_num", "(", "c", ")", ";", "}'" ]
is_alnum
HelenOS/helenos
multi_line
train
991
1,234
[ "Lex", "documentation", "comment", "open" ]
[ "'static", "int", "lexer_dcopen", "(", "lexer_t", "*", "lexer", ",", "lexer_tok_t", "*", "tok", ")", "{", "int", "rc", ";", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "bpos", ")", ";", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "lexer_get_pos", "(", "lexer", ",", "&", "tok", "->", "epos", ")", ";", "rc", "=", "lexer_advance", "(", "lexer", ",", "1", ",", "tok", ")", ";", "if", "(", "rc", "!=", "EOK", ")", "{", "lexer_free_tok", "(", "tok", ")", ";", "return", "rc", ";", "}", "tok", "->", "ttype", "=", "ltt_dcopen", ";", "lexer", "->", "state", "=", "ls_comment", ";", "return", "EOK", ";", "}'" ]
lexer_dcopen
HelenOS/helenos
multi_line
train
992
1,235
[ "Refill", "receive", "descriptor", "ring" ]
[ "'static", "void", "velocity_refill_rx", "(", "struct", "velocity_nic", "*", "vlc", ")", "{", "struct", "velocity_rx_descriptor", "*", "desc", ";", "struct", "io_buffer", "*", "iobuf", ";", "int", "rx_idx", ",", "<type", "ref=\"prev\"/>", "i", "=", "0", ";", "/*", "Check", "for", "new", "packets", "*/", "while", "(", "(", "vlc", "->", "rx_prod", "-", "vlc", "->", "rx_cons", ")", "<", "VELOCITY_RXDESC_NUM", ")", "{", "iobuf", "=", "alloc_iob", "(", "VELOCITY_RX_MAX_LEN", ")", ";", "/*", "Memory", "pressure:", "try", "again", "next", "poll", "*/", "if", "(", "!", "iobuf", ")", "break;", "rx_idx", "=", "(", "vlc", "->", "rx_prod", "++", "%", "VELOCITY_RXDESC_NUM", ")", ";", "desc", "=", "&", "vlc", "->", "rx_ring", "[", "rx_idx", "]", ";", "/*", "Set", "descrptor", "fields", "*/", "desc", "->", "des1", "=", "0", ";", "desc", "->", "addr", "=", "virt_to_le32bus", "(", "iobuf", "->", "data", ")", ";", "desc", "->", "des2", "=", "cpu_to_le32", "(", "VELOCITY_DES2_SIZE", "(", "VELOCITY_RX_MAX_LEN", "-", "1", ")", "|", "VELOCITY_DES2_IC", ")", ";", "vlc", "->", "rx_buffs", "[", "rx_idx", "]", "=", "iobuf", ";", "i", "++", ";", "/*", "Return", "RX", "descriptors", "in", "blocks", "of", "4", "(hw", "requirement)", "*/", "if", "(", "rx_idx", "%", "4", "==", "3", ")", "{", "int", "j", ";", "for", "(", "j", "=", "0", ";", "j", "<", "4", ";", "j", "++", ")", "{", "desc", "=", "&", "vlc", "->", "rx_ring", "[", "rx_idx", "-", "j", "]", ";", "desc", "->", "des0", "=", "cpu_to_le32", "(", "VELOCITY_DES0_OWN", ")", ";", "}", "vlc", "->", "rx_commit", "+=", "4", ";", "}", "}", "wmb", "()", ";", "if", "(", "vlc", "->", "rx_commit", ")", "{", "writew", "(", "vlc", "->", "rx_commit", ",", "vlc", "->", "regs", "+", "VELOCITY_RXDESC_RESIDUECNT", ")", ";", "vlc", "->", "rx_commit", "=", "0", ";", "}", "if", "(", "i", ">", "0", ")", "DBGC2", "(", "vlc", ",", "\"VELOCITY", "%p", "refilled", "%d", "RX", "descriptors\\\"", ",", "vlc", ",", "i", ")", ";", "}'" ]
velocity_refill_rx
ipxe/ipxe
multi_line
train
993
1,236
[ "Read", "from", "MII", "register" ]
[ "'static", "int", "velocity_mii_read", "(", "struct", "mii_interface", "*", "mdio", ",", "unsigned", "int", "phy", "__unused", ",", "unsigned", "int", "reg", ")", "{", "struct", "velocity_nic", "*", "vlc", "=", "container_of", "(", "mdio", ",", "struct", "velocity_nic", ",", "mdio", ")", ";", "int", "timeout", "=", "VELOCITY_TIMEOUT_US", ";", "int", "result", ";", "DBGC2", "(", "vlc", ",", "\"VELOCITY", "%p", "MII", "read", "reg", "%d\\\"", ",", "vlc", ",", "reg", ")", ";", "/*", "Disable", "autopolling", "before", "we", "can", "access", "MII", "*/", "velocity_autopoll_stop", "(", "vlc", ")", ";", "/*", "Send", "read", "command", "and", "address", "*/", "writeb", "(", "reg", ",", "vlc", "->", "regs", "+", "VELOCITY_MIIADDR", ")", ";", "velocity_setbit", "(", "vlc", "->", "regs", "+", "VELOCITY_MIICR", ",", "VELOCITY_MIICR_RCMD", ")", ";", "/*", "Wait", "for", "read", "to", "complete", "*/", "while", "(", "timeout", "--", ")", "{", "udelay", "(", "1", ")", ";", "if", "(", "(", "readb", "(", "vlc", "->", "regs", "+", "VELOCITY_MIICR", ")", "&", "VELOCITY_MIICR_RCMD", ")", "==", "0", ")", "{", "result", "=", "readw", "(", "vlc", "->", "regs", "+", "VELOCITY_MIIDATA", ")", ";", "velocity_autopoll_start", "(", "vlc", ")", ";", "return", "result", ";", "}", "}", "/*", "Restart", "autopolling", "*/", "velocity_autopoll_start", "(", "vlc", ")", ";", "DBGC", "(", "vlc", ",", "\"MII", "read", "timeout\\\"", ")", ";", "return", "-", "ETIMEDOUT", ";", "}'" ]
velocity_mii_read
ipxe/ipxe
multi_line
train
994
1,237
[ "Write", "to", "MII", "register" ]
[ "'static", "int", "velocity_mii_write", "(", "struct", "mii_interface", "*", "mdio", ",", "unsigned", "int", "phy", "__unused", ",", "unsigned", "int", "reg", ",", "unsigned", "int", "data", ")", "{", "struct", "velocity_nic", "*", "vlc", "=", "container_of", "(", "mdio", ",", "struct", "velocity_nic", ",", "mdio", ")", ";", "int", "timeout", "=", "VELOCITY_TIMEOUT_US", ";", "DBGC2", "(", "vlc", ",", "\"VELOCITY", "%p", "MII", "write", "reg", "%d", "data", "0x%04x\\\"", ",", "vlc", ",", "reg", ",", "data", ")", ";", "/*", "Disable", "autopolling", "before", "we", "can", "access", "MII", "*/", "velocity_autopoll_stop", "(", "vlc", ")", ";", "/*", "Send", "write", "command,", "data", "and", "destination", "register", "*/", "writeb", "(", "reg", ",", "vlc", "->", "regs", "+", "VELOCITY_MIIADDR", ")", ";", "writew", "(", "data", ",", "vlc", "->", "regs", "+", "VELOCITY_MIIDATA", ")", ";", "velocity_setbit", "(", "vlc", "->", "regs", "+", "VELOCITY_MIICR", ",", "VELOCITY_MIICR_WCMD", ")", ";", "/*", "Wait", "for", "write", "to", "complete", "*/", "while", "(", "timeout", "--", ")", "{", "udelay", "(", "1", ")", ";", "if", "(", "(", "readb", "(", "vlc", "->", "regs", "+", "VELOCITY_MIICR", ")", "&", "VELOCITY_MIICR_WCMD", ")", "==", "0", ")", "{", "velocity_autopoll_start", "(", "vlc", ")", ";", "return", "0", ";", "}", "}", "/*", "Restart", "autopolling", "*/", "velocity_autopoll_start", "(", "vlc", ")", ";", "DBGC", "(", "vlc", ",", "\"MII", "write", "timeout\\\"", ")", ";", "return", "-", "ETIMEDOUT", ";", "}'" ]
velocity_mii_write
ipxe/ipxe
multi_line
train
995
1,238
[ "Poll", "for", "completed", "and", "received", "packets" ]
[ "'static", "void", "velocity_poll", "(", "struct", "net_device", "*", "netdev", ")", "{", "struct", "velocity_nic", "*", "vlc", "=", "netdev", "->", "priv", ";", "uint8_t", "isr1", ";", "isr1", "=", "readb", "(", "vlc", "->", "regs", "+", "VELOCITY_ISR1", ")", ";", "/*", "ACK", "interrupts", "*/", "writew", "(", "0xFFFF", ",", "vlc", "->", "regs", "+", "VELOCITY_ISR0", ")", ";", "/*", "Check", "for", "competed", "packets", "*/", "velocity_poll_rx", "(", "vlc", ")", ";", "velocity_poll_tx", "(", "vlc", ")", ";", "if", "(", "isr1", "&", "VELOCITY_ISR1_SRCI", ")", "{", "/*", "Update", "linkstate", "*/", "DBGC2", "(", "vlc", ",", "\"VELOCITY", "%p", "link", "status", "interrupt\\\"", ",", "vlc", ")", ";", "velocity_check_link", "(", "netdev", ")", ";", "}", "velocity_refill_rx", "(", "vlc", ")", ";", "/*", "deal", "with", "potential", "RX", "stall", "caused", "by", "RX", "ring", "underrun", "*/", "writew", "(", "VELOCITY_RXQCSR_RUN", "|", "VELOCITY_RXQCSR_WAK", ",", "vlc", "->", "regs", "+", "VELOCITY_RXQCSRS", ")", ";", "}'" ]
velocity_poll
ipxe/ipxe
multi_line
train
996
1,239
[ "Enable", "or", "disable", "interrupts" ]
[ "'static", "void", "velocity_irq", "(", "struct", "net_device", "*", "netdev", ",", "int", "enable", ")", "{", "struct", "velocity_nic", "*", "vlc", "=", "netdev", "->", "priv", ";", "DBGC", "(", "vlc", ",", "\"VELOCITY", "%p", "interrupts", "%s\\\"", ",", "vlc", ",", "enable", "?", "\"enable\"", ":", "\"disable\"", ")", ";", "if", "(", "enable", ")", "{", "/*", "Enable", "interrupts", "*/", "writeb", "(", "VELOCITY_CR3_GINTMSK1", ",", "vlc", "->", "regs", "+", "VELOCITY_CRS3", ")", ";", "}", "else", "{", "/*", "Disable", "interrupts", "*/", "writeb", "(", "VELOCITY_CR3_GINTMSK1", ",", "vlc", "->", "regs", "+", "VELOCITY_CRC3", ")", ";", "}", "}'" ]
velocity_irq
ipxe/ipxe
multi_line
train
997
1,240
[ "Generates", "a", "candidate", "encoded", "frame", "given", "a", "picture", "and", "metadata" ]
[ "'static", "WebPEncodingError", "EncodeCandidate", "(", "WebPPicture", "*", "const", "sub_frame", ",", "const", "FrameRectangle", "*", "const", "rect", ",", "const", "WebPConfig", "*", "const", "encoder_config", ",", "int", "use_blending", ",", "Candidate", "*", "const", "candidate", ")", "{", "WebPConfig", "config", "=", "*", "encoder_config", ";", "WebPEncodingError", "error_code", "=", "VP8_ENC_OK", ";", "assert", "(", "candidate", "!=", "NULL", ")", ";", "memset", "(", "candidate", ",", "0", ",", "sizeof", "(", "*", "candidate", ")", ")", ";", "//", "Set", "frame", "rect", "and", "info.", "candidate", "->", "rect_", "=", "*", "rect", ";", "candidate", "->", "info_", ".", "id", "=", "WEBP_CHUNK_ANMF", ";", "candidate", "->", "info_", ".", "x_offset", "=", "rect", "->", "x_offset_", ";", "candidate", "->", "info_", ".", "y_offset", "=", "rect", "->", "y_offset_", ";", "candidate", "->", "info_", ".", "dispose_method", "=", "WEBP_MUX_DISPOSE_NONE", ";", "//", "Set", "later.", "candidate", "->", "info_", ".", "blend_method", "=", "use_blending", "?", "WEBP_MUX_BLEND", ":", "WEBP_MUX_NO_BLEND", ";", "candidate", "->", "info_", ".", "duration", "=", "0", ";", "//", "Set", "in", "next", "call", "to", "WebPAnimEncoderAdd().", "//", "Encode", "picture.", "WebPMemoryWriterInit", "(", "&", "candidate", "->", "mem_", ")", ";", "if", "(", "!", "config", ".", "lossless", "&&", "use_blending", ")", "{", "//", "Disable", "filtering", "to", "avoid", "blockiness", "in", "reconstructed", "frames", "at", "the", "//", "time", "of", "decoding.", "config", ".", "autofilter", "=", "0", ";", "config", ".", "filter_strength", "=", "0", ";", "}", "if", "(", "!", "EncodeFrame", "(", "&", "config", ",", "sub_frame", ",", "&", "candidate", "->", "mem_", ")", ")", "{", "error_code", "=", "sub_frame", "->", "error_code", ";", "goto", "Err", ";", "}", "candidate", "->", "evaluate_", "=", "1", ";", "return", "error_code", ";", "Err", ":", "WebPMemoryWriterClear", "(", "&", "candidate", "->", "mem_", ")", ";", "return", "error_code", ";", "}'" ]
EncodeCandidate
DanBloomberg/leptonica
double_slash
train
998
1,241
[ "Release", "the", "data", "contained", "by", "'encoded_frame'" ]
[ "'static", "void", "FrameRelease", "(", "EncodedFrame", "*", "const", "encoded_frame", ")", "{", "if", "(", "encoded_frame", "!=", "NULL", ")", "{", "WebPDataClear", "(", "&", "encoded_frame", "->", "sub_frame_", ".", "bitstream", ")", ";", "WebPDataClear", "(", "&", "encoded_frame", "->", "key_frame_", ".", "bitstream", ")", ";", "memset", "(", "encoded_frame", ",", "0", ",", "sizeof", "(", "*", "encoded_frame", ")", ")", ";", "}", "}'" ]
FrameRelease
DanBloomberg/leptonica
double_slash
train
999