ReactOS 0.4.15-dev-7834-g00c4b3d
raisecond.c File Reference
#include <schily/mconfig.h>
#include <schily/stdio.h>
#include <schily/standard.h>
#include <schily/sigblk.h>
#include <schily/unistd.h>
#include <schily/stdlib.h>
#include <schily/string.h>
#include <schily/avoffset.h>
#include <schily/schily.h>
Include dependency graph for raisecond.c:

Go to the source code of this file.

Macros

#define STDERR_FILENO   2
 
#define eprints(a)   (void)write(STDERR_FILENO, (a), sizeof (a)-1)
 
#define eprintl(a)   (void)write(STDERR_FILENO, (a), strlen(a))
 
#define is_even(p)   ((((long)(p)) & 1) == 0)
 
#define even(p)   (((long)(p)) & ~1L)
 
#define next_frame(vp)   vp = (((SIGBLK *)(vp))->sb_savfp);
 

Functions

LOCAL void raiseabort __PR ((const char *))
 
LOCAL BOOL framehandle __PR ((SIGBLK *, const char *, const char *, long))
 
EXPORT void raisecond (char *signame, long arg2) const
 
LOCAL BOOL framehandle (SIGBLK *sp, const char *handlename, const char *signame, long arg2)
 
LOCAL void raiseabort (char *signame) const
 

Variables

EXPORT SIGBLK__roothandle
 

Macro Definition Documentation

◆ eprintl

#define eprintl (   a)    (void)write(STDERR_FILENO, (a), strlen(a))

Definition at line 47 of file raisecond.c.

◆ eprints

#define eprints (   a)    (void)write(STDERR_FILENO, (a), sizeof (a)-1)

Definition at line 46 of file raisecond.c.

◆ even

#define even (   p)    (((long)(p)) & ~1L)

Definition at line 50 of file raisecond.c.

◆ is_even

#define is_even (   p)    ((((long)(p)) & 1) == 0)

Definition at line 49 of file raisecond.c.

◆ next_frame

#define next_frame (   vp)    vp = (((SIGBLK *)(vp))->sb_savfp);

Definition at line 84 of file raisecond.c.

◆ STDERR_FILENO

#define STDERR_FILENO   2

Definition at line 44 of file raisecond.c.

Function Documentation

◆ __PR() [1/2]

LOCAL void raiseabort __PR ( (const char *)  )

◆ __PR() [2/2]

LOCAL BOOL framehandle __PR ( (SIGBLK *, const char *, const char *, long )

◆ framehandle()

LOCAL BOOL framehandle ( SIGBLK sp,
const char handlename,
const char signame,
long  arg2 
)

Definition at line 145 of file raisecond.c.

150{
151 for (; sp; sp = sp->sb_signext) {
152 if (sp->sb_signame != NULL &&
153 streql(sp->sb_signame, handlename)) {
154 if (sp->sb_sigfun == NULL) { /* deactivated */
155 return (FALSE);
156 } else {
157 return (*sp->sb_sigfun)(signame,
158 sp->sb_sigarg, arg2);
159 }
160 }
161 }
162 return (FALSE);
163}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
static const WCHAR sp[]
Definition: suminfo.c:287
EXPORT int streql(char *a, const char *b) const
Definition: streql.c:23

Referenced by raisecond().

◆ raiseabort()

LOCAL void raiseabort ( char signame) const

Definition at line 166 of file raisecond.c.

168{
169 eprints("Condition not caught: "); eprintl(signame); eprints(".\n");
170 abort();
171 /* NOTREACHED */
172}
#define abort()
Definition: i386-dis.c:34
#define eprints(a)
Definition: raisecond.c:46
#define eprintl(a)
Definition: raisecond.c:47

Referenced by raisecond().

◆ raisecond()

EXPORT void raisecond ( char signame,
long  arg2 
) const

Definition at line 100 of file raisecond.c.

103{
104 register void *vp = NULL;
105
106#ifdef HAVE_SCANSTACK
107 /*
108 * As the SCO OpenServer C-Compiler has a bug that may cause
109 * the first function call to getfp() been done before the
110 * new stack frame is created, we call getfp() twice.
111 */
112 (void) getfp();
113 vp = getfp();
114 next_frame(vp);
115#else
116 vp = __roothandle;
117#endif
118
119 while (vp) {
120 if (framehandle((SIGBLK *)vp, signame, signame, arg2))
121 return;
122 else if (framehandle((SIGBLK *)vp, "any_other", signame, arg2))
123 return;
124#ifdef HAVE_SCANSTACK
125 vp = (struct frame *)((SIGBLK *)vp)->sb_savfp;
126#endif
127 next_frame(vp);
128 }
129 /*
130 * No matching handler that signals success found.
131 * Print error message and abort.
132 */
133 raiseabort(signame);
134 /* NOTREACHED */
135}
EXPORT SIGBLK * __roothandle
Definition: raisecond.c:81
LOCAL BOOL framehandle(SIGBLK *sp, const char *handlename, const char *signame, long arg2)
Definition: raisecond.c:145
LOCAL void raiseabort(char *signame) const
Definition: raisecond.c:166
#define next_frame(vp)
Definition: raisecond.c:84
Definition: sigblk.h:30

Referenced by _cvmod(), checkfmt(), and filewrite().

Variable Documentation

◆ __roothandle

EXPORT SIGBLK* __roothandle

Definition at line 81 of file raisecond.c.

Referenced by raisecond().