cake
/
libp7
Archived
1
0
Fork 1
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.
libp7/include/libp7/server.h

73 lines
2.3 KiB
C

/* ************************************************************************** */
/* _____ _ */
/* libp7/server.h |_ _|__ _ _| |__ ___ _ _ */
/* | Project: libp7 | |/ _ \| | | | '_ \ / _ \ | | | */
/* | | (_) | |_| | | | | __/ |_| | */
/* By: thomas <thomas@touhey.fr> |_|\___/ \__,_|_| |_|\___|\__, |.fr */
/* Last updated: 2017/01/04 15:02:44 |___/ */
/* */
/* ************************************************************************** */
#ifndef LIBP7_SERVER_H
# define LIBP7_SERVER_H
# include <libp7.h>
# ifdef __cplusplus
extern "C" {
# endif
/* A P7 server is basically a calculator. */
/* ************************************************************************** */
/* Server information */
/* ************************************************************************** */
/* Main structure */
typedef struct {
/* main information */
char product_id[17], username[17];
char hwid[9], cpuid[17];
/* preprogrammed ROM info */
int preprog_rom_wiped;
p7uint_t preprog_rom_capacity;
p7_version_t preprog_rom_version;
/* flash ROM and RAM info */
p7uint_t flash_rom_capacity, ram_capacity;
/* bootcode info */
int bootcode_wiped;
p7_version_t bootcode_version;
p7uint_t bootcode_offset, bootcode_size;
/* OS information */
int os_wiped;
p7_version_t os_version;
p7uint_t os_offset, os_size;
/* addresses - for serving */
const unsigned char *flash_rom, *ram;
const unsigned char *casiowin_entry, *bootcode;
} p7_server_t;
/* Functions */
typedef struct {
/* filesystem name */
const char *name;
/* directory commands */
int (*directory_exists)(const char *dirname);
int (*create_directory)(const char *dirname);
int (*delete_directory)(const char *dirname);
int (*rename_directory)(const char *dirname, const char *newdir);
/* things that should only be manipulated by libp7 */
char *working_directory, _wd[257];
} p7_filesystem_t;
/* Main libp7 function */
int p7_serve(p7_handle_t *handle, p7_server_t *info,
p7_filesystem_t *filesystems);
# ifdef __cplusplus
}
# endif
#endif /* LIBP7_SERVER_H */