00001 /***************************************************************************** 00002 * Copyright (c) 1999-2008 ACCESS CO., LTD. All rights reserved. 00003 * Copyright(c) 2006 PalmSource, Inc (an ACCESS company). All rights reserved. 00004 *****************************************************************************/ 00019 /*Includes********************************************************************/ 00020 #ifndef ALP_CATMGR_DML_H_ 00021 #define ALP_CATMGR_DML_H_ 1 00022 00023 00024 #include <stdint.h> 00025 #include <stdbool.h> 00026 #include <string.h> 00027 #include <alp/types.h> 00028 #include <alp/sysclass.h> 00029 #include <glib.h> 00030 00031 00032 /*Defines*********************************************************************/ 00039 #define ALP_STATUS_CATMGR_DML_NO_MEM \ 00040 (ALP_CLASS_CATMGR_DML | 0x00010000) 00041 #define ALP_STATUS_CATMGR_DML_BAD_PARAM \ 00042 (ALP_CLASS_CATMGR_DML | 0x00020000) 00043 #define ALP_STATUS_CATMGR_DML_INTERNAL_ERR \ 00044 (ALP_CLASS_CATMGR_DML | 0x00030000) 00045 #define ALP_STATUS_CATMGR_DML_INVALID_LUID \ 00046 (ALP_CLASS_CATMGR_DML | 0x00040000) 00047 #define ALP_STATUS_CATMGR_DML_NO_RECORDS \ 00048 (ALP_CLASS_CATMGR_DML | 0x00050000) 00049 #define ALP_STATUS_CATMGR_DML_DATABASE_ERR \ 00050 (ALP_CLASS_CATMGR_DML | 0x00060000) 00051 #define ALP_STATUS_CATMGR_DML_NOT_FOUND \ 00052 (ALP_CLASS_CATMGR_DML | 0x00070000) 00053 #define ALP_STATUS_CATMGR_DML_DUPLICATE_MEMBERSHIP \ 00054 (ALP_CLASS_CATMGR_DML | 0x00080000) 00055 #define ALP_STATUS_CATMGR_DML_CHANGEMGR_ERROR \ 00056 (ALP_CLASS_CATMGR_DML | 0x00090000) 00057 #define ALP_STATUS_CATMGR_DML_UDA_ERROR \ 00058 (ALP_CLASS_CATMGR_DML | 0x000A0000) 00059 #define ALP_STATUS_CATMGR_DML_PDI_ERROR \ 00060 (ALP_CLASS_CATMGR_DML | 0x000B0000) 00061 00070 typedef enum { 00071 Name, 00072 CategoryLuid, 00073 ReadOnly, 00074 EntityLuid, 00075 MembershipLuid, 00076 } AlpCatMgrDmlColumnType; 00077 00078 typedef enum { 00079 CategoryItem = 1, 00080 MembershipItem 00081 } AlpCatMgrDmlItemType; 00082 00086 #ifdef __cplusplus 00087 extern "C" { 00088 #endif /* __cplusplus */ 00089 00109 extern alp_status_t alp_catmgr_dml_init(AlpDmlH dmlH); 00110 00143 extern alp_status_t alp_catmgr_dml_open(AlpDmlH *catH, 00144 AlpDmlH dmlH, 00145 bool changeTrackingOn, 00146 const char *categoryURI, 00147 const char *membershipURI); 00148 00149 00163 extern alp_status_t alp_catmgr_dml_close(AlpDmlH catH); 00164 00179 extern alp_status_t alp_catmgr_dml_item_create( 00180 AlpCatMgrDmlItemType itemType, 00181 AlpDmlItemH *itemH); 00182 00195 extern alp_status_t alp_catmgr_dml_item_destroy(AlpDmlItemH itemH); 00196 00214 extern alp_status_t alp_catmgr_dml_item_set_int32( 00215 AlpDmlItemH itemH, 00216 AlpCatMgrDmlColumnType column, 00217 const int32_t *value); 00218 00243 extern alp_status_t alp_catmgr_dml_item_set_string( 00244 AlpDmlItemH itemH, 00245 AlpCatMgrDmlColumnType column, 00246 const char *value); 00247 00274 extern alp_status_t alp_catmgr_dml_insert( 00275 AlpDmlH dmlH, 00276 AlpDmlItemH itemH, 00277 AlpLuid *itemLuid); 00278 00299 extern alp_status_t alp_catmgr_dml_update( 00300 AlpDmlH dmlH, 00301 AlpDmlItemH itemH, 00302 AlpLuid itemLuid); 00303 00313 extern alp_status_t alp_catmgr_dml_delete( 00314 AlpDmlH dmlH, 00315 AlpCatMgrDmlItemType itemType, 00316 AlpLuid itemLuid); 00317 00359 extern alp_status_t alp_catmgr_dml_category_statement_begin( 00360 AlpDmlH dmlH, 00361 AlpLuid categoryLuid, 00362 AlpDmlStatementH *stmtH, 00363 int32_t *numResults); 00402 extern alp_status_t alp_catmgr_dml_membership_statement_begin( 00403 AlpDmlH dmlH, 00404 AlpLuid entityLuid, 00405 AlpLuid categoryLuid, 00406 AlpDmlStatementH *stmtH, 00407 int32_t *numResults); 00418 extern alp_status_t alp_catmgr_dml_statement_next( 00419 AlpDmlStatementH dmlStmtH); 00420 00427 extern alp_status_t alp_catmgr_dml_statement_end( 00428 AlpDmlStatementH dmlStmtH); 00429 00443 extern alp_status_t alp_catmgr_dml_statement_get_int32( 00444 AlpDmlStatementH dmlStmtH, 00445 AlpCatMgrDmlColumnType column, 00446 int32_t *value); 00447 00462 extern alp_status_t alp_catmgr_dml_statement_get_string( 00463 AlpDmlStatementH dmlStmtH, 00464 AlpCatMgrDmlColumnType column, 00465 char **value); 00466 00483 extern alp_status_t alp_catmgr_dml_statement_get_luid( 00484 AlpDmlStatementH dmlStmtH, 00485 AlpLuid *entityLuid); 00486 00506 extern alp_status_t alp_catmgr_dml_add_memberships( 00507 AlpDmlH catDmlH, 00508 AlpLuid entityID, 00509 const AlpLuid *categoryIDs, 00510 AlpLuid membershipID, 00511 int32_t numCategoryIDs); 00512 00513 #define alp_catmgr_dml_memberships_add alp_catmgr_dml_add_memberships 00514 00515 00536 extern alp_status_t alp_catmgr_dml_remove_memberships( 00537 AlpDmlH catDmlH, 00538 AlpLuid entityID, 00539 AlpLuid categoryID, 00540 AlpLuid membershipID); 00541 00542 #define alp_catmgr_dml_memberships_remove alp_catmgr_dml_remove_memberships 00543 00572 extern alp_status_t alp_catmgr_dml_category_from_vCategory_file( 00573 AlpDmlH dmlH, 00574 int theDataFd, 00575 bool fromExgMgr, 00576 GList** categoryLuids); 00577 00597 extern alp_status_t alp_catmgr_dml_category_from_vCategory_buffer( 00598 AlpDmlH dmlH, 00599 const uint8_t* dataBuf, 00600 bool fromExgMgr, 00601 GList** categoryLuids); 00602 00618 extern alp_status_t alp_catmgr_dml_category_to_vCategory_file( 00619 AlpDmlH dmlH, 00620 int theDataFd, 00621 bool toExgMgr, 00622 GList* categoryLuids); 00623 00624 00640 extern alp_status_t alp_catmgr_dml_category_to_vCategory_buffer( 00641 AlpDmlH dmlH, 00642 uint8_t** dataBuf, 00643 size_t* size, 00644 bool toExgMgr, 00645 GList* categoryLuids); 00646 00668 extern alp_status_t alp_catmgr_dml_membership_from_vMembership_file( 00669 AlpDmlH dmlH, 00670 int theDataFd, 00671 bool fromExgMgr, 00672 GList** membershipLuids); 00673 00693 extern alp_status_t alp_catmgr_dml_membership_from_vMembership_buffer( 00694 AlpDmlH dmlH, 00695 const uint8_t* dataBuf, 00696 bool fromExgMgr, 00697 GList** membershipLuids); 00713 extern alp_status_t alp_catmgr_dml_membership_to_vMembership_file( 00714 AlpDmlH dmlH, 00715 int theDataFd, 00716 bool toExgMgr, 00717 GList* membershipLuids); 00718 00734 extern alp_status_t alp_catmgr_dml_membership_to_vMembership_buffer( 00735 AlpDmlH dmlH, 00736 uint8_t** dataBuf, 00737 size_t* size, 00738 bool toExgMgr, 00739 GList* membershipLuids); 00740 00741 00745 00746 #ifdef __cplusplus 00747 } 00748 #endif /* __cplusplus */ 00749 00750 #endif /* ALP_CATMGR_DML_H_ */ 00751
Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.