Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat/can-fd
Browse files Browse the repository at this point in the history
# Conflicts:
#	.gitignore
  • Loading branch information
adamczykpiotr committed Sep 18, 2023
2 parents 8c4be7a + ed30c2c commit f3e42fe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ make install # installs extension in your system
- [x] CI for different PHP versions

## Links
* [CAN-Bus wikipedia](https:// en.wikipedia.org/wiki/CAN_bus)
* [Linux CAN utils](https:// github.com/linux-can/can-utils)
* [Raspberry PI + MCP2515](https:// forums.raspberrypi.com/viewtopic.php?t=141052), [Polish guide](http:// www.emvn.pl/can-bus-mcp2515-raspberrypi-socketcan/)
* [How to write PHP exntesion by ZEND](https:// www.zend.com/resources/writing-php-extensions)
* [PHP extension whitepaper](https:// www.zend.com/sites/zend/files/pdfs/whitepaper-zend-php-extensions.pdf)
* [PHP internals book](https:// www.phpinternalsbook.com/)
* [PHP Fast Parameter Parsing API](https:// wiki.php.net/rfc/fast_zpp) RFC From 2014, included in PHP 7.x (2015+)
* [2011 PHP extension guide](https:// kchodorow.com/2011/08/11/php-extensions-made-eldrich-php-variables/),
[Archive](https:// web.archive.org/web/20210416205006/https:// kchodorow.com/2011/08/11/php-extensions-made-eldrich-php-variables/) (uses old parameter parsing api)
* [Archive: 2005 PHP extension guide](http:// web.archive.org/web/20110222035803/http:// devzone.zend.com/article/1021) (uses old parameter parsing api)
* [Archive: PHP Documentation on internals](https:// web.archive.org/web/20200501034044/https:// www.php.net/manual/en/internals2.php)
* [CAN-Bus wikipedia](https://en.wikipedia.org/wiki/CAN_bus)
* [Linux CAN utils](https://github.com/linux-can/can-utils)
* [Raspberry PI + MCP2515](https://forums.raspberrypi.com/viewtopic.php?t=141052), [Polish guide](http://www.emvn.pl/can-bus-mcp2515-raspberrypi-socketcan/)
* [How to write PHP exntesion by ZEND](https://www.zend.com/resources/writing-php-extensions)
* [PHP extension whitepaper](https://www.zend.com/sites/zend/files/pdfs/whitepaper-zend-php-extensions.pdf)
* [PHP internals book](https://www.phpinternalsbook.com/)
* [PHP Fast Parameter Parsing API](https://wiki.php.net/rfc/fast_zpp) RFC From 2014, included in PHP 7.x (2015+)
* [2011 PHP extension guide](https://kchodorow.com/2011/08/11/php-extensions-made-eldrich-php-variables/),
[Archive](https://web.archive.org/web/20210416205006/https://kchodorow.com/2011/08/11/php-extensions-made-eldrich-php-variables/) (uses old parameter parsing api)
* [Archive: 2005 PHP extension guide](http://web.archive.org/web/20110222035803/http://devzone.zend.com/article/1021) (uses old parameter parsing api)
* [Archive: PHP Documentation on internals](https://web.archive.org/web/20200501034044/https://www.php.net/manual/en/internals2.php)

20 changes: 6 additions & 14 deletions canbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,8 @@ PHP_METHOD(CanFrame, __construct) {
/* }}} */

/* {{{ CanBus class registry */
static zend_class_entry *register_class_CanBus(void) {
zend_class_entry ce, *classEntry;

// Register class
INIT_CLASS_ENTRY(ce, "CanBus", class_CanBus_methods);
classEntry = zend_register_internal_class_ex(&ce, NULL);
static zend_class_entry *register_class_CanBus_with_members(void) {
zend_class_entry *classEntry = register_class_CanBus();

// Register member: public string $id = undefined
zval property_interface_default_value;
Expand All @@ -310,12 +306,8 @@ static zend_class_entry *register_class_CanBus(void) {
/* }}} */

/* {{{ CanFrame class registry */
static zend_class_entry *register_class_CanFrame(void) {
zend_class_entry ce, *classEntry;

// Register class
INIT_CLASS_ENTRY(ce, "CanFrame", class_CanFrame_methods);
classEntry = zend_register_internal_class(&ce);
static zend_class_entry *register_class_CanFrame_with_members(void) {
zend_class_entry *classEntry = register_class_CanFrame();

// Register member: public int $id = 0
zval id;
Expand Down Expand Up @@ -354,8 +346,8 @@ PHP_RINIT_FUNCTION(canbus){

/*{{{ PHP_MINIT_FUNCTION */
PHP_MINIT_FUNCTION(canbus) {
canBus_ce = register_class_CanBus();
canFrame_ce = register_class_CanFrame();
canBus_ce = register_class_CanBus_with_members();
canFrame_ce = register_class_CanFrame_with_members();

return SUCCESS;
}
Expand Down
20 changes: 20 additions & 0 deletions canbus_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,23 @@ static const zend_function_entry class_CanFrame_methods[] = {
ZEND_ME(CanFrame, __construct, arginfo_class_CanFrame___construct, ZEND_ACC_PUBLIC)
ZEND_FE_END
};

static zend_class_entry *register_class_CanBus(void)
{
zend_class_entry ce, *class_entry;

INIT_CLASS_ENTRY(ce, "CanBus", class_CanBus_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);

return class_entry;
}

static zend_class_entry *register_class_CanFrame(void)
{
zend_class_entry ce, *class_entry;

INIT_CLASS_ENTRY(ce, "CanFrame", class_CanFrame_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);

return class_entry;
}

0 comments on commit f3e42fe

Please sign in to comment.