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.

Constant API​_FILES Undocumented
Constant THIS​_DIR Undocumented
Constant VERRE Undocumented
Class ​Bool​Values​Api Undocumented
Class ​Function Undocumented
Class ​Function​Api Undocumented
Class ​Global​Var​Api Undocumented
Class ​Non​Null Undocumented
Class ​Parse​Error Undocumented
Class ​Steal​Ref Undocumented
Class ​Type​Api Undocumented
Function ​_repl 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
API_FILES =

Undocumented

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

Undocumented

Value
os.path.dirname(__file__)
VERRE =

Undocumented

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

Undocumented

def check_api_dict(d):
Check that an api dict is valid (does not use the same index twice).
def file_in_this_dir(filename):

Undocumented

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

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):
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):
Parse source files to get functions tagged by the given tag.
def get_versions_hash():

Undocumented

def main():

Undocumented

def merge_api_dicts(dicts):

Undocumented

def order_dict(d):
Order dict by its values.
def remove_whitespace(s):

Undocumented

def should_rebuild(targets, source_files):

Undocumented

def skip_brackets(s, lbrac, rbrac):

Undocumented

def split_arguments(argstr):

Undocumented

def write_file(filename, data):
Write data to filename Only write changed data to avoid updating timestamps unnecessarily