summaryrefslogtreecommitdiff
path: root/module/header.h
blob: 0678cd762d7739d000d96e090a2a2d32db92f3c0 (plain)
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* Generated by CMunge 0.76 (10 May 2006)
 * CMunge Copyright (c) 1999-2006 Robin Watts/Justin Fletcher */

#ifndef _CMUNGE_Iconv_H_
#define _CMUNGE_Iconv_H_

#include "kernel.h"

#define CMUNGE_VERSION (76)
#define CMHG_VERSION   (531) /* Nearest equivalent version */

#define Module_Title		"Iconv"
#define Module_Help		"Iconv"
#define Module_VersionString	"0.08"
#define Module_VersionNumber	8
#ifndef Module_Date
#define Module_Date		"11 Nov 2008"
#endif

#ifdef __cplusplus
extern "C" {
#endif


/***************************************************************************
 * Function:     mod_init
 * Description:  Initialise the module, setting up vectors, callbacks and
 *               any other parts of the system necessary for the module to
 *               function.
 * Parameters:   tail        = pointer to command line (control terminated)
 *               podule_base = address of podule module was started from, or
 *                             NULL if none
 *               pw          = private word for module
 * On exit:      Return NULL for successful initialisation, or a pointer to
 *               an error block if the module could not start properly.
 **************************************************************************/
_kernel_oserror *mod_init(const char *tail, int podule_base, void *pw);


/***************************************************************************
 * Function:     mod_fini
 * Description:  Finalise the module, shutting down any systems necessary,
 *               freeing vectors and releasing workspace
 * Parameters:   fatal       = fatality indicator; 1 if fatal, 0 if
 *                             reinitialising
 *               podule_base = address of podule module was started from, or
 *                             NULL if none
 *               pw          = private word for module
 * On exit:      Return 0 for successful finalisation, or a pointer to an
 *               error block if module was not shutdown properly.
 **************************************************************************/
_kernel_oserror *mod_fini(int fatal, int podule_base, void *pw);


/***************************************************************************
 * Description:  Star command and help request handler routines.
 * Parameters:   arg_string = pointer to argument string (control
 *                            terminated), or output buffer
 *               argc       = number of arguments passed
 *               number     = command number (see CMD_* definitions below)
 *               pw         = private word for module
 * On exit:      If number indicates a help entry:
 *                 To output, assemble zero terminated output into
 *                 arg_string, and return help_PRINT_BUFFER to print it.
 *                 To stay silent, return NULL.
 *                 To given an error, return an error pointer.
 *                 [In this case, you need to cast the 'const' away]
 *               If number indicates a configure option:
 *                 If arg_string is arg_STATUS, then print status, otherwise
 *                 use argc and arg_string to set option.
 *                 Return NULL for no error.
 *                 Return one of the four error codes below (configure_*)
 *                 for a generic error message.
 *                 Return an error pointer for a custom error.
 *               If number indicates a command entry:
 *                 Execute the command given by number, and arg_string.
 *                 Return NULL on success,
 *                 Return a pointer to an error block on failure.
 **************************************************************************/
_kernel_oserror *command_handler(const char *arg_string, int argc,
                                 int number, void *pw);
#define help_PRINT_BUFFER		((_kernel_oserror *) arg_string)
#define arg_CONFIGURE_SYNTAX		((char *) 0)
#define arg_STATUS			((char *) 1)
#define configure_BAD_OPTION		((_kernel_oserror *) -1)
#define configure_NUMBER_NEEDED		((_kernel_oserror *) 1)
#define configure_TOO_LARGE		((_kernel_oserror *) 2)
#define configure_TOO_MANY_PARAMS	((_kernel_oserror *) 3)

/* Command numbers, as passed to the command handler functions (see above) */
#undef CMD_Iconv
#define CMD_Iconv (0)
#undef CMD_ReadAliases
#define CMD_ReadAliases (1)


/***************************************************************************
 * Description:  SWI handler routine. All SWIs for this module will be
 *               passed to these routines.
 * Parameters:   number = SWI number within SWI chunk (i.e. 0 to 63)
 *               r      = pointer to register block on entry
 *               pw     = private word for module
 * On exit:      Return NULL if SWI handled sucessfully, setting return
 *               register values (r0-r9) in r.
 *               Return error_BAD_SWI for out of range SWIs.
 *               Return an error block for a custom error.
 **************************************************************************/
/* Function called to handle SWI calls */
_kernel_oserror *swi_handler(int number, _kernel_swi_regs *r, void *pw);
/* SWI number definitions */
#define Iconv_00 (0x00057540)
#undef Iconv_Open
#undef XIconv_Open
#define Iconv_Open                (0x00057540)
#define XIconv_Open               (0x00077540)
#undef Iconv_Iconv
#undef XIconv_Iconv
#define Iconv_Iconv               (0x00057541)
#define XIconv_Iconv              (0x00077541)
#undef Iconv_Close
#undef XIconv_Close
#define Iconv_Close               (0x00057542)
#define XIconv_Close              (0x00077542)
#undef Iconv_Convert
#undef XIconv_Convert
#define Iconv_Convert             (0x00057543)
#define XIconv_Convert            (0x00077543)
#undef Iconv_CreateMenu
#undef XIconv_CreateMenu
#define Iconv_CreateMenu          (0x00057544)
#define XIconv_CreateMenu         (0x00077544)
#undef Iconv_DecodeMenu
#undef XIconv_DecodeMenu
#define Iconv_DecodeMenu          (0x00057545)
#define XIconv_DecodeMenu         (0x00077545)

/* Special error for 'SWI values out of range for this module' */
#define error_BAD_SWI ((_kernel_oserror *) -1)

#ifdef __cplusplus
}
#endif

#endif