ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uspoof.h
Go to the documentation of this file.
1 /*
2 ***************************************************************************
3 * Copyright (C) 2008-2010, International Business Machines Corporation
4 * and others. All Rights Reserved.
5 ***************************************************************************
6 * file name: uspoof.h
7 * encoding: US-ASCII
8 * tab size: 8 (not used)
9 * indentation:4
10 *
11 * created on: 2008Feb13
12 * created by: Andy Heninger
13 *
14 * Unicode Spoof Detection
15 */
16 
17 #ifndef USPOOF_H
18 #define USPOOF_H
19 
20 #include "unicode/utypes.h"
21 #include "unicode/uset.h"
22 #include "unicode/parseerr.h"
23 #include "unicode/localpointer.h"
24 
25 #if !UCONFIG_NO_NORMALIZATION
26 
27 
28 #if U_SHOW_CPLUSPLUS_API
29 #include "unicode/unistr.h"
30 #include "unicode/uniset.h"
31 
33 #endif
34 
35 
146 struct USpoofChecker;
147 typedef struct USpoofChecker USpoofChecker;
156 typedef enum USpoofChecks {
163 
173 
184 
192 
198 
206 
212 
213  USPOOF_ALL_CHECKS = 0x7f
214  } USpoofChecks;
215 
216 
228 uspoof_open(UErrorCode *status);
229 
230 
253 uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActualLength,
254  UErrorCode *pErrorCode);
255 
288 uspoof_openFromSource(const char *confusables, int32_t confusablesLen,
289  const char *confusablesWholeScript, int32_t confusablesWholeScriptLen,
290  int32_t *errType, UParseError *pe, UErrorCode *status);
291 
292 
298 U_STABLE void U_EXPORT2
300 
301 #if U_SHOW_CPLUSPLUS_API
302 
304 
314 U_DEFINE_LOCAL_OPEN_POINTER(LocalUSpoofCheckerPointer, USpoofChecker, uspoof_close);
315 
317 
318 #endif
319 
330 uspoof_clone(const USpoofChecker *sc, UErrorCode *status);
331 
332 
345 U_STABLE void U_EXPORT2
346 uspoof_setChecks(USpoofChecker *sc, int32_t checks, UErrorCode *status);
347 
359 U_STABLE int32_t U_EXPORT2
360 uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status);
361 
404 U_STABLE void U_EXPORT2
405 uspoof_setAllowedLocales(USpoofChecker *sc, const char *localesList, UErrorCode *status);
406 
428 U_STABLE const char * U_EXPORT2
430 
431 
450 U_STABLE void U_EXPORT2
451 uspoof_setAllowedChars(USpoofChecker *sc, const USet *chars, UErrorCode *status);
452 
453 
474 U_STABLE const USet * U_EXPORT2
476 
477 
478 #if U_SHOW_CPLUSPLUS_API
479 
497 U_STABLE void U_EXPORT2
498 uspoof_setAllowedUnicodeSet(USpoofChecker *sc, const UnicodeSet *chars, UErrorCode *status);
499 
500 
522 uspoof_getAllowedUnicodeSet(const USpoofChecker *sc, UErrorCode *status);
523 #endif
524 
525 
554 U_STABLE int32_t U_EXPORT2
555 uspoof_check(const USpoofChecker *sc,
556  const UChar *text, int32_t length,
557  int32_t *position,
558  UErrorCode *status);
559 
560 
589 U_STABLE int32_t U_EXPORT2
591  const char *text, int32_t length,
592  int32_t *position,
593  UErrorCode *status);
594 
595 
596 #if U_SHOW_CPLUSPLUS_API
597 
622 U_STABLE int32_t U_EXPORT2
623 uspoof_checkUnicodeString(const USpoofChecker *sc,
625  int32_t *position,
626  UErrorCode *status);
627 
628 #endif
629 
630 
670 U_STABLE int32_t U_EXPORT2
672  const UChar *s1, int32_t length1,
673  const UChar *s2, int32_t length2,
674  UErrorCode *status);
675 
676 
677 
703 U_STABLE int32_t U_EXPORT2
705  const char *s1, int32_t length1,
706  const char *s2, int32_t length2,
707  UErrorCode *status);
708 
709 
710 
711 
712 #if U_SHOW_CPLUSPLUS_API
713 
734 U_STABLE int32_t U_EXPORT2
735 uspoof_areConfusableUnicodeString(const USpoofChecker *sc,
738  UErrorCode *status);
739 #endif
740 
741 
774 U_STABLE int32_t U_EXPORT2
776  uint32_t type,
777  const UChar *s, int32_t length,
778  UChar *dest, int32_t destCapacity,
779  UErrorCode *status);
780 
816 U_STABLE int32_t U_EXPORT2
818  uint32_t type,
819  const char *s, int32_t length,
820  char *dest, int32_t destCapacity,
821  UErrorCode *status);
822 
823 #if U_SHOW_CPLUSPLUS_API
824 
853 uspoof_getSkeletonUnicodeString(const USpoofChecker *sc,
854  uint32_t type,
855  const UnicodeString &s,
856  UnicodeString &dest,
857  UErrorCode *status);
858 #endif /* U_SHOW_CPLUSPLUS_API */
859 
860 
879 U_STABLE int32_t U_EXPORT2
881  void *data, int32_t capacity,
882  UErrorCode *status);
883 
884 
885 #endif
886 
887 #endif /* USPOOF_H */