您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ASTRDUP函数代码示例

51自学网 2021-06-01 19:38:11
  C++
这篇教程C++ ASTRDUP函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ASTRDUP函数的典型用法代码示例。如果您正苦于以下问题:C++ ASTRDUP函数的具体用法?C++ ASTRDUP怎么用?C++ ASTRDUP使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ASTRDUP函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: avdInfo_newForAndroidBuild

AvdInfo*avdInfo_newForAndroidBuild( const char*     androidBuildRoot,                            const char*     androidOut,                            AvdInfoParams*  params ){    AvdInfo*  i;    ANEW0(i);    i->inAndroidBuild   = 1;    i->androidBuildRoot = ASTRDUP(androidBuildRoot);    i->androidOut       = ASTRDUP(androidOut);    i->contentPath      = ASTRDUP(androidOut);    i->targetArch       = path_getBuildTargetArch(i->androidOut);    i->apiLevel         = path_getBuildTargetApiLevel(i->androidOut);    /* TODO: find a way to provide better information from the build files */    i->deviceName = ASTRDUP("<build>");    /* There is no config.ini in the build */    i->configIni = NULL;    if (_avdInfo_getCoreHwIniPath(i, i->androidOut) < 0 )        goto FAIL;    /* Read the build skin's hardware.ini, if any */    _avdInfo_getBuildSkinHardwareIni(i);    return i;FAIL:    avdInfo_free(i);    return NULL;}
开发者ID:bindassdost,项目名称:razrd,代码行数:34,


示例2: camera_device_open

