php-gnupg/php_gnupg.h

107 lines
2.8 KiB
C
Raw Normal View History

2005-10-07 18:59:50 +00:00
/*
+--------------------------------------------------------------------+
| PECL :: gnupg |
+--------------------------------------------------------------------+
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
| Copyright (c) 2006, Thilo Raufeisen <traufeisen@php.net> |
2013-07-08 14:11:30 +00:00
| Copyright (c) 2013, Jim Jagielski <jimjag@php.net> |
+--------------------------------------------------------------------+
2005-10-07 18:59:50 +00:00
*/
/* $Id$ */
#ifndef PHP_GNUPG_H
#define PHP_GNUPG_H
extern zend_module_entry gnupg_module_entry;
#define phpext_gnupg_ptr &gnupg_module_entry
2015-02-11 18:10:16 +00:00
#define PHP_GNUPG_VERSION "1.3.6"
2005-10-07 18:59:50 +00:00
#ifdef PHP_WIN32
#define PHP_GNUPG_API __declspec(dllexport)
#else
#define PHP_GNUPG_API
#endif
#ifdef ZTS
#include "TSRM.h"
#endif
#include <gpgme.h>
typedef struct gnupg_object{
2005-10-07 18:59:50 +00:00
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;
2005-10-07 18:59:50 +00:00
} gnupg_object;
2013-07-17 13:00:21 +00:00
static zend_class_entry *gnupg_class_entry;
2005-10-07 18:59:50 +00:00
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)));
}
/* }}} */
2005-10-07 18:59:50 +00:00
PHP_MINIT_FUNCTION(gnupg);
PHP_MSHUTDOWN_FUNCTION(gnupg);
PHP_MINFO_FUNCTION(gnupg);
PHP_FUNCTION(gnupg_keyinfo);
PHP_FUNCTION(gnupg_verify);
PHP_FUNCTION(gnupg_geterror);
PHP_FUNCTION(gnupg_setsignmode);
PHP_FUNCTION(gnupg_setarmor);
PHP_FUNCTION(gnupg_sign);
PHP_FUNCTION(gnupg_clearsignkeys);
PHP_FUNCTION(gnupg_clearencryptkeys);
PHP_FUNCTION(gnupg_cleardecryptkeys);
2005-10-07 18:59:50 +00:00
PHP_FUNCTION(gnupg_getprotocol);
PHP_FUNCTION(gnupg_encrypt);
PHP_FUNCTION(gnupg_encryptsign);
2005-10-07 18:59:50 +00:00
PHP_FUNCTION(gnupg_decrypt);
PHP_FUNCTION(gnupg_decryptverify);
2005-10-07 18:59:50 +00:00
PHP_FUNCTION(gnupg_export);
PHP_FUNCTION(gnupg_import);
PHP_FUNCTION(gnupg_init);
PHP_FUNCTION(gnupg_addsignkey);
PHP_FUNCTION(gnupg_addencryptkey);
PHP_FUNCTION(gnupg_adddecryptkey);
PHP_FUNCTION(gnupg_deletekey);
PHP_FUNCTION(gnupg_gettrustlist);
PHP_FUNCTION(gnupg_listsignatures);
PHP_FUNCTION(gnupg_seterrormode);
2005-10-07 18:59:50 +00:00
#ifdef ZTS
#define GNUPG_G(v) TSRMG(gnupg_globals_id, zend_gnupg_globals *, v)
#else
#define GNUPG_G(v) (gnupg_globals.v)
#endif
#endif /* PHP_GNUPG_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/