diff options
author | Benny Prijono <bennylp@teluu.com> | 2005-11-23 20:55:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2005-11-23 20:55:37 +0000 |
commit | 3366b25100e19ce91de500de827aed0606390f70 (patch) | |
tree | 0d3904e97f25d47dfdfd54eada7627cf52bed1b2 | |
parent | 5e4e0d031aad6bd49d94b92452b5e93fa8e60205 (diff) |
Added pj_cis_add_cis()
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@81 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjlib-util/include/pjlib-util/scanner.h | 8 | ||||
-rw-r--r-- | pjlib-util/src/pjlib-util/scanner.c | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pjlib-util/include/pjlib-util/scanner.h b/pjlib-util/include/pjlib-util/scanner.h index b8f8f761..59e9efe4 100644 --- a/pjlib-util/include/pjlib-util/scanner.h +++ b/pjlib-util/include/pjlib-util/scanner.h @@ -117,6 +117,14 @@ PJ_DECL(void) pj_cis_add_num( pj_cis_t *cis); PJ_DECL(void) pj_cis_add_str( pj_cis_t *cis, const char *str); /** + * Add specification from another specification. + * + * @param cis The specification is to be set. + * @param rhs The specification to be copied. + */ +PJ_DECL(void) pj_cis_add_cis( pj_cis_t *cis, const pj_cis_t *rhs); + +/** * Delete characters in the specified range from the specification. * * @param cis The scanner character specification. diff --git a/pjlib-util/src/pjlib-util/scanner.c b/pjlib-util/src/pjlib-util/scanner.c index ec215d5f..802cc09e 100644 --- a/pjlib-util/src/pjlib-util/scanner.c +++ b/pjlib-util/src/pjlib-util/scanner.c @@ -72,6 +72,15 @@ PJ_DEF(void) pj_cis_add_str( pj_cis_t *cis, const char *str) } } +PJ_DEF(void) pj_cis_add_cis( pj_cis_t *cis, const pj_cis_t *rhs) +{ + int i; + for (i=0; i<256; ++i) { + if (PJ_CIS_ISSET(rhs, i)) + PJ_CIS_SET(cis, i); + } +} + PJ_DEF(void) pj_cis_del_range( pj_cis_t *cis, int cstart, int cend) { while (cstart != cend) { |