1 /* {{{ Class CairoException */
3 static zend_class_entry
* CairoException_ce_ptr
= NULL
;
7 static zend_function_entry CairoException_methods
[] = {
13 static void class_init_CairoException(void)
17 INIT_CLASS_ENTRY(ce
, "CairoException", CairoException_methods
);
18 CairoException_ce_ptr
= zend_register_internal_class_ex(&ce
, zend_exception_get_default(), "Exception" TSRMLS_CC
);
21 /* }}} Class CairoException */
23 void phpCairoCheckStatus(cairo_status_t status
)
25 zend_throw_exception(CairoException_ce_ptr
, cairo_status_to_string(status
));
30 case CAIRO_STATUS_SUCCESS:
32 case CAIRO_STATUS_NO_MEMORY:
33 zend_throw_exception(CairoException_ce_ptr,"No memory", NULL);
35 case CAIRO_STATUS_READ_ERROR:
36 case CAIRO_STATUS_WRITE_ERROR:
37 zend_throw_exception(CairoException_ce_ptr, cairo_status_to_string(status), NULL);
39 case CAIRO_STATUS_INVALID_RESTORE:
40 zend_throw_expetion(CairoException_ce_ptr, "Invalid restore", NULL);
42 case CAIRO_STATUS_INVALID_POP_GROUP:
43 zend_throw_exception(CairoException_ce_ptr, "Pop group error", NULL);