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

« back to all changes in this revision

Viewing changes to source/3rdparty/qmon/Xmt310/Xmt/XmStringCvt.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:03  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
 
 
22
#include <stdlib.h>
 
23
#include <Xmt/Xmt.h>
 
24
#include <Xmt/ConvertersP.h>
 
25
 
 
26
#if 0 
 
27
/* #if XmVersion >= 2000 */
 
28
/**
 
29
 * Gary Merrill figured out how XmString parsing works in Motif 2.0, and
 
30
 * how rendition tables and tabs are handled, and wrote this code for
 
31
 * Motif 2.0.  David Flanagan tweaked the resulting code a bit.
 
32
 *
 
33
 * The following escape sequences are supported for strings in the
 
34
 * resource files:
 
35
 *
 
36
 *          @t             tab (relative to a tab list)
 
37
 *          @f[tag]        font
 
38
 *          @b[tag]        begin rendition
 
39
 *          @e[tag]        end rendition
 
40
 *          
 
41
 * Keep in mind that renditions override font specifications.
 
42
 *
 
43
 **/
 
44
 
 
45
#if NeedFunctionPrototypes
 
46
static XmIncludeStatus XmtConvertStringEscape(XtPointer *text,
 
47
                                              XtPointer text_end,
 
48
                                              XmTextType type,
 
49
                                              XmStringTag string_tag,
 
50
                                              XmParseMapping entry,
 
51
                                              int pattern_length,
 
52
                                              XmString *str_include,
 
53
                                              XtPointer call_data)
 
54
#else
 
55
static XmIncludeStatus XmtConvertStringEscape(text, text_end, type, string_tag,
 
56
                                              entry, pattern_length,
 
57
                                              str_include, call_data)
 
58
XtPointer *text;
 
59
XtPointer text_end;
 
60
XmTextType type;
 
61
XmStringTag string_tag;
 
62
XmParseMapping entry;
 
63
int pattern_length;
 
64
XmString *str_include;
 
65
XtPointer call_data;
 
66
#endif
 
