libww libww
WWitch compatibility library for the Wonderful toolchain
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1#ifndef __LIBWW_SYS_TYPES_H__
2#define __LIBWW_SYS_TYPES_H__
3
4// This type header is written with the Wonderful toolchain libc in mind;
5// as such, we don't duplicate types defined in the C standard.
6
7#include <stdarg.h>
8#include <stddef.h>
9#include <stdint.h>
10#include <time.h>
11#include <wonderful.h>
12
13typedef unsigned short ushort;
14typedef unsigned long ulong;
15
16typedef uint8_t BYTE;
17typedef uint16_t WORD;
18typedef uint32_t DWORD;
19typedef int16_t BOOL;
20
21#define FALSE 0
22#define TRUE 1
23
24// Compatibility shims
25#define far __far
26#define near
27
28// FreyaBIOS types
29struct intvector {
30 void (*callback)(void);
31 uint16_t cs;
32 uint16_t ds;
33 uint16_t unknown; /* ? */
34};
35typedef struct intvector intvector_t;
36
37struct ownerinfo {
38 char name[16];
39 uint16_t birth_year;
40 uint8_t birth_month;
41 uint8_t birth_day;
42 uint8_t sex;
43 uint8_t bloodtype;
44};
45typedef struct ownerinfo ownerinfo_t;
46
47struct datetime {
48 uint8_t year; /* 0 = year 2000 */
49 uint8_t month; /* 1 - 12 */
50 uint8_t date; /* 1 - 31 */
51 uint8_t day_of_week; /* 0 - 6, 0 = Sunday, 1 = Monday, 6 = Saturday */
52 uint8_t hour; /* 0 - 23 */
53 uint8_t minute; /* 0 - 59 */
54 uint8_t second; /* 0 - 59 */
55};
56typedef struct datetime datetime_t;
57
58// FreyaOS system types
59typedef uint16_t pid_t;
60typedef int32_t flen_t;
61typedef int32_t fpos_t;
62typedef uint16_t fmode_t;
63typedef uint32_t appid_t;
64
65typedef union {
66 void __far *fp;
67 uint32_t ul;
68 struct {
69 uint16_t off;
70 uint16_t seg;
71 } w;
72} address_t;
74
75#endif /* __LIBWW_SYS_TYPES_H__ */
uint8_t date
Definition types.h:50
uint8_t month
Definition types.h:49
uint8_t year
Definition types.h:48
uint8_t second
Definition types.h:54
uint8_t minute
Definition types.h:53
uint8_t day_of_week
Definition types.h:51
uint8_t hour
Definition types.h:52
void(* callback)(void)
Definition types.h:30
uint16_t unknown
Definition types.h:33
uint16_t ds
Definition types.h:32
uint16_t cs
Definition types.h:31
uint16_t birth_year
Definition types.h:39
uint8_t birth_month
Definition types.h:40
uint8_t birth_day
Definition types.h:41
uint8_t bloodtype
Definition types.h:43
char name[16]
Definition types.h:38
uint8_t sex
Definition types.h:42
int16_t BOOL
Definition types.h:19
int32_t fpos_t
Definition types.h:61
address_t floc_t
Definition types.h:73
struct intvector intvector_t
Definition types.h:35
struct ownerinfo ownerinfo_t
Definition types.h:45
unsigned long ulong
Definition types.h:14
struct datetime datetime_t
Definition types.h:56
uint8_t BYTE
Definition types.h:16
uint16_t WORD
Definition types.h:17
uint16_t fmode_t
Definition types.h:62
unsigned short ushort
Definition types.h:13
uint16_t pid_t
Definition types.h:59
int32_t flen_t
Definition types.h:60
uint32_t DWORD
Definition types.h:18
uint32_t appid_t
Definition types.h:63
uint32_t ul
Definition types.h:67
uint16_t seg
Definition types.h:70
void __far * fp
Definition types.h:66
uint16_t off
Definition types.h:69