static krb5_error_code resolve_by_uuid(krb5_context context, krb5_ccache id, const krb5_cc_ops *ops, krb5_uuid uuid) { krb5_error_code ret; CFUUIDBytes bytes; krb5_xcc *x; memcpy(&bytes, uuid, sizeof(bytes)); CFUUIDRef uuidref = CFUUIDCreateFromUUIDBytes(NULL, bytes); if (uuidref == NULL) { krb5_set_error_message(context, KRB5_CC_END, "failed to create uuid"); return KRB5_CC_END; } ret = xcc_alloc(context, &id); if (ret) { CFRELEASE_NULL(uuidref); return ret; } x = XCACHE(id); x->uuid = uuidref; genName(x); return 0; }
static krb5_error_code KRB5_CALLCONV get_cache_next(krb5_context context, krb5_cc_cursor cursor, const krb5_cc_ops *ops, krb5_ccache *id) { struct xcc_cursor *c = cursor; krb5_error_code ret; HeimCredRef cred; krb5_xcc *x; if (c->array == NULL) return KRB5_CC_END; if (c->offset >= CFArrayGetCount(c->array)) return KRB5_CC_END; cred = (HeimCredRef)CFArrayGetValueAtIndex(c->array, c->offset++); if (cred == NULL) return KRB5_CC_END; ret = _krb5_cc_allocate(context, ops, id); if (ret) return ret; xcc_alloc(context, id); x = XCACHE((*id)); x->uuid = HeimCredGetUUID(cred); CFRetain(x->uuid); x->cred = cred; CFRetain(cred); genName(x); return ret; }
static krb5_error_code KRB5_CALLCONV xcc_move(krb5_context context, krb5_ccache from, krb5_ccache to) { krb5_xcc *xfrom = XCACHE(from); krb5_xcc *xto = XCACHE(to); if (!HeimCredMove(xfrom->uuid, xto->uuid)) return KRB5_CC_END; CFRELEASE_NULL(xto->cred); CFRELEASE_NULL(xfrom->cred); free(xto->cache_name); xto->cache_name = NULL; genName(xto); CFRELEASE_NULL(xto->clientName); xto->clientName = xfrom->clientName; xfrom->clientName = NULL; if (xto->primary_principal) krb5_free_principal(context, xto->primary_principal); xto->primary_principal = xfrom->primary_principal; xfrom->primary_principal = NULL; return 0; }
static krb5_error_code KRB5_CALLCONV xcc_resolve(krb5_context context, krb5_ccache *id, const char *res) { krb5_error_code ret; CFUUIDBytes bytes; krb5_xcc *x; if (uuid_parse(res, (void *)&bytes) != 0) { krb5_set_error_message(context, KRB5_CC_END, "failed to parse uuid: %s", res); return KRB5_CC_END; } CFUUIDRef uuidref = CFUUIDCreateFromUUIDBytes(NULL, bytes); if (uuidref == NULL) { krb5_set_error_message(context, KRB5_CC_END, "failed to create uuid from: %s", res); return KRB5_CC_END; } ret = xcc_alloc(context, id); if (ret) { CFRELEASE_NULL(uuidref); return ret; } x = XCACHE((*id)); x->uuid = uuidref; genName(x); return 0; }
void Application::initializeInputSubsystem() { input = shared_ptr<SDLinput>(new SDLinput(genName(), this, joysticks)); registerSubscriber(input.get()); }
void Application::initializeSoundManager() { soundSystem = shared_ptr<SoundSystem>(new SoundSystem(genName(), this)); // soundSystem->playMusic(FileName("data/music/RachelBerkowitz.mp3")); soundSystem->setMute(false); soundSystem->setSoundEffectVolume(0.7f); soundSystem->setMusicVolume(0.0f); registerSubscriber(soundSystem.get()); TRACE("Sound system initialized"); }
void Application::initializeGameWorld() { // Create the game world world = shared_ptr<World>(new World(genName(), this, renderer, textureFactory, &camera)); registerSubscriber(world.get()); TRACE("Created the game world"); }
/** * Recursive function to ensure that everything is named */ void NamingControl::rename(ClassReflection *cref) { std::string type = cref->getType(); if (cref->getName() == "") { cref->getObject()->setName(genName(type)); } for (unsigned i=0; i < cref->getNumChildren(); i++) { ClassReflection *childref = cref->getChild(i); if (childref != NULL) { rename(childref); } } }
void Application::initializeGameStateMachine() { initializeGameWorld(); GameStateMachine *s = new GameStateMachine(genName(), this, g_FrameTimer, kernel, world); gameStateMachine = shared_ptr<GameStateMachine>(s); registerSubscriber(gameStateMachine.get()); TRACE("Game state machine initialized"); }
static krb5_error_code xcc_create(krb5_context context, krb5_xcc *x, CFUUIDRef uuid) { const void *keys[] = { (void *)kHEIMObjectType, (void *)kHEIMAttrType, (void *)kHEIMAttrUUID }; const void *values[] = { (void *)kHEIMObjectKerberos, (void *)kHEIMTypeKerberos, (void *)uuid }; CFDictionaryRef attrs; krb5_error_code ret; CFErrorRef error = NULL; CFIndex num_keys = sizeof(keys)/sizeof(keys[0]); if (uuid == NULL) num_keys -= 1; attrs = CFDictionaryCreate(NULL, keys, values, num_keys, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); heim_assert(attrs != NULL, "Failed to create dictionary"); /* * Contract with HeimCredCreate is creates a uuid's when they are * not set on the attributes passed in. */ x->cred = HeimCredCreate(attrs, &error); CFRelease(attrs); if (x->cred) { heim_assert(x->uuid == NULL, "credential should not already have a UUID"); x->uuid = HeimCredGetUUID(x->cred); heim_assert(x->uuid != NULL, "no uuid for credential?"); CFRetain(x->uuid); ret = 0; genName(x); } else { ret = _krb5_set_cf_error_message(context, ENOMEM, error, N_("no reply from GSSCred", "")); } CFRELEASE_NULL(error); return ret; }
Object::Object(unsigned long id, const shared_ptr<Class> c) : id(id) { objectClass = c; name = genName(); if (lastId < id) lastId = id; // avoid collisions when loading objects from file }
Object::Object() : Object(genId(), shared_ptr<Class>(nullptr)) { name = genName(); }
void Application::initializeRenderer() { renderer = shared_ptr<Renderer>(new Renderer(genName(), this)); registerSubscriber(renderer.get()); TRACE("Renderer initialized"); }