OSDN Git Service

2012/01/25 21:41:54
[nlite/nlite.git] / nlib / nlib.h
1 #pragma once
2
3 #ifndef WIN32_LEAN_AND_MEAN
4 #define WIN32_LEAN_AND_MEAN
5 #endif
6
7 #include <Windows.h>
8 #include <qwerty\qwerty_common.h>
9 #include <winhttp.h>
10 #include <shareCookie\browserType.h>
11
12 #include "nlib_define.h"
13
14 #ifdef NLIB_EXPORTS
15
16
17 #define NLIB_DECLSPEC  __declspec(dllexport)
18
19 #else  //NLIB_EXPORTS
20
21 #ifdef NLIB_DYNAMIC
22 #define NLIB_DECLSPEC  __declspec(dllimport)
23 #else //NLIB_STATIC
24
25 #define NLIB_DECLSPEC extern
26
27 #endif
28
29
30
31 #endif //NLIB_EXPORTS
32
33 //\8c^\92è\8b`
34 //////////////////////////////////////////////////////////////////////////////////////////////////////
35
36
37
38
39 ///
40 ///nlib\82Ì\96ß\82è\92l\82Ì\8c^
41 ///
42 typedef UINT_PTR NLIB_RESULT;
43
44
45 ///
46 ///\83v\83\8d\83o\83C\83_\83^\83C\83v
47 ///
48 typedef UINT_PTR PROVIDERTYPE;
49
50
51 ///
52 ///NicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
53 ///
54 typedef UINT_PTR                NICOLIVE_EVENT;
55
56 ///
57 ///NicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83p\83\89\83\81\81[\83^\83^\83C\83v
58 ///
59 typedef UINT_PTR                NICOLIVE_PARAM;
60
61
62 ///
63 ///NicoMyList\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
64 ///
65 typedef UINT_PTR                NICOMYLIST_EVENT;
66
67
68
69
70 ///
71 ///\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\83|\83C\83\93\83^
72 ///
73 typedef struct nicolivestream_t *NicoLiveStream_P;
74
75 ///
76 ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g
77 ///
78 typedef struct nicovideoauth_t *NicoVideoAuth_P;
79
80
81
82 ///
83 ///\83j\83R\83j\83R\90\95ú\91\97\83X\83e\81[\83^\83X
84 ///
85 //typedef struct streamstatus_t *StreamStatus_P;
86
87
88 ///
89 ///\83j\83R\83j\83R\90\95ú\91\97\8fî\95ñ\83I\83u\83W\83F\83N\83g
90 ///
91 //typedef struct streaminfo_t *StreamInfo_P;
92
93
94
95
96 ///
97 ///\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\83A\83C\83e\83\80\83I\83u\83W\83F\83N\83g
98 ///
99 typedef struct nicomylistitem_t *NicoMyListItem_P;
100
101 ///
102 ///\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\83A\83C\83e\83\80\83f\81[\83^\83I\83u\83W\83F\83N\83g
103 ///
104 typedef struct nicoitemdata_t *NicoItemData_P;
105
106 ///
107 ///\83j\83R\83j\83R\93®\89æ\82Ì\83}\83C\83\8a\83X\83g\83I\83u\83W\83F\83N\83g
108 ///
109 typedef struct nicomylist_t *NicoMyList_P;
110
111 ///
112 ///\83j\83R\83j\83R\90\95ú\91\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
113 ///
114 typedef NLIB_RESULT (*NicoRecvCallBack)(NICOLIVE_EVENT eventType,NicoLiveStream_P pNicoLiveStream,LPVOID option,NICOLIVE_PARAM param1,NICOLIVE_PARAM param2);
115
116 ///
117 ///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\83C\83x\83\93\83g\83n\83\93\83h\83\89
118 ///
119 typedef NLIB_RESULT (*NicoMyListCallBack)(LPVOID option,NicoMyListItem_P pVideo);
120
121 ///
122 ///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\88ê\97\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
123 ///
124 typedef NLIB_RESULT (*NicoMyListGroupCallBack)(LPVOID option,NicoMyList_P pMyList);
125
126
127 ///
128 ///\83j\83R\83j\83R\90\95ú\91\97\83`\83\83\83b\83g\83R\83\81\83\93\83g\8d\\91¢\91Ì
129 ///
130 typedef struct{
131         LPCTSTR premium;
132         LPCTSTR anonymity;
133         LPCTSTR thread;
134         LPCTSTR no;
135         LPCTSTR vpos;
136         LPCTSTR date;
137         LPCTSTR locale;
138         LPCTSTR user_id;
139         LPCTSTR name;
140         LPCTSTR chatBuf;
141         LPTSTR* mail;
142         UINT_PTR mailCount;
143 }NicoLiveChat,*NicoLiveChat_P;
144
145
146
147
148 ///
149 ///\83j\83R\83j\83R\90\95ú\91\97\83X\83\8c\83b\83h\83R\83\81\83\93\83g\8d\\91¢\91Ì
150 ///
151 typedef struct{
152         LPCTSTR thread;
153         LPCTSTR ticket;
154         LPCTSTR last_res;
155         LPCTSTR server_time;
156 }NicoLiveThreadComment,*NicoLiveThreadComment_P;
157
158
159 ///
160 ///\83j\83R\83j\83R\90\95ú\91\97\91\97\90M\8c\8b\89Ê\83R\83\81\83\93\83g\8d\\91¢\91Ì
161 ///
162 typedef struct{
163         LPCTSTR status;
164         LPCTSTR no;
165         LPCTSTR thread;
166 }NicoLiveSendResultComment,*NicoLiveSendResultComment_P;
167
168
169 ///
170 ///\83j\83R\90\83n\81[\83g\83r\81[\83g\8d\\91¢\91Ì
171 ///
172 typedef struct{
173
174         NLIB_RESULT status;
175
176         time_t time;
177
178         UINT_PTR watchCount;
179
180         UINT_PTR commentCount;
181
182         LPCTSTR is_restrict;
183
184         LPCTSTR ticket;
185
186
187 }NicoLiveHeartBeat,*NicoLiveHeartBeat_P;
188
189
190
191
192
193 #ifdef __cplusplus
194 extern "C" {
195 #endif
196
197         
198         ///
199         ///nlib\8f\89\8aú\89»\8aÖ\90\94
200         ///
201         NLIB_DECLSPEC NLIB_RESULT InitializeNLIB(HINTERNET hInternet);
202
203         ///
204         ///nlib\8cã\8en\96\96\8aÖ\90\94
205         ///
206         NLIB_DECLSPEC VOID FinalizeNLIB();
207
208
209         ///
210         ///\83G\83\89\81[\83\81\83b\83Z\81[\83W\8eæ\93¾
211         ///
212         NLIB_DECLSPEC LPCTSTR NLIB_GetErrorMessage(NLIB_RESULT rsltCode);
213
214
215
216
217
218
219 //
220 //\83j\83R\83j\83R\90\95ú\91\97\8aÖ\98A\8aÖ\90\94
221 ////////////////////////////////////////////////////////////////////////////////////////////////////
222
223         
224         ///
225         ///\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\93®\93I\90\90¬
226         ///
227         NLIB_DECLSPEC NicoLiveStream_P NicoLiveStream_new();
228
229         ///
230         ///\93®\93I\82É\90\90¬\82µ\82½\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\82ð\94j\8aü
231         ///
232         NLIB_DECLSPEC VOID NicoLiveStream_delete(NicoLiveStream_P* self);
233
234         ///
235         ///\8ew\92è\82µ\82½URL\82Ì\95ú\91\97\82É\90Ú\91±
236         ///
237         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVideoAuth,LPCTSTR url,NicoRecvCallBack callback,LPVOID option);
238         
239
240         ///
241         ///\95ú\91\97\82Æ\82Ì\90Ú\91±\82ð\90Ø\92f\82·\82é
242         ///
243         NLIB_DECLSPEC VOID NicoLiveStream_disConnect(NicoLiveStream_P self);
244
245         ///
246         ///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\90Ý\92è
247         ///
248         NLIB_DECLSPEC VOID NicoLiveStrream_setResFrom(NicoLiveStream_P self,INT_PTR res);
249
250
251         ///
252         ///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\8eæ\93¾
253         ///
254         NLIB_DECLSPEC INT_PTR NicoLiveStream_getResFrom(NicoLiveStream_P self);
255
256         ///
257         ///\83n\81[\83g\83r\81[\83g\82Ì\8aÔ\8au\82ð\90Ý\92è\81i\83~\83\8a\95b)
258         ///
259         NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatMsec(NicoLiveStream_P self,DWORD msec);
260
261
262         ///
263         ///\83n\81[\83g\83r\81[\83g\82Ì\8aÔ\8au\82ð\8eæ\93¾(\83~\83\8a\95b)
264         ///
265         NLIB_DECLSPEC DWORD NicoLiveStream_getHeartBeatMsec(NicoLiveStream_P self);
266
267         ///
268         ///\83n\81[\83g\83r\81[\83g\97L\8cø\81E\96³\8cø\90Ý\92è
269         ///
270         NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatFlag(NicoLiveStream_P self,BOOL flag);
271
272
273         ///
274         ///\83n\81[\83g\83r\81[\83g\97L\8cø\83t\83\89\83O\8eæ\93¾
275         ///
276         NLIB_DECLSPEC BOOL NicoLiveStream_getHeartBeatFlag(NicoLiveStream_P self);
277
278         ///
279         ///\83L\81[\83v\83A\83\89\83C\83u\82Ì\8aÔ\8au\82ð\90Ý\92è(\83~\83\8a\95b)
280         ///
281         NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveMsec(NicoLiveStream_P self,DWORD msec);
282
283         ///
284         ///\83L\81[\83v\83A\83\89\83C\83u\82Ì\8aÔ\8au\82ð\8eæ\93¾(\83~\83\8a\95b)
285         ///
286         NLIB_DECLSPEC DWORD NicoLiveStream_getKeapALiveMsec(NicoLiveStream_P self);
287
288
289         ///
290         ///\83L\81[\83v\83A\83\89\83C\83u\97L\8cø\81E\96³\8cø\90Ý\92è
291         ///
292         NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveFlag(NicoLiveStream_P self,BOOL flag);
293
294
295         ///
296         ///\83L\81[\83v\83A\83\89\83C\83u\83t\83\89\83O\8eæ\93¾
297         ///
298         NLIB_DECLSPEC BOOL NicoLiveStream_getKeapALiveFlag(NicoLiveStream_P self);
299
300
301         ///
302         ///\90\95ú\91\97\83X\83e\81[\83^\83X\8eæ\93¾
303         ///
304 //      NLIB_DECLSPEC StreamStatus_P NicoLiveStream_getStreamStatus(NicoLiveStream_P self);
305
306         ///
307         ///\83R\83\81\83\93\83g\91\97\90M
308         ///
309         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTSTR *mail,LPCTSTR *extends);
310
311         ///
312         ///\83n\81[\83g\83r\81[\83g\91\97\90M
313         ///
314         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self);
315
316
317         ///
318         ///\90Ú\91±\92\86\82Ì\95ú\91\97\8fî\95ñ\82ð\96â\82¢\8d\87\82í\82¹\82é
319         ///
320 //      NLIB_DECLSPEC StreamInfo_P NicoLiveStream_queryStreamInfo(NicoLiveStream_P self);
321
322
323         ///
324         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82ÌID\82ð\8eæ\93¾
325         ///
326         NLIB_DECLSPEC LPCTSTR NicoLiveStream_getId(NicoLiveStream_P self);
327
328
329         ///
330         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83R\83~\83\85\83j\83e\83B\94Ô\8d\86\82ð\8eæ\93¾
331         ///
332         NLIB_DECLSPEC LPCTSTR NicoLiveStream_getDefaultCommunity(NicoLiveStream_P self);
333
334
335         ///
336         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83v\83\8d\83o\83C\83_\83^\83C\83v\82ð\8eæ\93¾
337         ///
338         NLIB_DECLSPEC PROVIDERTYPE NicoLiveStream_getProviderType(NicoLiveStream_P self);
339
340
341         ///
342         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83I\81[\83i\81[\83t\83\89\83O\82ð\8eæ\93¾
343         ///
344         NLIB_DECLSPEC BOOL NicoLiveStream_isOwner(NicoLiveStream_P self);
345
346         ///
347         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8aJ\8en\8e\9e\8d\8f\82ð\8eæ\93¾
348         ///
349         NLIB_DECLSPEC time_t NicoLiveStream_getStartTime(NicoLiveStream_P self);
350
351         ///
352         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8fI\97¹\8e\9e\8d\8f\82ð\8eæ\93¾
353         ///
354         NLIB_DECLSPEC time_t NicoLiveStream_getEndTime(NicoLiveStream_P self);
355
356         ///
357         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8aJ\8fê\8e\9e\8d\8f\82ð\8eæ\93¾
358         ///
359         NLIB_DECLSPEC time_t NicoLiveStream_getOpenTime(NicoLiveStream_P self);
360
361         ///
362         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83x\81[\83X\8e\9e\8d\8f\82ð\8eæ\93¾
363         ///
364         NLIB_DECLSPEC time_t NicoLiveStream_getBaseTime(NicoLiveStream_P self);
365
366
367         ///
368         ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83^\83C\83g\83\8b\8eæ\93¾
369         ///
370         NLIB_DECLSPEC LPCTSTR NicoLiveStream_getTitle(NicoLiveStream_P self);
371
372
373         ///
374         ///\83v\83\8c\83~\83A\83\80\83t\83\89\83O\82Ì\8eæ\93¾
375         ///
376         NLIB_DECLSPEC BOOL NicoLiveStream_isPremium(NicoLiveStream_P self);
377
378         //
379         //\83j\83R\83j\83R\93®\89æ\94F\8fØ\8aÖ\98A\8aÖ\90\94
380         /////////////////////////////////////////////////////////////////////////////////////////////////
381         
382         ///
383         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g\90\90¬
384         ///
385         NLIB_DECLSPEC NicoVideoAuth_P NicoVideoAuth_new();
386
387         ///
388         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g\94j\8aü
389         ///
390         NLIB_DECLSPEC VOID NicoVideoAuth_delete(NicoVideoAuth_P *self);
391
392
393         ///
394         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\8fî\95ñ\8eæ\93¾
395         ///
396         NLIB_DECLSPEC NLIB_RESULT NicoVideoAuth_getNicoVideoAuth(NicoVideoAuth_P self,BROWSERTYPE browserType);
397
398
399         //
400         //\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\8aÖ\98A\8aÖ\90\94
401         ////////////////////////////////////////////////////////////////////////////////////////////////////
402
403         ///
404         ///\82Æ\82è\82 \82¦\82¸\83}\83C\83\8a\83X\83g\88ê\97\97\8eæ\93¾
405         ///
406         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getDefList(NicoVideoAuth_P pAuth,NicoMyListCallBack callback,LPVOID option);
407
408         ///
409         ///\83}\83C\83\8a\83X\83g\8eæ\93¾
410         ///
411         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyList(NicoVideoAuth_P pAuth,LPCTSTR id,NicoMyListCallBack callback,LPVOID option);
412
413         ///
414         ///\83}\83C\83\8a\83X\83g\83O\83\8b\81[\83v\8eæ\93¾
415         ///
416         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyListGroup(NicoVideoAuth_P pAuth,NicoMyListGroupCallBack callback,LPVOID option);
417
418
419         ///
420         ///\83}\83C\83\8a\83X\83g\93o\98^\8cÄ\82Ñ\8fo\82µ
421         /// 
422         NLIB_DECLSPEC NLIB_RESULT NicoMyList_addItem(LPCTSTR video_id);
423
424
425
426
427
428
429 #ifdef __cplusplus
430 }
431 #endif
432
433
434
435 #pragma comment(lib,"Wininet.lib")
436 #pragma comment(lib,"WinHttp.lib")
437 #pragma comment(lib,"Iepmapi.lib")
438 #pragma comment(lib,"ws2_32.lib")
439 #pragma comment(lib, "shell32.lib" )
440 #pragma comment(lib,"expat.lib")
441 #pragma comment(lib,"sqlite3.lib")
442 #pragma comment(lib,"sqliteManager.lib")
443 #pragma comment(lib,"shareCookie.lib")
444 #pragma comment(lib,"winmm.lib")
445 #pragma comment(lib,"JSONParser.lib")