rustcodegraph 1.2.10

Local-first code intelligence graph and CLI for AI agents
Documentation
//! Native-language built-in allowlists.
//!
//! Pascal/C/C++ 的标准库和运行时名字很容易与项目函数重名;这些表让解析器在
//! 命中内建时停下,保持图只表示项目内可追踪代码。

pub(super) const PASCAL_UNIT_PREFIXES: &[&str] = &[
    "System.",
    "Winapi.",
    "Vcl.",
    "Fmx.",
    "Data.",
    "Datasnap.",
    "Soap.",
    "Xml.",
    "Web.",
    "REST.",
    "FireDAC.",
    "IBX.",
    "IdHTTP",
    "IdTCP",
    "IdSSL",
];

pub(super) const PASCAL_BUILT_INS: &[&str] = &[
    "System",
    "SysUtils",
    "Classes",
    "Types",
    "Variants",
    "StrUtils",
    "Math",
    "DateUtils",
    "IOUtils",
    "Generics.Collections",
    "Generics.Defaults",
    "Rtti",
    "TypInfo",
    "SyncObjs",
    "RegularExpressions",
    "SysInit",
    "Windows",
    "Messages",
    "Graphics",
    "Controls",
    "Forms",
    "Dialogs",
    "StdCtrls",
    "ExtCtrls",
    "ComCtrls",
    "Menus",
    "ActnList",
    "WriteLn",
    "Write",
    "ReadLn",
    "Read",
    "Inc",
    "Dec",
    "Ord",
    "Chr",
    "Length",
    "SetLength",
    "High",
    "Low",
    "Assigned",
    "FreeAndNil",
    "Format",
    "IntToStr",
    "StrToInt",
    "FloatToStr",
    "StrToFloat",
    "Trim",
    "UpperCase",
    "LowerCase",
    "Pos",
    "Copy",
    "Delete",
    "Insert",
    "Now",
    "Date",
    "Time",
    "DateToStr",
    "StrToDate",
    "Raise",
    "Exit",
    "Break",
    "Continue",
    "Abort",
    "True",
    "False",
    "nil",
    "Self",
    "Result",
    "Create",
    "Destroy",
    "Free",
    "TObject",
    "TComponent",
    "TPersistent",
    "TInterfacedObject",
    "TList",
    "TStringList",
    "TStrings",
    "TStream",
    "TMemoryStream",
    "TFileStream",
    "Exception",
    "EAbort",
    "EConvertError",
    "EAccessViolation",
    "IInterface",
    "IUnknown",
];

pub(super) const C_BUILT_INS: &[&str] = &[
    // 包含常见 libc、POSIX 和基础类型/宏;用于降低 C 项目里外部符号误解析。
    "printf",
    "fprintf",
    "sprintf",
    "snprintf",
    "scanf",
    "fscanf",
    "sscanf",
    "malloc",
    "calloc",
    "realloc",
    "free",
    "memcpy",
    "memmove",
    "memset",
    "memcmp",
    "memchr",
    "strlen",
    "strcpy",
    "strncpy",
    "strcat",
    "strncat",
    "strcmp",
    "strncmp",
    "strstr",
    "strchr",
    "strrchr",
    "strtok",
    "strdup",
    "fopen",
    "fclose",
    "fread",
    "fwrite",
    "fgets",
    "fputs",
    "fputc",
    "fgetc",
    "feof",
    "ferror",
    "fflush",
    "fseek",
    "ftell",
    "rewind",
    "exit",
    "abort",
    "atexit",
    "atoi",
    "atol",
    "atof",
    "strtol",
    "strtoul",
    "strtod",
    "qsort",
    "bsearch",
    "abs",
    "labs",
    "rand",
    "srand",
    "sin",
    "cos",
    "tan",
    "sqrt",
    "pow",
    "log",
    "log10",
    "exp",
    "ceil",
    "floor",
    "fabs",
    "time",
    "clock",
    "difftime",
    "mktime",
    "localtime",
    "gmtime",
    "strftime",
    "asctime",
    "assert",
    "errno",
    "perror",
    "remove",
    "rename",
    "tmpfile",
    "tmpnam",
    "getenv",
    "system",
    "signal",
    "raise",
    "setjmp",
    "longjmp",
    "va_start",
    "va_end",
    "va_arg",
    "va_copy",
    "NULL",
    "EOF",
    "BUFSIZ",
    "FILENAME_MAX",
    "RAND_MAX",
    "EXIT_SUCCESS",
    "EXIT_FAILURE",
    "size_t",
    "ptrdiff_t",
    "wchar_t",
    "intptr_t",
    "uintptr_t",
    "int8_t",
    "int16_t",
    "int32_t",
    "int64_t",
    "uint8_t",
    "uint16_t",
    "uint32_t",
    "uint64_t",
    "FILE",
    "stat",
    "lstat",
    "fstat",
    "open",
    "close",
    "read",
    "write",
    "pipe",
    "fork",
    "exec",
    "waitpid",
    "getpid",
    "getppid",
    "kill",
    "sleep",
    "usleep",
    "pthread_create",
    "pthread_join",
    "pthread_mutex_lock",
    "pthread_mutex_unlock",
    "dlopen",
    "dlsym",
    "dlclose",
];

pub(super) const CPP_BUILT_INS: &[&str] = &[
    // C++ 额外补 STL 命名空间、cast 和智能指针工具等高频内建。
    "cout",
    "cin",
    "cerr",
    "clog",
    "endl",
    "flush",
    "ws",
    "std",
    "nullptr",
    "true",
    "false",
    "this",
    "sizeof",
    "alignof",
    "typeid",
    "static_cast",
    "dynamic_cast",
    "reinterpret_cast",
    "const_cast",
    "make_unique",
    "make_shared",
    "make_pair",
    "move",
    "forward",
    "swap",
];