kgdefs.h

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

H
149
字号

#ifndef KG_DEFS_H
#define KG_DEFS_H

/** items that may or may not be present in the environment */
#ifndef NULL
#define NULL (0)
#endif

//! \brief cross platform 8 bit data.
typedef unsigned char KGByte;

/** \brief avoid problems with inconsistent "size" type definitions across environments. */
typedef unsigned long kg_size;

/** \brief status codes returned by KGallery functions. All-caps codes correspond directly
	to codes returned by KEG. */
enum KGStatusCodes_e {

	KG_NoError = 0,
	KG_NotImplemented,
	KG_OutOfMemory,
	KG_InvalidArgument,
	KG_MissingURL,		//!< a required URL was empty or missing

	KG_FileNotFound,
	KG_FileOpenFailed,
	KG_FileReadFailed,
	KG_FileWriteFailed,
	KG_MiscError,

	KG_INetPostError,
	KG_Bug, // reported when an error looks like bad code
	KG_UnknownException,
	KG_ErrorRetry,
	KG_OperatorCancelled,

	KG_CallbackError,
	KG_NotFound,
	KG_DOM_Error,
	KG_BOF,
	KG_EOF,

	KG_IOPending,		//!< Not all IO has completed.
	KG_WrongSession,

	/** standard C runtime errors. */
	KG_WouldBlock,			//!< EAGAIN
	KG_BadFileDescriptor,	//!< EBADF
	KG_FileTooBig,			//!< EFBIG
	KG_Interrupted,			//!< EINTR
	KG_IOError,				//!< EIO

	KG_NoSpace,				//!< ENOSPC
	KG_Pipe,				//!< EPIPE
	KG_NoSuchDevice,		//!< ENXIO

	// The rest is from the old KGErrorManifestation;	

	/////////////////////////////////////////////////////////////////////////
	/////////////////// XMI API
	////////////////////////////////////////////////////////////////////////

	KG_CREATE_HTTP_REQUEST_ACTION_FAILED		,
	KG_CREATE_STREAM_ACTION_FAILED				,
	KG_WRITE_STREAM_ACTION_FAILED				,
	KG_PARSE_RETURN_VALUE_ACTION_FAILED			,
	KG_RESET_STREAM_ACTION_FAILED				,

	KG_POST_STREAM_ACTION_FAILED				,
	KG_SEEK_STREAM_ACTION_FAILED				,
	KG_ADD_IMAGE_TO_STREAM_ACTION_FAILED		,
	KG_PARSE_ALBUM_IDS_ACTION_FAILED			,
	KG_CREATE_TRANSFER_ASSETS_ACTION_FAILED		,

	KG_CREATE_ALBUM_CONTENTS_ACTION_FAILED		,
	KG_PARSE_UPLOAD_ASSETS_ACTION_FAILED		,
	KG_INVALID_NUMBER							,		// Ofoto return an "invalid_num" status code.
	KG_INVALID_XML								,		// The XML document could not be parsed.
	KG_INVALID_XMI_VERSION						,		// The XMI version is invalid

	KG_INVALID_ACTION							,		// An unrecognized action was specified.
	KG_INVALID_SOURCE_ID 						,		// An invalid sourceid was specified.
	KG_INVALID_SESSION_ID						,		// sessionid is invalid.
	KG_SESSION_TIMED_OUT						,		// Session has expired.
	KG_MISSING_RESPONSE							,		// Expected data was not in the response

	KG_UNKNOWN_ERROR							,		// An internal error occurred.
	KG_SERVLET_EXCEPTION						,		// Servlet threw an unhandled exception.
	KG_USER_LOGIN_REQUIRED						,		// The requested action requires a user-level login.
	KG_SSL_REQUIRED								,		// The requested action requires connection via SSL (https).
	KG_SUB_ERROR								,		// An error was found in one or more of the subsections of the request, but the rest of the request was successful. See the detail status codes for details.

	KG_NOT_IMPLEMENTED							,		// The requested XMI is not implemented.
	KG_INTERNET_CONNECT_FAILED					,
	KG_INTERNET_OPEN_FAILED						,
	KG_INTERNET_WRITE_FILE_FAILED				,
	KG_STATUS_FAILED							,	

	KG_SERVER_ERROR								,
	KG_NO_IMAGES_TO_PROCESS						,
	KG_RETRIEVE_INI_VALUE_ACTION_FAILED			,
	KG_SET_STREAM_SIZE_ACTION_FAILED			,
	KG_INVALID_TODO_POINTER						,	

	KG_TODO_LAST_ACTION_CANCELLED				,
	KG_DUPLICATE_ACCOUNT_FOUND					,
	KG_OFOTO_LOGIN_ACTION_FAILED				,
	KG_OFOTO_LOGIN_INVALID_PASSWORD				,
	KG_OFOTO_LOGIN_INVALID_USERID				,

	KG_LIST_SERVICES_ACTION_FAILED		,
	KG_OFOTO_UPLOAD_FILESIZE_LIMIT_EXCEEDED		,
	KG_OFOTO_ALBUM_FILECOUNT_LIMIT_EXCEEDED		,
	KG_OFOTO_SAVE_FILE_ACTION_FAILED			,
	KG_OFOTO_NO_ALBUMS_EXIST					,

	KG_OFOTO_MAX_ACTIVE_POSTS_EXCEEDED			,
	KG_SECURITY_CERTIFICATION_UNKNOWN			,
	KG_OFOTO_NOT_ALL_FILES_UPLOADED				,
	KG_OFOTO_ANON_SESSION_REQUIRED				,
	KG_FAILURE									 // no comma for last enum

	//////////////////////////////////////////////////////////////////////////
};
typedef enum KGStatusCodes_e KGStatus; // TODO fold in with error manifestation codes below???

// position in stream, relative to which the pointer will be moved.
typedef enum tagKG_STREAM_SEEK
{	
	KG_STREAM_SEEK_SET	= 0,	// beginning of stream
	KG_STREAM_SEEK_CUR	= 1,	// current position in stream
	KG_STREAM_SEEK_END	= 2		// end of stream
} 	KG_STREAM_SEEK;

/** types we need (want?) that may not exist on every platform. For now
	just a reminder.
	*/

/** Smart pointers - I want to use smart pointers for interfaces, but I need 
	to make sure that whatever I use is supported on Linux. */


/** for clarity, give interfaces their own type TODO should this be a typedef?*/
#define KGSDK_Interface struct

#endif /* KG_DEFS_H */

⌨️ 快捷键说明

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