Back to index

wims  3.65+svn20090927
pedia.c
Go to the documentation of this file.
00001 /*    Copyright (C) 1998-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis
00002  *
00003  *  This program is free software; you can redistribute it and/or modify
00004  *  it under the terms of the GNU General Public License as published by
00005  *  the Free Software Foundation; either version 2 of the License, or
00006  *  (at your option) any later version.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00016  */
00017 
00018        /* This should be a rather independent routine, which are 
00019         * used to interface an outside mathematical encyclopedia. */
00020 
00021 void exec_href(char *p);
00022 
00023        /* internal encyclopedia version */
00024 /* void pedia_wims(char *p)
00025 {
00026     char *s, *c, *t, buf[MAX_LINELEN+1];
00027     char r[MAX_LINELEN+1];
00028 
00029     t="target=wims_ref"; c="module=adm/enc.$module_language";
00030     s=getvar(ro_name[ro_module]);
00031     if(s!=NULL && strncmp(s,"adm/enc.",strlen("adm/enc."))==0) {
00032        c="cmd=reply"; t="";
00033     }
00034     else {
00035        s=getvar(ro_name[ro_session]);
00036        if(s!=NULL && strstr(s,"_dico")!=NULL) t="";
00037     }
00038     setvar("wims_dico_lookup",p);
00039     snprintf(buf,MAX_LINELEN,"%s %s&job=search&dom=math&search=$wims_dico_lookup %s",
00040             t, c, p);
00041     mystrncpy(r,ref_name,MAX_LINELEN);
00042     if(pedia_address!=NULL && *pedia_address!=0) {
00043        mystrncpy(ref_name,pedia_address,MAX_LINELEN);
00044     }
00045     exec_href(buf);
00046     mystrncpy(ref_name,r,MAX_LINELEN);
00047 }
00048 */
00049 
00050        /* this is the (only) public routine in this file. */
00051 void pedia(char *p)
00052 {
00053 
00054     if(*find_word_start(p)==0) return;
00055     force_setvar("wims_pedia_parm",p);
00056     phtml_put_base("pedia.phtml",1);
00057     *p=0;
00058     
00059 }
00060