Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/exception.h

    r38ac6ec rcbce272  
    1010// Created On       : Mon Jun 26 15:11:00 2017
    1111// Last Modified By : Andrew Beach
    12 // Last Modified On : Tus Jul 11 16:31:00 2017
    13 // Update Count     : 2
     12// Last Modified On : Fri Aug  4 15:20:00 2017
     13// Update Count     : 5
    1414//
    1515
    16 #ifndef EXCEPTION_H
    17 #define EXCEPTION_H
     16#pragma once
    1817
    19 
    20 // Later to be a special structure type.
    21 typedef int exception;
    2218
    2319#ifdef __CFORALL__
    2420extern "C" {
    2521#endif
     22
     23struct __cfaehm__base_exception_t;
     24typedef struct __cfaehm__base_exception_t exception;
     25struct __cfaehm__base_exception_t_vtable {
     26        const struct __cfaehm__base_exception_t_vtable * parent;
     27        size_t size;
     28        void (*copy)(struct __cfaehm__base_exception_t *this,
     29                     struct __cfaehm__base_exception_t * other);
     30        void (*free)(struct __cfaehm__base_exception_t *this);
     31        const char (*msg)(struct __cfaehm__base_exception_t *this);
     32};
     33struct __cfaehm__base_exception_t {
     34        struct __cfaehm__base_exception_t_vtable const * virtual_table;
     35};
     36extern struct __cfaehm__base_exception_t_vtable
     37        ___cfaehm__base_exception_t_vtable_instance;
     38
    2639
    2740// Used in throw statement translation.
     
    3649    int (*match_block)(exception * except));
    3750
     51// Clean-up the exception in catch blocks.
     52void __cfaehm__cleanup_terminate(void * except);
     53
    3854// Data structure creates a list of resume handlers.
    3955struct __cfaehm__try_resume_node {
     
    4258};
    4359
     60// These act as constructor and destructor for the resume node.
    4461void __cfaehm__try_resume_setup(
    4562    struct __cfaehm__try_resume_node * node,
     
    4966
    5067// Check for a standard way to call fake deconstructors.
    51 struct __cfaehm__cleanup_hook {
    52 };
     68struct __cfaehm__cleanup_hook {};
    5369
    5470#ifdef __CFORALL__
    5571}
    5672#endif
    57 
    58 #endif //EXCEPTION_H
Note: See TracChangeset for help on using the changeset viewer.