67
{
 
68
    char *s, *start, *text_ptr, indicator, *tag, tag_buf[3];
 
69
    XmStringComponentType component_type;
 
70
 
 
71
/* printf("...> '%s'\n", (char *) *text); */
 
72
 
 
73
    text_ptr = (char *) *text;
 
74
    start = s = XtNewString(*text);
 
75
    
 
76
    /* s[0] should be '@'.  Bump pointer to following char */
 
77
    s++;
 
78
    
 
79
    if (*s == '@') { /* Sequence is '@@' */
 
80
        *str_include = XmStringComponentCreate(XmSTRING_COMPONENT_TEXT, 1, s);
 
81
        text_ptr +=2;
 
82
        *text = text_ptr;
 
83
        XtFree(start);
 
84
        return XmINSERT;
 
85
    }
 
86
 
 
87
   switch (*s) {
 
88
   case 't':
 
89
       component_type = XmSTRING_COMPONENT_TAB;
 
90
       break;
 
91
   case 'f':  
 
92
       /*
 
93
        * treat @f the same as an unterminated @b.
 
94
        * Using XmSTRING_COMPONENT_TAG doesn't work quite right
 
95
        * with Motif 2.0.0, so we do it this way, which seems
 
96
        * to make as much sense, anyway.
 
97
        */
 
98
   case 'b':
 
99
       component_type = XmSTRING_COMPONENT_RENDITION_BEGIN;
 
100
       break;
 
101
   case 'e':
 
102
       component_type = XmSTRING_COMPONENT_RENDITION_END;
 
103
       break;
 
104
   default:
 
105
       component_type = XmSTRING_COMPONENT_UNKNOWN;
 
106
       break;
 
107
   }
 
108
 
 
109
   indicator = *s;
 
110
 
 
111
   switch (component_type) {
 
112
 
 
113
   case XmSTRING_COMPONENT_UNKNOWN:
 
114
       if ( indicator == '{' )
 
115
           XmtWarningMsg("XmtCreateXmString", "badlocale",
 
116
                         "'@{' locale indicator may occur only at beginning of string.");
 
117
       
 
118
       XmtWarningMsg("XmtCreateXmString", "unrecognized",
 
119
                     "Unrecognized string escape sequence '@%c' will be treated as text.",
 
120
                     indicator);
 
121
       s++;
 
122
       
 
123
       *str_include = XmStringComponentCreate(XmSTRING_COMPONENT_TEXT,
 
124
                                              2, start);
 
125
       text_ptr += 2;
 
126
       *text = text_ptr;
 
127
       XtFree(start);
 
128
       return XmINSERT;
 
129
       break;
 
130
       
 
131
   case XmSTRING_COMPONENT_TAB:
 
132
       *str_include = XmStringComponentCreate(component_type, 0, NULL);
 
133
       s++;
 
134
       text_ptr += s - start;
 
135
       *text = text_ptr;
 
136
       XtFree(start);
 
137
       return XmINSERT;
 
138
       break;
 
139
       
 
140
   default:     /* just drop through */
 
141
       break;
 
142
   }
 
143
    
 
144
    s++;         /* go past the component_type character */
 
145
    
 
146
    if (*s == '\0') {
 
147
        XmtWarningMsg("XmtCreateXmString", "syntax1",
 
148
                      "Improper '@%c' syntax in string being converted.",
 
149
                      indicator);
 
150
        XtFree(start);
 
151
        return XmTERMINATE;
 
152
    }
 
153
    
 
154
    /*
 
155
     * Now get the tag in '[ ]', after '(', or immediately
 
156
     * after the component_type indicator.
 
157
     */
 
158
    switch (*s) {
 
159
    case '[':
 
160
        s = tag = s+1;
 
161
        while (*s && (*s != ']')) s++;
 
162
        if (*s == '\0') {
 
163
            XmtWarningMsg("XmtCreateXmString", "syntax3",
 
164
                          "'@%c[%s' is missing ']' in string being converted",
 
165
                          indicator, tag);
 
166
            break;
 
167
        }
 
168
        *s = '\0'; /* null terminate the tag string */
 
169
        s++;
 
170
        break;
 
171
        
 
172
    case '(':
 
173
        if (!*(s+1) || !*(s+2)) {
 
174
            XmtWarningMsg("XmtCreateXmString", "syntax2",
 
175
                        "Improper '@%c(' syntax in string being converted.",
 
176
                        indicator);
 
177
            XtFree(start);
 
178
            return XmTERMINATE;
 
179
        }
 
180
        tag_buf[0] = *(s+1);
 
181
        tag_buf[1] = *(s+2);
 
182
        tag_buf[2] = '\0';
 
183
        tag = tag_buf;
 
184
        s += 3;
 
185
        break;
 
186
        
 
187
    default:
 
188
        tag_buf[0] = *s;
 
189
        tag_buf[1] = '\0';
 
190
        s++;
 
191
        tag = tag_buf;
 
192
        break;
 
193
    }
 
194
    
 
195
    *str_include = XmStringComponentCreate(component_type, strlen(tag), tag);
 
196
    text_ptr += s - start;
 
197
    *text = text_ptr;
 
198
    
 
199
    XtFree(start);
 
200
    return XmINSERT;
 
201
}
 
202
 
 
203
 
 
204
#if NeedFunctionPrototypes
 
205
XmString XmtCreateXmString(StringConst str)
 
206
#else
 
207
XmString XmtCreateXmString(str)
 
208
StringConst str;
 
209
#endif
 
