void SCOCacheMountPoint::newMountPointStage1_() { LOG_TRACE(path_); if (!fs::exists(path_)) { throw fungi::IOException("MountPoint does not exist", path_.string().c_str(), ENOENT); } else { if (!empty_()) { throw fungi::IOException("MountPoint not empty", path_.string().c_str(), EEXIST); } } validateParams_(); bu::basic_random_generator<boost::mt19937> uuidgen; uuid_ = uuidgen(); LOG_DEBUG(path_ << ": creation stage 1 succeeded"); }
/* * uuid_create() - create an UUID. * See also: * http://www.opengroup.org/onlinepubs/009629399/uuid_create.htm */ void uuid_create(uuid_t *u, uint32_t *status) { if (status) *status = uuid_s_ok; uuidgen(u, 1); }
/* * uuid_create() - create an UUID. * See also: * http://www.opengroup.org/onlinepubs/009629399/uuid_create.htm */ void uuid_create(uuid_t *u, uint32_t *status) { uint32_t s; if (uuidgen(u, 1) == -1) s = uuid_s_no_memory; /* XXX */ else s = uuid_s_ok; if (status) *status = s; }
/* * Main entry */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { char uidstr[40]; uuidgen(uidstr); const char *s = uidstr; const char **ps = &s; plhs[0] = mxCreateCharMatrixFromStrings(1, ps); if( nrhs == 1 ){ mxSetN( plhs[0] , *(mxGetPr(prhs[0])) ); } }
int MakeUUID(char *location) { uuid_t uuid; #if defined(HAVE_UUIDGEN) uuidgen(&uuid, 1); #elif defined(HAVE_UUID_GENERATE) uuid_generate(uuid); #else # error "you must define some way of generating a UUID." #endif memcpy((void *)location, (void *)&uuid, sizeof(uuid)); return 1; }
/** The tenant-create command */ int cmd_tenant_create (int argc, const char *argv[]) { uuid tenant; /* Avoid using the default tenant in this case */ disregard_default_tenant(); if (OPTIONS.tenant[0] == 0) { tenant = uuidgen(); OPTIONS.tenant = (const char *) malloc (40); uuid2str (tenant, (char *) OPTIONS.tenant); } else { tenant = mkuuid (OPTIONS.tenant); } var *req = var_alloc(); var *req_tenant = var_get_dict_forkey (req, "tenant"); if (OPTIONS.key[0]) { var_set_str_forkey (req_tenant, "key", OPTIONS.key); } if (OPTIONS.name[0]) { var_set_str_forkey (req_tenant, "name", OPTIONS.name); } var *apires = api_call ("POST", req, "/%s", OPTIONS.tenant); if (apires) { var *r = var_get_dict_forkey (apires, "tenant"); printf ("Tenant created:\n" "---------------------------------------------" "-----------------------------------\n" " Name: %s\n" " UUID: %s\n" " AES Key: %s\n" "---------------------------------------------" "-----------------------------------\n", var_get_str_forkey (r, "name"), OPTIONS.tenant, var_get_str_forkey (r, "key")); } var_free (req); var_free (apires); return 0; }
static void efi_generate_uuid(efi_guid_t *ent_uuid) { #ifdef HAVE_UUID_GENERATE uuid_generate((unsigned char*)ent_uuid); #elif defined HAVE_UUIDGEN uuidgen((struct uuid*)ent_uuid,1); #elif defined HAVE_UUID_CREATE uuid_t *uuid; char *data_ptr=(char*)&ent_uuid; size_t data_len=sizeof(ent_uuid);; uuid_create(&uuid); uuid_make(uuid, UUID_MAKE_V1); uuid_export(uuid, UUID_FMT_BIN, (void **)&data_ptr, &data_len); uuid_destroy(uuid); #else #warning You need a uuid_generate, uuidgen or uuid_create function #endif swap_uuid_and_efi_guid(ent_uuid); }
int main (int argc, const char *argv[]) { const char *tstr = NULL; var *env = var_alloc(); var *env_collector = var_get_dict_forkey (env, "collector"); var *env_colors = var_get_array_forkey (env, "colors"); var_set_int_forkey (env_collector, "listenport", 3333); var_set_str_forkey (env_collector, "address", "127.0.0.1"); var_set_str_forkey (env_collector, "key", "secret"); var_clear_array (env_colors); var_add_str (env_colors, "red"); var_add_str (env_colors, "green"); var_add_str (env_colors, "blue"); assert (var_get_int_forkey (env_collector, "listenport") == 3333); assert (tstr = var_get_str_forkey (env_collector, "address")); assert (strcmp (tstr, "127.0.0.1") == 0); assert (tstr = var_get_str_forkey (env_collector, "key")); assert (strcmp (tstr, "secret") == 0); assert (var_get_count (env_collector) == 3); assert (tstr = var_get_str_atindex (env_colors, 0)); assert (strcmp (tstr, "red") == 0); assert (tstr = var_get_str_atindex (env_colors, 1)); assert (strcmp (tstr, "green") == 0); assert (tstr = var_get_str_atindex (env_colors, 2)); assert (strcmp (tstr, "blue") == 0); time_t tnow = time (NULL); var_set_time_forkey (env, "nowtime", tnow); assert (var_get_time_forkey (env, "nowtime") == tnow); var_set_unixtime_forkey (env, "unixtime", tnow); assert (var_get_time_forkey (env, "unixtime") == tnow); uuid uuid_in = uuidgen(); var_set_uuid_forkey (env, "myuuid", uuid_in); uuid uuid_out = var_get_uuid_forkey (env, "myuuid"); assert (uuidcmp (uuid_in, uuid_out)); var_new_generation (env); var_set_int_forkey (env_collector, "listenport", 3333); var_set_str_forkey (env_collector, "address", "192.168.1.1"); var_clear_array (env_colors); var_add_str (env_colors, "red"); var_add_str (env_colors, "green"); var_add_str (env_colors, "blue"); var *lport, *addr, *key; lport = var_find_key (env_collector, "listenport"); addr = var_find_key (env_collector, "address"); key = var_find_key (env_collector, "key"); assert (lport); assert (addr); assert (key); /* collector.listenport should be unchanged from first generation */ assert (lport->generation == env->generation); assert (lport->lastmodified < env->generation); assert (lport->firstseen == lport->lastmodified); /* collector.addr should be changed this generation */ assert (addr->generation == env->generation); assert (addr->lastmodified == env->generation); assert (addr->firstseen == env->firstseen); /* colors should be changed this generation */ assert (env_colors->generation == env->generation); assert (env_colors->lastmodified == env->generation); assert (env_colors->firstseen == env->firstseen); /* collector.key should be stale */ assert (key->generation < env->generation); var_clean_generation (env); /* collector.key should now be deleted */ key = var_find_key (env_collector, "key"); assert (key == NULL); return 0; }
int main(int argc, char *argv[]) { FILE *fp; uuid_t *store, *uuid; char *p; int ch, count, i, iterate; count = -1; /* no count yet */ fp = stdout; /* default output file */ iterate = 0; /* not one at a time */ while ((ch = getopt(argc, argv, "1n:o:")) != -1) switch (ch) { case '1': iterate = 1; break; case 'n': if (count > 0) usage(); count = strtol(optarg, &p, 10); if (*p != 0 || count < 1) usage(); break; case 'o': if (fp != stdout) errx(1, "multiple output files not allowed"); fp = fopen(optarg, "w"); if (fp == NULL) err(1, "fopen"); break; default: usage(); } argv += optind; argc -= optind; if (argc) usage(); if (count == -1) count = 1; store = (uuid_t*)malloc(sizeof(uuid_t) * count); if (store == NULL) err(1, "malloc()"); if (!iterate) { /* Get them all in a single batch */ if (uuidgen(store, count) != 0) err(1, "uuidgen()"); } else { uuid = store; for (i = 0; i < count; i++) { if (uuidgen(uuid++, 1) != 0) err(1, "uuidgen()"); } } uuid = store; while (count--) { uuid_to_string(uuid++, &p, NULL); fprintf(fp, "%s\n", p); free(p); } free(store); if (fp != stdout) fclose(fp); return (0); }
// // composition // void GeneratorCSD::doComposition(CIDL::CompositionDef_ptr composition) { // // obtain uuid for the implementation // std::string uuid_string = uuidgen(); std::string os = "linux"; std::string processor = ""; std::string compiler = ""; std::string compiler_version = ""; #ifdef _WIN32 os = "WIN"; processor = "x86"; compiler = "VC++"; compiler_version = "7,0"; #endif // // open output file // std::string name; std::string id = composition->id(); IR__::Contained_ptr module_def = 0; std::string::size_type pos = id.find_last_of("/"); if(pos != std::string::npos) { id.replace(pos, string::npos, ":1.0"); module_def = repository_->lookup_id(id.c_str()); name = getAbsoluteName(module_def, "_"); name.append("_"); } name.append(composition->name()); filename_ = name + ".csd"; out.open(filename_.c_str()); // // xml file begin // out << "<?xml version = '1.0' ?>\n"; out << "<!DOCTYPE softpkg PUBLIC \"-//OMG//DTD Software Package Descriptor\""; out << " \"http://qedo.berlios.de/softpkg.dtd\">\n\n"; out << "<softpkg name=\"" << composition->name() << "_softpkg\" version=\"1,0\">\n\n"; out.indent(); out << "<pkgtype>CORBA Component</pkgtype>\n"; out << "<title></title>\n"; out << "<author></author>\n"; out << "<description></description>\n"; out << "<license href=\"\" />\n"; // the id should be of the component but is of the home currently for deployment reason out << "<idl id=\"" << composition->ccm_home()->id() << "\">\n"; out.indent(); out << "<fileinarchive name=\"" << idlfilename_ << "\"/>\n"; out.unindent(); out << "</idl>\n\n"; // // implementation // out << "<implementation id=\"UUID-" << uuid_string << "\">\n"; out.indent(); out << "<os name=\"" << os << "\" />\n"; out << "<processor name=\"" << processor << "\" />\n"; out << "<compiler name=\"" << compiler << "\" version=\"" << compiler_version << "\" />\n"; out << "<programminglanguage name=\"C++\" />\n"; out << "<dependency type=\"DLL\"><localfile name=\"jtcd.dll\"/></dependency>\n"; out << "<dependency type=\"DLL\"><localfile name=\"obd.dll\"/></dependency>\n"; out << "<descriptor type=\"CORBA-Component\">\n"; out.indent(); out << "<fileinarchive name=\"" << name << ".ccd\" />\n"; out.unindent(); out << "</descriptor>\n"; out << "<code type=\"DLL\">\n"; out.indent(); out << "<fileinarchive name=\"" << name << ".dll\"/>\n"; out << "<entrypoint>create_" << composition->ccm_home()->name() << "E</entrypoint>\n"; out << "<usage>executor</usage>\n"; out.unindent(); out << "</code>\n"; out << "<code type=\"DLL\">\n"; out.indent(); out << "<fileinarchive name=\"" << name << "_SERVANT.dll\"/>\n"; out << "<entrypoint>create_" << composition->ccm_home()->name() << "S</entrypoint>\n"; out << "<usage>servant</usage>\n"; out.unindent(); out << "</code>\n"; out.unindent(); out << "</implementation>\n"; out.unindent(); out << "</softpkg>\n"; // close file out.close(); }
int main(int ac, char **av) { uint32_t status; hammer2_off_t total_space; hammer2_off_t free_space; hammer2_off_t reserved_space; int ch; int fd = -1; char *fsidstr; char *spfsidstr; char *rpfsidstr; /* * Sanity check basic filesystem structures. No cookies for us * if it gets broken! */ assert(sizeof(hammer2_volume_data_t) == HAMMER2_VOLUME_BYTES); assert(sizeof(hammer2_inode_data_t) == HAMMER2_INODE_BYTES); assert(sizeof(hammer2_blockref_t) == HAMMER2_BLOCKREF_BYTES); /* * Generate a filesystem id and lookup the filesystem type */ srandomdev(); uuidgen(&Hammer2_FSId, 1); uuidgen(&Hammer2_SPFSId, 1); uuidgen(&Hammer2_RPFSId, 1); uuid_from_string(HAMMER2_UUID_STRING, &Hammer2_FSType, &status); /*uuid_name_lookup(&Hammer2_FSType, "DragonFly HAMMER2", &status);*/ if (status != uuid_s_ok) { errx(1, "uuids file does not have the DragonFly " "HAMMER filesystem type"); } /* * Parse arguments */ while ((ch = getopt(ac, av, "fL:b:m:r:V:")) != -1) { switch(ch) { case 'f': ForceOpt = 1; break; case 'L': Label = optarg; if (strlen(Label) > HAMMER2_INODE_MAXNAME) { errx(1, "Root directory label too long " "(64 chars max)\n"); } break; case 'b': BootAreaSize = getsize(optarg, HAMMER2_NEWFS_ALIGN, HAMMER2_BOOT_MAX_BYTES, 2); break; case 'r': AuxAreaSize = getsize(optarg, HAMMER2_NEWFS_ALIGN, HAMMER2_REDO_MAX_BYTES, 2); break; case 'V': Hammer2Version = strtol(optarg, NULL, 0); if (Hammer2Version < HAMMER2_VOL_VERSION_MIN || Hammer2Version >= HAMMER2_VOL_VERSION_WIP) { errx(1, "I don't understand how to format " "HAMMER2 version %d\n", Hammer2Version); } break; default: usage(); break; } } if (Hammer2Version < 0) { size_t olen = sizeof(Hammer2Version); Hammer2Version = HAMMER2_VOL_VERSION_DEFAULT; if (sysctlbyname("vfs.hammer2.supported_version", &Hammer2Version, &olen, NULL, 0) == 0) { if (Hammer2Version >= HAMMER2_VOL_VERSION_WIP) { Hammer2Version = HAMMER2_VOL_VERSION_WIP - 1; fprintf(stderr, "newfs_hammer: WARNING: HAMMER2 VFS " "supports higher version than I " "understand,\n" "using version %d\n", Hammer2Version); } } else { fprintf(stderr, "newfs_hammer: WARNING: HAMMER2 VFS not " "loaded, cannot get version info.\n" "Using version %d\n", HAMMER2_VOL_VERSION_DEFAULT); } } /* * Collect volume information. */ ac -= optind; av += optind; if (ac != 1) { fprintf(stderr, "Exactly one disk device must be specified\n"); exit(1); } total_space = check_volume(av[0], &fd); /* * ~typically 8MB alignment to avoid edge cases for reserved blocks * and so raid stripes (if any) operate efficiently. */ total_space &= ~HAMMER2_VOLUME_ALIGNMASK64; /* * Calculate defaults for the boot area size and round to the * volume alignment boundary. */ if (BootAreaSize == 0) { BootAreaSize = HAMMER2_BOOT_NOM_BYTES; while (BootAreaSize > total_space / 20) BootAreaSize >>= 1; if (BootAreaSize < HAMMER2_BOOT_MIN_BYTES) BootAreaSize = HAMMER2_BOOT_MIN_BYTES; } else if (BootAreaSize < HAMMER2_BOOT_MIN_BYTES) {
void GeneratorVC7::generateServant() { std::string uuid_string = uuidgen(); // // build file name for servant project and open file // std::string project_name; IR__::Contained_ptr module_def = 0; std::string target_id = target_->id(); std::string::size_type pos = target_id.find_last_of("/"); if(pos != std::string::npos) { target_id.replace(pos, std::string::npos, ":1.0"); module_def = repository_->lookup_id(target_id.c_str()); project_name = getAbsoluteName(module_def, "_"); project_name.append("_"); } project_name.append(target_->name()); project_name.append("_SERVANT"); #ifdef WIN32 _mkdir(project_name.c_str()); #else mkdir(project_name.c_str(), 0755); #endif filename_ = project_name + "/" + project_name + ".vcproj"; out.open(filename_.c_str()); // // biuld eport define needed for MICO on windows // std::string export_prefix_; for (unsigned long i = 0; i < file_prefix_.size(); i++) { export_prefix_+= toupper(file_prefix_[i]); } // // print servant project file // out << "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>\n"; out << "<VisualStudioProject\n"; out.indent(); out << "ProjectType=\"Visual C++\"\n"; out << "Version=\"7.10\"\n"; out << "Name=\"" << project_name << "\"\n"; out << "ProjectGUID=\"{" << uuid_string << "}\"\n"; out << "Keyword=\"Win32Proj\">\n"; // // platforms // out << "<Platforms>\n"; out.indent(); out << "<Platform\n"; out.indent(); out << "Name=\"Win32\"/>\n"; out.unindent(); out.unindent(); out << "</Platforms>\n"; // // configurations // out << "<Configurations>\n"; out.indent(); // // orbacus // out << "<Configuration\n"; out.indent(); out << "Name=\"Debug_orbacus|Win32\"\n"; out << "OutputDirectory=\"Debug_orbacus\"\n"; out << "IntermediateDirectory=\"Debug_orbacus\"\n"; out << "ConfigurationType=\"2\"\n"; out << "CharacterSet=\"2\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCLCompilerTool\"\n"; out << "Optimization=\"0\"\n"; out << "AdditionalIncludeDirectories=\".;$(QEDO)/include;$(ORBACUS)/include;$(ORBACUS)/include/OB;\"\n"; out << "PreprocessorDefinitions=\"_DEBUG;_USRDLL;SERVANTMODULE_EXPORTS;_QEDO_NO_QOS\"\n"; out << "MinimalRebuild=\"TRUE\"\n"; out << "BasicRuntimeChecks=\"3\"\n"; out << "RuntimeLibrary=\"3\"\n"; out << "RuntimeTypeInfo=\"TRUE\"\n"; out << "UsePrecompiledHeader=\"0\"\n"; out << "WarningLevel=\"3\"\n"; out << "Detect64BitPortabilityProblems=\"FALSE\"\n"; out << "DebugInformationFormat=\"4\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCLinkerTool\"\n"; out << "AdditionalDependencies=\"ComponentIDL.lib ComponentContainer.lib qedoutil.lib obd.lib jtcd.lib\"\n"; out << "OutputFile=\"$(OutDir)/" << project_name << ".dll\"\n"; out << "LinkIncremental=\"2\"\n"; out << "AdditionalLibraryDirectories=\"$(QEDO)/lib;$(ORBACUS)/lib\"\n"; out << "GenerateDebugInformation=\"TRUE\"\n"; out << "ProgramDatabaseFile=\"$(OutDir)/" << project_name << ".pdb\"\n"; out << "SubSystem=\"2\"\n"; out << "ImportLibrary=\"$(OutDir)/" << project_name << ".lib\"\n"; out << "TargetMachine=\"1\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCMIDLTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPostBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreLinkEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCResourceCompilerTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebServiceProxyGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCXMLDataGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebDeploymentTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCAuxilaryManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out.unindent(); out << "</Configuration>\n"; // // mico // out << "<Configuration\n"; out.indent(); out << "Name=\"Debug_mico|Win32\"\n"; out << "OutputDirectory=\"Debug_mico\"\n"; out << "IntermediateDirectory=\"Debug_mico\"\n"; out << "ConfigurationType=\"2\"\n"; out << "CharacterSet=\"2\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCLCompilerTool\"\n"; out << "Optimization=\"0\"\n"; out << "AdditionalIncludeDirectories=\".;$(QEDO)/include/pthreads;$(QEDO)/include;$(Qedo)/include/mico;$(Qedo)/include/mico/windows;\"\n"; out << "PreprocessorDefinitions=\""; out << "BUILD_" << export_prefix_ << "_DLL;MICO_ORB;WIN32;_DEBUG;_USRDLL;HAVE_THREADS;HAVE_PTHREADS;PtW32NoCatchWarn;__CLEANUP_C;_WIN32_WINNT=0x400;\"\n"; out << "MinimalRebuild=\"TRUE\"\n"; out << "BasicRuntimeChecks=\"3\"\n"; out << "RuntimeLibrary=\"3\"\n"; out << "RuntimeTypeInfo=\"TRUE\"\n"; out << "UsePrecompiledHeader=\"0\"\n"; out << "WarningLevel=\"3\"\n"; out << "Detect64BitPortabilityProblems=\"FALSE\"\n"; out << "DebugInformationFormat=\"4\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCLinkerTool\"\n"; out << "AdditionalDependencies=\"ComponentIDL.lib ComponentContainer.lib qedoutil.lib mico2311.lib pthreadVC2.lib\"\n"; out << "OutputFile=\"$(OutDir)/" << project_name << ".dll\"\n"; out << "LinkIncremental=\"2\"\n"; out << "AdditionalLibraryDirectories=\"$(QEDO)/lib;$(QEDO)/lib\"\n"; out << "GenerateDebugInformation=\"TRUE\"\n"; out << "ProgramDatabaseFile=\"$(OutDir)/" << project_name << ".pdb\"\n"; out << "SubSystem=\"2\"\n"; out << "ImportLibrary=\"$(OutDir)/" << project_name << ".lib\"\n"; out << "TargetMachine=\"1\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCMIDLTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPostBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreLinkEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCResourceCompilerTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebServiceProxyGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCXMLDataGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebDeploymentTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCAuxilaryManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out.unindent(); out << "</Configuration>\n"; // // tao // out << "<Configuration\n"; out.indent(); out << "Name=\"Debug_tao|Win32\"\n"; out << "OutputDirectory=\"Debug_tao\"\n"; out << "IntermediateDirectory=\"Debug_tao\"\n"; out << "ConfigurationType=\"2\"\n"; out << "CharacterSet=\"2\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCLCompilerTool\"\n"; out << "Optimization=\"0\"\n"; out << "AdditionalIncludeDirectories=\".;$(QEDO)/include;$(TAO)\"\n"; out << "PreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;SERVANTMODULE_EXPORTS;_QEDO_NO_QOS\"\n"; out << "MinimalRebuild=\"TRUE\"\n"; out << "BasicRuntimeChecks=\"3\"\n"; out << "RuntimeLibrary=\"3\"\n"; out << "RuntimeTypeInfo=\"TRUE\"\n"; out << "UsePrecompiledHeader=\"0\"\n"; out << "WarningLevel=\"3\"\n"; out << "Detect64BitPortabilityProblems=\"FALSE\"\n"; out << "DebugInformationFormat=\"4\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCLinkerTool\"\n"; out << "AdditionalDependencies=\"ComponentIDL.lib ComponentContainer.lib qedoutil.lib aced.lib TAOd.lib\"\n"; out << "OutputFile=\"$(OutDir)/" << project_name << ".dll\"\n"; out << "LinkIncremental=\"2\"\n"; out << "AdditionalLibraryDirectories=\"$(QEDO)/lib;$(ORBACUS)/lib\"\n"; out << "GenerateDebugInformation=\"TRUE\"\n"; out << "ProgramDatabaseFile=\"$(OutDir)/" << project_name << ".pdb\"\n"; out << "SubSystem=\"2\"\n"; out << "ImportLibrary=\"$(OutDir)/" << project_name << ".lib\"\n"; out << "TargetMachine=\"1\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCMIDLTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPostBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreBuildEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCPreLinkEventTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCResourceCompilerTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebServiceProxyGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCXMLDataGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCWebDeploymentTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out << "<Tool\n"; out.indent(); out << "Name=\"VCAuxilaryManagedWrapperGeneratorTool\"/>\n"; out.unindent(); out.unindent(); out << "</Configuration>\n"; out.unindent(); out << "</Configurations>\n"; // // files // out << "<Files>\n"; out.indent(); // // source files // out << "<Filter\n"; out.indent(); out << "Name=\"Source Files\"\n"; out << "Filter=\"cpp;c;cxx;def;odl;idl;hpj;bat;asm\">\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_SERVANT.cpp\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_EQUIVALENT.cpp\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_EQUIVALENT_skel.cpp\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_LOCAL.cpp\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_LOCAL_skel.cpp\">\n"; out.unindent(); out << "</File>\n"; out.unindent(); out << "</Filter>\n"; // // header files // out << "<Filter\n"; out.indent(); out << "Name=\"Header Files\"\n"; out << "Filter=\"h;hpp;hxx;hm;inl;inc\">\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_SERVANT.h\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_EQUIVALENT.h\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_EQUIVALENT_skel.h\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_LOCAL.h\">\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_LOCAL_skel.h\">\n"; out.unindent(); out << "</File>\n"; out.unindent(); out << "</Filter>\n"; // // idl files // out << "<Filter\n"; out.indent(); out << "Name=\"idl\"\n"; out << "Filter=\"idl;cidl\">\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"../" << target_file_name_ << "\">\n"; // orbacus out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_orbacus|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling CIDL\"\n"; out << "CommandLine=\"$(QEDO)/bin/cidl_gen -DORBACUS_ORB -DWIN32 -I$(QEDO)/idl -I$(ORBACUS)/idl "; out << "-I$(ORBACUS)/idl/OB --servant --target " << target_->id() << " ../" << target_file_name_ << "\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.idl;" << file_prefix_ << "_EQUIVALENT.idl\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // mico out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_mico|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling CIDL\"\n"; out << "CommandLine=\"$(QEDO)/bin/cidl_gen -DMICO_ORB -DMICO_CIDL_GEN -DWIN32 "; out << " -I$(QEDO)/idl -I$(QEDO)/include/mico -I$(QEDO)/include/mico/mico --servant --target " << target_->id() << " ../" << target_file_name_ << "\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.idl;" << file_prefix_ << "_EQUIVALENT.idl;" << file_prefix_ << "_SERVANT.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // tao out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_tao|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "CommandLine=\"$(QEDO)/bin/cidl_gen -DWIN32 -DTAO_ORB -I$(QEDO)/idl -I$(TAO)/idl "; out << "-I$(ORBACUS)/idl/OB --servant --target " << target_->id() << " ../" << target_file_name_ << "\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.idl;" << file_prefix_ << "_EQUIVALENT.idl;"; out << file_prefix_ << "_BUSINESS.idl\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_EQUIVALENT.idl\">\n"; // orbacus out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_orbacus|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling equivalent IDL\"\n"; out << "CommandLine=\"$(ORBACUS)/bin/idl -DORBACUS_ORB -DWIN32 -I$(QEDO)/idl -I$(ORBACUS)/idl "; out << "-I$(ORBACUS)/idl/OB " << file_prefix_ << "_EQUIVALENT.idl\"\n"; out << "Outputs=\"" << file_prefix_ << "_EQUIVALENT.h;" << file_prefix_ << "_EQUIVALENT.cpp;"; out << file_prefix_ << "_EQUIVALENT_skel.h;" << file_prefix_ << "_EQUIVALENT_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // mico out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_mico|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling equivalent IDL\"\n"; out << "CommandLine=\"$(QEDO)/bin/idl -DMICO_ORB -DWIN32 -B$(MICO) -I$(QEDO)/include/mico -I$(QEDO)/idl "; out << "--any --typecode --c++-skel --c++-suffix cpp --windows-dll "; out << file_prefix_ << " " << file_prefix_ << "_EQUIVALENT.idl\n"; out << "copy " << file_prefix_ << "_EQUIVALENT.h " << file_prefix_ << "_EQUIVALENT_skel.h\"\n"; out << "Outputs=\"" << file_prefix_ << "_EQUIVALENT.h;" << file_prefix_ << "_EQUIVALENT.cpp;"; out << file_prefix_ << "_EQUIVALENT_skel.h;" << file_prefix_ << "_EQUIVALENT_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // tao out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_tao|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "CommandLine=\"$(TAO)/bin/tao_idl -Sc -ss _skel.cpp -hs _skel.h -hc .h -cs .cpp -DTAO_ORB -DWIN32 -I$(QEDO)/idl "; out << "-I$(TAO)/idl " << file_prefix_ << "_EQUIVALENT.idl\"\n"; out << "Outputs=\"" << file_prefix_ << "_EQUIVALENT.h;" << file_prefix_ << "_EQUIVALENT.cpp;"; out << file_prefix_ << "_EQUIVALENT_skel.h;" << file_prefix_ << "_EQUIVALENT_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; out.unindent(); out << "</File>\n"; out << "<File\n"; out.indent(); out << "RelativePath=\"" << file_prefix_ << "_LOCAL.idl\">\n"; // orbacus out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_orbacus|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling local IDL\"\n"; out << "CommandLine=\"$(ORBACUS)/bin/idl -DORBACUS_ORB -DWIN32 -I$(QEDO)/idl -I$(ORBACUS)/idl "; out << "-I$(ORBACUS)/idl/OB " << file_prefix_ << "_LOCAL.idl\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.h;" << file_prefix_ << "_LOCAL.cpp;"; out << file_prefix_ << "_LOCAL_skel.h;" << file_prefix_ << "_LOCAL_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // mico out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_mico|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "Description=\"..... compiling local IDL\"\n"; out << "CommandLine=\"$(QEDO)/bin/idl -DMICO_ORB -DWIN32 -B$(MICO) -I$(QEDO)/include/mico -I$(QEDO)/idl "; out << "--any --typecode --c++-skel --c++-suffix cpp --windows-dll "; out << file_prefix_ << " " << file_prefix_ << "_LOCAL.idl\n"; out << "copy " << file_prefix_ << "_LOCAL.h " << file_prefix_ << "_LOCAL_skel.h\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.h;" << file_prefix_ << "_LOCAL.cpp;"; out << file_prefix_ << "_LOCAL_skel.h;" << file_prefix_ << "_LOCAL_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; // tao out << "<FileConfiguration\n"; out.indent(); out << "Name=\"Debug_tao|Win32\">\n"; out << "<Tool\n"; out.indent(); out << "Name=\"VCCustomBuildTool\"\n"; out << "CommandLine=\"$(ORBACUS)/bin/idl -DWIN32 -I$(QEDO)/idl -I$(ORBACUS)/idl "; out << "-I$(ORBACUS)/idl/OB " << file_prefix_ << "_LOCAL.idl\"\n"; out << "Outputs=\"" << file_prefix_ << "_LOCAL.h;" << file_prefix_ << "_LOCAL.cpp;"; out << file_prefix_ << "_LOCAL_skel.h;" << file_prefix_ << "_LOCAL_skel.cpp\"/>\n"; out.unindent(); out.unindent(); out << "</FileConfiguration>\n"; out.unindent(); out << "</File>\n"; out.unindent(); out << "</Filter>\n"; // // resource files // out << "<Filter\n"; out.indent(); out << "Name=\"Resource Files\"\n"; out << "Filter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\">\n"; out.unindent(); out << "</Filter>\n"; out.unindent(); out << "</Files>\n"; out << "<Globals>\n"; out << "</Globals>\n"; out.unindent(); out << "</VisualStudioProject>\n"; // // close servant file // out.close(); }
int main(int argc, char *argv[]) { FILE *fp; uuid_t *store, *uuid; char *p; int ch, count, i, iterate, c_struct; count = -1; /* no count yet */ fp = stdout; /* default output file */ iterate = 0; /* not one at a time */ c_struct = 0; /* not as a C structure */ while ((ch = getopt(argc, argv, "1n:o:s")) != -1) { switch (ch) { case '1': iterate = 1; break; case 'n': if (count > 0) usage(); count = strtol(optarg, &p, 10); if (*p != 0 || count < 1) usage(); break; case 'o': if (fp != stdout) errx(1, "multiple output files not allowed"); fp = fopen(optarg, "w"); if (fp == NULL) err(1, "fopen"); break; case 's': c_struct = 1; break; default: usage(); } } argv += optind; argc -= optind; if (argc) usage(); if (count == -1) count = 1; store = (uuid_t*)malloc(sizeof(uuid_t) * count); if (store == NULL) err(1, "malloc()"); if (!iterate) { /* Get them all in a single batch */ if (uuidgen(store, count) != 0) err(1, "uuidgen()"); } else { uuid = store; for (i = 0; i < count; i++) { if (uuidgen(uuid++, 1) != 0) err(1, "uuidgen()"); } } uuid = store; while (count--) { uuid_to_string(uuid++, &p, NULL); if (c_struct) { fprintf(fp, "= { /* %s */\n", p); /* } */ /* * Chunk up the string for processing: * * aaaaaaaa-bbbb-cccc-dddd-0123456789ab * * We output it like so: * * = { \/\* aaaaaaaa-bbbb-cccc-ddee-0123456789ab \*\/ * 0xaaaaaaaa, * 0xbbbb, * 0xcccc, * 0xdd, * 0xee, * { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab } * }; */ p[8] = '\0'; /* aaaaaaaa */ p[13] = '\0'; /* bbbb */ p[18] = '\0'; /* cccc */ p[23] = '\0'; /* dddd */ fprintf(fp, "\t0x%s,\n", p); fprintf(fp, "\t0x%s,\n", &p[9]); fprintf(fp, "\t0x%s,\n", &p[14]); fprintf(fp, "\t0x%c%c,\n", p[19], p[20]); fprintf(fp, "\t0x%c%c,\n", p[21], p[22]); fprintf(fp, "\t{ 0x%c%c, 0x%c%c, 0x%c%c, 0x%c%c, " "0x%c%c, 0x%c%c }\n", p[24], p[25], p[26], p[27], p[28], p[29], p[30], p[31], p[32], p[33], p[34], p[35]); /* { */ fprintf(fp, "};\n"); } else fprintf(fp, "%s\n", p); free(p); } free(store); if (fp != stdout) fclose(fp); return (0); }