BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB-UTIL Reference

scanner_cis_bitwise.h
1/*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJLIB_UTIL_SCANNER_CIS_BIT_H__
20#define __PJLIB_UTIL_SCANNER_CIS_BIT_H__
21
22#include <pj/types.h>
23
25
30#ifndef PJ_CIS_ELEM_TYPE
31# define PJ_CIS_ELEM_TYPE pj_uint32_t
32#endif
33
38typedef PJ_CIS_ELEM_TYPE pj_cis_elem_t;
39
44#define PJ_CIS_MAX_INDEX (sizeof(pj_cis_elem_t) << 3)
45
49typedef struct pj_cis_buf_t
50{
51 pj_cis_elem_t cis_buf[256];
52 pj_cis_elem_t use_mask;
54
58typedef struct pj_cis_t
59{
60 pj_cis_elem_t *cis_buf;
61 int cis_id;
62} pj_cis_t;
63
64
72#define PJ_CIS_SET(cis,c) ((cis)->cis_buf[(int)(c)] |= (1 << (cis)->cis_id))
73
81#define PJ_CIS_CLR(cis,c) ((cis)->cis_buf[(int)c] &= ~(1 << (cis)->cis_id))
82
90#define PJ_CIS_ISSET(cis,c) ((cis)->cis_buf[(int)c] & (1 << (cis)->cis_id))
91
92
93
95
96#endif /* __PJLIB_UTIL_SCANNER_CIS_BIT_H__ */
#define PJ_BEGIN_DECL
#define PJ_END_DECL
Definition: scanner_cis_bitwise.h:50
pj_cis_elem_t use_mask
Definition: scanner_cis_bitwise.h:52
pj_cis_elem_t cis_buf[256]
Definition: scanner_cis_bitwise.h:51
Definition: scanner_cis_bitwise.h:59
pj_cis_elem_t * cis_buf
Definition: scanner_cis_bitwise.h:60
int cis_id
Definition: scanner_cis_bitwise.h:61

 


PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.