~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/third_party/gsm/tst/gsm2cod.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
3
 
 * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
4
 
 * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
5
 
 */
6
 
 
7
 
/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm2cod.c,v 1.1 1994/10/21 20:52:11 jutta Exp $*/
8
 
 
9
 
#include <stdio.h>
10
 
#include <assert.h>
11
 
 
12
 
#include        "gsm.h"
13
 
#include        "proto.h"
14
 
 
15
 
char  * pname;
16
 
 
17
 
int     debug      = 0;
18
 
int     verbosity  = 0;
19
 
int     error      = 0;
20
 
 
21
 
usage P0()
22
 
{
23
 
        fprintf(stderr, "Usage: %s [files...]\n", pname);
24
 
        exit(1);
25
 
}
26
 
 
27
 
void process P2((f, filename), FILE * f, char * filename)
28
 
{
29
 
        gsm_frame       buf;
30
 
        gsm_signal      source[76];
31
 
 
32
 
        int             cc;
33
 
        gsm             r;
34
 
        int             nr=0;
35
 
 
36
 
        (void)memset(source, 0, sizeof(source));
37
 
 
38
 
        if (!(r = gsm_create())) {
39
 
                perror("gsm_create");
40
 
                error = 1;
41
 
                return ;
42
 
        }
43
 
        gsm_option(r, GSM_OPT_VERBOSE, &verbosity);
44
 
        for (;;) {
45
 
                cc = fread((char *)buf, sizeof(buf), 1, f);
46
 
                if (cc == 0) {
47
 
                        gsm_destroy(r);
48
 
                        return;
49
 
                }
50
 
                if (cc != 1) {
51
 
                        error = 1;
52
 
                        fprintf(stderr,
53
 
                                "%s: %s -- trailing bytes ignored\n",
54
 
                                pname, filename);
55
 
                        gsm_destroy(r);
56
 
                        return;
57
 
                }
58
 
 
59
 
                gsm_explode(r, buf, source);
60
 
                if (write(1, (char *)source, sizeof(source))!= sizeof(source)) {
61
 
 
62
 
                        perror("write");
63
 
                        error = 1;
64
 
                        gsm_destroy(r);
65
 
                        return;
66
 
                }
67
 
        }
68
 
}
69
 
 
70
 
main P2((ac, av), int ac, char ** av)
71
 
{
72
 
        int             opt;
73
 
        extern char   * optarg;
74
 
        extern int      optind;
75
 
 
76
 
        FILE            * f;
77
 
 
78
 
        if (!(pname = av[0])) pname = "gsm2cod";
79
 
 
80
 
        ac--;
81
 
        av++;
82
 
 
83
 
        if (!ac) process(stdin, "*stdin*");
84
 
        else for (; *av; av++) {
85
 
                if (!(f = fopen(*av, "r"))) perror(*av);
86
 
                else {
87
 
                        process(f, *av);
88
 
                        fclose(f);
89
 
                }
90
 
        }
91
 
 
92
 
        exit(error);
93
 
}