summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/tools/.cvsignore6
-rw-r--r--libopie2/tools/makemanuf.cpp62
-rw-r--r--libopie2/tools/makemanuf.pro17
3 files changed, 85 insertions, 0 deletions
diff --git a/libopie2/tools/.cvsignore b/libopie2/tools/.cvsignore
new file mode 100644
index 0000000..8f7300c
--- a/dev/null
+++ b/libopie2/tools/.cvsignore
@@ -0,0 +1,6 @@
1Makefile*
2moc*
3*moc
4*.o
5~*
6
diff --git a/libopie2/tools/makemanuf.cpp b/libopie2/tools/makemanuf.cpp
new file mode 100644
index 0000000..69f4550
--- a/dev/null
+++ b/libopie2/tools/makemanuf.cpp
@@ -0,0 +1,62 @@
1/*
2                 This file is part of the Opie Project
3              (C) 2003 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 =.
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
30
31#define private public
32#include <opie2/omanufacturerdb.h>
33
34#include <qdatastream.h>
35#include <qfile.h>
36
37int main( int argc, char** argv )
38{
39 if ( argc < 2 )
40 {
41 qDebug( "Usage: ./makemanuf <output>" );
42 return -1;
43 }
44
45 OManufacturerDB* db = OManufacturerDB::instance();
46
47 QFile f( argv[1] );
48 if ( !f.open( IO_WriteOnly ) )
49 {
50 qDebug( "Can't open file %s", argv[1] );
51 return -1;
52 }
53
54 QDataStream ds( &f );
55 ds << db->manufacturers;
56 ds << db->manufacturersExt;
57
58 qDebug( "ManufacturerDB successfully written to %s", argv[1] );
59
60 return 0;
61}
62
diff --git a/libopie2/tools/makemanuf.pro b/libopie2/tools/makemanuf.pro
new file mode 100644
index 0000000..84f0192
--- a/dev/null
+++ b/libopie2/tools/makemanuf.pro
@@ -0,0 +1,17 @@
1DESTDIR = .
2TEMPLATE = app
3CONFIG = qt warn_on debug
4
5HEADERS =
6
7SOURCES = makemanuf.cpp
8
9INCLUDEPATH += $(OPIEDIR)/include
10DEPENDPATH += $(OPIEDIR)/include
11INTERFACES =
12LIBS += -lopiecore2 -lopienet2
13TARGET = makemanuf
14
15include ( $(OPIEDIR)/include.pro )
16
17