src/lib/error.h
author Tero Marttila <terom@fixme.fi>
Tue, 18 Nov 2008 01:55:13 +0200
changeset 41 6abda2fa4579
parent 36 56427f22e969
child 44 9e76ee9729b6
permissions -rw-r--r--
touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
8
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
#ifndef LIB_ERROR_H
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
#define LIB_ERROR_H
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 8
diff changeset
     4
#include "log.h"
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 8
diff changeset
     5
41
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 36
diff changeset
     6
/*
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 36
diff changeset
     7
 * err_t is always positive
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 36
diff changeset
     8
 */
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 36
diff changeset
     9
typedef unsigned int err_t;
6abda2fa4579 touch up the Makefile, define err_t as unsigned int in error.h, and add some preliminary interrupt support, although it will always deadlock due to a bug in libfuse
Tero Marttila <terom@fixme.fi>
parents: 36
diff changeset
    10
8
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
#define ERROR(...) do { err_func(__func__, __VA_ARGS__); goto error; } while (0)
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
#define PERROR(...) do { perr_func(__func__, __VA_ARGS__); goto error; } while (0)
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
#define EERROR(_err, ...) do { eerr_func(__func__, (_err), __VA_ARGS__); goto error; } while (0)
24
82cfdb6680d1 working dbfs.lookup
Tero Marttila <terom@fixme.fi>
parents: 11
diff changeset
    14
#define NERROR(...) do { err_func_nonl(__func__, __VA_ARGS__); goto error; } while (0)
33
c71f3053c714 working symlink
Tero Marttila <terom@fixme.fi>
parents: 28
diff changeset
    15
#define SERROR(_err) do { (_err); goto error; } while (0)
36
56427f22e969 tweak debug/info output, implement dbfs_unlink with slightly improved error macros handling
Tero Marttila <terom@fixme.fi>
parents: 33
diff changeset
    16
#define XERROR(_err, ...) do { (_err); err_func(__func__, __VA_ARGS__); goto error; } while (0)
56427f22e969 tweak debug/info output, implement dbfs_unlink with slightly improved error macros handling
Tero Marttila <terom@fixme.fi>
parents: 33
diff changeset
    17
#define NXERROR(_err, ...) do { (_err); err_func_nonl(__func__, __VA_ARGS__); goto error; } while (0)
8
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    18
28
e944453ca924 split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents: 24
diff changeset
    19
// XXX: replace with *err_func(...) + exit(EXIT_FAILURE)
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 8
diff changeset
    20
#define FATAL(...) err_func_exit(__func__, __VA_ARGS__)
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 8
diff changeset
    21
#define PFATAL(...) perr_func_exit(__func__, __VA_ARGS__)
28
e944453ca924 split off dbfs components into a separate dir, improve dirop docs, error handling, etc
Tero Marttila <terom@fixme.fi>
parents: 24
diff changeset
    22
#define EFATAL(_err, ...) eerr_func_exit(__func__, (_err), __VA_ARGS__)
11
a4e382d4a22a Makefile fixes, build/deps
Tero Marttila <terom@fixme.fi>
parents: 8
diff changeset
    23
8
21bb5cdca4db working simple_readdir
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    24
#endif /* LIB_ERROR_H */