ffutf
Utility functions for manipulating Unicode Transformation Format (UTF) compatible data
Macros | Functions | Variables
ffutf.h File Reference

Header definitions for ffutf. More...

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <limits.h>
Include dependency graph for ffutf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FFUTF_PARSE   1
 Generic UTF parsing error.
 
#define FFUTF_EARLY   2
 Parsing finished early (an error).
 
#define FFUTF_16LOW   4
 In the UTF-16 string parsed, a high surrogate was found but the lower surrogate was not.
 
#define FFUTF_INVAL   8
 UTF codepoint was invalid (not in valid range).
 
#define FFUTF_IMPLM   16
 Not implemented.
 
#define NONE   0
 No type specified.
 
#define LE   2
 Little-endian (ignored for UTF8)
 
#define BE   3
 Big-endian (ignored for UTF8)
 
#define UTF8   4
 UTF8 encoding.
 
#define UTF16   8
 UTF16 encoding.
 
#define UTF32   16
 UTF32 encoding.
 
#define UTFERR   -2u
 fgetc_u or fwrite_u will return this value upon any non-standard (ffutf-specific) error.
 
#define ISASCII(ch)   ((ch) & 0x7f == (ch))
 Helper macro to check if a UTF8 or UTF32 character is an ASCII character.
 

Functions

uint32_t fgetc_u (FILE *fp, int type)
 
size_t fwrite_u (uint32_t c, FILE *fp, int type)
 
size_t strlen_u (const char *s, int type)
 Length of a unicode string. More...
 
size_t strnlen_u (const char *s, size_t max_len, int type)
 Length of a unicode string with a length limit. More...
 

Variables

int ffutf_errno
 

Detailed Description

Header definitions for ffutf.

Author
FoofyFox

Variable Documentation

◆ ffutf_errno

int ffutf_errno
extern

External variable for errors in functions of ffutf