module documentation

Get API information encoded in C files.

See find_function for how functions should be formatted, and read_order for how the order of the functions should be specified.

Class BoolValuesApi Undocumented
Class Function Undocumented
Class FunctionApi Undocumented
Class GlobalVarApi Undocumented
Class StealRef Undocumented
Class TypeApi Undocumented
Exception ParseError Undocumented
Function check_api_dict Check that an api dict is valid (does not use the same index twice).
Function file_in_this_dir Undocumented
Function find_functions Scan the file, looking for tagged functions.
Function fullapi_hash Given a list of api dicts defining the numpy C API, compute a checksum of the list of items in the API (as a string).
Function get_api_functions Parse source files to get functions tagged by the given tag.
Function get_versions_hash Undocumented
Function main Undocumented
Function merge_api_dicts Undocumented
Function order_dict Order dict by its values.
Function remove_whitespace Undocumented
Function should_rebuild Undocumented
Function skip_brackets Undocumented
Function split_arguments Undocumented
Function write_file Write data to filename Only write changed data to avoid updating timestamps unnecessarily
Constant API_FILES Undocumented
Constant THIS_DIR Undocumented
Constant VERRE Undocumented
Function _repl Undocumented
def check_api_dict(d): (source)

Check that an api dict is valid (does not use the same index twice).

def file_in_this_dir(filename): (source)

Undocumented

def find_functions(filename, tag='API'): (source)

Scan the file, looking for tagged functions.

Assuming tag=='API', a tagged function looks like:

/*API*/
static returntype*
function_name(argtype1 arg1, argtype2 arg2)
{
}

where the return type must be on a separate line, the function name must start the line, and the opening { must start the line.

An optional documentation comment in ReST format may follow the tag, as in:

/*API
  This function does foo...
 */
def fullapi_hash(api_dicts): (source)

Given a list of api dicts defining the numpy C API, compute a checksum of the list of items in the API (as a string).

def get_api_functions(tagname, api_dict): (source)

Parse source files to get functions tagged by the given tag.

def get_versions_hash(): (source)

Undocumented

def main(): (source)

Undocumented

def merge_api_dicts(dicts): (source)

Undocumented

def order_dict(d): (source)

Order dict by its values.

def remove_whitespace(s): (source)

Undocumented

def should_rebuild(targets, source_files): (source)

Undocumented

def skip_brackets(s, lbrac, rbrac): (source)

Undocumented

def split_arguments(argstr): (source)

Undocumented

def write_file(filename, data): (source)

Write data to filename Only write changed data to avoid updating timestamps unnecessarily

API_FILES = (source)

Undocumented

Value
[os.path.join(THIS_DIR, '..', 'src', a) for a in API_FILES]
THIS_DIR = (source)

Undocumented

Value
os.path.dirname(__file__)

Undocumented

Value
re.compile(r'(^0x[\da-f]{8})\s*=\s*([\da-f]{32})')
def _repl(str): (source)

Undocumented