drv_init_ifr.cpp

Go to the documentation of this file.
00001 // drv_init_ifr.cpp,v 1.3 2002/07/01 14:09:14 parsons Exp
00002 
00003 /*
00004 
00005 COPYRIGHT
00006 
00007 Copyright 1992, 1993, 1994 Sun Microsystems, Inc.  Printed in the United
00008 States of America.  All Rights Reserved.
00009 
00010 This product is protected by copyright and distributed under the following
00011 license restricting its use.
00012 
00013 The Interface Definition Language Compiler Front End (CFE) is made
00014 available for your use provided that you include this license and copyright
00015 notice on all media and documentation and the software program in which
00016 this product is incorporated in whole or part. You may copy and extend
00017 functionality (but may not remove functionality) of the Interface
00018 Definition Language CFE without charge, but you are not authorized to
00019 license or distribute it to anyone else except as part of a product or
00020 program developed by you or with the express written consent of Sun
00021 Microsystems, Inc. ("Sun").
00022 
00023 The names of Sun Microsystems, Inc. and any of its subsidiaries or
00024 affiliates may not be used in advertising or publicity pertaining to
00025 distribution of Interface Definition Language CFE as permitted herein.
00026 
00027 This license is effective until terminated by Sun for failure to comply
00028 with this license.  Upon termination, you shall destroy or return all code
00029 and documentation for the Interface Definition Language CFE.
00030 
00031 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED AS IS WITH NO WARRANTIES OF
00032 ANY KIND INCLUDING THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS
00033 FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR ARISING FROM A COURSE OF
00034 DEALING, USAGE OR TRADE PRACTICE.
00035 
00036 INTERFACE DEFINITION LANGUAGE CFE IS PROVIDED WITH NO SUPPORT AND WITHOUT
00037 ANY OBLIGATION ON THE PART OF Sun OR ANY OF ITS SUBSIDIARIES OR AFFILIATES
00038 TO ASSIST IN ITS USE, CORRECTION, MODIFICATION OR ENHANCEMENT.
00039 
00040 SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES SHALL HAVE NO LIABILITY WITH
00041 RESPECT TO THE INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY
00042 INTERFACE DEFINITION LANGUAGE CFE OR ANY PART THEREOF.
00043 
00044 IN NO EVENT WILL SUN OR ANY OF ITS SUBSIDIARIES OR AFFILIATES BE LIABLE FOR
00045 ANY LOST REVENUE OR PROFITS OR OTHER SPECIAL, INDIRECT AND CONSEQUENTIAL
00046 DAMAGES, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00047 
00048 Use, duplication, or disclosure by the government is subject to
00049 restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
00050 Technical Data and Computer Software clause at DFARS 252.227-7013 and FAR
00051 52.227-19.
00052 
00053 Sun, Sun Microsystems and the Sun logo are trademarks or registered
00054 trademarks of Sun Microsystems, Inc.
00055 
00056 SunSoft, Inc.  
00057 2550 Garcia Avenue 
00058 Mountain View, California  94043
00059 
00060 NOTE:
00061 
00062 SunOS, SunSoft, Sun, Solaris, Sun Microsystems or the Sun logo are
00063 trademarks or registered trademarks of Sun Microsystems, Inc.
00064 
00065 */
00066 
00067 // Initialization for IDL compiler driver program
00068 
00069 #include "idl.h"
00070 #include "idl_extern.h"
00071 #include "drv_private_ifr.h"
00072 #include "be_extern.h"
00073 
00074 ACE_RCSID(IFR_Service, drv_init_ifr, "drv_init_ifr.cpp,v 1.3 2002/07/01 14:09:14 parsons Exp")
00075 
00076 const size_t LOCAL_ESCAPES_BUFFER_SIZE = 1024;
00077 
00078 void
00079 DRV_init (void)
00080 {
00081   // Initialize FE global data object.
00082   ACE_NEW (idl_global,
00083            IDL_GlobalData);
00084 
00085   // Initialize some of its data.
00086   idl_global->set_root (0);
00087   idl_global->set_gen (0);
00088   idl_global->set_err (FE_new_UTL_Error ());
00089   idl_global->set_err_count (0);
00090   idl_global->set_indent (FE_new_UTL_Indenter ());
00091   idl_global->set_filename (0);
00092   idl_global->set_main_filename (0);
00093   idl_global->set_real_filename (0);
00094   idl_global->set_stripped_filename (0);
00095   idl_global->set_import (I_TRUE);
00096   idl_global->set_in_main_file (I_FALSE);
00097   idl_global->set_lineno (-1);
00098   idl_global->set_prog_name (0);
00099 
00100 #if defined (TAO_IDL_PREPROCESSOR)
00101   idl_global->set_cpp_location (TAO_IDL_PREPROCESSOR);
00102 #elif defined (ACE_CC_PREPROCESSOR)
00103   idl_global->set_cpp_location (ACE_CC_PREPROCESSOR);
00104 #else
00105   // Just default to cc.
00106   idl_global->set_cpp_location ("cc");
00107 #endif /* TAO_IDL_PREPROCESSOR */
00108 
00109   char local_escapes[LOCAL_ESCAPES_BUFFER_SIZE];
00110   ACE_OS::memset (&local_escapes, 
00111                   0, 
00112                   LOCAL_ESCAPES_BUFFER_SIZE);
00113 
00114   idl_global->set_local_escapes (local_escapes);
00115   idl_global->set_be ("");
00116   idl_global->set_compile_flags (0);
00117   idl_global->set_read_from_stdin (I_FALSE);
00118   idl_global->set_include_file_names (0);
00119   idl_global->set_n_include_file_names (0);
00120   idl_global->set_parse_state (IDL_GlobalData::PS_NoState);
00121 
00122   // Initialize BE global data object.
00123   ACE_NEW (be_global,
00124            BE_GlobalData);
00125 
00126   // Initialize driver private data.
00127   DRV_nfiles = 0;
00128   DRV_file_index = 0;  
00129 }
00130 

Generated on Thu Nov 9 14:11:49 2006 for TAO_IFR by doxygen 1.3.6