Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
strerror.c File Reference
#include <errno.h>
#include <string.h>
#include "__strerror.h"
Include dependency graph for strerror.c:

Go to the source code of this file.

Macros

#define E(a, b)   ((unsigned char)a),
 
#define E(a, b)   b "\0"
 

Functions

char * strerror (int err_no)
 

Variables

static const unsigned char errid []
 
static const char errmsg []
 

Macro Definition Documentation

◆ E [1/2]

#define E (   a,
 
)    ((unsigned char)a),

Definition at line 12 of file strerror.c.

◆ E [2/2]

#define E (   a,
 
)    b "\0"

Definition at line 12 of file strerror.c.

Function Documentation

◆ strerror()

char* strerror ( int  err_no)

Definition at line 17 of file strerror.c.

18 {
19  const char* s = NULL;
20  int i;
21 
22  for(i = 0; errid[i] && errid[i] != err_no; i++)
23  {
24  }
25 
26  for(s = errmsg; i; s++, i--)
27  {
28  for(; *s; s++)
29  {
30  }
31  }
32  return (char*)(uintptr_t)s;
33 }
#define NULL
Definition: stddef.h:15
static const unsigned char errid[]
Definition: strerror.c:7
static const char errmsg[]
Definition: strerror.c:13

References errid, errmsg, and NULL.

Referenced by strerror_r().

Here is the caller graph for this function:

Variable Documentation

◆ errid

const unsigned char errid[]
static

Definition at line 7 of file strerror.c.

Referenced by strerror().

◆ errmsg

const char errmsg[]
static
Initial value:
=
# 14 "/Users/pjohnston/.jenkins/workspace/ea-nightly_libc_master/src/string/strerror.c" 2

Definition at line 13 of file strerror.c.

Referenced by strerror().