<commit_before>/*
+----------------------------------------------------------------------+
| See LICENSE file for further copyright information                   |
+----------------------------------------------------------------------+
| Authors: <NAME> <<EMAIL>>                                  |
+----------------------------------------------------------------------+
*/

#ifndef PHP_XCOM_H
#define PHP_XCOM_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"

#ifdef PHP_WIN32
#include "win32/time.h"
#endif

#include <pthread.h>

#include "SAPI.h"
#include "zend_API.h"
#include "zend_variables.h"
#include "ext/standard/head.h"
#include "php_globals.h"
#include "php_main.h"
#include "php_ini.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_rand.h"
#include "ext/standard/php_smart_str.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_versioning.h"
#include "ext/standard/url.h"
#include "php_variables.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "php_globals.h"
#include "ext/standard/file.h"
#include "ext/standard/base64.h"
#include "ext/standard/php_lcg.h"
#include "ext/pcre/php_pcre.h"
#include "php_network.h"

#include <curl/curl.h>
#include <avro.h>
#include <avro/io.h>

#define CLEANUP_CURL_AND_FORM(f,h)  \
    curl_easy_cleanup(h); \
curl_formfree(f);

#ifndef Z_ADDREF_P
#define Z_ADDREF_P(pz) (++(pz)->refcount)
#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
#endif

#ifndef Z_DELREF_P
#define Z_DELREF_P(pz) (--(pz)->refcount)
#endif

#if ZEND_MODULE_API_NO >= 20100409
#ifndef ZEND_ENGINE_2_4
#define ZEND_ENGINE_2_4
#endif
#endif

#define PHP_XCOM_VERSION "1.0.0"

#ifdef ZEND_ENGINE_2_4
# define XCOM_READ_PROPERTY(_obj, _mem, _type) zend_get_std_object_handlers()->read_property(_obj, _mem, _type, key TSRMLS_CC)
# define XCOM_WRITE_PROPERTY(_obj, _mem, _val) zend_get_std_object_handlers()->write_property(_obj, _mem, _val, key TSRMLS_CC)
#else
# define XCOM_READ_PROPERTY(_obj, _mem, _type) zend_get_std_object_handlers()->read_property(_obj, _mem, _type TSRMLS_CC)
# define XCOM_WRITE_PROPERTY(_obj, _mem, _val) zend_get_std_object_handlers()->write_property(_obj, _mem, _val TSRMLS_CC)
#endif

#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || PHP_MAJOR_VERSION > 5
# define XCOM_ARGINFO
# define XCOM_IS_CALLABLE_CC TSRMLS_CC
#else
# define XCOM_ARGINFO static
# define XCOM_IS_CALLABLE_CC
#endif

#define XCOM_ME(func, arg_info, flags) PHP_ME(xcom, func, arg_info, flags)
#define XCOM_METHOD(func) PHP_METHOD(xcom, func)

#define __stringify_1(x)    #x
#define __stringify(x)      __stringify_1(x)
#define __XCOM_EXT_VER PHP_XCOM_VERSION
#define XCOM_EXT_VER __stringify(__XCOM_EXT_VER)
#define XCOM_USER_AGENT "PECL-XCom/" __stringify(__XCOM_EXT_VER)
#define XCOM_HTTP_PORT 80
#define XCOM_HTTPS_PORT 443
#define XCOM_MAX_HEADER_LEN 512L
#define XCOM_FABRIC_PRODUCTION "https://api.x.com/fabric/"
#define XCOM_FABRIC_SANDBOX "https://api.sandbox.x.com/fabric/"

extern zend_module_entry xcom_module_entry;

#define phpext_xcom_ptr &oauth_module_entry

#define PHP_XCOM_API

#define XCOM_HTTP_METHOD_POST "POST"

#define XCOM_SSLCHECK_NONE 0
#define XCOM_SSLCHECK_HOST 1
#define XCOM_SSLCHECK_PEER 2
#define XCOM_SSLCHECK_BOTH (OAUTH_SSLCHECK_HOST | OAUTH_SSLCHECK_PEER)

/* errors */
#define XCOM_ERR_BAD_REQUEST 400
#define XCOM_ERR_BAD_AUTH 401
#define XCOM_ERR_INTERNAL_ERROR 503

/* values */
#define XCOM_CALLBACK_OOB "oob"

#define XCOM_PARAM_PREFIX "xcom_"
#define XCOM_PARAM_PREFIX_LEN 6

#ifdef ZTS
#include "TSRM.h"<commit_msg>Fix wrong module entry name<commit_after>/*
+----------------------------------------------------------------------+
| See LICENSE file for further copyright information                   |
+----------------------------------------------------------------------+
| Authors: <NAME> <<EMAIL>>                                  |
+----------------------------------------------------------------------+
*/

