8e21f86812
X-SVN-Rev: 472
81 lines
2.4 KiB
C
81 lines
2.4 KiB
C
/*
|
|
*******************************************************************************
|
|
* *
|
|
* COPYRIGHT: *
|
|
* (C) Copyright International Business Machines Corporation, 1999 *
|
|
* Licensed Material - Program-Property of IBM - All Rights Reserved. *
|
|
* US Government Users Restricted Rights - Use, duplication, or disclosure *
|
|
* restricted by GSA ADP Schedule Contract with IBM Corp. *
|
|
* *
|
|
*******************************************************************************
|
|
*
|
|
* File uscanset.h
|
|
*
|
|
* Modification History:
|
|
*
|
|
* Date Name Description
|
|
* 12/03/98 stephen Creation.
|
|
* 03/12/99 stephen Modified for new C API.
|
|
*******************************************************************************
|
|
*/
|
|
|
|
#ifndef USCANSET_H
|
|
#define USCANSET_H
|
|
|
|
#include "unicode/utypes.h"
|
|
|
|
|
|
/**
|
|
* Simple struct for a scanset pair, ie a-z or A-Z
|
|
*/
|
|
struct u_scanf_scanset_pair {
|
|
UChar start;
|
|
UChar end;
|
|
};
|
|
typedef struct u_scanf_scanset_pair u_scanf_scanset_pair;
|
|
|
|
#define U_SCANF_MAX_SCANSET_SIZE 512
|
|
|
|
/**
|
|
* Struct representing a scanset
|
|
*/
|
|
struct u_scanf_scanset {
|
|
bool_t is_inclusive; /* false if '^' is given */
|
|
|
|
UChar singles [U_SCANF_MAX_SCANSET_SIZE];
|
|
u_scanf_scanset_pair pairs [U_SCANF_MAX_SCANSET_SIZE];
|
|
|
|
int32_t single_count; /* count of single chars in set */
|
|
int32_t pair_count; /* count of pairs in set */
|
|
};
|
|
typedef struct u_scanf_scanset u_scanf_scanset;
|
|
|
|
/**
|
|
* Init a u_scanf_scanset.
|
|
* @param scanset A pointer to the u_scanf_scanset to init.
|
|
* @param s A pointer to the first character in the scanset
|
|
* @param len On input, a pointer to the length of <TT>s</TT>. On output,
|
|
* a pointer to the number of characters parsed, excluding the final ']'
|
|
* @return TRUE if successful, FALSE otherwise.
|
|
*/
|
|
bool_t
|
|
u_scanf_scanset_init(u_scanf_scanset *scanset,
|
|
const UChar *s,
|
|
int32_t *len);
|
|
|
|
/**
|
|
* Determine if a UChar is in a u_scanf_scanset
|
|
* @param scanset A pointer to a u_scanf_scanset
|
|
* @param c The UChar to test.
|
|
* @return TRUE if the UChar is in the scanset, FALSE otherwise
|
|
*/
|
|
bool_t
|
|
u_scanf_scanset_in(u_scanf_scanset *scanset,
|
|
UChar c);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|