This repository was archived by the owner on Oct 27, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathleafpack.h
More file actions
65 lines (50 loc) · 1.6 KB
/
leafpack.h
File metadata and controls
65 lines (50 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* LEAF Visual Novel System For X
* (c) Copyright 1999,2000 Go Watanabe mailto:go@denpa.org
* All rights reserverd.
*
* ORIGINAL LVNS (c) Copyright 1996-1999 LEAF/AQUAPLUS Inc.
*
* $Id: leafpack.h,v 1.6 2000/05/10 17:32:23 go Exp $
*
*/
#ifndef ___LEAFPAK_H
#define ___LEAFPAK_H
#define LP_KEY_LEN 11
typedef enum {
LPTYPE_SIZUWIN,
LPTYPE_KIZUWIN,
LPTYPE_TOHEART,
LPTYPE_SAORIN,
LPTYPE_UNKNOWN
} LeafPackType;
/* パック情報 */
typedef struct {
LeafPackType type; /* パックの種別 */
u_char *addr; /* 先頭アドレス */
size_t size; /* サイズ */
int file_num; /* パック中のファイル数 */
int key[LP_KEY_LEN]; /* 展開用キー */
/* ファイル情報 */
struct LeafFileInfo {
char name[13]; /* ファイル名 */
off_t pos; /* ファイルの先頭からのオフセット */
size_t len; /* ファイルのサイズ */
} *files;
} LeafPack;
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
extern LeafPack *leafpack_new(const char *packname);
extern void leafpack_delete(LeafPack *);
extern void leafpack_print_type(LeafPack *);
extern void leafpack_print_table(LeafPack *, int verbose);
extern int leafpack_find(LeafPack *p, const char *name);
extern u_char* leafpack_extract(LeafPack *p, int index, size_t *sizeret);
void leafpack_lzs(const u_char *loadBuf, u_char *saveBuf, size_t size);
void leafpack_lzs2(const u_char *loadBuf, u_char *saveBuf, size_t size);
void leafpack_lzs3(const u_char *loadBuf, u_char *saveBuf, size_t size);
#endif