old files
authorMatthias Braun <matze@braunis.de>
Thu, 21 Dec 2006 14:58:05 +0000 (14:58 +0000)
committerMatthias Braun <matze@braunis.de>
Thu, 21 Dec 2006 14:58:05 +0000 (14:58 +0000)
ir/be/bemodules.c [deleted file]
ir/be/bemodules.h [deleted file]

diff --git a/ir/be/bemodules.c b/ir/be/bemodules.c
deleted file mode 100644 (file)
index 7ec3fd0..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Author:      Matthias Braun
- * Date:        29.09.2005
- * Copyright:   (c) Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-
-#include "bemodules.h"
-#include "xmalloc.h"
-
-typedef struct _constructor_list_entry_t {
-       struct _constructor_list_entry_t *next;
-       be_module_constructor_func func;
-} constructor_list_entry_t;
-
-static constructor_list_entry_t *constructors = NULL;
-
-static void free_constructor_list(void)
-{
-       constructor_list_entry_t *entry = constructors;
-
-       while(entry != NULL) {
-               constructor_list_entry_t *next = entry->next;
-               free(entry);
-               entry = next;
-       }
-}
-
-void be_module_add_constructor(be_module_constructor_func func)
-{
-       static int initialized = 0;
-       constructor_list_entry_t *entry;
-
-       if(!initialized) {
-               atexit(free_constructor_list);
-               initialized = 1;
-       }
-
-       entry = xmalloc(sizeof(entry[0]));
-       entry->next = constructors;
-       entry->func = func;
-
-       constructors = entry;
-}
-
-void be_module_call_constructors()
-{
-       constructor_list_entry_t *entry;
-
-       for(entry = constructors; entry != NULL; entry = entry->next) {
-               entry->func();
-       }
-}
diff --git a/ir/be/bemodules.h b/ir/be/bemodules.h
deleted file mode 100644 (file)
index 2f687f2..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Author:      Matthias Braun
- * Date:               11.12.2006
- * Copyright:   (c) Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
- */
-#ifndef BEMODULES_H_
-#define BEMODULES_H_
-
-typedef void (*be_module_constructor_func)(void);
-
-/**
- * Use this macro to register a module constructor. You should put this macro in
- * a .c file of your module. Compiler magic will make sure that your constructor
- * function gets called after the main backend structures are initialized.
- *
- * The module constructor is a convenient place to register commandline options,
- * or add the module to extension lists.
- */
-#define BE_REGISTER_MODULE_CONSTRUCTOR(func) \
-       static void __attribute__((constructor)) _be_constructor(void) \
-       {                                                              \
-               be_module_add_constructor(func);                           \
-       }
-
-// TODO msvc version
-
-/**
- * Warning: internal function, use BE_REGISTER_MODULE_CONSTRUCTOR instead.
- *
- * This function registers the constructor function of a backend module
- */
-void be_module_add_constructor(be_module_constructor_func func);
-
-/**
- * Call all registered constructor functions
- */
-void be_module_call_constructors(void);
-
-#endif