-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathteds_exceptions.h
29 lines (25 loc) · 1.47 KB
/
teds_exceptions.h
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
28
29
/*
+----------------------------------------------------------------------+
| teds extension for PHP |
| See COPYING file for further copyright information |
+----------------------------------------------------------------------+
| Author: Tyson Andre <[email protected]> |
+----------------------------------------------------------------------+
*/
#ifndef TEDS_EXCEPTIONS_H
#define TEDS_EXCEPTIONS_H
#include "Zend/zend_interfaces.h"
#include "php.h"
#include "Zend/zend_portability.h"
#include "Zend/zend_types.h"
extern zend_class_entry *teds_ce_UnsupportedOperationException;
void teds_throw_unsupportedoperationexception(const char *message);
void teds_throw_invalid_sequence_index_exception(void);
void teds_throw_invalid_collection_offset_exception(void);
void teds_throw_missing_map_key_exception(void);
#define TEDS_THROW_UNSUPPORTEDOPERATIONEXCEPTION(message) do { teds_throw_unsupportedoperationexception((message)); RETURN_THROWS(); } while (0)
#define TEDS_THROW_INVALID_SEQUENCE_INDEX_EXCEPTION() do { teds_throw_invalid_sequence_index_exception(); RETURN_THROWS(); } while (0)
#define TEDS_THROW_INVALID_COLLECTION_OFFSET_EXCEPTION() do { teds_throw_invalid_collection_offset_exception(); RETURN_THROWS(); } while (0)
#define TEDS_THROW_MISSING_MAP_KEY_EXCEPTION() do { teds_throw_missing_map_key_exception(); RETURN_THROWS(); } while (0)
void teds_register_exceptions(void);
#endif