1#ifndef c_phonenumberutil_h
2#define c_phonenumberutil_h
6#include "c_phonenumber.h"
8// Copied from PhoneNumberUtil::PhoneNumberFormat
9// is_same_enum verifies that these values didn't change
10enum phone_number_format {
17// Copied from PhoneNumberUtil::PhoneNumberType
18// is_same_enum verifies that these values didn't change
35// Copied from PhoneNumberUtil::MatchType
36// is_same_enum verifies that these values didn't change
45// Copied from PhoneNumberUtil::ErrorType
46// is_same_enum verifies that these values didn't change
50 INVALID_COUNTRY_CODE_ERROR,
57// Copied from PhoneNumberUtil::ValidationResult
58// is_same_enum verifies that these values didn't change
62 IS_POSSIBLE_LOCAL_ONLY,
69// A string allocated by malloc, might not include the null terminator.
70// It is haskell's responsibility to free it.
77// In the functions below, if an output parameter is a string, we malloc a
78// buffer and write its pointer and size into the given c_string *.
80// If an input parameter is a string, we "unpack" the c_string into a pair of
81// char const * + size_t, because c2hs cannot natively pass structs by value.
83// If the output is a list of T, we malloc a buffer and write its pointer into
84// the given T **, and its size (in T's) into the given size_t *.
85// If the output is a list of strings, we do the same as if T=c_string.
87// If the output is a PhoneNumber, we either return a PhoneNumber *, or write
88// it into a provided PhoneNumber **. In both cases the PhoneNumber object is
89// allocated by `new` and managed by C++ RAII. In all cases it is haskell's
90// responsibility to call its finalizer (c_phone_number_free);
91void c_phone_number_util_get_supported_regions(c_string **, size_t *);
92void c_phone_number_util_get_supported_global_network_calling_codes(int **, size_t *);
93void c_phone_number_util_get_supported_calling_codes(int **, size_t *);
94void c_phone_number_util_get_supported_types_for_region(char const *, size_t, enum phone_number_type **, size_t *);
95void c_phone_number_util_get_supported_types_for_non_geo_entity(int, enum phone_number_type **, size_t *);
96int c_phone_number_util_is_alpha_number(char const *, size_t);
97void c_phone_number_util_convert_alpha_characters_in_number(char const *, size_t, c_string *);
98void c_phone_number_util_normalize_digits_only(char const *, size_t, c_string *);
99void c_phone_number_util_normalize_dialable_chars_only(char const *, size_t, c_string *);
100void c_phone_number_util_get_national_significant_number(struct CxxPhoneNumber const *, c_string *);
101void c_phone_number_util_get_country_mobile_token(int, c_string *);
102void c_phone_number_util_format(struct CxxPhoneNumber const *, enum phone_number_format, c_string *);
103void c_phone_number_util_format_national_number_with_carrier_code(struct CxxPhoneNumber const *, char const *, size_t, c_string *);
104void c_phone_number_util_format_national_number_with_preferred_carrier_code(struct CxxPhoneNumber const *, char const *, size_t, c_string *);
105void c_phone_number_util_format_number_for_mobile_dialing(struct CxxPhoneNumber const *, char const *, size_t, int, c_string *);
106void c_phone_number_util_format_out_of_country_calling_number(struct CxxPhoneNumber const *, char const *, size_t, c_string *);
107void c_phone_number_util_format_in_original_format(struct CxxPhoneNumber const *, char const *, size_t, c_string *);
108void c_phone_number_util_format_out_of_country_keeping_alpha_chars(struct CxxPhoneNumber const *, char const *, size_t, c_string *);
109// /!\ May return NULL
110struct CxxPhoneNumber *c_phone_number_util_truncate_too_long_number(struct CxxPhoneNumber const *);
111enum phone_number_type c_phone_number_util_get_number_type(struct CxxPhoneNumber const *);
112int c_phone_number_util_is_valid_number(struct CxxPhoneNumber const *);
113int c_phone_number_util_is_valid_number_for_region(struct CxxPhoneNumber const *, char const *, size_t);
114void c_phone_number_util_get_region_code_for_number(struct CxxPhoneNumber const *, c_string *);
115int c_phone_number_util_get_country_code_for_region(char const *, size_t);
116void c_phone_number_util_get_region_code_for_country_code(int, c_string *);
117void c_phone_number_util_get_region_codes_for_country_calling_code(int, c_string **, size_t *);
118int c_phone_number_util_is_nanpa_country(char const *, size_t);
119void c_phone_number_util_get_ndd_prefix_for_region(char const *, size_t, int, c_string *);
120enum validation_result c_phone_number_util_is_possible_number_for_type_with_reason(struct CxxPhoneNumber const *, enum phone_number_type);
121int c_phone_number_util_can_be_internationally_dialed(struct CxxPhoneNumber const *);
122int c_phone_number_util_is_number_geographical_1(struct CxxPhoneNumber const *);
123int c_phone_number_util_is_number_geographical_2(enum phone_number_type, int);
124enum error_type c_phone_number_util_parse(char const *, size_t, char const *, size_t, struct CxxPhoneNumber **);
125enum error_type c_phone_number_util_parse_and_keep_raw_input(char const *, size_t, char const *, size_t, struct CxxPhoneNumber **);
126enum match_type c_phone_number_util_is_number_match(struct CxxPhoneNumber const *, struct CxxPhoneNumber const *);
127enum match_type c_phone_number_util_is_number_match_with_two_strings(char const *, size_t, char const *, size_t);
128enum match_type c_phone_number_util_is_number_match_with_one_string(struct CxxPhoneNumber const *, char const *, size_t);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list