Back to index

nagios-plugins  1.4.16
Defines | Functions
gettext.h File Reference
#include <string.h>
#include <stdlib.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define gettext(Msgid)   ((const char *) (Msgid))
#define dgettext(Domainname, Msgid)   ((void) (Domainname), gettext (Msgid))
#define dcgettext(Domainname, Msgid, Category)   ((void) (Category), dgettext (Domainname, Msgid))
#define ngettext(Msgid1, Msgid2, N)
#define dngettext(Domainname, Msgid1, Msgid2, N)   ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
#define dcngettext(Domainname, Msgid1, Msgid2, N, Category)   ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))
#define textdomain(Domainname)   ((const char *) (Domainname))
#define bindtextdomain(Domainname, Dirname)   ((void) (Domainname), (const char *) (Dirname))
#define bind_textdomain_codeset(Domainname, Codeset)   ((void) (Domainname), (const char *) (Codeset))
#define gettext_noop(String)   String
#define GETTEXT_CONTEXT_GLUE   "\004"
#define pgettext(Msgctxt, Msgid)   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#define dpgettext(Domainname, Msgctxt, Msgid)   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
#define dcpgettext(Domainname, Msgctxt, Msgid, Category)   pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
#define npgettext(Msgctxt, Msgid, MsgidPlural, N)   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N)   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category)   npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
#define pgettext_expr(Msgctxt, Msgid)   dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
#define dpgettext_expr(Domainname, Msgctxt, Msgid)   dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N)   dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N)   dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)

Functions

static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category)
static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category)
static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category)
static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category)

Define Documentation

Value:
(((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
   /* || __STDC_VERSION__ >= 199901L */ )

Definition at line 181 of file gettext.h.

#define bind_textdomain_codeset (   Domainname,
  Codeset 
)    ((void) (Domainname), (const char *) (Codeset))

Definition at line 91 of file gettext.h.

#define bindtextdomain (   Domainname,
  Dirname 
)    ((void) (Domainname), (const char *) (Dirname))

Definition at line 88 of file gettext.h.

#define dcgettext (   Domainname,
  Msgid,
  Category 
)    ((void) (Category), dgettext (Domainname, Msgid))

Definition at line 72 of file gettext.h.

#define dcngettext (   Domainname,
  Msgid1,
  Msgid2,
  N,
  Category 
)    ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N))

Definition at line 83 of file gettext.h.

#define dcnpgettext (   Domainname,
  Msgctxt,
  Msgid,
  MsgidPlural,
  N,
  Category 
)    npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)

Definition at line 132 of file gettext.h.

#define dcpgettext (   Domainname,
  Msgctxt,
  Msgid,
  Category 
)    pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)

Definition at line 121 of file gettext.h.

#define dgettext (   Domainname,
  Msgid 
)    ((void) (Domainname), gettext (Msgid))

Definition at line 70 of file gettext.h.

#define dngettext (   Domainname,
  Msgid1,
  Msgid2,
 
)    ((void) (Domainname), ngettext (Msgid1, Msgid2, N))

Definition at line 80 of file gettext.h.

#define dnpgettext (   Domainname,
  Msgctxt,
  Msgid,
  MsgidPlural,
 
)    npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)

Definition at line 130 of file gettext.h.

#define dnpgettext_expr (   Domainname,
  Msgctxt,
  Msgid,
  MsgidPlural,
 
)    dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)

Definition at line 236 of file gettext.h.

#define dpgettext (   Domainname,
  Msgctxt,
  Msgid 
)    pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)

Definition at line 119 of file gettext.h.

#define dpgettext_expr (   Domainname,
  Msgctxt,
  Msgid 
)    dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)

Definition at line 191 of file gettext.h.

#define gettext (   Msgid)    ((const char *) (Msgid))

Definition at line 68 of file gettext.h.

#define GETTEXT_CONTEXT_GLUE   "\004"

