schedule.h

Go to the documentation of this file.
00001 /*
00002  * SpanDSP - a series of DSP components for telephony
00003  *
00004  * schedule.h
00005  *
00006  * Written by Steve Underwood <steveu@coppice.org>
00007  *
00008  * Copyright (C) 2004 Steve Underwood
00009  *
00010  * All rights reserved.
00011  *
00012  * This program is free software; you can redistribute it and/or modify
00013  * it under the terms of the GNU General Public License as published by
00014  * the Free Software Foundation; either version 2 of the License, or
00015  * (at your option) any later version.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00025  *
00026  * $Id: schedule.h,v 1.4 2005/12/29 12:46:20 steveu Exp $
00027  */
00028 
00029 /*! \file */
00030 
00031 /*! \page schedule_page Scheduling
00032 \section schedule_page_sec_1 What does it do?
00033 ???.
00034 
00035 \section schedule_page_sec_2 How does it work?
00036 ???.
00037 */
00038 
00039 #if !defined(_SCHEDULE_H_)
00040 #define _SCHEDULE_H_
00041 
00042 typedef struct sp_sched_state_s sp_sched_state_t;
00043 
00044 typedef void (*sp_sched_callback_func_t)(sp_sched_state_t *s, void *user_data);
00045 
00046 typedef struct
00047 {
00048     uint64_t when;
00049     sp_sched_callback_func_t callback;
00050     void *user_data;
00051 } sp_sched_t;
00052 
00053 struct sp_sched_state_s
00054 {
00055     uint64_t ticker;
00056     int allocated;
00057     int max_to_date;
00058     sp_sched_t *sched;
00059 };
00060 
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064 
00065 uint64_t sp_schedule_next(sp_sched_state_t *s);
00066 uint64_t sp_schedule_time(sp_sched_state_t *s);
00067 void sp_schedule_run(sp_sched_state_t *s);
00068 
00069 int sp_schedule_event(sp_sched_state_t *s, int ms, void (*function)(sp_sched_state_t *s, void *data), void *user_data);
00070 void sp_schedule_update(sp_sched_state_t *s, int samples);
00071 void sp_schedule_del(sp_sched_state_t *s, int id);
00072 
00073 sp_sched_state_t *sp_schedule_init(sp_sched_state_t *s);
00074 int sp_schedule_release(sp_sched_state_t *s);
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079 
00080 #endif
00081 /*- End of file ------------------------------------------------------------*/

Generated on Fri Nov 10 09:40:24 2006 for libspandsp by  doxygen 1.5.1