From: [email protected] Subject: Re: Absolute Newbie Newsgroups: comp.object.corba Date: Wed, 10 Feb 1999 18:05:20 GMT [email protected] (Bill Janssen) writes: > > I wonder if there's a version of the UNIX `patch' utility for > Windows There is! I'm sure it is available from several places, we got it as part of the CVS package. Version 1.10 of CVS for Windows can be downloaded from: http://download.cyclic.com/pub/cvs-1.10/windows/cvs-1.10-win.zip To use patch.exe you also need win32gnu.dll which comes in the same zip file. Joachim
% cd /usr/local/ilu/src % patch -p0 < /usr/local/ilu/src/this-patch [...various output from the patch program...] %
*** 1.28 1999/08/03 01:55:50 --- runtime/cpp2/iluobject.cpp 1999/10/19 00:19:25 *************** *** 196,202 **** ILUCPP_BOOL b_parse_result; ilu_string p_mstid = NULL; ! iluClass objects_class; iluKernelObject kernelobject; iluObject* p_ilu_object; iluError an_error; --- 196,202 ---- ILUCPP_BOOL b_parse_result; ilu_string p_mstid = NULL; ! iluClass objects_class, better_class; iluKernelObject kernelobject; iluObject* p_ilu_object; iluError an_error; *************** *** 212,224 **** if (!b_parse_result) return NULL; ! ! // get the iluClass of this object ! objects_class = ilu_FindClassFromID(p_mstid); ! iluCppRuntime::iluFree(p_mstid); ! if (!objects_class) ! return NULL; ! // get a kernel object based on this sbh and class kernelobject = ilu_ObjectOfSBH (pc_string_binding_handle, objects_class, &an_error); if (ILU_ERRNOK(an_error)) { --- 212,229 ---- if (!b_parse_result) return NULL; ! ! if (!p_mstid) { ! objects_class = ilu_rootClass; ! } ! else { ! // get the iluClass of this object ! objects_class = ilu_FindClassFromID(p_mstid); ! iluCppRuntime::iluFree(p_mstid); ! if (!objects_class) ! return NULL; ! } ! // get a kernel object based on this sbh and class kernelobject = ilu_ObjectOfSBH (pc_string_binding_handle, objects_class, &an_error); if (ILU_ERRNOK(an_error)) { *************** *** 235,243 **** ILUCPP_DEBUG3("iluObject::iluStringToObject found lso %p for kernel object %p\n", p_ilu_object, kernelobject); ! if (p_ilu_object == NULL) ! // we didn't find an object already present for this, so create a new surrogate ! p_ilu_object = iluCppInternal::iluCreateSurrogate(objects_class, kernelobject); // exit the object's server ilu_ExitServer(ilu_ServerOfObject(kernelobject), objects_class); --- 240,253 ---- ILUCPP_DEBUG3("iluObject::iluStringToObject found lso %p for kernel object %p\n", p_ilu_object, kernelobject); ! if (p_ilu_object == NULL) { ! // we didn't find an object already present for this, so create a new surrogate ! if (p_mstid == NULL) ! better_class = ilu_ClassOfObject(kernelobject); ! else ! better_class = objects_class; ! p_ilu_object = iluCppInternal::iluCreateSurrogate(better_class, kernelobject); ! } // exit the object's server ilu_ExitServer(ilu_ServerOfObject(kernelobject), objects_class);
*** 1.24 1999/09/10 10:42:50 --- stubbers/genstub/generate.c 1999/09/27 21:30:30 *************** *** 40,49 **** int typedesc_index; } StructCorr; ! #define SIZE_TNV 30000 typedef struct { void *stub_ctl; /* for comm with stubber */ char *tree_node_vector; /* for failed instances */ int current_set_node; int last_search_node; Rule *current_rule; /* for error messages */ --- 40,52 ---- int typedesc_index; } StructCorr; ! #define INIT_SIZE_TNV 20000 ! #define INC_SIZE_TNV 10000 ! typedef struct { void *stub_ctl; /* for comm with stubber */ char *tree_node_vector; /* for failed instances */ + int current_size_tnv; int current_set_node; int last_search_node; Rule *current_rule; /* for error messages */ *************** *** 1242,1248 **** Instance call_args; int in_repeat, has_disj, found, current_eq, next_eq; ! int first_rpt_level, first_disj_level, last_repeat_failed; CExp *p_constr; RuleNode *p_target; GenTree *category_subtree, *next_result_chain, *this_result_chain; --- 1245,1251 ---- Instance call_args; int in_repeat, has_disj, found, current_eq, next_eq; ! int first_rpt_level, first_disj_level; CExp *p_constr; RuleNode *p_target; GenTree *category_subtree, *next_result_chain, *this_result_chain; *************** *** 1251,1256 **** --- 1254,1260 ---- Ref repeat_ref, index_ref; Instance temps, temps1; int ri, has_index_ref, di /* debugging*/; + char *temp_tnv; in_repeat = 0; has_disj = 0; *************** *** 1285,1291 **** } first_rpt_level = 1; - last_repeat_failed = 0; for( ri=0 ; (first_rpt_level && !in_repeat) || repeat_list_elem != NULL; ri++, --- 1289,1294 ---- *************** *** 1303,1309 **** lclmemcpy(ruleinst->properties[1], &temps, sizeof(Instance)); lclmemcpy(&temps1, ruleinst->properties[1], sizeof(Instance)); - last_repeat_failed = 0; for ( di = 0 ; (first_disj_level && !has_disj) || current_eq != 0; --- 1306,1311 ---- *************** *** 1321,1327 **** /* for data currency.. recapture why two variables */ ctl->last_search_node++; ctl->current_set_node = ctl->last_search_node; ! assert(ctl->current_set_node < SIZE_TNV); lclmemcpy(ruleinst->properties[1], &temps1, sizeof(Instance)); /* update local inst set node */ --- 1323,1339 ---- /* for data currency.. recapture why two variables */ ctl->last_search_node++; ctl->current_set_node = ctl->last_search_node; ! if(ctl->current_set_node >= ctl->current_size_tnv-10) { ! /* reallocate tree node vector */ ! temp_tnv= ctl->tree_node_vector; ! ctl ->tree_node_vector = ! (void *)calloc( (ctl->current_size_tnv) + INC_SIZE_TNV, ! sizeof(char)); ! memcpy((void *)ctl->tree_node_vector, (void *)temp_tnv, ! sizeof(char) * ctl->current_size_tnv); ! ctl->current_size_tnv = ctl->current_size_tnv + INC_SIZE_TNV; ! free(temp_tnv); ! } lclmemcpy(ruleinst->properties[1], &temps1, sizeof(Instance)); /* update local inst set node */ *************** *** 1387,1395 **** } } /* end of disjunction loop */ - if(!found) - last_repeat_failed = 1; - if(!in_repeat) break; } /* end of repeat edge loop */ --- 1399,1404 ---- *************** *** 1741,1747 **** ctl = (void *)calloc(1,sizeof(GCtl)); ctl->stub_ctl = stub_ctl; ! ctl ->tree_node_vector = (void *)calloc(SIZE_TNV, sizeof(char)); /* ?? */ ctl->current_set_node = 0; --- 1750,1757 ---- ctl = (void *)calloc(1,sizeof(GCtl)); ctl->stub_ctl = stub_ctl; ! ctl ->tree_node_vector = (void *)calloc(INIT_SIZE_TNV, sizeof(char)); ! ctl ->current_size_tnv - INIT_SIZE_TNV; /* ?? */ ctl->current_set_node = 0;
*** 1.58 1999/09/14 19:15:22 --- stubbers/cpp2/cpp.cpp.rules 1999/10/19 00:03:59 *************** *** 4193,4199 **** super.name != "CORBA_Object" ] L_narrow_corba: super1 in object.superclasses: (cpfx) ! [ super1.name != "CORBA_Object"] L_narrow_end() --- 4193,4199 ---- super.name != "CORBA_Object" ] L_narrow_corba: super1 in object.superclasses: (cpfx) ! [ super1.name == "CORBA_Object"] L_narrow_end()
*** 1.5 1999/09/10 10:42:50 --- stubbers/genstub/typesort.c 1999/10/20 20:56:32 *************** *** 334,339 **** --- 334,340 ---- } } l1 = t->description->structuredDes.object->methods; + if(l1 == NULL) break; for(ptr = l1->head; ptr; ptr=ptr->next) { l2 = ((Procedure)(ptr->data))->arguments; if(l2 != NULL) { *************** *** 567,573 **** Module m; if (module->contained_exceptions != NULL && ! module->contained_types->head != NULL){ for(ptr = module->contained_exceptions->head; ptr; ptr = ptr->next) { /* exception deps only used when outside module */ get_exc_deps((Exception)(ptr->data), local_deps); --- 568,574 ---- Module m; if (module->contained_exceptions != NULL && ! module->contained_exceptions->head != NULL){ for(ptr = module->contained_exceptions->head; ptr; ptr = ptr->next) { /* exception deps only used when outside module */ get_exc_deps((Exception)(ptr->data), local_deps); *************** *** 639,644 **** --- 640,646 ---- marked_ct = 0; first = 1; + global_did_something = 0; while(1) { did_something = 0;
*** 1.22 1999/08/03 04:19:06 --- stubbers/genstub/convert.c 1999/10/20 20:56:32 *************** *** 935,940 **** --- 935,941 ---- Instance *new, *e1; int exists; + list the_scoping; new = new_generic_instance(ctl, e, &exists); if(exists) return new; *************** *** 942,952 **** get_ST_nontypename_and_index(ctl, exception_NonType, &new->typename, &new->typeindex); put_scoped_name_fields(ctl, new, "name", "flat_name", "isl_name", ! name_base_name(e->name), e->scoping); put_field(ctl, new, "ilup_ref", e); put_field(ctl, new, "scoping", ! cvt_list(ctl, e->scoping, (cvt_EnumProc)cvt_name_mbr)); put_field(ctl, new, "type", cvt_type(ctl, e->type)); put_field(ctl, new, "valueoptional", e->valueOptional); put_field(ctl, new, "builtin", e->builtIn); --- 943,960 ---- get_ST_nontypename_and_index(ctl, exception_NonType, &new->typename, &new->typeindex); + if( ( e->scoping == NULL || e->scoping->head == NULL) && + e->import != NULL && + e->importInterfaceName != NULL && + (strcmp(e->importInterfaceName, "ilu"))) + the_scoping = e->import->scoping; + else the_scoping = e->scoping; + put_scoped_name_fields(ctl, new, "name", "flat_name", "isl_name", ! name_base_name(e->name), the_scoping); put_field(ctl, new, "ilup_ref", e); put_field(ctl, new, "scoping", ! cvt_list(ctl, the_scoping, (cvt_EnumProc)cvt_name_mbr)); put_field(ctl, new, "type", cvt_type(ctl, e->type)); put_field(ctl, new, "valueoptional", e->valueOptional); put_field(ctl, new, "builtin", e->builtIn); *************** *** 1253,1258 **** --- 1261,1267 ---- TypeKind fundamental_kind; Instance *new; int exists; + list the_scoping; #ifdef DEBUG printf("\ncvt type %p", t); *************** *** 1278,1290 **** new->storetype = storedata; ! /*TBD.. something about cached descriptions */ put_scoped_name_fields(ctl, new, "name", "flat_name", "isl_name", name_base_name(t->name), t->scoping); put_field(ctl, new, "supertype", cvt_type(ctl, t->supertype)); put_field(ctl, new, "scoping", ! cvt_list(ctl, t->scoping, (cvt_EnumProc)cvt_name_mbr)); put_field(ctl, new, "builtin", t->builtIn); put_field(ctl, new, "importedfromname", t->importInterfaceName); put_field(ctl, new, "typeininterface", --- 1287,1305 ---- new->storetype = storedata; ! if( ( t->scoping == NULL || t->scoping->head == NULL) && ! t->supertype != NULL && ! t->importInterfaceName != NULL && ! (strcmp(t->importInterfaceName, "ilu"))) ! the_scoping = t->supertype->scoping; ! else the_scoping = t->scoping; ! put_scoped_name_fields(ctl, new, "name", "flat_name", "isl_name", name_base_name(t->name), t->scoping); put_field(ctl, new, "supertype", cvt_type(ctl, t->supertype)); put_field(ctl, new, "scoping", ! cvt_list(ctl, the_scoping, (cvt_EnumProc)cvt_name_mbr)); put_field(ctl, new, "builtin", t->builtIn); put_field(ctl, new, "importedfromname", t->importInterfaceName); put_field(ctl, new, "typeininterface",
*** 1.16 1999/08/02 06:24:11 --- stubbers/genstub/modules.c 1999/10/23 00:03:36 *************** *** 33,40 **** static Module new_module(char *name, Module parent) { Module module; module = calloc(1, sizeof(struct ilu_module_s)); ! module->simple_name = name; module->containing_module = parent; return (module); } --- 33,49 ---- static Module new_module(char *name, Module parent) { Module module; + char *cloc; + module = calloc(1, sizeof(struct ilu_module_s)); ! /* use corba names as module names (no hyphens) */ ! /* not clear this will always work */ ! module->simple_name = (void *)malloc(strlen(name) +2); ! strcpy(module->simple_name, name); ! while(strchr(module->simple_name, '-') != NULL) { ! cloc = strchr(module->simple_name, '-'); ! *cloc = '_'; ! } module->containing_module = parent; return (module); } *************** *** 137,142 **** --- 146,152 ---- /* first name must be interface name, and must match current */ this_scope_elem = scoping->head; + assert(!strcmp(first_module->simple_name, (char *)(this_scope_elem->data)));
*** 1.40 1999/09/14 10:22:21 --- stubbers/cpp2/cpp2-gen.c 1999/10/23 00:20:28 *************** *** 747,753 **** Instance *m, Instance *t, char *sfx) { char *cname; list m_scoping, t_scoping; ! listElement *t_pt; Type type, urtype; type = (Type)get_any_property_value(ctl, t, "ilup_ref"); --- 747,753 ---- Instance *m, Instance *t, char *sfx) { char *cname; list m_scoping, t_scoping; ! listElement *t_pt, *t_pt1; Type type, urtype; type = (Type)get_any_property_value(ctl, t, "ilup_ref"); *************** *** 780,795 **** t_scoping = (list)get_any_property_value(ctl, t, "scoping"); ! if(m == NULL || !( sctl->use_cpp_namespace || ! sctl->use_cpp_classes) ) return (concat_instance_namelist(ctl, sctl, t_scoping->head, sfx, 0, 0, 0)); m_scoping = (list)get_any_property_value(ctl, m, "scoping"); /* get pt at which t_scoping diverges from m_scoping */ t_pt = get_scope_diverge_pt(ctl, t_scoping, m_scoping); ! return(concat_instance_namelist(ctl, sctl, t_pt, sfx, 0, 0,0)); } char *F_full_rel_typeref(void *ctl, SCtl *sctl, Instance *t, char *sfx) { --- 780,809 ---- t_scoping = (list)get_any_property_value(ctl, t, "scoping"); ! if(m == NULL) { return (concat_instance_namelist(ctl, sctl, t_scoping->head, sfx, 0, 0, 0)); + } m_scoping = (list)get_any_property_value(ctl, m, "scoping"); /* get pt at which t_scoping diverges from m_scoping */ t_pt = get_scope_diverge_pt(ctl, t_scoping, m_scoping); ! ! /* if underscore mapping, see if diverge pt not at beginning */ ! /* and t_scoping contains real class, not at end */ ! if( (t_pt != t_scoping->head) && ! !( sctl->use_cpp_namespace || sctl->use_cpp_classes) ) { ! for(t_pt1 = t_scoping->head; t_pt1; t_pt1 = t_pt1->next) { ! if(get_int_property_value( ! ctl,(Instance*)(t_pt1->data),"is_real_class") == 1) break; ! } ! if(t_pt1 == NULL || t_pt1->next == NULL) ! return (concat_instance_namelist(ctl, sctl, ! t_scoping->head, sfx, 0, 0, 0)); ! } ! ! return(concat_instance_namelist(ctl, sctl, t_pt, sfx, 0, 0,0)); } char *F_full_rel_typeref(void *ctl, SCtl *sctl, Instance *t, char *sfx) { *************** *** 800,808 **** /* For non types */ char *F_full_ref(void *ctl, SCtl *sctl, Instance *t) { list l; - Type type; - - type = (Type)get_any_property_value(ctl, t, "ilup_ref"); l= (list)get_any_property_value(ctl, t , "scoping"); return(concat_instance_namelist(ctl, sctl, l->head, "", 0, 0,0)); --- 814,819 ----
*** 1.3 1999/08/16 17:17:48 --- stubbers/idl/idl2isl.c 1999/10/22 23:55:04 *************** *** 426,431 **** --- 426,432 ---- new->constants=(set)iluparser_new_list(); new->brand=NULL; new->def=0; + new->module_structure = NULL; } if(d->u.module.definitions) list_enumerate(d->u.module.definitions,definition_makeisl,d);
*** 1.59 1999/10/18 16:17:26 --- stubbers/cpp2/cpp.cpp.rules 1999/10/26 18:41:25 *************** *** 104,111 **** =========================================================== R_initialize(Interface i) ! (Exception e, Exception e1, eu, ex_uid, e_intf, ! Object o, us_ex_name,extpfx, mname, mpfx, b, brand) --> E_ [extpfx = F_full_prefix(i.module_str, 1) mname = i.module_str.simple_name --- 104,110 ---- =========================================================== R_initialize(Interface i) ! (Exception e, Object o, extpfx, mname, mpfx, b, brand) --> E_ [extpfx = F_full_prefix(i.module_str, 1) mname = i.module_str.simple_name *************** *** 120,141 **** L_init (i.name, extpfx, mpfx) ! { { E_ [i.exceptions != NULL] ! L_except_comment(i.name) ! L_def_except :e in i.exceptions: ! (e_intf, F_underscore_name(e1), F_reg_name(e1), ex_uid) ! [ ! [[ e.importedfrom != NULL e1 = e.importedexception ] | e1 = e ] ! [[ e1.type == NULL ! ex_uid = "REINTERPRET_CAST(iluCString, ((ILUCPP_NULL_PTR) 0))" ] ! | ! [ eu = F_concat( "CONST_CAST(iluCString, \"", e1.type.uid) ! ex_uid = F_concat(eu, "\")")] ! ] ! e_intf = e1.interface.isl_name ! ] ! ! } | TRUE } { { E_ [i.classes != NULL] L_object_comment(i.name) --- 119,129 ---- L_init (i.name, extpfx, mpfx) ! {{ E_ [i.exceptions != NULL] ! L_except_comment(i.name) ! R_def_except :e in i.exceptions: (e) ! } ! | TRUE} { { E_ [i.classes != NULL] L_object_comment(i.name) *************** *** 148,153 **** --- 136,160 ---- L_end_init(mpfx) . + R_def_except(Exception e) (Exception e1, us_ex_name, eu, ex_uid) --> + + E_ [ [ [ e.importedfrom != NULL e1 = e.importedexception ] | e1 = e ] + us_ex_name = F_underscore_name(e1) + [[ e1.type == NULL + ex_uid = "REINTERPRET_CAST(iluCString, ((ILUCPP_NULL_PTR) 0))" ] + | + [ eu = F_concat( "CONST_CAST(iluCString, \"", e1.type.uid) + ex_uid = F_concat(eu, "\")")] ] + ] + + { + L_def_except (e1.interface.isl_name, us_ex_name, F_reg_name(e1), ex_uid) + [ e1.corba_rep_id == NULL] + | L_def_corba_except(us_ex_name, e1.corba_rep_id, ex_uid) + } + } + + L_init(intf, extpfx, mpfx) --> ////////////////////////////////////////////////////////////////////// *************** *** 174,179 **** --- 181,195 ---- CONST_CAST( iluCString, \"%ename_in_intf%\"), %exc_uid%); . + L_def_corba_except(us_ex_name, corba_name, exc_uid) --> + + interface_exceptions[g_%us_ex_name%_index] = + iluCppInternal::iluDefineException( + REINTERPRET_CAST(iluCString, ((ILUCPP_NULL_PTR) 0)), + CONST_CAST( iluCString, \"%corba_name%\"), + %exc_uid%); + . + L_object_comment(intf) -->
*** 1.45 1999/09/14 10:17:20 --- stubbers/cpp2/cpp.hpp.rules 1999/10/29 02:04:27 *************** *** 1493,1504 **** L_obj_continue1(cpfx, oname) # if name CORBA_Object narrow code already emitted ! L_obj_narrow:supertype1 in object.superclasses: (oname, stname1) ! [ stname1 = F_rel_typeref(m, supertype1,"") ! supertype1.name != "CORBA_Object" ] L_obj_continue2(oname) . #uses the base type for optional instead of optional #because don't have relative reference for const --- 1493,1511 ---- L_obj_continue1(cpfx, oname) # if name CORBA_Object narrow code already emitted ! R_obj_narrow:supertype1 in object.superclasses: (m, oname, supertype1) ! [ supertype1.name != "CORBA_Object" ] ! L_obj_continue2(oname) . + R_obj_narrow (Module m, oname, Object object) (Any supertype) --> + + L_obj_narrow (oname, F_rel_typeref(m, object,"")) + + R_obj_narrow: supertype in object.superclasses:(m, oname, supertype) + [ supertype.name != "CORBA_Object" ] + . #uses the base type for optional instead of optional #because don't have relative reference for const
*** 1.60 1999/10/27 03:26:23 --- stubbers/cpp2/cpp.cpp.rules 1999/10/29 02:04:18 *************** *** 4204,4212 **** L_narrow_begin (ext_obj_name, cpfx) ! L_narrow_super: super in object.superclasses: (ext_super) ! [ ext_super = F_full_typeref(super) ! super.name != "CORBA_Object" ] L_narrow_corba: super1 in object.superclasses: (cpfx) [ super1.name == "CORBA_Object"] --- 4204,4211 ---- L_narrow_begin (ext_obj_name, cpfx) ! R_narrow_super: super in object.superclasses: (super, cpfx) ! [ super.name != "CORBA_Object" ] L_narrow_corba: super1 in object.superclasses: (cpfx) [ super1.name == "CORBA_Object"] *************** *** 4262,4267 **** --- 4261,4278 ---- L_object_any_insert_extract(ext_obj_name, object.name, cpfx, extpfx) . + # iterative + R_narrow_super(Object object, cpfx) (Any super, Any super1) --> + + L_narrow_super(F_full_typeref(object)) + + R_narrow_super: super in object.superclasses: (super, cpfx) + [ super.name != "CORBA_Object" ] + + L_narrow_corba: super1 in object.superclasses: (cpfx) + [ super1.name == "CORBA_Object"] + . + # cacheable == functional? R_method (Method method, Int mi) (Int method_id, cacheable, asynch, Int exception_ct,Int arg_ct, *************** *** 4352,4364 **** . L_narrow_begin (ext_obj, cpfx) --> // for use in narrowing void *%ext_obj%::iluDowncast (iluClass class_to_cast_down_to) { if (!class_to_cast_down_to || class_to_cast_down_to == ilu_rootClass) return((void *)((iluObject*) this)); - // if %ext_obj% were a CORBA::Object type too, we'd also need - //if (class_to_cast_down_to == %cpfx%Object::iluGetILUClassRecord()) - // return((void *)((%cpfx%Object_ptr)) this)); . L_narrow_super( ext_super) --> --- 4363,4373 ---- . L_narrow_begin (ext_obj, cpfx) --> + // for use in narrowing void *%ext_obj%::iluDowncast (iluClass class_to_cast_down_to) { if (!class_to_cast_down_to || class_to_cast_down_to == ilu_rootClass) return((void *)((iluObject*) this)); . L_narrow_super( ext_super) -->
*** 1.6 1999/10/20 07:04:12 --- stubbers/genstub/typesort.c 2000/01/13 20:28:49 *************** *** 772,778 **** } /* now condense dep list and see if anything left */ ! if(global_did_something == 0) return dep_list; new_dep_list = new_list(); --- 772,779 ---- } /* now condense dep list and see if anything left */ ! if( (global_did_something == 0) && marked_ct < list_size(dep_list)) ! return dep_list; new_dep_list = new_list();
*** 1.236 1999/09/09 17:45:27 --- runtime/kernel/iiop.c 2000/02/16 01:10:29 *************** *** 1333,1345 **** else { char *sbh = ilu_SBHOfObject(obj); ilu_ProtocolInfo pinfo = NIL; ilu_TransportInfo tinfo = NIL; ilu_boolean owned; if (sbh == NIL || object_class(obj) == NIL) return ILU_ERR_CONS1(internal, &err, minor, ilu_im_broken, err); ! myior.ior.type_id = _ilu_Strdup(ilu_MstidOfObject(obj)); if (ILU_ERRNOK(err)) return err; if (strncmp(object_ih(obj), CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) != 0) { --- 1333,1349 ---- else { char *sbh = ilu_SBHOfObject(obj); + char * mstid = ilu_MstidOfObject(obj); ilu_ProtocolInfo pinfo = NIL; ilu_TransportInfo tinfo = NIL; ilu_boolean owned; if (sbh == NIL || object_class(obj) == NIL) return ILU_ERR_CONS1(internal, &err, minor, ilu_im_broken, err); ! if (strcmp(mstid, CORBA_OBJECT_TYPE_ID) == 0) ! myior.ior.type_id = _ilu_Strdup(""); ! else ! myior.ior.type_id = _ilu_Strdup(mstid); if (ILU_ERRNOK(err)) return err; if (strncmp(object_ih(obj), CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) != 0) { *************** *** 1428,1434 **** if (sbh == NIL) return ILU_ERR_CONS1(internal, &err, minor, ilu_im_broken, err); ! myior.ior.type_id = ilu_StrdupE(mstid, &err); if (ILU_ERRNOK(err)) return err; if (strncmp(ih, CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) != 0) { --- 1432,1441 ---- if (sbh == NIL) return ILU_ERR_CONS1(internal, &err, minor, ilu_im_broken, err); ! if (strcmp(mstid, CORBA_OBJECT_TYPE_ID) == 0) ! myior.ior.type_id = ilu_StrdupE("", &err); ! else ! myior.ior.type_id = ilu_StrdupE(mstid, &err); if (ILU_ERRNOK(err)) return err; if (strncmp(ih, CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) != 0) { *************** *** 2553,2559 **** n = ilu_MallocE(sizeof(*n) + (count * sizeof(NameComponent_s)), err); if (ILU_ERRNOK(*err)) return NIL; n->nnames = count; ! n->names = (NameComponent_s *) (((char *) n) + sizeof(NameList)); for (i = 0; i < n->nnames; i++) { n->names[i].id = NIL; n->names[i].kind = NIL; --- 2560,2566 ---- n = ilu_MallocE(sizeof(*n) + (count * sizeof(NameComponent_s)), err); if (ILU_ERRNOK(*err)) return NIL; n->nnames = count; ! n->names = (NameComponent_s *) (((char *) n) + sizeof(*n)); for (i = 0; i < n->nnames; i++) { n->names[i].id = NIL; n->names[i].kind = NIL; *************** *** 3116,3121 **** --- 3123,3129 ---- /* call resolve on the name service */ user_obj = CosNamingResolve (ns_obj, namelist, errout, err); if (ILU_ERRNOK(*err)) goto errout2; + if (errout->whicherr != ilu_rine_Success) goto errout2; /* free up the ns_obj, and the namelist */ if (object_server(user_obj) != object_server(ns_obj)) *************** *** 4759,4765 **** if (discriminator_p) { ! if (s->key != NIL) { ostr = s->key; ostr_len = s->keylen; } else { --- 4767,4773 ---- if (discriminator_p) { ! if ((s->key != NIL) && (strncmp(object_ih(h), CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) == 0)) { ostr = s->key; ostr_len = s->keylen; } else {
*** 1.239 2000/02/16 01:10:14 --- runtime/kernel/iiop.c 2000/02/17 00:23:11 *************** *** 2414,2419 **** --- 2414,2602 ---- return ilu_FALSE; } + ilu_boolean _ilu_IIOP_ParseCORBALoc (ilu_string corbaloc, ilu_string *ih, ilu_string *sid, + ilu_string *mstid, ilu_string *cinfo, ilu_cardinal *cinfolen, + ilu_boolean *pass_cinfo, ilu_Error *err) + { + /* Parse new INS-style URL: + * + * corbaloc::[:][,]/ + */ + + char *p; + char *decoded_key = NIL; + char protocol_token[64]; + char addresses[1024]; + char object_key[1024]; + char sid_hostname[1024]; + unsigned int sid_port, key_len; + unsigned int sid_major, sid_minor; + + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: loc is <%s>\n", corbaloc)); + if (strncmp(corbaloc, "corbaloc:", 9) == 0) + p = corbaloc + 9; + else + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, ilu_FALSE); + + if (sscanf(p, "%1023[^/]/%1023s", &addresses, object_key) != 2) + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, ilu_FALSE); + else if ((strlen(addresses) < 1) || (strlen(object_key) < 1)) + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, ilu_FALSE); + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: addresses are <%s>, key is <%s>\n", + addresses, object_key)); + decoded_key = _ilu_DecodeBuffer(object_key, strlen(object_key), &key_len, err); + if (ILU_ERRNOK(*err)) return ilu_FALSE; + if (strcmp(decoded_key, "ilu") == 0) /* ILU object */ + { + /* We have an ILU object, go ahead and transform it */ + + ilu_cardinal comma_count = strcharcount(addresses, ',') + 1; + + if (mstid != NIL) + *mstid = _ilu_Strdup(decoded_key + 4); + if (sid != NIL) + *sid = _ilu_Strdup(decoded_key + 4 + strlen(decoded_key + 4) + 1); + if (ih != NIL) + *ih = _ilu_Strdup(decoded_key + 4 + strlen(decoded_key + 4) + 1 + strlen(decoded_key + 4 + strlen(decoded_key + 4) + 1) + 1); + if (cinfo != NIL) + { + static char cinfodivider[2] = { ILU_CINFO_DIVIDER, 0 }; + static char cinfomarker[2] = { ILU_CINFO_MARKER, 0 }; + char pinfobuf[1024]; + char tinfobuf[1024]; + char hostname[1024]; + int port; + int major_version, minor_version; + char *pinfo; + char *addr_ptr = addresses; + char *comma; + *cinfo = NULL; + if (ILU_ERRNOK(*err)) goto errout; + /* we'll just do one address, though we could build a multi-part cinfo + which has all the addresses listed in "address" */ + comma = strchr(addr_ptr, ','); + if (comma) *comma = 0; + major_version = 1; + minor_version = 0; + port = 9999; + if ((sscanf (addr_ptr, "%u.%u@%1024[^:]:%u", &major_version, &minor_version, hostname, &port) != 4) && + (sscanf (addr_ptr, "%u.%u@%1024[^:]", &major_version, &minor_version, hostname) != 3) && + (sscanf (addr_ptr, "%1024[^:]:%u", hostname, &port) != 2) && + (sscanf (addr_ptr, "%1024[^:]", hostname) != 1)) { + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: bad cinfo in URL <%s>\n", corbaloc)); + ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ci, ilu_FALSE); + goto errout; + }; + sprintf (pinfobuf, "iiop_%u_%u_1@tcp_%s_%lu", major_version, minor_version, + hostname, port); + *cinfo = ilu_StrdupE(pinfobuf, err); + if (ILU_ERRNOK(*err)) goto errout; + if (cinfolen != NIL) + *cinfolen = strlen(*cinfo); + *pass_cinfo = ilu_TRUE; + } + else if (pass_cinfo != NIL) + *pass_cinfo = ilu_FALSE; + ilu_free(decoded_key); + return ilu_TRUE; + } + else + { + ilu_cardinal comma_count = strcharcount(addresses, ',') + 1; + + if (ih != NIL) { + *ih = _ilu_Strcat3(CORBA_NATIVE_OBJECT_IH_PREFIX, object_key, NIL); + if (*ih == NIL) { + ILU_ERR_CONS1(no_memory, err, nbytes, strlen(object_key) + SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX + 1, ilu_FALSE); + goto errout; + }; + }; + if (mstid != NIL) { + *mstid = NIL; + }; + if (cinfo != NIL) + { + static char cinfodivider[2] = { ILU_CINFO_DIVIDER, 0 }; + static char cinfomarker[2] = { ILU_CINFO_MARKER, 0 }; + char pinfobuf[1024]; + char tinfobuf[1024]; + char hostname[1024]; + int port; + int major_version, minor_version; + char *pinfo; + char *addr_ptr; + char *comma; + *cinfo = NULL; + if (ILU_ERRNOK(*err)) goto errout; + for (addr_ptr = addresses; comma_count > 0; comma_count--) { + comma = strchr(addr_ptr, ','); + if (comma) *comma = 0; + major_version = 1; + minor_version = 0; + port = 9999; + if (*addr_ptr == ':') /* default IIOP protocol */ + addr_ptr += 1; + else if (strncmp(addr_ptr, "iiop:", 5) == 0) + addr_ptr += 5; + else { + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: bad cinfo segment <%s> in URL <%s>\n", addr_ptr, corbaloc)); + ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ci, ilu_FALSE); + goto errout; + } + if ((sscanf (addr_ptr, "%u.%u@%1024[^:]:%u", &major_version, &minor_version, hostname, &port) != 4) && + (sscanf (addr_ptr, "%u.%u@%1024[^:]", &major_version, &minor_version, hostname) != 3) && + ((major_version = 1, minor_version = 0, sscanf (addr_ptr, "%1024[^:]:%u", hostname, &port)) != 2) && + (sscanf (addr_ptr, "%1024[^:]", hostname) != 1)) { + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: bad cinfo segment <%s> in URL <%s>\n", addr_ptr, corbaloc)); + ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ci, ilu_FALSE); + goto errout; + }; + if (sid != NIL) { + strcpy (sid_hostname, hostname); + sid_port = port; + sid_major = major_version; + sid_minor = minor_version; + }; + ILU_NOTE(IIOP_DEBUG, + ("_ilu_IIOP_ParseCORBALoc: cinfo: IIOP %u.%u at %s:%u\n", + major_version, minor_version, hostname, port)); + sprintf (pinfobuf, "iiop_%u_%u_1_%s", major_version, minor_version, object_key); + pinfo = _ilu_EncodeBuffer(pinfobuf, strlen(pinfobuf), err); + sprintf (tinfobuf, "tcp_%s_%lu", hostname, ((unsigned long) port) & 0xFFFF); + if (*cinfo) + *cinfo = _ilu_Strcat5 (*cinfo, cinfomarker, pinfo, cinfodivider, tinfobuf); + else + *cinfo = _ilu_Strcat3(pinfo, cinfodivider, tinfobuf); + if (ILU_ERRNOK(*err)) goto errout; + if (cinfolen != NIL) + *cinfolen = strlen(*cinfo); + *pass_cinfo = ilu_TRUE; + if (comma) addr_ptr = comma + 1; + } + } + else if (pass_cinfo != NIL) + *pass_cinfo = ilu_FALSE; + if (sid != NIL) { + *sid = ilu_IIOP_ServerIDFromObjectKey((ilu_bytes) decoded_key, key_len, + sid_hostname, sid_port, + sid_major, sid_minor, err); + if (ILU_ERRNOK(*err)) + goto errout; + }; + ilu_free(decoded_key); + return ilu_TRUE; + } + errout: + if (decoded_key != NIL) + ilu_free(decoded_key); + return ilu_FALSE; + } + typedef struct NameComponent_s { char * id; char * kind; *************** *** 2466,2471 **** --- 2649,2666 ---- return NIL; } + static void RemoveComponentQuoting (char *buffer) + { + register char *q, *p; + q = buffer; p = buffer; + while (*p != 0) { + if (*p != '\\') + *q++ = *p; + p++; + } + *q = 0; + } + static NameList ParsePathIntoNameList (ilu_string path, ilu_Error *err) { *************** *** 2490,2495 **** --- 2685,2692 ---- *possible_dot = 0; n->names[i].kind = possible_dot + 1; } + RemoveComponentQuoting(n->names[i].id); + RemoveComponentQuoting(n->names[i].kind); if (ending != NIL) component = ending + 1; } *************** *** 3146,3151 **** --- 3343,3427 ---- return NIL; } + /* Returns object result of contacting the specified CosNaming service, + and doing "resolve" on the specified path. If an error occurs remotely, + returns NIL, with "err" indicating success, and sets "errout" + to indicate the error. If an error occurs + locally, returns NIL, and sets "err" to indicate the error. + */ + static ilu_Object + ResolveCORBAName (ilu_string corbaname, + ilu_ResolveIIOPNameErrs_s *errout, + ILU_ERRS((bad_locks, inv_objref, + no_resources, IoErrs)) * err) + { + char *p; + char addresses[1024]; + char object_path[1024]; + char ns_url[2048]; + ilu_Object ns_obj; + ilu_Object user_obj; + NameList namelist; + + Initialize_CosNaming_NamingContext (err); + if (ILU_ERRNOK(*err)) return NIL; + + if (strncmp(corbaname, "corbaname:", 10) == 0) + p = corbaname + 10; + else + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, NIL); + + if (sscanf (p, "%1023[^#]#%1023s", addresses, object_path) != 2) + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, NIL); + else if ((strlen(addresses) < 1) || (strlen(object_path) < 1)) + return ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, NIL); + ILU_NOTE(IIOP_DEBUG, + ("ilu_IIOP_ResolveCORBAName: addresses are <%s>, path is <%s>\n", + addresses, object_path)); + + /* Form an iioploc: url for the NameService */ + sprintf(ns_url, "corbaloc:%s", addresses); + if (strchr(ns_url + 9, '/') == NIL) + strcpy (ns_url + strlen(ns_url), "/NameService"); + + /* Turn the path into a list of name/extension pairs */ + namelist = ParsePathIntoNameList(object_path, err); + if (ILU_ERRNOK(*err)) return NIL; + + /* Get an object corresponding to the name service */ + ns_obj = ilu_ObjectOfSBH (ns_url, CosNaming_NamingContext, err); + if (ns_obj == NIL) + ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_ior, 0); + if (ILU_ERRNOK(*err)) goto errout1; + ilu_DeltaHolds(ns_obj, +1); + ilu_ExitServer (object_server(ns_obj), CosNaming_NamingContext); + + /* call resolve on the name service */ + user_obj = CosNamingResolve (ns_obj, namelist, errout, err); + if (ILU_ERRNOK(*err)) goto errout2; + if (errout->whicherr != ilu_rine_Success) goto errout2; + + /* free up the ns_obj, and the namelist */ + if (object_server(user_obj) != object_server(ns_obj)) + ilu_EnterServer (object_server(ns_obj), CosNaming_NamingContext); + _ilu_DeltaHolds(ns_obj, -1); + if (object_server(user_obj) != object_server(ns_obj)) + ilu_ExitServer (object_server(ns_obj), CosNaming_NamingContext); + FreeNameList(namelist); + + /* return the user_obj */ + return user_obj; + + /* return with an error */ + errout2: + ilu_EnterServer (object_server(ns_obj), CosNaming_NamingContext); + _ilu_DeltaHolds(ns_obj, -1); + ilu_ExitServer (object_server(ns_obj), CosNaming_NamingContext); + errout1: + FreeNameList (namelist); + return NIL; + } + static void FreeResolveIIOPNameErrs(ilu_ResolveIIOPNameErrs_s *err) { *************** *** 3176,3182 **** ilu_ResolveIIOPNameErrs_s usererrs; ilu_Server s; ! kobj = ResolveIIOPName (iiopname, &usererrs, err); if (ILU_ERRNOK(*err)) return ilu_FALSE; switch (usererrs.whicherr) { case ilu_rine_Success: --- 3452,3463 ---- ilu_ResolveIIOPNameErrs_s usererrs; ilu_Server s; ! if (strncmp(iiopname, "iiopname:", 9) == 0) ! kobj = ResolveIIOPName (iiopname, &usererrs, err); ! else if (strncmp(iiopname, "corbaname:", 10) == 0) ! kobj = ResolveCORBAName (iiopname, &usererrs, err); ! else ! ILU_ERR_CONS1(inv_objref, err, minor, ilu_iom_CosNaming_InvalidName, 0); if (ILU_ERRNOK(*err)) return ilu_FALSE; switch (usererrs.whicherr) { case ilu_rine_Success: *** 1.248 1999/08/11 02:11:21 --- runtime/kernel/iluntrnl.h 2000/02/17 00:23:14 *************** *** 1723,1728 **** --- 1723,1730 ---- extern ilu_boolean _ilu_IIOP_ParseIIOP (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); extern ilu_boolean _ilu_IIOP_ParseIIOPLoc (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); extern ilu_boolean _ilu_IIOP_ParseIIOPName (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); + extern ilu_boolean _ilu_IIOP_ParseCORBALoc (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); + extern ilu_boolean _ilu_IIOP_ParseCORBAName (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); extern ilu_boolean _ilu_IIOP_ParseIOR (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); extern ilu_boolean _ilu_IIOP_ParseIOR2 (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *); *** 1.205 1999/08/30 22:19:30 --- runtime/kernel/object.c 2000/02/17 00:23:13 *************** *** 386,391 **** --- 386,393 ---- ilu_RegisterSBHParser ("iiop", _ilu_IIOP_ParseIIOP); ilu_RegisterSBHParser ("iioploc", _ilu_IIOP_ParseIIOPLoc); ilu_RegisterSBHParser ("iiopname", _ilu_IIOP_ParseIIOPName); + ilu_RegisterSBHParser ("corbaloc", _ilu_IIOP_ParseCORBALoc); + ilu_RegisterSBHParser ("corbaname", _ilu_IIOP_ParseIIOPName); #endif #ifdef W3NG_PROTOCOL ilu_RegisterSBHParser ("w3ng", _ilu_w3ng_ParseURL); *************** *** 820,825 **** --- 822,829 ---- strncmp(sbh, "IOR2:", 5) == 0 || strncmp(sbh, "iioploc:", 8) == 0 || strncmp(sbh, "iiopname:", 9) == 0 || + strncmp(sbh, "corbaloc:", 9) == 0 || + strncmp(sbh, "corbaname:", 10) == 0 || strncmp(sbh, "ior:", 4) == 0) { ILU_NOTE(OBJECT_DEBUG,
*** 1.241 2000/02/17 00:22:38 --- runtime/kernel/iiop.c 2000/02/17 01:42:24 *************** *** 3402,3412 **** if (errout->whicherr != ilu_rine_Success) goto errout2; /* free up the ns_obj, and the namelist */ ! if (object_server(user_obj) != object_server(ns_obj)) ! ilu_EnterServer (object_server(ns_obj), CosNaming_NamingContext); _ilu_DeltaHolds(ns_obj, -1); ! if (object_server(user_obj) != object_server(ns_obj)) ! ilu_ExitServer (object_server(ns_obj), CosNaming_NamingContext); FreeNameList(namelist); /* return the user_obj */ --- 3402,3410 ---- if (errout->whicherr != ilu_rine_Success) goto errout2; /* free up the ns_obj, and the namelist */ ! ilu_EnterServer (object_server(ns_obj), CosNaming_NamingContext); _ilu_DeltaHolds(ns_obj, -1); ! ilu_ExitServer (object_server(ns_obj), CosNaming_NamingContext); FreeNameList(namelist); /* return the user_obj */ *************** *** 3463,3482 **** case ilu_rine_Success: { s = object_server(kobj); if (ih) { *ih = ilu_StrdupE(object_ih(kobj), err); ! if (ILU_ERRNOK(*err)) break; }; if (sid) { *sid = ilu_StrdupE(server_id(s), err); ! if (ILU_ERRNOK(*err)) break; }; if (mstid) *mstid = NIL; if (cinfo || cinfolen) { if (cinfo) { *cinfo = ilu_StrdupE(s->sr_cinfo.icb_base, err); ! if (ILU_ERRNOK(*err)) break; }; if (*cinfolen) { if (cinfo) --- 3461,3481 ---- case ilu_rine_Success: { s = object_server(kobj); + ilu_EnterServer(s, object_class(kobj)); if (ih) { *ih = ilu_StrdupE(object_ih(kobj), err); ! if (ILU_ERRNOK(*err)) goto cleanup0; }; if (sid) { *sid = ilu_StrdupE(server_id(s), err); ! if (ILU_ERRNOK(*err)) goto cleanup1; }; if (mstid) *mstid = NIL; if (cinfo || cinfolen) { if (cinfo) { *cinfo = ilu_StrdupE(s->sr_cinfo.icb_base, err); ! if (ILU_ERRNOK(*err)) goto cleanup2; }; if (*cinfolen) { if (cinfo) *************** *** 3487,3492 **** --- 3486,3497 ---- if (pass_cinfo) *pass_cinfo = ilu_TRUE; } + cleanup2: + if (sid) ilu_free(*sid); + cleanup1: + if (ih) ilu_free(*ih); + cleanup0: + ilu_ExitServer(s, object_class(kobj)); } break; case ilu_rine_SystemError:
*** 1.242 2000/02/17 01:42:24 --- runtime/kernel/iiop.c 2000/02/23 00:23:37 *************** *** 1729,1735 **** ilu_bytes junk = NIL; ilu_cardinal nativeCodesetForShortChar = 0, nativeCodesetForChar = 0; ilu_cardinal nConverters; ! ilu_cardinal junklen; bo = (prof->profileData[0] == 0) ? BigEndian : LittleEndian; pk = _cdr_InmemPacket (prof->profileDataLen, prof->profileData, bo, 0, err); --- 1729,1735 ---- ilu_bytes junk = NIL; ilu_cardinal nativeCodesetForShortChar = 0, nativeCodesetForChar = 0; ilu_cardinal nConverters; ! ilu_cardinal junklen, test_charset_id; bo = (prof->profileData[0] == 0) ? BigEndian : LittleEndian; pk = _cdr_InmemPacket (prof->profileDataLen, prof->profileData, bo, 0, err); *************** *** 1768,1780 **** if (nativeCodesetForShortChar == ilu_IIOP_NATIVE_SHORT_CHAR_CODE_SET_ID) *short_character_codeset = nativeCodesetForShortChar; for (j = 0; j < nConverters; j++) { ! if (_cdr_get_u32 (codesetInfo, &junklen, err), ILU_ERRNOK(*err)) goto errout2; ! if (junklen == ilu_IIOP_NATIVE_SHORT_CHAR_CODE_SET_ID) *short_character_codeset = nativeCodesetForShortChar; ILU_NOTE(IIOP_DEBUG, ("(iiop.c:parse_MultiComponent_Profile): SHORT CHARACTER codeset converter for %08x\n", ! junklen)); } if ((_cdr_get_u32 (codesetInfo, &nativeCodesetForChar, err), ILU_ERRNOK(*err)) || (_cdr_get_u32 (codesetInfo, &nConverters, err), ILU_ERRNOK(*err))) --- 1768,1780 ---- if (nativeCodesetForShortChar == ilu_IIOP_NATIVE_SHORT_CHAR_CODE_SET_ID) *short_character_codeset = nativeCodesetForShortChar; for (j = 0; j < nConverters; j++) { ! if (_cdr_get_u32 (codesetInfo, &test_charset_id, err), ILU_ERRNOK(*err)) goto errout2; ! if (test_charset_id == ilu_IIOP_NATIVE_SHORT_CHAR_CODE_SET_ID) *short_character_codeset = nativeCodesetForShortChar; ILU_NOTE(IIOP_DEBUG, ("(iiop.c:parse_MultiComponent_Profile): SHORT CHARACTER codeset converter for %08x\n", ! test_charset_id)); } if ((_cdr_get_u32 (codesetInfo, &nativeCodesetForChar, err), ILU_ERRNOK(*err)) || (_cdr_get_u32 (codesetInfo, &nConverters, err), ILU_ERRNOK(*err))) *************** *** 1785,1797 **** if (nativeCodesetForChar == ilu_IIOP_NATIVE_CHAR_CODE_SET_ID) *long_character_codeset = nativeCodesetForChar; for (j = 0; j < nConverters; j++) { ! if (_cdr_get_u32 (codesetInfo, &junklen, err), ILU_ERRNOK(*err)) goto errout2; ! if (junklen == ilu_IIOP_NATIVE_CHAR_CODE_SET_ID) ! *long_character_codeset = nativeCodesetForChar; ILU_NOTE(IIOP_DEBUG, ("(iiop.c:parse_MultiComponent_Profile): CHARACTER codeset converter for %08x\n", ! junklen)); } /* allow free to free "junk" */ _cdr_InmemFree(codesetInfo, NIL, NIL); --- 1785,1797 ---- if (nativeCodesetForChar == ilu_IIOP_NATIVE_CHAR_CODE_SET_ID) *long_character_codeset = nativeCodesetForChar; for (j = 0; j < nConverters; j++) { ! if (_cdr_get_u32 (codesetInfo, &test_charset_id, err), ILU_ERRNOK(*err)) goto errout2; ! if (test_charset_id == ilu_IIOP_NATIVE_CHAR_CODE_SET_ID) ! *long_character_codeset = test_charset_id; ILU_NOTE(IIOP_DEBUG, ("(iiop.c:parse_MultiComponent_Profile): CHARACTER codeset converter for %08x\n", ! test_charset_id)); } /* allow free to free "junk" */ _cdr_InmemFree(codesetInfo, NIL, NIL);
*** 1.242 2000/02/17 01:42:24 --- runtime/kernel/iiop.c 2000/02/24 03:34:30 *************** *** 1964,1969 **** --- 1964,1985 ---- return NIL; else return d.mstid_candidate; + } + + /*Main Invariant holds; L2 otherwise unconstrained*/ + ilu_boolean _ilu_IIOP_PingObject (ilu_Object o, ilu_Connection *new_conn) + { + ilu_Error lerr; + + if (new_conn) + *new_conn = NIL; + /* Make sure object is of at least the putative type */ + if (!IsOfTypeViaRPC(o, ilu_FindClassFromID(CORBA_OBJECT_TYPE_ID), &lerr) || ILU_ERRNOK(lerr)) + { + ILU_HANDLED(lerr); + return ilu_FALSE; + } + return ilu_TRUE; } static ilu_boolean ParseIOR (struct IIOP_IOR_IOR *ior, *** 1.206 2000/02/17 00:22:38 --- runtime/kernel/object.c 2000/02/24 03:30:36 *************** *** 1456,1462 **** } /*Main Invariant holds; L2 otherwise unconstrained*/ ! ilu_boolean ilu_PingObject(ilu_Object o, ilu_Connection * new_conn) { ilu_Call_s call_s; ilu_Call call = &call_s; --- 1456,1463 ---- } /*Main Invariant holds; L2 otherwise unconstrained*/ ! static ilu_boolean ! PingObject(ilu_Object o, ilu_Connection * new_conn) { ilu_Call_s call_s; ilu_Call call = &call_s; *************** *** 1545,1550 **** --- 1546,1567 ---- return status; } } + + /*Main Invariant holds; L2 otherwise unconstrained*/ + ilu_boolean ilu_PingObject(ilu_Object o, ilu_Connection * new_conn) + { + #ifdef IIOP_PROTOCOL + #define CORBA_NATIVE_OBJECT_IH_PREFIX "ilu--corba-native-object:" + #define SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX (sizeof(CORBA_NATIVE_OBJECT_IH_PREFIX)-1) + + if (strncmp(object_ih(o), CORBA_NATIVE_OBJECT_IH_PREFIX, SIZEOF_CORBA_NATIVE_OBJECT_IH_PREFIX) == 0) + /* CORBA object from another kind of ORB; use is-a */ + return _ilu_IIOP_PingObject (o, new_conn); + else + #endif /* def IIOP_PROTOCOL */ + return PingObject(o, new_conn); + } + /**Call-Locking(call, IHi) before, Call-Locking(call, No) after*/ *** 1.249 2000/02/17 00:22:38 --- runtime/kernel/iluntrnl.h 2000/02/24 03:04:56 *************** *** 1718,1723 **** --- 1718,1727 ---- ilu_Class _ilu_IIOP_FindClassViaRPC(ilu_Object o); /* o->ob_class is temporarily set to some known type of o */ + ilu_boolean _ilu_IIOP_PingObject (ilu_Object o, ilu_Connection *new_conn); + /* pings object by doing an "is-a" call with IDL:org.omg/CORBA/Object:1.0 + called by ilu_PingObject */ + /*L1, L2 unconstrained*/ extern ilu_boolean _ilu_IIOP_ParseIIOP (ilu_string, ilu_string *, ilu_string *, ilu_string *, ilu_string *, ilu_cardinal *, ilu_boolean *, ilu_Error *);
*** 1.28 1999/08/30 23:17:39 --- runtime/lisp/ilu-lisp-skin.c 2000/03/04 01:01:47 *************** *** 525,531 **** if (disc) fprintf (stderr, "ilu-lisp-skin.c:ilulisp_InputObjectID: ******** Couldn't input discriminator of type %s (%s)\n", pclass->cl_name, pclass->cl_unique_id); ! else fprintf (stderr, "ilu-lisp-skin.c:ilulisp_InputObjectID: ******** Couldn't input object with pclass %s (%s)\n", pclass->cl_name, pclass->cl_unique_id); } --- 525,531 ---- if (disc) fprintf (stderr, "ilu-lisp-skin.c:ilulisp_InputObjectID: ******** Couldn't input discriminator of type %s (%s)\n", pclass->cl_name, pclass->cl_unique_id); ! else if (!pclass->cl_optional) fprintf (stderr, "ilu-lisp-skin.c:ilulisp_InputObjectID: ******** Couldn't input object with pclass %s (%s)\n", pclass->cl_name, pclass->cl_unique_id); }
End of patches