本文整理汇总了C++中STRCAT函数的典型用法代码示例。如果您正苦于以下问题:C++ STRCAT函数的具体用法?C++ STRCAT怎么用?C++ STRCAT使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了STRCAT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acpi_db_set_scope
void
acpi_db_set_scope (
NATIVE_CHAR *name)
{
if (!name || name[0] == 0) {
acpi_os_printf ("Current scope: %s\n", acpi_gbl_db_scope_buf);
return;
}
acpi_db_prep_namestring (name);
/* TBD: [Future] Validate scope here */
if (name[0] == '\\') {
STRCPY (acpi_gbl_db_scope_buf, name);
STRCAT (acpi_gbl_db_scope_buf, "\\");
}
else {
STRCAT (acpi_gbl_db_scope_buf, name);
STRCAT (acpi_gbl_db_scope_buf, "\\");
}
acpi_os_printf ("New scope: %s\n", acpi_gbl_db_scope_buf);
}
示例2: util_findFile
bool util_findFile(const char* dirs[], unsigned int numDirs,
const char* relativeFilePath, char* absoluteFilePath) {
bool found = false;
// check if it is an absolute file path
if (util_fileExists(relativeFilePath)) {
STRCPY(absoluteFilePath, relativeFilePath);
found = true;
}
unsigned int d;
for (d=0; d < numDirs && !found; ++d) {
// do the following: tmpPath = dirs[d] + sPS + relativeFilePath
char* tmpPath = util_allocStr(strlen(dirs[d]) + 1 + strlen(relativeFilePath));
//char tmpPath[strlen(dirs[d]) + 1 + strlen(relativeFilePath) + 1];
tmpPath[0]= '\0';
tmpPath = STRCAT(tmpPath, dirs[d]);
tmpPath = STRCAT(tmpPath, sPS);
tmpPath = STRCAT(tmpPath, relativeFilePath);
if (util_fileExists(tmpPath)) {
STRCPY(absoluteFilePath, tmpPath);
found = true;
}
free(tmpPath);
}
return found;
}
示例3: AcpiDbExecuteSetup
static void
AcpiDbExecuteSetup (
DB_METHOD_INFO *Info)
{
/* Catenate the current scope to the supplied name */
Info->Pathname[0] = 0;
if ((Info->Name[0] != '\\') &&
(Info->Name[0] != '/'))
{
STRCAT (Info->Pathname, AcpiGbl_DbScopeBuf);
}
STRCAT (Info->Pathname, Info->Name);
AcpiDbPrepNamestring (Info->Pathname);
AcpiDbSetOutputDestination (DB_DUPLICATE_OUTPUT);
AcpiOsPrintf ("Executing %s\n", Info->Pathname);
if (Info->Flags & EX_SINGLE_STEP)
{
AcpiGbl_CmSingleStep = TRUE;
AcpiDbSetOutputDestination (DB_CONSOLE_OUTPUT);
}
else
{
/* No single step, allow redirection to a file */
AcpiDbSetOutputDestination (DB_REDIRECTABLE_OUTPUT);
}
}
示例4: append_path
// Append to_append to path with a slash in between.
int append_path(char *path, const char *to_append, int max_len)
{
int current_length = STRLEN(path);
int to_append_length = STRLEN(to_append);
// Do not append empty strings.
if (to_append_length == 0) {
return OK;
}
// Do not append a dot.
if (STRCMP(to_append, ".") == 0) {
return OK;
}
// Glue both paths with a slash.
if (current_length > 0 && path[current_length-1] != '/') {
current_length += 1; // Count the trailing slash.
// +1 for the NUL at the end.
if (current_length + 1 > max_len) {
return FAIL;
}
STRCAT(path, "/");
}
// +1 for the NUL at the end.
if (current_length + to_append_length + 1 > max_len) {
return FAIL;
}
STRCAT(path, to_append);
return OK;
}
示例5: acpi_db_execute_setup
void
acpi_db_execute_setup (
db_method_info *info)
{
/* Catenate the current scope to the supplied name */
info->pathname[0] = 0;
if ((info->name[0] != '\\') &&
(info->name[0] != '/')) {
STRCAT (info->pathname, acpi_gbl_db_scope_buf);
}
STRCAT (info->pathname, info->name);
acpi_db_prep_namestring (info->pathname);
acpi_db_set_output_destination (DB_DUPLICATE_OUTPUT);
acpi_os_printf ("Executing %s\n", info->pathname);
if (info->flags & EX_SINGLE_STEP) {
acpi_gbl_cm_single_step = TRUE;
acpi_db_set_output_destination (DB_CONSOLE_OUTPUT);
}
else {
/* No single step, allow redirection to a file */
acpi_db_set_output_destination (DB_REDIRECTABLE_OUTPUT);
}
}
示例6: SearchPath
int SearchPath(char* oudzp, char* filename, char* whatever, int maxlen, char* nieuwzp, char** ach) {
FILE* fp;
char* p, * f;
if (filename[0] == '/') {
STRCPY(nieuwzp, maxlen, filename);
} else {
STRCPY(nieuwzp, maxlen, oudzp);
if (*nieuwzp && nieuwzp[strlen(nieuwzp)] != '/') {
STRCAT(nieuwzp, maxlen, "/");
}
STRCAT(nieuwzp, maxlen, filename);
}
if (ach) {
p = f = nieuwzp;
while (*p) {
if (*p == '/') {
f = p + 1;
} ++p;
}
*ach = f;
}
if (FOPEN_ISOK(fp, nieuwzp, "r")) {
fclose(fp);
return 1;
}
return 0;
}
示例7: WelsReopenTraceFile
/*!
*************************************************************************************
* \brief reopen log file when finish setting current path
*
* \param pCtx context pCtx
* \param pCurPath current path string
*
* \return NONE
*
* \note N/A
*************************************************************************************
*/
void WelsReopenTraceFile( void *pCtx, str_t *pCurPath )
{
#ifdef ENABLE_TRACE_FILE
sWelsEncCtx *pEncCtx = (sWelsEncCtx *)pCtx;
if (wlog == WelsLogDefault)
{
str_t strTraceFile[MAX_FNAME_LEN] = {0};
int32_t len = 0;
if (pEncCtx->pFileLog != NULL)
{
fclose(pEncCtx->pFileLog);
pEncCtx->pFileLog = NULL;
}
pEncCtx->uiSizeLog = 0;
len = STRNLEN( pCurPath, MAX_FNAME_LEN-1 ); // confirmed_safe_unsafe_usage
if (len >= MAX_FNAME_LEN)
return;
STRNCPY(strTraceFile, MAX_FNAME_LEN, pCurPath, len); // confirmed_safe_unsafe_usage
#ifdef __GNUC__
STRCAT(strTraceFile, MAX_FNAME_LEN-len, "/wels_encoder_trace.txt"); // confirmed_safe_unsafe_usage
pEncCtx->pFileLog = FOPEN(strTraceFile, "wt+"); // confirmed_safe_unsafe_usage
#elif WIN32
STRCAT(strTraceFile, MAX_FNAME_LEN-len, "\\wels_encoder_trace.txt");// confirmed_safe_unsafe_usage
#if _MSC_VER >= 1500
FOPEN(&pEncCtx->pFileLog, strTraceFile, "wt+"); // confirmed_safe_unsafe_usage
#else
pEncCtx->pFileLog = FOPEN(strTraceFile, "wt+"); // confirmed_safe_unsafe_usage
#endif//_MSC_VER>=1500
#else
#endif//__GNUC__
}
#endif//ENABLE_TRACE_FILE
}
示例8: PocketRocketForBrew_InitAppData
// this function is called when your application is starting up
boolean PocketRocketForBrew_InitAppData(PocketRocketForBrew* pMe)
{
AECHAR os[] = {'B','r','e','w','\0'};
char resx[5];
char resy[5];
AECHAR wresx[5];
AECHAR wresy[5];
AECHAR url[512];
char curl[512];
AECHAR fchunk[] = {'?','O','S','=','B','r','e','w','&','H','E','I','G','H','T','=','\0'};
AECHAR schunk[] = {'&','W','I','D','T','H','=','\0'};
AECHAR tchunk[] = {'&','I','D','=','1','\0'};
// Get the device information for this handset.
// Reference all the data by looking at the pMe->DeviceInfo structure
// Check the API reference guide for all the handy device info you can get
pMe->DeviceInfo.wStructSize = sizeof(pMe->DeviceInfo);
ISHELL_GetDeviceInfo(pMe->a.m_pIShell,&pMe->DeviceInfo);
// std::string a;
STRCPY(url,XID_URL);
// str
itoa((int)pMe->DeviceInfo.cyScreen,resx,10);
itoa((int)pMe->DeviceInfo.cxScreen,resy,10);
STRTOWSTR(wresx,resx,strlen(resx));
STRTOWSTR(wresy,resy,strlen(resy));
//strcp
STRCAT(url,fchunk);
STRCAT(url,wresy);
STRCAT(url,schunk);
STRCAT(url,wresx);
STRCAT(url,tchunk);
WSTRTOSTR(curl,url,strlen(curl));
printf(url);
//strcat(
// Insert your code here for initializing or allocating resources...
//XOsApplication *xosApplication = new XOsApplication("Testing");
// if there have been no failures up to this point then return success
return TRUE;
}
示例9: MakeCompressedName
/*
** char MakeCompressedName(char ARG_PTR *pszFileName);
**
** Make a file name into the corresponding compressed file name.
**
** Arguments: pszOriginalName - file name to convert to compressed file name
**
** Returns: char - Uncompressed file name extension character that was
** replaced. '\0' if no character needed to be replaced.
**
** Globals: none
**
** N.b., assumes pszFileName's buffer is long enough to hold an extra two
** characters ("._").
**
** For DBCS filenames, we know we can have at most one DBCS character in the
** extension. So instead of just blindly replacing the last character of a
** three-byte extension with an underscore, we replace the last single-byte
** character with an underscore.
*/
CHAR MakeCompressedName(CHAR ARG_PTR *pszFileName)
{
CHAR chReplaced = '\0';
CHAR ARG_PTR *pszExt;
#ifdef DBCS
if ((pszExt = ExtractExtension(pszFileName)) != NULL)
{
if (STRLEN(pszExt) >= 3)
{
// Replace the last single-byte character in the extension with an
// underscore.
if (! IsDBCSLeadByte(*pszExt) && IsDBCSLeadByte(pszExt[1]))
{
// Assert: The first character in the extension is a single-byte
// character and the second character in the extension is a
// double-byte character.
chReplaced = *pszExt;
*pszExt = chEXTENSION_CHAR;
}
else
{
// Assert: The third character in the extension is a single-byte
// character. The first two bytes may be two single-byte
// characters or a double-byte character.
chReplaced = pszExt[2];
pszExt[2] = chEXTENSION_CHAR;
}
}
else
STRCAT(pszExt, pszEXTENSION_STR);
}
else
STRCAT(pszFileName, pszNULL_EXTENSION);
#else
if ((pszExt = ExtractExtension(pszFileName)) != NULL)
{
if (STRLEN(pszExt) >= 3)
{
chReplaced = pszExt[STRLEN(pszExt) - 1];
pszExt[STRLEN(pszExt) - 1] = chEXTENSION_CHAR;
}
else
STRCAT(pszExt, pszEXTENSION_STR);
}
else
STRCAT(pszFileName, pszNULL_EXTENSION);
#endif
return(chReplaced);
}
示例10: crypt_append_msg
/*
* Append a message to IObuff for the encryption/decryption method being used.
*/
void
crypt_append_msg(
buf_T *buf)
{
if (crypt_get_method_nr(buf) == 0)
STRCAT(IObuff, _("[crypted]"));
else
{
STRCAT(IObuff, "[");
STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
STRCAT(IObuff, "]");
}
}
示例11: workshop_init
void
workshop_init(void)
{
char_u buf[64];
int is_dirty = FALSE;
int width, height;
XtInputMask mask;
/*
* Turn on MenuBar, ToolBar, and Footer.
*/
STRCPY(buf, p_go);
if (vim_strchr(p_go, GO_MENUS) == NULL)
{
STRCAT(buf, "m");
is_dirty = TRUE;
}
if (vim_strchr(p_go, GO_TOOLBAR) == NULL)
{
STRCAT(buf, "T");
is_dirty = TRUE;
}
if (vim_strchr(p_go, GO_FOOTER) == NULL)
{
STRCAT(buf, "F");
is_dirty = TRUE;
}
if (is_dirty)
set_option_value((char_u *)"go", 0L, buf, 0);
/*
* Set size from workshop_get_width_height().
*/
width = height = 0;
if (workshop_get_width_height(&width, &height))
{
XtVaSetValues(vimShell,
XmNwidth, width,
XmNheight, height,
NULL);
}
/*
* Now read in the initial messages from eserve.
*/
while ((mask = XtAppPending(app_context))
&& (mask & XtIMAlternateInput) && !workshopInitDone)
XtAppProcessEvent(app_context, (XtInputMask)XtIMAlternateInput);
}
示例12: CTB_unlink
void CTB_unlink(char *name)
{
char str[MAXPATH], *p = ctb_last_punct(name);
if (p)
*p = '\0';
STRCPY(str, name);
STRCAT(str, ".CTB");
UNLINK(str);
STRCPY(str, name);
STRCAT(str, ".IND");
UNLINK(str);
return;
}
示例13: main
int main(int argc, char** argv) {
char_t strExeFullPath[kMAX_PATH];
UNUSED_PARAM(argc);
UNUSED_PARAM(argv);
if (FALSE == lockFile()) {
PRINTF("Lock File %s Failed.\n may be the other collector is running.",gStrLockFile );
getchar();
return 0;
}
signal(SIGINT,ctrl_handler);
BZERO_ARR(strExeFullPath);
if (_getcwd(strExeFullPath, sizeof(strExeFullPath))) {
STRCAT(strExeFullPath, sizeof(strExeFullPath), STR_DIR_SEP);
}
else {
STRCPY(strExeFullPath, sizeof(strExeFullPath), NULL_STR);
}
PRINTF("%s\n", strExeFullPath);
StartService(&g_Interrupt, strExeFullPath);
getchar();
unlockFile();
return 0;
}
示例14: util_allocStrCpyCat
char* util_allocStrCpyCat(const char* toPart1, const char* toPart2) {
char* copy = (char*) calloc(strlen(toPart1)+strlen(toPart2)+1, sizeof(char));
STRCPY(copy, toPart1);
STRCAT(copy, toPart2);
return copy;
}
示例15: __create_message
void
__create_message (HWND hwnd,
SQLPOINTER dsn,
SQLPOINTER text,
SQLCHAR waMode,
AlertType id)
{
CFStringRef msg, msg1;
DialogRef dlg;
SInt16 out;
char buf[1024];
if (hwnd == NULL)
return;
if (waMode == 'A')
{
if (dsn)
{
STRCPY(buf, "DSN: ");
STRCAT(buf, dsn);
msg = CFStringCreateWithBytes (NULL, (unsigned char*)buf, STRLEN(buf),
kCFStringEncodingUTF8, false);
msg1 = CFStringCreateWithBytes (NULL, (unsigned char*)text, STRLEN(text),
kCFStringEncodingUTF8, false);
}
else
{
STRCPY(buf, "");
msg = CFStringCreateWithBytes (NULL, (unsigned char*)text, STRLEN(text),
kCFStringEncodingUTF8, false);
msg1 = CFStringCreateWithBytes (NULL, (unsigned char*)buf, STRLEN(buf),
kCFStringEncodingUTF8, false);
}
}
else
{
if (dsn)
{
WCSCPY(buf, L"DSN: ");
WCSCAT(buf, dsn);
msg = convert_wchar_to_CFString((wchar_t*)buf);
msg1 = convert_wchar_to_CFString((wchar_t*)text);
}
else
{
WCSCPY(buf, L"");
msg = convert_wchar_to_CFString((wchar_t*)text);
msg1 = convert_wchar_to_CFString((wchar_t*)buf);
}
}
CreateStandardAlert (id, msg, msg1, NULL, &dlg);
RunStandardAlert (dlg, NULL, &out);
CFRelease(msg);
CFRelease(msg1);
return;
}