-
Notifications
You must be signed in to change notification settings - Fork 2
/
global.c
48 lines (41 loc) · 1.4 KB
/
global.c
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Copyright 2010-2011 Brian Uechi <[email protected]>
*
* This file is part of mochad.
*
* mochad is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* mochad is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with mochad. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "global.h"
int Cm19a = 0;
/* 1 bit per house code, 1=RF to PL, 0=off, default all house codes on */
unsigned short RfToPl16 = 0xFFFF;
unsigned short RfToRf16 = 0;
/* #define dbprintf(fmt,...) fprintf(stderr, "%s:%d:" fmt, __FILE__,__LINE__,__VA_ARGS__) */
#define dbprintf(fmt, ...) _dbprintf(fmt, __FILE__,__LINE__, ## __VA_ARGS__)
int _dbprintf(const char *fmt, ...)
{
va_list args;
char buf[1024];
char fmtbig[1024];
int buflen;
va_start(args,fmt);
strcpy(fmtbig, "%s:%d:");
strcat(fmtbig, fmt);
buflen = vsprintf(buf, fmtbig, args);
va_end(args);
return fprintf(stderr, "%s", buf);
}