1 /* Copyright 2013 Akira Ohta (akohta001@gmail.com)
2 This file is part of ntch.
4 The ntch is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 The ntch is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with ntch. If not, see <http://www.gnu.org/licenses/>.
21 #include "utils/nt_std_t.h"
23 typedef struct tag_nt_category_t *nt_category_tp;
24 typedef struct tag_nt_category_t{
26 nt_link_tp boardlistp;
30 typedef struct tag_nt_board_t *nt_board_tp;
31 typedef struct tag_nt_board_t{
34 nt_link_tp threadlistp;
37 typedef struct tag_nt_thread_t *nt_thread_tp;
38 typedef struct tag_nt_thread_t{
46 typedef struct tag_nt_res_t *nt_res_tp;
47 typedef struct tag_nt_res_t{
55 typedef struct tag_nt_2ch_model_t *nt_2ch_model_tp;
56 typedef struct tag_nt_2ch_model_t{
58 nt_link_tp categorylistp;
62 typedef struct tag_nt_write_data_t *nt_write_data_tp;
63 typedef struct tag_nt_write_data_t
74 typedef struct tag_nt_2ch_selected_item_t *nt_2ch_selected_item_tp;
75 typedef struct tag_nt_2ch_selected_item_t{
76 nt_category_tp selected_categoryp;
77 nt_board_tp selected_boardp;
78 nt_thread_tp selected_threadp;
79 }nt_2ch_selected_item_t;
82 extern nt_write_data_tp nt_write_data_alloc();
83 extern void nt_write_data_free(nt_write_data_tp ptr);
85 extern nt_2ch_model_tp nt_2ch_model_alloc();
86 extern nt_category_tp nt_category_alloc(
87 nt_2ch_model_tp modelp, const wchar_t *name);
88 extern nt_board_tp nt_board_alloc( nt_category_tp categoryp,
89 const wchar_t *name, const wchar_t *addressp);
90 extern nt_thread_tp nt_thread_alloc(
91 nt_link_tp *threadlistpp, const wchar_t *name,
92 const wchar_t *file_name, int num_res);
93 extern nt_res_tp nt_res_alloc(nt_thread_tp threadp,
94 const wchar_t *name, const wchar_t *mail,
95 const wchar_t *misc, const wchar_t *msg);
96 extern nt_board_tp nt_get_board_by_name(
97 nt_2ch_model_tp modelp, const wchar_t *board_name, nt_category_tp *categorypp);
98 extern nt_board_tp nt_get_board_by_address_match(
99 nt_2ch_model_tp modelp, const wchar_t *param);
100 extern void nt_2ch_model_free(nt_2ch_model_tp ptr);
101 extern void nt_category_free(nt_category_tp ptr);
102 extern void nt_board_free(nt_board_tp ptr);
103 extern void nt_board_children_free(nt_board_tp ptr);
104 extern void nt_thread_free(nt_thread_tp ptr);
105 extern void nt_thread_children_free(nt_thread_tp ptr);
106 extern void nt_res_free(nt_res_tp ptr);
108 extern BOOL parse_board_menu(nt_2ch_model_tp modelp,
109 const wchar_t *linep);
110 extern BOOL parse_board(nt_board_tp boardp, const wchar_t *linep);
111 extern BOOL parse_thread(nt_thread_tp boardp, const wchar_t *linep);
113 extern void nt_set_selected_board(nt_2ch_selected_item_tp selectp,
114 nt_category_tp categoryp, nt_board_tp boardp);
115 extern void nt_set_selected_thread(
116 nt_2ch_selected_item_tp selectp, nt_thread_tp threadp);
118 extern nt_thread_tp nt_get_thread_by_seq_no(
119 nt_link_tp thread_list, int seq_no);
120 extern nt_thread_tp nt_get_thread_by_dat_name(
121 nt_link_tp thread_list, const wchar_t *dat_name);
122 extern wchar_t* nt_read_thread_title(nt_board_tp boardp,
123 const wchar_t *dat_name);
124 extern wchar_t* parse_thread_title(const wchar_t *linep);
126 #endif /* _MODEL_2CH_H_ */