Disable all code related to libXp
[oweals/cde.git] / cde / programs / dtinfo / DtMmdb / object / convert.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 // $XConsortium: convert.cc /main/3 1996/06/11 17:23:53 cde-hal $
24
25 #include <iostream>
26 using namespace std;
27
28 /*****************************************/
29 //Note: convert node.dat file to new format
30 /*****************************************/
31
32 #define BUFSIZ 100
33
34 main()
35 {
36    int sz;
37    int buf_sz = BUFSIZ;
38    char *buf = new char[BUFSIZ];
39
40    while ( cin.getline(buf, BUFSIZ) ) { // read in '100L'
41        cout << "102     0\n";
42        cout << "4\n";
43
44        for ( int i=0; i<4; i++ ) {
45           cin >> sz;
46 /*
47 cout << "***";
48 cout << sz;
49 cout << "***\n";
50 */
51           cin.get();
52    
53           if ( buf_sz < sz ) {
54              buf_sz = sz;
55              buf = new char[buf_sz];
56           }
57    
58           cin.read(buf, sz); 
59
60           cin.get(); // skip '\n'
61           cout << "5\t0" << "\n";
62           cout << sz << "\t";
63           cout.write(buf, sz); 
64
65           cout << "\n";
66        }
67    }
68
69    delete buf;
70 }