//########################################### CPAGE_FUNC(uint32_t) CPAGE_GetCountPage() { PROLOG; SetReturnCode_cpage(IDS_ERR_NO); uint32_t rc = Page.GetCount(); EPILOG; return rc; }
CPAGE_FUNC(Bool32) CPAGE_SavePage(Handle page,char * lpName) { PROLOG; Bool32 rc = FALSE; SetReturnCode_cpage(IDS_ERR_NO); Handle file = myOpenSave((char *)lpName); if(file) { #ifdef SAVE_COMPRESSED uint32_t vers = VERSION_FILE_COMPRESSED; #else uint32_t vers = VERSION_FILE; #endif if(myWrite(file,&vers,sizeof(vers))==sizeof(vers)) { if(page) { int count = 1; rc = myWrite(file,&count,sizeof(count))==sizeof(count); #ifdef SAVE_COMPRESSED rc = PAGE_H(page).SaveCompress(file); #else rc = PAGE_H(page).Save(file); #endif } else { int i; int count = Page.GetCount(); rc = myWrite(file,&count,sizeof(count))==sizeof(count); for(i=0;i<count && rc == TRUE;i++) #ifdef SAVE_COMPRESSED rc = PAGE_N(i).SaveCompress(file); #else rc = PAGE_N(i).Save(file); #endif } } myClose(file); } EPILOG; return rc; }
//########################################### CPAGE_FUNC(Handle) CPAGE_GetPageFirst(Handle type) { PROLOG; int count = Page.GetCount(); int i; #ifdef _DEBUG _ASSERT(CPAGE_GetNameInternalType(type)); #endif DefConvertInit(); for(i = 0;i<count;i++) { if(!type || PAGE_N(i).GetType()==type || PAGE_N(i).Convert(type,NULL,0)) break; } Handle rc = i < count ? Page.GetHandle(i):NULL; EPILOG; return rc; }