Make initial port to phpc

This commit is contained in:
Jakub Zelenka 2016-05-21 21:27:06 +01:00
parent 30fab6eaf9
commit fdf573ac73
5 changed files with 321 additions and 303 deletions

4
.gitignore vendored
View file

@ -63,6 +63,10 @@ tests/*.log
tests/*.out
tests/*.php
tests/*.sh
tests/pubring.kbx
tests/random_seed
tests/sshcontrol
tests/trustdb.gpg
# coverage
/coverage.info

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "phpc"]
path = phpc
url = https://github.com/bukka/phpc

584
gnupg.c

File diff suppressed because it is too large Load diff

View file

@ -32,32 +32,22 @@ extern zend_module_entry gnupg_module_entry;
#endif
#include <gpgme.h>
#include "phpc/phpc.h"
typedef struct gnupg_object{
PHPC_OBJ_STRUCT_BEGIN(gnupg)
gpgme_ctx_t ctx;
gpgme_error_t err;
int errormode;
char* errortxt;
int signmode;
gpgme_key_t *encryptkeys;
unsigned int encrypt_size;
HashTable *signkeys;
HashTable *decryptkeys;
zend_object zo;
} gnupg_object;
gpgme_error_t err;
int errormode;
char* errortxt;
int signmode;
gpgme_key_t *encryptkeys;
unsigned int encrypt_size;
HashTable *signkeys;
HashTable *decryptkeys;
PHPC_OBJ_STRUCT_END()
static zend_class_entry *gnupg_class_entry;
static inline gnupg_object *gnupg_object_from_obj(zend_object *obj) /* {{{ */ {
return (gnupg_object*)((char*)(obj) - XtOffsetOf(gnupg_object, zo));
}
/* }}} */
static inline gnupg_object *Z_GNUPGO_P(zval *zv) /* {{{ */ {
return gnupg_object_from_obj(Z_OBJ_P((zv)));
}
/* }}} */
PHP_MINIT_FUNCTION(gnupg);
PHP_MSHUTDOWN_FUNCTION(gnupg);
PHP_MINFO_FUNCTION(gnupg);

1
phpc Submodule

@ -0,0 +1 @@
Subproject commit 28b8bdf2a78a31772a325099806eb984ac9063ea