"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/memory.h" between
bed-3.0.3.src.tar.xz and bed-3.1.0.src.tar.xz

About: bed is an adjustable data format binary editor.

memory.h  (bed-3.0.3.src.tar.xz):memory.h  (bed-3.1.0.src.tar.xz)
skipping to change at line 27 skipping to change at line 27
/* */ /* */
/* Sun Dec 6 18:34:27 1998 */ /* Sun Dec 6 18:34:27 1998 */
#ifndef MEMORY_H #ifndef MEMORY_H
#define MEMORY_H #define MEMORY_H
#include <features.h> #include <features.h>
#include <limits.h> #include <limits.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/param.h> #include <sys/param.h>
#include <string.h> #include <string.h>
#include <stdlib.h>
#ifdef USE_RE2 #ifdef USE_RE2
#include <re2/re2.h> #include <re2/re2.h>
#endif #endif
#include "defines.h" #include "defines.h"
#include "rbtree.h" #include "rbtree.h"
#include "offtypes.h" #include "offtypes.h"
#include "myalloc.h" #include "myalloc.h"
#if defined(__FreeBSD__)||defined( _WIN32 ) #if defined(__FreeBSD__)||defined( _WIN32 )
#define NEEDS_BLOCKMODE 1 #define NEEDS_BLOCKMODE 1
#ifdef _WIN32 #ifdef _WIN32
#define ALIGNMEMORY 1 #define ALIGNMEMORY 1
#endif #endif
#endif #endif
#define alignedfree(x) ::free(x) #include "alignmem.h"
#ifdef ALIGNMEMORY
#define alignedalloc(bs,size) (char *)::aligned_alloc(bs, size)
#else
#define alignedalloc(bs,size) (char *)::malloc(size)
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifdef HAS_RE_SEARCH #ifdef HAS_RE_SEARCH
#ifdef HAVE_GNUREGEX_H #ifdef HAVE_GNUREGEX_H
#include <gnuregex.h> #include <gnuregex.h>
#else #else
#include <regex.h> #include <regex.h>
#endif #endif
#else #else
skipping to change at line 138 skipping to change at line 134
#ifdef _WIN32 #ifdef _WIN32
BY_HANDLE_FILE_INFORMATION FileInfo; BY_HANDLE_FILE_INFORMATION FileInfo;
int getfileinfo( BY_HANDLE_FILE_INFORMATION *FInfo ) ; int getfileinfo( BY_HANDLE_FILE_INFORMATION *FInfo ) ;
#else #else
STATTYPE statdata; STATTYPE statdata;
bool statmis() ; bool statmis() ;
#endif #endif
OFFTYPE filesize, diskfilesize; OFFTYPE filesize, diskfilesize{},useddiskfilesize{};
char *filename; char *filename;
int filenamelen; int filenamelen;
Tree tree; Tree tree;
int error(void) const {return errors;} int error(void) const {return errors;}
inline bool isnewfile() { return filehandle== MY_INVALID_HANDLE_VALUE;}; inline bool isnewfile() { return filehandle== MY_INVALID_HANDLE_VALUE;};
OFFTYPE size(void) const {return filesize;} OFFTYPE size(void) const {return filesize;}
explicit Memory(const char *name=NULL); explicit Memory(const char *name=NULL);
Memory() = delete; Memory() = delete;
skipping to change at line 165 skipping to change at line 161
void init(const char *name) ; void init(const char *name) ;
void initall(void) ; void initall(void) ;
//int reinit(const char *name) ; //int reinit(const char *name) ;
//int reinit(void) ; //int reinit(void) ;
void endfile(void); void endfile(void);
int empty(void) ; int empty(void) ;
int savenode(FILEHANDLE output, Treel *node) ; int savenode(FILEHANDLE output, Treel *node) ;
int saveall(void); int saveall(void);
#if (defined(HAVE_SENDFILE) && defined(SEEK_DATA)) ||defined(USE_WINFILE)
int nonsparsesaveto(FILEHANDLE handle);
#endif
int saveto(FILEHANDLE handle); int saveto(FILEHANDLE handle);
BEDS_SIZE_T saveto(FILEHANDLE handle,OFFTYPE beg,OFFTYPE len) ; BEDS_SIZE_T saveto(FILEHANDLE handle,OFFTYPE beg,OFFTYPE len) ;
#if (defined(HAVE_SENDFILE) && defined(SEEK_DATA)) ||defined(USE_WINFILE)
BEDS_SIZE_T nonsparsesaveto(FILEHANDLE handle,OFFTYPE beg,OFFTYPE len) ;
#endif
int touched(void) ; int touched(void) ;
BEDS_SIZE_T getblock(BLOCKTYPE blocknr,char *buf) ; BEDS_SIZE_T getblock(BLOCKTYPE blocknr,char *buf) ;
OFFTYPE getblocks(const BLOCKTYPE een,char *buf,const BLOCKTYPE nr) ; OFFTYPE getblocks(const BLOCKTYPE een,char *buf,const BLOCKTYPE nr) ;
OFFTYPE putblocks(const BLOCKTYPE een,char *buf,const BLOCKTYPE nr) ; OFFTYPE putblocks(const BLOCKTYPE een,char *buf,const BLOCKTYPE nr) ;
Flag mmapfailed=1; Flag mmapfailed=1;
BEDS_SIZE_T mmapgetblock(BLOCKTYPE blocknr,char *buf) ; BEDS_SIZE_T mmapgetblock(BLOCKTYPE blocknr,char *buf) ;
BEDS_SIZE_T putblock(BLOCKTYPE blocknr,char *buf) ; BEDS_SIZE_T putblock(BLOCKTYPE blocknr,char *buf) ;
BEDS_SIZE_T getblockpiece(OFFTYPE beg,BEDS_SIZE_T len,char *get) ; BEDS_SIZE_T getblockpiece(OFFTYPE beg,BEDS_SIZE_T len,char *get) ;
#ifdef _WIN32 #ifdef _WIN32
OFFTYPE getpartaligned(const OFFTYPE beg,const OFFTYPE len,char *const gegs) ; OFFTYPE getpartaligned(const OFFTYPE beg,const OFFTYPE len,char *const gegs) ;
#endif #endif
OFFTYPE getpart(OFFTYPE beg,OFFTYPE len,char *gegs) ; OFFTYPE getpart(OFFTYPE beg,OFFTYPE len,char *gegs) ;
BEDS_SIZE_T putblockpiece(OFFTYPE beg,BEDS_SIZE_T len,char *get) ; BEDS_SIZE_T putblockpiece(OFFTYPE beg,BEDS_SIZE_T len,char *get) ;
OFFTYPE putpart(OFFTYPE beg,OFFTYPE len,char *gegs) ; OFFTYPE putpart(OFFTYPE beg,OFFTYPE len,char *gegs) ;
void setborder(OFFTYPE pos) ; void setborder(OFFTYPE pos) ;
void extend(OFFTYPE newsize) ; void extend(OFFTYPE newsize) ;
void undotruncate(OFFTYPE newsize,OFFTYPE useddisk) ;
void truncatefile(OFFTYPE pos) ; /* v2 */ void truncatefile(OFFTYPE pos) ; /* v2 */
//f c r //f c r
inline BLOCKTYPE blocksize(void) const { return BLOCKSIZE;}; inline BLOCKTYPE blocksize(void) const { return BLOCKSIZE;};
BEDS_SIZE_T blockreadat(char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ; BEDS_SIZE_T blockreadat(char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ;
inline BEDS_SIZE_T readat(char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ; inline BEDS_SIZE_T readat(char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ;
BEDS_SIZE_T writeat(FILEHANDLE output,char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ; BEDS_SIZE_T writeat(FILEHANDLE output,char *ptr,BEDS_SIZE_T size,OFFTYPE offset) ;
int zerochange(void) ; int zerochange(void) ;
skipping to change at line 219 skipping to change at line 224
OFFTYPE win32diskfilesize(FILEHANDLE filehandle,OFFTYPE *,OFFTYPE *) ; OFFTYPE win32diskfilesize(FILEHANDLE filehandle,OFFTYPE *,OFFTYPE *) ;
#ifdef __linux__ #ifdef __linux__
bool getsizelinux(OFFTYPE &begin,OFFTYPE &end) ; bool getsizelinux(OFFTYPE &begin,OFFTYPE &end) ;
#endif #endif
inline void regfilesize(void ) ; inline void regfilesize(void ) ;
#ifdef USE_WINFILE #ifdef USE_WINFILE
inline FILEHANDLE openreading(const char *filename) ; inline FILEHANDLE openreading(const char *filename) ;
inline FILEHANDLE openreadwrite(const char *filename) ; inline FILEHANDLE openreadwrite(const char *filename) ;
#endif #endif
FILEHANDLE reopen() ;
}; };
extern BEDS_SIZE_T writetofile(FILEHANDLE output,const char *buf,BEDS_SIZE_T nr) ; extern BEDS_SIZE_T writetofile(FILEHANDLE output,const char *buf,BEDS_SIZE_T nr) ;
#ifdef _WIN32 #ifdef _WIN32
inline ssize_t sgetfilesize(FILEHANDLE han) { inline ssize_t sgetfilesize(FILEHANDLE han) {
return GetFileSize(han,NULL); return GetFileSize(han,NULL);
} }
inline OFFTYPE lgetfilesize(FILEHANDLE han) { inline OFFTYPE lgetfilesize(FILEHANDLE han) {
DWORD high,low; DWORD high,low;
 End of changes. 8 change blocks. 
7 lines changed or deleted 15 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)