1 /* -*- c -*- ------------------------------------------------------------- *
3 * Copyright 2004-2005 Murali Krishnan Ganapathy - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
20 #define NULL ((void *)0)
24 // CHRELATTR = ^N, CHABSATTR = ^O
28 void clearwindow(char top, char left, char bot, char right,
29 char page, char fillchar, char fillattr);
31 void cls(void); /* Clears the entire current screen page */
33 // Generic user input,
34 // password = 0 iff chars echoed on screen
35 // showoldvalue <> 0 iff current displayed for editing
36 void getuserinput(char *str, unsigned int size,
37 unsigned int password, unsigned int showoldvalue);
39 static inline void getstring(char *str, unsigned int size)
41 getuserinput(str,size,0,0);
44 static inline void editstring(char *str, unsigned int size)
46 getuserinput(str,size,0,1);
49 static inline void getpwd(char * str, unsigned int size)
51 getuserinput(str,size,1,0);
54 // Box drawing Chars offsets into array
55 #define BOX_TOPLEFT 0x0
56 #define BOX_BOTLEFT 0x1
57 #define BOX_TOPRIGHT 0x2
58 #define BOX_BOTRIGHT 0x3
59 #define BOX_TOP 0x4 // TOP = BOT = HORIZ
64 #define BOX_VERT 0x5 // LEFT=RIGHT=VERT
67 #define BOX_TOPBOT 0x8
68 #define BOX_BOTTOP 0x9
69 #define BOX_MIDDLE 0xA
71 typedef enum {BOX_SINSIN,BOX_DBLDBL, BOX_SINDBL, BOX_DBLSIN} boxtype;
73 unsigned char * getboxchars(boxtype bt);
75 void drawbox(char top,char left,char bot, char right,
76 char page, char attr,boxtype bt);
78 // Draw a horizontal line
79 // dumb == 1, means just draw the line
80 // dumb == 0 means check the first and last positions and depending on what is
81 // currently on the screen make it a LTRT and/or RTLT appropriately.
82 void drawhorizline(char top, char left, char right, char page, char attr,
83 boxtype bt, char dumb);