CUBRID Engine  latest
message_catalog.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * message_catalog.h - Message catalog functions with NLS support
22  */
23 
24 #ifndef _MESSAGE_CATALOG_H_
25 #define _MESSAGE_CATALOG_H_
26 
27 #ident "$Id$"
28 
29 #include <stdio.h>
30 
31 /*
32  * System message catalog id; used in msgcat_message()
33  */
34 #define MSGCAT_CATALOG_CUBRID 0
35 #define MSGCAT_CATALOG_CSQL 1
36 #define MSGCAT_CATALOG_UTILS 2
37 
38 /*
39  * Message set id in the message catalog MSGCAT_CATALOG_CUBRID (cubrid.msg).
40  * These define the $set numbers within the catalog file.
41  */
42 #define MSGCAT_SET_GENERAL 1
43 #define MSGCAT_SET_PARAMETERS 4
44 #define MSGCAT_SET_ERROR 5
45 #define MSGCAT_SET_INTERNAL 6
46 #define MSGCAT_SET_PARSER_SYNTAX 7
47 #define MSGCAT_SET_PARSER_SEMANTIC 8
48 #define MSGCAT_SET_PARSER_RUNTIME 9
49 #define MSGCAT_SET_AUTHORIZATION 11
50 #define MSGCAT_SET_HELP 12
51 #define MSGCAT_SET_TRIGGER 13
52 #define MSGCAT_SET_LOCK 14
53 #define MSGCAT_SET_IO 15
54 #define MSGCAT_SET_LOG 16
55 
56 /* Message id in the set MSGCAT_SET_GENERAL */
57 #define MSGCAT_GENERAL_DATABASE_INIT 1
58 #define MSGCAT_GENERAL_COPYRIGHT_HEADER 2
59 #define MSGCAT_GENERAL_COPYRIGHT_BODY 3
60 #define MSGCAT_GENERAL_ARG_NONINT 5
61 #define MSGCAT_GENERAL_ARG_NONFLOAT 6
62 #define MSGCAT_GENERAL_ARG_MISSING 7
63 #define MSGCAT_GENERAL_ARG_DUPLICATE 8
64 #define MSGCAT_GENERAL_ARG_MISSINGVAL 9
65 #define MSGCAT_GENERAL_ARG_UNKNOWN 10
66 #define MSGCAT_GENERAL_ARG_UNEXPECTED 11
67 #define MSGCAT_GENERAL_ARG_NODEF 12
68 #define MSGCAT_GENERAL_ARG_NOMEM 13
69 #define MSGCAT_GENERAL_ARG_TOO_LONG 14
70 #define MSGCAT_GENERAL_ARG_INVALIDNUM 15
71 #define MSGCAT_GENERAL_ARG_OPTIONS 16
72 #define MSGCAT_GENERAL_ARG_OPTIONS2 17
73 
74 /* Message id in the set MSGCAT_SET_TRIGGER */
75 #define MSGCAT_TRIGGER_TRACE_CONDITION 1
76 #define MSGCAT_TRIGGER_TRACE_ACTION 2
77 
78 /* Message id in the set MSGCAT_SET_LOCK are defined in the other file. */
79 
80 /* Message id in the set MSGCAT_SET_IO are defined in the other file. */
81 
82 /* Message id in the set MSGCAT_SET_LOG are defined in the other file. */
83 
84 #ifdef __cplusplus
85 extern "C"
86 {
87 #endif
88 /* functions for use of system message catalog */
89  extern int msgcat_init (void);
90  extern int msgcat_final (void);
91  extern char *msgcat_message (int, int, int);
92 
93 /* message catalog description */
94  typedef struct msg_catd
95  {
96  const char *file; /* file name of this message catalog */
97  void *catd; /* cub_nl_catd from POSIX cub_catopen() */
98  } *MSG_CATD;
99 
100 /* base functions for message catalog support */
101  extern MSG_CATD msgcat_open (const char *);
102  extern MSG_CATD msgcat_get_descriptor (int cat_id);
103  extern char *msgcat_gets (MSG_CATD, int, int, const char *);
104  extern int msgcat_close (MSG_CATD);
105 
106 /* a utility function */
107  extern FILE *msgcat_open_file (const char *name);
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif /* _MESSAGE_CATALOG_H_ */
int msgcat_close(MSG_CATD)
char * msgcat_message(int, int, int)
void * catd
struct msg_catd * MSG_CATD
char * msgcat_gets(MSG_CATD, int, int, const char *)
int msgcat_final(void)
FILE * msgcat_open_file(const char *name)
MSG_CATD msgcat_get_descriptor(int cat_id)
MSG_CATD msgcat_open(const char *)
const char * file
int msgcat_init(void)