Definition at line 106 of file gettext.h.

#define gettext_noop (   String)    String

Definition at line 103 of file gettext.h.

#define ngettext (   Msgid1,
  Msgid2,
 
)
Value:
((N) == 1 \
     ? ((void) (Msgid2), (const char *) (Msgid1)) \
     : ((void) (Msgid1), (const char *) (Msgid2)))

Definition at line 75 of file gettext.h.

#define npgettext (   Msgctxt,
  Msgid,
  MsgidPlural,
 
)    npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)

Definition at line 127 of file gettext.h.

#define npgettext_expr (   Msgctxt,
  Msgid,
  MsgidPlural,
 
)    dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)

Definition at line 234 of file gettext.h.

#define pgettext (   Msgctxt,
  Msgid 
)    pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)

Definition at line 116 of file gettext.h.

#define pgettext_expr (   Msgctxt,
  Msgid 
)    dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)

Definition at line 189 of file gettext.h.

#define textdomain (   Domainname)    ((const char *) (Domainname))

Definition at line 86 of file gettext.h.


Function Documentation

static const char* dcnpgettext_expr ( const char *  domain,
const char *  msgctxt,
const char *  msgid,
const char *  msgid_plural,
unsigned long int  n,
int  category 
) [static]

Definition at line 247 of file gettext.h.

{
  size_t msgctxt_len = strlen (msgctxt) + 1;
  size_t msgid_len = strlen (msgid) + 1;
  const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
  char msg_ctxt_id[msgctxt_len + msgid_len];
#else
  char buf[1024];
  char *msg_ctxt_id =
    (msgctxt_len + msgid_len <= sizeof (buf)
     ? buf
     : (char *) malloc (msgctxt_len + msgid_len));
  if (msg_ctxt_id != NULL)
#endif
    {
      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
      msg_ctxt_id[msgctxt_len - 1] = '\004';
      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
      if (msg_ctxt_id != buf)
        free (msg_ctxt_id);
#endif
      if (!(translation == msg_ctxt_id || translation == msgid_plural))
        return translation;
    }
  return (n == 1 ? msgid : msgid_plural);
}
static const char* dcpgettext_expr ( const char *  domain,
const char *  msgctxt,
const char *  msgid,
int  category 
) [static]

Definition at line 202 of file gettext.h.

{
  size_t msgctxt_len = strlen (msgctxt) + 1;
  size_t msgid_len = strlen (msgid) + 1;
  const char *translation;
#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
  char msg_ctxt_id[msgctxt_len + msgid_len];
#else
  char buf[1024];
  char *msg_ctxt_id =
    (msgctxt_len + msgid_len <= sizeof (buf)
     ? buf
     : (char *) malloc (msgctxt_len + msgid_len));
  if (msg_ctxt_id != NULL)
#endif
    {
      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
      msg_ctxt_id[msgctxt_len - 1] = '\004';
      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
      translation = dcgettext (domain, msg_ctxt_id, category);
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
      if (msg_ctxt_id != buf)
        free (msg_ctxt_id);
#endif
      if (translation != msg_ctxt_id)
        return translation;
    }
  return msgid;
}
static const char* npgettext_aux ( const char *  domain,
const char *  msg_ctxt_id,
const char *  msgid,
const char *  msgid_plural,
unsigned long int  n,
int  category 
) [static]

Definition at line 162 of file gettext.h.

{
  const char *translation =
    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
  if (translation == msg_ctxt_id || translation == msgid_plural)
    return (n == 1 ? msgid : msgid_plural);
  else
    return translation;
}
static const char* pgettext_aux ( const char *  domain,
const char *  msg_ctxt_id,
const char *  msgid,
int  category 
) [static]

Definition at line 143 of file gettext.h.

{
  const char *translation = dcgettext (domain, msg_ctxt_id, category);
  if (translation == msg_ctxt_id)
    return msgid;
  else
    return translation;
}