这篇教程C++ AFREE函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中AFREE函数的典型用法代码示例。如果您正苦于以下问题:C++ AFREE函数的具体用法?C++ AFREE怎么用?C++ AFREE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了AFREE函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: propertyFile_getIntintpropertyFile_getInt(const FileData* data, const char* key, int _default, SearchResult* searchResult) { char* prop = propertyFile_getValue((const char*)data->data, data->size, key); if (!prop) { if (searchResult) { *searchResult = RESULT_NOT_FOUND; } return _default; } char* end; // long is only 32 bits on windows so it isn't enough to detect int overflow long long val = strtoll(prop, &end, 10); if (val < INT_MIN || val > INT_MAX || end == prop || *end != '/0') { D("Invalid int property: '%s:%s'", key, prop); AFREE(prop); if (searchResult) { *searchResult = RESULT_INVALID; } return _default; } AFREE(prop); if (searchResult) { *searchResult = RESULT_FOUND; } return (int)val;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:33,
示例2: snapshot_info_freestatic voidsnapshot_info_free( SnapshotInfo* info ){ AFREE(info->id_str); AFREE(info->name); AFREE(info);}
开发者ID:ArtRichards,项目名称:android_emulator_spoofing,代码行数:7,
示例3: pipe_freestatic voidpipe_free( Pipe* pipe ){ if (pipe->funcs->close) { pipe->funcs->close(pipe->opaque); } AFREE(pipe->args); AFREE(pipe);}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:11,
示例4: pipe_freestatic voidpipe_free( Pipe* pipe ){ /* Call close callback */ if (pipe->funcs->close) { pipe->funcs->close(pipe->opaque); } /* Free stuff */ AFREE(pipe->args); AFREE(pipe);}
开发者ID:pras710,项目名称:qemu,代码行数:11,
示例5: iniFile_freevoidiniFile_free( IniFile* i ){ int nn; for (nn = 0; nn < i->numPairs; nn++) { AFREE(i->pairs[nn].key); i->pairs[nn].key = NULL; i->pairs[nn].value = NULL; } AFREE(i->pairs); AFREE(i);}
开发者ID:0-14N,项目名称:NDroid,代码行数:12,
示例6: pipe_loadstatic Pipe*pipe_load( PipeDevice* dev, QEMUFile* file, int version_id ){ Pipe* pipe; const PipeService* service = NULL; int state = qemu_get_byte(file); uint64_t channel; if (state != 0) { /* Pipe is associated with a service. */ char* name = qemu_get_string(file); if (name == NULL) return NULL; service = goldfish_pipe_find_type(name); if (service == NULL) { D("No QEMU pipe service named '%s'", name); AFREE(name); return NULL; } } if (version_id == GOLDFISH_PIPE_SAVE_VERSION_LEGACY) { channel = qemu_get_be32(file); } else { channel = qemu_get_be64(file); } pipe = pipe_new(channel, dev); pipe->wanted = qemu_get_byte(file); pipe->closed = qemu_get_byte(file); if (qemu_get_byte(file) != 0) { pipe->args = qemu_get_string(file); } pipe->service = service; if (service != NULL) { pipe->funcs = &service->funcs; } if (pipe->funcs->load) { pipe->opaque = pipe->funcs->load(pipe, service ? service->opaque : NULL, pipe->args, file); if (pipe->opaque == NULL) { AFREE(pipe); return NULL; } } else { /* Force-close the pipe on load */ pipe->closed = 1; } return pipe;}
开发者ID:pras710,项目名称:qemu,代码行数:51,
示例7: aintMap_freevoidaintMap_free( AIntMap* map ){ if (map) { if (map->keys != map->keys0) AFREE(map->keys); if (map->values != map->values0) AFREE(map->values); map->size = 0; map->capacity = 0; AFREE(map); }}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:14,
示例8: kf_compile_object/* * NAME: kfun->compile_object() * DESCRIPTION: compile an object */int kf_compile_object(frame *f, int nargs){ char file[STRINGSZ]; value *v; object *obj; string **strs; int i; v = &f->sp[nargs - 1]; if (path_string(file, v->u.string->text, v->u.string->len) == (char *) NULL) { return 1; } obj = o_find(file, OACC_MODIFY); if (obj != (object *) NULL) { if (!(obj->flags & O_MASTER)) { error("Cannot recompile cloned object"); } if (O_UPGRADING(obj)) { error("Object is already being upgraded"); } if (O_INHERITED(obj)) { error("Cannot recompile inherited object"); } } if (--nargs != 0) { strs = ALLOCA(string*, nargs); for (i = nargs, v = f->sp; i > 0; --i) { *strs++ = (v++)->u.string; } if (ec_push((ec_ftn) NULL)) { AFREE(strs - nargs); error((char *) NULL); } } else {
开发者ID:Shea690901,项目名称:gurbalib,代码行数:39,
示例9: _async_socket_connector_free/* Destroys AsyncSocketConnector instance. * Param: * connector - Initialized AsyncSocketConnector instance. */static void_async_socket_connector_free(AsyncSocketConnector* connector){ if (connector != NULL) { T("ASC %s: Connector is destroying...", _asc_socket_string(connector)); /* Stop all activities. */ if (asyncConnector_stop(connector->connector) == 0) { /* Connection was in progress. We need to destroy I/O descriptor for * that connection. */ D("ASC %s: Stopped async connection in progress.", _asc_socket_string(connector)); loopIo_done(connector->connector_io); } /* Free allocated resources. */ if (connector->looper != NULL) { loopTimer_done(connector->connector_timer); if (connector->owns_looper) { looper_free(connector->looper); } } if (connector->fd >= 0) { socket_close(connector->fd); } T("ASC %s: Connector is destroyed", _asc_socket_string(connector)); sock_address_done(&connector->address); AFREE(connector); }}
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:38,
示例10: qemud_client_disconnect/* disconnect a client. this automatically frees the QemudClient. * note that this also removes the client from the global list * and from its service's list, if any. */static voidqemud_client_disconnect( void* opaque ){ QemudClient* c = opaque; /* remove from current list */ qemud_client_remove(c); /* send a disconnect command to the daemon */ if (c->channel > 0) { char tmp[128], *p=tmp, *end=p+sizeof(tmp); p = bufprint(tmp, end, "disconnect:%02x", c->channel); qemud_serial_send(c->serial, 0, 0, (uint8_t*)tmp, p-tmp); } /* call the client close callback */ if (c->clie_close) { c->clie_close(c->clie_opaque); c->clie_close = NULL; } c->clie_recv = NULL; /* remove from service list, if any */ if (c->service) { qemud_service_remove_client(c->service, c); c->service = NULL; } AFREE(c);}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:34,
示例11: _avdInfo_getContentPath/* Returns the AVD's content path, i.e. the directory that contains * the AVD's content files (e.g. data partition, cache, sd card, etc...). * * We extract this by parsing the root config .ini file, looking for * a "path" elements. */static int_avdInfo_getContentPath( AvdInfo* i ){ char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); i->contentPath = iniFile_getString(i->rootIni, ROOT_ABS_PATH_KEY, NULL); if (i->contentPath == NULL) { derror("bad config: %s", "virtual device file lacks a "ROOT_ABS_PATH_KEY" entry"); return -1; } if (!path_is_dir(i->contentPath)) { // If the absolute path doesn't match an actual directory, try // the relative path if present. const char* relPath = iniFile_getString(i->rootIni, ROOT_REL_PATH_KEY, NULL); if (relPath != NULL) { p = bufprint_config_path(temp, end); p = bufprint(p, end, PATH_SEP "%s", relPath); if (p < end && path_is_dir(temp)) { AFREE(i->contentPath); i->contentPath = ASTRDUP(temp); } } } D("virtual device content at %s", i->contentPath); return 0;}
开发者ID:jvaemape,项目名称:qemu-android,代码行数:36,
示例12: _getSearchPaths/* Parse a given config.ini file and extract the list of SDK search paths * from it. Returns the number of valid paths stored in 'searchPaths', or -1 * in case of problem. * * Relative search paths in the config.ini will be stored as full pathnames * relative to 'sdkRootPath'. * * 'searchPaths' must be an array of char* pointers of at most 'maxSearchPaths' * entries. */static int_getSearchPaths( IniFile* configIni, const char* sdkRootPath, int maxSearchPaths, char** searchPaths ){ char temp[PATH_MAX], *p = temp, *end= p+sizeof temp; int nn, count = 0; for (nn = 0; nn < maxSearchPaths; nn++) { char* path; p = bufprint(temp, end, "%s%d", SEARCH_PREFIX, nn+1 ); if (p >= end) continue; path = iniFile_getString(configIni, temp, NULL); if (path != NULL) { DD(" found image search path: %s", path); if (!path_is_absolute(path)) { p = bufprint(temp, end, "%s/%s", sdkRootPath, path); AFREE(path); path = ASTRDUP(temp); } searchPaths[count++] = path; } } return count;}
开发者ID:bindassdost,项目名称:razrd,代码行数:39,
示例13: avdInfo_initHwConfigintavdInfo_initHwConfig( AvdInfo* i, AndroidHwConfig* hw ){ int ret = 0; androidHwConfig_init(hw, i->apiLevel); /* First read the config.ini, if any */ if (i->configIni != NULL) { ret = androidHwConfig_read(hw, i->configIni); } /* The skin's hardware.ini can override values */ if (ret == 0 && i->skinHardwareIni != NULL) { ret = androidHwConfig_read(hw, i->skinHardwareIni); } /* Auto-disable keyboard emulation on sapphire platform builds */ if (i->androidOut != NULL) { char* p = strrchr(i->androidOut, '/'); if (p != NULL && !strcmp(p,"sapphire")) { hw->hw_keyboard = 0; } } /* Set hw.useext4=yes, if the Ext4 file system is used. */ const char* p = avdInfo_getSystemInitImagePath(i); if (path_isExt4Image(p)) { hw->hw_useext4 = 1; } AFREE(p); return ret;}
开发者ID:jvaemape,项目名称:qemu-android,代码行数:34,
示例14: _camera_device_free/* Uninitializes and frees WndCameraDevice descriptor. * Note that upon return from this routine memory allocated for the descriptor * will be freed. */static void_camera_device_free(WndCameraDevice* cd){ if (cd != NULL) { if (cd->cap_window != NULL) { /* Disconnect from the driver. */ capDriverDisconnect(cd->cap_window); if (cd->dc != NULL) { W("%s: Frames should not be capturing at this point", __FUNCTION__); ReleaseDC(cd->cap_window, cd->dc); cd->dc = NULL; } /* Destroy the capturing window. */ DestroyWindow(cd->cap_window); cd->cap_window = NULL; } if (cd->gdi_bitmap != NULL) { free(cd->gdi_bitmap); } if (cd->frame_bitmap != NULL) { free(cd->frame_bitmap); } if (cd->window_name != NULL) { free(cd->window_name); } if (cd->framebuffer != NULL) { free(cd->framebuffer); } AFREE(cd); } else { W("%s: No descriptor", __FUNCTION__); }}
开发者ID:Bamtau,项目名称:platform_external_qemu,代码行数:39,
示例15: skin_keyboard_freevoidskin_keyboard_free( SkinKeyboard* keyboard ){ if (keyboard) { AFREE(keyboard); }}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:7,
示例16: avdInfo_getKernelPathchar*avdInfo_getKernelPath( AvdInfo* i ){ const char* imageName = _imageFileNames[ AVD_IMAGE_KERNEL ]; char* kernelPath = _avdInfo_getContentOrSdkFilePath(i, imageName); if (kernelPath == NULL && i->inAndroidBuild) { /* When in the Android build, look into the prebuilt directory * for our target architecture. */ char temp[PATH_MAX], *p = temp, *end = p + sizeof(temp); const char* suffix = ""; char* abi; /* If the target ABI is armeabi-v7a, then look for * kernel-qemu-armv7 instead of kernel-qemu in the prebuilt * directory. */ abi = path_getBuildTargetAbi(i->androidOut); if (!strcmp(abi,"armeabi-v7a")) { suffix = "-armv7"; } AFREE(abi); p = bufprint(temp, end, "%s/prebuilts/qemu-kernel/%s/kernel-qemu%s", i->androidBuildRoot, i->targetArch, suffix); if (p >= end || !path_exists(temp)) { derror("bad workspace: cannot find prebuilt kernel in: %s", temp); exit(1); } kernelPath = ASTRDUP(temp); } return kernelPath;}
开发者ID:bindassdost,项目名称:razrd,代码行数:34,
示例17: pipe_loadstatic Pipe*pipe_load( PipeDevice* dev, QEMUFile* file ){ Pipe* pipe; const PipeService* service = NULL; int state = qemu_get_byte(file); uint32_t channel; if (state != 0) { char* name = qemu_get_string(file); if (name == NULL) return NULL; service = goldfish_pipe_find_type(name); if (service == NULL) { D("No QEMU pipe service named '%s'", name); AFREE(name); return NULL; } } channel = qemu_get_be32(file); pipe = pipe_new(channel, dev); pipe->wanted = qemu_get_byte(file); pipe->closed = qemu_get_byte(file); if (qemu_get_byte(file) != 0) { pipe->args = qemu_get_string(file); } pipe->service = service; if (service != NULL) { pipe->funcs = &service->funcs; } if (pipe->funcs->load) { pipe->opaque = pipe->funcs->load(pipe, service ? service->opaque : NULL, pipe->args, file); if (pipe->opaque == NULL) { AFREE(pipe); return NULL; } } else { pipe->closed = 1; } return pipe;}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:47,
示例18: zeroPipe_closestatic voidzeroPipe_close( void* opaque ){ ZeroPipe* zpipe = opaque; D("%s: hwpipe=%p", __FUNCTION__, zpipe->hwpipe); AFREE(zpipe);}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:8,
示例19: _avdInfo_getBuildSkinHardwareIni/* Read a hardware.ini if it is located in the skin directory */static int_avdInfo_getBuildSkinHardwareIni( AvdInfo* i ){ char* skinName; char* skinDirPath; avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; int result = avdInfo_getSkinHardwareIni(i, skinName, skinDirPath); AFREE(skinName); AFREE(skinDirPath); return result;}
开发者ID:jvaemape,项目名称:qemu-android,代码行数:18,
示例20: skin_trackball_destroyvoidskin_trackball_destroy ( SkinTrackBall* ball ){ if (ball) { trackball_done(ball); AFREE(ball); }}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:8,
示例21: _adb_guest_free/* Frees AdbGuest instance created with _adb_guest_new routine. */static void_adb_guest_free(AdbGuest* adb_guest){ if (adb_guest != NULL) { /* At this poin the guest must not be in any of the lists. */ assert(alist_is_empty(&adb_guest->list_entry)); AFREE(adb_guest); }}
开发者ID:3a9LL,项目名称:panda,代码行数:10,
示例22: dirScanner_freevoiddirScanner_free( DirScanner* s ){ if (!s) return; _dirScanner_done(s); AFREE(s);}
开发者ID:0-14N,项目名称:NDroid,代码行数:9,
示例23: _areflist_checkSize0static void_areflist_checkSize0(ARefList* l){ if (l->size == 0 && l->max > 1) { AFREE(l->u.items); l->max = 1; l->u.item0 = NULL; }}
开发者ID:0-14N,项目名称:NDroid,代码行数:9,
示例24: path_getAvdTargetArchchar*path_getAvdTargetArch( const char* avdName ){ char* avdPath = _getAvdContentPath(avdName); char* avdArch = _getAvdTargetArch(avdPath); AFREE(avdPath); return avdArch;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:9,
示例25: _avdInfo_getBuildSkinHardwareIni/* Read a hardware.ini if it is located in the skin directory */static int_avdInfo_getBuildSkinHardwareIni( AvdInfo* i ){ char* skinName; char* skinDirPath; char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp); avdInfo_getSkinInfo(i, &skinName, &skinDirPath); if (skinDirPath == NULL) return 0; int result = avdInfo_getSkinHardwareIni(i, skinName, skinDirPath); AFREE(skinName); AFREE(skinDirPath); return result;}
开发者ID:bindassdost,项目名称:razrd,代码行数:19,
示例26: pingPongPipe_closestatic voidpingPongPipe_close( void* opaque ){ PingPongPipe* ppipe = opaque; D("%s: hwpipe=%p (pos=%d count=%d size=%d)", __FUNCTION__, ppipe->hwpipe, ppipe->pos, ppipe->count, ppipe->size); free(ppipe->buffer); AFREE(ppipe);}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:10,
示例27: gloopio_freestatic voidgloopio_free(void* impl){ GLoopIo* io = impl; if (io->ready != 0) glooper_delPendingIo(io->looper, io); glooper_delIo(io->looper, io); AFREE(io);}
开发者ID:0-14N,项目名称:NDroid,代码行数:10,
示例28: iniPair_replaceValuestatic voidiniPair_replaceValue( IniPair* pair, const char* value ){ char* key = pair->key; int keyLen = strlen(key); int valueLen = strlen(value); iniPair_init(pair, key, keyLen, value, valueLen); AFREE(key);}
开发者ID:0-14N,项目名称:NDroid,代码行数:10,
示例29: glooptimer_freestatic voidglooptimer_free(void* impl){ GLoopTimer* tt = impl; if (tt->deadline != DURATION_INFINITE) glooptimer_stop(tt); glooper_delTimer(tt->looper, tt); AFREE(tt);}
开发者ID:0-14N,项目名称:NDroid,代码行数:11,
注:本文中的AFREE函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ AFS_FS_I函数代码示例 C++ AFFS_SB函数代码示例 |