CTWM
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 */
25static inline int max(int a, int b)
26{
27 return a > b ? a : b;
28}
29
30static 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
58char *ExpandFilename(const char *name);
59char *ExpandFilePath(char *path);
60
61void GetColor(int kind, Pixel *what, const char *name);
63bool UpdateFont(MyFont *font, int height);
64void CreateFonts(ScreenInfo *scr);
65#if 0
67#endif
68void RescueWindows(void);
69void DebugTrace(char *file);
70
71
72void safe_strncpy(char *dest, const char *src, size_t size);
73
74extern FILE *tracefile;
75
76#endif /* _CTWM_UTIL_H */
static int PlaceX
Definition add_window.c:82
Definition ctwm.h:127
Info and control for each X Screen we control.
Definition screen.h:96
Info and control for every X Window we take over.
void safe_strncpy(char *dest, const char *src, size_t size)
Definition util.c:586
void GetColor(int kind, Pixel *what, const char *name)
Get info from the server about a given color.
Definition util.c:154
FILE * tracefile
Definition util.c:59
static int min(int a, int b)
Definition util.h:30
char * ExpandFilename(const char *name)
Definition util.c:131
bool UpdateFont(MyFont *font, int height)
Try adjusting a font's height.
Definition util.c:292
void GetShadeColors(ColorPair *cp)
Try and create a 'shaded' version of a color for prettier UI.
Definition util.c:245
void RescueWindows(void)
Backend for f.rescuewindows.
Definition util.c:471
static int max(int a, int b)
Definition util.h:25
char * ExpandFilePath(char *path)
Definition util.c:67
void DebugTrace(char *file)
Backend for f.trace.
Definition util.c:553
void CreateFonts(ScreenInfo *scr)
Load up our various defined fonts.
Definition util.c:383