<commit_before>/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997-2015 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.01 of the PHP license,      |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.php.net/license/3_01.txt                                  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | <EMAIL> so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Author:                                                              |
  +----------------------------------------------------------------------+
*/

/* $Id$ */

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

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_simplefork.h"

#include <zend.h>
#include <zend_API.h>
#include <zend_string.h>



/* If you declare any globals in php_simplefork.h uncomment this:
ZEND_DECLARE_MODULE_GLOBALS(simplefork)
*/

/* True global resources - no need for thread safety here */
static int le_simplefork;

static zend_class_entry *simplefork_exception_entry = NULL;

/* SimpleFork\CacheInterface */
zend_class_entry *cache_interface_entry = NULL;

ZEND_BEGIN_ARG_INFO(cache_key, 0)
    ZEND_ARG_INFO(0, cache_key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(cache_set, 0)
    ZEND_ARG_INFO(0, cache_key)
    ZEND_ARG_INFO(0, cache_value)
ZEND_END_ARG_INFO()

static zend_function_entry cache_interface_methods[]={
    ZEND_ABSTRACT_ME(cache_interface_entry, get, cache_key) 
    ZEND_ABSTRACT_ME(cache_interface_entry, delete, cache_key)
    ZEND_ABSTRACT_ME(cache_interface_entry, set, cache_set) 
    ZEND_ABSTRACT_ME(cache_interface_entry, flush, NULL) 
    {NULL,NULL,NULL}
};

/* SimpleFork\QueueInterface */
zend_class_entry *queue_interface_entry = NULL;

ZEND_BEGIN_ARG_INFO(queue_key, 0)
    ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(queue_put, 0)
    ZEND_ARG_INFO(0, key)
    ZEND_ARG_INFO(0, queue_value)
ZEND_END_ARG_INFO()

static zend_function_entry queue_interface_methods[]={
	ZEND_ABSTRACT_ME(queue_interface_entry, put, queue_put)
	ZEND_ABSTRACT_ME(queue_interface_entry, get, queue_key)
	ZEND_ABSTRACT_ME(queue_interface_entry, size, queue_key)
	ZEND_ABSTRACT_ME(queue_interface_entry, remove, NULL)
	{NULL, NULL, NULL}
};

/* SimpleFork\LockInterface */
zend_class_entry *lock_interface_entry = NULL;

static zend_function_entry lock_interface_methods[]={
	ZEND_ABSTRACT_ME(lock_interface_entry, acquire, NULL)
	ZEND_ABSTRACT_ME(lock_interface_entry, release, NULL)
	{NULL,NULL,NULL}
};

/* SimpleFork\Runnable */
zend_class_entry *runnable_interface_entry = NULL;

static zend_function_entry runnable_interface_methods[]={
	ZEND_ABSTRACT_ME(runnable_interface_entry, run, NULL)
	{NULL,NULL,NULL}
};



/* SimpleFork\Process */
zend_class_entry *process_class_entry = NULL;
//

ZEND_BEGIN_ARG_INFO(process_construct_args, 0)
	ZEND_ARG_INFO(0, execution)
ZEND_END_ARG_INFO()

static zend_function_entry process_class_methods[]={
	PHP_ME(Process, __construct, process_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
	PHP_ME(Process, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
	{NULL,NULL,NULL}
};


/* SimpleFork\Process Methods start */
/** {{{
*/
PHP_METHOD(Process, __construct)
{
	zval *execution = NULL;
	char *execution_name = NULL;
	if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z", &execution)){
		RETURN_FALSE;
	}

	if(zend_is_callable(execution, 0, &execution_name)){
		zend_throw_exception(simplefork_exception_entry, "execution param must be callable",0 TSRMLS_CC);
	}
	zend_update_property(process_class_entry, getThis(), "execution", sizeof("execution")-1, execution TSRMLS_CC);
}
/* }}} */

/** {{{
*/
PHP_METHOD(Process, __destruct)
{

}
/* }}} */

<commit_msg>update header<commit_after>/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997-2015 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.01 of the PHP license,      |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.php.net/license/3_01.txt                                  |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | <EMAIL> so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Author:                                                              |
  +----------------------------------------------------------------------+
*/

/* $Id$ */

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

#include "php.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "php_simplefork.h"

#include <zend.h>
#include <zend_API.h>
#include <zend_string.h>



/* If you declare any globals in php_simplefork.h uncomment this:
ZEND_DECLARE_MODULE_GLOBALS(simplefork)
*/

/* True global resources - no need for thread safety here */
static int le_simplefork;

static zend_class_entry *simplefork_exception_entry = NULL;

/* SimpleFork\CacheInterface */
zend_class_entry *cache_interface_entry = NULL;

ZEND_BEGIN_ARG_INFO(cache_key, 0)
    ZEND_ARG_INFO(0, cache_key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(cache_set, 0)
    ZEND_ARG_INFO(0, cache_key)
    ZEND_ARG_INFO(0, cache_value)
ZEND_END_ARG_INFO()

static zend_function_entry cache_interface_methods[]={
    ZEND_ABSTRACT_ME(cache_interface_entry, get, cache_key) 
    ZEND_ABSTRACT_ME(cache_interface_entry, delete, cache_key)
    ZEND_ABSTRACT_ME(cache_interface_entry, set, cache_set) 
    ZEND_ABSTRACT_ME(cache_interface_entry, flush, NULL) 
    {NULL,NULL,NULL}
};

/* SimpleFork\QueueInterface */
zend_class_entry *queue_interface_entry = NULL;

ZEND_BEGIN_ARG_INFO(queue_key, 0)
    ZEND_ARG_INFO(0, key)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(queue_put, 0)
    ZEND_ARG_INFO(0, key)
    ZEND_ARG_INFO(0, queue_value)
ZEND_END_ARG_INFO()

static zend_function_entry queue_interface_methods[]={
	ZEND_ABSTRACT_ME(queue_interface_entry, put, queue_put)
	ZEND_ABSTRACT_ME(queue_interface_entry, get, queue_key)
	ZEND_ABSTRACT_ME(queue_interface_entry, size, queue_key)
	ZEND_ABSTRACT_ME(queue_interface_entry, remove, NULL)
	{NULL, NULL, NULL}
};

/* SimpleFork\LockInterface */
zend_class_entry *lock_interface_entry = NULL;

static zend_function_entry lock_interface_methods[]={
	ZEND_ABSTRACT_ME(lock_interface_entry, acquire, NULL)
	ZEND_ABSTRACT_ME(lock_interface_entry, release, NULL)
	{NULL,NULL,NULL}
};

/* SimpleFork\Runnable */
zend_class_entry *runnable_interface_entry = NULL;

static zend_function_entry runnable_interface_methods[]={
	ZEND_ABSTRACT_ME(runnable_interface_entry, run, NULL)
	{NULL,NULL,NULL}
};



/* SimpleFork\Process */
zend_class_entry *process_class_entry = NULL;
//

ZEND_BEGIN_ARG_INFO(process_construct_args, 0)
	ZEND_ARG_INFO(0, execution)
ZEND_END_ARG_INFO()

static zend_function_entry process_class_methods[]={
	PHP_ME(Process, __construct, process_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
	PHP_ME(Process, __destruct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_DTOR)
	{NULL,NULL,NULL}
};


/* SimpleFork\Process Methods start */
/** {{{
*/
PHP_METHOD(Process, __construct)
{
	zval *execution = NULL;
	char *execution_name = NULL;
	if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "z", &execution)){
		RETURN_FALSE;
	}

	if(!zend_is_callable(execution, 0, &execution_name)){
		zend_throw_exception(simplefork_exception_entry, "execution param must be callable",0 TSRMLS_CC);
	}
	zend_update_property(process_class_entry, getThis(), "execution", sizeof("execution")-1, execution TSRMLS_CC);
}
/* }}} */

/** {{{
*/
PHP_METHOD(Process, __destruct)
{

}
/* }}} */


{'fraction_non_alphanumeric': 0.17820049013887268, 'fraction_numerical': 0.00700198389543704, 'mean_word_length': 2.819073083778966, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '858722', 'n_tokens_mistral': 2916, 'n_tokens_neox': 2786, 'n_words': 543}