/usr/include/unicode
NameSizeModeActions
basictz.h89130644editdlrm
bms.h86640644editdlrm
bmsearch.h73160644editdlrm
brkiter.h230010644editdlrm
bytestream.h85310644editdlrm
calendar.h906590644editdlrm
caniter.h72880644editdlrm
chariter.h241860644editdlrm
choicfmt.h295280644editdlrm
coleitr.h129900644editdlrm
coll.h484680644editdlrm
colldata.h119570644editdlrm
curramt.h36590644editdlrm
currpinf.h70610644editdlrm
currunit.h30570644editdlrm
datefmt.h279460644editdlrm
dbbi.h9660644editdlrm
dcfmtsym.h140400644editdlrm
decimfmt.h886120644editdlrm
docmain.h60030644editdlrm
dtfmtsym.h261450644editdlrm
dtintrv.h37340644editdlrm
dtitvfmt.h397000644editdlrm
dtitvinf.h187040644editdlrm
dtptngen.h173030644editdlrm
dtrule.h87180644editdlrm
errorcode.h43610644editdlrm
fieldpos.h87130644editdlrm
fmtable.h187940644editdlrm
format.h120830644editdlrm
gregocal.h337970644editdlrm
locid.h302410644editdlrm
measfmt.h18970644editdlrm
measunit.h16350644editdlrm
measure.h33210644editdlrm
msgfmt.h394350644editdlrm
normlzr.h303370644editdlrm
numfmt.h339870644editdlrm
numsys.h50040644editdlrm
parseerr.h30440644editdlrm
parsepos.h54680644editdlrm
platform.h99610644editdlrm
plurfmt.h230790644editdlrm
plurrule.h99010644editdlrm
ppalmos.h69920644editdlrm
putil.h66860644editdlrm
pwin32.h86680644editdlrm
rbbi.h269930644editdlrm
rbnf.h456810644editdlrm
rbtz.h156950644editdlrm
regex.h523160644editdlrm
rep.h95590644editdlrm
resbund.h181300644editdlrm
schriter.h62930644editdlrm
search.h223570644editdlrm
simpletz.h461790644editdlrm
smpdtfmt.h483250644editdlrm
sortkey.h111110644editdlrm
std_string.h17690644editdlrm
strenum.h98880644editdlrm
stringpiece.h54840644editdlrm
stsearch.h222870644editdlrm
symtable.h41990644editdlrm
tblcoll.h381990644editdlrm
timezone.h345840644editdlrm
tmunit.h34540644editdlrm
tmutamt.h47870644editdlrm
tmutfmt.h86690644editdlrm
translit.h547800644editdlrm
tzrule.h360570644editdlrm
tztrans.h61010644editdlrm
ubidi.h830920644editdlrm
ubrk.h176880644editdlrm
ucal.h401770644editdlrm
ucasemap.h164200644editdlrm
ucat.h53710644editdlrm
uchar.h1110620644editdlrm
uchriter.h131320644editdlrm
uclean.h118550644editdlrm
ucnv.h831110644editdlrm
ucnvsel.h56300644editdlrm
ucnv_cb.h66350644editdlrm
ucnv_err.h213750644editdlrm
ucol.h488260644editdlrm
ucoleitr.h123560644editdlrm
uconfig.h60350644editdlrm
ucsdet.h124640644editdlrm
ucurr.h115720644editdlrm
udat.h344960644editdlrm
udata.h142650644editdlrm
udatpg.h187150644editdlrm
udeprctd.h22840644editdlrm
udraft.h76000644editdlrm
uenum.h57960644editdlrm
uidna.h159180644editdlrm
uintrnal.h157520644editdlrm
uiter.h232340644editdlrm
uloc.h445480644editdlrm
ulocdata.h97390644editdlrm
umachine.h113600644editdlrm
umisc.h12550644editdlrm
umsg.h260760644editdlrm
unifilt.h37700644editdlrm
unifunct.h39660644editdlrm
unimatch.h60710644editdlrm
unirepl.h32900644editdlrm
uniset.h617710644editdlrm
unistr.h1613210644editdlrm
unorm.h236210644editdlrm
unum.h321450644editdlrm
uobject.h113930644editdlrm
uobslete.h8520644editdlrm
uregex.h439480644editdlrm
urename.h925380644editdlrm
urep.h53940644editdlrm
ures.h363480644editdlrm
uscript.h113600644editdlrm
usearch.h342230644editdlrm
uset.h398680644editdlrm
usetiter.h96060644editdlrm
ushape.h179070644editdlrm
uspoof.h387520644editdlrm
usprep.h77500644editdlrm
ustdio.h353330644editdlrm
ustream.h18910644editdlrm
ustring.h693830644editdlrm
usystem.h19250644editdlrm
utext.h583940644editdlrm
utf.h82730644editdlrm
utf8.h205120644editdlrm
utf16.h187760644editdlrm
utf32.h6530644editdlrm
utf_old.h436460644editdlrm
utmscale.h136890644editdlrm
utrace.h133550644editdlrm
utrans.h231290644editdlrm
utypes.h345130644editdlrm
uversion.h109020644editdlrm
vtzone.h200480644editdlrm
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 UCD object holds the Collator-specific data needed to * compute the length of the shortest string that can * generate a partcular list of CEs. * * UCD objects are quite expensive to compute. Because * of this, they are cached. When you call ucd_open it * returns a reference counted cached object. When you call ucd_close * 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 * ucd_flushCCache. If you no longer need any UCD * objects, you can call ucd_freeCache */ typedef void UCD; /** * Open a UCD object. * * @param coll - the collator * @param status - will be set if any errors occur. * * @return the UCD object. You must call * ucd_close 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 ucd_close. * * @internal ICU 4.0.1 technology preview */ U_CAPI UCD * U_EXPORT2 ucd_open(UCollator *coll, UErrorCode *status); /** * Release a UCD object. * * @param ucd - the object * * @internal ICU 4.0.1 technology preview */ U_CAPI void U_EXPORT2 ucd_close(UCD *ucd); /** * Get the UCollator object used to create a UCD object. * The UCollator 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 UCD object * * @return the UCollator used to create the given * UCD object. * * @internal ICU 4.0.1 technology preview */ U_CAPI UCollator * U_EXPORT2 ucd_getCollator(UCD *ucd); /** * UCD 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 close * for each UCD object that you have used. also, * DO NOT call this if another thread may be calling ucd_flushCache * at the same time. * * @internal ICU 4.0.1 technology preview */ U_CAPI void U_EXPORT2 ucd_freeCache(); /** * UCD objects are expensive to compute, and so * may be cached. This routine will remove any unused UCD * 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 UCD object by calling ucd_open. * Then you construct a BMS object from the UCD object, the pattern * string and the target string. Then you call the search method. Here's a code sample: * *
 * 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();
 * }
 * 
* * 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 MBS object. * * @param ucd - A UCD 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 BMS object. * * Note: if on return status is set to an error, the only safe * thing to do with the returned object is to call * bms_close. * * @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 BMS object and release all the * storage associated with it. * * @param bms - the BMS 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 BMS object * @return TRUE 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 UCD object used to create * a given BMS object. * * @param bms - the BMS object * * @return - the UCD object used to create * the given BMS 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 BMS 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 TRUE if the match succeeds, FALSE 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 BMS 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 */