#pragma once
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+
+#include <Windows.h>
#include <qwerty\qwerty_common.h>
+#include <shareCookie\browserType.h>
#include <winhttp.h>
+#include "nlib_define.h"
#ifdef NLIB_EXPORTS
//\8c^\92è\8b`
//////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+
///
///nlib\82Ì\96ß\82è\92l\82Ì\8c^
///
typedef UINT_PTR NLIB_RESULT;
+///
+///\83v\83\8d\83o\83C\83_\83^\83C\83v
+///
+typedef UINT_PTR PROVIDERTYPE;
+
///
///NicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
typedef UINT_PTR NICOLIVE_PARAM;
-
///
-///nlib\82Ì\90Ý\92è\83I\83u\83W\83F\83N\83g\83|\83C\83\93\83^
+///NicoMyList\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
///
-//typedef struct nlibproperty_t *NlibProperty_P;
+typedef UINT_PTR NICOMYLIST_EVENT;
+
+
+
///
///\83j\83R\83j\83R\90¶\95ú\91\97\83I\83u\83W\83F\83N\83g\83|\83C\83\93\83^
+///
+///\83j\83R\83j\83R\90¶\95ú\91\97\83X\83e\81[\83^\83X
+///
+//typedef struct streamstatus_t *StreamStatus_P;
+
+
+///
+///\83j\83R\83j\83R\90¶\95ú\91\97\8fî\95ñ\83I\83u\83W\83F\83N\83g
+///
+//typedef struct streaminfo_t *StreamInfo_P;
+
+
-typedef struct {
- WCHAR deleted[LENGTH_2048];
- time_t first_retrieve;
- WCHAR group_type[LENGTH_2048];
- WCHAR last_res_body[LENGTH_2048];
- WCHAR length_seconds[LENGTH_2048];
- WCHAR mylist_counter[LENGTH_2048];
- WCHAR num_res[LENGTH_2048];
- WCHAR thumbnail_url[LENGTH_2048];
- WCHAR title[LENGTH_2048];
- time_t update_time;
- WCHAR video_id[LENGTH_2048];
- WCHAR view_counter[LENGTH_2048];
- WCHAR watch_id[LENGTH_2048];
-}NicoItemData,*NicoItemData_P;
///
-///\83j\83R\83j\83R\93®\89æ\82¨\8bC\82É\93ü\82è\93®\89æ
+///\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\83A\83C\83e\83\80\83I\83u\83W\83F\83N\83g
///
-typedef struct {
- time_t create_time;
- WCHAR description[LENGTH_2048];
- NicoItemData itemData;
- WCHAR item_id[LENGTH_2048];
- WCHAR item_type[LENGTH_2048];
- time_t update_time;
- UINT_PTR watch;
+typedef struct nicomylistitem_t *NicoMyListItem_P;
+///
+///\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
+///
+typedef struct nicoitemdata_t *NicoItemData_P;
-}NicoMyListItem,*NicoMyListItem_P;
+///
+///\83j\83R\83j\83R\93®\89æ\82Ì\83}\83C\83\8a\83X\83g\83I\83u\83W\83F\83N\83g
+///
+typedef struct nicomylist_t *NicoMyList_P;
///
///\83j\83R\83j\83R\90¶\95ú\91\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
///
///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\83C\83x\83\93\83g\83n\83\93\83h\83\89
///
-typedef NLIB_RESULT (*NicoMyListCallBack)(LPVOID option,NicoMyListItem_P pVideo,DWORD code);
-
-
+typedef NLIB_RESULT (*NicoMyListCallBack)(LPVOID option,NicoMyListItem_P pVideo);
-
-typedef UCHAR NICOLIVE_PREMIUM;
-typedef UCHAR NICOLIVE_ANONYMITY;
+///
+///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\88ê\97\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
+///
+typedef NLIB_RESULT (*NicoMyListGroupCallBack)(LPVOID option,NicoMyList_P pMyList);
///
///\83j\83R\83j\83R\90¶\95ú\91\97\83`\83\83\83b\83g\83R\83\81\83\93\83g\8d\\91¢\91Ì
///
typedef struct{
- LPCWSTR premium;
- LPCWSTR anonymity;
- LPCWSTR thread;
- LPCWSTR no;
- LPCWSTR vpos;
- LPCWSTR date;
- LPCWSTR locale;
- LPCWSTR user_id;
- LPCWSTR name;
- LPCWSTR chatBuf;
- LPCWSTR* mail;
+ LPCTSTR premium;
+ LPCTSTR anonymity;
+ LPCTSTR thread;
+ LPCTSTR no;
+ LPCTSTR vpos;
+ LPCTSTR date;
+ LPCTSTR locale;
+ LPCTSTR user_id;
+ LPCTSTR name;
+ LPCTSTR chatBuf;
+ LPTSTR* mail;
UINT_PTR mailCount;
}NicoLiveChat,*NicoLiveChat_P;
///\83j\83R\83j\83R\90¶\95ú\91\97\83X\83\8c\83b\83h\83R\83\81\83\93\83g\8d\\91¢\91Ì
///
typedef struct{
- LPCWSTR thread;
- LPCWSTR ticket;
- LPCWSTR last_res;
- LPCWSTR server_time;
+ LPCTSTR thread;
+ LPCTSTR ticket;
+ LPCTSTR last_res;
+ time_t server_time;
}NicoLiveThreadComment,*NicoLiveThreadComment_P;
///\83j\83R\83j\83R\90¶\95ú\91\97\91\97\90M\8c\8b\89Ê\83R\83\81\83\93\83g\8d\\91¢\91Ì
///
typedef struct{
- LPCWSTR status;
- LPCWSTR no;
- LPCWSTR thread;
+ LPCTSTR status;
+ LPCTSTR no;
+ LPCTSTR thread;
}NicoLiveSendResultComment,*NicoLiveSendResultComment_P;
UINT_PTR commentCount;
- LPCWSTR is_restrict;
+ LPCTSTR is_restrict;
- LPCWSTR ticket;
+ LPCTSTR ticket;
}NicoLiveHeartBeat,*NicoLiveHeartBeat_P;
+namespace nlib{
///
-///\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\83I\83u\83W\83F\83N\83g\83|\83C\83\93\83^
+///nlib\97á\8aO\8f\88\97\9d\83N\83\89\83X
///
-typedef struct nicomylist_t *NicoMyList_P;
+class Exception:public std::exception{
+
+private:
+ std::wstring wErrMessage;
+ UINT_PTR line;
+ std::wstring fileName;
+ std::wstring function;
+
+
+public:
+ ///
+ ///\83R\83\93\83X\83g\83\89\83N\83^
+ ///
+ Exception();
+ Exception(const char* const& errMessage);
+ Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
+
+
+ ///
+ ///\83G\83\89\81[\95¶\8c¾\8eæ\93¾
+ ///
+ LPCTSTR what();
+
+
+ ///
+ ///\83G\83\89\81[\94\90¶\8ds\8eæ\93¾
+ ///
+ UINT_PTR getLineNo();
+
+ ///
+ ///\83G\83\89\81[\94\90¶\83t\83@\83C\83\8b\96¼\8eæ\93¾
+ ///
+ LPCTSTR getFileName();
+
+
+ ///
+ ///\83G\83\89\81[\94\90¶\8aÖ\90\94\96¼\82ð\8eæ\93¾
+ ///
+ LPCTSTR getFunctionName();
+
+};
+}
+
-#ifdef __cplusplus
-extern "C" {
-#endif
///
///
NLIB_DECLSPEC VOID FinalizeNLIB();
- //
- //\83j\83R\83j\83R\90¶\95ú\91\97\8aÖ\98A\8aÖ\90\94
- /////////////////////////////////////////////////////////////////////////////////////////////////////
///
+ ///\83G\83\89\81[\83\81\83b\83Z\81[\83W\8eæ\93¾
+ ///
+ NLIB_DECLSPEC LPCTSTR NLIB_GetErrorMessage(NLIB_RESULT rsltCode);
+
+
+
+
+
+
+//
+//\83j\83R\83j\83R\90¶\95ú\91\97\8aÖ\98A\8aÖ\90\94
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+ ///
///\83j\83R\83j\83R\90¶\95ú\91\97\83I\83u\83W\83F\83N\83g\93®\93I\90¶\90¬
///
NLIB_DECLSPEC NicoLiveStream_P NicoLiveStream_new();
///
///\8ew\92è\82µ\82½URL\82Ì\95ú\91\97\82É\90Ú\91±
///
- NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVideoAuth,LPCWSTR url,NicoRecvCallBack callback,LPVOID option);
+ NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVideoAuth,LPCTSTR url,NicoRecvCallBack callback,LPVOID option);
///
///
///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\90Ý\92è
///
- NLIB_DECLSPEC VOID SetResFrom(INT_PTR res);
+ NLIB_DECLSPEC VOID NicoLiveStrream_setResFrom(NicoLiveStream_P self,INT_PTR res);
///
///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\8eæ\93¾
///
- NLIB_DECLSPEC INT_PTR GetResFrom();
+ NLIB_DECLSPEC INT_PTR NicoLiveStream_getResFrom(NicoLiveStream_P self);
///
///\83n\81[\83g\83r\81[\83g\82Ì\8aÔ\8au\82ð\90Ý\92è\81i\83~\83\8a\95b)
///
+ ///\90¶\95ú\91\97\83X\83e\81[\83^\83X\8eæ\93¾
+ ///
+// NLIB_DECLSPEC StreamStatus_P NicoLiveStream_getStreamStatus(NicoLiveStream_P self);
+
+ ///
///\83R\83\81\83\93\83g\91\97\90M
///
- NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCWSTR chatbuf,LPCWSTR *mail,LPCWSTR *extends);
+ NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTSTR *mail,LPCTSTR *extends);
+
+
+ ///
+ ///\90¶\8eå\83R\83\81\83\93\83g\91\97\90M
+ ///
+ NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendOwnerChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTSTR *mail,LPCTSTR *extends);
///
///\83n\81[\83g\83r\81[\83g\91\97\90M
NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self);
+ ///
+ ///\90Ú\91±\92\86\82Ì\95ú\91\97\8fî\95ñ\82ð\96â\82¢\8d\87\82í\82¹\82é
+ ///
+// NLIB_DECLSPEC StreamInfo_P NicoLiveStream_queryStreamInfo(NicoLiveStream_P self);
+
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82ÌID\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC LPCTSTR NicoLiveStream_getId(NicoLiveStream_P self);
+
+
+ ///
+ ///\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¾
+ ///
+ NLIB_DECLSPEC LPCTSTR NicoLiveStream_getDefaultCommunity(NicoLiveStream_P self);
+
+
+ ///
+ ///\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¾
+ ///
+ NLIB_DECLSPEC PROVIDERTYPE NicoLiveStream_getProviderType(NicoLiveStream_P self);
+
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83I\81[\83i\81[\83t\83\89\83O\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC BOOL NicoLiveStream_isOwner(NicoLiveStream_P self);
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8aJ\8en\8e\9e\8d\8f\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC time_t NicoLiveStream_getStartTime(NicoLiveStream_P self);
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8fI\97¹\8e\9e\8d\8f\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC time_t NicoLiveStream_getEndTime(NicoLiveStream_P self);
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\8aJ\8fê\8e\9e\8d\8f\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC time_t NicoLiveStream_getOpenTime(NicoLiveStream_P self);
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83x\81[\83X\8e\9e\8d\8f\82ð\8eæ\93¾
+ ///
+ NLIB_DECLSPEC time_t NicoLiveStream_getBaseTime(NicoLiveStream_P self);
+
+
+ ///
+ ///\83X\83g\83\8a\81[\83\80\83X\83e\81[\83^\83X\82Ì\83^\83C\83g\83\8b\8eæ\93¾
+ ///
+ NLIB_DECLSPEC LPCTSTR NicoLiveStream_getTitle(NicoLiveStream_P self);
+
+
+ ///
+ ///\83v\83\8c\83~\83A\83\80\83t\83\89\83O\82Ì\8eæ\93¾
+ ///
+ NLIB_DECLSPEC BOOL NicoLiveStream_isPremium(NicoLiveStream_P self);
+
//
//\83j\83R\83j\83R\93®\89æ\94F\8fØ\8aÖ\98A\8aÖ\90\94
/////////////////////////////////////////////////////////////////////////////////////////////////
///
+ ///\83\86\81[\83U\81[\83Z\83b\83V\83\87\83\93\8eæ\93¾
+ ///
+ NLIB_DECLSPEC LPCTSTR NicoVideoAuth_getUserSession(NicoVideoAuth_P self);
+
+ ///
///\83j\83R\83j\83R\93®\89æ\94F\8fØ\8fî\95ñ\8eæ\93¾
///
NLIB_DECLSPEC NLIB_RESULT NicoVideoAuth_getNicoVideoAuth(NicoVideoAuth_P self,BROWSERTYPE browserType);
///
///\82Æ\82è\82 \82¦\82¸\83}\83C\83\8a\83X\83g\88ê\97\97\8eæ\93¾
///
- NLIB_DECLSPEC NLIB_RESULT NicoMyList_getDefList(NicoVideoAuth_P pAuth,NicoMyListCallBack callback,BOOL mtFlag,LPVOID option);
+ NLIB_DECLSPEC NLIB_RESULT NicoMyList_getDefList(NicoVideoAuth_P pAuth,NicoMyListCallBack callback,LPVOID option);
+ ///
+ ///\83}\83C\83\8a\83X\83g\8eæ\93¾
+ ///
+ NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyList(NicoVideoAuth_P pAuth,LPCTSTR id,NicoMyListCallBack callback,LPVOID option);
+ ///
+ ///\83}\83C\83\8a\83X\83g\83O\83\8b\81[\83v\8eæ\93¾
+ ///
+ NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyListGroup(NicoVideoAuth_P pAuth,NicoMyListGroupCallBack callback,LPVOID option);
+ ///
+ ///\83}\83C\83\8a\83X\83g\93o\98^\8cÄ\82Ñ\8fo\82µ
+ ///
+ NLIB_DECLSPEC NLIB_RESULT NicoMyList_addItem(LPCTSTR video_id);
-#ifdef __cplusplus
-}
-#endif
\ No newline at end of file
+
+#pragma comment(lib,"Wininet.lib")
+#pragma comment(lib,"WinHttp.lib")
+#pragma comment(lib,"Iepmapi.lib")
+#pragma comment(lib,"ws2_32.lib")
+#pragma comment(lib, "shell32.lib" )
+#pragma comment(lib,"expat.lib")
+#pragma comment(lib,"sqlite3.lib")
+#pragma comment(lib,"shareCookie.lib")
+#pragma comment(lib,"winmm.lib")
+#pragma comment(lib,"JSONParser.lib")