210
{
 
211
    static Boolean parse_table_registered = False;
 
212
    static XmParseMapping parse_table[3];
 
213
    
 
214
    if (!parse_table_registered) {
 
215
        Arg args[4];
 
216
        int n;
 
217
        
 
218
        n = 0;
 
219
        XtSetArg(args[n], XmNpattern, "\n"); n++;
 
220
        XtSetArg(args[n], XmNpatternType, XmMULTIBYTE_TEXT); n++;
 
221
        XtSetArg(args[n], XmNincludeStatus, XmINSERT); n++;
 
222
        XtSetArg(args[n], XmNsubstitute,XmStringSeparatorCreate());n++;
 
223
        parse_table[0] = XmParseMappingCreate(args, n);
 
224
        
 
225
        n = 0;
 
226
        XtSetArg(args[n], XmNpattern, "\t"); n++;
 
227
        XtSetArg(args[n], XmNpatternType, XmMULTIBYTE_TEXT); n++;
 
228
        XtSetArg(args[n], XmNincludeStatus, XmINSERT); n++;
 
229
        XtSetArg(args[n], XmNsubstitute,
 
230
                 XmStringComponentCreate(XmSTRING_COMPONENT_TAB, 0,NULL)); n++;
 
231
        parse_table[1] = XmParseMappingCreate(args, n);
 
232
        
 
233
        n = 0;
 
234
        XtSetArg(args[n], XmNpattern, "@"); n++;
 
235
        XtSetArg(args[n], XmNpatternType, XmMULTIBYTE_TEXT); n++;
 
236
        XtSetArg(args[n], XmNincludeStatus, XmINVOKE); n++;
 
237
        XtSetArg(args[n], XmNinvokeParseProc, XmtConvertStringEscape); n++;
 
238
        parse_table[2] = XmParseMappingCreate(args, n);
 
239
        
 
240
        parse_table_registered = True;
 
241
    }
 
242
    
 
243
    return XmStringParseText((XtPointer) str, NULL, NULL, XmMULTIBYTE_TEXT,
 
244
                             parse_table, XtNumber(parse_table),
 
245
                             NULL);
 
246
}
 
247
 
 
248
#else  /* XmVersion < 2000 */
 
249
 
 
250
#if NeedFunctionPrototypes
 
251
static XmString appendstring(String txt, XmString to, int sep, char *charset,
 
252
                             int fixup)
 
253
#else
 
254
static XmString appendstring(txt, to, sep, charset, fixup)
 
255
String txt;
 
256
XmString to;
 
257
int sep;
 
258
char *charset;
 
259
int fixup;
 
260
#endif
 
261
{
 
262
#if 0
 
263
   XmString s1, s2;
 
264
   char *mtxt = NULL;
 
265
      
 
266
   if (fixup) {
 
267
      wchar_t *s, *t;
 
268
      wchar_t *ws = NULL;
 
269
      int n;
 
270
 
 
271
      n = mbstowcs(NULL, txt, 0);
 
272
      if (n>0) {
 
273
         ws = (wchar_t*)malloc(sizeof(wchar_t)*(n+1));
 
274
      }
 
275
      if (ws) {
 
276
         mbstowcs(ws, txt, (n+1));
 
277
      }  
 
278
      for(s=t=ws; *s; s++, t++) {
 
279
            *t = *s;
 
280
            if ((*s == L'@') && (*(s+1) == L'@')) s++;
 
281
       }
 
282
       *t = *s;  /* copy the terminating '\0' */
 
283
       n = wcstombs(NULL, ws, 0);
 
284
       if (n > 0) {
 
285
         mtxt = (char*)malloc(sizeof(char)*(n+1));
 
286
      }
 
287
      if (mtxt) {
 
288
         wcstombs(mtxt, ws, (n+1));
 
289
      }  
 
290
      else {
 
291
         mtxt = strdup(txt);
 
292
      }   
 
293
      XtFree((char*)ws);
 
294
   }
 
295
 
 
296
   s1 = XmStringSegmentCreate(mtxt, charset, XmSTRING_DIRECTION_L_TO_R, sep);
 
297
   if (!to) return s1;
 
298
   s2 = XmStringConcat(to, s1);
 
299
   XmStringFree(to);
 
300
   XmStringFree(s1);
 
301
   XtFree(mtxt);
 
302
   return s2;
 
303
 
 
304
#else
 
305
    XmString s1, s2;
 
306
    char *s, *t;
 
307
 
 
308
    if (fixup) {
 
309
        for(s=t=txt; *s; s++, t++) {
 
310
            *t = *s;
 
311
            if ((*s == '@') && (*(s+1) == '@')) s++;
 
312
        }
 
313
        *t = *s;  /* copy the terminating '\0' */
 
314
    }
 
315
 
 
316
    s1 = XmStringSegmentCreate(txt, charset, XmSTRING_DIRECTION_L_TO_R, sep);
 
317
    if (!to) return s1;
 
318
    s2 = XmStringConcat(to, s1);
 
319
    XmStringFree(to);
 
320
    XmStringFree(s1);
 
321
    return s2;
 
322
#endif    
 
323
}
 
