void viewport_rebind( t_scene *sc, void *ptr) { t_viewport *viewport=( t_viewport *) ptr; rebind(sc, "viewport", "camera", (void **) &viewport->camera); rebind(sc, "viewport", "draw", (void **) &viewport->draw); rebind(sc, "viewport", "blocks", (void **) &viewport->controls); }
void vlst_rebind(t_scene *sc,void *ptr) { t_vlst *vlst=(t_vlst *)ptr; // REBIND rebind(sc,"vlst","data",(void **)&vlst->data); rebind(sc,"vlst","link",(void **)&vlst->link); }
void screen_rebind(t_scene *scene, void *ptr) { t_screen *screen = (t_screen *) ptr; rebind(scene,"screen","blocks",(void **)&screen->blocks); rebind(scene,"screen","viewports",(void **)&screen->viewports); if( is( screen->id.name, "screen_view3d")) { t_context *C = ctx_get(); C->scene->has_generic_viewport = 1; } }
inline HandleMap<EigenType, Handle, MapOptions>& HandleMap<EigenType, Handle, MapOptions>::rebind( const Handle &inHandle) { return rebind(inHandle, inHandle.size()); }
int makeListOrganisations (struct namelist **olistp) { entrystruct * x; int retval; if (rebind() != OK) return NOTOK; retval = ds_search(&sarg, &serror, &sresult); if ((retval == DSE_INTR_ABANDONED) && (serror.dse_type == DSE_ABANDONED)) abandoned = TRUE; if (retval != OK) return NOTOK; correlate_search_results (&sresult); setProblemFlags(sresult); highNumber = 0; for (x = sresult.CSR_entries; x != NULLENTRYINFO; x = x->ent_next) { *olistp = list_alloc(); (*olistp)->name = dn2pstr(x->ent_dn); (*olistp)->ats = as_cpy(x->ent_attr); olistp = &(*olistp)->next; highNumber++; } *olistp = NULLLIST; entryinfo_free(sresult.CSR_entries, 0); dn_free (sresult.CSR_object); crefs_free (sresult.CSR_cr); filter_free(sarg.sra_filter); return OK; }
void block_rebind(t_scene *sc,void *ptr) { t_block *block=(t_block *)ptr; rebind(sc,"block","bricks",(void **)&block->bricks); rebind(sc,"block","rhizome",(void **)&block->rhizome); rebind(sc,"block","set",(void **)&block->set); rebind(sc,"block","clone",(void **)&block->clone); // reset block->hover=NULL; block->submenu=NULL; t_context *C=ctx_get(); block_init(C->scene,block); }
inline HandleMap<ColumnVector, MutableArrayHandle<double> >& HandleMap<ColumnVector, MutableArrayHandle<double> >::rebind( const MutableArrayHandle<double>& inHandle) { return rebind(inHandle, inHandle.sizeOfDim(0)); }
inline HandleMap<Matrix, MutableArrayHandle<double> >& HandleMap<Matrix, MutableArrayHandle<double> >::rebind( const MutableArrayHandle<double>& inHandle) { return rebind(inHandle, inHandle.sizeOfDim(1), inHandle.sizeOfDim(0)); }
/*! * @if jp * @brief Object を rebind する * @else * @brief Rebind object * @endif */ void CorbaNaming::rebindByString(const char* string_name, CORBA::Object_ptr obj, const bool force) throw (SystemException, NotFound, CannotProceed, InvalidName) { rebind(toName(string_name), obj, force); }
inline EigenTypes<MapOptions>::HandleMap<EigenType, Handle>& EigenTypes<MapOptions>::HandleMap<EigenType, Handle>::rebind( const Handle &inHandle) { return rebind(inHandle, inHandle.size()); }
/*! * @if jp * @brief NamingContext を rebind する * @else * @brief Rebind NamingContext * @endif */ void CorbaNaming::rebindContext(const CosNaming::Name& name, CosNaming::NamingContext_ptr name_cxt, const bool force) throw (SystemException, NotFound, CannotProceed, InvalidName) { rebind(name, name_cxt, force); return; }
/* main() interprets the command-line arguments, builds the array of * symbol names, opens the object file, and calls rebind(). */ int main(int argc, char *argv[]) { int n; fromstrength = STB_GLOBAL; tostrength = STB_WEAK; tostrengthtext = "Weakening"; while ((n = getopt(argc, argv, "hsvw")) != EOF) { switch (n) { case 's': fromstrength = STB_WEAK; tostrength = STB_GLOBAL; tostrengthtext = "Strengthening"; break; case 'w': fromstrength = STB_GLOBAL; tostrength = STB_WEAK; tostrengthtext = "Weakening"; break; case 'h': fputs(yowzitch, stdout); return EXIT_SUCCESS; case 'v': fputs(vourzhon, stdout); return EXIT_SUCCESS; default: fputs(yowzitch, stderr); return EXIT_FAILURE; } } if (optind == argc) { fputs(yowzitch, stderr); return EXIT_FAILURE; } thefilename = argv[optind]; if (!(thefile = fopen(thefilename, "rb+"))) { err("unable to open."); return EXIT_FAILURE; } ++optind; if (optind == argc) { if (!namelistfromfile(stdin)) return EXIT_FAILURE; } else { namelist = argv + optind; namecount = argc - optind; } qsort(namelist, namecount, sizeof *namelist, qstrcmp); n = rebind() ? EXIT_SUCCESS : EXIT_FAILURE; fclose(thefile); return n; }
int main() { auto a = girl::make( "alice" ); std::cout << "+++ " << a->name() << " +++\n\n" ; auto b = catman::make( "the cheshire catman" ); a->rebind(b) ; std::cout << "+++ " << a->name() << " +++\n\n" ; auto c = girl::make( "the queen of hearts" ); auto d = a->rebind(c) ; std::cout << "+++ " << a->name() << " +++\n\n" ; try { d->rebind(a) ; } catch( const std::exception& e ) { std::cerr << "***** error: " << e.what() << '\n' ; } auto a1 = a ; try { c->rebind(a1) ; } catch( const std::exception& e ) { std::cerr << "***** error: " << e.what() << '\n' ; } std::cout << "+++ " << a->name() << " +++\n\n" ; }
int ACE_Naming_Context::rebind (const char *name_in, const char *value_in, const char *type_in) { ACE_TRACE ("ACE_Naming_Context::rebind"); return rebind (ACE_NS_WString (name_in), ACE_NS_WString (value_in), type_in); }
void GlImage::bind() { if (m_bound) return; ngsCheckGLError(glGenTextures(1, &m_id)); rebind(); ngsCheckGLError(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, m_imageData)); m_bound = true; CPLFree(m_imageData); m_imageData = nullptr; }
void sendDesc::extend(nmethod* nm, mapOop receiverMapOop, CountStub *cs_from_pic) { char *addr; bool isPerform= isPerformLookupType(raw_lookupType()); if ( PIC && !isPerform && (addr= jump_addr(), addr != lookupRoutine())) { // already has at least one nmethod linked to the send CacheStub* s= pic(); # if GENERATE_DEBUGGING_AIDS if (CheckAssertions) { assert(cs_from_pic==NULL, "discarding countStub?"); if (!s) { // turning monomorphic ic into PIC; PIC will carry dependencies assert(dependency()->notEmpty(), "shouldn't be empty"); // check for duplicate nmethod & rcvr map CountStub *oldcs= countStub(); nmethod *oldnm= oldcs ? oldcs->target() : nmethod::findNMethod(addr); assert( oldnm != nm || receiverMapOop != oldnm->key.receiverMapOop(), "already linked to this nmethod, why rebind?? (maybe I-cache did not get flushed)"); } } # endif s= s->extend(this, nm, receiverMapOop); assert(s, "should have a PIC now"); assert(dependency()->next == dependency()->prev, "more than one link"); } else { // first time we execute this send, or PICs disabled, or perform, or // rebinding after a PIC has been removed, or non-map related misses if (isPerform) NumberOfPerformMisses++; if (!PIC) { CacheStub *s= pic(); // remove existing PIC if (s) s->deallocate(); } rebind(nm, NULL, cs_from_pic); } MachineCache::flush_instruction_cache_for_debugging(); if (VerifyZoneOften) verify(); }
t_block *block_rebind(t_scene *sc,void *ptr) { t_block *block=(t_block *)ptr; check_init("BLOCK",block->name); rebind(sc,"block","bricks",(void **)&block->bricks); // methods block->draw=block_draw; // reset block->selected=NULL; block->submenu=NULL; t_context *C=ctx_get(); block_init(C->scene,block); check_check("BLOCK",block->name); return block; }
template < typename T > void convert( std::string new_name = "" ) { rebind( actual->convert<T>(new_name) ) ; }
void image_rebind( struct Scene *scene, void *ptr) { t_image *image = ( t_image *) ptr; rebind( scene, "image", "vlst", (void **) &image->vlst); }
int call_modify (int argc, char **argv) { struct ds_modifyentry_arg mod_arg; struct DSError error; struct entrymod *emnew, *ems_append(), *modify_avs(); Attr_Sequence as, #ifdef TURBO_DISK fget_attributes (), #else get_attributes (), #endif temp, trail = NULLATTR; AV_Sequence avst = NULLAV; extern AttributeType at_objectclass; extern int parse_status; Entry entry_ptr; FILE *fd; char draft_flag = FALSE; char noedit_flag = FALSE; int x; DN moddn; char *home; RDN new_rdn; struct list_element *start = 0 ; struct list_element *last ; struct list_element *l_temp ; /* char add = FALSE ; char rem = FALSE ; */ if ((argc = service_control (OPT, argc, argv, &mod_arg.mea_common)) == -1) return; mod_arg.mea_changes = NULLMOD; new_draft = FALSE; if (home = getenv ("DISHDRAFT")) strcpy (fname, home); else if (dad_flag) { strcpy (fname, "/tmp/dishXXXXXX"); unlink (mktemp (fname)); } else if (home = getenv ("HOME")) sprintf (fname, "%s/.dishdraft", home); else strcpy (fname, "./.dishdraft"); for (x=1; x<argc; x++) { if (test_arg (argv[x], "-draft",1)) { draft_flag = 1; shuffle_up (argc--,argv,x); if (x == argc) { ps_printf (OPT, "Draft file name missing\n"); Usage (argv[0]); return; } strcpy (fname, argv[x]); shuffle_up (argc--,argv,x--); } else if (test_arg (argv[x], "-newdraft",2)) { new_draft = TRUE; shuffle_up (argc--,argv,x--); } else if (test_arg (argv[x], "-noedit",3)) { noedit_flag = TRUE; shuffle_up (argc--,argv,x--); } else if (move (argv[x]) == OK) shuffle_up (argc--,argv,x--); else if (test_arg(argv[x], "-remove", 3)) { shuffle_up (argc--, argv, x); if (x == argc) { ps_printf(OPT, "Attribute to remove missing\n") ; Usage(argv[0]) ; return ; } l_temp = (struct list_element *) malloc (sizeof(struct list_element)) ; l_temp->mod = (char *) malloc ((unsigned)(strlen(argv[x]) + 1)); strcpy (l_temp->mod, argv[x]) ; l_temp->add = 0 ; l_temp->next = 0 ; if (start == 0) { start = last = l_temp ; } else { last->next = l_temp ; last = l_temp ; } shuffle_up (argc--,argv,x--); } else if (test_arg(argv[x], "-add", 2)) { shuffle_up (argc--, argv, x); if (x == argc) { ps_printf(OPT, "Attribute to insert missing\n") ; Usage(argv[0]) ; return ; } l_temp = (struct list_element *) malloc (sizeof(struct list_element)) ; l_temp->mod = (char *) malloc ((unsigned)(strlen(argv[x]) + 1)); strcpy (l_temp->mod, argv[x]) ; l_temp->add = 1 ; l_temp->next = 0 ; if (start == 0) { start = last = l_temp ; } else { last->next = l_temp ; last = l_temp ; } shuffle_up (argc--,argv,x--); } } if (dad_flag && (draft_flag || noedit_flag)) { ps_printf (OPT, "operation not allowed when using directory assistance server!\n"); return; } /* read attributes we want to modify */ if ((argc = read_cache_aux (argc, argv, FALSE, &mod_arg.mea_common)) <0 ) return; if (argc != 1) { ps_printf (OPT,"Unknown option %s\n",argv[1]); Usage (argv[0]); return; } if (start != 0) { if (build_modify(start, &mod_arg) == NOTOK) { return ; } while (ds_modifyentry (&mod_arg, &error) != DS_OK) { if (dish_error (OPT, &error) == 0) { return ; } mod_arg.mea_object = error.ERR_REFERRAL.DSE_ref_candidates->cr_name ; } ps_print (RPS, "Modified "); dn_print (RPS, dn, EDBOUT); ps_print (RPS, "\n"); delete_cache (dn); /* re-cache when next read */ return ; } if (!draft_flag) { if (mod_template (fname,noedit_flag) != OK) return; noedit_flag = FALSE; } else { new_draft = TRUE; /* Ugh ! */ mod_template ("/dev/null",TRUE); } if (! noedit_flag) if (editentry (1, argv) != OK) { make_old (fname,draft_flag); return; } /* now parse the files */ if ((fd = fopen (fname, "r")) == (FILE *) NULL) { ps_printf (OPT, "Can't open draft entry %s\n", fname); return; } entry_ptr = get_default_entry (NULLENTRY); #ifdef TURBO_DISK entry_ptr->e_attributes = fget_attributes (fd); #else entry_ptr->e_attributes = get_attributes (fd); #endif fclose (fd); if (parse_status != 0) return; mod_arg.mea_object = dn; for (moddn = dn ; moddn->dn_parent != NULLDN; moddn=moddn->dn_parent) ; entry_ptr->e_name = rdn_cpy (moddn->dn_rdn); /* add rdn as attribute */ for (new_rdn = entry_ptr->e_name; new_rdn != NULLRDN; new_rdn = new_rdn->rdn_next) { avst = avs_comp_new (AttrV_cpy (&new_rdn->rdn_av)); temp = as_comp_new (AttrT_cpy (new_rdn->rdn_at), avst, NULLACL_INFO); entry_ptr->e_attributes = as_merge (entry_ptr->e_attributes, temp); } for (as = entry_ptr->e_attributes; as != NULLATTR; as = as->attr_link) { emnew = NULLMOD; trail = as->attr_link; as->attr_link = NULLATTR; temp = current_entry->e_attributes; for (; temp != NULLATTR; temp = temp->attr_link) if (AttrT_cmp (as->attr_type, temp->attr_type) == 0) { /* found it - does it need changing ? */ if (avs_cmp (as->attr_value, temp->attr_value) != 0) emnew = modify_avs (as->attr_value, temp->attr_value,as->attr_type); break; } if (temp == NULLATTR) { emnew = em_alloc (); emnew->em_type = EM_ADDATTRIBUTE; emnew->em_what = as_cpy(as); emnew->em_next = NULLMOD; } if (emnew != NULLMOD) mod_arg.mea_changes = ems_append (mod_arg.mea_changes,emnew); as->attr_link = trail; } /* remove attribute missing in new entry */ for (as = current_entry->e_attributes; as != NULLATTR; as = as->attr_link) { emnew = NULLMOD; temp = entry_ptr->e_attributes; for (; temp != NULLATTR; temp = temp->attr_link) if (AttrT_cmp (as->attr_type, temp->attr_type) == 0) break; if (temp == NULLATTR) { emnew = em_alloc (); emnew->em_type = EM_REMOVEATTRIBUTE; emnew->em_what = as_comp_new(as->attr_type,NULLAV,NULLACL_INFO); emnew->em_next = NULLMOD; } if (emnew != NULLMOD) mod_arg.mea_changes = ems_append (mod_arg.mea_changes,emnew); } if (mod_arg.mea_changes == NULLMOD) { ps_print (RPS, "The draft entry and the entry for "); dn_print (RPS, dn, EDBOUT); ps_print (RPS, "\nare exactly the same - no change made!!!\n"); entry_free (entry_ptr); make_old (fname,draft_flag); return; } if (rebind () != OK) { entry_free (entry_ptr); return; } /* * If this operation is time-stamped, it may have expired while the user * was editing the entry. Re-calculate the time-stamp. Modify is the only * dish command where this needs to be done. */ if ((mod_arg.mea_common.ca_security != (struct security_parms *) 0) && (mod_arg.mea_common.ca_security->sp_time != NULLCP)) { char *new_version(); free(mod_arg.mea_common.ca_security->sp_time); mod_arg.mea_common.ca_security->sp_time = new_version(); } /* If security parameters are present, take this to mean that strong * authentication is required. This disallows 'parms + no signature' * (pointless) and 'signature + no parms' (security risk). */ if (mod_arg.mea_common.ca_security != (struct security_parms *) 0) { extern struct SecurityServices *dsap_security; mod_arg.mea_common.ca_sig = (dsap_security->serv_sign)((caddr_t)&mod_arg, _ZModifyEntryArgumentDataDAS, &_ZDAS_mod); } while (ds_modifyentry (&mod_arg, &error) != DS_OK) { if (dish_error (OPT, &error) == 0) { entry_free (entry_ptr); return; } mod_arg.mea_object = error.ERR_REFERRAL.DSE_ref_candidates->cr_name; } ps_print (RPS, "Modified "); dn_print (RPS, dn, EDBOUT); ps_print (RPS, "\n"); delete_cache (dn); /* re-cache when next read */ entry_free (entry_ptr); ems_part_free (mod_arg.mea_changes); make_old (fname,draft_flag); }