这篇教程C++ str_sprintf函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中str_sprintf函数的典型用法代码示例。如果您正苦于以下问题:C++ str_sprintf函数的具体用法?C++ str_sprintf怎么用?C++ str_sprintf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了str_sprintf函数的21个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: getGlobalsshort ExExeUtilTcb::alterObjectState(NABoolean online, char * tableName, char * failReason, NABoolean forPurgedata){ char buf[4000]; Lng32 cliRC = 0; // Get the globals stucture of the master executor. ExExeStmtGlobals *exeGlob = getGlobals()->castToExExeStmtGlobals(); ExMasterStmtGlobals *masterGlob = exeGlob->castToExMasterStmtGlobals(); // make object online str_sprintf(buf, "ALTER TABLE %s %s %s", tableName, (online ? "ONLINE" : "OFFLINE"), (forPurgedata ? "FOR PURGEDATA" : " ")); // set sqlparserflags to allow 'FOR PURGEDATA' syntax masterGlob->getStatement()->getContext()->setSqlParserFlags(0x1); cliRC = cliInterface()->executeImmediate(buf); masterGlob->getStatement()->getContext()->resetSqlParserFlags(0x1); if (cliRC < 0) { str_sprintf(failReason, "Could not alter the state of table %s to %s.", tableName, (online ? "online" : "offline")); return -1; } return 0;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:35,
示例2: log_messagevoid log_message(LogLevel level, const char* function, int line, const char* msg, ...) { if (level < logger.level) return; char buffer[LOG_BUFFER_SIZE]; va_list va; int preffixSize; time_format(buffer, "[%Y:%m:%d-%H:%M:%S]"); str_sprintf(buffer, "%s %s %s ", buffer, log_getLevelStr(level), logger.program, function, line); if (logger.develOutput) str_sprintf(buffer, "%s[%s:%i] ", buffer, function, line); preffixSize = str_len(buffer); va_start(va, msg); vsnprintf(buffer + preffixSize, LOG_BUFFER_SIZE - preffixSize, msg, va); va_end(va); if (logger.stdOutput) puts(buffer); if (logger.logFileFd) { file_write(logger.logFileFd, buffer, str_len(buffer)); file_write(logger.logFileFd, "/n", 1); }}
开发者ID:gvsurenderreddy,项目名称:openulteo,代码行数:29,
示例3: getenvvoid SqlciEnv::sqlmxRegress(){ char * regr = getenv("SQLMX_REGRESS"); if (regr) { char buf[1000]; str_sprintf(buf, "set envvar sqlmx_regress %s;", regr); SqlCmd::executeQuery(buf, this); if (!specialError_) { char *noexit = getenv("SQL_MXCI_NO_EXIT_ON_COMPILER_STARTUP_ERROR"); if (!noexit) exit(EXIT_FAILURE); } str_sprintf(buf, "cqd sqlmx_regress 'ON';"); SqlCmd::executeQuery(buf, this); if (!specialError_) { char *noexit = getenv("SQL_MXCI_NO_EXIT_ON_COMPILER_STARTUP_ERROR"); if (!noexit) exit(EXIT_FAILURE); } }}
开发者ID:XueminZhu,项目名称:incubator-trafodion,代码行数:26,
示例4: str_initstatic str *call_update_lookup_udp(char **out, struct callmaster *m, enum call_opmode opmode) { struct call *c; struct call_monologue *monologue; GQueue q = G_QUEUE_INIT; struct stream_params sp; str *ret, callid, viabranch, fromtag, totag = STR_NULL; int i; str_init(&callid, out[RE_UDP_UL_CALLID]); str_init(&viabranch, out[RE_UDP_UL_VIABRANCH]); str_init(&fromtag, out[RE_UDP_UL_FROMTAG]); if (opmode == OP_ANSWER) str_init(&totag, out[RE_UDP_UL_TOTAG]); c = call_get_opmode(&callid, m, opmode); if (!c) { ilog(LOG_WARNING, "["STR_FORMAT"] Got UDP LOOKUP for unknown call-id", STR_FMT(&callid)); return str_sprintf("%s 0 0.0.0.0/n", out[RE_UDP_COOKIE]); } monologue = call_get_mono_dialogue(c, &fromtag, &totag); if (!monologue) goto ml_fail; if (addr_parse_udp(&sp, out)) goto addr_fail; g_queue_push_tail(&q, &sp); i = monologue_offer_answer(monologue, &q, NULL); g_queue_clear(&q); if (i) goto unlock_fail; ret = streams_print(&monologue->active_dialogue->medias, sp.index, sp.index, out[RE_UDP_COOKIE], SAF_UDP); rwlock_unlock_w(&c->master_lock); redis_update(c, m->conf.redis); ilog(LOG_INFO, "Returning to SIP proxy: "STR_FORMAT"", STR_FMT(ret)); goto out;ml_fail: ilog(LOG_ERR, "Invalid dialogue association"); goto unlock_fail;addr_fail: ilog(LOG_ERR, "Failed to parse a media stream: %s/%s:%s", out[RE_UDP_UL_ADDR4], out[RE_UDP_UL_ADDR6], out[RE_UDP_UL_PORT]); goto unlock_fail;unlock_fail: rwlock_unlock_w(&c->master_lock); ret = str_sprintf("%s E8/n", out[RE_UDP_COOKIE]);out: obj_put(c); return ret;}
开发者ID:kupishkis,项目名称:rtpengine,代码行数:59,
示例5: dropOneTable// *****************************************************************************// * *// * Function: dropOneTable *// * *// * Drops a table and all its dependent objects. *// * *// *****************************************************************************// * *// * Parameters: *// * *// * <cliInterface> ExeCliInterface & In *// * is a reference to an Executor CLI interface handle. *// * *// * <catalogName> const char * In *// * is the catalog of the table to drop. *// * *// * <schemaName> const char * In *// * is the schema of the table to drop. *// * *// * <objectName> const char * In *// * is the name of the table to drop. *// * *// * <isVolatile> bool In *// * is true if the object is volatile or part of a volatile schema. *// * *// *****************************************************************************// * *// * Returns: bool *// * *// * true: Could not drop table or one of its dependent objects. *// * false: Drop successful or could not set CQD for NATable cache reload. *// * *// *****************************************************************************static bool dropOneTable( ExeCliInterface & cliInterface, const char * catalogName, const char * schemaName, const char * objectName, bool isVolatile) {char buf [1000];bool someObjectsCouldNotBeDropped = false;char volatileString[20] = {0};Lng32 cliRC = 0; if (isVolatile) strcpy(volatileString,"VOLATILE"); if (ComIsTrafodionExternalSchemaName(schemaName)) str_sprintf(buf,"DROP EXTERNAL TABLE /"%s/" FOR /"%s/"./"%s/"./"%s/" CASCADE", objectName,catalogName,schemaName,objectName); else str_sprintf(buf,"DROP %s TABLE /"%s/"./"%s/"./"%s/" CASCADE", volatileString,catalogName,schemaName,objectName); ULng32 savedParserFlags = Get_SqlParser_Flags(0xFFFFFFFF); try { Set_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL); cliRC = cliInterface.executeImmediate(buf); } catch (...) { // Restore parser flags settings to what they originally were Assign_SqlParser_Flags(savedParserFlags); throw; } // Restore parser flags settings to what they originally were Set_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL); if (cliRC < 0 && cliRC != -CAT_OBJECT_DOES_NOT_EXIST_IN_TRAFODION) someObjectsCouldNotBeDropped = true; // remove NATable entry for this table CorrName cn(objectName,STMTHEAP,schemaName,catalogName); ActiveSchemaDB()->getNATableDB()->removeNATable(cn, NATableDB::REMOVE_FROM_ALL_USERS, COM_BASE_TABLE_OBJECT); return someObjectsCouldNotBeDropped; }
开发者ID:kleopatra999,项目名称:incubator-trafodion,代码行数:90,
示例6: str_sprintf// -----------------------------------------------------------------------// Used by the internal SHOWPLAN command to get attributes of a TDB in a// string.// -----------------------------------------------------------------------NA_EIDPROC void ComTdb::displayContents(Space * space,ULng32 flag){#ifndef __EID char buf[100]; str_sprintf(buf, "Contents of %s [%d]:", getNodeName(),getExplainNodeId()); Int32 j = str_len(buf); space->allocateAndCopyToAlignedSpace(buf, j, sizeof(short)); for (Int32 k = 0; k < j; k++) buf[k] = '-'; buf[j] = '/n'; buf[j+1] = 0; space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); if(flag & 0x00000008) { str_sprintf(buf,"For ComTdb :"); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf,"Class Version = %d, Class Size = %d", getClassVersionID(),getClassSize()); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf,"InitialQueueSizeDown = %d, InitialQueueSizeUp = %d", getInitialQueueSizeDown(),getInitialQueueSizeUp()); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf,"queueResizeLimit = %d, queueResizeFactor = %d", getQueueResizeLimit(),getQueueResizeFactor()); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf, "queueSizeDown = %d, queueSizeUp = %d, numBuffers = %d, bufferSize = %d", getMaxQueueSizeDown(), getMaxQueueSizeUp(), numBuffers_, bufferSize_); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf, "estimatedRowUsed = %f, estimatedRowsAccessed = %f, expressionMode = %d", estRowsUsed_, estRowsAccessed_, expressionMode_); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); str_sprintf(buf, "Flag = %b",flags_); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); if (firstNRows() >= 0) { str_sprintf(buf, "Request Type: GET_N (%d) ", firstNRows()); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); } } #endif if(flag & 0x00000001) { displayExpression(space,flag); displayChildren(space,flag); }}
开发者ID:blfritch-esgyn,项目名称:incubator-trafodion,代码行数:59,
示例7: cliInterfaceshort ExExeUtilLongRunningTcb::processContinuing(Lng32 &rc) { Int64 rowsAffected = 0; rc = cliInterface()->execContinuingRows(getContinuingOutputVarPtrList(), rowsAffected); if (rc < 0) { return -1; } if (rowsAffected > 0) addRowsDeleted(rowsAffected);#ifdef _DEBUG if ((rowsAffected > 0) && lrTdb().longRunningQueryPlan()) { char lruQPInfo[100]; str_sprintf(lruQPInfo, "Continuing rows deleted: %ld/n/n", rowsAffected); ComDiagsArea * diagsArea = getDiagAreaFromUpQueueTail(); (*diagsArea) << DgSqlCode(8427) << DgString0(lruQPInfo); }#endif return 0;}
开发者ID:apache,项目名称:incubator-trafodion,代码行数:32,
示例8: showStrColNamesstatic void showStrColNames(Queue * listOfColNames, Space * space, NABoolean nullTerminated = FALSE){ char buf[1000]; listOfColNames->position(); for (Lng32 j = 0; j < listOfColNames->numEntries(); j++) { char * currPtr = (char*)listOfColNames->getCurr(); char * colNamePtr = NULL; if (nullTerminated) { colNamePtr = currPtr; } else { short colNameLen = *(short*)currPtr; char colName[500]; snprintf(colName,sizeof(colName),"%.*s",colNameLen,currPtr+sizeof(short)); colNamePtr = colName; } str_sprintf(buf, " Entry #%d: %s", j+1, colNamePtr); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); listOfColNames->advance(); } // for}
开发者ID:kleopatra999,项目名称:incubator-trafodion,代码行数:32,
示例9: str_sprintfshort CmpSeabaseDDL::getUsingRoutines(ExeCliInterface *cliInterface, Int64 objUID, Queue * & usingRoutinesQueue){ Lng32 retcode = 0; Lng32 cliRC = 0; char buf[4000]; str_sprintf(buf, "select trim(catalog_name) || '.' || trim(schema_name) || '.' || trim(object_name), object_type " "from %s./"%s/".%s T, %s./"%s/".%s LU " "where LU.using_library_uid = %Ld and " "T.object_uid = LU.used_udr_uid and T.valid_def = 'Y' ", getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS, getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES_USAGE, objUID); usingRoutinesQueue = NULL; cliRC = cliInterface->fetchAllRows(usingRoutinesQueue, buf, 0, FALSE, FALSE, TRUE); if (cliRC < 0) { cliInterface->retrieveSQLDiagnostics(CmpCommon::diags()); return cliRC; } if (usingRoutinesQueue->numEntries() == 0) return 100; return 0;}
开发者ID:kleopatra999,项目名称:incubator-trafodion,代码行数:31,
示例10: str_sprintfInt16 SqlSealogEvent::sendEvent(Int16 eventId, Lng32 slSeverity){ Int32 rc = 0;#ifndef SP_DIS char eventidStr[10]=" "; Lng32 eventidLen = 0; str_sprintf(eventidStr,"10%d%06d",SQEVL_SQL,eventId); str_strip_blanks(eventidStr,eventidLen); Lng32 eventIdVal = (Lng32)str_atoi(eventidStr,eventidLen); common::event_header * eventHeader = sqlInfoEvent_.mutable_header(); common::info_header * infoHeader = eventHeader->mutable_header(); rc = initAMQPInfoHeader(infoHeader, SQEVL_SQL); if (rc) //add trace log return rc; sqlInfoEvent_.mutable_header()->set_event_id(eventIdVal); sqlInfoEvent_.mutable_header()->set_event_severity(slSeverity); setExperienceLevel("ADVANCED"); setTarget("LOGONLY"); AMQPRoutingKey routingKey(SP_EVENT, SP_SQLPACKAGE, SP_INSTANCE, SP_PUBLIC, SP_GPBPROTOCOL, "info_event"); try { rc = sendAMQPMessage(true, sqlInfoEvent_.SerializeAsString(), SP_CONTENT_TYPE_APP, routingKey); } catch(...) { rc = -1; }#endif return rc;}
开发者ID:ryzuo,项目名称:incubator-trafodion,代码行数:31,
示例11: __C_DBGstr *call_delete_udp(char **out, struct callmaster *m) { str callid, branch, fromtag, totag; __C_DBG("got delete for callid '%s' and viabranch '%s'", out[RE_UDP_DQ_CALLID], out[RE_UDP_DQ_VIABRANCH]); str_init(&callid, out[RE_UDP_DQ_CALLID]); str_init(&branch, out[RE_UDP_DQ_VIABRANCH]); str_init(&fromtag, out[RE_UDP_DQ_FROMTAG]); str_init(&totag, out[RE_UDP_DQ_TOTAG]); if (call_delete_branch(m, &callid, &branch, &fromtag, &totag, NULL)) return str_sprintf("%s E8/n", out[RE_UDP_COOKIE]); return str_sprintf("%s 0/n", out[RE_UDP_COOKIE]);}
开发者ID:kupishkis,项目名称:rtpengine,代码行数:16,
示例12: str_sprintfshort CmpSeabaseDDL::dropMetadataViews(ExeCliInterface * cliInterface){ Lng32 cliRC = 0; Lng32 retcode = 0; char queryBuf[5000]; for (Int32 i = 0; i < sizeof(allMDviewsInfo)/sizeof(MDViewInfo); i++) { const MDViewInfo &mdi = allMDviewsInfo[i]; if (! mdi.viewName) continue; str_sprintf(queryBuf, "drop view %s./"%s/".%s", getSystemCatalog(), SEABASE_MD_SCHEMA, mdi.viewName); NABoolean xnWasStartedHere = FALSE; if (beginXnIfNotInProgress(cliInterface, xnWasStartedHere)) return -1; cliRC = cliInterface->executeImmediate(queryBuf); if (cliRC < 0) { cliInterface->retrieveSQLDiagnostics(CmpCommon::diags()); } if (endXnIfStartedHere(cliInterface, xnWasStartedHere, cliRC) < 0) return -1; } // for return 0;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:35,
示例13: str_sprintf//----------------------------------------------------------------------// Name : sortSendEnd// // Parameters : ...//// Description : //// Return Value :// SORT_SUCCESS if everything goes on well.// SORT_FAILURE if any error encounterd. ////----------------------------------------------------------------------Lng32 SortUtil::sortSendEnd(NABoolean& internalSort){ Lng32 retcode = SORT_SUCCESS; state_ = SORT_SEND_END; retcode = sortAlgo_->sortSendEnd() ; if (retcode) return retcode; if (sortAlgo_->isInternalSort()) { internalSort = TRUE_L; if(config_->logInfoEvent()) { char msg[500]; str_sprintf(msg, "Sort is performing internal sort: NumRecs:%d", stats_.numRecs_); SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_); } } else { internalSort = FALSE_L; retcode = sortSendEndProcessing() ; return retcode; } return retcode;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:43,
示例14: NA_JulianTimestamp//----------------------------------------------------------------------// Name : sortReceive// // Parameters : ...//// Description : //// Return Value :// SORT_SUCCESS if everything goes on well.// SORT_FAILURE if any error encounterd. ////----------------------------------------------------------------------Lng32 SortUtil::sortReceive(void*& record,ULng32& len,void*& tupp){ NABoolean status; status = sortAlgo_->sortReceive(record, len, tupp); if ((len == 0) && (!config_->partialSort_)) { if(scratch_) { ScratchFileMap* tempFilesMap; tempFilesMap = scratch_->getScrFilesMap(); //stats_.scrNumReads_ = tempFilesMap->totalNumOfReads(); //stats_.scrNumAwaitio_ = tempFilesMap->totalNumOfAwaitio(); scratch_->getTotalIoWaitTime(stats_.ioWaitTime_); } stats_.numCompares_ += sortAlgo_->getNumOfCompares(); Int64 currentTimeJ = NA_JulianTimestamp(); stats_.elapsedTime_ = currentTimeJ - stats_.beginSortTime_; if (config_->logInfoEvent()) { char msg[500]; str_sprintf(msg, "Sort elapsed time : %Ld; Num runs : %d; runsize :%d", stats_.elapsedTime_,stats_.numInitRuns_,sortAlgo_->getRunSize()); SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_); } } return status;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:37,
示例15: str_sprintf// creates LOB handle in string format.void ExpLOBoper::createLOBhandleString(Int16 flags, Lng32 lobType, Int64 uid, Lng32 lobNum, Int64 descKey, Int64 descTS, short schNameLen, char * schName, char * lobHandleBuf){ str_sprintf(lobHandleBuf, "LOBH%04d%02d%04d%020Ld%02d%Ld%02d%Ld%03d%s", flags, lobType, lobNum, uid, findNumDigits(descKey), descKey, findNumDigits(descTS), descTS, schNameLen, schName); /* str_sprintf(lobHandleBuf, "LOBH%04d%020Ld%04d%02d%Ld%02d%Ld%03d%s", flags, uid, lobNum, findNumDigits(descKey), descKey, findNumDigits(descTS), descTS, schNameLen, schName); */}
开发者ID:anoopsharma00,项目名称:incubator-trafodion,代码行数:26,
示例16: lockMutex// log an ASSERTION FAILURE eventvoidSQLMXLoggingArea::logSQLMXAssertionFailureEvent(const char* file, Int32 line, const char* msgTxt, const char* condition, const Lng32* tid){ bool lockedMutex = lockMutex(); Int32 LEN = 8192; char msg[8192]; memset(msg, 0, LEN); Int32 sLen = str_len(msgTxt); Int32 sTotalLen = sLen; str_cpy_all (msg, msgTxt, sLen); char fileLineStr[200]; if (file) { str_sprintf(fileLineStr, ", FILE: %s, LINE: %d ",file, line); sLen = str_len(fileLineStr); str_cpy_all (msg+sTotalLen, fileLineStr, sLen); sTotalLen += sLen; } if (tid && (*tid != -1)) { char transId[100]; str_sprintf(transId, " TRANSACTION ID: %d ", *tid); sLen = str_len(transId); str_cpy_all (msg+sTotalLen, transId, sLen); sTotalLen += sLen; } if (condition) { char condStr[100]; str_sprintf(condStr, " CONDITION: %s ", condition); sLen = str_len(condStr); str_cpy_all (msg+sTotalLen, condStr, sLen); } QRLogger::log(QRLogger::instance().getMyDefaultCat(), LL_FATAL, "%s", msg); if (lockedMutex) unlockMutex(); }
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:46,
示例17: getIntervalTypeText// A helper function convert an Interval type to its TextshortgetIntervalTypeText(char *text, // OUTPUT rec_datetime_field datetimestart, // INPUT UInt32 intervalleadingprec, // INPUT rec_datetime_field datetimeend, // INPUT UInt32 fractionPrecision) // INPUT{ if (datetimestart >= REC_DATE_SECOND) { str_sprintf(text, "INTERVAL %s(%u,%u)", dtFieldToText(datetimestart), intervalleadingprec, fractionPrecision); } else if (datetimestart == datetimeend) { str_sprintf(text, "INTERVAL %s(%u)", dtFieldToText(datetimestart), intervalleadingprec); } else { if (datetimeend < REC_DATE_SECOND) { str_sprintf(text, "INTERVAL %s(%u) TO %s", dtFieldToText(datetimestart), intervalleadingprec, dtFieldToText(datetimeend)); } else { str_sprintf(text, "INTERVAL %s(%u) TO %s(%u)", dtFieldToText(datetimestart), intervalleadingprec, dtFieldToText(datetimeend), fractionPrecision); } } return 0;} // getIntervalTypeText()
开发者ID:qwertyioz,项目名称:incubator-trafodion,代码行数:46,
示例18: byte_str_cpychar * ExExeUtilTcb::getStatusString(const char * operation, const char * status, const char * object, char * outBuf, char * timeBuf, char * queryBuf, char * errorBuf){ if (! outBuf) return NULL; char o[16]; char s[10]; byte_str_cpy(o, 15, operation, strlen(operation), ' '); o[15] = 0; byte_str_cpy(s, 9, status, strlen(status), ' '); s[9] = 0; if (queryBuf) { str_sprintf(outBuf, "Task: %s Status: %s Command: %s", o, s, queryBuf); } else if (timeBuf) { str_sprintf(outBuf, "Task: %s Status: %s ET: %s", o, s, timeBuf); } else if (errorBuf) { str_sprintf(outBuf, "Task: %s Status: %s Details: %s", o, s, errorBuf); } else { if (object) str_sprintf(outBuf, "Task: %s Status: %s Object: %s", o, s, object); else str_sprintf(outBuf, "Task: %s Status: %s", o, s); } return outBuf;}
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:44,
示例19: showColNamesstatic void showColNames(Queue * listOfColNames, Space * space){ char buf[1000]; listOfColNames->position(); for (Lng32 j = 0; j < listOfColNames->numEntries(); j++) { char * currPtr = (char*)listOfColNames->getCurr(); Lng32 currPos = 0; Lng32 jj = 0; short colNameLen = *(short*)currPtr; currPos += sizeof(short); char colFam[100]; while (currPtr[currPos] != ':') { colFam[jj] = currPtr[currPos]; currPos++; jj++; } colFam[jj] = ':'; jj++; currPos++; colFam[jj] = 0; colNameLen -= jj; NABoolean withAt = FALSE; char * colName = &currPtr[currPos]; if (colName[0] == '@') { colNameLen--; colName++; withAt = TRUE; } Int64 v; if (colNameLen == sizeof(char)) v = *(char*)colName; else if (colNameLen == sizeof(unsigned short)) v = *(UInt16*)colName; else if (colNameLen == sizeof(Lng32)) v = *(ULng32*)colName; else v = 0; str_sprintf(buf, " Entry #%d: %s%s%Ld", j+1, colFam, (withAt ? "@" : ""), v); space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short)); listOfColNames->advance(); } // for}
开发者ID:hadr4ros,项目名称:core,代码行数:56,
示例20: make_disk_commentvoid make_disk_comment(const char *program, const char *version, disk_t& disk) { time_t now = time(NULL); const struct tm *local = localtime(&now); disk.comment = str_sprintf( "%s %s: %02d/%02d/%04d %02d:%02d:%02d/r/n", program, version, local->tm_mday, local->tm_mon + 1, local->tm_year + 1900, local->tm_hour, local->tm_min, local->tm_sec);}
开发者ID:johnkw,项目名称:dumpfloppy,代码行数:10,
示例21: cfg_get_strvoidcfg_get_str(const char *key, String *result){ assert(cfg_L != NULL && key != NULL && str_isvalid(result)); lua_pushstring(cfg_L, key); /* ... key */ lua_rawget(cfg_L, cfg_index); /* ... str? */ L_assert(cfg_L, lua_isstring(cfg_L, -1), "String expected."); str_sprintf(result, lua_tostring(cfg_L, -1)); lua_pop(cfg_L, 1); /* ... */}
开发者ID:snauts,项目名称:lariad,代码行数:10,
注:本文中的str_sprintf函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ str_term_width1函数代码示例 C++ str_split函数代码示例 |