forked from hpyproject/hpy
-
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.
Merge pull request hpyproject#253 from steve-s/ss/fix-docs1
Make the documentation up to date with the API changes
- Loading branch information
Showing
12 changed files
with
322 additions
and
98 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from setuptools import setup, Extension | ||
from os import path | ||
|
||
setup( | ||
name="hpy-mixed-example", | ||
hpy_ext_modules=[ | ||
Extension('mixed', sources=[path.join(path.dirname(__file__), 'mixed.c')]), | ||
], | ||
setup_requires=['hpy'], | ||
) |
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,10 @@ | ||
from setuptools import setup, Extension | ||
from os import path | ||
|
||
setup( | ||
name="hpy-simple-example", | ||
hpy_ext_modules=[ | ||
Extension('simple', sources=[path.join(path.dirname(__file__), 'simple.c')]), | ||
], | ||
setup_requires=['hpy'], | ||
) |
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,39 @@ | ||
/* Simple C module that defines single simple function "myabs". | ||
* We need to have a separate standalone package for those snippets, because we | ||
* want to show the source code in its entirety, including the HPyDef array | ||
* initialization, the module definition, and the setup.py script, so there is | ||
* no room left for mixing these code snippets with other code snippets. | ||
*/ | ||
|
||
// BEGIN: myabs | ||
#include "hpy.h" | ||
|
||
HPyDef_METH(myabs, "myabs", myabs_impl, HPyFunc_O) | ||
static HPy myabs_impl(HPyContext *ctx, HPy self, HPy arg) | ||
{ | ||
return HPy_Absolute(ctx, arg); | ||
} | ||
// END: myabs | ||
|
||
// BEGIN: methodsdef | ||
static HPyDef *SimpleMethods[] = { | ||
&myabs, | ||
NULL, | ||
}; | ||
|
||
static HPyModuleDef simple = { | ||
HPyModuleDef_HEAD_INIT, | ||
.m_name = "simple", | ||
.m_doc = "HPy Example", | ||
.m_size = -1, | ||
.defines = SimpleMethods, | ||
.legacy_methods = NULL | ||
}; | ||
// END: methodsdef | ||
|
||
// BEGIN: moduledef | ||
HPy_MODINIT(simple) | ||
HPy init_simple_impl(HPyContext *ctx) { | ||
return HPyModule_Create(ctx, &simple); | ||
} | ||
// END: moduledef |
Oops, something went wrong.