2 * $Id: enigma_dyn_flash.h,v 1.5 2005/10/12 20:46:27 digi_casi Exp $
4 * (C) 2005 by digi_casi <digi_casi@tuxbox.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef __enigma_dyn_flash_h
23 #define __enigma_dyn_flash_h
25 #include <lib/base/thread.h>
26 #include <lib/base/message.h>
28 class eHTTPDynPathResolver
;
29 void ezapFlashInitializeDyn(eHTTPDynPathResolver
*dyn_resolver
, bool lockWeb
);
30 eString
getConfigFlashMgr(void);
32 class eFlashOperationsHandler
: public eMainloop
, private eThread
, public Object
34 eString progressMessage1
, progressMessage2
;
47 Message(int type
= 0, const char *mtd
= 0, const char *filename
= 0)
48 :type(type
), mtd(mtd
), filename(filename
)
51 eFixedMessagePump
<Message
> messages
;
52 static eFlashOperationsHandler
*instance
;
53 void gotMessage(const Message
&message
);
55 int writeFlash(eString mtd
, eString fileName
);
56 int readFlash(eString mtd
, eString fileName
);
58 eFlashOperationsHandler();
59 ~eFlashOperationsHandler();
60 void readPartition(const char * mtd
, const char * filename
);
61 void writePartition(const char * mtd
, const char * filename
);
63 eString
getProgressMessage1() { return progressMessage1
; }
64 eString
getProgressMessage2() { return progressMessage2
; }
65 int getProgressComplete() { return progressComplete
; }
66 static eFlashOperationsHandler
*getInstance() { return (instance
) ? instance
: new eFlashOperationsHandler(); }
71 eString h1
, h2
, h3
, h4
;
74 eString dev
, name
, size
, erasesize
;
76 std::list
<t_mtd
> mtds
;
82 eString
getMTDName(eString mtd
);
85 #endif /* __enigma_dyn_flash_h */