~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to debian/patches/gendigits.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Kilian Krause, Tzafrir Cohen, Kilian Krause
  • Date: 2006-03-30 23:52:38 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060330235238-loilw12281wdw2p6
Tags: 1:1.2.5-1
[ Tzafrir Cohen ]
* New upstream version
* Only build xpp for i386, as it currently crashes on other arches.
* Fix compilation of xpp for 2.6.14

[ Kilian Krause ]
* Fix gendigits to write to stdout.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## gendigits.dpatch by Kilian Krause <kilian@debian.org>
 
3
##
 
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.
 
6
 
 
7
@DPATCH@
 
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
 
10
@@ -95,7 +95,7 @@
 
11
   return(ulawbyte);
 
12
 }                                                                                            
 
13
 
 
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)
 
16
 {
 
17
        char c;
 
18
        float gain;
 
19
@@ -119,7 +119,7 @@
 
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;
 
22
 
 
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,
 
27
                        label);
 
28
@@ -141,23 +141,15 @@
 
29
 
 
30
 int main(int argc, char *argv[])
 
31
 {
 
32
-       FILE *f;
 
33
-       
 
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");
 
45
-               fclose(f);
 
46
-       } else {
 
47
-               fprintf(stderr, "Unable to open tones.h for writing\n");
 
48
-               return 1;
 
49
-       }
 
50
+       printf("static struct zt_tone dtmf_tones[16] = {\n");
 
51
+       process("dtmf", dtmf_dial, LEVEL_DTMF_LOW, LEVEL_DTMF_HIGH);
 
52
+       printf("};\n\n");
 
53
+       printf("static struct zt_tone mfv1_tones[15] = {\n");
 
54
+       process("mfv1", mf_dial, LEVEL_MF, LEVEL_MF);
 
55
+       printf("};\n\n");
 
56
+       printf("/* END tones.h */\n");
 
57
 
 
58
        return 0;
 
59
 }