Go to the documentation of this file.00001
00002
00003 #include "global_extern.h"
00004 #include "be_extern.h"
00005 #include "../../tao/Version.h"
00006
00007 int
00008 BE_save_orb_args (int &argc, ACE_TCHAR *argv[])
00009 {
00010 int i = 1;
00011 ACE_TString holder;
00012
00013 while (i < argc)
00014 {
00015 if (ACE_OS::strncmp (argv[i], ACE_TEXT("-ORB"), 4) == 0)
00016 {
00017 holder += ACE_TString (argv[i]);
00018 holder += ACE_TEXT(" ");
00019
00020
00021 if (*argv[i + 1] == '-')
00022 {
00023 ++i;
00024 continue;
00025 }
00026
00027
00028 ACE_TString tmp (argv[i + 1],
00029 0,
00030 false);
00031
00032
00033
00034 size_t len = tmp.length ();
00035 ssize_t pos = tmp.find (ACE_TEXT(".idl"));
00036
00037 if (len - pos == 4)
00038 {
00039 return 0;
00040 }
00041
00042 pos = tmp.find (ACE_TEXT(".pidl"));
00043
00044 if (len - pos == 5)
00045 {
00046 return 0;
00047 }
00048
00049
00050 holder += tmp;
00051 holder += ACE_TEXT(" ");
00052 i += 2;
00053 }
00054 else
00055 {
00056 ++i;
00057 }
00058 }
00059
00060 be_global->orb_args (ACE_TEXT_ALWAYS_CHAR(holder.c_str()));
00061
00062 return 0;
00063 }
00064
00065
00066
00067
00068
00069 int
00070 BE_ifr_orb_init (int &ac, ACE_TCHAR *av[])
00071 {
00072 try
00073 {
00074 ACE_TCHAR* name = 0;
00075 be_global->orb (CORBA::ORB_init (ac,
00076 av,
00077 name));
00078 }
00079 catch (const CORBA::Exception& ex)
00080 {
00081 ex._tao_print_exception (ACE_TEXT ("BE_ifr_orb_init"));
00082
00083 return 1;
00084 }
00085
00086 return 0;
00087 }
00088
00089 TAO_IFR_BE_Export void
00090 BE_version (void)
00091 {
00092 ACE_DEBUG ((LM_DEBUG,
00093 "%s %s\n",
00094 ACE_TEXT ("TAO_IFR_BE, version"),
00095 ACE_TEXT (TAO_VERSION)));
00096 }
00097
00098 TAO_IFR_BE_Export int
00099 BE_init (int &argc, ACE_TCHAR *argv[])
00100 {
00101
00102 ACE_NEW_RETURN (be_global,
00103 BE_GlobalData,
00104 -1);
00105
00106 int status = BE_save_orb_args (argc, argv);
00107
00108 if (status != 0)
00109 {
00110 return status;
00111 }
00112
00113 idl_global->using_ifr_backend (true);
00114
00115 return BE_ifr_orb_init (argc, argv);
00116 }
00117
00118 TAO_IFR_BE_Export void
00119 BE_post_init (char *[], long)
00120 {
00121 }
00122