CTWM
Toggle main menu visibility
Loading...
Searching...
No Matches
/usr/src/RPM/BUILD/ctwm-4.1.0/util.h
Go to the documentation of this file.
1
/*
2
* utility routines header file
3
*
4
*
5
* Copyright 1988 by Evans & Sutherland Computer Corporation,
6
* Salt Lake City, Utah
7
* Portions Copyright 1989 by the Massachusetts Institute of Technology
8
* Cambridge, Massachusetts
9
*
10
* $XConsortium: util.h,v 1.10 89/12/10 17:47:04 jim Exp $
11
*
12
* 28-Oct-87 Thomas E. LaStrange File created
13
*
14
* Copyright 1992 Claude Lecommandeur.
15
*/
16
17
#ifndef _CTWM_UTIL_H
18
#define _CTWM_UTIL_H
19
20
#include <ctype.h>
21
#include <stdio.h>
22
23
24
/* Simple int utils */
25
static
inline
int
max
(
int
a,
int
b)
26
{
27
return
a > b ? a : b;
28
}
29
30
static
inline
int
min
(
int
a,
int
b)
31
{
32
return
a < b ? a : b;
33
}
34
35
#ifndef MAX
36
#define MAX(x,y) (max(x,y))
37
#endif
38
#ifndef MIN
39
#define MIN(x,y) (min(x,y))
40
#endif
41
#ifndef ABS
42
#define ABS(x) ((x)<0?-(x):(x))
43
#endif
44
45
/*
46
* Define some helper macros, because "The argument to toupper() must be
47
* EOF or representable as an unsigned char; otherwise, the behavior is
48
* undefined." In particular, an argument of type "char" is problematic
49
* (gcc: warning: array subscript has type 'char').
50
*/
51
#define Isascii(c) isascii((int)(unsigned char)(c))
52
#define Isdigit(c) isdigit((int)(unsigned char)(c))
53
#define Islower(c) islower((int)(unsigned char)(c))
54
#define Isupper(c) isupper((int)(unsigned char)(c))
55
#define Tolower(c) tolower((int)(unsigned char)(c))
56
#define Toupper(c) toupper((int)(unsigned char)(c))
57
58
char
*
ExpandFilename
(
const
char
*name);
59
char
*
ExpandFilePath
(
char
*path);
60
61
void
GetColor
(
int
kind, Pixel *what,
const
char
*name);
62
void
GetShadeColors
(
ColorPair
*cp);
63
bool
UpdateFont
(
MyFont
*font,
int
height);
64
void
CreateFonts
(
ScreenInfo
*scr);
65
#if 0
66
void
move_to_after(
TwmWindow
*t,
TwmWindow
*after);
67
#endif
68
void
RescueWindows
(
void
);
69
void
DebugTrace
(
char
*file);
70
71
72
void
safe_strncpy
(
char
*dest,
const
char
*src,
size_t
size);
73
74
extern
FILE *
tracefile
;
75
76
#endif
/* _CTWM_UTIL_H */
ColorPair
Definition
ctwm.h:140
MyFont
Definition
ctwm.h:127
ScreenInfo
Info and control for each X Screen we control.
Definition
screen.h:96
TwmWindow
Info and control for every X Window we take over.
Definition
twm_window_struct.h:34
safe_strncpy
void safe_strncpy(char *dest, const char *src, size_t size)
Definition
util.c:586
GetColor
void GetColor(int kind, Pixel *what, const char *name)
Get info from the server about a given color.
Definition
util.c:154
tracefile
FILE * tracefile
Definition
util.c:59
ExpandFilename
char * ExpandFilename(const char *name)
Definition
util.c:131
UpdateFont
bool UpdateFont(MyFont *font, int height)
Try adjusting a font's height.
Definition
util.c:292
GetShadeColors
void GetShadeColors(ColorPair *cp)
Try and create a 'shaded' version of a color for prettier UI.
Definition
util.c:245
RescueWindows
void RescueWindows(void)
Backend for f.rescuewindows.
Definition
util.c:471
ExpandFilePath
char * ExpandFilePath(char *path)
Definition
util.c:67
DebugTrace
void DebugTrace(char *file)
Backend for f.trace.
Definition
util.c:553
CreateFonts
void CreateFonts(ScreenInfo *scr)
Load up our various defined fonts.
Definition
util.c:383
min
static int min(int a, int b)
Definition
util.h:30
max
static int max(int a, int b)
Definition
util.h:25
util.h
Generated by
1.18.0