Annotation of sbbs/uifc/uifc.h, revision 1.1.1.1

1.1       root        1: /* UIFC.H */
                      2: 
                      3: #include <dos.h>
                      4: #include <time.h>
                      5: #include <bios.h>
                      6: #include <alloc.h>
                      7: #include <ctype.h>
                      8: #include <conio.h>
                      9: #include <stdio.h>
                     10: #include <string.h>
                     11: #include <stdarg.h>
                     12: #include <stdlib.h>
                     13: 
                     14: #define MAX_OPTS       128     /* Maximum number of options per menu call */
                     15: #define MAX_OPLN       81              /* Maximum length of each option per menu call */
                     16: #define MAX_BUFS       8               /* Maximum number of screen buffers to save */
                     17: #define MAX_BFLN       8000    /* Maximum size of screen buffers - 80x50       */
                     18: 
                     19: #ifndef uint
                     20: #define uint unsigned int
                     21: #endif
                     22: 
                     23: #define UIFC_INMSG     (1<<0)  /* Currently in Message Routine non-recursive */
                     24: 
                     25: #define WIN_ORG        (1<<0)  /* Original menu - destroy valid screen area */
                     26: #define WIN_SAV        (1<<1)  /* Save existing text and replace when finished */
                     27: #define WIN_ACT        (1<<2)  /* Menu remains active after a selection */
                     28: #define WIN_L2R        (1<<3)  /* Center the window based on 'width'   */
                     29: #define WIN_T2B        (1<<4)  /* Center the window based on 'height'  */
                     30: #define WIN_INS        (1<<5)  /* Allows user to user insert key */
                     31: #define WIN_INSACT     (1<<6)  /* Remains active after insert key */
                     32: #define WIN_DEL        (1<<7)  /* Allows user to use delete key */
                     33: #define WIN_DELACT     (1<<8)  /* Remains active after delete key */
                     34: #define WIN_ESC        (1<<9)  /* Screen is active when escape is hit                   */
                     35: #define WIN_EDT        (1<<10) /* Edit mode for input() function */
                     36: #define WIN_RHT        (1<<11) /* Place window against right side of screen */
                     37: #define WIN_BOT        (1<<12) /* Place window against botton of screen */
                     38: #define WIN_GET        (1<<13) /* Allows F5 to Get a menu item */
                     39: #define WIN_PUT        (1<<14) /* Allows F6 to Put a menu item */
                     40: #define WIN_CHE        (1<<15) /* Stay active after escape if changes */
                     41: 
                     42: #define WIN_MID WIN_L2R|WIN_T2B  /* Place window in middle of screen */
                     43: 
                     44: #define MSK_INS 0x0100
                     45: #define MSK_DEL 0x0200
                     46: #define MSK_GET 0x0300
                     47: #define MSK_PUT 0x0400
                     48: 
                     49: #define SCRN_TOP       3
                     50: #define SCRN_LEFT      5
                     51: #define SCRN_RIGHT  76
                     52: 
                     53: #define NO_CURSOR      0x2100
                     54: #define BIG_CURSOR     0x000f
                     55: 
                     56:                                                        /* Bits in 'mode' for getkey and getstr     */
                     57: #define K_UPPER                (1<<0)  /* Converts all letters to upper case           */
                     58: #define K_UPRLWR    (1<<1)  /* Upper/Lower case automatically           */
                     59: #define K_NUMBER    (1<<2)  /* Allow numbers only                       */
                     60: #define K_WRAP     (1<<3)  /* Allows word wrap                                                 */
                     61: #define K_MSG          (1<<4)  /* Allows ANSI, ^N ^A ^G                                        */
                     62: #define K_SPIN      (1<<5)  /* Spinning cursor (same as SPIN)           */
                     63: #define K_LINE      (1<<6)  /* Input line (inverse color)               */
                     64: #define K_EDIT      (1<<7)  /* Edit string passed                       */
                     65: #define K_CHAT         (1<<8)  /* In chat multi-chat                                           */
                     66: #define K_NOCRLF    (1<<9)     /* Don't print CRLF after string input      */
                     67: #define K_ALPHA     (1<<10) /* Only allow alphabetic characters         */
                     68: 
                     69: 
                     70: 
                     71: #define BS  8
                     72: #define FF     12
                     73: #define LF  10
                     74: #define CR     13
                     75: #define ESC 27
                     76: #define SP     32
                     77: 
                     78: #define CLREOL 256
                     79: 
                     80: typedef struct {
                     81:        char    left,top,right,bot,*buf;
                     82:        } win_t;
                     83: 
                     84: /* LCLOLL.ASM */
                     85: int lclini(int);
                     86: void lclxy(int,int);
                     87: int lclwx(void);
                     88: int lclwy(void);
                     89: int lclatr(int);
                     90: void lputc(int);
                     91: long lputs(char far *);
                     92: 
                     93: 
                     94: extern char scrn_len,lclr,hclr,bclr,cclr,blk_scrn[MAX_BFLN],savdepth
                     95:        ,changes,savnum,uifc_status;
                     96: extern win_t sav[MAX_BUFS];
                     97: extern uint cursor;
                     98: 
                     99: void uifcini(void);
                    100: void uscrn(char *str);
                    101: int ulist(int mode, char left, char top, char width, int *dflt
                    102:        ,char *title, char option[][MAX_OPLN]);
                    103: char uinput(int imode, char left, char top, char *prompt, char *str, char len
                    104:        ,int kmode);
                    105: void umsg(char *str);
                    106: int  getstr(char *str, int maxlen, int mode);
                    107: uint getcursortype();
                    108: void setcursortype(uint cursor);
                    109: void timedisplay();
                    110: void puttextinfo(struct text_info txt);
                    111: int  lprintf(char *fmt,...);
                    112: char *timestr(time_t *intime);

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.