~ubuntu-branches/ubuntu/trusty/zvbi/trusty

« back to all changes in this revision

Viewing changes to examples/network.c

  • Committer: Package Import Robot
  • Author(s): Jackson Doak
  • Date: 2013-10-15 06:29:56 UTC
  • mfrom: (1.1.11) (2.1.13 sid)
  • Revision ID: package-import@ubuntu.com-20131015062956-0b9vqh1f8y90f38k
Tags: 0.2.35-2
* QA upload
* Add 06_sizeof_FTBFS.diff. Closes: #726186

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
26
 */
27
27
 
28
 
/* $Id: network.c,v 1.5 2008/02/19 00:51:51 mschimek Exp $ */
 
28
/* $Id: network.c,v 1.7 2009/03/23 01:30:22 mschimek Exp $ */
29
29
 
30
30
/* This example shows how to identify a network from data transmitted
31
31
   in XDS packets, Teletext packet 8/30 format 1 and 2, and VPS packets.
79
79
 
80
80
        network_name = "unknown";
81
81
        if (0 != ev->ev.network.name[0])
82
 
                network_name = ev->ev.network.name;
 
82
                network_name = (const char *) ev->ev.network.name;
83
83
 
84
84
        /* The network name is an ISO-8859-1 string (the API is
85
85
           quite old...) so we convert it to locale encoding,
93
93
        /* ASCII. */
94
94
        call_sign = "unknown";
95
95
        if (0 != ev->ev.network.call[0])
96
 
                call_sign = ev->ev.network.call;
 
96
                call_sign = (const char *) ev->ev.network.call;
97
97
 
98
98
        printf ("%s: receiving: \"%s\" call sign: \"%s\" "
99
 
                "CNI VPS: 0x%x 8/30-1: 0x%x 8/30-2: 0x%x\n",
 
99
                "CNI VPS: 0x%x 8/30/1: 0x%x 8/30/2: 0x%x\n",
100
100
                event_name,
101
101
                (NULL == locale_network_name) ?
102
102
                "iconv-error" : locale_network_name,
140
140
                        fprintf (stderr, "VBI read error %d (%s)\n",
141
141
                                 errno, strerror (errno));
142
142
                        /* Could be ignored, esp. EIO with some drivers. */
143
 
                        exit(EXIT_FAILURE);
 
143
                        exit (EXIT_FAILURE);
144
144
 
145
145
                case 0: 
146
146
                        fprintf (stderr, "VBI read timeout\n");
147
 
                        exit(EXIT_FAILURE);
 
147
                        exit (EXIT_FAILURE);
148
148
 
149
149
                case 1: /* success */
150
150
                        break;
192
192
                         errstr);
193
193
 
194
194
                free (errstr);
195
 
                errstr = NULL;
196
195
 
197
196
                exit (EXIT_FAILURE);
198
197
        }
210
209
        mainloop ();
211
210
 
212
211
        vbi_decoder_delete (dec);
213
 
        dec = NULL;
214
212
 
215
213
        vbi_capture_delete (cap);
216
 
        cap = NULL;
217
214
 
218
215
        exit (EXIT_SUCCESS);
219
216
}