wprintf.c

来自「详细介绍了一篇关于pci开发的接口芯片」· C语言 代码 · 共 29 行

C
29
字号
/*  CXL - Copyright (c) 1987-1989 by Mike Smedley - All Rights Reserved  */
/*  cxl_wprintf.C   - outputs a formatted string to active window   */

#include <stdarg.h>
#include <stdio.h>
#include "cxlwin.h"

#define     MAXCHARS    255

int cxl_wprintf(const char *format,...)
{
    va_list argptr;
    char buf[MAXCHARS];

    /* check for active window */
    if(!_winfo.total) return(_winfo.errno=W_NOACTIVE);

    /* format string using specified parameters into buffer */
    va_start(argptr,format);            /* access argument list */
    vsprintf(buf,format,argptr);        /* create string using argument list */
    va_end(argptr);                     /* end access of argument list */

    /* display the created string */
    wputs(buf);

    /* return w/return code from wputs() */
    return(_winfo.errno);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?