xf.li | bfc6e71 | 2025-02-07 01:54:34 -0800 | [diff] [blame^] | 1 | |
| 2 | #include "pb_com.h"
|
| 3 | T_zPb_DbResult atPb_CreatDb(){T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ |
| 4 | ZPB_MAX_BYTES_DB]={(0x17bf+3885-0x26ec)};UINT32 count=(0x677+5507-0x1bfa);result |
| 5 | =atPb_ExecDbSql(ZPB_CREATE_PBM_TABLE,NULL,NULL);if(ZPB_DB_OK!=result){slog( |
| 6 | PB_PRINT,SLOG_ERR, |
| 7 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x72\x65\x61\x74\x65\x20\x70\x62\x6d\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 8 | ,result);return result;}result=atPb_ExecDbSql( |
| 9 | ZPB_CREATE_PBM_SIM_CAPABILITY_TABLE,NULL,NULL);if(ZPB_DB_OK!=result){slog( |
| 10 | PB_PRINT,SLOG_ERR, |
| 11 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x72\x65\x61\x74\x65\x20\x70\x62\x6d\x5f\x73\x69\x6d\x5f\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x79\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 12 | ,result);return result;}result=atPb_ExecDbSql( |
| 13 | ZPB_CREATE_PBM_DEVICE_CAPABILITY_TABLE,NULL,NULL);if(ZPB_DB_OK!=result){slog( |
| 14 | PB_PRINT,SLOG_ERR, |
| 15 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x72\x65\x61\x74\x65\x20\x70\x62\x6d\x5f\x64\x65\x76\x69\x63\x65\x5f\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x79\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 16 | ,result);return result;}snprintf(sql,sizeof(sql), |
| 17 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" |
| 18 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_USIM);result=atPb_ExecDbSql(sql,NULL,NULL);if( |
| 19 | ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_ERR, |
| 20 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x72\x65\x61\x74\x65\x20\x70\x62\x6d\x5f\x64\x65\x76\x69\x63\x65\x5f\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x79\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 21 | ,result);return result;}memset(sql,(0x7c5+1762-0xea7),sizeof(sql));snprintf(sql, |
| 22 | sizeof(sql)-(0x29f+1571-0x8c1), |
| 23 | "\x73\x65\x6c\x65\x63\x74\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x66\x72\x6f\x6d\x20\x25\x73" |
| 24 | ,ZPB_DB_SIM_CAPABILITY_TABLE);(VOID)atPb_ExecDbSql(sql,atPb_DbCountTableLineCb,& |
| 25 | count);if((0x373+2622-0xdb1)<count){memset(sql,(0x4d8+6944-0x1ff8),sizeof(sql)); |
| 26 | snprintf(sql,sizeof(sql)-(0x674+7098-0x222d), |
| 27 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x53\x69\x6d\x5f\x74\x79\x70\x65\x3e\x3d\x30" |
| 28 | ,ZPB_DB_SIM_CAPABILITY_TABLE);result=atPb_ExecDbSql(sql,NULL,NULL);if(ZPB_DB_OK |
| 29 | !=result){slog(PB_PRINT,SLOG_DEBUG, |
| 30 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x53\x65\x74\x53\x69\x6d\x43\x61\x70\x61\x63\x69\x74\x79\x54\x61\x62\x6c\x65\x3a\x66\x61\x69\x6c\x21" "\n" |
| 31 | );return result;}}return ZPB_DB_OK;}T_zPb_DbResult atPb_DropDb(){T_zPb_DbResult |
| 32 | result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0x1015+4461-0x2182)};result= |
| 33 | atPb_ExecDbSql(ZTE_DROP_PBM_SQL,NULL,NULL);if(ZPB_DB_OK!=result){slog(PB_PRINT, |
| 34 | SLOG_ERR, |
| 35 | "\x61\x74\x50\x62\x5f\x44\x72\x6f\x70\x44\x62\x3a\x64\x65\x6c\x20\x70\x62\x6d\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 36 | ,result);return result;}result=atPb_ExecDbSql(ZTE_DROP_PBM_DEVICE_SQL,NULL,NULL) |
| 37 | ;if(ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_ERR, |
| 38 | "\x61\x74\x50\x62\x5f\x44\x72\x6f\x70\x44\x62\x3a\x64\x65\x6c\x20\x70\x62\x6d\x5f\x64\x65\x76\x69\x63\x65\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 39 | ,result);return result;}result=atPb_ExecDbSql(ZTE_DROP_PBM_SIM_SQL,NULL,NULL);if |
| 40 | (ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_ERR, |
| 41 | "\x61\x74\x50\x62\x5f\x44\x72\x6f\x70\x44\x62\x3a\x64\x65\x6c\x20\x70\x62\x6d\x5f\x73\x69\x6d\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 42 | ,result);return result;}result=atPb_ExecDbSql(ZTE_DROP_PBM_SIM_CAPABILITY_SQL, |
| 43 | NULL,NULL);if(ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_ERR, |
| 44 | "\x61\x74\x50\x62\x5f\x44\x72\x6f\x70\x44\x62\x3a\x64\x65\x6c\x20\x70\x62\x6d\x5f\x73\x69\x6d\x5f\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x79\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 45 | ,result);return result;}result=atPb_ExecDbSql(ZTE_DROP_PBM_DEVICE_CAPABILITY_SQL |
| 46 | ,NULL,NULL);if(ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_ERR, |
| 47 | "\x61\x74\x50\x62\x5f\x44\x72\x6f\x70\x44\x62\x3a\x64\x65\x6c\x20\x70\x62\x6d\x5f\x64\x65\x76\x69\x63\x65\x5f\x63\x61\x70\x61\x62\x69\x6c\x69\x74\x79\x20\x74\x61\x62\x6c\x65\x20\x72\x65\x73\x75\x6c\x74\x20\x69\x73\x20\x25\x64" "\n" |
| 48 | ,result);return result;}return ZPB_DB_OK;}T_zPb_DbResult atPb_DbOpen(sqlite3** |
| 49 | pDb){sqlite3*pTmpDb=NULL;if(NULL==pDb){slog(PB_PRINT,SLOG_ERR, |
| 50 | "\x70\x62\x3a\x70\x62\x6d\x3a\x69\x6e\x76\x61\x6c\x69\x64\x65\x20\x69\x6e\x70\x75\x74\x73\x2e" |
| 51 | );return ZPB_DB_ERROR_INVALIDPTR;}slog(PB_PRINT,SLOG_DEBUG, |
| 52 | "\x70\x62\x3a\x73\x71\x6c\x69\x74\x65\x33\x5f\x6f\x70\x65\x6e\x20\x63\x61\x6c\x6c" |
| 53 | ); |
| 54 | #if (0x2197+446-0x2355)
|
| 55 | if(!fopen(ZPB_DB_PATH,"\x72")){file=fopen(ZPB_DB_PATH,"\x77");if(!file){printf( |
| 56 | "\x75\x6e\x61\x62\x6c\x65\x20\x74\x6f\x20\x6f\x70\x65\x6e\x20\x20\x66\x69\x6c\x65\x20\x65\x74\x63\x5f\x72\x77\x2f\x70\x62\x6d\x2e\x64\x62" "\n" |
| 57 | );}else{printf( |
| 58 | "\x20\x6f\x70\x65\x6e\x20\x20\x66\x69\x6c\x65\x20\x65\x74\x63\x5f\x72\x77\x2f\x70\x62\x6d\x2e\x64\x62\x20\x66\x69\x6c\x65\x3d\x25\x64" "\n" |
| 59 | ,file);fclose(file);}} |
| 60 | #endif
|
| 61 | if(sqlite3_open(ZPB_DB_PATH,&pTmpDb)){slog(PB_PRINT,SLOG_ERR, |
| 62 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x61\x6e\x20\x6e\x6f\x74\x20\x6f\x70\x65\x6e\x20\x64\x62\x2c\x73\x71\x6c\x69\x74\x65\x33\x5f\x65\x72\x72\x6d\x73\x67\x3a\x25\x73\x2e" |
| 63 | ,sqlite3_errmsg(pTmpDb));(VOID)sqlite3_close(pTmpDb);return |
| 64 | ZPB_DB_ERROR_NOTOPENDB;}*pDb=pTmpDb;return ZPB_DB_OK;}T_zPb_DbResult |
| 65 | atPb_DbClose(sqlite3*pDb){if(NULL==pDb){slog(PB_PRINT,SLOG_ERR, |
| 66 | "\x70\x62\x3a\x70\x62\x6d\x3a\x69\x6e\x76\x61\x6c\x69\x64\x65\x20\x69\x6e\x70\x75\x74\x73\x2e" |
| 67 | );return ZPB_DB_ERROR_INVALIDPTR;}if(sqlite3_close(pDb)){slog(PB_PRINT,SLOG_ERR, |
| 68 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x61\x6e\x20\x6e\x6f\x74\x20\x63\x6c\x6f\x73\x65\x20\x64\x62" |
| 69 | );return ZPB_DB_ERROR;} |
| 70 | #ifdef WEBS_SECURITY
|
| 71 | if(access(ZPB_TMP_PATH,F_OK)==(0x7ed+181-0x8a2)){slog(PB_PRINT,SLOG_ERR, |
| 72 | "\x70\x62\x3a\x70\x62\x6d\x3a\x74\x6d\x70\x20\x64\x62\x20\x73\x74\x61\x79");if( |
| 73 | remove(ZPB_TMP_PATH)!=(0xb37+5205-0x1f8c)){slog(PB_PRINT,SLOG_ERR, |
| 74 | "\x72\x65\x6d\x6f\x76\x65\x20\x5a\x50\x42\x5f\x54\x4d\x50\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c" |
| 75 | );}}if(rename(ZPB_SEC_PATH,ZPB_TMP_PATH)!=(0x1030+5248-0x24b0)){slog(PB_PRINT, |
| 76 | SLOG_ERR, |
| 77 | "\x72\x65\x6e\x61\x6d\x65\x20\x5a\x50\x42\x5f\x53\x45\x43\x5f\x50\x41\x54\x48\x20\x66\x61\x69\x6c" |
| 78 | );}{char rnum_buf[(0x1565+3485-0x22ea)]={(0xd7b+4880-0x208b)};char cmd[ |
| 79 | (0x14f3+1868-0x1bbf)]={(0xe43+2558-0x1841)};sc_cfg_get( |
| 80 | "\x72\x6e\x75\x6d\x5f\x61\x74",rnum_buf,sizeof(rnum_buf));snprintf(cmd,sizeof( |
| 81 | cmd), |
| 82 | "\x2f\x62\x69\x6e\x2f\x6f\x70\x65\x6e\x73\x73\x6c\x20\x65\x6e\x63\x20\x2d\x65\x20\x2d\x61\x65\x73\x32\x35\x36\x20\x2d\x73\x61\x6c\x74\x20\x2d\x69\x6e\x20\x25\x73\x20\x2d\x6f\x75\x74\x20\x25\x73\x20\x2d\x70\x61\x73\x73\x20\x70\x61\x73\x73\x3a\x25\x73" |
| 83 | ,ZPB_DB_PATH,ZPB_SEC_PATH,rnum_buf);zxic_system(cmd);if(access(ZPB_SEC_PATH,F_OK |
| 84 | )==(0x1637+944-0x19e7)){if(remove(ZPB_TMP_PATH)!=(0x9eb+4596-0x1bdf)){slog( |
| 85 | PB_PRINT,SLOG_ERR, |
| 86 | "\x72\x65\x6d\x6f\x76\x65\x20\x5a\x50\x42\x5f\x54\x4d\x50\x5f\x50\x41\x54\x48\x31\x20\x66\x61\x69\x6c" |
| 87 | );}}} |
| 88 | #endif
|
| 89 | return ZPB_DB_OK;}static check_sql_cmd(const char*pSql){if(pSql!=NULL){if(strstr |
| 90 | (pSql,"\x3b")||strstr(pSql,"\x2d\x2d")){return(0x149d+3953-0x240e);}return |
| 91 | (0x28b+6211-0x1acd);}return(0x6b7+2456-0x104f);}T_zPb_DbResult atPb_ExecDbSql( |
| 92 | const char*pSql,sqlite3_callback callback,VOID*pFvarg){sqlite3*pDb=NULL;CHAR |
| 93 | dbErrMsg[(0x11eb+3354-0x1e85)]={(0x22b+5720-0x1883)};if(NULL==pSql){return |
| 94 | ZPB_DB_ERROR_INVALIDPTR;} |
| 95 | #ifdef WEBS_SECURITY
|
| 96 | if(check_sql_cmd(pSql)==(0xa76+5764-0x20fa)){slog(PB_PRINT,SLOG_ERR, |
| 97 | "\x21\x21\x61\x74\x50\x62\x5f\x45\x78\x65\x63\x44\x62\x53\x71\x6c\x3a\x78\x73\x73\x20\x25\x73" "\n" |
| 98 | ,pSql);return ZPB_DB_ERROR_INVALIDPTR;} |
| 99 | #endif
|
| 100 | if(ZPB_DB_OK!=atPb_DbOpen(&pDb)){slog(PB_PRINT,SLOG_ERR, |
| 101 | "\x70\x62\x3a\x6f\x70\x65\x6e\x20\x70\x62\x6d\x2e\x64\x62\x20\x66\x61\x69\x6c\x65\x64\x2e" |
| 102 | );return ZPB_DB_ERROR_NOTOPENDB;}slog(PB_PRINT,SLOG_DEBUG, |
| 103 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x45\x78\x65\x63\x44\x62\x53\x71\x6c\x3a\x25\x73" "\n" |
| 104 | ,pSql);if(sqlite3_exec(pDb,pSql,callback,pFvarg,NULL)){strncpy(dbErrMsg, |
| 105 | sqlite3_errmsg(pDb),sizeof(dbErrMsg)-(0x3d8+123-0x452));slog(PB_PRINT,SLOG_ERR, |
| 106 | "\x70\x62\x3a\x70\x62\x6d\x3a\x63\x61\x6e\x20\x6e\x6f\x74\x20\x65\x78\x65\x63\x20\x73\x71\x6c\x2c\x73\x71\x6c\x69\x74\x65\x33\x5f\x65\x72\x72\x6d\x73\x67\x3a\x25\x73\x2e" |
| 107 | ,dbErrMsg);(VOID)sqlite3_close(pDb);return ZPB_DB_ERROR;}(VOID)atPb_DbClose(pDb) |
| 108 | ;return ZPB_DB_OK;}SINT32 atPb_InitApIndexCb(VOID*fvarg,int line,char**zresult, |
| 109 | char**lname){SINT32 index=(0x1ab8+2955-0x2643);if((0x698+5816-0x1d4f)>line){slog |
| 110 | (PB_PRINT,SLOG_ERR, |
| 111 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x49\x6e\x69\x74\x41\x70\x49\x6e\x64\x65\x78\x43\x62\x3a\x72\x65\x63\x6f\x72\x64\x20\x6e\x6f\x20\x64\x61\x74\x61\x2e" "\n" |
| 112 | );return-(0xaec+2311-0x13f2);}index=atoi(zresult[(0xb28+6501-0x248d)]);if(index> |
| 113 | ZPB_AP_MAX_RECORD){slog(PB_PRINT,SLOG_ERR, |
| 114 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x49\x6e\x69\x74\x41\x70\x49\x6e\x64\x65\x78\x43\x62\x3a\x69\x6e\x64\x65\x78\x20\x6f\x76\x65\x72\x66\x6c\x6f\x77\x2e" "\n" |
| 115 | );return-(0x120f+3797-0x20e3);}slog(PB_PRINT,SLOG_DEBUG, |
| 116 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x49\x6e\x69\x74\x41\x70\x49\x6e\x64\x65\x78\x43\x62\x3a\x70\x62\x6d\x5f\x69\x6e\x64\x65\x78\x3d\x25\x64" "\n" |
| 117 | ,index);g_zPb_ApIndex[index]=PBM_SUCCESS;return(0x1207+2834-0x1d19);} |
| 118 | T_zPb_DbResult atPb_InitApIndex(){CHAR sql[ZPB_MAX_BYTES_DB]={ |
| 119 | (0x2160+1016-0x2558)};SINT32 i=(0xec8+3074-0x1ac9);g_zPb_ApIndex[ |
| 120 | (0x7e0+2610-0x1212)]=ZPB_AP_MAX_RECORD;for(i=(0x4a0+2443-0xe2a);i<=g_zPb_ApIndex |
| 121 | [(0x11a1+2820-0x1ca5)];i++){g_zPb_ApIndex[i]=PBM_ERROR_NOT_FOUND;}snprintf(sql, |
| 122 | sizeof(sql), |
| 123 | "\x73\x65\x6c\x65\x63\x74\x20\x50\x62\x6d\x5f\x69\x6e\x64\x65\x78\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" |
| 124 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_AP);return atPb_ExecDbSql(sql,atPb_InitApIndexCb, |
| 125 | ZUFI_NULL);}INT zte_pbm_check_and_creat_dir(char*path){if(-(0xe16+5704-0x245d)== |
| 126 | access(path,(0x5ac+8376-0x2664))){slog(PB_PRINT,SLOG_DEBUG, |
| 127 | "\x70\x62\x3a\x70\x62\x6d\x3a\x25\x73\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x65\x78\x69\x73\x74\x2c\x73\x6f\x63\x72\x65\x61\x74\x65\x20\x69\x74\x2e" "\n" |
| 128 | ,ZPB_DB_DIR);if(-(0x1c30+1852-0x236b)==mkdir(path,(0x656+3578-0x1251))){slog( |
| 129 | PB_PRINT,SLOG_ERR, |
| 130 | "\x70\x62\x3a\x3a\x66\x61\x69\x6c\x65\x64\x20\x74\x6f\x20\x63\x72\x65\x61\x74\x65\x20\x64\x62\x20\x64\x69\x72\x2e" "\n" |
| 131 | );return-(0xc46+633-0xebe);}}return(0xcca+563-0xefd);}UINT8 |
| 132 | zte_pbm_check_web_pbm_dir(VOID){ |
| 133 | #ifdef _MBB_OS_UCLINUX
|
| 134 | (VOID)zte_pbm_check_and_creat_dir( |
| 135 | "\x2f\x6d\x6e\x74\x2f\x6a\x66\x66\x73\x32\x2f\x65\x74\x63\x5f\x72\x77");(VOID) |
| 136 | zte_pbm_check_and_creat_dir( |
| 137 | "\x2f\x6d\x6e\x74\x2f\x6a\x66\x66\x73\x32\x2f\x65\x74\x63\x5f\x72\x77\x2f\x63\x6f\x6e\x66\x69\x67" |
| 138 | ); |
| 139 | #else
|
| 140 | (VOID)zte_pbm_check_and_creat_dir("\x2f\x65\x74\x63\x5f\x72\x77");(VOID) |
| 141 | zte_pbm_check_and_creat_dir( |
| 142 | "\x2f\x65\x74\x63\x5f\x72\x77\x2f\x63\x6f\x6e\x66\x69\x67"); |
| 143 | #endif
|
| 144 | return ZUFI_SUCC;}T_zPb_DbResult atPb_DelSimRecFromPbTable(SINT32 index){ |
| 145 | T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0x197f+3239-0x2626) |
| 146 | };snprintf(sql,sizeof(sql), |
| 147 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64\x20\x61\x6e\x64\x20\x50\x62\x6d\x5f\x69\x6e\x64\x65\x78\x3d\x25\x64" |
| 148 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_USIM,index);result=atPb_ExecDbSql(sql,NULL,NULL); |
| 149 | if(ZPB_DB_OK==result){g_zPb_SimIndex[index]=PBM_ERROR_NOT_FOUND;}return result;} |
| 150 | T_zPb_DbResult atPb_LoadARecToPbmTable(T_zPb_WebContact*pbPara){T_zPb_DbResult |
| 151 | result=ZPB_DB_ERROR;CHAR sql[ZPB_MAX_BYTES_DB]={(0x1627+4219-0x26a2)};if(NULL== |
| 152 | pbPara){slog(PB_PRINT,SLOG_ERR, |
| 153 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x4c\x6f\x61\x64\x41\x52\x65\x63\x54\x6f\x50\x62\x6d\x54\x61\x62\x6c\x65\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74" |
| 154 | );return ZPB_DB_ERROR_INVALIDPTR;}snprintf(sql,sizeof(sql),"insert into %s (Pbm_index,Location,Number,Type,Name,Anr,Anr1,Email,Sne) \
|
| 155 | values(\'%d\',\'%d\',\'%s\',\'%d\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\')",ZPB_DB_PBM_TABLE,pbPara->pbIndex,pbPara->pbLocation,pbPara->mobilNumber,pbPara |
| 156 | ->pbType,pbPara->name,pbPara->homeNumber,pbPara->officeNumber,pbPara->email, |
| 157 | pbPara->sne);result=atPb_ExecDbSql(sql,NULL,NULL);if(ZPB_DB_OK==result){CHAR |
| 158 | pbMax[(0x43f+803-0x730)]={(0x94b+5655-0x1f62)};sc_cfg_get(ZPB_NV_USIMINDEXMAX, |
| 159 | pbMax,sizeof(pbMax));if((pbPara->pbIndex>=(0x598+2686-0x1015))&&(pbPara->pbIndex |
| 160 | <=atoi(pbMax))){g_zPb_SimIndex[pbPara->pbIndex]=PBM_SUCCESS;}(VOID)sc_cfg_set( |
| 161 | ZPB_NV_WRITE_FLAG,ZPB_OPERATE_SUC);}else{(VOID)sc_cfg_set(ZPB_NV_WRITE_FLAG, |
| 162 | ZPB_NEW_ERROR);}slog(PB_PRINT,SLOG_DEBUG, |
| 163 | "\x70\x62\x3a\x70\x62\x6d\x3a\x65\x78\x65\x63\x20\x74\x61\x62\x6c\x65\x20\x25\x73\x20\x72\x65\x73\x75\x6c\x74\x20\x25\x64" "\n" |
| 164 | ,ZPB_DB_PBM_TABLE,result);return result;}VOID atPb_SqlModifyOneRec( |
| 165 | T_zPb_WebContact*pbmPara,char*sql,int len){printf( |
| 166 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x53\x71\x6c\x4d\x6f\x64\x69\x66\x79\x4f\x6e\x65\x52\x65\x63\x20\x65\x6e\x74\x65\x72" |
| 167 | );if(ZPB_LOCATION_USIM==pbmPara->pbLocation){snprintf(sql,len,"update %s set Pbm_index=\'%d\',Location=\'%d\',Number=\'%s\',Type=\'%d\',Name=\'%s\',Anr=\'%s\', \
|
| 168 | Anr1=\'%s\',Email=\'%s\',Sne=\'%s\' where id=%d",ZPB_DB_PBM_TABLE,pbmPara->pbIndex,pbmPara->pbLocation,pbmPara->mobilNumber, |
| 169 | pbmPara->pbType,pbmPara->name,pbmPara->homeNumber,pbmPara->officeNumber,pbmPara |
| 170 | ->email,pbmPara->sne,pbmPara->pbId);}else if(ZPB_LOCATION_AP==pbmPara-> |
| 171 | pbLocation){snprintf(sql,len,"update %s set Pbm_index=\'%d\',Location=\'%d\',Number=\'%s\',Type=\'%d\',Name=\'%s\',Anr=\'%s\', \
|
| 172 | Anr1=\'%s\',Email=\'%s\',Sne=\'%s\',Pbm_group=\'%s\' where id=%d",ZPB_DB_PBM_TABLE,pbmPara->pbIndex,pbmPara->pbLocation,pbmPara->mobilNumber, |
| 173 | pbmPara->pbType,pbmPara->name,pbmPara->homeNumber,pbmPara->officeNumber,pbmPara |
| 174 | ->email,pbmPara->sne,pbmPara->group,pbmPara->pbId);}}T_zPb_DbResult |
| 175 | atPb_DbGetParamCb(VOID*fvarg,int line,char**zresult,char**lname){T_zPb_Header |
| 176 | para={(0x904+4519-0x1aab)};if((0x1479+2419-0x1deb)>line){slog(PB_PRINT,SLOG_ERR, |
| 177 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x62\x47\x65\x74\x50\x61\x72\x61\x6d\x43\x62\x3a\x72\x65\x63\x6f\x72\x64\x20\x6e\x6f\x20\x64\x61\x74\x61\x2e" |
| 178 | );return ZPB_DB_ERROR;}para.pbIndex=atoi(zresult[(0x11cb+4266-0x2275)]);para. |
| 179 | pbLocation=atoi(zresult[(0xddb+3424-0x1b3a)]);slog(PB_PRINT,SLOG_DEBUG, |
| 180 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x62\x47\x65\x74\x50\x61\x72\x61\x6d\x43\x62\x3a\x20\x69\x6e\x64\x65\x78\x3d\x25\x64\x2c\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" |
| 181 | ,para.pbIndex,para.pbLocation);memcpy(fvarg,¶,sizeof(para));return ZPB_DB_OK |
| 182 | ;}T_zPb_DbResult atPb_GetIndexLocationById(T_zPb_Header*pbPara){CHAR sql[ |
| 183 | ZPB_MAX_BYTES_DB]={(0x2013+801-0x2334)};snprintf(sql,sizeof(sql)- |
| 184 | (0x1944+3076-0x2547), |
| 185 | "\x73\x65\x6c\x65\x63\x74\x20\x50\x62\x6d\x5f\x69\x6e\x64\x65\x78\x2c\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x69\x64\x3d\x25\x64" |
| 186 | ,ZPB_DB_PBM_TABLE,pbPara->pbId);memset(pbPara,(0x250+7824-0x20e0),sizeof( |
| 187 | T_zPb_Header));return atPb_ExecDbSql(sql,atPb_DbGetParamCb,pbPara);}VOID |
| 188 | atPb_SqlNewOneRec(T_zPb_WebContact*pbmPara,CHAR*sql,int len){if( |
| 189 | ZPB_LOCATION_USIM==pbmPara->pbLocation){snprintf(sql,len,"insert into %s (Pbm_index,Location,Number,Type,Name,Anr,Anr1,Email,Sne)\
|
| 190 | values(\'%d\',\'%d\',\'%s\',\'%d\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\')",ZPB_DB_PBM_TABLE,pbmPara->pbIndex,pbmPara->pbLocation,pbmPara->mobilNumber, |
| 191 | pbmPara->pbType,pbmPara->name,pbmPara->homeNumber,pbmPara->officeNumber,pbmPara |
| 192 | ->email,pbmPara->sne);}else if(ZPB_LOCATION_AP==pbmPara->pbLocation){snprintf( |
| 193 | sql,len,"insert into %s (Pbm_index,Location,Number,Type,Name,Anr,Anr1,Email,Sne,Pbm_group)\
|
| 194 | values(\'%d\',\'%d\',\'%s\',\'%d\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\',\'%s\')",ZPB_DB_PBM_TABLE,pbmPara->pbIndex,pbmPara->pbLocation,pbmPara->mobilNumber, |
| 195 | pbmPara->pbType,pbmPara->name,pbmPara->homeNumber,pbmPara->officeNumber,pbmPara |
| 196 | ->email,pbmPara->sne,pbmPara->group);}}T_zPb_DbResult |
| 197 | atPb_WriteContactToPbmTable(T_zPb_WebContact*pPbRecord,BOOL pbNewFlag){ |
| 198 | T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0xc67+4861-0x1f64)} |
| 199 | ;if(NULL==pPbRecord){slog(PB_PRINT,SLOG_ERR, |
| 200 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x57\x72\x69\x74\x65\x43\x6f\x6e\x74\x61\x63\x74\x54\x6f\x50\x62\x6d\x54\x61\x62\x6c\x65\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74" |
| 201 | );return ZPB_DB_ERROR_INVALIDPTR;}slog(PB_PRINT,SLOG_DEBUG, |
| 202 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x57\x72\x69\x74\x65\x43\x6f\x6e\x74\x61\x63\x74\x54\x6f\x50\x62\x6d\x54\x61\x62\x6c\x65\x3a\x69\x6e\x70\x75\x74\x20\x69\x6e\x64\x65\x78\x20\x69\x73\x20\x25\x64\x2c\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" "\n" |
| 203 | ,pPbRecord->pbIndex,pPbRecord->pbLocation);if(TRUE==pbNewFlag){atPb_SqlNewOneRec |
| 204 | (pPbRecord,sql,sizeof(sql));}else{atPb_SqlModifyOneRec(pPbRecord,sql,sizeof(sql) |
| 205 | );}result=atPb_ExecDbSql(sql,NULL,NULL);if(ZPB_DB_OK==result){if( |
| 206 | ZPB_LOCATION_USIM==pPbRecord->pbLocation){g_zPb_SimIndex[(pPbRecord->pbIndex)]= |
| 207 | PBM_SUCCESS;}else if(ZPB_LOCATION_AP==pPbRecord->pbLocation){g_zPb_ApIndex[( |
| 208 | pPbRecord->pbIndex)]=PBM_SUCCESS;}}return result;}SINT32 atPb_DbCountTableLineCb |
| 209 | (VOID*fvarg,int line,char**zresult,char**lname){if((0x6a+9234-0x247b)>line){slog |
| 210 | (PB_PRINT,SLOG_ERR, |
| 211 | "\x70\x62\x3a\x70\x62\x6d\x3a\x72\x65\x63\x6f\x72\x64\x20\x6e\x6f\x20\x64\x61\x74\x61\x2e" |
| 212 | );return-(0x1a19+334-0x1b66);}*(int*)fvarg=atoi(zresult[(0xf9d+2448-0x192d)]); |
| 213 | return(0x14f2+2451-0x1e85);}T_zPb_DbResult atPb_SetSimCapacityTable( |
| 214 | T_zPb_UsimCapacity pbPara){T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ |
| 215 | ZPB_MAX_BYTES_DB]={(0x5f4+6581-0x1fa9)};UINT32 count=(0xbcb+6172-0x23e7); |
| 216 | snprintf(sql,sizeof(sql)-(0x1a32+1835-0x215c), |
| 217 | "\x73\x65\x6c\x65\x63\x74\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x66\x72\x6f\x6d\x20\x25\x73" |
| 218 | ,ZPB_DB_SIM_CAPABILITY_TABLE);(VOID)atPb_ExecDbSql(sql,atPb_DbCountTableLineCb,& |
| 219 | count);if((0x83b+5003-0x1bc6)<count){memset(sql,(0x78+2703-0xb07),sizeof(sql)); |
| 220 | snprintf(sql,sizeof(sql)-(0xc87+846-0xfd4), |
| 221 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x53\x69\x6d\x5f\x74\x79\x70\x65\x3e\x3d\x30" |
| 222 | ,ZPB_DB_SIM_CAPABILITY_TABLE);result=atPb_ExecDbSql(sql,NULL,NULL);if(ZPB_DB_OK |
| 223 | !=result){slog(PB_PRINT,SLOG_DEBUG, |
| 224 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x53\x65\x74\x53\x69\x6d\x43\x61\x70\x61\x63\x69\x74\x79\x54\x61\x62\x6c\x65\x3a\x66\x61\x69\x6c\x21" "\n" |
| 225 | );return result;}}memset(sql,(0x126a+213-0x133f),sizeof(sql));snprintf(sql, |
| 226 | sizeof(sql)-(0x91f+1686-0xfb4),"insert into %s (Sim_type,Max_record_number,Used_record_number,Max_number_len,Max_name_len,Max_anr_len,Max_anr1_len, \
|
| 227 | Max_email_len,Max_sne_len) values(\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\',\'%d\')",ZPB_DB_SIM_CAPABILITY_TABLE,pbPara.simType,pbPara.maxRecordNum,pbPara. |
| 228 | usedRecordNum,pbPara.maxNumberLen,pbPara.maxNameLen,pbPara.maxAnrLen,pbPara. |
| 229 | maxAnr1Len,pbPara.maxEmailLen,pbPara.maxSneLen);slog(PB_PRINT,SLOG_DEBUG, |
| 230 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x53\x65\x74\x53\x69\x6d\x43\x61\x70\x61\x63\x69\x74\x79\x54\x61\x62\x6c\x65\x3a\x6f\x6b\x21" "\n" |
| 231 | );return atPb_ExecDbSql(sql,NULL,NULL);}T_zPb_DbResult atPb_SetApCapacityTable() |
| 232 | {T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0xdf4+4783-0x20a3) |
| 233 | };SINT32 count=(0x1e4d+1940-0x25e1);T_zPb_ApCapacity pbPara={ |
| 234 | (0x1c3b+1800-0x2343)};snprintf(sql,sizeof(sql)-(0x14c0+3297-0x21a0), |
| 235 | "\x73\x65\x6c\x65\x63\x74\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x66\x72\x6f\x6d\x20\x25\x73" |
| 236 | ,ZPB_DB_DEVICE_CAPABILITY_TABLE);(VOID)atPb_ExecDbSql(sql, |
| 237 | atPb_DbCountTableLineCb,&count);if((0x18df+221-0x19bc)<count){memset(sql, |
| 238 | (0x1c+6659-0x1a1f),sizeof(sql));snprintf(sql,sizeof(sql)-(0x10e0+2762-0x1ba9), |
| 239 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73", |
| 240 | ZPB_DB_DEVICE_CAPABILITY_TABLE);result=atPb_ExecDbSql(sql,NULL,NULL);if( |
| 241 | ZPB_DB_OK!=result){slog(PB_PRINT,SLOG_DEBUG, |
| 242 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x53\x65\x74\x41\x70\x43\x61\x70\x61\x63\x69\x74\x79\x54\x61\x62\x6c\x65\x3a\x66\x61\x69\x6c\x21" "\n" |
| 243 | );return result;}}memset(sql,(0xa61+6377-0x234a),sizeof(sql));snprintf(sql, |
| 244 | sizeof(sql)-(0x4ad+6230-0x1d02), |
| 245 | "\x73\x65\x6c\x65\x63\x74\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" |
| 246 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_AP);result=atPb_ExecDbSql(sql, |
| 247 | atPb_DbCountTableLineCb,&count);if(ZPB_DB_OK==result){pbPara.usedRecordNum=count |
| 248 | ;pbPara.maxRecordNum=ZPB_AP_MAX_RECORD;}slog(PB_PRINT,SLOG_DEBUG, |
| 249 | "\x70\x62\x3a\x6d\x61\x78\x5f\x72\x65\x63\x5f\x6e\x75\x6d\x3d\x25\x64\x2c\x75\x73\x65\x64\x3d\x25\x64" |
| 250 | ,pbPara.maxRecordNum,pbPara.usedRecordNum);memset(sql,(0x1892+418-0x1a34),sizeof |
| 251 | (sql));snprintf(sql,sizeof(sql)-(0x911+6386-0x2202), |
| 252 | "\x69\x6e\x73\x65\x72\x74\x20\x69\x6e\x74\x6f\x20\x25\x73\x20\x28\x4d\x61\x78\x5f\x72\x65\x63\x6f\x72\x64\x5f\x6e\x75\x6d\x62\x65\x72\x2c\x55\x73\x65\x64\x5f\x72\x65\x63\x6f\x72\x64\x5f\x6e\x75\x6d\x62\x65\x72\x29\x20\x76\x61\x6c\x75\x65\x73\x28" "\'" "\x25\x64" "\'" "\x2c" "\'" "\x25\x64" "\'" "\x29" |
| 253 | ,ZPB_DB_DEVICE_CAPABILITY_TABLE,pbPara.maxRecordNum,pbPara.usedRecordNum);return |
| 254 | atPb_ExecDbSql(sql,NULL,NULL);}T_zPb_DbResult atPb_DbGetIndexByGroupCb(VOID* |
| 255 | fvarg,int line,char**zresult,char**lname){T_zPb_ApIndex*pbIndex=NULL;int i= |
| 256 | (0x523+5894-0x1c29);if((0xc05+4139-0x1c2f)>line){return ZPB_DB_ERROR;}pbIndex=( |
| 257 | T_zPb_ApIndex*)fvarg;i=pbIndex->count;slog(PB_PRINT,SLOG_DEBUG, |
| 258 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x62\x47\x65\x74\x49\x6e\x64\x65\x78\x42\x79\x47\x72\x6f\x75\x70\x43\x62\x20\x65\x6e\x74\x65\x72\x2c\x69\x3d\x25\x64" "\n" |
| 259 | ,i);pbIndex->apIndex[i+(0x63f+7847-0x24e5)]=atoi(zresult[(0x5e5+4079-0x15d4)]); |
| 260 | slog(PB_PRINT,SLOG_DEBUG, |
| 261 | "\x70\x62\x3a\x67\x65\x74\x5f\x69\x6e\x64\x65\x78\x5f\x62\x79\x5f\x67\x72\x6f\x75\x70\x5f\x63\x62\x3a\x70\x62\x6d\x5f\x69\x6e\x64\x65\x78\x3d\x25\x64" |
| 262 | ,pbIndex->apIndex[i+(0x1624+1631-0x1c82)]);pbIndex->count=i+(0x23c+2043-0xa36); |
| 263 | slog(PB_PRINT,SLOG_DEBUG, |
| 264 | "\x70\x62\x3a\x67\x65\x74\x5f\x69\x6e\x64\x65\x78\x5f\x62\x79\x5f\x67\x72\x6f\x75\x70\x5f\x63\x62\x3a\x70\x62\x6d\x20\x63\x6f\x75\x6e\x74\x20\x69\x73\x20\x25\x64" |
| 265 | ,pbIndex->count);return ZPB_DB_OK;}T_zPb_DbResult atPb_DelRecFromPbmTableByGroup |
| 266 | (T_zPb_ApIndex*index){T_zPb_DbResult result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB] |
| 267 | ={(0x5f+1373-0x5bc)};SINT32 countByGroup=(0xebf+267-0xfca);CHAR pbGroup[ |
| 268 | ZPB_PARAM_SIZE20]={(0x837+1702-0xedd)};sc_cfg_get(ZPB_NV_GROUP,pbGroup,sizeof( |
| 269 | pbGroup));snprintf(sql,sizeof(sql)-(0x1090+3204-0x1d13), |
| 270 | "\x73\x65\x6c\x65\x63\x74\x20\x63\x6f\x75\x6e\x74\x28\x2a\x29\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64\x20\x61\x6e\x64\x20\x28\x50\x62\x6d\x5f\x67\x72\x6f\x75\x70\x3d" "\"" "\x25\x73" "\"" "\x29" |
| 271 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_AP,pbGroup);(VOID)atPb_ExecDbSql(sql, |
| 272 | atPb_DbCountTableLineCb,&countByGroup);memset(sql,(0x1d41+1412-0x22c5),sizeof( |
| 273 | sql));snprintf(sql,sizeof(sql)-(0xbc5+84-0xc18), |
| 274 | "\x73\x65\x6c\x65\x63\x74\x20\x50\x62\x6d\x5f\x69\x6e\x64\x65\x78\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64\x20\x61\x6e\x64\x20\x28\x50\x62\x6d\x5f\x67\x72\x6f\x75\x70\x3d" "\"" "\x25\x73" "\"" "\x29" |
| 275 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_AP,pbGroup);result=atPb_ExecDbSql(sql, |
| 276 | atPb_DbGetIndexByGroupCb,index);if(countByGroup==index->count){memset(sql, |
| 277 | (0x7e8+6380-0x20d4),sizeof(sql));snprintf(sql,sizeof(sql)-(0x189d+1369-0x1df5), |
| 278 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64\x20\x61\x6e\x64\x20\x28\x50\x62\x6d\x5f\x67\x72\x6f\x75\x70\x3d" "\"" "\x25\x73" "\"" "\x29" |
| 279 | ,ZPB_DB_PBM_TABLE,ZPB_LOCATION_AP,pbGroup);if(ZPB_DB_OK==atPb_ExecDbSql(sql,NULL |
| 280 | ,NULL)){(VOID)sc_cfg_set(ZPB_NV_WRITE_FLAG,ZPB_OPERATE_SUC);}slog(PB_PRINT, |
| 281 | SLOG_DEBUG, |
| 282 | "\x70\x62\x3a\x70\x62\x6d\x3a\x65\x78\x65\x63\x20\x74\x61\x62\x6c\x65\x20\x25\x73\x20\x72\x65\x73\x75\x6c\x74\x20\x25\x64" "\n" |
| 283 | ,ZPB_DB_PBM_TABLE,result);}else{return ZPB_DB_ERROR;}(VOID)sc_cfg_set( |
| 284 | ZPB_NV_GROUP,"");return result;}VOID atPb_GetLocationIndexForDel(T_zPb_DelInfo* |
| 285 | recData,SINT32 delTime){T_zPb_Header pbHeader={(0x50d+1274-0xa07)};if(NULL== |
| 286 | recData){slog(PB_PRINT,SLOG_ERR, |
| 287 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x47\x65\x74\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x49\x6e\x64\x65\x78\x46\x6f\x72\x44\x65\x6c\x2d\x2d\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74" "\n" |
| 288 | );return;}pbHeader.pbId=recData->delId[delTime];if(ZPB_DB_OK!= |
| 289 | atPb_GetIndexLocationById(&pbHeader)){slog(PB_PRINT,SLOG_ERR, |
| 290 | "\x70\x62\x3a\x70\x62\x6d\x3a\x66\x69\x6e\x64\x20\x69\x6e\x64\x65\x78\x20\x61\x6e\x64\x20\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x20\x66\x61\x69\x6c\x65\x64" |
| 291 | );return;}recData->delIndex[delTime]=pbHeader.pbIndex;recData->delLocation= |
| 292 | pbHeader.pbLocation;slog(PB_PRINT,SLOG_DEBUG, |
| 293 | "\x70\x62\x3a\x70\x62\x6d\x3a\x64\x65\x6c\x20\x69\x6e\x64\x65\x78\x3d\x25\x64\x2c\x6c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64\x2c\x64\x65\x6c\x5f\x70\x62\x6d\x5f\x74\x69\x6d\x65\x3d\x25\x64" |
| 294 | ,recData->delIndex[delTime],recData->delLocation,delTime);}T_zPb_DbResult |
| 295 | atPb_DelARecFromPbmTable(T_zPb_DelInfo*pbPara,SINT32 delTime){T_zPb_DbResult |
| 296 | result=ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0x1603+2123-0x1e4e)};if(NULL== |
| 297 | pbPara){slog(PB_PRINT,SLOG_ERR, |
| 298 | "\x70\x62\x3a\x70\x62\x6d\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74" |
| 299 | );return ZPB_DB_ERROR_INVALIDPTR;}atPb_GetLocationIndexForDel(pbPara,delTime); |
| 300 | slog(PB_PRINT,SLOG_DEBUG, |
| 301 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x65\x6c\x41\x52\x65\x63\x46\x72\x6f\x6d\x50\x62\x6d\x54\x61\x62\x6c\x65\x20\x65\x6e\x74\x65\x72\x2c\x64\x65\x6c\x54\x69\x6d\x65\x3d\x25\x64\x2c\x69\x64\x3d\x25\x64" "\n" |
| 302 | ,delTime,pbPara->delId[delTime]);snprintf(sql,sizeof(sql)-(0xa9d+31-0xabb), |
| 303 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x69\x64\x3d\x25\x64" |
| 304 | ,ZPB_DB_PBM_TABLE,pbPara->delId[delTime]);result=atPb_ExecDbSql(sql,NULL,NULL); |
| 305 | if(ZPB_DB_OK==result){if(ZPB_LOCATION_AP==pbPara->delLocation){g_zPb_ApIndex[( |
| 306 | pbPara->delIndex[delTime])]=PBM_ERROR_NOT_FOUND;}else if(ZPB_LOCATION_USIM== |
| 307 | pbPara->delLocation){g_zPb_SimIndex[(pbPara->delIndex[delTime])]= |
| 308 | PBM_ERROR_NOT_FOUND;}}return result;}VOID atPb_ClearSimPbmIndexArray(VOID){ |
| 309 | SINT32 i=(0xff+4212-0x1172);for(i=(0x1127+5041-0x24d7);(i<=g_zPb_SimIndex[ |
| 310 | (0x1634+3491-0x23d7)])&&(i<(ZPB_SIM_MAX_RECORD+(0x16bc+555-0x18e6)));i++){ |
| 311 | g_zPb_SimIndex[i]=PBM_ERROR_NOT_FOUND;}}VOID atPb_ClearApPbmIndexArray(VOID){ |
| 312 | SINT32 i=(0x66b+2883-0x11ad);for(i=(0x155a+956-0x1915);(i<=g_zPb_ApIndex[ |
| 313 | (0x254+4705-0x14b5)])&&(i<(ZPB_AP_MAX_RECORD+(0x4ab+8038-0x2410)));i++){ |
| 314 | g_zPb_ApIndex[i]=PBM_ERROR_NOT_FOUND;}}T_zPb_DbResult |
| 315 | atPb_DelAllRecsFromPbmTable(T_zPb_DelInfo*pbPara){T_zPb_DbResult result= |
| 316 | ZPB_DB_OK;CHAR sql[ZPB_MAX_BYTES_DB]={(0x602+6240-0x1e62)};if(NULL==pbPara){slog |
| 317 | (PB_PRINT,SLOG_ERR, |
| 318 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x65\x6c\x41\x6c\x6c\x52\x65\x63\x73\x46\x72\x6f\x6d\x50\x62\x6d\x54\x61\x62\x6c\x65\x3a\x69\x6e\x76\x61\x6c\x69\x64\x20\x69\x6e\x70\x75\x74" "\n" |
| 319 | );return ZPB_DB_ERROR_INVALIDPTR;}snprintf(sql,sizeof(sql)-(0x41c+1190-0x8c1), |
| 320 | "\x64\x65\x6c\x65\x74\x65\x20\x66\x72\x6f\x6d\x20\x25\x73\x20\x77\x68\x65\x72\x65\x20\x4c\x6f\x63\x61\x74\x69\x6f\x6e\x3d\x25\x64" |
| 321 | ,ZPB_DB_PBM_TABLE,pbPara->delLocation);result=atPb_ExecDbSql(sql,NULL,NULL);slog |
| 322 | (PB_PRINT,SLOG_DEBUG, |
| 323 | "\x70\x62\x3a\x61\x74\x50\x62\x5f\x44\x65\x6c\x41\x6c\x6c\x52\x65\x63\x73\x46\x72\x6f\x6d\x50\x62\x6d\x54\x61\x62\x6c\x65\x3a\x65\x78\x65\x63\x20\x74\x61\x62\x6c\x65\x20\x25\x73\x20\x72\x65\x73\x75\x6c\x74\x20\x25\x64" |
| 324 | ,ZPB_DB_PBM_TABLE,result);if(ZPB_LOCATION_USIM==pbPara->delLocation){ |
| 325 | atPb_ClearSimPbmIndexArray();}else if(ZPB_LOCATION_AP==pbPara->delLocation){ |
| 326 | atPb_ClearApPbmIndexArray();}else if(ZPB_LOCATION_ALL==pbPara->delLocation){ |
| 327 | atPb_ClearSimPbmIndexArray();atPb_ClearApPbmIndexArray();}return result;} |