324
 
 
325
#if NeedFunctionPrototypes
 
326
XmString XmtCreateXmString(StringConst str)
 
327
#else
 
328
XmString XmtCreateXmString(str)
 
329
StringConst str;
 
330
#endif
 
331
{
 
332
#if 0
 
333
    String r, s, t;
 
334
#ifdef XMSTRING_TO_COMPOUND_TEXT_BUG
 
335
    String charset = XmSTRING_DEFAULT_CHARSET;
 
336
#else    
 
337
#  if XmVersion < 1002
 
338
    String charset = XmSTRING_DEFAULT_CHARSET;
 
339
#  else
 
340
    String charset = XmFONTLIST_DEFAULT_TAG;
 
341
#  endif
 
342
#endif    
 
343
    char charset_buf[3];
 
344
    XmString result = NULL;
 
345
    Boolean fixup = False;
 
346
    
 
347
    if (!str) return NULL;
 
348
    else if (!*str)
 
349
        return XmStringSegmentCreate((String)str, charset,
 
350
                                     XmSTRING_DIRECTION_L_TO_R, False);
 
351
    /*
 
352
     * make a copy of the string so we can frob with it
 
353
     * We keep pointer r so we can free it when done
 
354
     */
 
355
    r = s = XtNewString(str);
 
356
 
 
357
 
 
358
    for(t = s; *s; s++) {
 
359
        switch(*s) {
 
360
        case '\n':
 
361
            *s = '\0';  /* null terminate the string */
 
362
            result = appendstring(t, result, True, charset, fixup);
 
363
            fixup = False;
 
364
            t = s+1;
 
365
            break;
 
366
        case '@':
 
367
            if ((*s == '@') && (*(s+1) == '@')) {
 
368
                /* set a flag to strip doubled escapes later */
 
369
                fixup = True;
 
370
                s++;
 
371
                break;
 
372
            }
 
373
            else if (*(s+1) != 'f') break;
 
374
            /* its a font change, so add the string up to here, if any */
 
375
            *s = '\0'; /* null terminate the string */
 
376
            if (s != t)
 
377
                result = appendstring(t, result, False, charset, fixup);
 
378
            fixup = False;
 
379
 
 
380
            /* and now get the new charset */
 
381
            if (*(s+2) == '\0') break;
 
382
            s+=2;
 
383
            if (*s == '[') {  /* read till close ']' */
 
384
                s = charset = s+1;
 
385
                while (*s && (*s != ']')) s++;
 
386
                if (*s == '\0') break;
 
387
                *s = '\0';  /* null-terminate the charset string */
 
388
            }
 
389
            else if (*s == '(') { /* charset is next 2 chars */
 
390
                if (*(s+1)) s++; else break;
 
391
                charset_buf[0] = *s;
 
392
                if (*(s+1)) s++; else break;
 
393
                charset_buf[1] = *s;
 
394
                charset_buf[2] = '\0';
 
395
                charset = charset_buf;
 
396
            }
 
397
            else if (*s) { /* charset is single current character */
 
398
                charset_buf[0] = *s;
 
399
                charset_buf[1] = '\0';
 
400
                charset = charset_buf;
 
401
            }
 
402
 
 
403
            t = s+1;
 
404
            break;
 
405
        }
 
406
    }
 
407
    if (s != t) result = appendstring(t, result, False, charset, fixup);
 
408
    
 
409
    XtFree(r);
 
410
 
 
411
    return result;
 
412
 
 
413
#else
 
414
    String r, s, t;
 
415
#ifdef XMSTRING_TO_COMPOUND_TEXT_BUG
 
416
    String charset = XmSTRING_DEFAULT_CHARSET;
 
417
#else    
 
418
#  if XmVersion < 1002
 
419
    String charset = XmSTRING_DEFAULT_CHARSET;
 
420
#  else
 
421
    String charset = XmFONTLIST_DEFAULT_TAG;
 
422
#  endif
 
423
#endif    
 
424
    char charset_buf[3];
 
425
    XmString result = NULL;
 
426
    Boolean fixup = False;
 
427
    
 
428
    if (!str) return NULL;
 
429
    else if (!*str)
 
430
        return XmStringSegmentCreate((String)str, charset,
 
431
                                     XmSTRING_DIRECTION_L_TO_R, False);
 
432
    /*
 
433
     * make a copy of the string so we can frob with it
 
434
     * We keep pointer r so we can free it when done
 
435
     */
 
436
    r = s = XtNewString(str);
 
437
 
 
438
 
 
439
    for(t = s; *s; s++) {
 
440
        switch(*s) {
 
441
        case '\n':
 
442
            *s = '\0';  /* null terminate the string */
 
443
            result = appendstring(t, result, True, charset, fixup);
 
444
            fixup = False;
 
445
            t = s+1;
 
446
            break;
 
447
        case '@':
 
448
            if ((*s == '@') && (*(s+1) == '@')) {
 
449
                /* set a flag to strip doubled escapes later */
 
450
                fixup = True;
 
451
                s++;
 
452
                break;
 
453
            }
 
454
            else if (*(s+1) != 'f') break;
 
455
            /* its a font change, so add the string up to here, if any */
 
456
            *s = '\0'; /* null terminate the string */
 
457
            if (s != t)
 
458
                result = appendstring(t, result, False, charset, fixup);
 
459
            fixup = False;
 
460
 
 
461
            /* and now get the new charset */
 
462
            if (*(s+2) == '\0') break;
 
463
            s+=2;
 
464
            if (*s == '[') {  /* read till close ']' */
 
465
                s = charset = s+1;
 
466
                while (*s && (*s != ']')) s++;
 
467
                if (*s == '\0') break;
 
468
                *s = '\0';  /* null-terminate the charset string */
 
469
            }
 
470
            else if (*s == '(') { /* charset is next 2 chars */
 
471
                if (*(s+1)) s++; else break;
 
472
                charset_buf[0] = *s;
 
473
                if (*(s+1)) s++; else break;
 
474
                charset_buf[1] = *s;
 
475
                charset_buf[2] = '\0';
 
476
                charset = charset_buf;
 
477
            }
 
478
            else if (*s) { /* charset is single current character */
 
479
                charset_buf[0] = *s;
 
480
                charset_buf[1] = '\0';
 
481
                charset = charset_buf;
 
482
            }
 
483
 
 
484
            t = s+1;
 
485
            break;
 
486
        }
 
487
    }
 
488
    if (s != t) result = appendstring(t, result, False, charset, fixup);
 
489
    
 
490
    XtFree(r);
 
491
 
 
492
    return result;
 
493
#endif    
 
494
/*     return XmStringCreateLocalized(str); */
 
495
}
 
