/
usr
/
include
/
unicode
/
/usr/include/unicode
mkdir
upload
Name
Size
Mode
Actions
basictz.h
8913
0644
edit
dl
rm
bms.h
8664
0644
edit
dl
rm
bmsearch.h
7316
0644
edit
dl
rm
brkiter.h
23001
0644
edit
dl
rm
bytestream.h
8531
0644
edit
dl
rm
calendar.h
90659
0644
edit
dl
rm
caniter.h
7288
0644
edit
dl
rm
chariter.h
24186
0644
edit
dl
rm
choicfmt.h
29528
0644
edit
dl
rm
coleitr.h
12990
0644
edit
dl
rm
coll.h
48468
0644
edit
dl
rm
colldata.h
11957
0644
edit
dl
rm
curramt.h
3659
0644
edit
dl
rm
currpinf.h
7061
0644
edit
dl
rm
currunit.h
3057
0644
edit
dl
rm
datefmt.h
27946
0644
edit
dl
rm
dbbi.h
966
0644
edit
dl
rm
dcfmtsym.h
14040
0644
edit
dl
rm
decimfmt.h
88612
0644
edit
dl
rm
docmain.h
6003
0644
edit
dl
rm
dtfmtsym.h
26145
0644
edit
dl
rm
dtintrv.h
3734
0644
edit
dl
rm
dtitvfmt.h
39700
0644
edit
dl
rm
dtitvinf.h
18704
0644
edit
dl
rm
dtptngen.h
17303
0644
edit
dl
rm
dtrule.h
8718
0644
edit
dl
rm
errorcode.h
4361
0644
edit
dl
rm
fieldpos.h
8713
0644
edit
dl
rm
fmtable.h
18794
0644
edit
dl
rm
format.h
12083
0644
edit
dl
rm
gregocal.h
33797
0644
edit
dl
rm
locid.h
30241
0644
edit
dl
rm
measfmt.h
1897
0644
edit
dl
rm
measunit.h
1635
0644
edit
dl
rm
measure.h
3321
0644
edit
dl
rm
msgfmt.h
39435
0644
edit
dl
rm
normlzr.h
30337
0644
edit
dl
rm
numfmt.h
33987
0644
edit
dl
rm
numsys.h
5004
0644
edit
dl
rm
parseerr.h
3044
0644
edit
dl
rm
parsepos.h
5468
0644
edit
dl
rm
platform.h
9961
0644
edit
dl
rm
plurfmt.h
23079
0644
edit
dl
rm
plurrule.h
9901
0644
edit
dl
rm
ppalmos.h
6992
0644
edit
dl
rm
putil.h
6686
0644
edit
dl
rm
pwin32.h
8668
0644
edit
dl
rm
rbbi.h
26993
0644
edit
dl
rm
rbnf.h
45681
0644
edit
dl
rm
rbtz.h
15695
0644
edit
dl
rm
regex.h
52316
0644
edit
dl
rm
rep.h
9559
0644
edit
dl
rm
resbund.h
18130
0644
edit
dl
rm
schriter.h
6293
0644
edit
dl
rm
search.h
22357
0644
edit
dl
rm
simpletz.h
46179
0644
edit
dl
rm
smpdtfmt.h
48325
0644
edit
dl
rm
sortkey.h
11111
0644
edit
dl
rm
std_string.h
1769
0644
edit
dl
rm
strenum.h
9888
0644
edit
dl
rm
stringpiece.h
5484
0644
edit
dl
rm
stsearch.h
22287
0644
edit
dl
rm
symtable.h
4199
0644
edit
dl
rm
tblcoll.h
38199
0644
edit
dl
rm
timezone.h
34584
0644
edit
dl
rm
tmunit.h
3454
0644
edit
dl
rm
tmutamt.h
4787
0644
edit
dl
rm
tmutfmt.h
8669
0644
edit
dl
rm
translit.h
54780
0644
edit
dl
rm
tzrule.h
36057
0644
edit
dl
rm
tztrans.h
6101
0644
edit
dl
rm
ubidi.h
83092
0644
edit
dl
rm
ubrk.h
17688
0644
edit
dl
rm
ucal.h
40177
0644
edit
dl
rm
ucasemap.h
16420
0644
edit
dl
rm
ucat.h
5371
0644
edit
dl
rm
uchar.h
111062
0644
edit
dl
rm
uchriter.h
13132
0644
edit
dl
rm
uclean.h
11855
0644
edit
dl
rm
ucnv.h
83111
0644
edit
dl
rm
ucnvsel.h
5630
0644
edit
dl
rm
ucnv_cb.h
6635
0644
edit
dl
rm
ucnv_err.h
21375
0644
edit
dl
rm
ucol.h
48826
0644
edit
dl
rm
ucoleitr.h
12356
0644
edit
dl
rm
uconfig.h
6035
0644
edit
dl
rm
ucsdet.h
12464
0644
edit
dl
rm
ucurr.h
11572
0644
edit
dl
rm
udat.h
34496
0644
edit
dl
rm
udata.h
14265
0644
edit
dl
rm
udatpg.h
18715
0644
edit
dl
rm
udeprctd.h
2284
0644
edit
dl
rm
udraft.h
7600
0644
edit
dl
rm
uenum.h
5796
0644
edit
dl
rm
uidna.h
15918
0644
edit
dl
rm
uintrnal.h
15752
0644
edit
dl
rm
uiter.h
23234
0644
edit
dl
rm
uloc.h
44548
0644
edit
dl
rm
ulocdata.h
9739
0644
edit
dl
rm
umachine.h
11360
0644
edit
dl
rm
umisc.h
1255
0644
edit
dl
rm
umsg.h
26076
0644
edit
dl
rm
unifilt.h
3770
0644
edit
dl
rm
unifunct.h
3966
0644
edit
dl
rm
unimatch.h
6071
0644
edit
dl
rm
unirepl.h
3290
0644
edit
dl
rm
uniset.h
61771
0644
edit
dl
rm
unistr.h
161321
0644
edit
dl
rm
unorm.h
23621
0644
edit
dl
rm
unum.h
32145
0644
edit
dl
rm
uobject.h
11393
0644
edit
dl
rm
uobslete.h
852
0644
edit
dl
rm
uregex.h
43948
0644
edit
dl
rm
urename.h
92538
0644
edit
dl
rm
urep.h
5394
0644
edit
dl
rm
ures.h
36348
0644
edit
dl
rm
uscript.h
11360
0644
edit
dl
rm
usearch.h
34223
0644
edit
dl
rm
uset.h
39868
0644
edit
dl
rm
usetiter.h
9606
0644
edit
dl
rm
ushape.h
17907
0644
edit
dl
rm
uspoof.h
38752
0644
edit
dl
rm
usprep.h
7750
0644
edit
dl
rm
ustdio.h
35333
0644
edit
dl
rm
ustream.h
1891
0644
edit
dl
rm
ustring.h
69383
0644
edit
dl
rm
usystem.h
1925
0644
edit
dl
rm
utext.h
58394
0644
edit
dl
rm
utf.h
8273
0644
edit
dl
rm
utf8.h
20512
0644
edit
dl
rm
utf16.h
18776
0644
edit
dl
rm
utf32.h
653
0644
edit
dl
rm
utf_old.h
43646
0644
edit
dl
rm
utmscale.h
13689
0644
edit
dl
rm
utrace.h
13355
0644
edit
dl
rm
utrans.h
23129
0644
edit
dl
rm
utypes.h
34513
0644
edit
dl
rm
uversion.h
10902
0644
edit
dl
rm
vtzone.h
20048
0644
edit
dl
rm
Edit:
/usr/include/unicode/bms.h
(8664B)
/* * Copyright (C) 1996-2009, International Business Machines Corporation and Others. * All rights reserved. */ /** * \file * \brief C API: Boyer-Moore StringSearch prototype. * \internal */ #ifndef _BMS_H #define _BMS_H #include "unicode/utypes.h" #if !UCONFIG_NO_COLLATION #include "unicode/ucol.h" /** * A <code>UCD</code> object holds the Collator-specific data needed to * compute the length of the shortest string that can * generate a partcular list of CEs. * * <code>UCD</code> objects are quite expensive to compute. Because * of this, they are cached. When you call <code>ucd_open</code> it * returns a reference counted cached object. When you call <code>ucd_close</code> * the reference count on the object is decremented but the object is not deleted. * * If you do not need to reuse any unreferenced objects in the cache, you can call * <code>ucd_flushCCache</code>. If you no longer need any <code>UCD</code> * objects, you can call <code>ucd_freeCache</code> */ typedef void UCD; /** * Open a <code>UCD</code> object. * * @param coll - the collator * @param status - will be set if any errors occur. * * @return the <code>UCD</code> object. You must call * <code>ucd_close</code> when you are done using the object. * * Note: if on return status is set to an error, the only safe * thing to do with the returned object is to call <code>ucd_close</code>. * * @internal ICU 4.0.1 technology preview */ U_CAPI UCD * U_EXPORT2 ucd_open(UCollator *coll, UErrorCode *status); /** * Release a <code>UCD</code> object. * * @param ucd - the object * * @internal ICU 4.0.1 technology preview */ U_CAPI void U_EXPORT2 ucd_close(UCD *ucd); /** * Get the <code>UCollator</code> object used to create a <code>UCD</code> object. * The <code>UCollator</code> object returned may not be the exact * object that was used to create this object, but it will have the * same behavior. * * @param ucd - the <code>UCD</code> object * * @return the <code>UCollator</code> used to create the given * <code>UCD</code> object. * * @internal ICU 4.0.1 technology preview */ U_CAPI UCollator * U_EXPORT2 ucd_getCollator(UCD *ucd); /** * <code>UCD</code> objects are expensive to compute, and so * may be cached. This routine will free the cached objects and delete * the cache. * * WARNING: Don't call this until you are have called <code>close</code> * for each <code>UCD</code> object that you have used. also, * DO NOT call this if another thread may be calling <code>ucd_flushCache</code> * at the same time. * * @internal ICU 4.0.1 technology preview */ U_CAPI void U_EXPORT2 ucd_freeCache(); /** * <code>UCD</code> objects are expensive to compute, and so * may be cached. This routine will remove any unused <code>UCD</code> * objects from the cache. * * @internal 4.0.1 technology preview */ U_CAPI void U_EXPORT2 ucd_flushCache(); /** * BMS * * This object holds the information needed to do a Collation sensitive Boyer-Moore search. It encapulates * the pattern, the "bad character" and "good suffix" tables, the Collator-based data needed to compute them, * and a reference to the text being searched. * * To do a search, you first need to get a <code>UCD</code> object by calling <code>ucd_open</code>. * Then you construct a <code>BMS</code> object from the <code>UCD</code> object, the pattern * string and the target string. Then you call the <code>search</code> method. Here's a code sample: * * <pre> * void boyerMooreExample(UCollator *collator, UChar *pattern, int32_t patternLen, UChar *target, int32_t targetLength) * { * UErrorCode status = U_ZERO_ERROR; * int32_t offset = 0, start = -1, end = -1; * UCD *ucd = NULL); * BMS *bms = NULL; * * ucd = ucd_open(collator, &status); * if (U_FAILURE(status)) { * // could not create a UCD object * return; * } * * BMS *bms = bms_open(ucd, pattern, patternLength, target, targetlength, &status); * if (U_FAILURE(status)) { * // could not create a BMS object * ucd_close(ucd); * return; * } * * * // Find all matches * while (bms_search(bms, offset, &start, &end)) { * // process the match between start and end * ... * * // advance past the match * offset = end; * } * * // at this point, if offset == 0, there were no matches * if (offset == 0) { * // handle the case of no matches * } * * bms_close(bms); * ucd_close(ucd); * * // UCD objects are cached, so the call to * // ucd_close doesn't delete the object. * // Call this if you don't need the object any more. * ucd_flushCache(); * } * </pre> * * NOTE: This is a technology preview. The final version of this API may not bear any resenblence to this API. * * Knows linitations: * 1) Backwards searching has not been implemented. * * 2) For Han and Hangul characters, this code ignores any Collation tailorings. In general, * this isn't a problem, but in Korean locals, at strength 1, Hangul characters are tailored * to be equal to Han characters with the same pronounciation. Because this code ignroes * tailorings, searching for a Hangul character will not find a Han character and visa-versa. * * 3) In some cases, searching for a pattern that needs to be normalized and ends * in a discontiguous contraction may fail. The only known cases of this are with * the Tibetan script. For example searching for the pattern * "\u0F7F\u0F80\u0F81\u0F82\u0F83\u0F84\u0F85" will fail. (This case is artificial. We've * been unable to find a pratical, real-world example of this failure.) * * NOTE: This is a technology preview. The final version of this API may not bear any resenblence to this API. * * @internal ICU 4.0.1 technology preview */ struct BMS; typedef struct BMS BMS; /**< @see BMS */ /** * Construct a <code>MBS</code> object. * * @param ucd - A <code>UCD</code> object holding the Collator-sensitive data * @param pattern - the string for which to search * @param patternLength - the length of the string for which to search * @param target - the string in which to search * @param targetLength - the length of the string in which to search * @param status - will be set if any errors occur. * * @return the <code>BMS</code> object. * * Note: if on return status is set to an error, the only safe * thing to do with the returned object is to call * <code>bms_close</code>. * * @internal ICU 4.0.1 technology preview */ U_CAPI BMS * U_EXPORT2 bms_open(UCD *ucd, const UChar *pattern, int32_t patternLength, const UChar *target, int32_t targetLength, UErrorCode *status); /** * Close a <code>BMS</code> object and release all the * storage associated with it. * * @param bms - the <code>BMS</code> object to close. */ U_CAPI void U_EXPORT2 bms_close(BMS *bms); /** * Test the pattern to see if it generates any CEs. * * @param bms - the <code>BMS</code> object * @return <code>TRUE</code> if the pattern string did not generate any CEs * * @internal ICU 4.0.1 technology preview */ U_CAPI UBool U_EXPORT2 bms_empty(BMS *bms); /** * Get the <code>UCD</code> object used to create * a given <code>BMS</code> object. * * @param bms - the <code>BMS</code> object * * @return - the <code>UCD</code> object used to create * the given <code>BMS</code> object. * * @internal ICU 4.0.1 technology preview */ U_CAPI UCD * U_EXPORT2 bms_getData(BMS *bms); /** * Search for the pattern string in the target string. * * @param bms - the <code>BMS</code> object * @param offset - the offset in the target string at which to begin the search * @param start - will be set to the starting offset of the match, or -1 if there's no match * @param end - will be set to the ending offset of the match, or -1 if there's no match * * @return <code>TRUE</code> if the match succeeds, <code>FALSE</code> otherwise. * * @internal ICU 4.0.1 technology preview */ U_CAPI UBool U_EXPORT2 bms_search(BMS *bms, int32_t offset, int32_t *start, int32_t *end); /** * Set the target string for the match. * * @param bms - the <code>BMS</code> object * @param target - the new target string * @param targetLength - the length of the new target string * @param status - will be set if any errors occur. * * @internal ICU 4.0.1 technology preview */ U_CAPI void U_EXPORT2 bms_setTargetString(BMS *bms, const UChar *target, int32_t targetLength, UErrorCode *status); #endif #endif /* _BMS_H */
Save
cmd:
run