forked from geonef/php5-gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathogrexception.cc
More file actions
27 lines (22 loc) · 832 Bytes
/
ogrexception.cc
File metadata and controls
27 lines (22 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "php.h"
#include "php_gdal.h"
#include <zend_exceptions.h>
#include "ogrexception.h"
zend_class_entry *gdal_ogrexception_ce;
zend_object_handlers ogrexception_object_handlers;
zend_function_entry ogrexception_methods[] = {
{NULL, NULL, NULL}
};
void php_gdal_ogrexception_startup(INIT_FUNC_ARGS)
{
zend_class_entry ce;
INIT_CLASS_ENTRY(ce, "OGRException", ogrexception_methods);
gdal_ogrexception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default(TSRMLS_C), NULL TSRMLS_CC);
}
void php_gdal_ogr_throw_error_with_message(int error_code, const char *error_message, int strict_error TSRMLS_DC)
{
(void *) strict_error;
zend_throw_exception(gdal_ogrexception_ce, (char*)error_message, error_code TSRMLS_CC);
}
/* VIM settings */
/* ex: set tabstop=2 expandtab shiftwidth=2 smartindent */