kodak_gallery.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 265 行

H
265
字号
/******************************************************************* *  *  Copyright C 2006 by Amlogic, Inc. All Rights Reserved. * *  Description: SSL library test code. * *  Author: Jerry Cao *  Created: Fri Oct 6 12:12:12 2006 * *******************************************************************/#ifndef KODAK_GALLERY_H#define KODAK_GALLERY_H#include "XMLTemplates.h"#include "KGAgTypes.h"#include "KGList.h"#define XMIxmiFamily	"xmi"	#define XMIwebFamily	"web"	#define XMIallFamily	"all"	#define KG_WAIT_TIMEOUT   500#define KG_DEFAULT_BOUNDARY_DELIMITER   KGDefaultBoundaryDelimiter#define KG_DEFAULT_USER                 "jcao\100amlogic.com"#define KG_DEFAULT_PASSWORD             "amlogicsw"#define KG_DEFAULT_SOURCE_ID            "742736170403"#define KG_DEFAULT_SERVICE_LOCATOR      "http://locator.kodakgallery.com/servlet/XMIDispatchServlet"#define KG_HTTP_REQUEST_SIZE            512#define KG_HTTP_HEADER_SIZE             256#define KG_ERROR_MSG_SIZE               128#define XMI_requestOpen	    XMI_startBoundaryTag \                            XMI_contentDispositionTag_Part1 #define XMI_requestClose    XMI_endBoundaryTagtypedef int (*kg_interrupt_cb_t)(void* arg);typedef enum KGAlbumType_e {    eNoFavorites	= 0,    eOnlyFavorites	= 1,    eAllAlbums		= 2,} KGAlbumType_e;/* AVOS Kodak Gallery implementation define. */typedef enum {    eKG_stateInit = 0,    eKG_stateHttpPost,    eKG_stateReady,} KGState_e;typedef enum KGXMIAction_e {    eKG_XMI_none = 0,    eKG_XMI_list_sites,    eKG_XMI_list_services,    eKG_XMI_login,    eKG_XMI_login_anonymous,    eKG_XMI_logout,    eKG_XMI_get_albums,    eKG_XMI_get_friend_albums,    eKG_XMI_get_photos,    eKG_XMI_get_friend_photos,    //eKG_XMI_get_photo,} KGXMIAction_e;typedef struct KG_get_albums_request{    KGAlbumType_e albumType;    bool          continues;    bool          includeEmptyAlbums;    bool          includeCollectionId;    uint32_t      startIdx;    uint32_t      maxCount;    uint32_t      maxSize;    KGAlbumSpec * albumList;    uint8_t       friendAlbum;} KG_get_albums_request;typedef struct KG_get_photos_request{    bool          continues;    uint32_t      startIdx;    uint32_t      maxCount;    uint32_t      maxSize;    CKGString     imageSize;    uint32_t      photoWidth;    uint32_t      photoHeight;    CKGString     collectionId;    KGPhotoSpec * photoList;    uint8_t       friendPhoto;} KG_get_photos_request;#if 0typedef struct KG_get_photo_request{    uint32_t      maxSize;    CKGString     imageSize;    uint32_t      photoWidth;    uint32_t      photoHeight;    CKGString     photoId;    KGPhotoSpec * photoSpec;} KG_get_photo_request;#endif /* 0 */typedef struct kodakGallery_s {    /* HTTP client connection. */    HTTPTcpConnection_t * queryConn;    HTTPTcpConnection_t * httpConn;    char                  httpHeader[KG_HTTP_HEADER_SIZE];    size_t                httpHeaderSize;    char                  httpRequest[KG_HTTP_REQUEST_SIZE];    size_t                httpRequestSize;    char                * httpResponse;    size_t                httpResponseSize;    OS_EVENT            * httpWait;    void                * httpCookie;    /* Client state. */    KGState_e     state;    /* XMI request execution status and error message buffer. */    KGStatus      status;    char          lastErrorMsg[KG_ERROR_MSG_SIZE];    /* Current XMI action and expected reply. */    KGXMIAction_e currAction;    char        * expectReply;    /* MIME delimiter. */    char * boundaryDelimiter;    /* Vendor source id. */    char * sourceId;    /* User name and password. */    CKGString user;    CKGString password;    /* Session information. */    KGLoginSpec sessionInfo;    /* Service site(s). */    KGSiteSpec * siteSpec;    URI_t * serviceLocator;        char cancel_flag;} kodakGallery_t;kodakGallery_t * KGInit ( void );KGStatus KGPostStream ( kodakGallery_t * kg,                        HTTPTcpConnection_t * client,                        char * host,                        char * uri,                        char * data,                        uint32_t data_len,                        void * cookie,                        kg_interrupt_cb_t interrupt_cb ,void* arg);KGStatus KGSecurePostStream ( kodakGallery_t * kg,                              char * host,                              char * uri,                              char * data,                              uint32_t data_len,                              void * cookie );KGStatus KGClassifyXMIResponse ( kodakGallery_t * kg,                                 char           * pkgNameResp,                                 Docptr         * pDoc,                                 Nodeptr        * pElement,                                 char           * response );KGStatus KG_list_sites ( kodakGallery_t * kg,                         kg_interrupt_cb_t interrupt_cb,                         void* arg );KGStatus KGProcessXMI_list_sites ( kodakGallery_t * kg,                                   Docptr doc,                                   Nodeptr element );KGStatus KG_list_services ( kodakGallery_t * kg,                            CKGString families,                            CKGString language,                            CKGString country ,                            kg_interrupt_cb_t interrupt_cb ,void* arg);KGStatus KGProcessXMI_list_services ( kodakGallery_t * kg,                                      Docptr doc,                                      Nodeptr element );KGStatus KG_login ( kodakGallery_t * kg,                    CKGString user,                    CKGString password,                    kg_interrupt_cb_t interrupt_cb ,void* arg );KGStatus KGProcessXMI_login ( kodakGallery_t * kg,                              Docptr doc,                              Nodeptr element );KGStatus KG_login_anonymous ( kodakGallery_t * kg );KGStatus KGProcessXMI_login_anonymous ( kodakGallery_t * kg,                                        Docptr doc,                                        Nodeptr element );KGStatus KG_get_albums ( kodakGallery_t * kg,                         KG_get_albums_request * request ,                         kg_interrupt_cb_t interrupt_cb ,void* arg);KGStatus KGProcessXMI_get_albums ( kodakGallery_t * kg,                                   Docptr doc,                                   Nodeptr element );KGStatus KG_get_photos ( kodakGallery_t * kg,                         KG_get_photos_request * request ,                         kg_interrupt_cb_t interrupt_cb ,void* arg);KGStatus KGProcessXMI_get_photos ( kodakGallery_t * kg,                                   Docptr doc,                                   Nodeptr element );void KGFree_Album(KGAlbumSpec * currAlbum);void KGFree_Photo(KGPhotoSpec * currPhoto);void KGFree_KG(kodakGallery_t * kg);void KG_Cancel(kodakGallery_t * kg);#if 0KGStatus KG_get_photo ( kodakGallery_t * kg,                        KG_get_photo_request * request ,                        kg_interrupt_cb_t interrupt_cb ,void* arg);KGStatus KGProcessXMI_get_photo ( kodakGallery_t * kg,                                  Docptr doc,                                  Nodeptr element );#endif /* 0 */#ifdef KODAK_GALLERY_DEBUG#define kgPrint 		AVOS_printf_ext#define KG_DUMP_DATA	AVOS_printfvoid KG_string_dump ( char * buf, uint32_t buf_size );void KG_album_dump ( KGAlbumSpec * list );void KG_photo_dump ( KGPhotoSpec * list );void KG_download_photo ( kodakGallery_t * kg, KGPhotoSpec * photo );void KG_test ( void );#else /* KODAK_GALLERY_DEBUG */#define kgPrint(x...) #define KG_DUMP_DATA(x...) #define KG_string_dump(x, y) #define KG_album_dump(x) #define KG_photo_dump(x)#define KG_download_photo(x, y) #define KG_test(x)#endif /* KODAK_GALLERY_DEBUG */#endif /* KODAK_GALLERY_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?