⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wmessage.c

📁 详细介绍了一篇关于pci开发的接口芯片
💻 C
字号:
/*  CXL - Copyright (c) 1987-1989 by Mike Smedley - All Rights Reserved  */
/*  WMESSAGE.C  - displays text on window's top or bottom border  */

/* Changed to allow if leftofs is negative, then offset is from right */

#include <string.h>
#include "cxlvid.h"
#include "cxlwin.h"

int wmessage(char *str,int border,int leftofs,int attr)
{
    /* check for active window */
    if(!_winfo.total) return(_winfo.errno=W_NOACTIVE);

    /* make sure window has a border */
    if(!_winfo.active->border) return(_winfo.errno=W_NOBORDER);


    if ( leftofs >= 0 )
    {
      /* make sure string fits in window */
      if( (_winfo.active->scol+leftofs+strlen(str)-1) > (_winfo.active->ecol) )
          return(_winfo.errno=W_STRLONG);

      /* display string */
      prints(border?_winfo.active->erow:_winfo.active->srow,
            _winfo.active->scol+leftofs,attr,str);
    }
    else {
      /* Change sign */
      leftofs = -leftofs;
      /* make sure string fits in window */
      if( (_winfo.active->ecol-leftofs-strlen(str)+1) < (_winfo.active->scol) )
          return(_winfo.errno=W_STRLONG);

      /* display string */
      prints(border?_winfo.active->erow:_winfo.active->srow,
            _winfo.active->ecol-leftofs-strlen(str)+1,attr,str);
    }

    /* return normally */
    return(_winfo.errno=W_NOERROR);
}

⌨️ 快捷键说明

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