Subversion Repositories wimsdev

Rev

Rev 7673 | 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. #include "wims.h"
  21.  
  22. void exec_href(char *p);
  23.  
  24. /* internal encyclopedia version */
  25. /* void pedia_wims(char *p)
  26. {
  27.     char *s, *c, *t, buf[MAX_LINELEN+1];
  28.     char r[MAX_LINELEN+1];
  29.  
  30.     t="target=wims_ref"; c="module=adm/enc.$module_language";
  31.     s=getvar(ro_name[ro_module]);
  32.     if(s!=NULL && strncmp(s,"adm/enc.",strlen("adm/enc."))==0) {
  33.      c="cmd=reply"; t="";
  34.     }
  35.     else {
  36.      s=getvar(ro_name[ro_session]);
  37.      if(s!=NULL && strstr(s,"_dico")!=NULL) t="";
  38.     }
  39.     setvar("wims_dico_lookup",p);
  40.     snprintf(buf,MAX_LINELEN,"%s %s&job=search&dom=math&search=$wims_dico_lookup %s",
  41.           t, c, p);
  42.     mystrncpy(r,ref_name,MAX_LINELEN);
  43.     if(pedia_address!=NULL && *pedia_address!=0) {
  44.      mystrncpy(ref_name,pedia_address,MAX_LINELEN);
  45.     }
  46.     exec_href(buf);
  47.     mystrncpy(ref_name,r,MAX_LINELEN);
  48. }
  49. */
  50.  
  51.      /* this is the (only) public routine in this file. */
  52. void pedia(char *p)
  53. {
  54.  
  55.     if(*find_word_start(p)==0) return;
  56.     force_setvar("wims_pedia_parm",p);
  57.     phtml_put_base("pedia.phtml",1);
  58.     *p=0;
  59. }
  60.