78 lines
2.6 KiB
C
78 lines
2.6 KiB
C
/* ************************************************************************** */
|
|
/* _____ _ */
|
|
/* libp7/types.h |_ _|__ _ _| |__ ___ _ _ */
|
|
/* | Project: libp7 | |/ _ \| | | | '_ \ / _ \ | | | */
|
|
/* | | (_) | |_| | | | | __/ |_| | */
|
|
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
|
|
/* Last updated: 2017/02/07 16:52:51 |___/ */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#ifndef LIBP7_TYPES_H
|
|
# define LIBP7_TYPES_H
|
|
# if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) \
|
|
&& !defined(__WINDOWS__)
|
|
# define __WINDOWS__
|
|
# endif
|
|
|
|
/* Main includes */
|
|
# include <stdlib.h>
|
|
# include <stdint.h>
|
|
# include <inttypes.h>
|
|
# ifdef __cplusplus
|
|
extern "C" {
|
|
# endif
|
|
|
|
/* ************************************************************************** */
|
|
/* Integer types */
|
|
/* ************************************************************************** */
|
|
/* integer types */
|
|
# define PRIuP7SHORT PRIuFAST16
|
|
# define PRIxP7SHORT PRIxFAST16
|
|
typedef uint_fast16_t p7ushort_t;
|
|
# define PRIuP7INT PRIuFAST32
|
|
# define PRIxP7INT PRIxFAST32
|
|
typedef uint_fast32_t p7uint_t;
|
|
|
|
/* Size_t-related printf format */
|
|
# ifndef PRIuSIZE
|
|
# if defined(_WIN64)
|
|
# define PRIuSIZE "l64u"
|
|
# elif defined(_WIN32)
|
|
# define PRIuSIZE "u"
|
|
# else
|
|
# define PRIuSIZE "zu"
|
|
# endif
|
|
# endif
|
|
|
|
/* ************************************************************************** */
|
|
/* Handles - these are actually private */
|
|
/* ************************************************************************** */
|
|
struct p7_handle_s;
|
|
typedef struct p7_handle_s p7_handle_t;
|
|
extern const size_t p7_handle_size;
|
|
|
|
/* ************************************************************************** */
|
|
/* Other types */
|
|
/* ************************************************************************** */
|
|
/* Version (xx.xx.xxxx) */
|
|
typedef struct {
|
|
unsigned int major;
|
|
unsigned int minor;
|
|
unsigned int rev;
|
|
} p7_version_t;
|
|
|
|
/* CASIOWIN entry - the OS entry the bootcode reads to run it */
|
|
typedef struct {
|
|
/* version */
|
|
p7_version_t version;
|
|
|
|
/* syscall table address */
|
|
p7uint_t syscall_table_offset;
|
|
} p7_casiowin_entry_t;
|
|
|
|
# ifdef __cplusplus
|
|
}
|
|
# endif
|
|
# include <libp7/buffer.h>
|
|
#endif /* LIBP7_TYPES_H */
|