Back to index

texmacs  1.0.7.15
inittex.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : inittex.cpp
00004 * DESCRIPTION: initialize conversion from and to TeX
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #include "Tex/convert_tex.hpp"
00013 #include "rel_hashmap.hpp"
00014 #include "scheme.hpp"
00015 
00016 static string
00017 latex_type_func (string s) {
00018   return as_string (call ("latex-type", s));
00019 }
00020 
00021 static int
00022 latex_arity_func (string s) {
00023   return as_int (call ("latex-arity", s));
00024 }
00025 
00026 hashfunc<string,string>    latex_std_type (latex_type_func, "undefined");
00027 hashfunc<string,int>       latex_std_arity (latex_arity_func, 0);
00028 
00029 rel_hashmap<string,string> command_type ("undefined");
00030 rel_hashmap<string,int>    command_arity (0);
00031 rel_hashmap<string,string> command_def ("undefined");
00032 
00033 string
00034 latex_type (string s) {
00035   if (command_type->contains (s)) return command_type[s];
00036   else return latex_std_type [s];
00037 }
00038 
00039 int
00040 latex_arity (string s) {
00041   if (command_arity->contains (s)) return command_arity[s];
00042   else return latex_std_arity [s];
00043 }