Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xtlsoft/zephir-c-call
An extension that allows you to call C functions in Zephir.
https://github.com/xtlsoft/zephir-c-call
Last synced: 2 days ago
JSON representation
An extension that allows you to call C functions in Zephir.
- Host: GitHub
- URL: https://github.com/xtlsoft/zephir-c-call
- Owner: xtlsoft
- License: mit
- Created: 2019-07-25T05:34:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-25T06:09:13.000Z (over 5 years ago)
- Last Synced: 2024-04-17T18:06:17.291Z (7 months ago)
- Language: PHP
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zephir C Call
An extension that allows you to call C functions in Zephir.
## Installation
If your zephir is installed in project scope:
```php
composer require xtlsoft/zephir-c-call
```If your zephir is installed in global scope:
```php
composer g require xtlsoft/zephir-c-call
```If your zephir was installed as zephir.phar:
You need to re-pack the zephir.phar file.
## Usage
You can call `c_include`, `c_call`, `c_runf` functions from Zephir.
### c_include
```php
c_include(string filename);
```The filename must be a literal. Don't use the return value.
### c_call
```php
c_call(
string ret_type, string func_name,
[string param1_type, string param1_value,
[string param2_type, string param2_value,
[string...
);
````type` can be one of `int`, `long`, `double`, `float`, `string`.
except values, all types and func_names should be literals.
### c_runf
```php
c_runf(
string ret_type, string expr,
[string arg1, [string arg2, [string arg3...
);
```ret_type and expr must be literals.
You can access the arguments using \${1}, \${2}, \${3}... in expr.
All arguments are `zval*` typed.