wind(3)
π wind β the Heimdal wind library π
okay so bestie, welcome to wind(3), aka the Heimdal wind library's very own corner of the manual. it's giving "tiny C library that does big character-encoding energy" and honestly? we're obsessed. π¦
β¨ SYNOPSIS β¨
π Functions π
int wind_punycode_label_toascii (const uint32_t *in, size_t in_len, char *out, size_t *out_len)
int wind_stringprep (const uint32_t *in, size_t in_len, uint32_t *out, size_t *out_len, wind_profile_flags flags)
int wind_profile (const char *name, wind_profile_flags *flags)
int wind_utf8ucs4 (const char *in, uint32_t *out, size_t *out_len)
int wind_utf8ucs4_length (const char *in, size_t *out_len)
int wind_ucs4utf8 (const uint32_t *in, size_t in_len, char *out, size_t *out_len)
int wind_ucs4utf8_length (const uint32_t *in, size_t in_len, size_t *out_len)
int wind_ucs2read (const void *ptr, size_t len, unsigned int *flags, uint16_t *out, size_t *out_len)
int wind_ucs2write (const uint16_t *in, size_t in_len, unsigned int *flags, void *ptr, size_t *out_len)
int wind_utf8ucs2 (const char *in, uint16_t *out, size_t *out_len)
int wind_utf8ucs2_length (const char *in, size_t *out_len)
int wind_ucs2utf8 (const uint16_t *in, size_t in_len, char *out, size_t *out_len)
int wind_ucs2utf8_length (const uint16_t *in, size_t in_len, size_t *out_len)
look at all those lil encoding converters. they're all serving int return values and honestly they ate. π
πΈ Detailed Description πΈ
bestie, this section is literally empty in the original. like, zero words. the whole lore lives down in Function Documentation instead. no cap, that's just how the Doxygen decided to do it. π
π Function Documentation π
int wind_profile (const char * name, wind_profile_flags * flags)
try to find the profile given a name. π
Parameters
nameβ name of the profile.flagsβ the resulting profile.
Returns
returns 0 on success, an wind error code otherwise.
int wind_punycode_label_toascii (const uint32_t * in, size_t in_len, char * out, size_t * out_len)
convert an UCS4 string to a puny-coded DNS label string, suitable when combined with delimiters and other labels for DNS lookup. it's giving "internationalized domain names but make it ASCII". π
Parameters
inβ an UCS4 string to convert.in_lenβ the length ofin.outβ the resulting puny-coded string. The string is not NUL terminatied. (their typo, not mine, we're keeping it, periodt β)out_lenβ before processingout_lenshould be the length of theoutvariable, after processing it will be the length of theoutstring.
Returns
returns 0 on success, an wind error code otherwise.
int wind_stringprep (const uint32_t * in, size_t in_len, uint32_t * out, size_t * out_len, wind_profile_flags flags)
process an input UCS4 string according to a string-prep profile. glamour pass, but for text. β¨
Parameters
inβ input UCS4 string to process.in_lenβ length of the input string.outβ output UCS4 string.out_lenβ length of the output string.flagsβ stringprep profile.
Returns
returns 0 on success, an wind error code otherwise.
int wind_ucs2read (const void * ptr, size_t len, unsigned int * flags, uint16_t * out, size_t * out_len)
read in an UCS2 from a buffer. π₯
Parameters
ptrβ The input buffer to read from.lenβ the length of the input buffer.flagsβ Flags to control the behavior of the function.outβ the output UCS2, the array must be at leastout/2long.out_lenβ the output length.
Returns
returns 0 on success, an wind error code otherwise.
extra tea, straight from the source: π΅ - iflenis zero, flags are unchanged - iflenis odd,WIND_ERR_LENGTH_NOT_MOD2is returned - If the flagsWIND_RW_BOMis set, check for BOM. If not BOM is found, check is LE/BE flag is already and use that otherwise fail withWIND_ERR_NO_BOM. When done, clearWIND_RW_BOMand the LE/BE flag and set the resulting LE/BE flag.
int wind_ucs2utf8 (const uint16_t * in, size_t in_len, char * out, size_t * out_len)
convert an UCS2 string to a UTF-8 string. π¦
Parameters
inβ an UCS2 string to convert.in_lenβ the length of theinUCS2 string.outβ the resulting UTF-8 strint, must be at leastwind_ucs2utf8_length()long. IfoutisNULL, the function will calculate the needed space for theoutvariable (just likewind_ucs2utf8_length()).out_lenβ before processingout_lenshould be the length of theoutvariable, after processing it will be the length of theoutstring.
Returns
returns 0 on success, an wind error code otherwise.
int wind_ucs2utf8_length (const uint16_t * in, size_t in_len, size_t * out_len)
calculate the length of from converting a UCS2 string to an UTF-8 string. yes, "length of from" β we don't edit the ancestors, we respect them. π
Parameters
inβ an UCS2 string to convert.in_lenβ an UCS2 string length to convert.out_lenβ the length of the resulting UTF-8 string.
Returns
returns 0 on success, an wind error code otherwise.
int wind_ucs2write (const uint16_t * in, size_t in_len, unsigned int * flags, void * ptr, size_t * out_len)
write an UCS2 string to a buffer. π€
Parameters
inβ The input UCS2 string.in_lenβ the length of the input buffer.flagsβ Flags to control the behavior of the function.ptrβ The input buffer to write to, the array must be at least(in + 1) * 2bytes long.out_lenβ the output length.
Returns
returns 0 on success, an wind error code otherwise.
more rules, bestie, read them fr fr: π - Ifinbuffer is not of length be mod 2,WIND_ERR_LENGTH_NOT_MOD2is returned - On zero input length, flags are preserved - If flags haveWIND_RW_BOMset, the byte order mark is written first to the output data - If the output wont fit intoout_len,WIND_ERR_OVERRUNis returned
int wind_ucs4utf8 (const uint32_t * in, size_t in_len, char * out, size_t * out_len)
convert an UCS4 string to a UTF-8 string. π
Parameters
inβ an UCS4 string to convert.in_lenβ the length input array.outβ the resulting UTF-8 strint, must be at leastwind_ucs4utf8_length() + 1long (the extra char for the NUL). IfoutisNULL, the function will calculate the needed space for theoutvariable (just likewind_ucs4utf8_length()).out_lenβ before processingout_lenshould be the length of theoutvariable, after processing it will be the length of theoutstring.
Returns
returns 0 on success, an wind error code otherwise.
int wind_ucs4utf8_length (const uint32_t * in, size_t in_len, size_t * out_len)
calculate the length of from converting a UCS4 string to an UTF-8 string. πΈ
Parameters
inβ an UCS4 string to convert.in_lenβ the length of UCS4 string to convert.out_lenβ the length of the resulting UTF-8 string.
Returns
returns 0 on success, an wind error code otherwise.
int wind_utf8ucs2 (const char * in, uint16_t * out, size_t * out_len)
convert an UTF-8 string to an UCS2 string. the reverse direction, she contains multitudes. π
Parameters
inβ an UTF-8 string to convert.outβ the resulting UCS2 strint, must be at leastwind_utf8ucs2_length()long. IfoutisNULL, the function will calculate the needed space for theoutvariable (just likewind_utf8ucs2_length()).out_lenβ before processingout_lenshould be the length of theoutvariable, after processing it will be the length of theoutstring.
Returns
returns 0 on success, an wind error code otherwise.
int wind_utf8ucs2_length (const char * in, size_t * out_len)
calculate the length of from converting a UTF-8 string to a UCS2 string. π
Parameters
inβ an UTF-8 string to convert.out_lenβ the length of the resulting UCS4 string.
Returns
returns 0 on success, an wind error code otherwise.
int wind_utf8ucs4 (const char * in, uint32_t * out, size_t * out_len)
convert an UTF-8 string to an UCS4 string. π¦
Parameters
inβ an UTF-8 string to convert.outβ the resulting UCS4 strint, must be at leastwind_utf8ucs4_length()long. IfoutisNULL, the function will calculate the needed space for theoutvariable (just likewind_utf8ucs4_length()).out_lenβ before processingout_lenshould be the length of theoutvariable, after processing it will be the length of theoutstring.
Returns
returns 0 on success, an wind error code otherwise.
int wind_utf8ucs4_length (const char * in, size_t * out_len)
calculate the length of from converting a UTF-8 string to a UCS4 string. π«Ά
Parameters
inβ an UTF-8 string to convert.out_lenβ the length of the resulting UCS4 string.
Returns
returns 0 on success, an wind error code otherwise.
π Author π
Generated automatically by Doxygen for Heimdal wind library from the source code. not a human author, just Doxygen doing its lil autopilot thing. iconic honestly. π€π
and that's the whole page, bestie!! this was Version 7.8.0, dated Tue Nov 15 2022, brought to you by the Heimdal wind library. go forth and convert your encodings, you absolute main character. βππ
π¦ where this page comes from
- alpine 3.22: heimdal-doc 7.8.0-r4 Β· BSD-3-Clause
- alpine 3.23: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- alpine 3.24: heimdal-doc 7.8.0-r5 Β· BSD-3-Clause
- epel 10: heimdal-devel 7.8.0-26.el10_2 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- epel 9: heimdal-devel 7.8.0-5.el9 Β· BSD and MIT
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 43: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-26.fc43 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- fedora 44: heimdal-devel 7.8.0-28.fc44 Β· BSD-2-Clause AND BSD-3-Clause AND HPND-export-US AND HPND-export2-US AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms