HEADER := $(S) $(HEADER)
# ¥½¡¼¥¹¥Õ¥¡¥¤¥ë
-SRC = main.c cache.c parser.c layout.c retriever.c tadlib.c poptray.c postres.c http.c submit.c sjisstring.c parselib.c submitutil.c bchan_vobj.c tadurl.c bchan_panels.c bchan_menus.c residhash.c resindexhash.c tadimf.c layoutarray.c array.c render.c layoutstyle.c traydata.c hmi.c
+SRC = main.c cache.c parser.c layout.c retriever.c tadlib.c poptray.c postres.c http.c submit.c sjisstring.c parselib.c submitutil.c bchan_vobj.c tadurl.c bchan_panels.c bchan_menus.c residhash.c resindexhash.c tadimf.c layoutarray.c array.c render.c layoutstyle.c traydata.c hmi.c wordlist.c
# ¥Ç¡¼¥¿¥Ü¥Ã¥¯¥¹¥½¡¼¥¹¥Õ¥¡¥¤¥ë
DBSRC =
HEADER := $(S) $(HEADER)
# ¥½¡¼¥¹¥Õ¥¡¥¤¥ë
-SRC = test_main.c cache.c test_cache.c parser.c test_parser.c layout.c test_layout.c retriever.c tadlib.c parselib.c test_parselib.c http.c submitutil.c test_submitutil.c sjisstring.c test_sjisstring.c residhash.c test_residhash.c resindexhash.c test_resindexhash.c postres.c test_postres.c tadimf.c test_tadimf.c array.c test_array.c layoutarray.c test_layoutarray.c layoutstyle.c
+SRC = test_main.c cache.c test_cache.c parser.c test_parser.c layout.c test_layout.c retriever.c tadlib.c parselib.c test_parselib.c http.c submitutil.c test_submitutil.c sjisstring.c test_sjisstring.c residhash.c test_residhash.c resindexhash.c test_resindexhash.c postres.c test_postres.c tadimf.c test_tadimf.c array.c test_array.c layoutarray.c test_layoutarray.c layoutstyle.c wordlist.c test_wordlist.c
# ¥Ç¡¼¥¿¥Ü¥Ã¥¯¥¹¥½¡¼¥¹¥Õ¥¡¥¤¥ë
DBSRC =
#include "hmi.h"
#include "tadlib.h"
+#include "wordlist.h"
#include <bstdio.h>
#include <bstdlib.h>
#include <btron/btron.h>
#include <btron/hmi.h>
#include <btron/vobj.h>
-#include <bsys/queue.h>
#ifdef BCHAN_CONFIG_DEBUG
# define DP(arg) printf arg
{
}
-struct ngwordlist_node_t_ {
- QUEUE queue;
- TC *str;
- W len;
-};
-typedef struct ngwordlist_node_t_ ngwordlist_node_t;
-
-LOCAL ngwordlist_node_t* ngwordlist_node_new(TC *str, W strlen)
-{
- ngwordlist_node_t *node;
-
- node = (ngwordlist_node_t*)malloc(sizeof(ngwordlist_node_t));
- if (node == NULL) {
- return NULL;
- }
-
- node->str = malloc(sizeof(TC)*strlen);
- if (node->str == NULL) {
- free(node);
- return NULL;
- }
- memcpy(node->str, str, sizeof(TC)*strlen);
- node->len = strlen;
- QueInit(&(node->queue));
-
- return node;
-}
-
-LOCAL VOID ngwordlist_node_delete(ngwordlist_node_t *node)
-{
- QueRemove(&(node->queue));
- free(node->str);
- free(node);
-}
-
-LOCAL VOID ngwordlist_node_insert(ngwordlist_node_t *entry, ngwordlist_node_t *node)
-{
- QueInsert(&(entry->queue), &(node->queue));
-}
-
-LOCAL ngwordlist_node_t* ngwordlist_node_next(ngwordlist_node_t *node)
-{
- return (ngwordlist_node_t *)(node->queue.next);
-}
-
struct datwindow_t_ {
WID wid;
GID gid;
--- /dev/null
+/*
+ * test_wordlist.c
+ *
+ * Copyright (c) 201a project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <btron/btron.h>
+#include <bstdio.h>
+#include <tcode.h>
+
+#include "test.h"
+
+#include "wordlist.h"
--- /dev/null
+/*
+ * wordlist.c
+ *
+ * Copyright (c) 2011 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include "wordlist.h"
+
+#include <bstdio.h>
+#include <bstdlib.h>
+#include <bsys/queue.h>
+
+#ifdef BCHAN_CONFIG_DEBUG
+# define DP(arg) printf arg
+# define DP_ER(msg, err) printf("%s (%d/%x)\n", msg, err>>16, err)
+#else
+# define DP(arg) /**/
+# define DP_ER(msg, err) /**/
+#endif
+
+EXPORT VOID ngwordlist_node_insert(ngwordlist_node_t *entry, ngwordlist_node_t *node)
+{
+ QueInsert(&(entry->queue), &(node->queue));
+}
+
+EXPORT ngwordlist_node_t* ngwordlist_node_next(ngwordlist_node_t *node)
+{
+ return (ngwordlist_node_t *)(node->queue.next);
+}
+
+EXPORT ngwordlist_node_t* ngwordlist_node_new(TC *str, W strlen)
+{
+ ngwordlist_node_t *node;
+
+ node = (ngwordlist_node_t*)malloc(sizeof(ngwordlist_node_t));
+ if (node == NULL) {
+ return NULL;
+ }
+
+ node->str = malloc(sizeof(TC)*strlen);
+ if (node->str == NULL) {
+ free(node);
+ return NULL;
+ }
+ memcpy(node->str, str, sizeof(TC)*strlen);
+ node->len = strlen;
+ QueInit(&(node->queue));
+
+ return node;
+}
+
+EXPORT VOID ngwordlist_node_delete(ngwordlist_node_t *node)
+{
+ QueRemove(&(node->queue));
+ free(node->str);
+ free(node);
+}
--- /dev/null
+/*
+ * wordlist.h
+ *
+ * Copyright (c) 2011 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <basic.h>
+#include <bsys/queue.h>
+
+#ifndef __WORDLIST_H__
+#define __WORDLIST_H__
+
+struct ngwordlist_node_t_ {
+ QUEUE queue;
+ TC *str;
+ W len;
+};
+typedef struct ngwordlist_node_t_ ngwordlist_node_t;
+
+IMPORT ngwordlist_node_t* ngwordlist_node_new(TC *str, W strlen);
+IMPORT VOID ngwordlist_node_delete(ngwordlist_node_t *node);
+IMPORT VOID ngwordlist_node_insert(ngwordlist_node_t *entry, ngwordlist_node_t *node);
+IMPORT ngwordlist_node_t* ngwordlist_node_next(ngwordlist_node_t *node);
+
+#endif