Subversion Repositories wimsdev

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*    Copyright (C) 1998-2003 XIAO, Gang of Universite de Nice - Sophia Antipolis
  2.  *
  3.  *  This program is free software; you can redistribute it and/or modify
  4.  *  it under the terms of the GNU General Public License as published by
  5.  *  the Free Software Foundation; either version 2 of the License, or
  6.  *  (at your option) any later version.
  7.  *
  8.  *  This program is distributed in the hope that it will be useful,
  9.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.  *  GNU General Public License for more details.
  12.  *
  13.  *  You should have received a copy of the GNU General Public License
  14.  *  along with this program; if not, write to the Free Software
  15.  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16.  */
  17.  
  18.         /* This should be a rather independent routine, which are
  19.          * used to interface an outside mathematical encyclopedia. */
  20.  
  21. void exec_href(char *p);
  22.  
  23.         /* internal encyclopedia version */
  24. /* void pedia_wims(char *p)
  25. {
  26.     char *s, *c, *t, buf[MAX_LINELEN+1];
  27.     char r[MAX_LINELEN+1];
  28.  
  29.     t="target=wims_ref"; c="module=adm/enc.$module_language";
  30.     s=getvar(ro_name[ro_module]);
  31.     if(s!=NULL && strncmp(s,"adm/enc.",strlen("adm/enc."))==0) {
  32.         c="cmd=reply"; t="";
  33.     }
  34.     else {
  35.         s=getvar(ro_name[ro_session]);
  36.         if(s!=NULL && strstr(s,"_dico")!=NULL) t="";
  37.     }
  38.     setvar("wims_dico_lookup",p);
  39.     snprintf(buf,MAX_LINELEN,"%s %s&job=search&dom=math&search=$wims_dico_lookup %s",
  40.              t, c, p);
  41.     mystrncpy(r,ref_name,MAX_LINELEN);
  42.     if(pedia_address!=NULL && *pedia_address!=0) {
  43.         mystrncpy(ref_name,pedia_address,MAX_LINELEN);
  44.     }
  45.     exec_href(buf);
  46.     mystrncpy(ref_name,r,MAX_LINELEN);
  47. }
  48. */
  49.  
  50.         /* this is the (only) public routine in this file. */
  51. void pedia(char *p)
  52. {
  53.  
  54.     if(*find_word_start(p)==0) return;
  55.     force_setvar("wims_pedia_parm",p);
  56.     phtml_put_base("pedia.phtml",1);
  57.     *p=0;
  58.    
  59. }
  60.  
  61.