/*
  +----------------------------------------------------------------------+
  | PHP Version 5                                                        |
  +----------------------------------------------------------------------+
  | Copyright (c) 1997-2004 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.0 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_0.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          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Author: Andrey Hristov <andrey _at_ php _dot_ net>                   |
  +----------------------------------------------------------------------+
*/

/* $Id: header,v 1.15 2004/01/08 16:46:52 sniper Exp $ */

#ifndef PHP_CCMATH_H
#define PHP_CCMATH_H

extern zend_module_entry ccmath_module_entry;
#define phpext_ccmath_ptr &ccmath_module_entry

#ifdef PHP_WIN32
#define PHP_CCMATH_API __declspec(dllexport)
#else
#define PHP_CCMATH_API
#endif

#ifdef ZTS
#include "TSRM.h"
#endif

PHP_MINIT_FUNCTION(ccmath);
PHP_MINFO_FUNCTION(ccmath);

PHP_METHOD(complex, __construct);
PHP_METHOD(complex, add);
PHP_METHOD(complex, sub);
PHP_METHOD(complex, mul);
PHP_METHOD(complex, div);
PHP_METHOD(complex, realMul);
PHP_METHOD(complex, imagMul);
PHP_METHOD(complex, addS);
PHP_METHOD(complex, subS);
PHP_METHOD(complex, mulS);
PHP_METHOD(complex, divS);
PHP_METHOD(complex, realMulS);
PHP_METHOD(complex, imagMulS);
PHP_METHOD(complex, cng);
PHP_METHOD(complex, cngS);
PHP_METHOD(complex, exp);
PHP_METHOD(complex, expS);
PHP_METHOD(complex, log);
PHP_METHOD(complex, logS);
PHP_METHOD(complex, sinh);
PHP_METHOD(complex, sinhS);
PHP_METHOD(complex, cosh);
PHP_METHOD(complex, coshS);
PHP_METHOD(complex, tanh);
PHP_METHOD(complex, tanhS);
PHP_METHOD(complex, asinh);
PHP_METHOD(complex, asinhS);
PHP_METHOD(complex, acosh);
PHP_METHOD(complex, acoshS);
PHP_METHOD(complex, atanh);
PHP_METHOD(complex, atanhS);
PHP_METHOD(complex, asin);
PHP_METHOD(complex, asinS);
PHP_METHOD(complex, acos);
PHP_METHOD(complex, acosS);
PHP_METHOD(complex, atan);
PHP_METHOD(complex, atanS);
PHP_METHOD(complex, sqrt);
PHP_METHOD(complex, sqrtS);
PHP_METHOD(complex, sin);
PHP_METHOD(complex, sinS);
PHP_METHOD(complex, cos);
PHP_METHOD(complex, cosS);
PHP_METHOD(complex, tan);
PHP_METHOD(complex, tanS);

PHP_METHOD(complex, print);


#define CCMATH_SET_COMPLEX(__complex, __re, __im) \
	__complex.re = __re; \
	__complex.im = __im;

#define CCMATH_RETURN_COMPLEX_OBJECT(__re, __im) \
	Z_TYPE_P(return_value) = IS_OBJECT; \
	(return_value)->value.obj = ccmath_complex_object_new(ccmath_ce_complex_class_entry TSRMLS_CC); \
    CCMATH_SET_COMPLEX(((ccmath_complex_object *) zend_object_store_get_object(return_value TSRMLS_CC))->cnum, __re, __im);

typedef struct complex ccmath_complex;

#ifdef ZTS
#define CCMATH_G(v) TSRMG(ccmath_globals_id, zend_ccmath_globals *, v)
#else
#define CCMATH_G(v) (ccmath_globals.v)
#endif

#endif	/* PHP_CCMATH_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
 */
