com php-src: BreakIterator: add rules status constants: ext/intl/breakiterator/breakiterator_class.cpp

From: Date: Mon, 04 Jun 2012 21:09:10 +0000
Subject: com php-src: BreakIterator: add rules status constants: ext/intl/breakiterator/breakiterator_class.cpp
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-69460@lists.php.net to get a copy of this message
Commit: c6593a0e9b3ea1a6045f8a52a1b9d8bce4d63773 Author: Gustavo André dos Santos Lopes <cataphract@php.net> Mon, 4 Jun 2012 23:09:10 +0200 Parents: 036b1eb2912872ade10e35f26daf10c65cc3cdea Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c6593a0e9b3ea1a6045f8a52a1b9d8bce4d63773 Log: BreakIterator: add rules status constants Changed paths: M ext/intl/breakiterator/breakiterator_class.cpp Diff: diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 47e5fb5..f273a2f 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);

« previous php.cvs (#69460) next »