Search
lxdream.org :: lxdream/src/lxdream.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/lxdream.h
changeset 502:c4ecae2b1b5e
prev477:9a373f2ff009
next503:36a668469e37
author nkeynes
date Thu Nov 08 11:54:16 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Add sh4ptr_t type, start converting bare pointer refs to it
view annotate diff log raw
     1 /**
     2  * $Id: lxdream.h,v 1.2 2007-11-08 11:54:16 nkeynes Exp $
     3  *
     4  * Common type definitions and forward declarations
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #ifndef lxdream_common_H
    20 #define lxdream_common_H 1
    22 #include <stdint.h>
    23 #include <glib/gtypes.h>
    25 #ifdef __cplusplus
    26 extern "C" {
    27 #endif
    29 #define APP_NAME "lxDream"
    30 #define APP_VERSION "0.8"
    32 #define MB *1024*1024
    33 #define KB *1024
    35 #ifndef max
    36 #define max(a,b) ( (a) > (b) ? (a) : (b) )
    37 #endif
    39 /**
    40  * A 32-bit address in SH4 space
    41  */
    42 typedef uint32_t sh4addr_t;
    43 /**
    44  * A direct pointer into SH4 memory
    45  */
    46 typedef unsigned char *sh4ptr_t;
    48 /******************* Forward type declarations ******************/
    50 typedef struct render_buffer *render_buffer_t;
    51 typedef struct frame_buffer *frame_buffer_t;
    53 /*************************** Logging ****************************/
    55 #define EMIT_FATAL 0
    56 #define EMIT_ERR 1
    57 #define EMIT_WARN 2
    58 #define EMIT_INFO 3
    59 #define EMIT_DEBUG 4
    60 #define EMIT_TRACE 5
    62 #ifdef MODULE
    63 #define MODULE_NAME MODULE.name
    64 #else
    65 #define MODULE_NAME "*****"
    66 #endif
    68 void log_message( void *, int level, const char *source, const char *msg, ... );
    70 #define FATAL( ... ) log_message( NULL, EMIT_FATAL, MODULE_NAME, __VA_ARGS__ )
    71 #define ERROR( ... ) log_message( NULL, EMIT_ERR, MODULE_NAME, __VA_ARGS__ )
    72 #define WARN( ... ) log_message( NULL, EMIT_WARN, MODULE_NAME, __VA_ARGS__ )
    73 #define INFO( ... ) log_message( NULL, EMIT_INFO, MODULE_NAME, __VA_ARGS__ )
    74 #define DEBUG( ... ) log_message( NULL, EMIT_DEBUG, MODULE_NAME, __VA_ARGS__ )
    75 #define TRACE( ... ) log_message( NULL, EMIT_TRACE, MODULE_NAME, __VA_ARGS__ )
    79 #ifdef __cplusplus
    80 }
    81 #endif
    83 #endif /* !lxdream_common_H */
.