/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2005 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 | +----------------------------------------------------------------------+ */ /* $Id: shp.c,v 1.8 2006/07/12 17:17:06 andrey Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "php_shp.h" #define SHPHANDLE_RES_NAME "SHP Handle" #define SHPOBJECT_RES_NAME "SHP Object" /* If you declare any globals in php_shp.h uncomment this: ZEND_DECLARE_MODULE_GLOBALS(shp) */ #define MIN3(a,b,c) ((a)<(b)?(MIN(a,c)):(MIN(b,c))) /* True global resources - no need for thread safety here */ static int le_shphandle; static int le_shpobject; #ifdef COMPILE_DL_SHP ZEND_GET_MODULE(shp) #endif /* {{{ _close_shp_handle */ static void _close_shp_handle(zend_rsrc_list_entry *rsrc TSRMLS_DC) { SHPClose((SHPHandle) rsrc->ptr); } /* }}} */ /* {{{ _close_shp_object */ static void _close_shp_object(zend_rsrc_list_entry *rsrc TSRMLS_DC) { SHPDestroyObject((SHPObject *) rsrc->ptr); } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(shp) { php_info_print_table_start(); php_info_print_table_header(2, "shapelib support", "enabled"); php_info_print_table_end(); } /* }}} */ /* {{{ proto resource shp_open(string filename, string access) Opens a SHP handle */ PHP_FUNCTION(shp_open) { char *name = NULL, *acc = NULL; int name_len, acc_len; SHPHandle shph; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &acc, &acc_len) == FAILURE) { RETURN_FALSE; } shph = SHPOpen(name, acc); if (!shph) { RETURN_NULL(); } ZEND_REGISTER_RESOURCE(return_value, shph, le_shphandle); } /* }}} */ /* {{{ proto resource shp_create(string filename, string access) Creates a SHP handle */ PHP_FUNCTION(shp_create) { char *name = NULL; int name_len; long shape_type; SHPHandle shph; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl", &name, &name_len, &shape_type) == FAILURE) { RETURN_FALSE; } switch (shape_type) { case SHPT_POINT: case SHPT_ARC: case SHPT_POLYGON: case SHPT_MULTIPOINT: break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported type %ld", shape_type); } shph = SHPCreate(name, shape_type); if (!shph) { RETURN_NULL(); } ZEND_REGISTER_RESOURCE(return_value, shph, le_shphandle); } /* }}} */ /* {{{ proto bool shp_close(resource shp) Close a SHP handle */ PHP_FUNCTION(shp_close) { zval *res; SHPHandle shph; int c_id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } if (!res) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shph, SHPHandle, &res, c_id, SHPHANDLE_RES_NAME, le_shphandle); zend_list_delete(Z_LVAL_P(res)); ZVAL_NULL(res); RETURN_TRUE; } /* }}} */ /* {{{ proto resource shp_read_object(resource shp, int ord) Reads an object from a handle. The numbering starts from 0 */ PHP_FUNCTION(shp_read_object) { zval *res; SHPHandle shph; SHPObject *shp_obj; int c_id = -1; long ord; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &ord) == FAILURE) { RETURN_FALSE; } if (!res) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shph, SHPHandle, &res, c_id, SHPHANDLE_RES_NAME, le_shphandle); shp_obj = SHPReadObject(shph, ord); if (!shp_obj) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Reading of object %ld failed", ord); RETURN_NULL(); } ZEND_REGISTER_RESOURCE(return_value, shp_obj, le_shpobject); } /* }}} */ /* {{{ proto bool shp_destroy_object(resource shp_object) This function should be used to deallocate the resources associated with a SHPObject when it is no longer needed, including those created with shp_create_simple_object(), shp_create_object() and returned from shp_read_object(). */ PHP_FUNCTION(shp_destroy_object) { zval *res; SHPObject *shp_obj; int c_id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } if (!res) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shp_obj, SHPObject *, &res, c_id, SHPOBJECT_RES_NAME, le_shpobject); zend_list_delete(Z_LVAL_P(res)); ZVAL_NULL(res); RETURN_TRUE; } /* }}} */ /* {{{ proto bool shp_rewind_object(resource shp_handle, resource shp_object) This function will reverse any rings necessary in order to enforce the shapefile restrictions on the required order of inner and outer rings in the Shapefile specification. It returns TRUE if a change is made and FALSE if no change is made. Only polygon objects will be affected though any object may be passed. */ PHP_FUNCTION(shp_rewind_object) { zval *res_handle = NULL, *res_obj = NULL; SHPObject *shp_obj; SHPHandle shph; int c_id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rr", &res_handle, &res_obj) == FAILURE) { RETURN_FALSE; } if (!res_handle || !res_obj) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res_handle or res_obj"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shph, SHPHandle, &res_handle, c_id, SHPHANDLE_RES_NAME, le_shphandle); ZEND_FETCH_RESOURCE(shp_obj, SHPObject *, &res_obj, c_id, SHPOBJECT_RES_NAME, le_shpobject); RETURN_BOOL(SHPRewindObject(shph, shp_obj)); } /* }}} */ /* {{{ proto int shp_write_object(resource shp_handle, int entity_num, resource shp_object) The shp_write_object() call is used to write a single structure, or entity to the shapefile. See the definition of the SHPObject structure for detailed information on fields of a SHPObject. The return value is the entity number of the written shape. */ PHP_FUNCTION(shp_write_object) { zval *res_handle = NULL, *res_obj = NULL; SHPObject *shp_obj; SHPHandle shph; int c_id = -1; long entity_n; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlr", &res_handle, &entity_n, &res_obj) == FAILURE) { RETURN_FALSE; } if (!res_handle || !res_obj) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res_handle or res_obj"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shph, SHPHandle, &res_handle, c_id, SHPHANDLE_RES_NAME, le_shphandle); ZEND_FETCH_RESOURCE(shp_obj, SHPObject *, &res_obj, c_id, SHPOBJECT_RES_NAME, le_shpobject); RETURN_LONG(SHPWriteObject(shph, entity_n, shp_obj)); } /* }}} */ /* {{{ proto mixed shp_get_info(resource shp_handle) Retrieves various information about shapefile as a whole. The bounds are read from the file header, and may be inaccurate if the file was improperly generated.*/ PHP_FUNCTION(shp_get_info) { zval *res; SHPHandle shph; int c_id = -1; int i = 0; zval *min_bound, *max_bound; double min_b[4], max_b[4]; int ent_n, shp_type; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } if (!res) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shph, SHPHandle, &res, c_id, SHPHANDLE_RES_NAME, le_shphandle); SHPGetInfo(shph, &ent_n, &shp_type, min_b, max_b); MAKE_STD_ZVAL(min_bound); MAKE_STD_ZVAL(max_bound); array_init(min_bound); array_init(max_bound); SHPGetInfo(shph, &ent_n, &shp_type, min_b, max_b); for (i = 0; i < 4; ++i) { add_next_index_double(min_bound, min_b[i]); add_next_index_double(max_bound, max_b[i]); } array_init(return_value); add_assoc_long_ex(return_value, "pnEntities", sizeof("pnEntities"), ent_n); add_assoc_long_ex(return_value, "pnShapetype", sizeof("pnShapetype"), shp_type); add_assoc_zval_ex(return_value, "padfMinBound", sizeof("padfMinBound"), min_bound); add_assoc_zval_ex(return_value, "padfMaxBound", sizeof("padfMaxBound"), max_bound); } /* }}} */ /* {{{ proto bool shp_compute_extents(resource shp_object) This function will recompute the extents of this shape, replacing the existing values of the dfXMin, dfYMin, dfZMin, dfMMin, dfXMax, dfYMax, dfZMax, and dfMMax values based on the current set of vertices for the shape. This function is automatically called by shp_create_object() but if the vertices of an existing object are altered it should be called again to fix up the extents.*/ PHP_FUNCTION(shp_compute_extents) { zval *res; SHPObject *shp_obj; int c_id = -1; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) { RETURN_FALSE; } if (!res) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got NULL for res"); RETURN_FALSE; } ZEND_FETCH_RESOURCE(shp_obj, SHPObject *, &res, c_id, SHPOBJECT_RES_NAME, le_shpobject); SHPComputeExtents(shp_obj); RETURN_TRUE; } /* }}} */ /* {{{ proto resource shp_create_object(...) */ PHP_FUNCTION(shp_create_object) { zval *res; SHPObject *shp_obj; unsigned long shp_type, shp_id, parts_num, vertices_num, real_vert_num = 0; zval *panPartStart, *panPartType, *padfX, *padfY, *padfZ, *padfM; double *c_padfX = NULL, *c_padfY = NULL, *c_padfZ = NULL, *c_padfM = NULL; int *c_panPartStart = NULL, *c_panPartType = NULL; HashPosition pos; zval **data; unsigned int i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllaalaaaa", &shp_type, &shp_id, &parts_num, &panPartStart, &panPartType, &vertices_num, &padfX, &padfY, &padfZ, &padfM) == FAILURE) { RETURN_FALSE; } if (zend_hash_num_elements(Z_ARRVAL_P(padfX)) && zend_hash_num_elements(Z_ARRVAL_P(padfX)) != zend_hash_num_elements(Z_ARRVAL_P(padfY))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "padfX and padfY have different number of elements"); RETURN_FALSE; } if (zend_hash_num_elements(Z_ARRVAL_P(padfX)) && zend_hash_num_elements(Z_ARRVAL_P(padfX)) < vertices_num) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "less elements in padfX than specified in vertices_num"); RETURN_FALSE; } /****************************************************/ { if (zend_hash_num_elements(Z_ARRVAL_P(panPartStart))) { c_panPartStart = emalloc(zend_hash_num_elements(Z_ARRVAL_P(panPartStart)) * sizeof(int)); } i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(panPartStart), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(panPartStart), (void **)&data, &pos) == SUCCESS) { convert_to_long_ex(data); c_panPartStart[i++] = Z_LVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(panPartStart), &pos); } } /****************************************************/ { if (zend_hash_num_elements(Z_ARRVAL_P(panPartType))) { c_panPartType = emalloc(zend_hash_num_elements(Z_ARRVAL_P(panPartType)) * sizeof(int)); } i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(panPartType), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(panPartType), (void **)&data, &pos) == SUCCESS) { convert_to_long_ex(data); c_panPartType[i++] = Z_LVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(panPartType), &pos); } } real_vert_num = MIN3(zend_hash_num_elements(Z_ARRVAL_P(padfX)), zend_hash_num_elements(Z_ARRVAL_P(padfY)), (zend_hash_num_elements(Z_ARRVAL_P(padfZ))? zend_hash_num_elements(Z_ARRVAL_P(padfZ)):99999999L)); // 0 should not be the smallest real_vert_num = MIN(real_vert_num, vertices_num); if (real_vert_num != vertices_num) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The real number of used vertices %ld, passed %ld", real_vert_num, vertices_num); } if (real_vert_num) { c_padfX = emalloc(real_vert_num * sizeof(double)); memset(c_padfX, 0, real_vert_num * sizeof(double)); c_padfY = emalloc(real_vert_num * sizeof(double)); memset(c_padfY, 0, real_vert_num * sizeof(double)); if (zend_hash_num_elements(Z_ARRVAL_P(padfZ))) { c_padfZ = emalloc(real_vert_num * sizeof(double)); memset(c_padfZ, 0, real_vert_num * sizeof(double)); } if (zend_hash_num_elements(Z_ARRVAL_P(padfM))) { c_padfM = emalloc(real_vert_num * sizeof(double)); memset(c_padfM, 0, real_vert_num * sizeof(double)); } /****************************************/ i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfX), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfX), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfX[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfX), &pos); } /****************************************/ i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfY), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfY), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfY[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfY), &pos); } /****************************************/ if (c_padfZ) { i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfZ), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfZ), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfZ[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfZ), &pos); } } if (c_padfM) { i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfM), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfM), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfM[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfM), &pos); } } } shp_obj = SHPCreateObject(shp_type, shp_id, parts_num, c_panPartStart, c_panPartType, real_vert_num, c_padfX, c_padfY, c_padfZ, c_padfM ); if (c_panPartStart) { efree(c_panPartStart); } if (c_panPartType) { efree(c_panPartType); } if (c_padfX) { efree(c_padfX); } if (c_padfY) { efree(c_padfY); } if (c_padfZ) { efree(c_padfZ); } if (c_padfM) { efree(c_padfM); } if (!shp_obj) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "SHPCreateObject returned NULL"); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, shp_obj, le_shpobject); } /* }}} */ /* {{{ proto resource shp_create_simple_object(...) */ PHP_FUNCTION(shp_create_simple_object) { zval *res; SHPObject *shp_obj; unsigned long shp_type, vertices_num, real_vert_num = 0; zval *padfX, *padfY, *padfZ; double *c_padfX = NULL, *c_padfY = NULL, *c_padfZ = NULL; HashPosition pos; zval **data; unsigned int i; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "llaaa", &shp_type, &vertices_num, &padfX, &padfY, &padfZ) == FAILURE) { RETURN_FALSE; } if (zend_hash_num_elements(Z_ARRVAL_P(padfX)) && zend_hash_num_elements(Z_ARRVAL_P(padfX)) != zend_hash_num_elements(Z_ARRVAL_P(padfY))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "padfX and padfY have different number of elements"); RETURN_FALSE; } if (zend_hash_num_elements(Z_ARRVAL_P(padfX)) && zend_hash_num_elements(Z_ARRVAL_P(padfX)) < vertices_num) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "less elements in padfX than specified in vertices_num"); RETURN_FALSE; } real_vert_num = MIN3(zend_hash_num_elements(Z_ARRVAL_P(padfX)), zend_hash_num_elements(Z_ARRVAL_P(padfY)), (zend_hash_num_elements(Z_ARRVAL_P(padfZ))? zend_hash_num_elements(Z_ARRVAL_P(padfZ)):99999999L)); // 0 should not be the smallest real_vert_num = MIN(real_vert_num, vertices_num); if (real_vert_num != vertices_num) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The real number of used vertices %ld, passed %ld", real_vert_num, vertices_num); } if (real_vert_num) { c_padfX = emalloc(real_vert_num * sizeof(double)); memset(c_padfX, 0, real_vert_num * sizeof(double)); c_padfY = emalloc(real_vert_num * sizeof(double)); memset(c_padfY, 0, real_vert_num * sizeof(double)); if (zend_hash_num_elements(Z_ARRVAL_P(padfZ))) { c_padfZ = emalloc(real_vert_num * sizeof(double)); memset(c_padfZ, 0, real_vert_num * sizeof(double)); } /****************************************/ i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfX), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfX), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfX[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfX), &pos); } /****************************************/ i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfY), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfY), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfY[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfY), &pos); } /****************************************/ if (c_padfZ) { i = 0; zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(padfZ), &pos); while (i < real_vert_num && zend_hash_get_current_data_ex(Z_ARRVAL_P(padfZ), (void **)&data, &pos) == SUCCESS) { convert_to_double_ex(data); c_padfZ[i++] = Z_DVAL_PP(data); zend_hash_move_forward_ex(Z_ARRVAL_P(padfZ), &pos); } } } shp_obj = SHPCreateSimpleObject(shp_type, real_vert_num, c_padfX, c_padfY, c_padfZ); if (c_padfX) { efree(c_padfX); } if (c_padfY) { efree(c_padfY); } if (c_padfZ) { efree(c_padfZ); } if (!shp_obj) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "SHPCreateSimpleObject returned NULL"); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, shp_obj, le_shpobject); } /* }}} */ /* {{{ shp_functions[] * * Every user visible function must have an entry in shp_functions[]. */ function_entry shp_functions[] = { PHP_FE(shp_get_info, NULL) PHP_FE(shp_close, NULL) PHP_FE(shp_compute_extents, NULL) PHP_FE(shp_create, NULL) PHP_FE(shp_destroy_object, NULL) PHP_FE(shp_open, NULL) PHP_FE(shp_read_object, NULL) PHP_FE(shp_rewind_object, NULL) PHP_FE(shp_write_object, NULL) PHP_FE(shp_create_object, NULL) PHP_FE(shp_create_simple_object, NULL) {NULL, NULL, NULL} /* Must be the last line in shp_functions[] */ }; /* }}} */ /* {{{ shp_module_entry */ zend_module_entry shp_module_entry = { STANDARD_MODULE_HEADER, "shp", shp_functions, PHP_MINIT(shp), PHP_MSHUTDOWN(shp), NULL, NULL, PHP_MINFO(shp), "1.0", STANDARD_MODULE_PROPERTIES }; /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(shp) { /* If you have INI entries, uncomment these lines ZEND_INIT_MODULE_GLOBALS(shp, php_shp_init_globals, NULL); REGISTER_INI_ENTRIES(); */ le_shphandle = zend_register_list_destructors_ex(_close_shp_handle, NULL, SHPHANDLE_RES_NAME, module_number); le_shpobject = zend_register_list_destructors_ex(_close_shp_object, NULL, SHPOBJECT_RES_NAME, module_number); REGISTER_LONG_CONSTANT("SHPT_NULL", SHPT_NULL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POINT", SHPT_POINT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_ARC", SHPT_ARC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POLYGON", SHPT_POLYGON, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_MULTIPOINT", SHPT_MULTIPOINT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POINTZ", SHPT_POINTZ, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_ARCZ", SHPT_ARCZ, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POLYGONZ", SHPT_POLYGONZ, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_MULTIPOINTZ", SHPT_MULTIPOINTZ, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POINTM", SHPT_POINTM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_ARCM", SHPT_ARCM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_POLYGONM", SHPT_POLYGONM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_MULTIPOINTM", SHPT_MULTIPOINTM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPT_MULTIPATCH", SHPT_MULTIPATCH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_TRISTRIP", SHPP_TRISTRIP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_TRIFAN", SHPP_TRIFAN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_OUTERRING", SHPP_OUTERRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_INNERRING", SHPP_INNERRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_FIRSTRING", SHPP_FIRSTRING, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SHPP_RING", SHPP_RING, CONST_CS | CONST_PERSISTENT); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(shp) { /* uncomment this line if you have INI entries UNREGISTER_INI_ENTRIES(); */ return SUCCESS; } /* }}} */ /* * 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 */