Subversion Repositories HelenOS

Rev

Rev 3435 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3435 Rev 3471
Line 35... Line 35...
35
#include <stdio.h>
35
#include <stdio.h>
36
#include <stdlib.h>
36
#include <stdlib.h>
37
#include <ipc/ipc.h>
37
#include <ipc/ipc.h>
38
#include <libadt/hash_table.h>
38
#include <libadt/hash_table.h>
39
 
39
 
-
 
40
#include "trace.h"
40
#include "proto.h"
41
#include "proto.h"
41
 
42
 
42
#define SRV_PROTO_TABLE_CHAINS 32
43
#define SRV_PROTO_TABLE_CHAINS 32
43
#define METHOD_OPER_TABLE_CHAINS 32
44
#define METHOD_OPER_TABLE_CHAINS 32
44
 
45
 
Line 170... Line 171...
170
    proto_struct_init(p, name);
171
    proto_struct_init(p, name);
171
 
172
 
172
    return p;
173
    return p;
173
}
174
}
174
 
175
 
-
 
176
void proto_delete(proto_t *proto)
-
 
177
{
-
 
178
    free(proto);
-
 
179
}
-
 
180
 
175
void proto_add_oper(proto_t *proto, int method, oper_t *oper)
181
void proto_add_oper(proto_t *proto, int method, oper_t *oper)
176
{
182
{
177
    method_oper_t *mo;
183
    method_oper_t *mo;
178
    unsigned long key;
184
    unsigned long key;
179
 
185
 
Line 202... Line 208...
202
static void oper_struct_init(oper_t *oper, char *name)
208
static void oper_struct_init(oper_t *oper, char *name)
203
{
209
{
204
    oper->name = name;
210
    oper->name = name;
205
}
211
}
206
 
212
 
207
oper_t *oper_new(char *name)
213
oper_t *oper_new(char *name, int argc, val_type_t *arg_types,
-
 
214
    val_type_t rv_type, int respc, val_type_t *resp_types)
208
{
215
{
209
    oper_t *o;
216
    oper_t *o;
-
 
217
    int i;
210
 
218
 
211
    o = malloc(sizeof(oper_t));
219
    o = malloc(sizeof(oper_t));
212
    oper_struct_init(o, name);
220
    oper_struct_init(o, name);
213
 
221
 
-
 
222
    o->argc = argc;
-
 
223
    for (i = 0; i < argc; i++)
-
 
224
        o->arg_type[i] = arg_types[i];
-
 
225
 
-
 
226
    o->rv_type = rv_type;
-
 
227
 
-
 
228
    o->respc = respc;
-
 
229
    for (i = 0; i < respc; i++)
-
 
230
        o->resp_type[i] = resp_types[i];
-
 
231
 
214
    return o;
232
    return o;
215
}
233
}
216
 
234
 
217
/** @}
235
/** @}
218
 */
236
 */