2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 //%% (c) Copyright 1993, 1994 Hewlett-Packard Company
24 //%% (c) Copyright 1993, 1994 International Business Machines Corp.
25 //%% (c) Copyright 1993, 1994 Sun Microsystems, Inc.
26 //%% (c) Copyright 1993, 1994 Novell, Inc.
27 //%% $XConsortium: tttkutils.C /main/4 1996/02/27 16:06:59 drk $
29 * @(#)tttkutils.C 1.3 93/09/07
31 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
36 #include "api/c/tt_c.h"
37 #include "util/tt_port.h"
38 #include "api/c/api_api.h"
39 #include "tttk/tttk.h"
40 #include "tttk/tttkutils.h"
42 char _TttkKeys[ _TttkNumKeys ] = { 0 };
44 // Array of supported desktop messages
46 const char *TtDtOps[] = {
102 Tt_status status = tt_ptr_error( msg );
103 if ((status != TT_OK) || (msg == 0)) {
104 return TT_CALLBACK_PROCESSED;
106 return TT_CALLBACK_CONTINUE;
116 _tt_syslog( 0, LOG_ERR, "%s: %s", whence, msg );
126 _tt_syslog( 0, LOG_ERR, "%s: %s: %s\n",
127 whence, expr, tt_status_message( status ));
137 _tt_syslog( 0, LOG_ERR, "%s: %s: %d\n", whence, expr, n );
146 _tt_syslog( 0, LOG_ERR, "%s: %s: %m", whence, msg );
154 if (s == 0) return TTDT_OP_NONE;
155 for (int op = TTDT_OP_NONE; op < TTDT_OP_LAST; op++) {
156 const char *opStr = _ttDtOp( (Tttk_op)op );
160 if (strcmp( opStr, s ) == 0) {
172 if ((op > TTDT_OP_NONE) && (op < TTDT_OP_LAST)) {
173 return TtDtOps[ op ];
184 return _tt_strdup( _ttDtOp( op ));