~ubuntu-branches/ubuntu/utopic/gridengine/utopic

« back to all changes in this revision

Viewing changes to source/3rdparty/qmon/Xmt310/Xmt/Localize.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2008-06-25 22:36:13 UTC
  • Revision ID: james.westby@ubuntu.com-20080625223613-tvd9xlhuoct9kyhm
Tags: upstream-6.2~beta2
ImportĀ upstreamĀ versionĀ 6.2~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Motif Tools Library, Version 3.1
 
3
 * $Id$
 
4
 * 
 
5
 * Written by David Flanagan.
 
6
 * Copyright (c) 1992-2001 by David Flanagan.
 
7
 * All Rights Reserved.  See the file COPYRIGHT for details.
 
8
 * This is open source software.  See the file LICENSE for details.
 
9
 * There is no warranty for this software.  See NO_WARRANTY for details.
 
10
 *
 
11
 * $Log$
 
12
 * Revision 1.1.1.1  2001/07/18 11:06:02  root
 
13
 * Initial checkin.
 
14
 *
 
15
 * Revision 1.2  2001/06/12 16:25:28  andre
 
16
 * *** empty log message ***
 
17
 *
 
18
 *
 
19
 */
 
20
 
 
21
#include <stdio.h>
 
22
#include <Xmt/XmtP.h>
 
23
#include <Xmt/LookupP.h>
 
24
 
 
25
#if NeedFunctionPrototypes
 
26
String _XmtLocalize(Screen *screen, StringConst default_string,
 
27
                    StringConst category, StringConst tag)
 
28
#else
 
29
String _XmtLocalize(screen, default_string, category, tag)
 
30
Screen *screen;
 
31
StringConst default_string, category, tag;
 
32
#endif
 
33
{
 
34
    char buf[200];
 
35
    String name;
 
36
    String new;
 
37
 
 
38
    if (category && tag) {
 
39
        sprintf(buf, "%s.%s", category, tag);
 
40
        name = buf;
 
41
    }
 
42
    else if (category) name = (String) category;
 
43
    else name = (String) tag;
 
44
 
 
45
    new = _XmtLookupResource(screen, "Mltc", name);
 
46
    if (new) return new;
 
47
    else return (String) default_string;
 
48
}
 
49
 
 
50
#if NeedFunctionPrototypes
 
51
String XmtLocalize2(Widget w, StringConst default_string,
 
52
                   StringConst category, StringConst tag)
 
53
#else
 
54
String XmtLocalize2(w, default_string, category, tag)
 
55
Widget w;
 
56
StringConst default_string, category, tag;
 
57
#endif
 
58
{
 
59
    return _XmtLocalize(XtScreenOfObject(w), default_string, category, tag);
 
60
}
 
61
 
 
62
#if NeedFunctionPrototypes
 
63
String XmtLocalize(Widget w, StringConst default_string, StringConst tag)
 
64
#else
 
65
String XmtLocalize(w, default_string, tag)
 
66
Widget w;
 
67
StringConst default_string;
 
68
StringConst tag;
 
69
#endif
 
70
{
 
71
    return _XmtLocalize(XtScreenOfObject(w), default_string, NULL, tag);
 
72
}
 
73
 
 
74
#if NeedFunctionPrototypes
 
75
String XmtLocalizeWidget(Widget w, StringConst default_string, StringConst tag)
 
76
#else
 
77
String XmtLocalizeWidget(w, default_string, tag)
 
78
Widget w;
 
79
StringConst default_string;
 
80
StringConst tag;
 
81
#endif
 
82
{
 
83
    return _XmtLocalize(XtScreenOfObject(w), default_string,
 
84
                        XtClass(w)->core_class.class_name,
 
85
                        tag);
 
86
}
 
87