Back to index

glibc  2.9
Classes | Defines | Functions | Variables
nis_error.c File Reference
#include <errno.h>
#include <syslog.h>
#include <string.h>
#include <libintl.h>
#include <rpcsvc/nis.h>
#include "nis_error.h"

Go to the source code of this file.

Classes

union  msgstr_t
struct  msgstr_t.__unnamed__

Defines

#define MF(line)   MF1 (line)
#define MF1(line)   str##line
#define S(s)   char MF(__LINE__)[sizeof (s)];
#define S(s)   s,
#define S(s)   offsetof (union msgstr_t, MF (__LINE__)),

Functions

const char * nis_sperrno (const nis_error status)
 libnsl_hidden_def (nis_sperrno)
void nis_lerror (const nis_error status, const char *label)
char * nis_sperror_r (const nis_error status, const char *label, char *buffer, size_t buflen)
 libnsl_hidden_def (nis_sperror_r)

Variables

static union msgstr_t msgstr
static const unsigned short int msgidx []

Class Documentation

union msgstr_t

Definition at line 29 of file nis_error.c.

Class Members
struct msgstr_t __unnamed__
struct msgstr_t __unnamed__
char str
struct msgstr_t.__unnamed__

Definition at line 31 of file nis_error.c.


Define Documentation

#define MF (   line)    MF1 (line)

Definition at line 27 of file nis_error.c.

#define MF1 (   line)    str##line

Definition at line 28 of file nis_error.c.

#define S (   s)    char MF(__LINE__)[sizeof (s)];

Definition at line 33 of file nis_error.c.

#define S (   s)    s,

Definition at line 33 of file nis_error.c.

#define S (   s)    offsetof (union msgstr_t, MF (__LINE__)),

Definition at line 33 of file nis_error.c.


Function Documentation

Definition at line 63 of file nis_error.c.

{
  fprintf (stderr, "%s: %s\n", label, nis_sperrno (status));
}

Here is the call graph for this function:

Definition at line 90 of file nis_error.c.

{
  static char buffer[NIS_MAXNAMELEN + 1];

  return nis_sperror_r (status, label, buffer, sizeof (buffer));
}

Here is the call graph for this function:

void nis_lerror ( const nis_error  status,
const char *  label 
)

Definition at line 72 of file nis_error.c.

{
  syslog (LOG_ERR, "%s: %s", label, nis_sperrno (status));
}

Here is the call graph for this function:

const char* nis_sperrno ( const nis_error  status)

Definition at line 56 of file nis_error.c.

{
  if (status >= sizeof (msgidx) / sizeof (msgidx[0]))
    return "???";
  else
    return gettext (msgstr.str + msgidx[status]);
}

Here is the call graph for this function:

Here is the caller graph for this function:

char* nis_sperror_r ( const nis_error  status,
const char *  label,
char *  buffer,
size_t  buflen 
)

Definition at line 78 of file nis_error.c.

{
  if (snprintf (buffer, buflen, "%s: %s", label, nis_sperrno (status))
      >= buflen)
    {
      __set_errno (ERANGE);
      return NULL;
    }

  return buffer;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const unsigned short int msgidx[] [static]

Definition at line 47 of file nis_error.c.

union msgstr_t msgstr [static]