MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lang_res_bytes

Function lang_res_bytes

src/discover/language.c:1421–1424  ·  view source on GitHub ↗

Disambiguate .res files (#2176): ReScript source shares the extension with * two binary formats -- Godot resources (RSRC/RSCC magic, the default save * format for imported meshes) and Windows compiled resource files. Binary * content has no ReScript meaning, and a NUL byte never occurs in ReScript * text while both binary formats carry NULs in their first bytes. */

Source from the content-addressed store, hash-verified

1419 * content has no ReScript meaning, and a NUL byte never occurs in ReScript
1420 * text while both binary formats carry NULs in their first bytes. */
1421static CBMLanguage lang_res_bytes(const unsigned char *head, size_t n) {
1422 size_t len = n < LANG_PROBE_HEAD ? n : LANG_PROBE_HEAD;
1423 return (len > 0 && memchr(head, '\0', len)) ? CBM_LANG_COUNT : CBM_LANG_RESCRIPT;
1424}
1425
1426CBMLanguage cbm_disambiguate_res(const char *path) {
1427 unsigned char head[LANG_PROBE_HEAD];

Callers 2

cbm_disambiguate_resFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected