dcop Library API Documentation

main.cpp

00001 /***************************************************************** 00002 Copyright (c) 1999 Torben Weis <weis@kde.org> 00003 Copyright (c) 2000 Matthias Ettrich <ettrich@kde.org> 00004 00005 Permission is hereby granted, free of charge, to any person obtaining a copy 00006 of this software and associated documentation files (the "Software"), to deal 00007 in the Software without restriction, including without limitation the rights 00008 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00009 copies of the Software, and to permit persons to whom the Software is 00010 furnished to do so, subject to the following conditions: 00011 00012 The above copyright notice and this permission notice shall be included in 00013 all copies or substantial portions of the Software. 00014 00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00018 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 00019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00021 00022 ******************************************************************/ 00023 #include <qstring.h> 00024 #include <qfile.h> 00025 #include <qcstring.h> 00026 #include <stdlib.h> 00027 00028 void dcopidlParse( const char *_code ); 00029 00030 int idl_line_no; 00031 00032 #if YYDEBUG 00033 extern int yydebug; 00034 #endif 00035 00036 int main( int argc, char** argv ) 00037 { 00038 if (argc != 2) 00039 { 00040 fprintf(stderr, "Usage : dcopidl input_file\n"); 00041 return -1; 00042 } 00043 QFile file( argv[1] ); 00044 if ( !file.open( IO_ReadOnly ) ) 00045 { 00046 fprintf(stderr, "Can't open input file\n"); 00047 return -1; 00048 } 00049 00050 QByteArray arr = file.readAll(); 00051 int len = arr.size(); 00052 arr.resize( len + 1 ); 00053 arr[ len ] = 0; 00054 00055 #if YYDEBUG 00056 char *debug = getenv("DEBUG"); 00057 if (debug) 00058 yydebug = 1; 00059 #endif 00060 idl_line_no = 1; 00061 00062 printf("<!DOCTYPE DCOP-IDL><DCOP-IDL>\n"); 00063 printf("<SOURCE>%s</SOURCE>\n", argv[1] ); 00064 dcopidlParse( arr.data() ); 00065 printf("</DCOP-IDL>\n"); 00066 00067 file.close(); 00068 return 0; 00069 }
KDE Logo
This file is part of the documentation for dcop Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Oct 8 11:13:47 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003