496
 
 
497
#endif /* XmVersion >= 2000 */
 
498
 
 
499
/* ARGSUSED */
 
500
#if NeedFunctionPrototypes
 
501
static XmString XmtCreateLocalizedXmString_(Screen *screen, StringConst str)
 
502
#else
 
503
static XmString XmtCreateLocalizedXmString_(screen, str)
 
504
Screen* screen;
 
505
StringConst str;
 
506
#endif
 
507
{
 
508
    XmString value = NULL;
 
509
    String category, tag, defaultstr;
 
510
    String free_me = NULL;
 
511
    String s = NULL;
 
512
#if NeedFunctionPrototypes
 
513
    extern String _XmtLocalize(Screen *, StringConst,StringConst,StringConst);
 
514
#else
 
515
    extern String _XmtLocalize();
 
516
#endif
 
517
 
 
518
    if (!str)
 
519
        return NULL;
 
520
 
 
521
/* printf("==> '%s'\n", str); */
 
522
    /* if this string has a tag, localize it first */
 
523
    if ((str[0] == '@') && (str[1] == '{')) {
 
524
        s = XtNewString(str);
 
525
        free_me = s;
 
526
        s += 2;
 
527
/* printf("=-> '%s'\n", s); */
 
528
        category = NULL;
 
529
        tag = NULL;
 
530
        defaultstr = s;
 
531
        while(*s) {
 
532
            if (*s == '.' && !category) {
 
533
                *s = '\0';
 
534
                category = defaultstr;
 
535
                defaultstr = s+1;
 
536
            }
 
537
            if (*s == '.' && !tag) {
 
538
                *s = '\0';
 
539
                tag = defaultstr;
 
540
                defaultstr = s+1;
 
541
            }
 
542
            if (*s == '}') {
 
543
                *s = '\0';
 
544
                s++;
 
545
                break;
 
546
            }
 
547
            s++;
 
548
/* printf("-=> '%s'\n", free_me+2); */
 
549
        }
 
550
        if (!tag)
 
551
           tag = defaultstr;
 
552
        if (!tag[0]) goto error;
 
553
        if (category && !category[0]) goto error;
 
554
        s = _XmtLocalize(screen, defaultstr, category, tag);
 
555
    }
 
556
    else {
 
557
        s = (String)str;
 
558
    }
 
559
 
 
560
/* printf("--> '%s'\n", s); */
 
561
 
 
562
    value = XmtCreateXmString(s);
 
563
 
 
564
    if (!value) goto error;
 
565
    if (free_me) XtFree(free_me);
 
566
 
 
567
    return value;
 
568
 
 
569
 error:
 
570
    if (free_me) XtFree(free_me);
 
571
    return NULL;
 
572
}
 
