4 * Copyright (c) 2009 project bchan
6 * This software is provided 'as-is', without any express or implied
7 * warranty. In no event will the authors be held liable for any damages
8 * arising from the use of this software.
10 * Permission is granted to anyone to use this software for any purpose,
11 * including commercial applications, and to alter it and redistribute it
12 * freely, subject to the following restrictions:
14 * 1. The origin of this software must not be misrepresented; you must not
15 * claim that you wrote the original software. If you use this software
16 * in a product, an acknowledgment in the product documentation would be
17 * appreciated but is not required.
19 * 2. Altered source versions must be plainly marked as such, and must not be
20 * misrepresented as being the original software.
22 * 3. This notice may not be removed or altered from any source
33 #include <btron/btron.h>
35 #include <btron/hmi.h>
40 #ifdef BCHAN_CONFIG_DEBUG
41 # define DP(arg) printf arg
42 # define DP_ER(msg, err) printf("%s (%d/%x)\n", msg, err>>16, err)
45 # define DP_ER(msg, err) /**/
48 EXPORT W poptray_gettraydata(postresdata_t **post)
51 TR_VOBJREC *vobjrec = NULL;
55 err = tget_dat(NULL, 0, &size, -1);
57 DP_ER("tget_dat: get size error", err);
64 data = (TRAYREC*)malloc(size);
68 recs = tget_dat(data, size, NULL, -1);
70 DP_ER("tget_dat: get data error", recs);
74 for (i = 0; i < recs; i++) {
75 if (data[i].id != TR_VOBJ) {
78 vobjrec = (TR_VOBJREC*)data[i].dt;
81 if (vobjrec != NULL) {
82 ret = postresdata_new();
87 postresdata_readfile(ret, &(vobjrec->vlnk));