[go: up one dir, main page]

Menu

[e1ed9f]: / src / common.h  Maximize  Restore  History

Download this file

34 lines (26 with data), 940 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __COMMON_H__
#define __COMMON_H__
#include "config.h"
#include <sys/types.h>
#include <unistd.h>
/* gcc specific extension. does nothing on other compilers */
#if defined(__GNUC__)
#define ATTRIB(x) __attribute__ (x)
#else
#define ATTRIB(x) /* no attributes */
#endif
int common_get_smbnetfs_debug_level(void);
int common_set_smbnetfs_debug_level(int level);
int common_set_log_file(const char *logfile);
void common_debug_print(int level, const char *fmt, ...) ATTRIB((format(printf, 2, 3)));
void common_print_backtrace(void);
#ifdef PRINTF_DEBUG
#include <stdio.h>
#define DPRINTF(level, fmt, args...) { fprintf(stderr, "%d->%s: " fmt, getpid(), __FUNCTION__, ## args); fflush(stderr); }
#else
#define DPRINTF(level, fmt, args...) common_debug_print(level, "%d->%s: " fmt, getpid(), __FUNCTION__, ## args)
#endif
#ifndef HAVE_STRNDUP
char* strndup(const char *s, size_t n);
#endif
#endif /* __COMMON_H__ */