00001 /* 00002 * HT Editor 00003 * relfile.h 00004 * 00005 * Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de) 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License version 2 as 00009 * published by the Free Software Foundation. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00019 */ 00020 00021 #ifndef __RELFILE_H__ 00022 #define __RELFILE_H__ 00023 00024 #include "htdata.h" 00025 #include "stream.h" 00026 00027 /* 00028 * CLASS ht_reloc_file 00029 */ 00030 00031 class ht_reloc_file: public ht_layer_streamfile { 00032 protected: 00033 ht_tree *relocs; 00034 bool enabled; 00035 00036 /* new */ 00037 virtual void reloc_apply(Object *reloc, byte *data) = 0; 00038 virtual bool reloc_unapply(Object *reloc, byte *data) = 0; 00039 public: 00040 void init(ht_streamfile *streamfile, bool own_streamfile); 00041 virtual void done(); 00042 /* overwritten */ 00043 void finalize(); 00044 void insert_reloc(FILEOFS o, Object *reloc); 00045 virtual UINT read(void *buf, UINT size); 00046 virtual int vcntl(UINT cmd, va_list vargs); 00047 virtual UINT write(const void *buf, UINT size); 00048 }; 00049 00050 #endif /* __RELFILE_H__ */ 00051