ICU 56.1  56.1
 All Data Structures Namespaces 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-2015, 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 #endif
32 
33 
152 struct USpoofChecker;
153 typedef struct USpoofChecker USpoofChecker;
162 typedef enum USpoofChecks {
169 
179 
190 
198 
213 
214 #ifndef U_HIDE_DEPRECATED_API
215 
221 #endif /* U_HIDE_DEPRECATED_API */
222 
230 
236 
244 
251 
264  USPOOF_AUX_INFO = 0x40000000
265 
266  } USpoofChecks;
267 
268 
274  typedef enum URestrictionLevel {
280  USPOOF_ASCII = 0x10000000,
312  USPOOF_UNRESTRICTIVE = 0x60000000,
320 
331 U_STABLE USpoofChecker * U_EXPORT2
332 uspoof_open(UErrorCode *status);
333 
334 
356 U_STABLE USpoofChecker * U_EXPORT2
357 uspoof_openFromSerialized(const void *data, int32_t length, int32_t *pActualLength,
358  UErrorCode *pErrorCode);
359 
391 U_STABLE USpoofChecker * U_EXPORT2
392 uspoof_openFromSource(const char *confusables, int32_t confusablesLen,
393  const char *confusablesWholeScript, int32_t confusablesWholeScriptLen,
394  int32_t *errType, UParseError *pe, UErrorCode *status);
395 
396 
402 U_STABLE void U_EXPORT2
404 
405 #if U_SHOW_CPLUSPLUS_API
406 
408 
419 
421 
422 #endif
423 
433 U_STABLE USpoofChecker * U_EXPORT2
434 uspoof_clone(const USpoofChecker *sc, UErrorCode *status);
435 
436 
449 U_STABLE void U_EXPORT2
450 uspoof_setChecks(USpoofChecker *sc, int32_t checks, UErrorCode *status);
451 
463 U_STABLE int32_t U_EXPORT2
464 uspoof_getChecks(const USpoofChecker *sc, UErrorCode *status);
465 
474 U_STABLE void U_EXPORT2
476 
477 
485 U_STABLE URestrictionLevel U_EXPORT2
487 
530 U_STABLE void U_EXPORT2
531 uspoof_setAllowedLocales(USpoofChecker *sc, const char *localesList, UErrorCode *status);
532 
554 U_STABLE const char * U_EXPORT2
556 
557 
576 U_STABLE void U_EXPORT2
577 uspoof_setAllowedChars(USpoofChecker *sc, const USet *chars, UErrorCode *status);
578 
579 
600 U_STABLE const USet * U_EXPORT2
602 
603 
604 #if U_SHOW_CPLUSPLUS_API
605 
623 U_STABLE void U_EXPORT2
625 
626 
647 U_STABLE const icu::UnicodeSet * U_EXPORT2
649 #endif
650 
651 
678 U_STABLE int32_t U_EXPORT2
679 uspoof_check(const USpoofChecker *sc,
680  const UChar *id, int32_t length,
681  int32_t *position,
682  UErrorCode *status);
683 
684 
712 U_STABLE int32_t U_EXPORT2
714  const char *id, int32_t length,
715  int32_t *position,
716  UErrorCode *status);
717 
718 
719 #if U_SHOW_CPLUSPLUS_API
720 
743 U_STABLE int32_t U_EXPORT2
745  const icu::UnicodeString &id,
746  int32_t *position,
747  UErrorCode *status);
748 
749 #endif
750 
751 
791 U_STABLE int32_t U_EXPORT2
793  const UChar *id1, int32_t length1,
794  const UChar *id2, int32_t length2,
795  UErrorCode *status);
796 
797 
798 
824 U_STABLE int32_t U_EXPORT2
826  const char *id1, int32_t length1,
827  const char *id2, int32_t length2,
828  UErrorCode *status);
829 
830 
831 
832 
833 #if U_SHOW_CPLUSPLUS_API
834 
855 U_STABLE int32_t U_EXPORT2
857  const icu::UnicodeString &s1,
858  const icu::UnicodeString &s2,
859  UErrorCode *status);
860 #endif
861 
862 
895 U_STABLE int32_t U_EXPORT2
897  uint32_t type,
898  const UChar *id, int32_t length,
899  UChar *dest, int32_t destCapacity,
900  UErrorCode *status);
901 
937 U_STABLE int32_t U_EXPORT2
939  uint32_t type,
940  const char *id, int32_t length,
941  char *dest, int32_t destCapacity,
942  UErrorCode *status);
943 
944 #if U_SHOW_CPLUSPLUS_API
945 
970 U_I18N_API icu::UnicodeString & U_EXPORT2
972  uint32_t type,
973  const icu::UnicodeString &id,
974  icu::UnicodeString &dest,
975  UErrorCode *status);
976 #endif /* U_SHOW_CPLUSPLUS_API */
977 
989 U_STABLE const USet * U_EXPORT2
991 
1003 U_STABLE const USet * U_EXPORT2
1005 
1006 #if U_SHOW_CPLUSPLUS_API
1007 
1019 U_STABLE const icu::UnicodeSet * U_EXPORT2
1021 
1033 U_STABLE const icu::UnicodeSet * U_EXPORT2
1035 
1036 #endif /* U_SHOW_CPLUSPLUS_API */
1037 
1060 U_STABLE int32_t U_EXPORT2
1062  void *data, int32_t capacity,
1063  UErrorCode *status);
1064 
1065 
1066 #endif
1067 
1068 #endif /* USPOOF_H */