diff options
| author | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-06-04 23:09:10 +0200 |
|---|---|---|
| committer | Gustavo André dos Santos Lopes <cataphract@php.net> | 2012-06-04 23:09:10 +0200 |
| commit | c6593a0e9b3ea1a6045f8a52a1b9d8bce4d63773 (patch) | |
| tree | 11d60f16f94bfda1be985949fbceb50993ee4558 | |
| parent | 036b1eb2912872ade10e35f26daf10c65cc3cdea (diff) | |
| download | php-git-c6593a0e9b3ea1a6045f8a52a1b9d8bce4d63773.tar.gz | |
BreakIterator: add rules status constants
| -rw-r--r-- | ext/intl/breakiterator/breakiterator_class.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 47e5fb52df..f273a2f74a 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -333,6 +333,35 @@ void breakiterator_register_BreakIterator_class(TSRMLS_D) zend_declare_class_constant_long(BreakIterator_ce_ptr, "DONE", sizeof("DONE") - 1, BreakIterator::DONE TSRMLS_CC ); + /* Declare constants that are defined in the C header */ +#define BREAKITER_DECL_LONG_CONST(name) \ + zend_declare_class_constant_long(BreakIterator_ce_ptr, #name, \ + sizeof(#name) - 1, UBRK_ ## name TSRMLS_CC) + + BREAKITER_DECL_LONG_CONST(WORD_NONE); + BREAKITER_DECL_LONG_CONST(WORD_NONE_LIMIT); + BREAKITER_DECL_LONG_CONST(WORD_NUMBER); + BREAKITER_DECL_LONG_CONST(WORD_NUMBER_LIMIT); + BREAKITER_DECL_LONG_CONST(WORD_LETTER); + BREAKITER_DECL_LONG_CONST(WORD_LETTER_LIMIT); + BREAKITER_DECL_LONG_CONST(WORD_KANA); + BREAKITER_DECL_LONG_CONST(WORD_KANA_LIMIT); + BREAKITER_DECL_LONG_CONST(WORD_IDEO); + BREAKITER_DECL_LONG_CONST(WORD_IDEO_LIMIT); + + BREAKITER_DECL_LONG_CONST(LINE_SOFT); + BREAKITER_DECL_LONG_CONST(LINE_SOFT_LIMIT); + BREAKITER_DECL_LONG_CONST(LINE_HARD); + BREAKITER_DECL_LONG_CONST(LINE_HARD_LIMIT); + + BREAKITER_DECL_LONG_CONST(SENTENCE_TERM); + BREAKITER_DECL_LONG_CONST(SENTENCE_TERM_LIMIT); + BREAKITER_DECL_LONG_CONST(SENTENCE_SEP); + BREAKITER_DECL_LONG_CONST(SENTENCE_SEP_LIMIT); + +#undef BREAKITER_DECL_LONG_CONST + + /* Create and register 'RuleBasedBreakIterator' class. */ INIT_CLASS_ENTRY(ce, "RuleBasedBreakIterator", RuleBasedBreakIterator_class_functions); |
