Diff

Differences From Artifact [7be7436122]:

To Artifact [78ff5be79c]:


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
#define HAVE_STDC 1

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

#include "vfs_kitdll_data.h"

typedef struct kitdll_data *(cmd_getData_t)(const char *, unsigned long);
typedef unsigned long (cmd_getChildren_t)(const char *, unsigned long *, unsigned long);


static cmd_getData_t *getCmdData(const char *hashkey) {
	/* XXX: TODO: Look up symbol using dlsym() */
	if (strcmp(hashkey, "vfs_kitdll_data") == 0) {
		return(kitdll_vfs_kitdll_data_getData);
	}

	return(NULL);
}

static cmd_getChildren_t *getCmdChildren(const char *hashkey) {
	/* XXX: TODO: Look up symbol using dlsym() */
	if (strcmp(hashkey, "vfs_kitdll_data") == 0) {
		return(kitdll_vfs_kitdll_data_getChildren);
	}

	return(NULL);
}

static int getMetadata(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	cmd_getData_t *cmd_getData;
	cmd_getChildren_t *cmd_getChildren;
	struct kitdll_data *finfo = NULL;
	Tcl_Obj *ret_list, *ret_list_items[20];
	unsigned long num_children;
	const char *hashkey;
<
<

<


<
<



>
|
<
<
<
<
<
<
<
<
|
<
<
<
|
|
<
<
<









1

2
3


4
5
6
7
8








9



10
11



12
13
14
15
16
17
18


#include <tcl.h>

#include <stdlib.h>



typedef struct kitdll_data *(cmd_getData_t)(const char *, unsigned long);
typedef unsigned long (cmd_getChildren_t)(const char *, unsigned long *, unsigned long);

/* Your implementation must provide these */
static cmd_getData_t *getCmdData(const char *hashkey);








static cmd_getChildren_t *getCmdChildren(const char *hashkey);




/* Tcl Commands */



static int getMetadata(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
	cmd_getData_t *cmd_getData;
	cmd_getChildren_t *cmd_getChildren;
	struct kitdll_data *finfo = NULL;
	Tcl_Obj *ret_list, *ret_list_items[20];
	unsigned long num_children;
	const char *hashkey;
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309

	free(children);

	Tcl_SetObjResult(interp, ret_list);

	return(TCL_OK);
}

int Vfs_kitdll_data_Init(Tcl_Interp *interp) {   
	Tcl_Command tclCreatComm_ret;
	int tclPkgProv_ret;

	tclCreatComm_ret = Tcl_CreateObjCommand(interp, "::vfs::kitdll::data::getMetadata", getMetadata, NULL, NULL);
	if (!tclCreatComm_ret) {
		return(TCL_ERROR);
	}

	tclCreatComm_ret = Tcl_CreateObjCommand(interp, "::vfs::kitdll::data::getData", getData, NULL, NULL);
	if (!tclCreatComm_ret) {
		return(TCL_ERROR);
	}

	tclCreatComm_ret = Tcl_CreateObjCommand(interp, "::vfs::kitdll::data::getChildren", getChildren, NULL, NULL);
	if (!tclCreatComm_ret) {
		return(TCL_ERROR);
	}

	tclPkgProv_ret = Tcl_PkgProvide(interp, "vfs::kitdll::data", "1.0");

	return(tclPkgProv_ret);
}







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
261
262
263
264
265
266
267

























	free(children);

	Tcl_SetObjResult(interp, ret_list);

	return(TCL_OK);
}