Skip to content
This repository was archived by the owner on Oct 30, 2020. It is now read-only.

Commit a3de131

Browse files
committed
Add new libdogma functions from 1.2.0.
1 parent dcc8449 commit a3de131

File tree

3 files changed

+62
-4
lines changed

3 files changed

+62
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ PHP bindings of the libdogma library.
66
Released under the GNU Affero General Public License, version 3 or
77
later. The full license text is included in the `COPYING` file.
88

9-
Requires libdogma ≥ 1.1.0 and pkg-config (and probably PHP ≥ 5.4 and a
9+
Requires libdogma ≥ 1.2.0 and pkg-config (and probably PHP ≥ 5.4 and a
1010
C11-aware compiler, like `clang ≥ 3.1` or `gcc ≥ 4.7`).
1111

1212
Main libdogma repository: https://github.com/Artefact2/libdogma

dogma.c

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* php-dogma
2-
* Copyright (C) 2013 Romain "Artefact2" Dalmaso <[email protected]>
2+
* Copyright (C) 2013, 2015 Romain "Artefact2" Dalmaso <[email protected]>
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU Affero General Public License as published by
@@ -63,6 +63,19 @@ ZEND_END_ARG_INFO()
6363

6464

6565

66+
ZEND_BEGIN_ARG_INFO(arginfo_add_area_beacon, 0)
67+
ZEND_ARG_INFO(0, context)
68+
ZEND_ARG_INFO(0, typeid)
69+
ZEND_ARG_INFO(1, key)
70+
ZEND_END_ARG_INFO()
71+
72+
ZEND_BEGIN_ARG_INFO(arginfo_remove_area_beacon, 0)
73+
ZEND_ARG_INFO(0, context)
74+
ZEND_ARG_INFO(0, key)
75+
ZEND_END_ARG_INFO()
76+
77+
78+
6679
ZEND_BEGIN_ARG_INFO(arginfo_add_implant, 0)
6780
ZEND_ARG_INFO(0, context)
6881
ZEND_ARG_INFO(0, typeid)
@@ -414,6 +427,9 @@ const zend_function_entry dogma_functions[] = {
414427
DEF_DOGMA_FE(free_context)
415428
DEF_DOGMA_FE(get_hashcode)
416429

430+
DEF_DOGMA_FE(add_area_beacon)
431+
DEF_DOGMA_FE(remove_area_beacon)
432+
417433
DEF_DOGMA_FE(add_implant)
418434
DEF_DOGMA_FE(remove_implant)
419435

@@ -497,7 +513,7 @@ zend_module_entry dogma_module_entry = {
497513
PHP_RINIT(dogma),
498514
PHP_RSHUTDOWN(dogma),
499515
PHP_MINFO(dogma),
500-
"1.1.0",
516+
"1.2.0",
501517
STANDARD_MODULE_PROPERTIES
502518
};
503519

@@ -696,6 +712,45 @@ ZEND_FUNCTION(dogma_get_hashcode) {
696712

697713

698714

715+
ZEND_FUNCTION(dogma_add_area_beacon) {
716+
zval* zctx;
717+
dogma_context_t* ctx;
718+
long implant;
719+
zval* zkey;
720+
dogma_key_t key;
721+
int ret;
722+
723+
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &zctx, &implant, &zkey) == FAILURE) {
724+
RETURN_FALSE;
725+
}
726+
GET_CTX(zctx, ctx);
727+
728+
ret = dogma_add_area_beacon(ctx, (dogma_typeid_t)implant, &key);
729+
convert_to_null(zkey);
730+
ZVAL_LONG(zkey, (long)key);
731+
732+
RETURN_LONG(ret);
733+
}
734+
735+
ZEND_FUNCTION(dogma_remove_area_beacon) {
736+
zval* zctx;
737+
dogma_context_t* ctx;
738+
long key;
739+
740+
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &zctx, &key) == FAILURE) {
741+
RETURN_FALSE;
742+
}
743+
GET_CTX(zctx, ctx);
744+
745+
RETURN_LONG(dogma_remove_area_beacon(ctx, (dogma_key_t)key));
746+
}
747+
748+
749+
750+
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
751+
752+
753+
699754
ZEND_FUNCTION(dogma_add_implant) {
700755
zval* zctx;
701756
dogma_context_t* ctx;

php_dogma.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* php-dogma
2-
* Copyright (C) 2013 Romain "Artefact2" Dalmaso <[email protected]>
2+
* Copyright (C) 2013, 2015 Romain "Artefact2" Dalmaso <[email protected]>
33
*
44
* This program is free software: you can redistribute it and/or modify
55
* it under the terms of the GNU Affero General Public License as published by
@@ -43,6 +43,9 @@ ZEND_FUNCTION(dogma_init_context);
4343
ZEND_FUNCTION(dogma_free_context);
4444
ZEND_FUNCTION(dogma_get_hashcode);
4545

46+
ZEND_FUNCTION(dogma_add_area_beacon);
47+
ZEND_FUNCTION(dogma_remove_area_beacon);
48+
4649
ZEND_FUNCTION(dogma_add_implant);
4750
ZEND_FUNCTION(dogma_remove_implant);
4851

0 commit comments

Comments
 (0)