Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10 | Rev 7673 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | * You should have received a copy of the GNU General Public License |
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 |
14 | * along with this program; if not, write to the Free Software |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | */ |
16 | */ |
17 | 17 | ||
18 |
|
18 | /* This should be a rather independent routine, which are |
19 |
|
19 | * used to interface an outside mathematical encyclopedia. */ |
20 | 20 | ||
21 | void exec_href(char *p); |
21 | void exec_href(char *p); |
22 | 22 | ||
23 |
|
23 | /* internal encyclopedia version */ |
24 | /* void pedia_wims(char *p) |
24 | /* void pedia_wims(char *p) |
25 | { |
25 | { |
26 | char *s, *c, *t, buf[MAX_LINELEN+1]; |
26 | char *s, *c, *t, buf[MAX_LINELEN+1]; |
27 | char r[MAX_LINELEN+1]; |
27 | char r[MAX_LINELEN+1]; |
28 | 28 | ||
29 | t="target=wims_ref"; c="module=adm/enc.$module_language"; |
29 | t="target=wims_ref"; c="module=adm/enc.$module_language"; |
30 | s=getvar(ro_name[ro_module]); |
30 | s=getvar(ro_name[ro_module]); |
31 | if(s!=NULL && strncmp(s,"adm/enc.",strlen("adm/enc."))==0) { |
31 | if(s!=NULL && strncmp(s,"adm/enc.",strlen("adm/enc."))==0) { |
32 | |
32 | c="cmd=reply"; t=""; |
33 | } |
33 | } |
34 | else { |
34 | else { |
35 | |
35 | s=getvar(ro_name[ro_session]); |
36 | |
36 | if(s!=NULL && strstr(s,"_dico")!=NULL) t=""; |
37 | } |
37 | } |
38 | setvar("wims_dico_lookup",p); |
38 | setvar("wims_dico_lookup",p); |
39 | snprintf(buf,MAX_LINELEN,"%s %s&job=search&dom=math&search=$wims_dico_lookup %s", |
39 | snprintf(buf,MAX_LINELEN,"%s %s&job=search&dom=math&search=$wims_dico_lookup %s", |
40 | |
40 | t, c, p); |
41 | mystrncpy(r,ref_name,MAX_LINELEN); |
41 | mystrncpy(r,ref_name,MAX_LINELEN); |
42 | if(pedia_address!=NULL && *pedia_address!=0) { |
42 | if(pedia_address!=NULL && *pedia_address!=0) { |
43 | |
43 | mystrncpy(ref_name,pedia_address,MAX_LINELEN); |
44 | } |
44 | } |
45 | exec_href(buf); |
45 | exec_href(buf); |
46 | mystrncpy(ref_name,r,MAX_LINELEN); |
46 | mystrncpy(ref_name,r,MAX_LINELEN); |
47 | } |
47 | } |
48 | */ |
48 | */ |
49 | 49 | ||
50 |
|
50 | /* this is the (only) public routine in this file. */ |
51 | void pedia(char *p) |
51 | void pedia(char *p) |
52 | { |
52 | { |
53 | 53 | ||
54 | if(*find_word_start(p)==0) return; |
54 | if(*find_word_start(p)==0) return; |
55 | force_setvar("wims_pedia_parm",p); |
55 | force_setvar("wims_pedia_parm",p); |
56 | phtml_put_base("pedia.phtml",1); |
56 | phtml_put_base("pedia.phtml",1); |
57 | *p=0; |
57 | *p=0; |
58 | - | ||
59 | } |
58 | } |
60 | - |