File: MsgSkip.c

package info (click to toggle)
xsystem35 2.17.0-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 8,096 kB
  • sloc: ansic: 38,159; java: 4,085; xml: 249; sh: 134; python: 15; makefile: 12
file content (101 lines) | stat: -rw-r--r-- 1,772 bytes parent folder | download | duplicates (2)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "portab.h"
#include "system.h"
#include "filecheck.h"
#include "xsystem35.h"
#include "modules.h"
#include "nact.h"
#include "msgskip.h"
#include "utfsjis.h"

static bool valid;
static int action;

static void Init() {
	int *p1 = getCaliVariable();
	int p2 = getCaliValue(); /* ISys3x */
	int p3 = getCaliValue();
	int p4 = getCaliValue();

	action = p3;
	valid = true;
	*p1 = 0;

	TRACE("MsgSkip.Init %p,%d,%d,%d:", p1, p2, p3, p4);
}

static void Start() {
	int *p1 = getCaliVariable();
	int p2 = getCaliValue();

	char *fname_utf8 = sjis2utf(svar_get(p2));
	char *path = fc_get_path(fname_utf8);
	msgskip_init(path);
	free(path);
	free(fname_utf8);

	TRACE("MsgSkip.Start %p,%d:", p1, p2);
}

static void SetValid() {
	int p1 = getCaliValue();

	valid = p1;
	msgskip_pause(!valid);

	TRACE("MsgSkip.SetValid %d:", p1);
}

static void GetValid() {
	int *p1 = getCaliVariable();

	*p1 = valid;

	TRACE("MsgSkip.GetValid %p:", p1);
}

static void SetAction() {
	int p1 = getCaliValue();

	action = p1;

	TRACE("MsgSkip.SetAcion %d:", p1);
}

static void GetAction() {
	int *p1 = getCaliVariable();

	*p1 = action;

	TRACE("MsgSkip.GetAcion %p:", p1);
}

static void PushStr() {
	int p1 = getCaliValue();
	
	TRACE_UNIMPLEMENTED("MsgSkip.PushStr %d:", p1);
}

static void PopStr() {
	int p1 = getCaliValue();
	
	TRACE_UNIMPLEMENTED("MsgSkip.PopStr %d:", p1);
}

static const ModuleFunc functions[] = {
	{"GetAction", GetAction},
	{"GetValid", GetValid},
	{"Init", Init},
	{"PopStr", PopStr},
	{"PushStr", PushStr},
	{"SetAction", SetAction},
	{"SetValid", SetValid},
	{"Start", Start},
};

const Module module_MsgSkip = {"MsgSkip", functions, sizeof(functions) / sizeof(ModuleFunc)};