本文整理汇总了C++中bufprint函数的典型用法代码示例。如果您正苦于以下问题:C++ bufprint函数的具体用法?C++ bufprint怎么用?C++ bufprint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bufprint函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: bufprint_temp_file
char*
bufprint_temp_file(char* buff, char* end, const char* suffix)
{
char* p;
p = bufprint_temp_dir(buff, end);
p = bufprint(p, end, PATH_SEP "%s", suffix);
return p;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:8,代码来源:bufprint.c
示例2: 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:ACSOP,项目名称:android_external_qemu,代码行数:17,代码来源:info.c
示例3: bufprint_config_file
char*
bufprint_config_file(char* buff, char* end, const char* suffix)
{
char* p;
p = bufprint_config_path(buff, end);
p = bufprint(p, end, PATH_SEP "%s", suffix);
return p;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:8,代码来源:bufprint.c
示例4: scan_timezone_dir
static const char*
scan_timezone_dir( ScanDataRec* scan,
char* top,
int depth )
{
DIR* d = opendir( scan->path );
const char* result = NULL;
D( "%s: entering '%s\n", __FUNCTION__, scan->path );
if (d != NULL) {
struct dirent* ent;
while ((ent = readdir(d)) != NULL) {
struct stat ent_st;
char* p = top;
if (ent->d_name[0] == '.') /* avoid hidden and special files */
continue;
p = bufprint( p, scan->path_end, "/%s", ent->d_name );
if (p >= scan->path_end)
continue;
//D( "%s: scanning '%s'\n", __FUNCTION__, scan->path );
if ( stat( scan->path, &ent_st ) < 0 )
continue;
if ( S_ISDIR(ent_st.st_mode) && depth < 2 )
{
//D( "%s: directory '%s'\n", __FUNCTION__, scan->path );
result = scan_timezone_dir( scan, p, depth + 1 );
if (result != NULL)
break;
}
else if ( S_ISREG(ent_st.st_mode) && (depth >= 1 && depth <= 2) )
{
char* name = scan->path_root + 1;
if ( check_timezone_is_zoneinfo( name ) )
{
if (compare_timezone_to_localtime( scan, scan->path ))
{
result = strdup( name );
D( "%s: found '%s'\n", __FUNCTION__, result );
break;
}
}
else
{
//D( "%s: ignoring '%s'\n", __FUNCTION__, scan->path );
}
}
}
closedir(d);
}
return result;
}
开发者ID:Katarzynasrom,项目名称:patch-hosting-for-android-x86-support,代码行数:57,代码来源:timezone.c
示例5: eventList_bufprintCode
static char*
eventList_bufprintCode( EventList list,
int index,
char* buf,
char* bufend )
{
if (list == NULL)
return buf;
return bufprint(buf, bufend, "%s", list[index].name);
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:11,代码来源:hw-events.c
示例6: _checkSkinPath
/* check that a given directory contains a valid skin.
* returns 1 on success, 0 on failure.
*/
static int
_checkSkinPath( const char* skinPath )
{
char temp[MAX_PATH], *p=temp, *end=p+sizeof(temp);
/* for now, if it has a 'layout' file, it is a valid skin path */
p = bufprint(temp, end, "%s/layout", skinPath);
if (p >= end || !path_exists(temp))
return 0;
return 1;
}
开发者ID:bindassdost,项目名称:razrd,代码行数:15,代码来源:info.c
示例7: _getSdkImage
static char*
_getSdkImage( const char* path, const char* file )
{
char temp[MAX_PATH];
char *p = temp, *end = p + sizeof(temp);
p = bufprint(temp, end, "%s/%s", path, file);
if (p >= end || !path_exists(temp))
return NULL;
return android_strdup(temp);
}
开发者ID:MIPS,项目名称:external-qemu,代码行数:12,代码来源:main-ui.c
示例8: skin_ui_reset_title
void skin_ui_reset_title(SkinUI* ui) {
char temp[128], *p=temp, *end = p + sizeof(temp);
if (ui->window == NULL)
return;
if (ui->show_trackball) {
SkinKeyBinding bindings[SKIN_KEY_COMMAND_MAX_BINDINGS];
int count = skin_keyset_get_bindings(skin_keyset_get_default(),
SKIN_KEY_COMMAND_TOGGLE_TRACKBALL,
bindings);
if (count > 0) {
int nn;
p = bufprint(p, end, "Press ");
for (nn = 0; nn < count; nn++) {
if (nn > 0) {
if (nn < count-1)
p = bufprint(p, end, ", ");
else
p = bufprint(p, end, " or ");
}
p = bufprint(p, end, "%s",
skin_key_pair_to_string(bindings[nn].sym,
bindings[nn].mod));
}
p = bufprint(p, end, " to leave trackball mode. ");
}
}
p = bufprint(p, end, "%s", ui->ui_params.window_name);
skin_window_set_title(ui->window, temp);
}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:33,代码来源:ui.c
示例9: 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,代码来源:util.c
示例10: bufprint_temp_dir
char*
bufprint_temp_dir(char* buff, char* end)
{
#ifdef _WIN32
char path[MAX_PATH];
DWORD retval;
retval = GetTempPath( sizeof(path), path );
if (retval > sizeof(path) || retval == 0) {
D( "can't locate TEMP directory" );
strncpy(path, "C:\\Temp", sizeof(path) );
}
strncat( path, "\\AndroidEmulator", sizeof(path)-1 );
path_mkdir(path, 0744);
return bufprint(buff, end, "%s", path);
#else
const char* tmppath = "/tmp/android";
mkdir(tmppath, 0744);
return bufprint(buff, end, "%s", tmppath );
#endif
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:22,代码来源:bufprint.c
示例11: bufprint_config_path
char*
bufprint_config_path(char* buff, char* end)
{
#ifdef _WIN32
const char* home = getenv("ANDROID_SDK_HOME");
if (home != NULL) {
return bufprint(buff, end, "%s\\%s", home, _ANDROID_PATH );
} else {
char path[MAX_PATH];
SHGetFolderPath( NULL, CSIDL_PROFILE,
NULL, 0, path);
return bufprint(buff, end, "%s\\%s", path, _ANDROID_PATH );
}
#else
const char* home = getenv("ANDROID_SDK_HOME");
if (home == NULL)
home = getenv("HOME");
if (home == NULL)
home = "/tmp";
return bufprint(buff, end, "%s/%s", home, _ANDROID_PATH );
#endif
}
开发者ID:flwh,项目名称:Alcatel_OT_985_kernel,代码行数:24,代码来源:bufprint.c
示例12: _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,代码来源:main.c
示例13: 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,代码来源:util.c
示例14: _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,代码来源:info.c
示例15: cdebbuf_alloc
_cdebbuf *capi_cmsg2str(_cmsg * cmsg)
{
_cdebbuf *cdb;
cdb = cdebbuf_alloc();
if (!cdb)
return NULL;
cmsg->l = 8;
cmsg->p = 0;
cdb = bufprint(cdb, "%s ID=%03d #0x%04x LEN=%04d\n",
mnames[command_2_index(cmsg->Command, cmsg->Subcommand)],
((u16 *) cmsg->m)[1],
((u16 *) cmsg->m)[3],
((u16 *) cmsg->m)[0]);
cdb = protocol_message_2_pars(cdb, cmsg, 1);
return cdb;
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:17,代码来源:capiutil.c
示例16: _dirScannerInit
static int
_dirScannerInit( DirScanner* s )
{
char* p = s->root + s->rootLen;
char* end = s->root + sizeof s->root;
int ret;
/* create file spec by appending \* to root */
p = bufprint(p, end, "\\*");
if (p >= end)
return -1;
ret = _findfirst(s->root, &s->findData);
s->findIndex1 = ret+1;
return ret;
}
开发者ID:0-14N,项目名称:NDroid,代码行数:17,代码来源:dirscanner.c
示例17: _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,代码来源:info.c
示例18: avdInfo_getSkinHardwareIni
int avdInfo_getSkinHardwareIni( AvdInfo* i, char* skinName, char* skinDirPath)
{
char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);
p = bufprint(temp, end, "%s/%s/hardware.ini", skinDirPath, skinName);
if (p >= end || !path_exists(temp)) {
DD("no skin-specific hardware.ini in %s", skinDirPath);
return 0;
}
D("found skin-specific hardware.ini: %s", temp);
if (i->skinHardwareIni != NULL)
iniFile_free(i->skinHardwareIni);
i->skinHardwareIni = iniFile_newFromFile(temp);
if (i->skinHardwareIni == NULL)
return -1;
return 0;
}
开发者ID:bindassdost,项目名称:razrd,代码行数:19,代码来源:info.c
示例19: _getAvdTargetArch
static char*
_getAvdTargetArch(const char* avdPath)
{
IniFile* ini;
char* targetArch = NULL;
char temp[PATH_MAX], *p=temp, *end=p+sizeof(temp);
p = bufprint(temp, end, "%s" PATH_SEP "config.ini", avdPath);
if (p >= end) {
APANIC("AVD path too long: %s\n", avdPath);
}
ini = iniFile_newFromFile(temp);
if (ini == NULL) {
APANIC("Could not open AVD config file: %s\n", temp);
}
targetArch = iniFile_getString(ini, "hw.cpu.arch", "arm");
iniFile_free(ini);
return targetArch;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_external_qemu,代码行数:19,代码来源:util.c
示例20: dirScanner_nextFull
const char*
dirScanner_nextFull( DirScanner* s )
{
const char* name = dirScanner_next(s);
char* p;
char* end;
if (name == NULL)
return NULL;
p = s->full;
end = p + sizeof s->full;
p = bufprint(p, end, "%.*s/%s", s->rootLen, s->root, name);
if (p >= end) {
/* ignore if the full name is too long */
return dirScanner_nextFull(s);
}
return s->full;
}
开发者ID:0-14N,项目名称:NDroid,代码行数:20,代码来源:dirscanner.c
注:本文中的bufprint函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论