/* pcdl.h - Definitions for parsing a Phone Category Definition Language
*
* This file is part of TUA.
*
* Copyright (C) 1991,92,93 Lele Gaifax (lele@nautilus.sublink.org)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the license, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef _PCDL_H
#define _PCDL_H
typedef struct pcdl_slots
{
short from, to, cost;
short definition_line;
struct pcdl_slots * next;
} pcdl_slots;
typedef struct pcdl_names
{
short cost;
char * name;
float cost_per_second; /* If positive it is the cost per second,
* otherwise the fixed cost of the call. */
short definition_line;
struct pcdl_names * next;
} pcdl_names;
typedef struct pcdl_country
{
char * name;
char * currency;
short decimals; /* # of dec digits. It is really funny to
think at a fraction of an Italian Lira ;-) */
pcdl_names * names;
pcdl_slots * slots[7]; /* slots[0] = sunday, ... */
} pcdl_country;
extern pcdl_slots * EXFUN(pcdl_create_new_slot, (NOARGS));
extern pcdl_slots * EXFUN(pcdl_insert_slot, (pcdl_slots * slot, pcdl_slots * slot_list));
extern pcdl_slots * EXFUN(pcdl_merge_slots, (pcdl_slots * slot_list1, pcdl_slots * slot_list2));
extern pcdl_names * EXFUN(pcdl_create_new_name, (NOARGS));
extern pcdl_names * EXFUN(pcdl_insert_name, (pcdl_names * name, pcdl_names * name_list));
extern int EXFUN(pcdl_lookup_rate_symbol, (CONST char * symbol, int ins_flag));
extern void EXFUN(pcdl_destroy_symbol_list, (NOARGS));
extern void EXFUN(pcdl_print_country, (CONST pcdl_country * CONST country));
extern CONST char * EXFUN(pcd_rate_name, (int rate));
extern float EXFUN(pcd_rate_cost, (int rate));
/* The name of the country to search in the PCD file */
extern CONST char * default_country_name;
/* Current country time rates info */
extern pcdl_country current_country;
/* The number of different time rates in the current country */
extern int pcd_names_count;
/* TRUE if we want the list of the countries in the PCD file. */
extern int pcd_list_countries;
#endif /* ifdef _PCDL_H */
syntax highlighted by Code2HTML, v. 0.9.1