pike.git / src / modules / DVB / dvb.c

version» Context lines:

pike.git/src/modules/DVB/dvb.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: dvb.c,v 1.16 2002/11/19 16:11:29 hop Exp $ + || $Id: dvb.c,v 1.17 2002/11/26 20:47:02 grubba Exp $   */      /*    * DVB module    *    * Creator: Honza Petrous <hop@unibase.cz>    *    * Credits:    * + Tuner zapping code inspired on 'szap' app from linux DVB driver    * package
pike.git/src/modules/DVB/dvb.c:1385:   }      static void f_stream_info(INT32 args) {       check_all_args("DVB.dvb->stream_info", args, BIT_INT, 0);    pop_n_elems(args);    push_int(0);      }    + /*! @decl void close() +  *! +  *! Closes an open stream. +  *! +  *! @seealso +  *! @[read()] +  */ + static void f_stream_close(INT32 args) { +  if(DVBStream->fd != -1) { +  close(DVBStream->fd); +  if(DVBStream->pkt.payload != NULL) +  free(DVBStream->pkt.payload); +  } +  DVBStream->fd = -1; +  pop_n_elems(args); +  push_int(0); + } +    /*! @endclass    */      /*! @class Audio    *!    *! Object for controlling an audio subsystem on full featured cards.    */      /*! @decl void create(int card_number)    *! @decl void create()
pike.git/src/modules/DVB/dvb.c:1707:    start_new_program();    ADD_STORAGE(dvb_stream_data);    set_init_callback(init_dvb_stream);    set_exit_callback(exit_dvb_stream);       add_function("create", f_stream_create, "function(object,int,function|int,int:void)", 0);    add_function("destroy", f_stream_detach, "function(void:void)", 0);    add_function("read", f_stream_read, "function(int|void:string|int)", 0);    add_function("set_buffer", f_stream_set_buffer, "function(int:int)", 0);    add_function("info", f_stream_info, "function(int:mapping|int)", 0); +  add_function("close", f_stream_info, "function(:void)", 0);       dvb_stream_program = end_program();    add_program_constant("Stream", dvb_stream_program, 0);       /* Audio */    start_new_program();    ADD_STORAGE(dvb_audio_data);    set_init_callback(init_dvb_audio);    set_exit_callback(exit_dvb_audio);