Python repository containing parsed standard C library function and argument information
Python Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docker
.gitignore
.travis.yml
LICENSE
Makefile
README.md
funcparser.py
functions.py
missing.sh
missing.txt
requirements.txt
script.py
source.c
tox.ini

README.md

functions

Python repository containing parsed standard C library function and argument information

How do I use it?

I already did the heavy lifting for you, just look at functions.py.

If you want to build it yourself, just clone the repo and make clean all.

Things will probably blow up, which is why I included a Dockerfile. You can build with make release.

Example

>>> from functions import functions
>>> print functions['memcpy']
Function(type='void', derefcnt=1, name='memcpy', args=[Argument(type='void', derefcnt=1, name='dest'), Argument(type='void', derefcnt=1, name='src'), Argument(type='size_t', derefcnt=0, name='n')])
>>> print functions['memcpy'].args
[Argument(type='void', derefcnt=1, name='dest'), Argument(type='void', derefcnt=1, name='src'), Argument(type='size_t', derefcnt=0, name='n')]
>>> print functions['memcpy'].args[0]
Argument(type='void', derefcnt=1, name='dest')
>>> print functions['memcpy'].type
void
>>> print functions['memcpy'].derefcnt
1

Notes

Basically we just pass everything to PyCParser and extract all functions and arguments, as well as their types.

Some syscalls are not in any standard C headers, so these have been added to missing.txt. The signatures are manually (pun!) extracted from the man pages.