msgcat.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004, 2005, 2007  Internet Systems Consortium, Inc. ("ISC")
00003  * Copyright (C) 1999-2001  Internet Software Consortium.
00004  *
00005  * Permission to use, copy, modify, and/or distribute this software for any
00006  * purpose with or without fee is hereby granted, provided that the above
00007  * copyright notice and this permission notice appear in all copies.
00008  *
00009  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
00010  * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
00011  * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
00012  * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
00013  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
00014  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
00015  * PERFORMANCE OF THIS SOFTWARE.
00016  */
00017 
00018 /* $Id: msgcat.h,v 1.13 2007/06/19 23:47:18 tbox Exp $ */
00019 
00020 #ifndef ISC_MSGCAT_H
00021 #define ISC_MSGCAT_H 1
00022 
00023 /*****
00024  ***** Module Info
00025  *****/
00026 
00027 /*! \file isc/msgcat.h
00028  * \brief The ISC Message Catalog
00029  * aids internationalization of applications by allowing
00030  * messages to be retrieved from locale-specific files instead of
00031  * hardwiring them into the application.  This allows translations of
00032  * messages appropriate to the locale to be supplied without recompiling
00033  * the application.
00034  *
00035  * Notes:
00036  *\li   It's very important that message catalogs work, even if only the
00037  *      default_text can be used.
00038  *
00039  * MP:
00040  *\li   The caller must ensure appropriate synchronization of
00041  *      isc_msgcat_open() and isc_msgcat_close().  isc_msgcat_get()
00042  *      ensures appropriate synchronization.
00043  *
00044  * Reliability:
00045  *\li   No anticipated impact.
00046  *
00047  * Resources:
00048  *\li   TBS
00049  *
00050  * \li Security:
00051  *      No anticipated impact.
00052  *
00053  * \li Standards:
00054  *      None.
00055  */
00056 
00057 /*****
00058  ***** Imports
00059  *****/
00060 
00061 #include <isc/lang.h>
00062 #include <isc/types.h>
00063 
00064 ISC_LANG_BEGINDECLS
00065 
00066 /*****
00067  ***** Methods
00068  *****/
00069 
00070 void
00071 isc_msgcat_open(const char *name, isc_msgcat_t **msgcatp);
00072 /*%<
00073  * Open a message catalog.
00074  *
00075  * Notes:
00076  *
00077  *\li   If memory cannot be allocated or other failures occur, *msgcatp
00078  *      will be set to NULL.  If a NULL msgcat is given to isc_msgcat_get(),
00079  *      the default_text will be returned, ensuring that some message text
00080  *      will be available, no matter what's going wrong.
00081  *
00082  * Requires:
00083  *
00084  *\li   'name' is a valid string.
00085  *
00086  *\li   msgcatp != NULL && *msgcatp == NULL
00087  */
00088 
00089 void
00090 isc_msgcat_close(isc_msgcat_t **msgcatp);
00091 /*%<
00092  * Close a message catalog.
00093  *
00094  * Notes:
00095  *
00096  *\li   Any string pointers returned by prior calls to isc_msgcat_get() are
00097  *      invalid after isc_msgcat_close() has been called and must not be
00098  *      used.
00099  *
00100  * Requires:
00101  *
00102  *\li   *msgcatp is a valid message catalog or is NULL.
00103  *
00104  * Ensures:
00105  *
00106  *\li   All resources associated with the message catalog are released.
00107  *
00108  *\li   *msgcatp == NULL
00109  */
00110 
00111 const char *
00112 isc_msgcat_get(isc_msgcat_t *msgcat, int set, int message,
00113                const char *default_text);
00114 /*%<
00115  * Get message 'message' from message set 'set' in 'msgcat'.  If it
00116  * is not available, use 'default_text'.
00117  *
00118  * Requires:
00119  *
00120  *\li   'msgcat' is a valid message catalog or is NULL.
00121  *
00122  *\li   set > 0
00123  *
00124  *\li   message > 0
00125  *
00126  *\li   'default_text' is a valid string.
00127  */
00128 
00129 ISC_LANG_ENDDECLS
00130 
00131 #endif /* ISC_MSGCAT_H */

Generated on Tue Apr 28 17:41:04 2015 by Doxygen 1.5.4 for BIND9 Internals 9.11.0pre-alpha