CameraDevice*camera_device_open(const char* name, int inp_channel){    struct v4l2_cropcap cropcap;    struct v4l2_crop crop;    LinuxCameraDevice* cd;    /* Allocate and initialize the descriptor. */    cd = _camera_device_alloc();    //cd->device_name = name != NULL ? ASTRDUP(name) : ASTRDUP("/dev/video0");    //Gemdroid added    cd->device_name = name != NULL ? ASTRDUP(name) : ASTRDUP("/dev/video1");    //Gemdroid added    cd->input_channel = inp_channel;    /* Open the device. */    if (_camera_device_open(cd)) {        _camera_device_free(cd);        return NULL;    }    /* Select video input, video standard and tune here. */    cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;    _xioctl(cd->handle, VIDIOC_CROPCAP, &cropcap);    crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;    crop.c = cropcap.defrect; /* reset to default */    _xioctl (cd->handle, VIDIOC_S_CROP, &crop);    return &cd->header;}
开发者ID:abhinavjayanthy,项目名称:GemDroid,代码行数:30,


示例3: path_get_absolute

char*path_get_absolute( const char* path ){    if (path_is_absolute(path)) {        return ASTRDUP(path);    }#ifdef _WIN32    {        char* result;        int   pathLen    = strlen(path);        int   currentLen = GetCurrentDirectory(0, NULL);        if (currentLen <= 0) {            /* Could not get size of working directory. something is             * really fishy here, return a simple copy */            return ASTRDUP(path);        }        result = malloc(currentLen + pathLen + 2);        GetCurrentDirectory(currentLen+1, result);        if (currentLen == 0 || result[currentLen-1] != '//') {            result[currentLen++] = '//';        }        memcpy(result + currentLen, path, pathLen+1);        return result;    }#else    {        int   pathLen    = strlen(path);        char  currentDir[PATH_MAX];        int   currentLen;        char* result;        if (getcwd(currentDir, sizeof(currentDir)) == NULL) {            /* Could not get the current working directory. something is really            * fishy here, so don't do anything and return a copy */            return ASTRDUP(path);        }        /* Make a new path with <current-path>/<path> */        currentLen = strlen(currentDir);        result     = malloc(currentLen + pathLen + 2);        memcpy(result, currentDir, currentLen);        if (currentLen == 0 || result[currentLen-1] != '/') {            result[currentLen++] = '/';        }        memcpy(result + currentLen, path, pathLen+1);        return result;    }#endif}
开发者ID:Dazdin9o,项目名称:DECAF,代码行数:55,


示例4: _checkSkinSkinsDir

/* Check that there is a skin named 'skinName' listed from 'skinDirRoot' * this returns the full path of the skin directory (after alias expansions), * including the skin name, or NULL on failure. */static char*_checkSkinSkinsDir( const char*  skinDirRoot,                    const char*  skinName ){    DirScanner*  scanner;    char*        result;    char         temp[MAX_PATH], *p = temp, *end = p + sizeof(temp);    p = bufprint(temp, end, "%s/skins/%s", skinDirRoot, skinName);    DD("Probing skin directory: %s", temp);    if (p >= end || !path_exists(temp)) {        DD("    ignore bad skin directory %s", temp);        return NULL;    }    /* first, is this a normal skin directory ? */    if (_checkSkinPath(temp)) {        /* yes */        DD("    found skin directory: %s", temp);        return ASTRDUP(temp);    }    /* second, is it an alias to another skin ? */    *p      = 0;    result  = NULL;    scanner = dirScanner_new(temp);    if (scanner != NULL) {        for (;;) {            const char*  file = dirScanner_next(scanner);            if (file == NULL)                break;            if (strncmp(file, "alias-", 6) || file[6] == 0)                continue;            p = bufprint(temp, end, "%s/skins/%s", skinDirRoot, file+6);            if (p < end && _checkSkinPath(temp)) {                /* yes, it's an alias */                DD("    skin alias '%s' points to skin directory: %s",                   file+6, temp);                result = ASTRDUP(temp);                break;            }        }        dirScanner_free(scanner);    }    return result;}
开发者ID:bindassdost,项目名称:razrd,代码行数:53,


示例5: _getFullFilePath

/* TODO: Put in shared source file */static char*_getFullFilePath( const char* rootPath, const char* fileName ){    if (path_is_absolute(fileName)) {        return ASTRDUP(fileName);    } else {        char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);        p = bufprint(temp, end, "%s/%s", rootPath, fileName);        if (p >= end) {            return NULL;        }        return ASTRDUP(temp);    }}
开发者ID:MarvelHq,项目名称:DECAF,代码行数:16,


示例6: _wecam_setup

/* Initialized webcam emulation record in camera service descriptor. * Param: *  csd - Camera service descriptor to initialize a record in. *  disp_name - Display name of a web camera ('webcam<N>') to use for emulation. *  dir - Direction ('back', or 'front') that emulated camera is facing. *  ci, ci_cnt - Array of webcam information for enumerated web cameras connected *      to the host. */static void_wecam_setup(CameraServiceDesc* csd,             const char* disp_name,             const char* dir,             CameraInfo* ci,             int ci_cnt){    /* Find webcam record in the list of enumerated web cameras. */    CameraInfo* found = _camera_info_get_by_display_name(disp_name, ci, ci_cnt);    if (found == NULL) {        W("Camera name '%s' is not found in the list of connected cameras./n"          "Use '-webcam-list' emulator option to obtain the list of connected camera names./n",          disp_name);        return;    }    /* Save to the camera info array that will be used by the service. */    memcpy(csd->camera_info + csd->camera_count, found, sizeof(CameraInfo));    /* This camera is taken. */    found->in_use = 1;    /* Update direction parameter. */    if (csd->camera_info[csd->camera_count].direction != NULL) {        free(csd->camera_info[csd->camera_count].direction);    }    csd->camera_info[csd->camera_count].direction = ASTRDUP(dir);    D("Camera %d '%s' connected to '%s' facing %s using %.4s pixel format",      csd->camera_count, csd->camera_info[csd->camera_count].display_name,      csd->camera_info[csd->camera_count].device_name,      csd->camera_info[csd->camera_count].direction,      (const char*)(&csd->camera_info[csd->camera_count].pixel_format));      csd->camera_count++;}
开发者ID:3a9LL,项目名称:panda,代码行数:40,


示例7: _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,


示例8: enumerate_camera_devices

intenumerate_camera_devices(CameraInfo* cis, int max){    char dev_name[24];    int found = 0;    int n;    for (n = 0; n < max; n++) {        CameraDevice* cd;        sprintf(dev_name, "/dev/video%d", n);        cd = camera_device_open(dev_name, 0);        if (cd != NULL) {            LinuxCameraDevice* lcd = (LinuxCameraDevice*)cd->opaque;            if (!_camera_device_get_info(lcd, cis + found)) {                char user_name[24];                sprintf(user_name, "webcam%d", found);                cis[found].display_name = ASTRDUP(user_name);                cis[found].in_use = 0;                found++;            }            camera_device_close(cd);        } else {            break;        }    }    return found;}
开发者ID:abhinavjayanthy,项目名称:GemDroid,代码行数:29,


示例9: _avdInfo_getSdkFilePath

/* Search a file in the SDK search directories. Return NULL if not found, * or a strdup() otherwise. */static char*_avdInfo_getSdkFilePath(AvdInfo*  i, const char*  fileName){    char temp[MAX_PATH], *p = temp, *end = p + sizeof(temp);    do {        /* try the search paths */        int  nn;        for (nn = 0; nn < i->numSearchPaths; nn++) {            const char* searchDir = i->searchPaths[nn];            p = bufprint(temp, end, "%s/%s", searchDir, fileName);            if (p < end && path_exists(temp)) {                DD("found %s in search dir: %s", fileName, searchDir);                goto FOUND;            }            DD("    no %s in search dir: %s", fileName, searchDir);        }        return NULL;    } while (0);FOUND:    return ASTRDUP(temp);}
开发者ID:bindassdost,项目名称:razrd,代码行数:30,


示例10: avdInfo_getKernelPath

char*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,


示例11: _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,


示例12: find_target_compiler

/* Find target compiler using a path from COLLECT_GCC or COMPILER_PATH.  */static char *find_target_compiler (const char *name){  bool found = false;  char **paths = NULL;  unsigned n_paths, i;  char *target_compiler;  const char *collect_gcc = getenv ("COLLECT_GCC");  const char *gcc_path = dirname (ASTRDUP (collect_gcc));  const char *gcc_exec = basename (ASTRDUP (collect_gcc));  if (strcmp (gcc_exec, collect_gcc) == 0)    {      /* collect_gcc has no path, so it was found in PATH.  Make sure we also	 find accel-gcc in PATH.  */      target_compiler = XDUPVEC (char, name, strlen (name) + 1);      found = true;      goto out;    }
开发者ID:AHelper,项目名称:gcc,代码行数:20,


示例13: path_getBuildBootProp

char* path_getBuildBootProp(const char* androidOut) {    char temp[MAX_PATH], *p = temp, *end = p + sizeof(temp);    p = bufprint(temp, end, "%s/boot.prop", androidOut);    if (p >= end) {        D("ANDROID_BUILD_OUT is too long: %s/n", androidOut);        return NULL;    }    if (!path_exists(temp)) {        D("Cannot find boot properties file: %s/n", temp);        return NULL;    }    return ASTRDUP(temp);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:13,


示例14: camera_device_open

CameraDevice*camera_device_open(const char* name, int inp_channel){    WndCameraDevice* wcd;    /* Allocate descriptor and initialize windows-specific fields. */    wcd = _camera_device_alloc();    if (wcd == NULL) {        E("%s: Unable to allocate WndCameraDevice instance", __FUNCTION__);        return NULL;    }    wcd->window_name = (name != NULL) ? ASTRDUP(name) :                                        ASTRDUP(_default_window_name);    if (wcd->window_name == NULL) {        E("%s: Unable to save window name", __FUNCTION__);        _camera_device_free(wcd);        return NULL;    }    wcd->input_channel = inp_channel;    /* Create capture window that is a child of HWND_MESSAGE window.     * We make it invisible, so it doesn't mess with the UI. Also     * note that we supply standard HWND_MESSAGE window handle as     * the parent window, since we don't want video capturing     * machinery to be dependent on the details of our UI. */    wcd->cap_window = capCreateCaptureWindow(wcd->window_name, WS_CHILD, 0, 0,                                             0, 0, HWND_MESSAGE, 1);    if (wcd->cap_window == NULL) {        E("%s: Unable to create video capturing window '%s': %d",          __FUNCTION__, wcd->window_name, GetLastError());        _camera_device_free(wcd);        return NULL;    }    /* Save capture window descriptor as window's user data. */    capSetUserData(wcd->cap_window, wcd);    return &wcd->header;}
开发者ID:0omega,项目名称:platform_external_qemu,代码行数:38,


示例15: _avdInfo_getContentFilePath

/* Look for a named file inside the AVD's content directory. * Returns NULL if it doesn't exist, or a strdup() copy otherwise. */static char*_avdInfo_getContentFilePath(AvdInfo*  i, const char* fileName){    char temp[MAX_PATH], *p = temp, *end = p + sizeof(temp);    p = bufprint(p, end, "%s/%s", i->contentPath, fileName);    if (p >= end) {        derror("can't access virtual device content directory");        return NULL;    }    if (!path_exists(temp)) {        return NULL;    }    return ASTRDUP(temp);}
开发者ID:bindassdost,项目名称:razrd,代码行数:18,


示例16: path_getRootIniPath

/* Return the path to the AVD's root configuration .ini file. it is located in * ~/.android/avd/<name>.ini or Windows equivalent * * This file contains the path to the AVD's content directory, which * includes its own config.ini. */char*path_getRootIniPath( const char*  avdName ){    char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);    p = bufprint_config_path(temp, end);    p = bufprint(p, end, PATH_SEP ANDROID_AVD_DIR PATH_SEP "%s.ini", avdName);    if (p >= end) {        return NULL;    }    if (!path_exists(temp)) {        return NULL;    }    return ASTRDUP(temp);}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:21,


示例17: avdInfo_getTracePath

char*avdInfo_getTracePath( AvdInfo*  i, const char*  traceName ){    char   tmp[MAX_PATH], *p=tmp, *end=p + sizeof(tmp);    if (i == NULL || traceName == NULL || traceName[0] == 0)        return NULL;    if (i->inAndroidBuild) {        p = bufprint( p, end, "%s" PATH_SEP "traces" PATH_SEP "%s",                      i->androidOut, traceName );    } else {        p = bufprint( p, end, "%s" PATH_SEP "traces" PATH_SEP "%s",                      i->contentPath, traceName );    }    return ASTRDUP(tmp);}
开发者ID:bindassdost,项目名称:razrd,代码行数:17,


示例18: _getSkinPathFromName

/* try to see if the skin name leads to a magic skin or skin path directly * returns 1 on success, 0 on error. * * on success, this sets up '*pSkinName' and '*pSkinDir' */static int_getSkinPathFromName( const char*  skinName,                      const char*  sdkRootPath,                      char**       pSkinName,                      char**       pSkinDir ){    char  temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);    /* if the skin name has the format 'NNNNxNNN' where    * NNN is a decimal value, then this is a 'magic' skin    * name that doesn't require a skin directory    */    if (isdigit(skinName[0])) {        int  width, height;        if (sscanf(skinName, "%dx%d", &width, &height) == 2) {            D("'magic' skin format detected: %s", skinName);            *pSkinName = ASTRDUP(skinName);            *pSkinDir  = NULL;            return 1;        }    }    /* is the skin name a direct path to the skin directory ? */    if (path_is_absolute(skinName) && _checkSkinPath(skinName)) {        goto FOUND_IT;    }    /* is the skin name a relative path from the SDK root ? */    p = bufprint(temp, end, "%s/%s", sdkRootPath, skinName);    if (p < end && _checkSkinPath(temp)) {        skinName = temp;        goto FOUND_IT;    }    /* nope */    return 0;FOUND_IT:    if (path_split(skinName, pSkinDir, pSkinName) < 0) {        derror("malformed skin name: %s", skinName);        exit(2);    }    D("found skin '%s' in directory: %s", *pSkinName, *pSkinDir);    return 1;}
开发者ID:bindassdost,项目名称:razrd,代码行数:50,


示例19: create_tmp_var_name

treecreate_tmp_var_name (const char *prefix){  char *tmp_name;  if (prefix)    {      char *preftmp = ASTRDUP (prefix);      remove_suffix (preftmp, strlen (preftmp));      clean_symbol_name (preftmp);      prefix = preftmp;    }  ASM_FORMAT_PRIVATE_NAME (tmp_name, prefix ? prefix : "T", tmp_var_id_num++);  return get_identifier (tmp_name);}
开发者ID:WojciechMigda,项目名称:gcc,代码行数:18,


示例20: _camera_device_get_info

/* Collects information about an opened camera device. * The information collected in this routine contains list of pixel formats, * supported by the device, and list of frame dimensions supported by the camera * for each pixel format. * Param: *  cd - Opened camera device descriptor. *  cis - Upon success contains information collected from the camera device. * Return: *  0 on success, != 0 on failure. */static int_camera_device_get_info(LinuxCameraDevice* cd, CameraInfo* cis){    int f;    int chosen = -1;    QemuPixelFormat* formats = NULL;    int num_pix_fmts = _camera_device_enum_pixel_formats(cd, &formats);    if (num_pix_fmts <= 0) {        return -1;    }    /* Lets see if camera supports preferred formats */    for (f = 0; f < _preferred_format_num; f++) {                chosen = _get_format_index(_preferred_formats[f], formats, num_pix_fmts);        if (chosen >= 0) {            printf("chosen :::%d, f:::::%d/n", chosen, f);            break;        }    }    if (chosen < 0) {        /* Camera doesn't support any of the chosen formats. Then it doesn't         * matter which one we choose. Lets choose the first one. */        chosen = 0;    }    cis->device_name = ASTRDUP(cd->device_name);    cis->inp_channel = cd->input_channel;    cis->pixel_format = formats[chosen].format;    cis->frame_sizes_num = formats[chosen].dim_num;    /* Swap instead of copy. */    cis->frame_sizes = formats[chosen].dims;    formats[chosen].dims = NULL;    cis->in_use = 0;    for (f = 0; f < num_pix_fmts; f++) {        _qemu_pixel_format_free(formats + f);    }    free(formats);    return 0;}
开发者ID:abhinavjayanthy,项目名称:GemDroid,代码行数:52,


示例21: avdInfo_new

AvdInfo*avdInfo_new( const char*  name, AvdInfoParams*  params ){    AvdInfo*  i;    if (name == NULL)        return NULL;    if (!_checkAvdName(name)) {        derror("virtual device name contains invalid characters");        exit(1);    }    ANEW0(i);    i->deviceName = ASTRDUP(name);    if ( _avdInfo_getSdkRoot(i) < 0     ||            _avdInfo_getRootIni(i) < 0     ||            _avdInfo_getContentPath(i) < 0 ||            _avdInfo_getConfigIni(i)   < 0 ||            _avdInfo_getCoreHwIniPath(i, i->contentPath) < 0 )        goto FAIL;    i->apiLevel = _avdInfo_getApiLevel(i);    /* look for image search paths. handle post 1.1/pre cupcake     * obsolete SDKs.     */    _avdInfo_getSearchPaths(i);    /* don't need this anymore */    iniFile_free(i->rootIni);    i->rootIni = NULL;    return i;FAIL:    avdInfo_free(i);    return NULL;}
开发者ID:jvaemape,项目名称:qemu-android,代码行数:40,


示例22: qemud_service_new

/* Create a new QemudService object */static QemudService*qemud_service_new( const char*          name,                   int                  max_clients,                   void*                serv_opaque,                   QemudServiceConnect  serv_connect,                   QemudService**       pservices ){    QemudService*  s;    ANEW0(s);    s->name        = ASTRDUP(name);    s->max_clients = max_clients;    s->num_clients = 0;    s->clients     = NULL;    s->serv_opaque  = serv_opaque;    s->serv_connect = serv_connect;    s->next    = *pservices;    *pservices = s;    return s;}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:24,


示例23: _getAvdContentPath

static char*_getAvdContentPath(const char* avdName){    char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);    IniFile* ini = NULL;    char*    iniPath = path_getRootIniPath(avdName);    char*    avdPath = NULL;    if (iniPath != NULL) {        ini = iniFile_newFromFile(iniPath);        AFREE(iniPath);    }    if (ini == NULL) {        APANIC("Could not open: %s/n", iniPath == NULL ? avdName : iniPath);    }    avdPath = iniFile_getString(ini, ROOT_ABS_PATH_KEY, NULL);    if (!path_is_dir(avdPath)) {        // If the absolute path doesn't match an actual directory, try        // the relative path if present.        const char* relPath = iniFile_getString(ini, 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(avdPath);                avdPath = ASTRDUP(temp);            }        }    }    iniFile_free(ini);    return avdPath;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:37,


示例24: propertyFile_getTargetArch

char*propertyFile_getTargetArch(const FileData* data) {    char* ret = propertyFile_getTargetAbi(data);    if (ret) {        // Translate ABI name into architecture name.        // By default, there are the same with a few exceptions.        static const struct {            const char* input;            const char* output;        } kData[] = {            { "armeabi", "arm" },            { "armeabi-v7a", "arm" },        };        size_t n;        for (n = 0; n < sizeof(kData)/sizeof(kData[0]); ++n) {            if (!strcmp(ret, kData[n].input)) {                free(ret);                ret = ASTRDUP(kData[n].output);                break;            }        }    }    return ret;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:24,


示例25: path_getSdkRoot

/* Return the path to the Android SDK root installation. * * (*pFromEnv) will be set to 1 if it comes from the $ANDROID_SDK_ROOT * environment variable, or 0 otherwise. * * Caller must free() returned string. */char*path_getSdkRoot( char *pFromEnv ){    const char*  env;    char*        sdkPath;    char         temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);    /* If ANDROID_SDK_ROOT is defined is must point to a directory     * containing a valid SDK installation.     */#define  SDK_ROOT_ENV  "ANDROID_SDK_ROOT"    env = getenv(SDK_ROOT_ENV);    if (env != NULL && env[0] != 0) {        if (path_exists(env)) {            D("found " SDK_ROOT_ENV ": %s", env);            *pFromEnv = 1;            return ASTRDUP(env);        }        D(SDK_ROOT_ENV " points to unknown directory: %s", env);    }    *pFromEnv = 0;    /* We assume the emulator binary is under tools/ so use its     * parent as the Android SDK root.     */    (void) bufprint_app_dir(temp, end);    sdkPath = path_parent(temp, 1);    if (sdkPath == NULL) {        derror("can't find root of SDK directory");        return NULL;    }    D("found SDK root at %s", sdkPath);    return sdkPath;}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:43,



注:本文中的ASTRDUP函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ AST_APP_ARG函数代码示例
C++ ASTRA_ASSERT函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。