source: trunk/athena/lib/Xj/StrToJust.c @ 12350

Revision 12350, 1.4 KB checked in by ghudson, 26 years ago (diff)
Some RCS ID cleanup: delete $Log$ and replace other RCS keywords with $Id$.
Line 
1/*
2 * $Id: StrToJust.c,v 1.2 1999-01-22 23:16:59 ghudson Exp $
3 *
4 * Copyright 1990, 1991 by the Massachusetts Institute of Technology.
5 *
6 * For copying and distribution information, please see the file
7 * <mit-copyright.h>.
8 *
9 */
10
11#if  (!defined(lint))  &&  (!defined(SABER))
12static char *rcsid =
13"$Id: StrToJust.c,v 1.2 1999-01-22 23:16:59 ghudson Exp $";
14#endif
15
16#include "mit-copyright.h"
17#include "Jets.h"
18
19/*
20 * String to Justify conversion
21 */
22int StrToJustify(display, window, where, resource, type, address)
23     Display *display;
24     Window window;
25     caddr_t where;
26     XjResource *resource;
27     char *type;
28     caddr_t address;
29{
30  if (strcasecmp(address, XjLeftJustify) == 0  ||
31      strcasecmp(address, XjTopJustify) == 0)
32    {
33      *((int *)((char *)where + resource->resource_offset)) = Left;
34      return 0;
35    }
36
37  if (strcasecmp(address, XjCenterJustify) == 0)
38    {
39      *((int *)((char *)where + resource->resource_offset)) = Center;
40      return 0;
41    }
42
43  if (strcasecmp(address, XjRightJustify) == 0  ||
44      strcasecmp(address, XjBottomJustify) == 0)
45    {
46      *((int *)((char *)where + resource->resource_offset)) = Right;
47      return 0;
48    }
49
50  *((int *)((char *)where + resource->resource_offset)) = Center;
51
52  {
53    char errtext[100];
54    sprintf(errtext, "bad justify value: %s", address);
55    XjWarning(errtext);
56  }
57  return 0;
58}
Note: See TracBrowser for help on using the repository browser.