573
 
 
574
/* ARGSUSED */
 
575
#if NeedFunctionPrototypes
 
576
static void FreeConvertedXmString(XtAppContext app, XrmValue *to,
 
577
                                  XtPointer closure,
 
578
                                  XrmValue *args, Cardinal *num_args)
 
579
#else
 
580
static void FreeConvertedXmString(app, to, closure, args, num_args)
 
581
XtAppContext app;
 
582
XrmValue *to;
 
583
XtPointer closure;
 
584
XrmValue *args;
 
585
Cardinal *num_args;
 
586
#endif
 
587
{
 
588
    XmStringFree(*((XmString *) to->addr));
 
589
}
 
590
 
 
591
 
 
592
 
 
593
 
 
594
/* ARGSUSED */
 
595
#if NeedFunctionPrototypes
 
596
Boolean XmtConvertStringToXmString(Display *dpy,
 
597
                                   XrmValue *args, Cardinal *num_args,
 
598
                                   XrmValue *from, XrmValue *to,
 
599
                                   XtPointer *converter_data)
 
600
#else
 
601
Boolean XmtConvertStringToXmString(dpy, args, num_args,
 
602
                                   from, to, converter_data)
 
603
Display *dpy;
 
604
XrmValue *args;
 
605
Cardinal *num_args;
 
606
XrmValue *from;
 
607
XrmValue *to;
 
608
XtPointer *converter_data;
 
609
#endif
 
610
{
 
611
    String s = (String) from->addr;
 
612
    Screen *screen = *(Screen **)args[0].addr;
 
613
    XmString value;
 
614
    
 
615
    value = XmtCreateLocalizedXmString_(screen, s);
 
616
    if (!value) goto error;
 
617
    done(XmString, value);
 
618
 
 
619
 error:
 
620
    XtDisplayStringConversionWarning(dpy, (String)from->addr, XmRXmString);
 
621
    return False;
 
622
}
 
623
 
 
624
/* ARGSUSED */
 
625
#if NeedFunctionPrototypes
 
626
XmString XmtCreateLocalizedXmString(Widget w, StringConst s)
 
627
#else
 
628
XmString XmtCreateLocalizedXmString(w, s)
 
629
Widget w;
 
630
StringConst s;
 
631
#endif
 
632
{
 
633
   return XmtCreateLocalizedXmString_(XtScreen(w), s);
 
634
}
 
635
 
 
636
#if NeedFunctionPrototypes
 
637
void XmtRegisterXmStringConverter(void)
 
638
#else
 
639
void XmtRegisterXmStringConverter()
 
640
#endif
 
641
{
 
642
    static Boolean registered = False;
 
643
 
 
644
    if (!registered) {
 
645
        XtSetTypeConverter(XtRString, XmRXmString,
 
646
                           XmtConvertStringToXmString,
 
647
                           (XtConvertArgRec *)screenConvertArg, (Cardinal) 1,
 
648
                           XtCacheAll | XtCacheRefCount,
 
649
                           FreeConvertedXmString);
 
650
        registered = True;
 
651
    }
 
652
}
 
653