00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00002 * 00003 * The Lemur toolkit for language modeling and information retrieval. 00004 * Copyright (c) 2001 Carnegie Mellon University. All rights reserved. 00005 * 00006 * Redistribution and use in source and binary forms, with or without 00007 * modification, are permitted for research or educational purposes, 00008 * provided that this copyright notice is maintained and note is made 00009 * of any changes to the source code. 00010 * 00011 * This is a research system. The code is distributed on an "as is" basis, 00012 * without any warranty, express or implied. 00013 * 00014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00015 00016 #ifndef _PARAM_H_ 00017 #define _PARAM_H_ 00018 00019 #include <stdio.h> 00020 /* #include "util.h" */ 00021 00022 int param_geti(const char *parameter_name, int default_value); 00023 00024 double param_getf(const char *parameter_name, double default_value); 00025 00026 char *param_getc(const char *parameter_name, char *default_value); 00027 00028 char *param_gets(const char *parameter_name); 00029 00030 int param_getb(const char *parameter_name, int default_value); 00031 /* Returns true if the value of <parameter_name> is 1, true, or yes, 00032 (case insensitive), false for any other value, and default_value 00033 for no value. */ 00034 00035 int param_symvarie(const char *parameter_name, int *returned_value); 00036 /* Returns true if a value was found, false otherwise */ 00037 00038 int param_symvarfe(const char *parameter_name, double *returned_value); 00039 /* Ditto */ 00040 00041 int param_symvarce(const char *parameter_name, char *returned_value); 00042 /* Ditto. Note that the second argument is a "pointer to a char *", 00043 i.e., approximately a pointer to a string. */ 00044 00045 void param_set(const char *parameter_name, char *new_value); 00046 /* Changes the value of ddinf parameter <parameter_name>. This can be 00047 used to communicate with subroutines which expect ddinf 00048 parameters without having to make sure they exist in the ddinf file. 00049 Note, however, that values assigned in the ddinf file are 00050 OVERRIDDEN by a call to param_set. */ 00051 /* One might want to implement a param_add which would allow adding 00052 new ddinf parameters within a program, but which could not 00053 override values from the ddinf file. */ 00054 00055 void param_dump (FILE *stream); 00056 /* Writes the current ddinf bindings to a stream */ 00057 00058 void param_push_prefix (const char *hot_prefix); 00059 /* Push the current prefix to be applied to all ddnames */ 00060 00061 void param_pop_prefix (void); 00062 /* Pop the current prefix */ 00063 00064 int param_push_file (const char *fn); 00065 /* Use the file for all bindings */ 00066 00067 char *param_pop_file (void); 00068 /* Pop current bindings */ 00069 00070 void param_display(); 00071 /* display parameter bindings */ 00072 00073 #endif 00074 00075 00076 00077 00078 00079