1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## gendigits.dpatch by Kilian Krause <kilian@debian.org>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Fix writing to be on stdout rather than some file which fails eventually.
8
--- ../build-area/zaptel-1.2.5/gendigits.c 2005-11-29 19:42:08.000000000 +0100
9
+++ zaptel/gendigits.c 2006-03-30 22:30:51.000000000 +0200
14
-int process(FILE *f, char *label, ZAP_DIAL z[], float low_tone_level, float high_tone_level)
15
+int process(char *label, ZAP_DIAL z[], float low_tone_level, float high_tone_level)
20
init_v2_2 = sin(-4.0 * M_PI * (z->f2 / 8000.0)) * gain;
21
init_v3_2 = sin(-2.0 * M_PI * (z->f2 / 8000.0)) * gain;
23
- fprintf(f, "\t /* %s_%c */ { %d, %d, %d, %d, %d, %d, DEFAULT_DTMF_LENGTH, &%s_silence }, \n", label, c,
24
+ printf("\t /* %s_%c */ { %d, %d, %d, %d, %d, %d, DEFAULT_DTMF_LENGTH, &%s_silence }, \n", label, c,
25
fac1, init_v2_1, init_v3_1,
26
fac2, init_v2_2, init_v3_2,
30
int main(int argc, char *argv[])
34
- if ((f = fopen("tones.h", "w"))) {
35
- fprintf(f, "/* DTMF and MF tones used by the Tormenta Driver, in static tables.\n"
36
+ printf("/* DTMF and MF tones used by the Tormenta Driver, in static tables.\n"
37
" Generated automatically from gendigits. Do not edit by hand. */\n");
38
- fprintf(f, "static struct zt_tone dtmf_tones[16] = {\n");
39
- process(f, "dtmf", dtmf_dial, LEVEL_DTMF_LOW, LEVEL_DTMF_HIGH);
40
- fprintf(f, "};\n\n");
41
- fprintf(f, "static struct zt_tone mfv1_tones[15] = {\n");
42
- process(f, "mfv1", mf_dial, LEVEL_MF, LEVEL_MF);
43
- fprintf(f, "};\n\n");
44
- fprintf(f, "/* END tones.h */\n");
47
- fprintf(stderr, "Unable to open tones.h for writing\n");
50
+ printf("static struct zt_tone dtmf_tones[16] = {\n");
51
+ process("dtmf", dtmf_dial, LEVEL_DTMF_LOW, LEVEL_DTMF_HIGH);
53
+ printf("static struct zt_tone mfv1_tones[15] = {\n");
54
+ process("mfv1", mf_dial, LEVEL_MF, LEVEL_MF);
56
+ printf("/* END tones.h */\n");