1
/* $XConsortium: StrToOrnt.c,v 1.6 90/12/20 13:33:20 converse Exp $ */
4
* Copyright 1988 by the Massachusetts Institute of Technology
6
* Permission to use, copy, modify, and distribute this software and its
7
* documentation for any purpose and without fee is hereby granted, provided
8
* that the above copyright notice appear in all copies and that both that
9
* copyright notice and this permission notice appear in supporting
10
* documentation, and that the name of M.I.T. not be used in advertising
11
* or publicity pertaining to distribution of the software without specific,
12
* written prior permission. M.I.T. makes no representations about the
13
* suitability of this software for any purpose. It is provided "as is"
14
* without express or implied warranty.
18
#include <X11/Intrinsic.h>
19
#include <X11/StringDefs.h>
20
#include "Converters.h"
24
#define done(address, type) \
25
{ (*toVal).size = sizeof(type); (*toVal).addr = (caddr_t) address; }
29
XmuCvtStringToOrientation(args, num_args, fromVal, toVal)
30
XrmValuePtr args; /* unused */
31
Cardinal *num_args; /* unused */
35
static XtOrientation orient;
36
static XrmQuark XtQEhorizontal;
37
static XrmQuark XtQEvertical;
38
static int haveQuarks = 0;
43
XtQEhorizontal = XrmPermStringToQuark(XtEhorizontal);
44
XtQEvertical = XrmPermStringToQuark(XtEvertical);
47
XmuCopyISOLatin1Lowered(lowerName, (char *) fromVal->addr);
48
q = XrmStringToQuark(lowerName);
49
if (q == XtQEhorizontal) {
50
orient = XtorientHorizontal;
51
done(&orient, XtOrientation);
54
if (q == XtQEvertical) {
55
orient = XtorientVertical;
56
done(&orient, XtOrientation);