Beyond basic pattern matching, qi tracks rich metadata about every symbol. These filters enable greater precision.
Find member access, method calls, and struct/class fields:
qi count -p patterns # Find patterns->count or patterns.count
qi 'field%' -p 'config%' # All fields accessed on config objects
qi init -p User # Find User->init or User.init methods
qi '*' -p 'request%' --limit 20 # All members of request-like objectsHow it works: Tracks the parent in expressions like obj->field, obj.method(), array[i].field
Filter by type declarations (for refactoring):
qi '*' -i arg -t 'int *' # All int pointer arguments
qi '*' -i var -t 'char *' # All char pointer variables
qi '*' -i arg -t 'OldType%' # Find args using deprecated types
qi '*' -t 'uint32_t' --limit 20 # All uint32_t usageUse case: Type-based refactoring, finding all uses of a specific type
Filter by access modifiers and storage classes:
qi '*' -i func -m static --limit 10 # All static functions
qi '*' -i var -m const # All const variables
qi '*' -m private # Private members
qi '*' -m inline -i func # Inline functionsUse case: Understanding code visibility, finding optimization candidates
Filter by visibility scope:
qi '*' -s public -i func # Public API functions
qi '*' -s private -i prop # Private properties
qi method -s protected # Protected methodsUse case: API analysis, understanding encapsulation
Search only within specific functions or classes:
qi malloc --within handle_request # malloc calls only in handle_request
qi fprintf --within 'debug%' # fprintf in debug-related functions
qi strcmp --within parse_args # strcmp only in parse_args
qi '*' -i var --within main # All variables declared in mainUse case: Understanding local behavior, debugging specific functions
Stack filters for maximum precision:
# Find static int pointer arguments in memory functions
qi '*' -i arg -t 'int *' -m static --within 'mem*'
# Find private fields accessed on config objects
qi '*' -p config -s private -i prop
# Find all malloc calls in static helper functions
qi malloc -i call --within '*helper*' -m staticPro tip: Use -v (verbose) to see all available columns, then craft precise queries