trunk 20080912
[gitenigma.git] / src / enigma_dyn_flash.h
blobdeb27b0b15c09fc887510456599e073922d503ea
1 /*
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;
35 int progressComplete;
36 struct Message
38 int type;
39 const char *mtd;
40 const char *filename;
41 enum
43 read,
44 write,
45 quit
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);
54 void thread();
55 int writeFlash(eString mtd, eString fileName);
56 int readFlash(eString mtd, eString fileName);
57 public:
58 eFlashOperationsHandler();
59 ~eFlashOperationsHandler();
60 void readPartition(const char * mtd, const char * filename);
61 void writePartition(const char * mtd, const char * filename);
62 void quitFlashOps();
63 eString getProgressMessage1() { return progressMessage1; }
64 eString getProgressMessage2() { return progressMessage2; }
65 int getProgressComplete() { return progressComplete; }
66 static eFlashOperationsHandler *getInstance() { return (instance) ? instance : new eFlashOperationsHandler(); }
69 class eFlashMgr
71 eString h1, h2, h3, h4;
72 typedef struct
74 eString dev, name, size, erasesize;
75 } t_mtd;
76 std::list<t_mtd> mtds;
78 public:
79 eFlashMgr();
80 ~eFlashMgr();
81 eString htmlList();
82 eString getMTDName(eString mtd);
85 #endif /* __enigma_dyn_flash_h */