Category : Files from Magazines
Archive   : CUJ9209.ZIP
Filename : 1009024A

 
Output of file : 1009024A contained in archive : CUJ9209.ZIP
// LISTING 4

#ifndef EXH_H
#define EXH_H

#include
#include
#include "JmpStack.h"
#include "Exception.h"

typedef void(*PFV)();
extern void terminate();
extern PFV set_terminate(PFV);
extern void unexpected();
extern PFV set_unexpected(PFV);

class ExH {
public:
enum {BUFSIZE=2024};

private:
friend PFV set_terminate(PFV);
friend PFV set_unexpected(PFV);
friend void terminate();
friend void unexpected();
static PFV terminate;
static PFV unexpected;

static char safeSpace[BUFSIZE];

public:
static Exception* lastEx; // Pointer to safeSpace
static JmpStack stk;
static void throw(Exception&);
};

inline void ExH::throw (Exception& ex)
{
// Copy exception to a safe place
if(ExH::lastEx != &ex)
memcpy(ExH::safeSpace, &ex, ex.size());

// longjmp to last try
longjmp(ExH::stk--, ex.type());
}

#endif


  3 Responses to “Category : Files from Magazines
Archive   : CUJ9209.ZIP
Filename : 1009024A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/