#ifndef PHP_XCOM_H
#define PHP_XCOM_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"

#ifdef PHP_WIN32
#include "win32/time.h"
#endif

#include <pthread.h>

#include "SAPI.h"
#include "zend_API.h"
#include "zend_variables.h"
#include "ext/standard/head.h"
#include "php_globals.h"
#include "php_main.h"
#include "php_ini.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_rand.h"
#include "ext/standard/php_smart_str.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "ext/standard/php_versioning.h"
#include "ext/standard/url.h"
#include "php_variables.h"
#include "zend_exceptions.h"
#include "zend_interfaces.h"
#include "php_globals.h"
#include "ext/standard/file.h"
#include "ext/standard/base64.h"
#include "ext/standard/php_lcg.h"
#include "ext/pcre/php_pcre.h"
#include "php_network.h"

#include <curl/curl.h>
#include <avro.h>
#include <avro/io.h>

#define CLEANUP_CURL_AND_FORM(f,h)  \
    curl_easy_cleanup(h); \
curl_formfree(f);

#ifndef Z_ADDREF_P
#define Z_ADDREF_P(pz) (++(pz)->refcount)
#define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
#endif

#ifndef Z_DELREF_P
#define Z_DELREF_P(pz) (--(pz)->refcount)
#endif

#if ZEND_MODULE_API_NO >= 20100409
#ifndef ZEND_ENGINE_2_4
#define ZEND_ENGINE_2_4
#endif
#endif

#define PHP_XCOM_VERSION "1.0.0"

#ifdef ZEND_ENGINE_2_4
# define XCOM_READ_PROPERTY(_obj, _mem, _type) zend_get_std_object_handlers()->read_property(_obj, _mem, _type, key TSRMLS_CC)
# define XCOM_WRITE_PROPERTY(_obj, _mem, _val) zend_get_std_object_handlers()->write_property(_obj, _mem, _val, key TSRMLS_CC)
#else
# define XCOM_READ_PROPERTY(_obj, _mem, _type) zend_get_std_object_handlers()->read_property(_obj, _mem, _type TSRMLS_CC)
# define XCOM_WRITE_PROPERTY(_obj, _mem, _val) zend_get_std_object_handlers()->write_property(_obj, _mem, _val TSRMLS_CC)
#endif

#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 2) || PHP_MAJOR_VERSION > 5
# define XCOM_ARGINFO
# define XCOM_IS_CALLABLE_CC TSRMLS_CC
#else
# define XCOM_ARGINFO static
# define XCOM_IS_CALLABLE_CC
#endif

#define XCOM_ME(func, arg_info, flags) PHP_ME(xcom, func, arg_info, flags)
#define XCOM_METHOD(func) PHP_METHOD(xcom, func)

#define __stringify_1(x)    #x
#define __stringify(x)      __stringify_1(x)
#define __XCOM_EXT_VER PHP_XCOM_VERSION
#define XCOM_EXT_VER __stringify(__XCOM_EXT_VER)
#define XCOM_USER_AGENT "PECL-XCom/" __stringify(__XCOM_EXT_VER)
#define XCOM_HTTP_PORT 80
#define XCOM_HTTPS_PORT 443
#define XCOM_MAX_HEADER_LEN 512L
#define XCOM_FABRIC_PRODUCTION "https://api.x.com/fabric/"
#define XCOM_FABRIC_SANDBOX "https://api.sandbox.x.com/fabric/"

extern zend_module_entry xcom_module_entry;

#define phpext_xcom_ptr &xcom_module_entry

#define PHP_XCOM_API

#define XCOM_HTTP_METHOD_POST "POST"

#define XCOM_SSLCHECK_NONE 0
#define XCOM_SSLCHECK_HOST 1
#define XCOM_SSLCHECK_PEER 2
#define XCOM_SSLCHECK_BOTH (OAUTH_SSLCHECK_HOST | OAUTH_SSLCHECK_PEER)

/* errors */
#define XCOM_ERR_BAD_REQUEST 400
#define XCOM_ERR_BAD_AUTH 401
#define XCOM_ERR_INTERNAL_ERROR 503

/* values */
#define XCOM_CALLBACK_OOB "oob"

#define XCOM_PARAM_PREFIX "xcom_"
#define XCOM_PARAM_PREFIX_LEN 6

#ifdef ZTS
#include "TSRM.h"
{'fraction_non_alphanumeric': 0.17142062056490887, 'fraction_numerical': 0.013635731181299569, 'mean_word_length': 4.2814107274063185, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 35, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3972324', 'n_tokens_mistral': 2899, 'n_tokens_neox': 2812, 'n_words': 523}