Changeset 1104 in MondoRescue for branches/stable/mondo/src/include


Ignore:
Timestamp:
Feb 7, 2007, 8:00:23 PM (17 years ago)
Author:
Bruno Cornec
Message:

Improvement of the low level library (Usage of LINE and FILE and simplified interfaces using macros)

Location:
branches/stable/mondo/src/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/include/mr_err.h

    r1064 r1104  
    99#define MR_ERR_H
    1010
     11#include "mr_msg.h"
     12
    1113/* functions (public methods) */
    1214
    1315extern inline void mr_exit(int errorcode, const char *message);
    14 extern inline void mr_log_exit(int errorcode, const char *message);
     16#define mr_log_exit(x,y) {mr_msg(0,y); mr_exit(x, y);}
    1517
    1618#endif                          /* MR_ERR_H */
  • branches/stable/mondo/src/include/mr_mem.h

    r1096 r1104  
    1717/* functions (public methods) */
    1818
    19 extern inline void mr_free(char *allocated);
    20 extern inline void mr_allocstr(char *alloc, const char *orig);
    21 extern inline void mr_asprintf(char **alloc, const char *fmt, ...);
    22 extern inline void mr_getline(char **lineptr, size_t *n, FILE *stream);
    23 extern inline void *mr_malloc(size_t size);
     19#define mr_free(x) mr_free_int((void **)&x,__LINE__,__FILE__)
     20#define mr_allocstr(x,y) mr_allocstr_int(x, y,__LINE__,__FILE__)
     21#define mr_asprintf(x,y,args...) mr_asprintf_int(x,__LINE__,__FILE__, y, ## args)
     22#define mr_getline(x,y,z) mr_getline_int(x, y,z,__LINE__,__FILE__)
     23#define mr_malloc(x) mr_malloc_int((size_t)x,__LINE__,__FILE__)
     24
     25/* Internal function bringing debuging info
     26 * called indirectly through macros */
     27extern inline void mr_free_int(void **allocated, int line, char *file);
     28extern inline void mr_allocstr_int(char *alloc, const char *orig, int line, char *file);
     29extern inline void mr_asprintf_int(char **alloc, int line, char *file, const char *fmt, ...);
     30extern inline void mr_getline_int(char **lineptr, size_t *n, FILE *stream, int line, char *file);
     31extern inline void *mr_malloc_int(size_t size, int line, char *file);
    2432
    2533#endif                          /* MR_MEM_H */
  • branches/stable/mondo/src/include/mr_msg.h

    r1064 r1104  
    1616/* functions (public methods) */
    1717
    18 extern inline void mr_msg(int debug, const char *fmt, ...);
     18#define mr_msg(x,y,args...) {mr_msg_int(x,__LINE__,__FILE__,y,## args);}
    1919extern void mr_msg_init(const char *configfile, int loglevel);
    2020extern void mr_msg_close(void);
    2121
     22/* Internal function bringing debuging info
     23 * called indirectly through macros */
     24extern inline void mr_msg_int(int debug,int line, const char *file, const char *fmt, ...);
     25
    2226#endif                          /* MR_MSG_H */
Note: See TracChangeset for help on using the changeset viewer.