00001 /*************************************************************************** 00002 * Copyright (C) 2006 by André Lindhjem <belgarat@sdf.lonestar.org>, * 00003 * Kjetil Holien <kjetil.holien@gmail.com>, * 00004 * Terje Risa <terje.risa@gmail.com> & * 00005 * Øyvind Nerbråten <oyvind@nerbraten.com> * 00006 * * 00007 * This program is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU General Public License as published by * 00009 * the Free Software Foundation; either version 2 of the License, or * 00010 * (at your option) any later version. * 00011 * * 00012 * This program is distributed in the hope that it will be useful, * 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00015 * GNU General Public License for more details. * 00016 * * 00017 * You should have received a copy of the GNU General Public License * 00018 * along with this program; if not, write to the * 00019 * Free Software Foundation, Inc., * 00020 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00021 *************************************************************************** 00022 * 00023 * \file parsetime.c 00024 * \author André Lindhjem, Kjetil Holien, Terje Risa & Øyvind Nerbråten 00025 * \date 15.02.2006 00026 * 00027 * This library parses valid DAISY time formats and constructs mad_timer_t 00028 */ 00029 00030 #ifndef PARSETIME_H_ 00031 #define PARSETIME_H_ 00032 00033 00034 00035 /* ************************************************ * 00036 * Global datastructures * 00037 * ************************************************ */ 00038 00043 enum pt_type { 00044 PT_INVALID_FORMAT = -1, 00045 PT_FULL_CLOCK = 0, 00046 PT_PARTIAL_CLOCK = 1, 00047 PT_TIMECOUNT = 2 00048 }; 00049 00053 enum pt_unit { 00054 PT_NO_UNIT = 0, 00055 PT_MILLISECONDS = 1, 00056 PT_SECONDS = 2, 00057 PT_MINUTES = 3, 00058 PT_HOURS = 4 00059 }; 00060 00061 00062 00063 /* ************************************************ * 00064 * Global function declarations * 00065 * ************************************************ */ 00066 00073 mad_timer_t parse_time_mad_time_t (const char *expr); 00074 00075 00082 unsigned long int parse_time_milliseconds (const char *expr); 00083 00084 00091 unsigned long int parse_time_get_dur (const char *start, const char *stop); 00092 00093 00094 #endif /*PARSETIME_H_*/