-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
45c0a82
commit 8b63803
Showing
51 changed files
with
1,081 additions
and
518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,27 @@ | ||
.. _reference-capi_macros: | ||
|
||
Defined Macros | ||
============== | ||
|
||
|
||
|
||
.. c:macro:: _Cp_Name(name) | ||
Appends the name of the C module to the given name. For example, if the given | ||
name is :code:`"foo"`, the returned name is :code:`"caterpillar._C.foo"`. | ||
|
||
|
||
.. c:function:: PyObject *CpObject_Create(PyObject *type, const char *format, ...) | ||
Creates an object of the given type using the given arguments and returns it. | ||
Returns *NULL* if an error occurs. | ||
.. c:function:: PyObject *CpObject_CreateOneArgs(PyObject *type, PyObject *arg) | ||
Creates an object of the given type using the given argument and returns it. | ||
Returns *NULL* if an error occurs. | ||
.. c:function:: PyObject *CpObject_CreateNoArgs(PyObject *type) | ||
Creates an object of the given type and returns it. Returns *NULL* if an error occurs. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,96 @@ | ||
.. _reference-capi_module: | ||
|
||
********** | ||
Module API | ||
********** | ||
|
||
|
||
.. c:var:: PyModuleDef CpModule; | ||
Global module object for the Caterpillar C module. | ||
|
||
|
||
.. c:function:: inline _modulestate *get_module_state(PyObject *module) | ||
Returns the :c:type:`_modulestate` for the given module. | ||
.. c:function:: inline _modulestate *get_global_module_state(void) | ||
Returns the :c:type:`_modulestate` using the global caterpillar module object. | ||
.. c:struct:: _modulestate | ||
The internal state for this module. It will store all necessary information | ||
about the core module. | ||
Global options: | ||
.. c:member:: PyObject* cp_option__dynamic; | ||
PyObject* cp_option__sequential; | ||
PyObject* cp_option__keep_position; | ||
PyObject* cp_option__union; | ||
PyObject* cp_option__eval; | ||
PyObject* cp_option__discard_unnamed; | ||
PyObject* cp_option__discard_const; | ||
PyObject* cp_option__replace_types; | ||
PyObject* cp_option__slots; | ||
Global default options: | ||
.. c:member:: PyObject* cp_option__global_field_options; | ||
PyObject* cp_option__global_struct_options; | ||
Global arch and endian: | ||
.. c:member:: PyObject* cp_arch__host; | ||
PyObject* cp_endian__native; | ||
PyObject* cp_endian__big; | ||
PyObject* cp_endian__little; | ||
Typing constants: | ||
.. c:member:: PyObject* Any_Type; | ||
PyObject* List_Type; | ||
PyObject* Union_Type; | ||
PyObject* BytesIO_Type; | ||
String constants: | ||
.. c:member:: PyObject* str_path_delim = "."; | ||
PyObject* str_tell = "tell"; | ||
PyObject* str_seek = "seek"; | ||
PyObject* str_write = "write"; | ||
PyObject* str_read = "read"; | ||
PyObject* str_close = "close"; | ||
PyObject* str_strict = "strict"; | ||
PyObject* str___pack__ = "__pack__"; | ||
PyObject* str___pack_many__ = "__pack_many__"; | ||
PyObject* str___unpack__ = "__unpack__"; | ||
PyObject* str___unpack_many__ = "__unpack_many__"; | ||
PyObject* str___size__ = "__size__"; | ||
PyObject* str___type__ = "__type__"; | ||
PyObject* str___annotations__ = "__annotations__"; | ||
PyObject* str___mro__ = "__mro__"; | ||
PyObject* str___struct__ = "__struct__"; | ||
PyObject* str___slots__ = "__slots__"; | ||
PyObject* str___match_args__ = "__match_args__"; | ||
PyObject* str___weakref__ = "__weakref__"; | ||
PyObject* str___dict__ = "__dict__"; | ||
PyObject* str___qualname__ = "__qualname__"; | ||
PyObject* str_start = "start"; | ||
PyObject* str_ctx__root = "<root>"; | ||
PyObject* str_ctx__getattr = "__context_getattr__"; | ||
PyObject* str_bytesio_getvalue = "getvalue"; | ||
PyObject* str_builder_process = "process"; | ||
PyObject* str_pattern_match = "match"; | ||
.. c:macro:: CpModule_SetupType(op) | ||
Sets up the type object for the given module object. Expands to: | ||
.. code-block:: c | ||
if (PyType_Ready(op) < 0) | ||
return NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,53 @@ | ||
.. _capi_arch: | ||
|
||
Arch & Endian Objects | ||
===================== | ||
|
||
Arch Objects | ||
------------ | ||
|
||
.. c:var:: PyTypeObject CpArch_Type | ||
The type object for the :c:type:`CpArchObject` class. | ||
|
||
|
||
.. c:type:: CpArchObject | ||
*TODO* | ||
|
||
|
||
.. c:function:: int CpArch_CheckExact(PyObject *op) | ||
Checks if the given object is an :c:type:`CpArchObject`. | ||
.. c:function:: int CpArch_Check(PyObject *op) | ||
Checks if the given object is instance of an :c:type:`CpArchObject`. | ||
Endian Objects | ||
-------------- | ||
.. c:var:: PyTypeObject CpEndian_Type | ||
The type object for the :c:type:`CpEndianObject` class. | ||
.. c:type:: CpEndianObject | ||
*TODO* | ||
.. c:function:: int CpEndian_IsLittleEndian(CpEndianObject *endian, _modulestate *mod) | ||
Returns ``1`` if the current system is little-endian and ``0`` otherwise. | ||
.. c:function:: int CpEndian_CheckExact(PyObject *op) | ||
Checks if the given object is an :c:type:`CpEndianObject`. | ||
.. c:function:: int CpEndian_Check(PyObject *op) | ||
Checks if the given object is instance of an :c:type:`CpEndianObject` |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.