• Home
  • Raw
  • Download

Lines Matching refs:fd

55 static void wfc_util_finsert_new_string(int fd, char **ppReadedBuff, char *pNewStringValue, char *p…  in wfc_util_finsert_new_string()  argument
62 if( 0 == fd || NULL == pNewStringValue || 0 == strlen(pNewStringValue) ) { in wfc_util_finsert_new_string()
83 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_finsert_new_string()
101 lseek( fd, (int)(pSPointer-pReadBuff), SEEK_SET ); in wfc_util_finsert_new_string()
102 write( fd, pNewStringValue, strlen(pNewStringValue)); in wfc_util_finsert_new_string()
112 lseek( fd, (int)(pETagPointer-pReadBuff), SEEK_SET ); in wfc_util_finsert_new_string()
113 write( fd, pBackupBuff, sz_backupBuff ); in wfc_util_finsert_new_string()
115 …ftruncate(fd, sz_file + strlen(pNewStringValue) - 1); /* we use "-1" becasue of "pSPointer = pETag… in wfc_util_finsert_new_string()
132 static void wfc_util_fupdate_string(int fd, char **ppReadedBuff, in wfc_util_fupdate_string() argument
139 if( 0 == fd ) { in wfc_util_fupdate_string()
154 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_fupdate_string()
185 lseek( fd, 0, SEEK_SET ); in wfc_util_fupdate_string()
186 write( fd, pNewReadBuff, sz_newReadBuff); in wfc_util_fupdate_string()
187 ftruncate(fd, sz_newReadBuff); in wfc_util_fupdate_string()
204 int fd; in wfc_util_fset_buffer() local
208 fd = open( pFileName, O_RDWR ); in wfc_util_fset_buffer()
210 if( fd >= 0 ) { in wfc_util_fset_buffer()
214 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_fset_buffer()
226 lseek( fd, 0, SEEK_SET ); in wfc_util_fset_buffer()
227 read( fd, pReadBuff, sz_file ); in wfc_util_fset_buffer()
230 lseek( fd, positionStart, SEEK_SET ); in wfc_util_fset_buffer()
231 write( fd, pNewValue, newValueLength ); in wfc_util_fset_buffer()
245 if ( -1 == fsync( fd ) ) { in wfc_util_fset_buffer()
249 close( fd ); in wfc_util_fset_buffer()
266 int fd; in wfc_util_fget_buffer() local
271 fd = open( pFileName, O_RDONLY ); in wfc_util_fget_buffer()
273 if( fd >= 0 ) { in wfc_util_fget_buffer()
277 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_fget_buffer()
290 lseek( fd, 0, SEEK_SET ); in wfc_util_fget_buffer()
291 read( fd, pReadBuff, sz_file ); in wfc_util_fget_buffer()
321 close( fd ); in wfc_util_fget_buffer()
345 int fd; in wfc_util_fset_string() local
351 fd = open( pFileName, O_RDWR ); in wfc_util_fset_string()
353 if( fd >= 0 ) { in wfc_util_fset_string()
357 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_fset_string()
370 if(lseek(fd, 0, SEEK_SET) != 0) { in wfc_util_fset_string()
373 read( fd, pReadBuff, sz_file ); in wfc_util_fset_string()
395 lseek( fd, (int)(pSValuePointer-pReadBuff), SEEK_SET ); in wfc_util_fset_string()
396 write( fd, pNewValueString, strlen(pNewValueString)); in wfc_util_fset_string()
401 wfc_util_fupdate_string(fd, &pReadBuff, pETagPointer, pSValuePointer, pNewValueString); in wfc_util_fset_string()
426 wfc_util_finsert_new_string(fd, &pReadBuff, pNewValueBuff, pEndOfCfg); in wfc_util_fset_string()
439 if ( -1 == fsync( fd ) ) { in wfc_util_fset_string()
443 close( fd ); in wfc_util_fset_string()
470 int fd; in wfc_util_fget_string() local
478 fd = open( pFileName, O_RDONLY ); in wfc_util_fget_string()
480 if( fd >= 0 ) { in wfc_util_fget_string()
484 sz_file = lseek( fd, 0, SEEK_END ); in wfc_util_fget_string()
497 if(lseek(fd, 0, SEEK_SET) != 0) { in wfc_util_fget_string()
500 read( fd, pReadBuff, sz_file ); in wfc_util_fget_string()
538 close( fd ); in wfc_util_fget_string()