summaryrefslogtreecommitdiff
path: root/src/user/lib/tce/Folder.c
blob: 9b0a77352abbf8afc02b7adbabe4bb18cd87c7f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <tce/Folder.h>
#include <stdio.h>

static struct FolderMethods _folderMethods = { 0 };

struct FolderMethods *Folder_getMethods() {
	int i;
	if (_folderMethods.GetChildNameAt == -1) return 0;
	if (_folderMethods.GetChildNameAt == 0) {
		i = get_methods("Folder", (int*)&_folderMethods);
		if (i < 0) {
			_folderMethods.GetChildNameAt = -1;
			return 0;
		}
	}
	return &_folderMethods;
}

int Folder_GetChildNameAt(Object object, int pos, char *to) {
	struct FolderMethods *folder = Folder_getMethods();
	if (folder == 0) return E_NOT_IMPLEMENTED;

	return Call(folder->GetChildNameAt, object, pos, to, 0, 0);
}