1 /*
2    +----------------------------------------------------------------------+
3    | This source file is subject to version 3.01 of the PHP license,      |
4    | that is bundled with this package in the file LICENSE, and is        |
5    | available through the world-wide-web at the following url:           |
6    | http://www.php.net/license/3_01.txt                                  |
7    | If you did not receive a copy of the PHP license and are unable to   |
8    | obtain it through the world-wide-web, please send a note to          |
9    | license@php.net so we can mail you a copy immediately.               |
10    +----------------------------------------------------------------------+
11    | Authors: Gustavo Lopes <cataphract@php.net>                          |
12    +----------------------------------------------------------------------+
13  */
14 
15 #include "codepointiterator_internal.h"
16 
17 extern "C" {
18 #define USE_BREAKITERATOR_POINTER 1
19 #include "breakiterator_class.h"
20 }
21 
22 using PHP::CodePointBreakIterator;
23 
fetch_cpbi(BreakIterator_object * bio)24 static inline CodePointBreakIterator *fetch_cpbi(BreakIterator_object *bio) {
25 	return (CodePointBreakIterator*)bio->biter;
26 }
27 
PHP_METHOD(IntlCodePointBreakIterator,getLastCodePoint)28 U_CFUNC PHP_METHOD(IntlCodePointBreakIterator, getLastCodePoint)
29 {
30 	BREAKITER_METHOD_INIT_VARS;
31 	object = ZEND_THIS;
32 
33 	if (zend_parse_parameters_none() == FAILURE) {
34 		RETURN_THROWS();
35 	}
36 
37 	BREAKITER_METHOD_FETCH_OBJECT;
38 
39 	RETURN_LONG(fetch_cpbi(bio)->getLastCodePoint());
40 }
41