cake
/
libg1m
Archived
1
0
Fork 0
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libg1m/include/libg1m/fontcharacter.h

44 lines
2.0 KiB
C

/* ************************************************************************** */
/* _____ _ */
/* libg1m/fontcharacter.h |_ _|__ _ _| |__ ___ _ _ */
/* | Project: libg1m | |/ _ \| | | | '_ \ / _ \ | | | */
/* | | (_) | |_| | | | | __/ |_| | */
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
/* Last updated: 2016/11/21 09:26:47 |___/ */
/* */
/* ************************************************************************** */
#ifndef LIBG1M_FONTCHARACTER_H
# define LIBG1M_FONTCHARACTER_H
# include <stdlib.h>
# include <stdint.h>
# define FC_MB_MAX 2
# ifdef __cplusplus
extern "C" {
# endif
/* ************************************************************************** */
/* Main type */
/* ************************************************************************** */
/* CASIO's character encoding, named `FONTCHARACTER` by its SDK, is a simple
* multibyte one : if the character is a special one, then the next one is
* to read.
*
* Special characters are: 0x7F, 0xF7, 0xF9, 0xE5, 0xE6, 0xE7. */
typedef uint16_t FONTCHARACTER;
/* ************************************************************************** */
/* Utilities */
/* ************************************************************************** */
/* encoding characters */
int g1m_mbtofc(FONTCHARACTER *pfc, const char *s, size_t n);
int g1m_fctomb(char *s, FONTCHARACTER fc);
/* encoding strings */
size_t g1m_mbstofcs(FONTCHARACTER *dst, const char *src, size_t n);
size_t g1m_fcstombs(char *dst, const FONTCHARACTER *src, size_t n);
# ifdef __cplusplus
}
# endif
#endif /* LIBG1M_FONTCHARACTER_H */