• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ outfmt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TNC_TNCS_ReportMessageTypesLong

TNC_Result TNC_TNCS_ReportMessageTypesLong(
/*in*/  TNC_IMVID imvID,
/*in*/  TNC_VendorIDList supportedVendorIDs,
/*in*/  TNC_MessageSubtypeList supportedSubtypes,
/*in*/  TNC_UInt32 typeCount)
{
    unsigned i;

    if( typeCount > g_nImvMessageLongSubtypesCount )
	{
		g_pImvMessageLongSubtypes = (TNC_MessageSubtypeList) realloc( g_pImvMessageLongSubtypes, sizeof( *supportedSubtypes ) * typeCount );
		g_pImvVendorIDs = (TNC_VendorIDList) realloc( g_pImvVendorIDs, sizeof(TNC_VendorID) * typeCount );
	}

    outfmt( OUT_LEVEL_NORMAL, "< TNC_TNCS_ReportMessageTypesLong (IMV %d)", imvID );
    if( typeCount > 0 )
    {
        memcpy( g_pImvMessageLongSubtypes, supportedSubtypes, sizeof( *supportedSubtypes ) * typeCount );
		memcpy( g_pImvVendorIDs, supportedVendorIDs, sizeof( *supportedVendorIDs ) * typeCount );
        g_nImvMessageLongSubtypesCount = typeCount;

        for( i=0; i < typeCount; ++i )
			outfmt( OUT_LEVEL_NORMAL, "%c(vendor ID %#x, message subtype %#x)%c", 
                0 == i ? '\n' : ' ', 
				g_pImvVendorIDs[i],
                g_pImvMessageLongSubtypes[i], 
                i == typeCount - 1 ? '\n' : ',' );
    }
    else
	{
        outfmt( OUT_LEVEL_NORMAL, "\nEmpty message list. No messages will be delivered to this IMV!\n" );
	}

    return TNC_RESULT_SUCCESS;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:35,代码来源:IMCIMVTNCS.c


示例2: TNC_TNCS_SendMessageLong

TNC_Result TNC_TNCS_SendMessageLong(
/*in*/  TNC_IMVID imvID,
/*in*/  TNC_ConnectionID connectionID,
/*in*/  TNC_UInt32 messageFlags,
/*in*/  TNC_BufferReference message,
/*in*/  TNC_UInt32 messageLength,
/*in*/  TNC_VendorID messageVendorID,
/*in*/  TNC_MessageSubtype messageSubtype,
/*in*/  TNC_UInt32 destinationIMCID)
{
	MESSAGE_LONG  longTypeMessage;

    outfmt( OUT_LEVEL_NORMAL, "< TNC_TNCS_SendMessageLong: IMV %d, CID %d, "
		"msg length %d, vendor ID %#x msg subtype %#x, msg flags %#x, destIMCID %#x\n", 
        imvID, connectionID, messageLength, messageVendorID, 
		messageSubtype, messageFlags, destinationIMCID );

    outfmt( OUT_LEVEL_VERBOSE, "< IMC message data:\n" );
    outmessage( OUT_LEVEL_VERBOSE, message, messageLength );

	longTypeMessage.imcID = destinationIMCID;
	longTypeMessage.imvID = imvID;
	longTypeMessage.message = message;
	longTypeMessage.messageFlags = messageFlags;
	longTypeMessage.messageLength = messageLength;
	longTypeMessage.messageSubtype = messageSubtype;
	longTypeMessage.messageVendorID = messageVendorID;

    QueueAddMessageLong( &longTypeMessage );

    return TNC_RESULT_SUCCESS;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:32,代码来源:IMCIMVTNCS.c


示例3: exvwarning

static void
exvwarning(int sv_errno, const char *msg, va_list ap)
{
	/* Partially emulate line buffered output so that:
	 *	printf '%d\n' 1 a 2
	 * and
	 *	printf '%d %d %d\n' 1 a 2
	 * both generate sensible text when stdout and stderr are merged.
	 */
	if (output.nextc != output.buf && output.nextc[-1] == '\n')
		flushout(&output);
	if (commandname)
		outfmt(&errout, "%s: ", commandname);
	else
		outfmt(&errout, "%s: ", getprogname());
	if (msg != NULL) {
		doformat(&errout, msg, ap);
		if (sv_errno >= 0)
			outfmt(&errout, ": ");
	}
	if (sv_errno >= 0)
		outfmt(&errout, "%s", strerror(sv_errno));
	out2c('\n');
	flushout(&errout);
}
开发者ID:VargMon,项目名称:netbsd-cvs-mirror,代码行数:25,代码来源:error.c


示例4: synerror

STATIC void
synerror(char *msg)
{
	if (commandname)
		outfmt(&errout, "%s: %d: ", commandname, startlinno);
	outfmt(&errout, "Syntax error: %s\n", msg);
	error((char *)NULL);
}
开发者ID:7shi,项目名称:minix-tools,代码行数:8,代码来源:parser.c


示例5: setterm

void
setterm(const char *term)
{
	if (el != NULL && term != NULL)
		if (el_set(el, EL_TERMINAL, term) != 0) {
			outfmt(out2, "sh: Can't set terminal type %s\n", term);
			outfmt(out2, "sh: Using dumb terminal settings.\n");
		}
}
开发者ID:ajinkya93,项目名称:netbsd-src,代码行数:9,代码来源:histedit.c


示例6: vwarning

static void
vwarning(const char *msg, va_list ap)
{
	if (commandname)
		outfmt(out2, "%s: ", commandname);
	else if (arg0)
		outfmt(out2, "%s: ", arg0);
	doformat(out2, msg, ap);
	out2fmt_flush("\n");
}
开发者ID:0mp,项目名称:freebsd,代码行数:10,代码来源:error.c


示例7: ImvBatchEnding

unsigned ImvBatchEnding( TNC_ConnectionID cid )
{
    TNC_Result rc = TNC_RESULT_SUCCESS;

    if( NULL != imvFuncs.pfnBatchEnding )
    {
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_BatchEnding (IMV: %d, CID: %d)\n", IMV_ID, cid );
        rc = imvFuncs.pfnBatchEnding( IMV_ID, cid );
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_BatchEnding result: %d\n", rc );
    }

    return rc;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:13,代码来源:IMCIMVTNCS.c


示例8: LoadIMV

int LoadIMV(const char *dllPath)
{
    int err;

	outfmt( OUT_LEVEL_NORMAL, "Loading IMV DLL: \"%s\"...", dllPath );
    err = LoadImvDLL( dllPath, &imvFuncs );
    if (err) 
    {
        outfmt( OUT_LEVEL_NORMAL, " Error %d.\n", err);
        return TNC_RESULT_OTHER;
    }

    outfmt( OUT_LEVEL_NORMAL, " Ok\n" );
    return TNC_RESULT_SUCCESS;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:15,代码来源:IMCIMVTNCS.c


示例9: NotifyImvConnectionState

unsigned NotifyImvConnectionState( TNC_ConnectionID cid, TNC_ConnectionState state )
{
    TNC_Result rc = TNC_RESULT_SUCCESS;
    extern char *g_pszConnStates[];

    if( NULL != imvFuncs.pfnNotifyConnectionChange )
    {
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_NotifyConnectionChange (IMV: %d, CID: %d, state: `%s')\n", 
            IMV_ID, cid, g_pszConnStates[ state ] );

        rc = imvFuncs.pfnNotifyConnectionChange( IMV_ID, cid, state );
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_NotifyConnectionChange result: %d\n", rc );
    }

    return rc;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:16,代码来源:IMCIMVTNCS.c


示例10: subevalvar_misc

static int
subevalvar_misc(char *p, const char *var, int subtype, int startloc,
  int varflags)
{
	char *startp;
	struct nodelist *saveargbackq = argbackq;
	int amount;

	argstr(p, EXP_TILDE, NULL);
	STACKSTRNUL(expdest);
	argbackq = saveargbackq;
	startp = stackblock() + startloc;

	switch (subtype) {
	case VSASSIGN:
		setvar(var, startp, 0);
		amount = startp - expdest;
		STADJUST(amount, expdest);
		return 1;

	case VSQUESTION:
		if (*p != CTLENDVAR) {
			outfmt(out2, "%s\n", startp);
			error((char *)NULL);
		}
		error("%.*s: parameter %snot set", (int)(p - var - 1),
		      var, (varflags & VSNUL) ? "null or " : "");
		return 0;

	default:
		abort();
	}
}
开发者ID:gahr,项目名称:poudriere,代码行数:33,代码来源:expand.c


示例11: gather_month_strings

std::vector<std::basic_string<charT> >
gather_month_strings(const std::locale& locale, bool short_strings=true)
{
  typedef std::basic_string<charT> string_type;
  typedef std::vector<string_type> collection_type;
  typedef std::basic_ostringstream<charT> ostream_type;
  typedef std::ostreambuf_iterator<charT> ostream_iter_type;
  typedef std::basic_ostringstream<charT> stringstream_type;
  typedef std::time_put<charT>           time_put_facet_type;
  charT short_fmt[3] = { '%', 'b' };
  charT long_fmt[3]  = { '%', 'B' };
  collection_type months;
  string_type outfmt(short_fmt);
  if (!short_strings) {
    outfmt = long_fmt;
  }
  {
    //grab the needed strings by using the locale to
    //output each month
    for (int m=0; m < 12; m++) {
      tm tm_value;
      tm_value.tm_mon = m;
      stringstream_type ss;
      ostream_iter_type oitr(ss);
      std::use_facet<time_put_facet_type>(locale).put(oitr, ss, ss.fill(),
                                                      &tm_value,
                                                      &*outfmt.begin(),
                                                      &*outfmt.begin()+outfmt.size());
      months.push_back(ss.str());
    }
  }
  return months;
}
开发者ID:CRF,项目名称:passenger,代码行数:33,代码来源:strings_from_facet.hpp


示例12: aliascmd

/*
 * TODO - sort output
 */
int
aliascmd(int argc, char **argv)
{
	char *n, *v;
	int ret = 0;
	struct alias *ap;

	if (argc == 1) {
		int i;

		for (i = 0; i < ATABSIZE; i++)
			for (ap = atab[i]; ap; ap = ap->next) {
				printalias(ap);
			}
		return (0);
	}
	while ((n = *++argv) != NULL) {
		if ((v = strchr(n+1, '=')) == NULL) { /* n+1: funny ksh stuff */
			if ((ap = *__lookupalias(n)) == NULL) {
				outfmt(out2, "%s: %s not found\n", "alias", n);
				ret = 1;
			} else
				printalias(ap);
		} else {
			*v++ = '\0';
			setalias(n, v);
		}
	}

	return (ret);
}
开发者ID:Agochka,项目名称:klibc,代码行数:34,代码来源:alias.c


示例13: aliascmd

int
aliascmd(int argc, char **argv)
{
	char *n, *v;
	int ret = 0;
	struct alias *ap;

	if (argc == 1) {
		printaliases();
		return (0);
	}
	while ((n = *++argv) != NULL) {
		if ((v = strchr(n+1, '=')) == NULL) /* n+1: funny ksh stuff */
			if ((ap = lookupalias(n, 0)) == NULL) {
				outfmt(out2, "alias: %s not found\n", n);
				ret = 1;
			} else
				printalias(ap);
		else {
			*v++ = '\0';
			setalias(n, v);
		}
	}

	return (ret);
}
开发者ID:jpostel,项目名称:FreeBSD-mirror,代码行数:26,代码来源:alias.c


示例14: chkmail

void
chkmail(void)
{
	const char *mpath;
	char *p;
	char *q;
	time_t *mtp;
	struct stackmark smark;
#ifdef WINDOWS
	struct stat statb;
#else
	struct stat64 statb;
#endif

	setstackmark(&smark);
	mpath = mpathset() ? mpathval() : mailval();
	for (mtp = mailtime; mtp < mailtime + MAXMBOXES; mtp++) {
		p = padvance(&mpath, nullstr);
		if (p == NULL)
			break;
		if (*p == '\0')
			continue;
		for (q = p ; *q ; q++);
#ifdef DEBUG
		if (q[-1] != '/')
			abort();
#endif
		q[-1] = '\0';			/* delete trailing '/' */
#ifdef WINDOWS
		if (stat(p, &statb) < 0) {
#else
		if (stat64(p, &statb) < 0) {
#endif
			*mtp = 0;
			continue;
		}
		if (!changed && statb.st_mtime != *mtp) {
			outfmt(
				&errout, snlfmt,
				pathopt ? pathopt : "you have mail"
			);
		}
		*mtp = statb.st_mtime;
	}
	changed = 0;
	popstackmark(&smark);
}


void
changemail(const char *val)
{
	changed++;
}
开发者ID:neonatura,项目名称:share,代码行数:54,代码来源:mail.c


示例15: strtoul

String *jnl_readprompt (const char *prompt)

{
  char *buff, header[16], *p;
  String *string;
  uLong strln;

  /* If recovery file open, read from it, otherwise read from terminal */

  if (recover_file == NULL) goto readterminal;
  if (fgets (header, sizeof header, recover_file) == NULL) goto closerecovery;
  if (header[0] != '*') goto badrecovery;
  if (strcmp (header + 1, "EOF\n") == 0) {
    string = NULL;
    goto writejournal;
  }
  strln = strtoul (header + 1, &p, 10);
  if (*p != '\n') goto badrecovery;
  buff = malloc (strln + 1);
  if (fread (buff, strln, 1, recover_file) == 0) goto closerecovery;
  string = string_create (strln, buff);
  buff[strln] = 0;
  outfmt (strlen (prompt) + strlen (buff), "%s%s\n", prompt, buff);
  free (buff);
  goto writejournal;

badrecovery:
  outerr (strlen (header), "bad recovery file format at %s\n", header);
closerecovery:
  fclose (recover_file);
  recover_file = NULL;

  /* Read from terminal screen after flushing any output */

readterminal:
  output ();
  string = os_readprompt (prompt);

  /* Write journal record */

writejournal:
  if (journal_file != NULL) {
    if (string == NULL) fprintf (journal_file, "*EOF\n");
    else {
      strln = string_getlen (string);
      fprintf (journal_file, "*%u\n", strln);
      fwrite (string_getval (string), strln, 1, journal_file);
    }
  }

  /* Return pointer to string (NULL for eof) */

  return (string);
}
开发者ID:Rick33,项目名称:freevms,代码行数:54,代码来源:journaling.c


示例16: TNC_TNCS_SendMessageSOH

TNC_Result TNC_TNCS_SendMessageSOH(
/*in*/  TNC_IMVID imvID,
/*in*/  TNC_ConnectionID connectionID,
/*in*/  TNC_BufferReference sohReportEntry,
/*in*/  TNC_UInt32 sohRELength)
{
	MESSAGE_SOH  sohMessage;

    outfmt( OUT_LEVEL_NORMAL, "< TNC_TNCS_SendMessageSOH: IMV %d, CID %d, msg length %d\n", 
        imvID, connectionID, sohRELength );

    outfmt( OUT_LEVEL_VERBOSE, "< IMV message data:\n" );
    outmessage( OUT_LEVEL_VERBOSE, sohReportEntry, sohRELength );

	sohMessage.sohReportEntry = sohReportEntry;
	sohMessage.sohRELength = sohRELength;

    QueueAddMessageSOH( &sohMessage );

    return TNC_RESULT_SUCCESS;
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:21,代码来源:IMCIMVTNCS.c


示例17: cmd_delete

void cmd_delete (char *cp)

{

  first = 1;
  count = 0;
  if (range_multiple (cp, &cp, delete_range, &first) >= 0) eoltest (cp);
  if (count == 0) outerr (0, "no lines deleted\n");
  else outerr (12, "%u line%s deleted\n", count, (count == 1) ? "" : "s");
  if (cur_position.line != NULL) line_print (cur_position.line);
  else outfmt (strlen (buffer_name (cur_position.buffer)), "[EOB=%s]\n", buffer_name (cur_position.buffer));
}
开发者ID:Rick33,项目名称:freevms,代码行数:12,代码来源:cmd_delete.c


示例18: trapcmd

int
trapcmd(int argc, char **argv)
{
    char *action;
    char **ap;
    int signo;

    nextopt(nullstr);
    ap = argptr;
    if (!*ap) {
        for (signo = 0 ; signo < NSIG ; signo++) {
            if (trap[signo] != NULL) {
                out1fmt(
                    "trap -- %s %s\n",
                    single_quote(trap[signo]),
                    signal_names[signo]
                );
            }
        }
        return 0;
    }
    if (!ap[1])
        action = NULL;
    else
        action = *ap++;
    while (*ap) {
        if ((signo = decode_signal(*ap, 0)) < 0) {
            outfmt(out2, "trap: %s: bad trap\n", *ap);
            return 1;
        }
        INTOFF;
        if (action) {
            if (action[0] == '-' && action[1] == '\0')
                action = NULL;
            else {
                if (*action)
                    trapcnt++;
                action = savestr(action);
            }
        }
        if (trap[signo]) {
            if (*trap[signo])
                trapcnt--;
            ckfree(trap[signo]);
        }
        trap[signo] = action;
        if (signo != 0)
            setsignal(signo);
        INTON;
        ap++;
    }
    return 0;
}
开发者ID:alimon,项目名称:dash,代码行数:53,代码来源:trap.c


示例19: exvwarning2

static void exvwarning2(const char *msg, va_list ap)
{
	struct output *errs;
	const char *name;
	const char *fmt;

	errs = out2;
	name = arg0 ? arg0 : "sh";
	fmt = "%s: %d: ";
	outfmt(errs, fmt, name, errlinno);
	doformat(errs, msg, ap);
	outc('\n', errs);
}
开发者ID:hominlinx,项目名称:hot-pot-lab,代码行数:13,代码来源:error.c


示例20: TerminateIMV

void TerminateIMV(void)
{
    TNC_Result result;

    if( NULL != imvFuncs.pfnTerminate )
    {
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_Terminate (IMV %d)\n", IMV_ID );
        result = imvFuncs.pfnTerminate( IMV_ID );
        outfmt( OUT_LEVEL_NORMAL, "> TNC_IMV_Terminate result: %d\n", result );
    }

    free( g_pImvMessageTypes );
    g_pImvMessageTypes = NULL;
    g_nImvMessageTypesCount = 0;

	free( g_pImvMessageLongSubtypes );
	free( g_pImvVendorIDs );
	g_pImvMessageLongSubtypes = NULL;
	g_pImvVendorIDs = NULL;
	g_nImvMessageLongSubtypesCount = 0;

    UnloadImvDLL();
}
开发者ID:hirendra-rathor,项目名称:TNCSDK,代码行数:23,代码来源:IMCIMVTNCS.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ outl函数代码示例发布时间:2022-05-30
下一篇:
C++ outfile函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap