Automatically remove trailing whitespace
This commit is contained in:
24
src/Makefile
24
src/Makefile
@@ -66,14 +66,14 @@ tags:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: cci.h port.h cciServer.h kcms.h
|
||||
|
||||
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
|
||||
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
|
||||
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: bitmaps/*.xbm
|
||||
|
||||
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
@@ -87,8 +87,8 @@ gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
|
||||
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
|
||||
gui-menubar.o: ../libwww2/HTAAUtil.h
|
||||
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
|
||||
|
||||
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
@@ -104,7 +104,7 @@ newsrc.o: prefs.h prefs_defs.h
|
||||
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
|
||||
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
|
||||
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
|
||||
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
|
||||
@@ -119,7 +119,7 @@ hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
|
||||
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
|
||||
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
|
||||
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
|
||||
history.o: hotlist.h ../libwww2/HTAAUtil.h
|
||||
|
||||
@@ -149,7 +149,7 @@ img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
|
||||
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
|
||||
img.o: bitmaps/gopher_unknown.xbm
|
||||
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
|
||||
|
||||
xpmhash.o: xpm.h
|
||||
@@ -158,7 +158,7 @@ xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
|
||||
|
||||
gifread.o: gifread.h
|
||||
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: pixmaps.h xpmread.h xpm.h
|
||||
pixmaps.o: pixmaps/*.xpm
|
||||
|
||||
@@ -170,7 +170,7 @@ hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
|
||||
|
||||
child.o: child.h list.h
|
||||
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: ../libnut/url-utils.h ../libnut/system.h
|
||||
|
||||
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
|
||||
@@ -200,8 +200,8 @@ support.o: cci.h port.h
|
||||
bla.o: cciServer.h cci.h port.h list.h
|
||||
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
|
||||
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
|
||||
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# @configure_output@
|
||||
# This file is used by Autoconf to make the real Makefile.
|
||||
# DO NOT EDIT THIS FILE!
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# If you want to change something do it to the Makefile autoconf
|
||||
# creates. You should never have to edit this file.
|
||||
|
||||
CC= @CC@
|
||||
@@ -74,14 +74,14 @@ tags:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: cci.h port.h cciServer.h kcms.h
|
||||
|
||||
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
|
||||
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
|
||||
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: bitmaps/*.xbm
|
||||
|
||||
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
@@ -95,8 +95,8 @@ gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
|
||||
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
|
||||
gui-menubar.o: ../libwww2/HTAAUtil.h
|
||||
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
|
||||
|
||||
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
@@ -112,7 +112,7 @@ newsrc.o: prefs.h prefs_defs.h
|
||||
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
|
||||
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
|
||||
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
|
||||
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
|
||||
@@ -127,7 +127,7 @@ hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
|
||||
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
|
||||
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
|
||||
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
|
||||
history.o: hotlist.h ../libwww2/HTAAUtil.h
|
||||
|
||||
@@ -157,7 +157,7 @@ img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
|
||||
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
|
||||
img.o: bitmaps/gopher_unknown.xbm
|
||||
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
|
||||
|
||||
xpmhash.o: xpm.h
|
||||
@@ -166,7 +166,7 @@ xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
|
||||
|
||||
gifread.o: gifread.h
|
||||
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: pixmaps.h xpmread.h xpm.h
|
||||
pixmaps.o: pixmaps/*.xpm
|
||||
|
||||
@@ -178,7 +178,7 @@ hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
|
||||
|
||||
child.o: child.h list.h
|
||||
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: ../libnut/url-utils.h ../libnut/system.h
|
||||
|
||||
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
|
||||
@@ -208,8 +208,8 @@ support.o: cci.h port.h
|
||||
bla.o: cciServer.h cci.h port.h list.h
|
||||
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
|
||||
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h /usr/include/stdarg.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
|
||||
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
|
||||
|
||||
|
||||
@@ -66,14 +66,14 @@ tags:
|
||||
|
||||
# DO NOT DELETE THIS LINE -- make depend depends on it.
|
||||
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
main.o: main.h gui.h pan.h child.h globalhist.h cciBindings2.h
|
||||
main.o: cci.h port.h cciServer.h kcms.h
|
||||
|
||||
gui.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h port.h
|
||||
gui.o: gui-documents.h main.h mo-www.h gui-menubar.h proxy.h pan.h pixmaps.h
|
||||
gui.o: ../libwww2/HTAAUtil.h ../libhtmlw/HTML.h xresources.h cci.h
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: pixmaps/*.xpm
|
||||
gui.o: bitmaps/*.xbm
|
||||
|
||||
gui-dialogs.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
@@ -87,8 +87,8 @@ gui-menubar.o: cciBindings.h cciBindings2.h cciServer.h history.h pan.h
|
||||
gui-menubar.o: annotate.h mo-www.h globalhist.h proxy.h
|
||||
gui-menubar.o: ../libwww2/HTAAUtil.h
|
||||
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
gui-documents.o: gui.h gui-documents.h gui-extras.h mo-www.h annotate.h
|
||||
gui-documents.o: history.h ../libhtmlw/HTML.h cci.h port.h cciBindings.h
|
||||
|
||||
gui-news.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
@@ -104,7 +104,7 @@ newsrc.o: prefs.h prefs_defs.h
|
||||
gui-extras.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
gui-extras.o: gui-extras.h mo-www.h ../libhtmlw/HTML.h ../libnut/system.h
|
||||
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
mo-www.o: mo-www.h ../libwww2/HTAAUtil.h ../libwww2/HTUtils.h
|
||||
mo-www.o: ../libwww2/HTString.h ../libwww2/tcp.h ../libwww2/HTTCP.h
|
||||
mo-www.o: ../libwww2/HTParse.h ../libwww2/HTAccess.h ../libwww2/HTAnchor.h
|
||||
@@ -119,7 +119,7 @@ hotlist.o: mosaic.h ../libXmx/Xmx.h toolbar.h
|
||||
hotlist.o: prefs.h prefs_defs.h hotlist.h hotfile.h gui.h
|
||||
hotlist.o: mo-www.h bitmaps/hotlist.xbm ../libnut/system.h
|
||||
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
history.o: gui.h mo-www.h gui-popup.h ../libhtmlw/HTML.h
|
||||
history.o: hotlist.h ../libwww2/HTAAUtil.h
|
||||
|
||||
@@ -149,7 +149,7 @@ img.o: bitmaps/gopher_sound.xbm bitmaps/gopher_index.xbm
|
||||
img.o: bitmaps/gopher_telnet.xbm bitmaps/gopher_binary.xbm
|
||||
img.o: bitmaps/gopher_unknown.xbm
|
||||
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
picread.o: picread.h gifread.h xpmread.h readJPEG.h readPNG.h
|
||||
|
||||
xpmhash.o: xpm.h
|
||||
@@ -158,7 +158,7 @@ xpmread.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h xpmread.h
|
||||
|
||||
gifread.o: gifread.h
|
||||
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h
|
||||
pixmaps.o: pixmaps.h xpmread.h xpm.h
|
||||
pixmaps.o: pixmaps/*.xpm
|
||||
|
||||
@@ -170,7 +170,7 @@ hotfile.o: prefs.h prefs_defs.h hotlist.h mo-www.h ../libhtmlw/HTML.h
|
||||
|
||||
child.o: child.h list.h
|
||||
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h gui.h
|
||||
mailto.o: ../libnut/url-utils.h ../libnut/system.h
|
||||
|
||||
readJPEG.o: mosaic.h ../libXmx/Xmx.h toolbar.h prefs.h prefs_defs.h readJPEG.h
|
||||
@@ -200,8 +200,8 @@ support.o: cci.h port.h
|
||||
bla.o: cciServer.h cci.h port.h list.h
|
||||
bla.o: memStuffForPipSqueeks.h ../libwww2/HTPlain.h ../libwww2/HTStream.h
|
||||
bla.o: ../libwww2/HTUtils.h ../libwww2/HTString.h /usr/include/stdarg.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAnchor.h ../libwww2/HTList.h ../libwww2/HTAtom.h
|
||||
bla.o: ../libwww2/HTFormat.h ../libwww2/HText.h ../libwww2/HTFile.h
|
||||
bla.o: ../libwww2/HTAccess.h ../libwww2/tcp.h ../libwww2/HTML.h
|
||||
bla.o: ../libwww2/HTMLDTD.h ../libwww2/SGML.h ../libwww2/HTCompressed.h
|
||||
|
||||
|
||||
10
src/accept.c
10
src/accept.c
@@ -113,7 +113,7 @@ struct protoent *protocolEntry;
|
||||
else {
|
||||
socketFD = socket(AF_INET, SOCK_STREAM,0);
|
||||
}
|
||||
|
||||
|
||||
if (socketFD < 0) {
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -131,7 +131,7 @@ struct protoent *protocolEntry;
|
||||
serverAddress.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||
serverAddress.sin_port = htons(portNumber);
|
||||
|
||||
if (bind(socketFD, (struct sockaddr *) &serverAddress,
|
||||
if (bind(socketFD, (struct sockaddr *) &serverAddress,
|
||||
sizeof(serverAddress))<0){
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
@@ -146,7 +146,7 @@ struct protoent *protocolEntry;
|
||||
/* set socket to non-blocking for linux */
|
||||
fcntl(socketFD,FNDELAY,0);
|
||||
#endif
|
||||
|
||||
|
||||
if (listen(socketFD,5) == -1) {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
@@ -160,7 +160,7 @@ struct protoent *protocolEntry;
|
||||
/* set socket to non-blocking */
|
||||
ioctl(socketFD,FIONBIO,0);
|
||||
#endif
|
||||
|
||||
|
||||
return(socketFD);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ fd_set readfds;
|
||||
else {
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int NetIsThereAConnection(socketFD)
|
||||
|
||||
142
src/annotate.c
142
src/annotate.c
@@ -173,8 +173,8 @@ static void set_annotation_mode (mo_window *win, int mode)
|
||||
{
|
||||
win->annotation_mode = mode;
|
||||
|
||||
XmxSetSensitive
|
||||
(win->delete_button,
|
||||
XmxSetSensitive
|
||||
(win->delete_button,
|
||||
mode == mo_edit_annotation ? XmxSensitive : XmxNotSensitive);
|
||||
return;
|
||||
}
|
||||
@@ -230,12 +230,12 @@ static XmxCallback (annotate_win_cb)
|
||||
for (i = 0; i < strlen (author); i++)
|
||||
if (author[i] == '\"')
|
||||
author[i] = '\'';
|
||||
|
||||
|
||||
/*
|
||||
* Add the new annotation to the server -- with its real URL
|
||||
* if inside an HDF file, else the canonical form.
|
||||
*/
|
||||
mo_new_grpan(mo_url_to_unique_document
|
||||
mo_new_grpan(mo_url_to_unique_document
|
||||
(win->current_node->url), title, author, txt);
|
||||
|
||||
mo_set_win_current_node (win, win->current_node);
|
||||
@@ -263,8 +263,8 @@ static XmxCallback (annotate_win_cb)
|
||||
/*
|
||||
* Change the annotation on the server
|
||||
*/
|
||||
mo_modify_grpan(mo_url_to_unique_document
|
||||
(win->current_node->url),
|
||||
mo_modify_grpan(mo_url_to_unique_document
|
||||
(win->current_node->url),
|
||||
title, author, txt);
|
||||
|
||||
mo_reload_window_text (win, 0);
|
||||
@@ -282,10 +282,10 @@ static XmxCallback (annotate_win_cb)
|
||||
{
|
||||
if (win->annotation_mode == mo_new_annotation)
|
||||
{
|
||||
mo_new_pan
|
||||
(mo_url_to_unique_document (win->current_node->url),
|
||||
XmxTextGetString (win->annotate_title),
|
||||
XmxTextGetString (win->annotate_author),
|
||||
mo_new_pan
|
||||
(mo_url_to_unique_document (win->current_node->url),
|
||||
XmxTextGetString (win->annotate_title),
|
||||
XmxTextGetString (win->annotate_author),
|
||||
txt);
|
||||
/* Inefficient, but safe. */
|
||||
mo_write_pan_list ();
|
||||
@@ -294,8 +294,8 @@ static XmxCallback (annotate_win_cb)
|
||||
else /* edit annotation */
|
||||
{
|
||||
mo_modify_pan (win->editing_id,
|
||||
XmxTextGetString (win->annotate_title),
|
||||
XmxTextGetString (win->annotate_author),
|
||||
XmxTextGetString (win->annotate_title),
|
||||
XmxTextGetString (win->annotate_author),
|
||||
txt);
|
||||
/* Inefficient, but safe. */
|
||||
mo_write_pan_list ();
|
||||
@@ -325,7 +325,7 @@ static XmxCallback (passwd_toggle_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
int on = XmToggleButtonGetState (win->passwd_toggle);
|
||||
|
||||
|
||||
if (on)
|
||||
{
|
||||
XmxSetSensitive (win->passwd_label, XmxSensitive);
|
||||
@@ -353,7 +353,7 @@ static void do_slate (mo_window *win)
|
||||
sprintf (namestr, "%s (%s)",
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL),
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME));
|
||||
|
||||
|
||||
XmxTextSetString (win->annotate_author, namestr);
|
||||
|
||||
sprintf (namestr, "%s %s","Annotation by",
|
||||
@@ -382,7 +382,7 @@ static XmxCallback (include_fsb_cb)
|
||||
|
||||
XtUnmanageChild (win->include_fsb);
|
||||
fname = (char *)malloc (128 * sizeof (char));
|
||||
|
||||
|
||||
XmStringGetLtoR (((XmFileSelectionBoxCallbackStruct *)call_data)->value,
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&fname);
|
||||
@@ -406,8 +406,8 @@ static XmxCallback (include_fsb_cb)
|
||||
|
||||
sprintf(final,"\nUnable to Open File:\n %s\n\nOpen Error:\n %s\n",(!efname || !*efname?" ":efname),buf);
|
||||
|
||||
XmxMakeErrorDialog (win->annotate_win,
|
||||
final,
|
||||
XmxMakeErrorDialog (win->annotate_win,
|
||||
final,
|
||||
"Annotation Open Error");
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
@@ -417,14 +417,14 @@ static XmxCallback (include_fsb_cb)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
long pos;
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto done;
|
||||
|
||||
|
||||
XmTextInsert (win->annotate_text,
|
||||
pos = XmTextGetInsertionPosition (win->annotate_text),
|
||||
line);
|
||||
@@ -452,7 +452,7 @@ static XmxCallback (include_button_cb)
|
||||
{
|
||||
XmFileSelectionDoSearch (win->include_fsb, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->include_fsb);
|
||||
|
||||
return;
|
||||
@@ -478,19 +478,19 @@ mo_status mo_delete_annotation (mo_window *win, int id)
|
||||
return mo_fail;
|
||||
|
||||
mo_delete_pan (id);
|
||||
|
||||
|
||||
/* Now that we've deleted the annotation, take care of
|
||||
business. Damn, but this shouldn't have to happen here. */
|
||||
if (win->current_node->previous)
|
||||
{
|
||||
mo_node *prev = win->current_node->previous;
|
||||
|
||||
|
||||
mo_kill_node (win, win->current_node);
|
||||
prev->next = NULL;
|
||||
win->current_node = prev;
|
||||
/* Set the text. */
|
||||
mo_reload_window_text (win, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No previous node; this only happens if someone's dumb enough
|
||||
@@ -502,7 +502,7 @@ mo_status mo_delete_annotation (mo_window *win, int id)
|
||||
|
||||
mo_load_window_text (win, home_document, NULL);
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -522,13 +522,13 @@ mo_status mo_delete_group_annotation (mo_window *win, char *url)
|
||||
if (win->current_node->previous)
|
||||
{
|
||||
mo_node *prev = win->current_node->previous;
|
||||
|
||||
|
||||
mo_kill_node (win, win->current_node);
|
||||
prev->next = NULL;
|
||||
win->current_node = prev;
|
||||
/* Set the text. */
|
||||
mo_reload_window_text (win, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No previous node; this only happens if someone's dumb enough
|
||||
@@ -540,7 +540,7 @@ mo_status mo_delete_group_annotation (mo_window *win, char *url)
|
||||
|
||||
mo_load_window_text (win, home_document, NULL);
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -561,7 +561,7 @@ static XmxCallback (delete_button_cb)
|
||||
{
|
||||
mo_delete_group_annotation (win, win->current_node->url);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ static void do_privacy (mo_window *win)
|
||||
static XmxCallback (pubpri_opts_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
|
||||
|
||||
win->pubpri = XmxExtractToken ((int)client_data);
|
||||
|
||||
#ifdef GRPAN_PASSWD
|
||||
@@ -627,7 +627,7 @@ static XmxCallback (pubpri_opts_cb)
|
||||
If mo_post_annotate_win is told it's supposed to edit,
|
||||
then it installs title, author, text, etc. as it sees fit.
|
||||
|
||||
If, while in edit mode, 'Clear Slate' gets hit,
|
||||
If, while in edit mode, 'Clear Slate' gets hit,
|
||||
mode flips to mo_edit_annotation regardless -- everything's wiped out.
|
||||
*/
|
||||
|
||||
@@ -643,25 +643,25 @@ static void make_annotate_win (mo_window *win)
|
||||
#ifdef GRPAN_PASSWD
|
||||
Widget passwd_frame, passwd_f;
|
||||
#endif
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
XmxSetArg (XmNresizePolicy, XmRESIZE_GROW);
|
||||
win->annotate_win = XmxMakeFormDialog
|
||||
win->annotate_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Annotate Window" );
|
||||
dialog_frame = XmxMakeFrame (win->annotate_win, XmxShadowOut);
|
||||
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
annotate_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
author_label = XmxMakeLabel (annotate_form, "Annotation Author:" );
|
||||
win->annotate_author = XmxMakeTextField (annotate_form);
|
||||
|
||||
|
||||
title_label = XmxMakeLabel (annotate_form, "Annotation Title:" );
|
||||
win->annotate_title = XmxMakeTextField (annotate_form);
|
||||
|
||||
@@ -671,11 +671,11 @@ static void make_annotate_win (mo_window *win)
|
||||
(annotate_form, "", pubpri_opts_cb, pubpri_opts);
|
||||
XmxRSetSensitive (win->pubpri_menu, mo_annotation_public, XmxNotSensitive);
|
||||
if (!get_pref_string(eANNOTATION_SERVER))
|
||||
XmxRSetSensitive (win->pubpri_menu, mo_annotation_workgroup,
|
||||
XmxRSetSensitive (win->pubpri_menu, mo_annotation_workgroup,
|
||||
XmxNotSensitive);
|
||||
win->pubpri = mo_annotation_private;
|
||||
|
||||
#ifdef GRPAN_PASSWD
|
||||
#ifdef GRPAN_PASSWD
|
||||
/* --- Frame for the password fields. --- */
|
||||
XmxSetArg (XmNmarginWidth, 4);
|
||||
XmxSetArg (XmNmarginHeight, 4);
|
||||
@@ -683,17 +683,17 @@ static void make_annotate_win (mo_window *win)
|
||||
passwd_frame = XmxMakeFrame (annotate_form, XmxShadowEtchedOut);
|
||||
passwd_f = XmxMakeForm (passwd_frame);
|
||||
{
|
||||
win->passwd_toggle = XmxMakeToggleButton
|
||||
win->passwd_toggle = XmxMakeToggleButton
|
||||
(passwd_f, "Password Protection" , passwd_toggle_cb, 0);
|
||||
XmxSetToggleButton (win->passwd_toggle, XmxSet);
|
||||
|
||||
|
||||
win->passwd_label = XmxMakeLabel (passwd_f, "Password:" );
|
||||
XmxSetArg (XmNcolumns, 20);
|
||||
win->annotate_passwd = XmxMakeTextField (passwd_f);
|
||||
|
||||
XmxSetOffsets (win->passwd_toggle, 1, 0, 2, 10);
|
||||
XmxSetConstraints
|
||||
(win->passwd_toggle, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(win->passwd_toggle, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_NONE, NULL, NULL, NULL, NULL);
|
||||
XmxSetOffsets (win->passwd_label, 1, 0, 15, 10);
|
||||
XmxSetConstraints
|
||||
@@ -705,14 +705,14 @@ static void make_annotate_win (mo_window *win)
|
||||
XmATTACH_WIDGET, XmATTACH_FORM, NULL, NULL, win->passwd_label, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
logo = XmxMakeNamedLabel (annotate_form, NULL, "logo");
|
||||
XmxApplyBitmapToLabelWidget
|
||||
(logo, annotate_bits, annotate_width, annotate_height);
|
||||
|
||||
|
||||
sep = XmxMakeHorizontalSeparator (annotate_form);
|
||||
|
||||
text_label = XmxMakeLabel
|
||||
|
||||
text_label = XmxMakeLabel
|
||||
(annotate_form, "Enter the annotation text:");
|
||||
|
||||
clear_button = XmxMakePushButton
|
||||
@@ -721,7 +721,7 @@ static void make_annotate_win (mo_window *win)
|
||||
(annotate_form, "Include File..." , include_button_cb, 0);
|
||||
win->delete_button = XmxMakePushButton
|
||||
(annotate_form, "Delete" , delete_button_cb, 0);
|
||||
|
||||
|
||||
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
|
||||
XmxSetArg (XmNscrolledWindowMarginHeight, 8);
|
||||
XmxSetArg (XmNcursorPositionVisible, True);
|
||||
@@ -730,14 +730,14 @@ static void make_annotate_win (mo_window *win)
|
||||
XmxSetArg (XmNrows, 15);
|
||||
XmxSetArg (XmNcolumns, 80);
|
||||
win->annotate_text = XmxMakeScrolledText (annotate_form);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (annotate_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtonsSqueezed
|
||||
(annotate_form, annotate_win_cb, "Save" ,
|
||||
"Dismiss" , "Help..." ,
|
||||
"Dismiss" , "Help..." ,
|
||||
0, 1, 2);
|
||||
|
||||
|
||||
/* Constraints for annotate_form. */
|
||||
/* author_label: top form, bottom nothing,
|
||||
left form, right nothing. */
|
||||
@@ -757,7 +757,7 @@ static void make_annotate_win (mo_window *win)
|
||||
XmxSetOffsets (title_label, 14, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(title_label, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
win->annotate_author, NULL, NULL, NULL);
|
||||
/* annotate_title: top annotate_author, bottom nothing,
|
||||
left title_label, right logo. */
|
||||
@@ -773,7 +773,7 @@ static void make_annotate_win (mo_window *win)
|
||||
#endif
|
||||
XmxSetConstraints
|
||||
(win->pubpri_menu->base, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
win->annotate_title, NULL, NULL, NULL);
|
||||
#ifdef GRPAN_PASSWD
|
||||
/* passwd_frame: top annotate_title, bottom nothing,
|
||||
@@ -793,7 +793,7 @@ static void make_annotate_win (mo_window *win)
|
||||
(sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_FORM, win->pubpri_menu->base, NULL, NULL, NULL);
|
||||
#endif /* not GRPAN_PASSWD */
|
||||
|
||||
|
||||
/* text_label: top sep, bottom nothing,
|
||||
left form, right nothing */
|
||||
XmxSetOffsets (text_label, 12, 0, 10, 10);
|
||||
@@ -801,7 +801,7 @@ static void make_annotate_win (mo_window *win)
|
||||
(text_label, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
sep, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Buttons */
|
||||
XmxSetOffsets (clear_button, 8, 0, 0, 3);
|
||||
XmxSetConstraints
|
||||
@@ -818,27 +818,27 @@ static void make_annotate_win (mo_window *win)
|
||||
(win->delete_button, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_NONE, XmATTACH_FORM,
|
||||
sep, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* logo: top form, bottom nothing,
|
||||
left nothing, right form. */
|
||||
XmxSetOffsets (logo, 5, 10, 10, 5);
|
||||
XmxSetConstraints
|
||||
(logo, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_NONE, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
XmxSetOffsets (XtParent (win->annotate_text), 0, 2, 0, 0);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->annotate_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
(XtParent (win->annotate_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, XmATTACH_FORM,
|
||||
text_label, dialog_sep, NULL, NULL);
|
||||
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
@@ -848,7 +848,7 @@ static void make_annotate_win (mo_window *win)
|
||||
do_privacy (win);
|
||||
#endif
|
||||
win->include_fsb = 0;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -865,8 +865,8 @@ static void make_annotate_win (mo_window *win)
|
||||
* window title should change (to Edit Annotation)
|
||||
* 'Annotate' should change to 'Commit'.
|
||||
Right now this doesn't happen. */
|
||||
mo_status mo_post_annotate_win
|
||||
(mo_window *win, int edit_flag, int id, char *title, char *author,
|
||||
mo_status mo_post_annotate_win
|
||||
(mo_window *win, int edit_flag, int id, char *title, char *author,
|
||||
char *text, char *fname)
|
||||
{
|
||||
if (!win->current_node)
|
||||
@@ -875,7 +875,7 @@ mo_status mo_post_annotate_win
|
||||
/* First thing we do is create the window if it doesn't exist yet. */
|
||||
if (!win->annotate_win)
|
||||
make_annotate_win (win);
|
||||
|
||||
|
||||
/* If we're in edit mode, then do the right thing. */
|
||||
if (edit_flag)
|
||||
{
|
||||
@@ -891,7 +891,7 @@ mo_status mo_post_annotate_win
|
||||
else if (win->current_node->annotation_type == mo_annotation_workgroup)
|
||||
win->pubpri = mo_annotation_workgroup;
|
||||
XmxRSetOptionMenuHistory(win->pubpri_menu, win->pubpri);
|
||||
|
||||
|
||||
XmxTextSetString (win->annotate_author, author);
|
||||
XmxTextSetString (win->annotate_title, title);
|
||||
#ifdef GRPAN_PASSWD
|
||||
@@ -907,7 +907,7 @@ mo_status mo_post_annotate_win
|
||||
|
||||
/* Finally, we manage. */
|
||||
XmxManageRemanage (win->annotate_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
92
src/audan.c
92
src/audan.c
@@ -75,7 +75,7 @@ mo_status mo_audio_capable (void)
|
||||
struct stat buf;
|
||||
int r;
|
||||
|
||||
r = stat (filename, &buf);
|
||||
r = stat (filename, &buf);
|
||||
if (r != -1 && buf.st_mode & S_IXOTH)
|
||||
return mo_succeed;
|
||||
else
|
||||
@@ -96,8 +96,8 @@ static XmxCallback (start_cb)
|
||||
if ((win->record_pid = fork ()) < 0)
|
||||
{
|
||||
/* Uh oh, no process. */
|
||||
XmxMakeErrorDialog (win->audio_annotate_win,
|
||||
"Unable to start audio recording process." ,
|
||||
XmxMakeErrorDialog (win->audio_annotate_win,
|
||||
"Unable to start audio recording process." ,
|
||||
"Audio Annotation Error" );
|
||||
XtManageChild (Xmx_w);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ static XmxCallback (stop_cb)
|
||||
/* Stop the record process. This works for both SGI recordaiff
|
||||
and Sun record, apparently. */
|
||||
kill (win->record_pid, SIGINT);
|
||||
|
||||
|
||||
/* Wait until the process is dead. */
|
||||
waitpid (win->record_pid, NULL, 0);
|
||||
|
||||
@@ -151,7 +151,7 @@ static XmxCallback (buttons_cb)
|
||||
{
|
||||
/* Stop the record process. */
|
||||
kill (win->record_pid, SIGINT);
|
||||
|
||||
|
||||
/* Wait until the process is dead. */
|
||||
waitpid (win->record_pid, NULL, 0);
|
||||
}
|
||||
@@ -164,7 +164,7 @@ static XmxCallback (buttons_cb)
|
||||
FILE *fp;
|
||||
int len;
|
||||
extern char *machine;
|
||||
|
||||
|
||||
sprintf (namestr, "%s <%s>",
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME),
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
@@ -172,7 +172,7 @@ static XmxCallback (buttons_cb)
|
||||
sprintf (titlestr, "%s %s",
|
||||
"Audio Annotation by" ,
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME));
|
||||
|
||||
|
||||
len = 0;
|
||||
fp = fopen(win->record_fnam, "r");
|
||||
if (fp != NULL)
|
||||
@@ -195,41 +195,41 @@ static XmxCallback (buttons_cb)
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
if (len <= 0)
|
||||
{
|
||||
XmxMakeErrorDialog
|
||||
(win->base, "Unable to complete audio annotation." ,
|
||||
XmxMakeErrorDialog
|
||||
(win->base, "Unable to complete audio annotation." ,
|
||||
"Audio Annotation Error" );
|
||||
XtManageChild (Xmx_w);
|
||||
}
|
||||
|
||||
|
||||
mo_audio_grpan(win->current_node->url, titlestr, namestr,
|
||||
(char *)data, len);
|
||||
if (data)
|
||||
free((char *)data);
|
||||
|
||||
|
||||
mo_set_win_current_node (win, win->current_node);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Do the right thing. */
|
||||
int pan_id = mo_next_pan_id ();
|
||||
char *default_directory =
|
||||
char *default_directory =
|
||||
get_pref_string(ePRIVATE_ANNOTATION_DIRECTORY);
|
||||
char filename[500], *cmd, namestr[200], textstr[500], titlestr[200];
|
||||
extern char *machine;
|
||||
|
||||
|
||||
#ifdef __sgi
|
||||
sprintf (filename, "%s/%s/%s%d.aiff", getenv ("HOME"),
|
||||
sprintf (filename, "%s/%s/%s%d.aiff", getenv ("HOME"),
|
||||
default_directory,
|
||||
"PAN-", pan_id);
|
||||
#else /* sun or hp */
|
||||
sprintf (filename, "%s/%s/%s%d.au", getenv ("HOME"),
|
||||
sprintf (filename, "%s/%s/%s%d.au", getenv ("HOME"),
|
||||
default_directory,
|
||||
"PAN-", pan_id);
|
||||
#endif
|
||||
|
||||
|
||||
/*SWP -- New "mv" fucntion to take care of these /bin/mv things*/
|
||||
{
|
||||
char retBuf[BUFSIZ];
|
||||
@@ -248,19 +248,19 @@ static XmxCallback (buttons_cb)
|
||||
sprintf (namestr, "%s <%s>",
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME),
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
sprintf (textstr,
|
||||
sprintf (textstr,
|
||||
"This is an audio annotation. <P>\n\nTo hear the annotation, click <A HREF=\"file:%s\">here</A>. <P>\n" , filename);
|
||||
|
||||
mo_new_pan (win->current_node->url, titlestr, namestr,
|
||||
textstr);
|
||||
|
||||
|
||||
/* Inefficient, but safe. */
|
||||
mo_write_pan_list ();
|
||||
|
||||
|
||||
mo_set_win_current_node (win, win->current_node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
win->record_pid = 0;
|
||||
win->record_fnam = 0;
|
||||
|
||||
@@ -271,10 +271,10 @@ static XmxCallback (buttons_cb)
|
||||
{
|
||||
/* Stop the record process. */
|
||||
kill (win->record_pid, SIGINT);
|
||||
|
||||
|
||||
/* Wait until the process is dead. */
|
||||
waitpid (win->record_pid, NULL, 0);
|
||||
|
||||
|
||||
win->record_pid = 0;
|
||||
win->record_fnam = 0;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ static XmxCallback (buttons_cb)
|
||||
NULL, NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -298,7 +298,7 @@ extern XmxOptionMenuStruct *pubpri_opts;
|
||||
static XmxCallback (pubpri_opts_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
|
||||
|
||||
win->audio_pubpri = XmxExtractToken ((int)client_data);
|
||||
|
||||
return;
|
||||
@@ -318,22 +318,22 @@ mo_status mo_post_audio_annotate_win (mo_window *win)
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
XmxSetArg (XmNresizePolicy, XmRESIZE_GROW);
|
||||
win->audio_annotate_win = XmxMakeFormDialog
|
||||
win->audio_annotate_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Audio Annotate Window" );
|
||||
dialog_frame = XmxMakeFrame (win->audio_annotate_win, XmxShadowOut);
|
||||
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
XmxSetArg (XmNfractionBase, 2);
|
||||
audio_annotate_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
yap_label = XmxMakeLabel
|
||||
|
||||
yap_label = XmxMakeLabel
|
||||
(audio_annotate_form, "Press Start to start recording; Stop to stop recording.\nRepeat until you're satisfied with the annotation.\nThen either Save or Dismiss the annotation." );
|
||||
|
||||
|
||||
win->audio_start_button = XmxMakePushButton (audio_annotate_form,
|
||||
"Start" ,
|
||||
start_cb,
|
||||
@@ -345,34 +345,34 @@ mo_status mo_post_audio_annotate_win (mo_window *win)
|
||||
|
||||
win->audio_pubpri_menu = XmxRMakeOptionMenu
|
||||
(audio_annotate_form, "", pubpri_opts_cb, pubpri_opts);
|
||||
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_public,
|
||||
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_public,
|
||||
XmxNotSensitive);
|
||||
|
||||
if (! get_pref_string(eANNOTATION_SERVER))
|
||||
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_workgroup,
|
||||
XmxRSetSensitive (win->audio_pubpri_menu, mo_annotation_workgroup,
|
||||
XmxNotSensitive);
|
||||
|
||||
win->audio_pubpri = mo_annotation_private;
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (audio_annotate_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtons
|
||||
(audio_annotate_form, buttons_cb, "Save" ,
|
||||
"Dismiss" , "Help..." ,
|
||||
"Dismiss" , "Help..." ,
|
||||
0, 1, 2);
|
||||
|
||||
|
||||
/* Constraints for audio_annotate_form. */
|
||||
XmxSetOffsets (yap_label, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(yap_label, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxSetOffsets (win->audio_start_button, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(win->audio_start_button, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE,
|
||||
yap_label, NULL, NULL, NULL);
|
||||
XmxSetOffsets (win->audio_stop_button, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(win->audio_stop_button, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
yap_label, NULL, win->audio_start_button, NULL);
|
||||
@@ -381,14 +381,14 @@ mo_status mo_post_audio_annotate_win (mo_window *win)
|
||||
(win->audio_pubpri_menu->base, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
yap_label, NULL, win->audio_stop_button, NULL);
|
||||
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
win->audio_pubpri_menu->base, NULL, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
dialog_sep, NULL, NULL, NULL);
|
||||
}
|
||||
@@ -396,7 +396,7 @@ mo_status mo_post_audio_annotate_win (mo_window *win)
|
||||
XmxManageRemanage (win->audio_annotate_win);
|
||||
XmxSetSensitive (win->audio_stop_button, XmxNotSensitive);
|
||||
XmxSetSensitive (win->audio_start_button, XmxSensitive);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
20
src/bla.c
20
src/bla.c
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/* CCI redirect object
|
||||
/* CCI redirect object
|
||||
** =================
|
||||
*/
|
||||
|
||||
@@ -84,8 +84,8 @@ struct _HTStream {
|
||||
|
||||
HTAtom *dataType;
|
||||
char fileName[L_tmpnam]; /* name of temp file... kept for unlink()ing*/
|
||||
FILE *fp;
|
||||
|
||||
FILE *fp;
|
||||
|
||||
int compressed;
|
||||
};
|
||||
|
||||
@@ -143,8 +143,8 @@ PRIVATE void CCI_free ARGS1(HTStream *, me)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cciTrace)
|
||||
fprintf
|
||||
(stderr,
|
||||
fprintf
|
||||
(stderr,
|
||||
"[CCI_free] OK, we're going to decompress HText\n");
|
||||
#endif
|
||||
HTCompressedHText (me->text, me->compressed, 1);
|
||||
@@ -163,7 +163,7 @@ PRIVATE void CCI_end_document ARGS1(HTStream *, me)
|
||||
fclose(me->fp);
|
||||
/* ship it */
|
||||
if ( me->compressed != COMPRESSED_NOT)
|
||||
HTCompressedFileToFile (me->fileName, me->compressed);
|
||||
HTCompressedFileToFile (me->fileName, me->compressed);
|
||||
MoCCISendOutputToClient(HTAtom_name(me->dataType),me->fileName);
|
||||
/*
|
||||
unlink(me->fileName);
|
||||
@@ -182,13 +182,13 @@ PRIVATE void CCI_handle_interrupt ARGS1(HTStream *, me)
|
||||
** -----------------------
|
||||
*/
|
||||
PUBLIC WWW_CONST HTStreamClass CCIout =
|
||||
{
|
||||
{
|
||||
"CCIout",
|
||||
CCI_free,
|
||||
CCI_end_document,
|
||||
CCI_put_character, CCI_put_string, CCI_write,
|
||||
CCI_handle_interrupt
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/* New object
|
||||
@@ -196,14 +196,14 @@ PUBLIC WWW_CONST HTStreamClass CCIout =
|
||||
*/
|
||||
PUBLIC HTStream* CCIPresent ARGS5(
|
||||
HTPresentation *, pres,
|
||||
HTParentAnchor *, anchor,
|
||||
HTParentAnchor *, anchor,
|
||||
HTStream *, sink,
|
||||
HTFormat, format_in,
|
||||
int, compressed)
|
||||
{
|
||||
HTStream* me = (HTStream*)malloc(sizeof(HTStream));
|
||||
|
||||
me->isa = &CCIout;
|
||||
me->isa = &CCIout;
|
||||
|
||||
(void) tmpnam(me->fileName);
|
||||
if (!(me->fp = fopen(me->fileName,"w"))) {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
46
src/cci.h
46
src/cci.h
@@ -91,7 +91,7 @@
|
||||
#define MCCI_S_QUIT "QUIT"
|
||||
#define MCCI_S_SEND "SEND"
|
||||
#define MCCI_S_OUTPUT "OUTPUT"
|
||||
#define MCCI_S_ANCHOR "ANCHOR"
|
||||
#define MCCI_S_ANCHOR "ANCHOR"
|
||||
#define MCCI_S_BEFORE "BEFORE"
|
||||
#define MCCI_S_AFTER "AFTER"
|
||||
#define MCCI_S_HANDLER "HANDLER" /* ADC ZZZ */
|
||||
@@ -147,7 +147,7 @@
|
||||
#define MCCI_PLAINTEXT "PLAINTEXT"
|
||||
#define MCCI_FORMATTEDTEXT "FORMATTEDTEXT"
|
||||
#define MCCI_POSTSCRIPT "POSTSCRIPT"
|
||||
#define MCCI_HTML "HTML"
|
||||
#define MCCI_HTML "HTML"
|
||||
|
||||
#define MCCI_BACK "BACK"
|
||||
#define MCCI_FORWARD "FORWARD"
|
||||
@@ -211,19 +211,19 @@
|
||||
#define MCCIR_SEND_ANCH_BEF_HIST_OK 286 /* from history */
|
||||
#define MCCIR_SEND_ANCH_BEF_HOTL_OK 287 /* from hotlist */
|
||||
#define MCCIR_SEND_ANCH_BEF_MCCI_OK 288 /* from CCI */
|
||||
#define MCCIR_SEND_ANCH_BEF_OTHR_OK 289 /* from other source */
|
||||
#define MCCIR_SEND_ANCH_BEF_OTHR_OK 289 /* from other source */
|
||||
|
||||
/* sendAnchor After return codes */
|
||||
#define MCCIR_SEND_ANCH_AFT_LINK_OK 290 /* clicked link */
|
||||
#define MCCIR_SEND_ANCH_AFT_OPEN_OK 291 /* used open dialog */
|
||||
#define MCCIR_SEND_ANCH_AFT_EDIT_OK 292 /* edited URL field */
|
||||
#define MCCIR_SEND_ANCH_AFT_FORW_OK 293 /* clicked forward */
|
||||
#define MCCIR_SEND_ANCH_AFT_BACK_OK 294 /* clicked back */
|
||||
#define MCCIR_SEND_ANCH_AFT_RELO_OK 295 /* clicked reload */
|
||||
#define MCCIR_SEND_ANCH_AFT_HIST_OK 296 /* from history */
|
||||
#define MCCIR_SEND_ANCH_AFT_HOTL_OK 297 /* from hotlist */
|
||||
#define MCCIR_SEND_ANCH_AFT_MCCI_OK 298 /* from CCI */
|
||||
#define MCCIR_SEND_ANCH_AFT_OTHR_OK 299 /* from other source */
|
||||
#define MCCIR_SEND_ANCH_AFT_LINK_OK 290 /* clicked link */
|
||||
#define MCCIR_SEND_ANCH_AFT_OPEN_OK 291 /* used open dialog */
|
||||
#define MCCIR_SEND_ANCH_AFT_EDIT_OK 292 /* edited URL field */
|
||||
#define MCCIR_SEND_ANCH_AFT_FORW_OK 293 /* clicked forward */
|
||||
#define MCCIR_SEND_ANCH_AFT_BACK_OK 294 /* clicked back */
|
||||
#define MCCIR_SEND_ANCH_AFT_RELO_OK 295 /* clicked reload */
|
||||
#define MCCIR_SEND_ANCH_AFT_HIST_OK 296 /* from history */
|
||||
#define MCCIR_SEND_ANCH_AFT_HOTL_OK 297 /* from hotlist */
|
||||
#define MCCIR_SEND_ANCH_AFT_MCCI_OK 298 /* from CCI */
|
||||
#define MCCIR_SEND_ANCH_AFT_OTHR_OK 299 /* from other source */
|
||||
|
||||
/* ADC ZZZ */
|
||||
#define MCCIR_SEND_ANCH_HAN_OTHR_OK 270 /* ADC ZZZ */
|
||||
@@ -255,21 +255,21 @@
|
||||
typedef enum{
|
||||
|
||||
/* selected from menu */
|
||||
MOSAIC_NEW, MOSAIC_CLONE, MOSAIC_OPEN_URL, FILE_OPEN_LOCAL,
|
||||
MOSAIC_NEW, MOSAIC_CLONE, MOSAIC_OPEN_URL, FILE_OPEN_LOCAL,
|
||||
MOSAIC_RELOAD_CURRENT,
|
||||
/*5*/ FILE_RELOAD_IMAGES, FILE_REFRESH_CURRENT, FILE_FIND_IN_CURRENT,
|
||||
/*8*/ FILE_VIEW_SOURCE, FILE_EDIT_SOURCE, FILE_SOURCE_DATE, MOSAIC_SAVE_AS,
|
||||
/*12*/ FILE_PRINT, FILE_MAIL_TO, FILE_CCI, MOSAIC_CLOSE, FILE_EXIT_PROGRAM,
|
||||
|
||||
/*17*/
|
||||
OPTIONS_FANCY_SELECTIONS_ON, OPTIONS_FANCY_SELECTIONS_OFF,
|
||||
OPTIONS_FANCY_SELECTIONS_ON, OPTIONS_FANCY_SELECTIONS_OFF,
|
||||
OPTIONS_LOAD_TO_LOCAL_DISK_ON, OPTIONS_LOAD_TO_LOCAL_DISK_OFF,
|
||||
OPTIONS_DELAY_IMAGE_LOADING_ON, OPTIONS_DELAY_IMAGE_LOADING_OFF,
|
||||
OPTIONS_LOAD_IMAGES_IN_CURRENT, OPTIONS_RELOAD_CONFIG_FILES,
|
||||
OPTIONS_FLUSH_IMAGE_CACHE, OPTIONS_CLEAR_GLOBAL_HISTORY,
|
||||
OPTIONS_LOAD_IMAGES_IN_CURRENT, OPTIONS_RELOAD_CONFIG_FILES,
|
||||
OPTIONS_FLUSH_IMAGE_CACHE, OPTIONS_CLEAR_GLOBAL_HISTORY,
|
||||
/*27*/
|
||||
OPTIONS_FONTS_TR, OPTIONS_FONTS_TS, OPTIONS_FONTS_TL,
|
||||
OPTIONS_FONTS_HR, OPTIONS_FONTS_HS, OPTIONS_FONTS_HL,
|
||||
OPTIONS_FONTS_HR, OPTIONS_FONTS_HS, OPTIONS_FONTS_HL,
|
||||
OPTIONS_FONTS_NCR, OPTIONS_FONTS_NCS, OPTIONS_FONTS_NCL,
|
||||
OPTIONS_FONTS_LBR, OPTIONS_FONTS_LBS, OPTIONS_FONTS_LBL,
|
||||
/*39*/
|
||||
@@ -277,12 +277,12 @@ typedef enum{
|
||||
OPTIONS_ANCHOR_UNDERLINES_MU, OPTIONS_ANCHOR_UNDERLINES_HU,
|
||||
OPTIONS_ANCHOR_UNDERLINES_NU,
|
||||
/*44*/
|
||||
MOSAIC_BACK, MOSAIC_FORWARD, MOSAIC_HOME_DOCUMENT,
|
||||
NAVIGATE_WINDOW_HISTORY, NAVIGATE_HOTLIST,
|
||||
NAVIGATE_ADD_CURRENT_TO_HOTLIST, NAVIGATE_INTERNET_STARTING_POINTS,
|
||||
MOSAIC_BACK, MOSAIC_FORWARD, MOSAIC_HOME_DOCUMENT,
|
||||
NAVIGATE_WINDOW_HISTORY, NAVIGATE_HOTLIST,
|
||||
NAVIGATE_ADD_CURRENT_TO_HOTLIST, NAVIGATE_INTERNET_STARTING_POINTS,
|
||||
NAVIGATE_INTERNET_RESOURCES_META_INDEX,
|
||||
/*52*/
|
||||
ANNOTATE_ANNOTATE, ANNOTATE_AUDIO_ANNOTATE, ANNOTATE_EDIT_THIS_ANNOTATION,
|
||||
ANNOTATE_ANNOTATE, ANNOTATE_AUDIO_ANNOTATE, ANNOTATE_EDIT_THIS_ANNOTATION,
|
||||
ANNOTATE_DELETE_THIS_ANNOTATION,
|
||||
/*56*/
|
||||
NEWS_NEXT, NEWS_PREV, NEWS_NEXT_THREAD, NEWS_PREV_THREAD, NEWS_INDEX,
|
||||
@@ -316,7 +316,7 @@ typedef enum{
|
||||
/* Events for FTP transfer/commands. */
|
||||
FTP_PUT, FTP_REMOVE, FTP_MKDIR ,
|
||||
|
||||
OPTIONS_FLUSH_PASSWD_CACHE
|
||||
OPTIONS_FLUSH_PASSWD_CACHE
|
||||
|
||||
}CCI_events;
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
if (!strcmp(command, MCCI_BACK))
|
||||
mo_back_node(win);
|
||||
else if (!strcmp(command, MCCI_FORWARD))
|
||||
mo_forward_node(win);
|
||||
mo_forward_node(win);
|
||||
else if (!strcmp(command, MCCI_HOME))
|
||||
mo_access_document (win, home_document);
|
||||
else if (!strcmp(command, MCCI_RELOAD))
|
||||
@@ -229,7 +229,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
status = mo_save_window(win, filename, 0);
|
||||
else if (!strcmp(format, MCCI_FORMATTEDTEXT))
|
||||
status = mo_save_window(win, filename, 1);
|
||||
else if (!strcmp(format, MCCI_HTML))
|
||||
else if (!strcmp(format, MCCI_HTML))
|
||||
status = mo_save_window(win, filename, 2);
|
||||
else if (!strcmp(format, MCCI_POSTSCRIPT))
|
||||
status = mo_save_window(win, filename, 4);
|
||||
@@ -254,7 +254,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
|
||||
else if (!strcmp(command, MCCI_FINDINCURRENT)){
|
||||
/* need to get search_string and CASE|NOCASE */
|
||||
char *s_string, *c;
|
||||
char *s_string, *c;
|
||||
mo_status found;
|
||||
|
||||
/* s is pointed pass the window id part */
|
||||
@@ -270,7 +270,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
if (tmp_end) *tmp_end = '\0';
|
||||
|
||||
GetWordFromString(s,&c,&end); /* Get command */
|
||||
if ((!c) || (c == end) ){
|
||||
if ((!c) || (c == end) ){
|
||||
*retCode = MCCIR_DOCOMMAND_FAILED;
|
||||
strcpy(retText, "You Need to Specify CASE");
|
||||
if (s_string) free(s_string);
|
||||
@@ -334,7 +334,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
status = mo_print_window(win, 0, printCommand);
|
||||
else if (!strcmp(format, MCCI_FORMATTEDTEXT))
|
||||
status = mo_print_window(win, 1, printCommand);
|
||||
else if (!strcmp(format, MCCI_HTML))
|
||||
else if (!strcmp(format, MCCI_HTML))
|
||||
status = mo_print_window(win, 2, printCommand);
|
||||
else if (!strcmp(format, MCCI_POSTSCRIPT))
|
||||
status = mo_print_window(win, 4, printCommand);
|
||||
@@ -443,7 +443,7 @@ char *s, *end, *tmp_end, *w_id;
|
||||
XmxSetArg (WbNdelayImageLoads, True);
|
||||
XmxSetValues (win->scrolled_win);
|
||||
*/
|
||||
XmxRSetSensitive (win->menubar, mo_expand_images_current,
|
||||
XmxRSetSensitive (win->menubar, mo_expand_images_current,
|
||||
win->delay_image_loads?XmxSensitive:XmxNotSensitive);
|
||||
}
|
||||
else if (!strcmp(on_off, MCCI_OFF)){
|
||||
@@ -454,9 +454,9 @@ char *s, *end, *tmp_end, *w_id;
|
||||
XmxSetArg (WbNdelayImageLoads, False);
|
||||
XmxSetValues (win->scrolled_win);
|
||||
*/
|
||||
XmxRSetSensitive (win->menubar, mo_expand_images_current,
|
||||
XmxRSetSensitive (win->menubar, mo_expand_images_current,
|
||||
win->delay_image_loads?XmxSensitive:XmxNotSensitive);
|
||||
}
|
||||
}
|
||||
else{
|
||||
*retCode = MCCIR_DOCOMMAND_FAILED;
|
||||
strcpy(retText, "You Need to Specify ON|OFF");
|
||||
@@ -592,7 +592,7 @@ mo_status moStatus;
|
||||
switch (output) {
|
||||
case MCCI_OUTPUT_CURRENT:
|
||||
/* turn flag on so mosaic will know to do a get*/
|
||||
cci_get = 1;
|
||||
cci_get = 1;
|
||||
|
||||
moStatus = mo_load_window_text (current_win, url, NULL);
|
||||
if (moStatus == mo_succeed) {
|
||||
@@ -608,7 +608,7 @@ mo_status moStatus;
|
||||
cci_get = 0; /* done with get, turn flag off */
|
||||
case MCCI_OUTPUT_NEW:
|
||||
/* turn flag on so mosaic will know to do a get*/
|
||||
cci_get = 1;
|
||||
cci_get = 1;
|
||||
|
||||
if (!mo_open_another_window(current_win,url,NULL,NULL)) {
|
||||
*retCode = MCCIR_GET_FAILED;
|
||||
@@ -804,7 +804,7 @@ int length;
|
||||
case MCCI_OUTPUT_NONE:
|
||||
/* do not display output of post, but send the
|
||||
output back through the cci to the client */
|
||||
response = mo_post_pull_er_over(url,
|
||||
response = mo_post_pull_er_over(url,
|
||||
contentType, postData, &textHead);
|
||||
|
||||
/* send response back through cci */
|
||||
@@ -825,7 +825,7 @@ int length;
|
||||
*retCode = MCCI_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case MCCI_OUTPUT_NEW:
|
||||
/* open a new window and display posting... */
|
||||
@@ -835,12 +835,12 @@ int length;
|
||||
case MCCI_OUTPUT_CURRENT:
|
||||
default:
|
||||
/* display in current window */
|
||||
response = mo_post_pull_er_over(url,
|
||||
response = mo_post_pull_er_over(url,
|
||||
contentType, postData, &textHead);
|
||||
/*mo_decode_internal_reference(url,response,url);*/
|
||||
mo_do_window_text(current_win,url,
|
||||
response,response,1,url,0,0);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -898,10 +898,10 @@ char *new_url;
|
||||
ref = strdup(url);
|
||||
new_url = strdup(url);
|
||||
if (strcmp(contentType, "text/html") == 0)
|
||||
mo_do_window_text(current_win, new_url,
|
||||
mo_do_window_text(current_win, new_url,
|
||||
displayData, displayData, 1, ref, current_win->current_node->last_modified, current_win->current_node->expires);
|
||||
else
|
||||
strcpy(retText, "Display text/html only");
|
||||
strcpy(retText, "Display text/html only");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -927,8 +927,8 @@ char *url;
|
||||
int type;
|
||||
{
|
||||
*retDataLength = 0;
|
||||
|
||||
if ((type == MCCI_PRIVATE_ANNOTATION) ||
|
||||
|
||||
if ((type == MCCI_PRIVATE_ANNOTATION) ||
|
||||
(type == MCCI_ALL_ANNOTATION)) {
|
||||
if ((*retData) = mo_fetch_personal_annotations(url)) {
|
||||
*retCode = MCCIR_PRIVATE_ANNOTATION;
|
||||
@@ -945,7 +945,7 @@ int type;
|
||||
*retCode = MCCIR_NO_ANNOTATION;
|
||||
strcpy(retText,"Only Private annotations currently supported");
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -977,7 +977,7 @@ char *url;
|
||||
}
|
||||
else {
|
||||
strcpy(retText,"No URL for given file name");
|
||||
*retCode = MCCIR_NO_URL_FOR_FILE;
|
||||
*retCode = MCCIR_NO_URL_FOR_FILE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
#include "HTFormat.h"
|
||||
|
||||
static Boolean cciAccepting = 0;
|
||||
static Boolean cciAccepting = 0;
|
||||
static int listenPortNumber=0;
|
||||
static XtInputId connectInputID;
|
||||
static List listOfConnections;
|
||||
@@ -80,7 +80,7 @@ static List listOfForm; /* list of form submitted by application */
|
||||
/* ADC ugly hack below ZZZZZ */
|
||||
extern int CCIprotocol_handler_found;
|
||||
extern int MCCIanchorcached;
|
||||
|
||||
|
||||
extern XtAppContext app_context;
|
||||
/***/ extern HTStream* CCIPresent();
|
||||
extern char *machine_with_domain; /* host name */
|
||||
@@ -110,7 +110,7 @@ struct FormSubmit{
|
||||
MCCIPort client;
|
||||
char *actionID;
|
||||
int valid;
|
||||
};
|
||||
};
|
||||
|
||||
cciStat *cciStatListFindEntry(MCCIPort findMe)
|
||||
{
|
||||
@@ -128,12 +128,12 @@ cciStat *cciStatListFindEntry(MCCIPort findMe)
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
|
||||
|
||||
cciStat *cciStatListDeleteEntry(MCCIPort deleteMe)
|
||||
{
|
||||
cciStat *current;
|
||||
|
||||
|
||||
if (current = cciStatListFindEntry(deleteMe))
|
||||
{
|
||||
ListDeleteEntry(listOfSendAnchorTo,current);
|
||||
@@ -146,18 +146,18 @@ cciStat *cciStatListDeleteEntry(MCCIPort deleteMe)
|
||||
void cciStatPreventSendAnchor(MCCIPort client, char *url)
|
||||
{
|
||||
/* this sets the flag that is checked for in cciSafeToSend, but
|
||||
* only if sendAnchor is on for this client.
|
||||
* only if sendAnchor is on for this client.
|
||||
*/
|
||||
|
||||
|
||||
cciStat *current;
|
||||
|
||||
if ((current = cciStatListFindEntry(client)) && (url != NULL))
|
||||
current->url = strdup(url);
|
||||
}
|
||||
|
||||
|
||||
int cciSafeToSend(cciStat *current, char *url)
|
||||
{
|
||||
/* ensures that Mosaic does not send an ANCHOR in response to a GET
|
||||
/* ensures that Mosaic does not send an ANCHOR in response to a GET
|
||||
* if SEND ANCHOR is turned on.
|
||||
*
|
||||
* INPUTS:
|
||||
@@ -167,7 +167,7 @@ int cciSafeToSend(cciStat *current, char *url)
|
||||
* 1 if flag is not set for (client,url) pair
|
||||
* (safe to send)
|
||||
*/
|
||||
|
||||
|
||||
int rc = 1;
|
||||
|
||||
if (current->url != NULL)
|
||||
@@ -177,7 +177,7 @@ int cciSafeToSend(cciStat *current, char *url)
|
||||
current->url = NULL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
void cciStatFree(cciStat *i)
|
||||
{
|
||||
@@ -197,7 +197,7 @@ cciStat *cciStatNew(MCCIPort client, int status)
|
||||
}
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
void MoCCISendAnchor(client,sendIt)
|
||||
/* set the state of sending anchors */
|
||||
MCCIPort client;
|
||||
@@ -255,9 +255,9 @@ int beforeAfter;
|
||||
***************************************************************/
|
||||
{
|
||||
cciStat *client;
|
||||
|
||||
|
||||
client = (cciStat *) ListHead(listOfSendAnchorTo);
|
||||
while(client)
|
||||
while(client)
|
||||
{
|
||||
if (cciSafeToSend(client, url)) /* test flag */
|
||||
switch (beforeAfter)
|
||||
@@ -382,7 +382,7 @@ int registered = 0;
|
||||
sendForm = (struct FormSubmit *)
|
||||
ListCurrent(listOfForm);
|
||||
#if 0
|
||||
sendForm->valid = 0;
|
||||
sendForm->valid = 0;
|
||||
#endif
|
||||
}
|
||||
else{
|
||||
@@ -457,19 +457,19 @@ int retVal;
|
||||
/* Write port number to .mosaiccciport */
|
||||
char *home = getenv ("HOME"), *fnam;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
if (!home)
|
||||
home = "/tmp";
|
||||
|
||||
|
||||
fnam = (char *)malloc (strlen (home) + 32);
|
||||
sprintf (fnam, "%s/.mosaic/cciport", home); // SAM
|
||||
|
||||
|
||||
fp = fopen (fnam, "w");
|
||||
if (fp) {
|
||||
fprintf(fp,"%s:%d\n",machine_with_domain,portNumber);
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
|
||||
free (fnam);
|
||||
}
|
||||
return(retVal);
|
||||
@@ -496,7 +496,7 @@ struct SendWhatToWhom *sendOutput;
|
||||
ListDeleteEntry(listOfSendOutput,sendOutput);
|
||||
FREE(sendOutput->contentType);
|
||||
FREE(sendOutput);
|
||||
|
||||
|
||||
sendOutput = (struct SendWhatToWhom *)
|
||||
ListCurrent(listOfSendOutput);
|
||||
}
|
||||
@@ -534,7 +534,7 @@ struct SendWhatToWhom *sendOutput;
|
||||
sendOutput = (struct SendWhatToWhom *)
|
||||
ListNext(listOfSendOutput);
|
||||
}
|
||||
|
||||
|
||||
ListDeleteEntry(listOfConnections,con);
|
||||
con = (struct Connection *)
|
||||
ListCurrent(listOfConnections);
|
||||
@@ -555,9 +555,9 @@ int source;
|
||||
}
|
||||
|
||||
void MoCCINewConnection(app_context,source,inputID)
|
||||
XtAppContext app_context;
|
||||
XtAppContext app_context;
|
||||
int *source;
|
||||
XtInputId *inputID;
|
||||
XtInputId *inputID;
|
||||
{
|
||||
MCCIPort client;
|
||||
struct Connection *con;
|
||||
@@ -580,8 +580,8 @@ struct Connection *con;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
this determines wether there is one or many cci clients connecting
|
||||
/*
|
||||
this determines wether there is one or many cci clients connecting
|
||||
XtRemoveInput(*inputID);
|
||||
*/
|
||||
|
||||
@@ -616,9 +616,9 @@ char buff[256];
|
||||
if (cciAccepting != XmToggleButtonGetState
|
||||
(win->cci_accept_toggle)) {
|
||||
/* reset toggle state */
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
cciAccepting);
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
!cciAccepting);
|
||||
}
|
||||
XtUnmanageChild(win->cci_win);
|
||||
@@ -646,9 +646,9 @@ char buff[256];
|
||||
XtManageChild (Xmx_w);
|
||||
cciAccepting = False;
|
||||
listenPortNumber = 0;
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
cciAccepting);
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
!cciAccepting);
|
||||
return;
|
||||
}
|
||||
@@ -667,9 +667,9 @@ char buff[256];
|
||||
else {
|
||||
cciAccepting = False;
|
||||
listenPortNumber = 0;
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
XmxSetToggleButton(win->cci_accept_toggle,
|
||||
cciAccepting);
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
XmxSetToggleButton(win->cci_off_toggle,
|
||||
!cciAccepting);
|
||||
/* Can't accept on this port...*/
|
||||
XmxMakeErrorDialog (win->cci_win,
|
||||
@@ -704,7 +704,7 @@ Widget buttonBox;
|
||||
|
||||
if (!win->cci_win) {
|
||||
XmxSetUniqid (win->id);
|
||||
win->cci_win = XmxMakeFormDialog(win->base,
|
||||
win->cci_win = XmxMakeFormDialog(win->base,
|
||||
"NCSA Mosaic: Common Client Interface" );
|
||||
dialogFrame = XmxMakeFrame(win->cci_win, XmxShadowOut);
|
||||
XmxSetConstraints
|
||||
@@ -716,7 +716,7 @@ Widget buttonBox;
|
||||
label = XmxMakeLabel(cciForm, "CCI Port Address: " );
|
||||
XmxSetArg(XmNcolumns, 25);
|
||||
win->cci_win_text= XmxMakeText (cciForm);
|
||||
XmxAddCallbackToText (win->cci_win_text,
|
||||
XmxAddCallbackToText (win->cci_win_text,
|
||||
MoCCIWindowCallBack, 0);
|
||||
|
||||
toggleBox = XmxMakeRadioBox(cciForm);
|
||||
@@ -738,25 +738,25 @@ Widget buttonBox;
|
||||
|
||||
XmxSetOffsets (label, 13, 0, 10, 0);
|
||||
XmxSetConstraints
|
||||
(label, XmATTACH_FORM, XmATTACH_NONE,
|
||||
(label, XmATTACH_FORM, XmATTACH_NONE,
|
||||
XmATTACH_FORM, XmATTACH_NONE, NULL, NULL, NULL, NULL);
|
||||
|
||||
XmxSetOffsets (win->cci_win_text, 10, 0, 5, 8);
|
||||
XmxSetConstraints
|
||||
(win->cci_win_text, XmATTACH_FORM, XmATTACH_NONE,
|
||||
(win->cci_win_text, XmATTACH_FORM, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, NULL, NULL, label, NULL);
|
||||
|
||||
XmxSetConstraints (toggleBox, XmATTACH_WIDGET,
|
||||
XmxSetConstraints (toggleBox, XmATTACH_WIDGET,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
win->cci_win_text, NULL, label, NULL);
|
||||
XmxSetOffsets (toggleBox, 8, 0, 2, 0);
|
||||
|
||||
XmxSetConstraints (dialogSeparator, XmATTACH_WIDGET,
|
||||
XmxSetConstraints (dialogSeparator, XmATTACH_WIDGET,
|
||||
XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
toggleBox, NULL, NULL, NULL);
|
||||
|
||||
XmxSetConstraints (buttonBox, XmATTACH_WIDGET,
|
||||
XmxSetConstraints (buttonBox, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
|
||||
dialogSeparator, NULL, NULL, NULL);
|
||||
}
|
||||
@@ -803,7 +803,7 @@ struct SendWhatToWhom *sendOutput;
|
||||
}
|
||||
sendOutput=(struct SendWhatToWhom *)ListNext(listOfSendOutput);
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -832,13 +832,13 @@ int found = 0;
|
||||
if (send){
|
||||
send = 0;
|
||||
sendForm=(struct FormSubmit *) ListHead(listOfForm);
|
||||
while(sendForm)
|
||||
while(sendForm)
|
||||
{
|
||||
if ( !strcmp(actionID, sendForm->actionID))
|
||||
/* found correct client */
|
||||
{
|
||||
if (sendForm->valid)
|
||||
MCCIFormQueryToClient(sendForm->client,
|
||||
MCCIFormQueryToClient(sendForm->client,
|
||||
actionID, query, contentType, post_data);
|
||||
found = 1;
|
||||
}
|
||||
@@ -854,7 +854,7 @@ void MoCCISendOutput(MCCIPort client,Boolean sendIt,char *contentType)
|
||||
struct SendWhatToWhom *sendOutput;
|
||||
|
||||
if (sendIt) {
|
||||
if (!(sendOutput = (struct SendWhatToWhom *)
|
||||
if (!(sendOutput = (struct SendWhatToWhom *)
|
||||
MALLOC(sizeof(struct SendWhatToWhom)))) {
|
||||
return /*mem error*/;
|
||||
}
|
||||
@@ -891,7 +891,7 @@ struct SendWhatToWhom *sendOutput;
|
||||
ListNext(listOfSendOutput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,7 +907,7 @@ int port;
|
||||
(XtPointer) XtInputReadMask,
|
||||
(XtInputCallbackProc) MoCCINewConnection,
|
||||
app_context);
|
||||
cciAccepting = True;
|
||||
cciAccepting = True;
|
||||
listenPortNumber = port;
|
||||
/*
|
||||
XmxMakeInfoDialog(w,"Mosaic CCI port is listening",
|
||||
@@ -1014,7 +1014,7 @@ char *data;
|
||||
if (stat(filename,&fileInfo)) { /* get the length of the file */
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!(fp = fopen(filename,"r"))) {
|
||||
return(MCCI_FAIL);
|
||||
@@ -1058,7 +1058,7 @@ char *fileName;
|
||||
char *url;
|
||||
{
|
||||
struct FileURL *fileURL;
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cciTrace) {
|
||||
fprintf(stderr,"MoCCIAddFileURLToList():fileName=\"%s\", url=\"%s\"\n",(fileName?fileName:"NULL"),(url?url:"NULL"));
|
||||
@@ -1087,7 +1087,7 @@ char *fileName;
|
||||
struct FileURL *fileURL;
|
||||
|
||||
fileURL = (struct FileURL *) ListHead(listOfFileToURLs);
|
||||
while (fileURL){
|
||||
while (fileURL){
|
||||
if (!strncmp(fileURL->fileName,fileName,
|
||||
strlen(fileURL->fileName))) {
|
||||
return(fileURL->url);
|
||||
@@ -1097,7 +1097,7 @@ struct FileURL *fileURL;
|
||||
return(NULL);
|
||||
}
|
||||
/* this rplaces a vanilla url name with the name it was actually called with,
|
||||
which is what is needed by external apps. It is indeed a huge hack, and
|
||||
which is what is needed by external apps. It is indeed a huge hack, and
|
||||
should be fixed
|
||||
*/
|
||||
void MoCCIAddAnchorToURL(url, urlAndAnchor)
|
||||
@@ -1112,4 +1112,4 @@ char *urlAndAnchor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -89,13 +89,13 @@ void MoCCINewConnection(XtAppContext app_context,int *source,XtInputId *inputID)
|
||||
static XmxCallback (MoCCIWindowCallBack);
|
||||
mo_status MoDisplayCCIWindow(mo_window *win);
|
||||
void MoCCISendOutputToClient(char *contentType,char *fileName);
|
||||
int MoCCIFormToClient(char *actionID, char *query, char *contentType,
|
||||
int MoCCIFormToClient(char *actionID, char *query, char *contentType,
|
||||
char *post_data, int status);
|
||||
void MoCCISendOutput(MCCIPort client,Boolean sendIt,char *contentType);
|
||||
void MoCCIStartListening(Widget w,int port);
|
||||
void MoCCISendEventOutput(CCI_events event_type);
|
||||
void MoCCISendMouseAnchorOutput(char *anchor);
|
||||
void MoCCISendBrowserViewOutput(char *url, char *contentType,
|
||||
void MoCCISendBrowserViewOutput(char *url, char *contentType,
|
||||
char *data, int dataLength);
|
||||
int MoCCISendBrowserViewFile(char *url, char *contentType, char *filename);
|
||||
int MoCCIMaxNumberOfConnectionsAllowed();
|
||||
|
||||
@@ -194,8 +194,8 @@ MCCIPort client;
|
||||
}
|
||||
|
||||
int MCCIReadContent(client,content)
|
||||
/* read from client. Next line should contain Content-Length: value
|
||||
and then the content body. Returns the number of chars read.
|
||||
/* read from client. Next line should contain Content-Length: value
|
||||
and then the content body. Returns the number of chars read.
|
||||
0 on error. space is allocated and placed into 'content'*/
|
||||
MCCIPort client;
|
||||
char **content;
|
||||
@@ -262,14 +262,14 @@ int MCCIHandleSend(client,line,retText)
|
||||
{
|
||||
int retCode;
|
||||
char *s,*end,*start;
|
||||
|
||||
|
||||
if (!(s = strchr(line,' ')))
|
||||
{ /* skip over SEND */
|
||||
strcpy(retText,"Error in protocol");
|
||||
return(MCCIR_ERROR);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
GetWordFromString(s,&start,&end);
|
||||
if (!my_strncasecmp(start,MCCI_S_ANCHOR,strlen(MCCI_S_ANCHOR)))
|
||||
{
|
||||
@@ -279,9 +279,9 @@ int MCCIHandleSend(client,line,retText)
|
||||
/* ejb 9 March 1995 added BEFORE and AFTER cases */
|
||||
if (start && (start != end))
|
||||
/* SEND ANCHOR STOP => turn off SEND ANCHOR */
|
||||
if (!my_strncasecmp(start,MCCI_S_STOP,strlen(MCCI_S_STOP)))
|
||||
if (!my_strncasecmp(start,MCCI_S_STOP,strlen(MCCI_S_STOP)))
|
||||
MCCIRequestSendAnchor(&retCode,retText,client,0);
|
||||
else
|
||||
else
|
||||
/* SEND ANCHOR BEFORE => Mosaic sends anchor, BEFORE done getting */
|
||||
if (!my_strncasecmp(start,MCCI_S_BEFORE,strlen(MCCI_S_BEFORE)))
|
||||
MCCIRequestSendAnchor(&retCode,retText,client,MCCI_SEND_BEFORE);
|
||||
@@ -334,7 +334,7 @@ int MCCIHandleSend(client,line,retText)
|
||||
MCCIRequestSendOutput(&retCode,retText,
|
||||
client,1,start);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
/* "SEND OUTPUT" so send it all */
|
||||
@@ -342,7 +342,7 @@ int MCCIHandleSend(client,line,retText)
|
||||
client,1,(char *)0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if (!my_strncasecmp(start,MCCI_S_BROWSERVIEW,strlen(MCCI_S_BROWSERVIEW))){
|
||||
/* SEND BROWSERVIEW */
|
||||
s = end;
|
||||
@@ -366,7 +366,7 @@ int MCCIHandleSend(client,line,retText)
|
||||
client,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if (!my_strncasecmp(start,MCCI_S_EVENT,strlen(MCCI_S_EVENT))){
|
||||
/* SEND EVENT */
|
||||
s = end;
|
||||
@@ -491,7 +491,7 @@ char *next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
output = MCCI_DEFAULT;
|
||||
output = MCCI_DEFAULT;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -513,12 +513,12 @@ char *next;
|
||||
}
|
||||
#endif
|
||||
|
||||
MCCIRequestPost(client,&retCode, retText, url, mimeType,
|
||||
MCCIRequestPost(client,&retCode, retText, url, mimeType,
|
||||
postData, postDataLength, output);
|
||||
|
||||
free(url);
|
||||
free(mimeType);
|
||||
|
||||
|
||||
return(retCode);
|
||||
}
|
||||
|
||||
@@ -615,7 +615,7 @@ char *next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
output = MCCI_DEFAULT;
|
||||
output = MCCI_DEFAULT;
|
||||
}
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -638,12 +638,12 @@ char *next;
|
||||
}
|
||||
#endif
|
||||
|
||||
MCCIRequestDisplay(client, &retCode, retText, url, mimeType,
|
||||
MCCIRequestDisplay(client, &retCode, retText, url, mimeType,
|
||||
displayData, displayDataLength, output);
|
||||
|
||||
free(url);
|
||||
free(mimeType);
|
||||
|
||||
|
||||
return(retCode);
|
||||
}
|
||||
|
||||
@@ -666,7 +666,7 @@ int retCode;
|
||||
/* absRel = MCCI_DEFAULT;*/
|
||||
headerExt = (char *) 0;
|
||||
headerExtLength=0;
|
||||
|
||||
|
||||
if (!(s = strchr(line,' '))){ /* skip over GET */
|
||||
strcpy(retText,"Error in protocol");
|
||||
return(MCCIR_ERROR);
|
||||
@@ -737,7 +737,7 @@ int retCode;
|
||||
}
|
||||
#endif
|
||||
/* set flag to be caught in MoCCISendAnchorToCCI */
|
||||
cciStatPreventSendAnchor(client, url);
|
||||
cciStatPreventSendAnchor(client, url);
|
||||
MCCIRequestGetURL(&retCode,retText,url,output,headerExt);
|
||||
if ((headerExtLength > 0) && (headerExt)) {
|
||||
FREE(headerExt);
|
||||
@@ -863,10 +863,10 @@ int status;
|
||||
|
||||
/* set flag to be caught in MoCCISendAnchorToCCI */
|
||||
/*
|
||||
cciStatPreventSendAnchor(client, url);
|
||||
cciStatPreventSendAnchor(client, url);
|
||||
*/
|
||||
MCCIRequestForm(client, &retCode,retText,actionID,status);
|
||||
|
||||
|
||||
/* free(actionID);
|
||||
*/
|
||||
return(retCode);
|
||||
@@ -951,7 +951,7 @@ int retCode;
|
||||
else
|
||||
MCCIGetAnnotationDummyLine(&retCode,retText,retData,retDataLength,annoCodes[index]);
|
||||
|
||||
if (retDataLength !=
|
||||
if (retDataLength !=
|
||||
NetServerWrite(client,retData,retDataLength)) {
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
@@ -1119,7 +1119,7 @@ char *line;
|
||||
&retDataLength);
|
||||
*/
|
||||
MCCISendResponseLine(client,retCode,retText);
|
||||
if (retDataLength !=
|
||||
if (retDataLength !=
|
||||
NetServerWrite(client,*retData,retDataLength)) {
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
@@ -1176,13 +1176,13 @@ char *line;
|
||||
MCCISendResponseLine(client,retCode,retText);
|
||||
}
|
||||
else {
|
||||
/*
|
||||
/*
|
||||
MCCIRRequestUnrecognized();
|
||||
*/
|
||||
MCCISendResponseLine(client,MCCIR_UNRECOGNIZED,
|
||||
"Command not recognized");
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(1);
|
||||
}
|
||||
@@ -1201,7 +1201,7 @@ char buff[1024];
|
||||
return(MCCISendResponseLine(client, MCCIR_ANCHOR_INFO,buff));
|
||||
}
|
||||
|
||||
int MCCIFormQueryToClient(client, actionID, query, contentType, post_data)
|
||||
int MCCIFormQueryToClient(client, actionID, query, contentType, post_data)
|
||||
MCCIPort client;
|
||||
char *actionID;
|
||||
char *query;
|
||||
@@ -1211,7 +1211,7 @@ char *post_data;
|
||||
char buff[1024];
|
||||
int length, dataLength;
|
||||
|
||||
|
||||
|
||||
sprintf(buff, "%s %s ", actionID, query);
|
||||
if(MCCISendResponseLine(client, MCCIR_FORM_RESPONSE,buff)){
|
||||
return(MCCI_FAIL);
|
||||
@@ -1223,7 +1223,7 @@ int length, dataLength;
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
|
||||
dataLength = strlen(post_data);
|
||||
dataLength = strlen(post_data);
|
||||
sprintf(buff,"Content-Length: %d \r\n",dataLength);
|
||||
length = strlen(buff);
|
||||
if (length != NetServerWrite(client,buff,length)) {
|
||||
@@ -1233,7 +1233,7 @@ int length, dataLength;
|
||||
if (dataLength!= NetServerWrite(client,post_data,dataLength)) {
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
|
||||
|
||||
return(MCCI_OK);
|
||||
}
|
||||
|
||||
@@ -1285,7 +1285,7 @@ FILE *fp;
|
||||
|
||||
}
|
||||
else {
|
||||
/* error reading here...but we promised to send
|
||||
/* error reading here...but we promised to send
|
||||
countDown number of bytes, so send nulls */
|
||||
while (countDown > 0) {
|
||||
if (1 != NetServerWrite(client,"\0",1)) {
|
||||
@@ -1297,7 +1297,7 @@ FILE *fp;
|
||||
}
|
||||
fclose(fp);
|
||||
return(MCCI_OK);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1332,7 +1332,7 @@ int length;
|
||||
if (dataLength!= NetServerWrite(client,data,dataLength)) {
|
||||
return(MCCI_FAIL);
|
||||
}
|
||||
|
||||
|
||||
return(MCCI_OK);
|
||||
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ ProcessHandle *p;
|
||||
|
||||
}
|
||||
|
||||
/* terminate the children...
|
||||
/* terminate the children...
|
||||
you may want to remove SIGCHLD signal handler before calling this routine
|
||||
*/
|
||||
void KillAllChildren(void)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -775,7 +775,7 @@ ReadImage(FILE *fd, int len, int height, XColor *colrs, int cmapSize,
|
||||
unsigned char cmap[3][MAXCOLORMAPSIZE], int gray,
|
||||
int interlace, int ignore)
|
||||
{
|
||||
unsigned char *dp, c;
|
||||
unsigned char *dp, c;
|
||||
int v;
|
||||
int xpos = 0, ypos = 0/*, pass = 0*/;
|
||||
unsigned char *image;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
170
src/globalhist.c
170
src/globalhist.c
@@ -246,7 +246,7 @@ static void add_url_to_bucket (int buck, char *url, char *lastdate)
|
||||
|
||||
l->cached_data = NULL;
|
||||
l->next = NULL;
|
||||
|
||||
|
||||
if (bkt->head == NULL)
|
||||
bkt->head = l;
|
||||
else
|
||||
@@ -283,7 +283,7 @@ static int been_here_before (char *url)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -295,12 +295,12 @@ static int been_here_before (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_been_here_before_huh_dad
|
||||
* purpose: Predicate to determine if we've visited this URL before.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed if we've been here before; mo_fail otherwise
|
||||
* remarks:
|
||||
* We canonicalize the URL (stripping out the target anchor,
|
||||
* remarks:
|
||||
* We canonicalize the URL (stripping out the target anchor,
|
||||
* if one exists).
|
||||
****************************************************************************/
|
||||
mo_status mo_been_here_before_huh_dad (char *url)
|
||||
@@ -321,12 +321,12 @@ mo_status mo_been_here_before_huh_dad (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_here_we_are_son
|
||||
* purpose: Add a URL to the global history, if it's not already there.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to add.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* We canonicalize the URL (stripping out the target anchor,
|
||||
* remarks:
|
||||
* We canonicalize the URL (stripping out the target anchor,
|
||||
* if one exists).
|
||||
****************************************************************************/
|
||||
mo_status mo_here_we_are_son (char *url)
|
||||
@@ -345,7 +345,7 @@ mo_status mo_here_we_are_son (char *url)
|
||||
|
||||
if (!been_here_before (curl))
|
||||
add_url_to_bucket (hash_url (curl), curl, ts);
|
||||
|
||||
|
||||
free (curl);
|
||||
|
||||
return mo_succeed;
|
||||
@@ -355,12 +355,12 @@ mo_status mo_here_we_are_son (char *url)
|
||||
* name: mo_read_global_history (PRIVATE)
|
||||
* purpose: Given a filename, read the file's contents into the
|
||||
* global history hash table.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *filename: The file to read.
|
||||
* returns:
|
||||
* returns:
|
||||
* nothing
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
static void mo_read_global_history (char *filename)
|
||||
{
|
||||
@@ -387,7 +387,7 @@ static void mo_read_global_history (char *filename)
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto screwed_with_file;
|
||||
|
||||
|
||||
/* See if it's our format. */
|
||||
if (strncmp (line, NCSA_HISTORY_FORMAT_COOKIE_ONE,
|
||||
strlen (NCSA_HISTORY_FORMAT_COOKIE_ONE))) {
|
||||
@@ -407,17 +407,17 @@ static void mo_read_global_history (char *filename)
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto screwed_with_file;
|
||||
|
||||
|
||||
/* Start grabbing url's. */
|
||||
while (1)
|
||||
{
|
||||
char *url;
|
||||
char *lastdate;
|
||||
|
||||
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto done;
|
||||
|
||||
|
||||
url = strtok (line, " ");
|
||||
if (!url)
|
||||
goto screwed_with_file;
|
||||
@@ -432,7 +432,7 @@ static void mo_read_global_history (char *filename)
|
||||
add_url_to_bucket (hash_url (url), url, lastdate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
screwed_with_file:
|
||||
done:
|
||||
fclose (fp);
|
||||
@@ -447,12 +447,12 @@ static void mo_read_global_history (char *filename)
|
||||
/****************************************************************************
|
||||
* name: mo_init_global_history
|
||||
* purpose: Initialize the global history hash table.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* none
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
mo_status mo_init_global_history (void)
|
||||
{
|
||||
@@ -472,11 +472,11 @@ mo_status mo_init_global_history (void)
|
||||
/****************************************************************************
|
||||
* name: mo_wipe_global_history
|
||||
* purpose: Wipe out the current global history.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* none
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* Huge memory hole here. However, we now call
|
||||
* mo_flush_image_cache to at least clear out the image structures.
|
||||
****************************************************************************/
|
||||
@@ -496,12 +496,12 @@ mo_status mo_wipe_global_history (mo_window *win)
|
||||
* purpose: Called on program startup to do the global history
|
||||
* initialization stuff, including figuring out where the
|
||||
* global history file is and reading it.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* none
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
static char *cached_global_hist_fname = NULL;
|
||||
mo_status mo_setup_global_history (void)
|
||||
@@ -516,8 +516,8 @@ mo_status mo_setup_global_history (void)
|
||||
/* This shouldn't happen. */
|
||||
if (!home)
|
||||
home = "/tmp";
|
||||
|
||||
filename = (char *)malloc
|
||||
|
||||
filename = (char *)malloc
|
||||
((strlen (home) +
|
||||
strlen (get_pref_string(eHISTORY_FILE)) +
|
||||
8) * sizeof (char));
|
||||
@@ -545,7 +545,7 @@ mo_status mo_setup_global_history (void)
|
||||
mo_read_global_history (filename);
|
||||
|
||||
free(filename);
|
||||
filename = (char *)malloc
|
||||
filename = (char *)malloc
|
||||
((strlen (home) +
|
||||
strlen (get_pref_string(eHISTORY_FILE)) +
|
||||
8) * sizeof (char));
|
||||
@@ -560,11 +560,11 @@ mo_status mo_setup_global_history (void)
|
||||
/****************************************************************************
|
||||
* name: mo_write_global_history
|
||||
* purpose: Write the global history file out to disk.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* none
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed (usually)
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This assigns last-read times to all the entries in the history,
|
||||
* which is a bad thing.
|
||||
* ---Not anymore --- SWP
|
||||
@@ -584,7 +584,7 @@ mo_status mo_write_global_history (void)
|
||||
return mo_fail;
|
||||
|
||||
fprintf (fp, "%s\n%s\n", NCSA_HISTORY_FORMAT_COOKIE_TWO, "Global");
|
||||
|
||||
|
||||
for (i = 0; i < HASH_TABLE_SIZE; i++)
|
||||
{
|
||||
for (l = hash_table[i].head; l != NULL; l = l->next)
|
||||
@@ -592,9 +592,9 @@ mo_status mo_write_global_history (void)
|
||||
fprintf (fp, "%s %s\n", l->url, (isdigit(*(l->lastdate))?l->lastdate:ts));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -602,11 +602,11 @@ mo_status mo_write_global_history (void)
|
||||
/****************************************************************************
|
||||
* name: mo_fetch_cached_image_data
|
||||
* purpose: Retrieve a piece of cached data associated with a URL.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL.
|
||||
* returns:
|
||||
* returns:
|
||||
* The piece of cached data (void *).
|
||||
* remarks:
|
||||
* remarks:
|
||||
* We do *not* do anything to the URL. If there is a target
|
||||
* anchor in it, fine with us. This means the target anchor
|
||||
* should have been stripped out someplace else if it needed to be.
|
||||
@@ -642,7 +642,7 @@ void *mo_fetch_cached_image_data (char *url)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -650,11 +650,11 @@ void *mo_fetch_cached_image_data (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_fetch_cached_local_name
|
||||
* purpose: Retrieve a piece of cached data associated with a URL.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL.
|
||||
* returns:
|
||||
* returns:
|
||||
* The piece of cached data (void *).
|
||||
* remarks:
|
||||
* remarks:
|
||||
* We do *not* do anything to the URL. If there is a target
|
||||
* anchor in it, fine with us. This means the target anchor
|
||||
* should have been stripped out someplace else if it needed to be.
|
||||
@@ -675,7 +675,7 @@ void *mo_fetch_cached_local_name (char *url)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ void *mo_fetch_cached_local_name (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_cache_data
|
||||
* purpose: Cache a piece of data associated with a given URL.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL.
|
||||
* - void *info: The piece of data to cache (currently either
|
||||
* an ImageInfo struct for an image named as SRC
|
||||
@@ -691,9 +691,9 @@ void *mo_fetch_cached_local_name (char *url)
|
||||
* local copy of a remote HDF file).
|
||||
* - int type: The type of data to cache (currently either
|
||||
* 0 for an ImageInfo struct or 1 for a local name).
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed, unless something goes badly wrong
|
||||
* remarks:
|
||||
* remarks:
|
||||
* We do *not* do anything to the URL. If there is a target
|
||||
* anchor in it, fine with us. This means the target anchor
|
||||
* should have been stripped out someplace else if it needed to be.
|
||||
@@ -720,7 +720,7 @@ mo_status mo_cache_data (char *url, void *info, int type)
|
||||
if (!strcmp (l->url, url))
|
||||
goto found;
|
||||
}
|
||||
|
||||
|
||||
return mo_fail;
|
||||
|
||||
found:
|
||||
@@ -782,12 +782,12 @@ mo_status mo_zap_cached_images_here (mo_window *win)
|
||||
|
||||
/****************************************************************************
|
||||
* name: mo_flush_image_cache
|
||||
* purpose:
|
||||
* inputs:
|
||||
* purpose:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* returns:
|
||||
* returns:
|
||||
* nuthin
|
||||
* remarks:
|
||||
* remarks:
|
||||
****************************************************************************/
|
||||
mo_status mo_flush_image_cache (mo_window *win)
|
||||
{
|
||||
@@ -846,7 +846,7 @@ static mo_status mo_dump_cached_cd_array (void)
|
||||
if (cached_cd_array[i])
|
||||
if (cacheTrace) {
|
||||
fprintf (stderr, " %02d data 0x%08x last_access %d\n", i,
|
||||
cached_cd_array[i]->image_data,
|
||||
cached_cd_array[i]->image_data,
|
||||
cached_cd_array[i]->last_access);
|
||||
}
|
||||
else
|
||||
@@ -868,8 +868,8 @@ static mo_status mo_dump_cached_cd_array (void)
|
||||
static mo_status mo_init_cached_cd_array (void)
|
||||
{
|
||||
/* int i;*/
|
||||
|
||||
cached_cd_array = (cached_data **)malloc (sizeof (cached_data *) *
|
||||
|
||||
cached_cd_array = (cached_data **)malloc (sizeof (cached_data *) *
|
||||
CHUNK_OF_IMAGES);
|
||||
size_of_cached_cd_array += CHUNK_OF_IMAGES;
|
||||
|
||||
@@ -880,7 +880,7 @@ static mo_status mo_init_cached_cd_array (void)
|
||||
size_of_cached_cd_array);
|
||||
#endif
|
||||
|
||||
/* bzero ((char *)cached_cd_array,
|
||||
/* bzero ((char *)cached_cd_array,
|
||||
CHUNK_OF_IMAGES * sizeof (cached_cd_array[0]));*/
|
||||
memset((char *)cached_cd_array, 0,
|
||||
CHUNK_OF_IMAGES * sizeof (cached_cd_array[0]));
|
||||
@@ -891,18 +891,18 @@ static mo_status mo_init_cached_cd_array (void)
|
||||
static mo_status mo_grow_cached_cd_array (void)
|
||||
{
|
||||
/* int i;*/
|
||||
|
||||
cached_cd_array = (cached_data **)realloc
|
||||
|
||||
cached_cd_array = (cached_data **)realloc
|
||||
(cached_cd_array,
|
||||
sizeof (cached_data *) * (size_of_cached_cd_array + CHUNK_OF_IMAGES));
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf (stderr, "[grow] cached_cd_array 0x%08x, size_of_cached_cd_array 0x%08x, sum 0x%08x\n",
|
||||
cached_cd_array, size_of_cached_cd_array,
|
||||
cached_cd_array, size_of_cached_cd_array,
|
||||
cached_cd_array + size_of_cached_cd_array);
|
||||
#endif
|
||||
/* bzero ((char *)(cached_cd_array + size_of_cached_cd_array),
|
||||
/* bzero ((char *)(cached_cd_array + size_of_cached_cd_array),
|
||||
CHUNK_OF_IMAGES * sizeof (cached_cd_array[0]));*/
|
||||
memset((char *)(cached_cd_array + size_of_cached_cd_array), 0,
|
||||
CHUNK_OF_IMAGES * sizeof (cached_cd_array[0]));
|
||||
@@ -964,22 +964,22 @@ static mo_status mo_sort_cached_cd_array (void)
|
||||
}
|
||||
#endif
|
||||
|
||||
qsort
|
||||
((void *)cached_cd_array, size_of_cached_cd_array,
|
||||
qsort
|
||||
((void *)cached_cd_array, size_of_cached_cd_array,
|
||||
sizeof (cached_cd_array[0]), mo_sort_cd_for_qsort);
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
mo_dump_cached_cd_array ();
|
||||
#endif
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
static mo_status mo_remove_cd_from_cached_cd_array (cached_data *cd)
|
||||
{
|
||||
int i/*, num = -1*/, freed_kbytes = 0;
|
||||
|
||||
|
||||
if (!cached_cd_array)
|
||||
return mo_fail;
|
||||
|
||||
@@ -989,12 +989,12 @@ static mo_status mo_remove_cd_from_cached_cd_array (cached_data *cd)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf
|
||||
(stderr,
|
||||
"[mo_remove_cd_from_cached_cd_array] Found data 0x%08x, location %d\n",
|
||||
fprintf
|
||||
(stderr,
|
||||
"[mo_remove_cd_from_cached_cd_array] Found data 0x%08x, location %d\n",
|
||||
cached_cd_array[i]->image_data, i);
|
||||
#endif
|
||||
freed_kbytes = mo_kbytes_in_image_data
|
||||
freed_kbytes = mo_kbytes_in_image_data
|
||||
(cached_cd_array[i]->image_data);
|
||||
mo_free_image_data (cached_cd_array[i]->image_data);
|
||||
cached_cd_array[i] = NULL;
|
||||
@@ -1008,7 +1008,7 @@ static mo_status mo_remove_cd_from_cached_cd_array (cached_data *cd)
|
||||
#endif
|
||||
|
||||
return mo_fail;
|
||||
|
||||
|
||||
done:
|
||||
num_in_cached_cd_array--;
|
||||
kbytes_cached -= freed_kbytes;
|
||||
@@ -1019,7 +1019,7 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
{
|
||||
int i, num;
|
||||
int kbytes_in_new_image = mo_kbytes_in_image_data (cd->image_data);
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf (stderr, "[mo_add_cd] New image is %d kbytes.\n",
|
||||
@@ -1051,14 +1051,14 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
int num_to_remove = 0;
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf (stderr, "[mo_add_cd] Going to sort 0x%08x...\n",
|
||||
fprintf (stderr, "[mo_add_cd] Going to sort 0x%08x...\n",
|
||||
cached_cd_array);
|
||||
#endif
|
||||
mo_sort_cached_cd_array ();
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
{
|
||||
fprintf (stderr,
|
||||
fprintf (stderr,
|
||||
"[mo_add_to] Just sorted in preparation for purging...\n");
|
||||
mo_dump_cached_cd_array ();
|
||||
}
|
||||
@@ -1069,7 +1069,7 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf
|
||||
fprintf
|
||||
(stderr, "[mo_add_cd] Trying to free another image (%d > %d).\n",
|
||||
(kbytes_cached + kbytes_in_new_image),
|
||||
get_pref_int(eIMAGE_CACHE_SIZE));
|
||||
@@ -1118,7 +1118,7 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
}
|
||||
}
|
||||
removed_em_all:
|
||||
|
||||
|
||||
if (num_in_cached_cd_array == size_of_cached_cd_array)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -1141,8 +1141,8 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
}
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
fprintf
|
||||
(stderr,
|
||||
fprintf
|
||||
(stderr,
|
||||
"[mo_add_cd_to_cached_cd_array] UH OH couldn't find empty slot\n");
|
||||
#endif
|
||||
/* Try to grow array -- flow of control should never reach here,
|
||||
@@ -1150,7 +1150,7 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
num = size_of_cached_cd_array;
|
||||
mo_grow_cached_cd_array ();
|
||||
}
|
||||
|
||||
|
||||
got_num:
|
||||
cached_cd_array[num] = cd;
|
||||
num_in_cached_cd_array++;
|
||||
@@ -1160,11 +1160,11 @@ static mo_status mo_add_cd_to_cached_cd_array (cached_data *cd)
|
||||
#ifndef DISABLE_TRACE
|
||||
if (cacheTrace)
|
||||
{
|
||||
fprintf
|
||||
(stderr,
|
||||
fprintf
|
||||
(stderr,
|
||||
"[mo_add_cd_to_cached_cd_array] Added cd, data 0x%08x, num %d\n",
|
||||
cd->image_data, num);
|
||||
fprintf
|
||||
fprintf
|
||||
(stderr,
|
||||
"[mo_add_cd_to_cached_cd_array] Now cached %d kbytes.\n", kbytes_cached);
|
||||
mo_dump_cached_cd_array ();
|
||||
@@ -1193,7 +1193,7 @@ static int mo_kbytes_in_image_data (void *image_data)
|
||||
|
||||
if (kbytes == 0)
|
||||
kbytes = 1;
|
||||
|
||||
|
||||
return kbytes;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -75,15 +75,15 @@ static int HtLoadHTTPANN(char *arg, char *data, int len, char *com);
|
||||
/****************************************************************************
|
||||
* name: HtLoadHTTPANN (PRIVATE)
|
||||
* purpose: Issue a command to a group annotation server.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *arg:
|
||||
* - char *data:
|
||||
* - int len:
|
||||
* - char *com:
|
||||
* returns:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
* returns:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
static int
|
||||
HtLoadHTTPANN(char *arg, char *data, int len, char *com)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
124
src/grpan.c
124
src/grpan.c
@@ -83,7 +83,7 @@ static char *EscapeStuff(char *title);
|
||||
Return an HTML-format hyperlink table to be appended to
|
||||
the document text, or NULL if no annotations exist.
|
||||
If a non-NULL result is returned, the caller must free it.
|
||||
|
||||
|
||||
mo_status mo_new_grpan (char *url, char *title, char *author,
|
||||
char *text)
|
||||
Add a new annotation for document named by 'url' to the
|
||||
@@ -152,13 +152,13 @@ static char *EscapeStuff(char *title)
|
||||
/****************************************************************************
|
||||
* name: mo_fetch_grpan_links
|
||||
* purpose: Fetch the list of group annotations for this document.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL for which to fetch.
|
||||
* returns:
|
||||
* returns:
|
||||
* An HTML block with the list of group annotations, or NULL.
|
||||
* remarks:
|
||||
* Right now the server constructs the list for us. Later we will want
|
||||
* to construct it ourselves to be able to support local kill lists,
|
||||
* remarks:
|
||||
* Right now the server constructs the list for us. Later we will want
|
||||
* to construct it ourselves to be able to support local kill lists,
|
||||
* and the like.
|
||||
****************************************************************************/
|
||||
char *mo_fetch_grpan_links (char *url)
|
||||
@@ -175,30 +175,30 @@ char *mo_fetch_grpan_links (char *url)
|
||||
{
|
||||
/* Go get the anchor in the URL, if any. */
|
||||
char *anch = mo_url_extract_anchor (url);
|
||||
|
||||
|
||||
/* If there is one and it doesn't start with "hdfref",
|
||||
then clip it off. WHAT ABOUT PERSONAL ANNOTATIONS??? */
|
||||
if (anch && strncmp (anch, "hdfref", 6))
|
||||
url = mo_url_canonicalize (url, "");
|
||||
|
||||
|
||||
/* Sanity check. */
|
||||
if (!url)
|
||||
return NULL;
|
||||
|
||||
/* the old Bina grpan request */
|
||||
/*
|
||||
/*
|
||||
request = (char *)malloc(strlen(url) + 256);
|
||||
sprintf
|
||||
(request, "grpan://%s/url=\"%s\";=", Rdata.annotation_server, url);
|
||||
ttxt = grpan_doit("ANN_GET ", request, (char *)NULL, 0, &ttxthead);
|
||||
free(request);
|
||||
*/
|
||||
|
||||
|
||||
/* amb */
|
||||
post_data = (char *)malloc(strlen(url) + 1024);
|
||||
sprintf(post_data, "cmd=an_get&format=html&url=%s", url);
|
||||
ttxt = mo_post_pull_er_over (get_pref_string(eANNOTATION_SERVER),
|
||||
"application/x-www-form-urlencoded",
|
||||
"application/x-www-form-urlencoded",
|
||||
post_data, &ttxthead);
|
||||
free(post_data);
|
||||
|
||||
@@ -225,12 +225,12 @@ char *mo_fetch_grpan_links (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_is_editable_grpan
|
||||
* purpose: Discover if a block of HTML is an editable group annotation.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *text: Text block to check.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed if it is, mo_fail if not.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
mo_status mo_is_editable_grpan (char *text)
|
||||
{
|
||||
@@ -248,14 +248,14 @@ mo_status mo_is_editable_grpan (char *text)
|
||||
/****************************************************************************
|
||||
* name: mo_new_grpan
|
||||
* purpose: Send a new group annotation to the server.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL of the document being annotated.
|
||||
* - char *title: Title of the new annotation.
|
||||
* - char *author: Author of the new annotation.
|
||||
* - char *text: Text of the new annotation.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed if the annotation was registered; mo_fail if not.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* Send a new group annotation to the server. The data (text) can actually
|
||||
* be binary, but then you need to compose what you send with something other
|
||||
* than strcat, and you may need to call a function other than
|
||||
@@ -276,15 +276,15 @@ mo_status mo_new_grpan (char *url, char *title, char *author, char *text)
|
||||
char *ts = ctime (&foo);
|
||||
char *Etitle, *Euser;
|
||||
char *esc_text;
|
||||
|
||||
|
||||
ts[strlen(ts)-1] = '\0';
|
||||
|
||||
|
||||
Etitle = EscapeStuff(title);
|
||||
Euser = EscapeStuff(author);
|
||||
|
||||
/* The old Bina thing */
|
||||
/*
|
||||
|
||||
|
||||
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
|
||||
strlen(ts) + strlen(text) + 256);
|
||||
if (request == NULL)
|
||||
@@ -300,7 +300,7 @@ mo_status mo_new_grpan (char *url, char *title, char *author, char *text)
|
||||
*/
|
||||
|
||||
/* amb */
|
||||
post_data = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser)
|
||||
post_data = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser)
|
||||
+ strlen(ts) + strlen(text) + 256);
|
||||
if (post_data == NULL)
|
||||
return mo_fail;
|
||||
@@ -308,7 +308,7 @@ mo_status mo_new_grpan (char *url, char *title, char *author, char *text)
|
||||
sprintf(post_data, "cmd=an_post&url=%s&title=%s&author=%s&text=%s",
|
||||
url, title, author, esc_text);
|
||||
ttxt = mo_post_pull_er_over (get_pref_string(eANNOTATION_SERVER),
|
||||
"application/x-www-form-urlencoded",
|
||||
"application/x-www-form-urlencoded",
|
||||
post_data, &ttxthead);
|
||||
free(post_data);
|
||||
|
||||
@@ -329,19 +329,19 @@ mo_status mo_new_grpan (char *url, char *title, char *author, char *text)
|
||||
|
||||
/****************************************************************************
|
||||
* name: mo_audio_grpan
|
||||
* purpose: Send a new audio group annotation to the server.
|
||||
* inputs:
|
||||
* purpose: Send a new audio group annotation to the server.
|
||||
* inputs:
|
||||
* - char *url: The URL of the document being annotated.
|
||||
* - char *title: Title of the new annotation.
|
||||
* - char *author: Author of the new annotation.
|
||||
* - char *data: Binary data of the new annotation.
|
||||
* - int len:
|
||||
* returns:
|
||||
* - int len:
|
||||
* returns:
|
||||
* mo_succeed if everything's OK, mo_fail else.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* The data is sound, either .au, or .aiff format.
|
||||
****************************************************************************/
|
||||
mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
char *data, int len)
|
||||
{
|
||||
if (! get_pref_string(eANNOTATION_SERVER)) /* No annotation server */
|
||||
@@ -360,7 +360,7 @@ mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
|
||||
Etitle = EscapeStuff(title);
|
||||
Euser = EscapeStuff(author);
|
||||
|
||||
|
||||
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
|
||||
strlen(ts) + 256);
|
||||
if (request == NULL)
|
||||
@@ -392,15 +392,15 @@ mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
/****************************************************************************
|
||||
* name: mo_modify_grpan
|
||||
* purpose: Alter the content of an existing group annotation.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL of the annotation being changed.
|
||||
* - char *title: Title of the new (modified) annotation.
|
||||
* - char *author: Author of the new (modified) annotation.
|
||||
* - char *text: Text of the new (modified) annotation.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed if the annotation changes were registered; mo_fail if not.
|
||||
* remarks:
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
mo_status mo_modify_grpan (char *url, char *title, char *author, char *text)
|
||||
@@ -416,12 +416,12 @@ mo_status mo_modify_grpan (char *url, char *title, char *author, char *text)
|
||||
time_t foo = time (NULL);
|
||||
char *ts = ctime (&foo);
|
||||
char *Etitle, *Euser;
|
||||
|
||||
|
||||
ts[strlen(ts)-1] = '\0';
|
||||
|
||||
|
||||
Etitle = EscapeStuff(title);
|
||||
Euser = EscapeStuff(author);
|
||||
|
||||
|
||||
request = (char *)malloc(strlen(url) + strlen(Etitle) + strlen(Euser) +
|
||||
strlen(ts) + strlen(text) + 256);
|
||||
if (request == NULL)
|
||||
@@ -449,12 +449,12 @@ mo_status mo_modify_grpan (char *url, char *title, char *author, char *text)
|
||||
/****************************************************************************
|
||||
* name: mo_delete_grpan
|
||||
* purpose: Delete the annotation whose url is passed.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL of annotation to be deleted.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed, if everything went OK.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
mo_status mo_delete_grpan (char *url)
|
||||
{
|
||||
@@ -466,10 +466,10 @@ mo_status mo_delete_grpan (char *url)
|
||||
{
|
||||
char *request;
|
||||
char *ttxt, *ttxthead;
|
||||
|
||||
|
||||
request = (char *)malloc(strlen(url) + 256);
|
||||
sprintf
|
||||
(request, "grpan://%s/url=\"%s\";=",
|
||||
(request, "grpan://%s/url=\"%s\";=",
|
||||
get_pref_string(eANNOTATION_SERVER), url);
|
||||
ttxt = grpan_doit("ANN_DELETE ", request, (char *)NULL, 0, &ttxthead);
|
||||
free(request);
|
||||
@@ -481,7 +481,7 @@ mo_status mo_delete_grpan (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_grok_grpan_pieces
|
||||
* purpose: Read pieces of out an annotation.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL of the annotation.
|
||||
* - char *t: Text of the annotation.
|
||||
* - char **title: Return title of the annotation.
|
||||
@@ -489,11 +489,11 @@ mo_status mo_delete_grpan (char *url)
|
||||
* - char **text: Return text (body) of the annotation.
|
||||
* - int *id: Return ID of the annotation.
|
||||
* - char **fn: Unused.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed if the return pointers were set to the right data;
|
||||
* mo_fail if something went wrong.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
char **title, char **author, char **text,
|
||||
@@ -516,7 +516,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
{
|
||||
return mo_fail;
|
||||
}
|
||||
|
||||
|
||||
/* Skip the magic cookie */
|
||||
tptr = txt;
|
||||
while (*tptr != '\n')
|
||||
@@ -527,7 +527,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* Skip the title line */
|
||||
tptr++;
|
||||
while (*tptr != '\n')
|
||||
@@ -538,7 +538,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* skip to the beginning of the title after the header tag */
|
||||
while (*tptr != '>')
|
||||
{
|
||||
@@ -550,7 +550,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
head = tptr;
|
||||
|
||||
|
||||
/* skip to the end of the title before the close header tag */
|
||||
while (*tptr != '<')
|
||||
{
|
||||
@@ -563,7 +563,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
*tptr = '\0';
|
||||
*title = strdup(head); /* snarf out the title */
|
||||
*tptr = '<';
|
||||
|
||||
|
||||
/* skip to the end of the header line. */
|
||||
while (*tptr != '\n')
|
||||
{
|
||||
@@ -573,7 +573,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* skip to the beginning of the author after the address tag */
|
||||
while (*tptr != '>')
|
||||
{
|
||||
@@ -585,7 +585,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
head = tptr;
|
||||
|
||||
|
||||
/* skip to the end of the author before the close address tag */
|
||||
while (*tptr != '<')
|
||||
{
|
||||
@@ -598,7 +598,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
*tptr = '\0';
|
||||
*author = strdup(head); /* snarf the author name */
|
||||
*tptr = '<';
|
||||
|
||||
|
||||
/* skip to the end of the author line. */
|
||||
while (*tptr != '\n')
|
||||
{
|
||||
@@ -608,7 +608,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* skip to the end of the date line. */
|
||||
tptr++;
|
||||
while (*tptr != '\n')
|
||||
@@ -619,7 +619,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* skip to the end of the ___ line. */
|
||||
tptr++;
|
||||
while (*tptr != '\n')
|
||||
@@ -630,7 +630,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
}
|
||||
|
||||
|
||||
/* skip to the end of the pre line. */
|
||||
tptr++;
|
||||
while (*tptr != '\n')
|
||||
@@ -643,7 +643,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
tptr++;
|
||||
*text = strdup(tptr); /* snarf the remaining text */
|
||||
|
||||
|
||||
/*
|
||||
* Find the annotation file name at the end of the url, and strip
|
||||
* the id number out of it.
|
||||
@@ -652,7 +652,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
if (tptr == NULL)
|
||||
{
|
||||
int hash, val;
|
||||
|
||||
|
||||
if (sscanf(url, "%d-%d.html", &hash, &val) != 2)
|
||||
{
|
||||
return mo_fail;
|
||||
@@ -662,7 +662,7 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
else
|
||||
{
|
||||
int hash, val;
|
||||
|
||||
|
||||
tptr++;
|
||||
if (sscanf(tptr, "%d-%d.html", &hash, &val) != 2)
|
||||
{
|
||||
@@ -670,6 +670,6 @@ mo_status mo_grok_grpan_pieces (char *url, char *t,
|
||||
}
|
||||
*id = val;
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -69,7 +69,7 @@
|
||||
char *mo_fetch_grpan_links (char *url);
|
||||
mo_status mo_is_editable_grpan (char *text);
|
||||
mo_status mo_new_grpan (char *url, char *title, char *author, char *text);
|
||||
mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
mo_status mo_audio_grpan (char *url, char *title, char *author,
|
||||
char *data, int len);
|
||||
mo_status mo_modify_grpan (char *url, char *title, char *author, char *text);
|
||||
mo_status mo_delete_grpan (char *url);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -101,10 +101,10 @@ static void mo_back_possible (mo_window *win);
|
||||
static void mo_forward_possible (mo_window *win);
|
||||
static void mo_annotate_edit_possible (mo_window *win);
|
||||
static void mo_annotate_edit_impossible (mo_window *win);
|
||||
static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
char *target_anchor, void *cached_stuff);
|
||||
static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
char *content_type, char *post_data,
|
||||
static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
char *content_type, char *post_data,
|
||||
char *ref);
|
||||
|
||||
/* for selective image loading */
|
||||
@@ -117,18 +117,18 @@ extern Boolean currently_delaying_images;
|
||||
/****************************************************************************
|
||||
* name: check_imagedelay
|
||||
* purpose: checks the win->current_node->url against the imagedelay_sites
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url - the current url
|
||||
* returns:
|
||||
* returns:
|
||||
* 1 if there is a match in imagedelay_sites
|
||||
* 0 if there is not a match
|
||||
*
|
||||
*
|
||||
****************************************************************************/
|
||||
static Boolean check_imagedelay (char *url) {
|
||||
|
||||
long i;
|
||||
|
||||
|
||||
|
||||
if(imagedelay_sites != NULL) {
|
||||
for(i = 0; imagedelay_sites[i]; i++) {
|
||||
if(strstr(url, imagedelay_sites[i])) {
|
||||
@@ -136,9 +136,9 @@ static Boolean check_imagedelay (char *url) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -146,12 +146,12 @@ static Boolean check_imagedelay (char *url) {
|
||||
* name: mo_snarf_scrollbar_values
|
||||
* purpose: Store current viewing state in the current node, in case
|
||||
* we want to return to the same location later.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: Current window.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* (mo_fail if no current node exists)
|
||||
* remarks:
|
||||
* remarks:
|
||||
* Snarfs current docid position in the HTML widget.
|
||||
****************************************************************************/
|
||||
static mo_status mo_snarf_scrollbar_values (mo_window *win)
|
||||
@@ -255,7 +255,7 @@ static void mo_forward_possible (mo_window *win)
|
||||
mo_tool_state(&(win->tools[BTN_NEXT]),XmxSensitive,BTN_NEXT);
|
||||
XmxRSetSensitive (win->menubar, mo_forward, XmxSensitive);
|
||||
}
|
||||
|
||||
|
||||
mo_popup_set_something("Forward", XmxSensitive, NULL);
|
||||
|
||||
return;
|
||||
@@ -272,7 +272,7 @@ mo_status mo_forward_impossible (mo_window *win)
|
||||
mo_tool_state(&(win->tools[BTN_NEXT]),XmxNotSensitive,BTN_NEXT);
|
||||
XmxRSetSensitive (win->menubar, mo_forward, XmxNotSensitive);
|
||||
}
|
||||
|
||||
|
||||
mo_popup_set_something("Forward", XmxNotSensitive, NULL);
|
||||
return mo_succeed;
|
||||
}
|
||||
@@ -296,7 +296,7 @@ static void mo_annotate_edit_impossible (mo_window *win)
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
char *target_anchor, void *cached_stuff)
|
||||
{
|
||||
/* Any data transfer that takes place in here must be inlined
|
||||
@@ -305,10 +305,10 @@ static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
interrupted = 0;
|
||||
mo_set_image_cache_nuke_threshold ();
|
||||
if (get_pref_boolean(eANNOTATIONS_ON_TOP))
|
||||
HTMLSetText (w, txt, ans ? ans : "\0", "\0", id, target_anchor,
|
||||
HTMLSetText (w, txt, ans ? ans : "\0", "\0", id, target_anchor,
|
||||
cached_stuff);
|
||||
else
|
||||
HTMLSetText (w, txt, "\0", ans ? ans : "\0", id, target_anchor,
|
||||
HTMLSetText (w, txt, "\0", ans ? ans : "\0", id, target_anchor,
|
||||
cached_stuff);
|
||||
loading_inlined_images = 0;
|
||||
interrupted = 0;
|
||||
@@ -320,7 +320,7 @@ static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
* name: mo_do_window_text (PRIVATE)
|
||||
* purpose: Set a window's text and do lots of other housekeeping
|
||||
* and GUI-maintenance things.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* - char *url: The URL for the text; assumed to be canonicalized
|
||||
* and otherwise ready for inclusion in history lists,
|
||||
@@ -332,9 +332,9 @@ static void mo_set_text (Widget w, char *txt, char *ans, int id,
|
||||
* as a new node in the history list. If FALSE,
|
||||
* then we're just moving around in the history list.
|
||||
* - char *ref: Reference (possible title) for this text.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This is the mother of all functions in Mosaic. Probably should be
|
||||
* rethought and broken down.
|
||||
****************************************************************************/
|
||||
@@ -367,7 +367,7 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
/* TRACK APPLICATION MODE */
|
||||
{
|
||||
int newmode = moMODE_PLAIN;
|
||||
|
||||
|
||||
if(!strncmp(url,"ftp:",4)) newmode = moMODE_FTP;
|
||||
if(!strncmp(url,"news:",4)) {
|
||||
int p,n,pt,nt,f;
|
||||
@@ -380,38 +380,38 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
|
||||
mo_tool_state(&(win->tools[BTN_NTHR]),
|
||||
nt?XmxSensitive:XmxNotSensitive,BTN_NTHR);
|
||||
XmxRSetSensitive (win->menubar, mo_news_nextt,
|
||||
XmxRSetSensitive (win->menubar, mo_news_nextt,
|
||||
nt?XmxSensitive:XmxNotSensitive);
|
||||
|
||||
mo_tool_state(&(win->tools[BTN_PART]),
|
||||
p?XmxSensitive:XmxNotSensitive,BTN_PART);
|
||||
XmxRSetSensitive (win->menubar, mo_news_prev,
|
||||
XmxRSetSensitive (win->menubar, mo_news_prev,
|
||||
p?XmxSensitive:XmxNotSensitive);
|
||||
|
||||
mo_tool_state(&(win->tools[BTN_NART]),
|
||||
n?XmxSensitive:XmxNotSensitive,BTN_NART);
|
||||
XmxRSetSensitive (win->menubar, mo_news_next,
|
||||
XmxRSetSensitive (win->menubar, mo_news_next,
|
||||
n?XmxSensitive:XmxNotSensitive);
|
||||
|
||||
mo_tool_state(&(win->tools[BTN_POST]),XmxSensitive,BTN_POST);
|
||||
|
||||
mo_tool_state(&(win->tools[BTN_FOLLOW]),
|
||||
f?XmxSensitive:XmxNotSensitive,BTN_FOLLOW);
|
||||
XmxRSetSensitive (win->menubar, mo_news_follow,
|
||||
XmxRSetSensitive (win->menubar, mo_news_follow,
|
||||
f?XmxSensitive:XmxNotSensitive);
|
||||
/* set the popup too */
|
||||
mo_popup_set_something("Previous Thread",
|
||||
mo_popup_set_something("Previous Thread",
|
||||
pt?XmxSensitive:XmxNotSensitive, NULL);
|
||||
mo_popup_set_something("Next Thread",
|
||||
nt?XmxSensitive:XmxNotSensitive, NULL);
|
||||
mo_popup_set_something("Previous Article",
|
||||
p?XmxSensitive:XmxNotSensitive, NULL);
|
||||
mo_popup_set_something("Next Article",
|
||||
mo_popup_set_something("Previous Article",
|
||||
p?XmxSensitive:XmxNotSensitive, NULL);
|
||||
mo_popup_set_something("Next Article",
|
||||
n?XmxSensitive:XmxNotSensitive, NULL);
|
||||
mo_popup_set_something("Followup",
|
||||
f?XmxSensitive:XmxNotSensitive, NULL);
|
||||
newmode = moMODE_NEWS;
|
||||
}
|
||||
}
|
||||
if(newmode != win->mode) {
|
||||
win->mode = newmode;
|
||||
mo_switch_mode(win);
|
||||
@@ -430,7 +430,7 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
NULL);
|
||||
XmStringFree (xmstr);
|
||||
}
|
||||
|
||||
|
||||
/* If !register_visit, we're just screwing around with current_node
|
||||
already, so don't bother snarfing scrollbar values. */
|
||||
if (register_visit)
|
||||
@@ -441,7 +441,7 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
win->cached_url = cached_url;
|
||||
|
||||
mo_here_we_are_son (url);
|
||||
|
||||
|
||||
{
|
||||
/* Since mo_fetch_annotation_links uses the communications code,
|
||||
we need to play games with binary_transfer. */
|
||||
@@ -488,8 +488,8 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
|
||||
/* vvv HREF ListBox Stuff -- BJS 10/2/95 */
|
||||
if(win->links_win) mo_update_links_window(win);
|
||||
|
||||
|
||||
|
||||
|
||||
if (win->target_anchor)
|
||||
free (win->target_anchor);
|
||||
|
||||
@@ -553,13 +553,13 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
mo_back_possible (win);
|
||||
else
|
||||
mo_back_impossible (win);
|
||||
|
||||
|
||||
if (win->current_node && win->current_node->next != NULL)
|
||||
mo_forward_possible (win);
|
||||
else
|
||||
mo_forward_impossible (win);
|
||||
|
||||
if (win->current_node &&
|
||||
if (win->current_node &&
|
||||
mo_is_editable_annotation (win, win->current_node->text))
|
||||
mo_annotate_edit_possible (win);
|
||||
else
|
||||
@@ -584,7 +584,7 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
win->delay_image_loads = 0;
|
||||
did_we_image_delay=0;
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -594,12 +594,12 @@ mo_status mo_do_window_text (mo_window *win, char *url, char *txt,
|
||||
* purpose: Given a window and a node, set the window's current node.
|
||||
* This assumes node is already all put together, in the history
|
||||
* list for the window, etc.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* - mo_node *node: The node to use.
|
||||
* returns:
|
||||
* returns:
|
||||
* Result of calling mo_do_window_text.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This routine is meant to be used to move forward, backward,
|
||||
* and to arbitrarily locations in the history list.
|
||||
****************************************************************************/
|
||||
@@ -608,7 +608,7 @@ mo_status mo_set_win_current_node (mo_window *win, mo_node *node)
|
||||
void *to_free = NULL;
|
||||
mo_status r;
|
||||
Widget pix_free;
|
||||
|
||||
|
||||
mo_snarf_scrollbar_values (win);
|
||||
|
||||
pix_free = win->scrolled_win;
|
||||
@@ -629,8 +629,8 @@ mo_status mo_set_win_current_node (mo_window *win, mo_node *node)
|
||||
MoCCISendAnchorToCCI(win->current_node->url, 0);
|
||||
/*****************************************************/
|
||||
|
||||
r = mo_do_window_text (win, win->current_node->url,
|
||||
win->current_node->text,
|
||||
r = mo_do_window_text (win, win->current_node->url,
|
||||
win->current_node->text,
|
||||
win->current_node->texthead,
|
||||
FALSE, win->current_node->ref,
|
||||
win->current_node->last_modified,
|
||||
@@ -652,25 +652,25 @@ mo_status mo_set_win_current_node (mo_window *win, mo_node *node)
|
||||
* name: mo_reload_window_text
|
||||
* purpose: Reload the current window's text by pulling it over the
|
||||
* network again.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This frees the current window's texthead. This calls mo_pull_er_over
|
||||
* directly, and needs to be smarter about handling HDF, etc.
|
||||
****************************************************************************/
|
||||
mo_status mo_reload_window_text (mo_window *win, int reload_images_also)
|
||||
{
|
||||
static Boolean did_we_image_delay=0;
|
||||
|
||||
|
||||
mo_busy ();
|
||||
|
||||
mo_set_current_cached_win (win);
|
||||
|
||||
/* Uh oh, this is trouble... */
|
||||
if (!win->current_node)
|
||||
return mo_load_window_text
|
||||
return mo_load_window_text
|
||||
(win, startup_document ? startup_document : home_document, NULL);
|
||||
|
||||
/* Free all images in the current document. */
|
||||
@@ -697,7 +697,7 @@ mo_status mo_reload_window_text (mo_window *win, int reload_images_also)
|
||||
reloading=1;
|
||||
}
|
||||
|
||||
win->current_node->text = mo_pull_er_over (win->current_node->url,
|
||||
win->current_node->text = mo_pull_er_over (win->current_node->url,
|
||||
&win->current_node->texthead);
|
||||
|
||||
|
||||
@@ -723,17 +723,17 @@ mo_status mo_reload_window_text (mo_window *win, int reload_images_also)
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_HDF
|
||||
if (win->current_node->text &&
|
||||
if (win->current_node->text &&
|
||||
strncmp (win->current_node->text, "<mosaic-internal-reference", 26) == 0)
|
||||
{
|
||||
char *text = mo_decode_internal_reference
|
||||
char *text = mo_decode_internal_reference
|
||||
(win->current_node->url, win->current_node->text,
|
||||
mo_url_extract_anchor (win->current_node->url));
|
||||
win->current_node->text = text;
|
||||
win->current_node->texthead = text;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* Clear out the cached stuff, if any exists. */
|
||||
win->reloading = 1;
|
||||
|
||||
@@ -743,7 +743,7 @@ mo_status mo_reload_window_text (mo_window *win, int reload_images_also)
|
||||
|
||||
/* If news: URL, then we need to auto-scroll to the >>> marker if it
|
||||
is here. We use a hacked version of the searching function here
|
||||
which will need to be updated when we rewrite. --SWP
|
||||
which will need to be updated when we rewrite. --SWP
|
||||
*/
|
||||
|
||||
if (win->current_node &&
|
||||
@@ -760,11 +760,11 @@ mo_status mo_reload_window_text (mo_window *win, int reload_images_also)
|
||||
/****************************************************************************
|
||||
* name: mo_refresh_window_text
|
||||
* purpose: Reload the current window's text without pulling it over the net.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
****************************************************************************/
|
||||
mo_status mo_refresh_window_text (mo_window *win)
|
||||
{
|
||||
@@ -795,14 +795,14 @@ mo_status mo_refresh_window_text (mo_window *win)
|
||||
* name: mo_load_window_text
|
||||
* purpose: Given a window and a raw URL, load the window. The window
|
||||
* is assumed to already exist with a document inside, etc.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* - char *url: The URL to load.
|
||||
* - char *ref: The reference ("parent") URL.
|
||||
* NOTE: actually, the ref field is the citation hypertext - AMB
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This is getting ugly.
|
||||
****************************************************************************/
|
||||
mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
@@ -824,9 +824,9 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
} else {
|
||||
newtexthead = newtext;
|
||||
goto special_urls;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* If we're just referencing an anchor inside a document,
|
||||
do the right thing. */
|
||||
if (url && *url == '#')
|
||||
@@ -848,7 +848,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
newtexthead = newtext;
|
||||
}
|
||||
}
|
||||
url = mo_url_canonicalize_keep_anchor
|
||||
url = mo_url_canonicalize_keep_anchor
|
||||
(url, win->current_node ? win->current_node->url : "");
|
||||
/********* Send Anchor history to CCI if CCI wants it */
|
||||
MoCCISendAnchorToCCI(url, 1);
|
||||
@@ -874,16 +874,16 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
|
||||
|
||||
/* ADC ZZZZ ugly hack below: */
|
||||
|
||||
|
||||
CCIprotocol_handler_found = 0;
|
||||
|
||||
|
||||
/********* Send Anchor history to CCI if CCI wants to handle it */
|
||||
MoCCISendAnchorToCCI(url,3);
|
||||
/*****************************************************/
|
||||
|
||||
|
||||
if (CCIprotocol_handler_found)
|
||||
return return_stat; /* success */
|
||||
|
||||
|
||||
|
||||
|
||||
/********* Send Anchor history to CCI if CCI wants it */
|
||||
@@ -891,19 +891,19 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
/*****************************************************/
|
||||
newtext = mo_pull_er_over (canon, &newtexthead);
|
||||
|
||||
/*
|
||||
/*
|
||||
* added so MCCIRequestGetURL could return failed when
|
||||
* url fails
|
||||
*/
|
||||
if (newtext)
|
||||
if ( (!strncmp(newtext, "<H1>ERROR<H1>", 10)) ||
|
||||
(!strncmp(newtext,
|
||||
(!strncmp(newtext,
|
||||
"<HEAD><TITLE>404 Not Found</TITLE></HEAD>",
|
||||
28)))
|
||||
return_stat = mo_fail;
|
||||
|
||||
/* Yes this is a really big hack (ETG) */
|
||||
if (win->target_anchor && *(win->target_anchor))
|
||||
if (win->target_anchor && *(win->target_anchor))
|
||||
MoCCIAddAnchorToURL(canon, url);
|
||||
|
||||
/* AF */
|
||||
@@ -923,7 +923,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
{
|
||||
mo_here_we_are_son (url);
|
||||
url = use_this_url_instead;
|
||||
|
||||
|
||||
/* Go get another target_anchor. */
|
||||
if (win->target_anchor)
|
||||
free (win->target_anchor);
|
||||
@@ -973,7 +973,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
if (win->target_anchor)
|
||||
free (win->target_anchor);
|
||||
win->target_anchor = NULL;
|
||||
|
||||
|
||||
mo_gui_done_with_icon ();
|
||||
mo_not_busy ();
|
||||
}
|
||||
@@ -990,8 +990,8 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Now, if it's a telnet session, there should be no need
|
||||
to do anything else. Also check for override in text itself. */
|
||||
if (strncmp (url, "telnet:", 7) == 0 ||
|
||||
@@ -1002,7 +1002,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
/* We don't need this anymore. */
|
||||
free (newtext);
|
||||
|
||||
/* We still want a global history entry but NOT a
|
||||
/* We still want a global history entry but NOT a
|
||||
window history entry. */
|
||||
mo_here_we_are_son (url);
|
||||
/* ... and we want to redisplay the current window to
|
||||
@@ -1014,14 +1014,14 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
}
|
||||
else if (newtext)
|
||||
{
|
||||
|
||||
|
||||
/* Not a telnet session and not an override, but text present
|
||||
(the "usual" case): */
|
||||
|
||||
/* first check if we are using cci Get, if so, don't display
|
||||
the error message */
|
||||
|
||||
if (cci_get && (return_stat == mo_fail) )
|
||||
if (cci_get && (return_stat == mo_fail) )
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
@@ -1034,7 +1034,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
{
|
||||
special_urls:
|
||||
/* Set the window text. */
|
||||
mo_do_window_text (win, url, newtext, newtexthead, (do_meta==1?0:2),
|
||||
mo_do_window_text (win, url, newtext, newtexthead, (do_meta==1?0:2),
|
||||
ref, last_modified, expires);
|
||||
}
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
|
||||
/* first check if we are using cci Get, if so, don't display
|
||||
the error message */
|
||||
if (cci_get && (return_stat == mo_fail) )
|
||||
if (cci_get && (return_stat == mo_fail) )
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
@@ -1087,8 +1087,8 @@ mo_status mo_load_window_text (mo_window *win, char *url, char *ref)
|
||||
}
|
||||
|
||||
|
||||
static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
char *content_type, char *post_data,
|
||||
static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
char *content_type, char *post_data,
|
||||
char *ref)
|
||||
{
|
||||
char *newtext = NULL, *newtexthead = NULL, *actionID;
|
||||
@@ -1120,7 +1120,7 @@ static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
newtexthead = newtext;
|
||||
}
|
||||
}
|
||||
url = mo_url_canonicalize_keep_anchor
|
||||
url = mo_url_canonicalize_keep_anchor
|
||||
(url, win->current_node ? win->current_node->url : "");
|
||||
}
|
||||
else
|
||||
@@ -1142,7 +1142,7 @@ static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
interrupted = 0;
|
||||
|
||||
if (!MoCCIFormToClient(actionID, NULL, content_type, post_data, 0))
|
||||
newtext = mo_post_pull_er_over (canon, content_type,
|
||||
newtext = mo_post_pull_er_over (canon, content_type,
|
||||
post_data, &newtexthead);
|
||||
free (canon);
|
||||
}
|
||||
@@ -1220,7 +1220,7 @@ static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
/* We don't need this anymore. */
|
||||
free (newtext);
|
||||
|
||||
/* We still want a global history entry but NOT a
|
||||
/* We still want a global history entry but NOT a
|
||||
window history entry. */
|
||||
mo_here_we_are_son (url);
|
||||
/* ... and we want to redisplay the current window to
|
||||
@@ -1263,12 +1263,12 @@ static mo_status mo_post_load_window_text (mo_window *win, char *url,
|
||||
* name: mo_duplicate_window_text
|
||||
* purpose: Given an old window and a new window, make a copy of the text
|
||||
* in the old window and install it in the new window.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *oldw: The old window.
|
||||
* - mo_window *neww: The new window.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This is how windows are cloned: a new window is created and this
|
||||
* call sets up its contents.
|
||||
****************************************************************************/
|
||||
@@ -1283,9 +1283,9 @@ mo_status mo_duplicate_window_text (mo_window *oldw, mo_window *neww)
|
||||
|
||||
newtext = strdup (oldw->current_node->text);
|
||||
|
||||
mo_do_window_text
|
||||
(neww, strdup (oldw->current_node->url),
|
||||
newtext, newtext, TRUE,
|
||||
mo_do_window_text
|
||||
(neww, strdup (oldw->current_node->url),
|
||||
newtext, newtext, TRUE,
|
||||
oldw->current_node->ref ? strdup (oldw->current_node->ref) : NULL,
|
||||
oldw->current_node->last_modified,
|
||||
oldw->current_node->expires);
|
||||
@@ -1296,14 +1296,14 @@ mo_status mo_duplicate_window_text (mo_window *oldw, mo_window *neww)
|
||||
|
||||
/****************************************************************************
|
||||
* name: mo_access_document
|
||||
* purpose: Given a URL, access the document by loading the current
|
||||
* purpose: Given a URL, access the document by loading the current
|
||||
* window's text.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - mo_window *win: The current window.
|
||||
* - char *url: URL to access.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This should be the standard call for accessing a document.
|
||||
****************************************************************************/
|
||||
mo_status mo_access_document (mo_window *win, char *url)
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -75,7 +75,7 @@ static XmxCallback (links_win_cb)
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
int *posns, pcount;
|
||||
char *text,*fnam,*url;
|
||||
|
||||
|
||||
switch (XmxExtractToken ((int)client_data)){
|
||||
case 0: /* GOTO */
|
||||
if(XmListGetSelectedPos(win->links_list, &posns, &pcount)){
|
||||
@@ -94,7 +94,7 @@ static XmxCallback (links_win_cb)
|
||||
return;
|
||||
case 3:
|
||||
if(XmListGetSelectedPos(win->links_list, &posns, &pcount)){
|
||||
|
||||
|
||||
if(pcount && XmStringGetLtoR(win->links_items[posns[0]-1],
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&text)){
|
||||
@@ -109,18 +109,18 @@ static XmxCallback (links_win_cb)
|
||||
XtFree(text);
|
||||
}
|
||||
XtFree((char *)posns);
|
||||
|
||||
|
||||
}
|
||||
|
||||
mo_gui_done_with_icon();
|
||||
|
||||
return;
|
||||
return;
|
||||
case 1: /* DISMISS */
|
||||
XtUnmanageChild (win->links_win);
|
||||
break;
|
||||
case 2: /* HELP */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-links.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -134,7 +134,7 @@ static void links_list_cb(Widget w, XtPointer client, XtPointer call)
|
||||
mo_window *win = (mo_window *) client;
|
||||
char *text;
|
||||
XmListCallbackStruct *cs = (XmListCallbackStruct *) call;
|
||||
|
||||
|
||||
if(XmStringGetLtoR(win->links_items[cs->item_position-1],
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&text)){
|
||||
@@ -144,7 +144,7 @@ static void links_list_cb(Widget w, XtPointer client, XtPointer call)
|
||||
}
|
||||
|
||||
/* Don't unmanage the list. */
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -153,31 +153,31 @@ mo_status mo_post_links_window(mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget links_form, list, scroller, label;
|
||||
|
||||
|
||||
if (!win->links_win)
|
||||
{
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
|
||||
Xmx_n = 0;
|
||||
win->links_win = XmxMakeFormDialog
|
||||
win->links_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Document Links" );
|
||||
dialog_frame = XmxMakeFrame (win->links_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
links_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (links_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndFourButtons
|
||||
(links_form, links_win_cb,
|
||||
"Goto URL" , "Save" ,
|
||||
"Dismiss" , "Help..." ,
|
||||
(links_form, links_win_cb,
|
||||
"Goto URL" , "Save" ,
|
||||
"Dismiss" , "Help..." ,
|
||||
0, 3, 1, 2);
|
||||
|
||||
label = XtVaCreateManagedWidget("Document Links & Images ..." ,
|
||||
@@ -189,7 +189,7 @@ mo_status mo_post_links_window(mo_window *win)
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNtopOffset, 2,
|
||||
NULL);
|
||||
|
||||
|
||||
scroller = XtVaCreateWidget("scroller",
|
||||
xmScrolledWindowWidgetClass,
|
||||
links_form,
|
||||
@@ -207,8 +207,8 @@ mo_status mo_post_links_window(mo_window *win)
|
||||
XmNleftOffset, 8,
|
||||
XmNrightOffset, 8,
|
||||
NULL);
|
||||
|
||||
list = XtVaCreateManagedWidget("list", xmListWidgetClass,
|
||||
|
||||
list = XtVaCreateManagedWidget("list", xmListWidgetClass,
|
||||
scroller,
|
||||
XmNvisibleItemCount, 10,
|
||||
XmNresizable, False,
|
||||
@@ -217,28 +217,28 @@ mo_status mo_post_links_window(mo_window *win)
|
||||
NULL);
|
||||
|
||||
XtAddCallback(list, XmNdefaultActionCallback, links_list_cb, (XtPointer) win);
|
||||
|
||||
|
||||
win->links_list = list;
|
||||
win->links_items = NULL;
|
||||
win->links_count = 0;
|
||||
|
||||
|
||||
XtManageChild(scroller);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
|
||||
XmxSetConstraints
|
||||
(buttons_form,
|
||||
XmxSetConstraints
|
||||
(buttons_form,
|
||||
XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
XmxManageRemanage (win->links_win);
|
||||
mo_update_links_window(win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ mo_status mo_update_links_window(mo_window *win)
|
||||
imgs = HTMLGetImageSrcs(win->scrolled_win,&icount);
|
||||
|
||||
count = icount + hcount;
|
||||
|
||||
|
||||
if(!count){
|
||||
XtVaSetValues(win->links_list,
|
||||
XmNitemCount, 0,
|
||||
@@ -288,14 +288,14 @@ mo_status mo_update_links_window(mo_window *win)
|
||||
XmNitemCount, count,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
if(win->links_count) {
|
||||
XtFree((char *)(win->links_items));
|
||||
XtFree((char *)(win->links_items));
|
||||
}
|
||||
|
||||
win->links_count = count;
|
||||
win->links_items = xmstr;
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -342,7 +342,7 @@ struct {
|
||||
{"help","0http://www.ncsa.uiuc.edu/SDG/Software/mosaic-x/"},
|
||||
/* places & organizations */
|
||||
{"acm","0http://www.acm.uiuc.edu/"},
|
||||
{"ncsa","0http://www.ncsa.uiuc.edu/"},
|
||||
{"ncsa","0http://www.ncsa.uiuc.edu/"},
|
||||
{"sdg","0http://sdg.ncsa.uiuc.edu/"},
|
||||
{"uiuc","0http://www.uiuc.edu/"},
|
||||
/* for fun */
|
||||
@@ -354,7 +354,7 @@ struct {
|
||||
"<TITLE>Are you lost?</TITLE><H1>Surely you jest?</H1>"},
|
||||
{NULL,NULL}
|
||||
};
|
||||
|
||||
|
||||
/* assorted FUN things */
|
||||
char *mo_special_urls(char *url)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ char *mo_special_urls(char *url)
|
||||
if(!url) return NULL;
|
||||
|
||||
if(strncmp(url,"about:",6)) return NULL;
|
||||
|
||||
|
||||
for(i=0;abouts[i].name;i++) {
|
||||
if(!strncmp(&url[6],abouts[i].name,strlen(abouts[i].name))) {
|
||||
if(abouts[i].expand[0]=='0')
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -67,8 +67,8 @@
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite);
|
||||
|
||||
|
||||
/* gui-ftp handles all of the gui bits of the FTP send, remove, and mkdir
|
||||
functionality. All of the actual transfer stuff is in libwww2/HTFTP.c
|
||||
/* gui-ftp handles all of the gui bits of the FTP send, remove, and mkdir
|
||||
functionality. All of the actual transfer stuff is in libwww2/HTFTP.c
|
||||
*/
|
||||
|
||||
/*--------------------- mo_handle_ftpput ---------------------------------*/
|
||||
@@ -86,12 +86,12 @@ mo_status mo_handle_ftpput(mo_window *win)
|
||||
win->ftp_site = strdup(win->current_node->url);
|
||||
mo_post_ftpput_window(win);
|
||||
} else {
|
||||
sprintf(tbuf, "FTP Send requires you to be on a page with an FTP url.");
|
||||
sprintf(tbuf, "FTP Send requires you to be on a page with an FTP url.");
|
||||
application_user_info_wait(tbuf);
|
||||
return mo_fail;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
/* ---------------------- mo_post_ftpput_window ----------------------- */
|
||||
static XmxCallback (ftpput_win_cb)
|
||||
@@ -103,7 +103,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
XmString st;
|
||||
XmStringTable selected_items;
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
|
||||
|
||||
XtUnmanageChild (win->ftpput_win); /* Down with the box */
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
XtVaGetValues (fsbList,
|
||||
@@ -115,7 +115,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
for (i=0; i<count; i++) {
|
||||
XmStringGetLtoR (selected_items[i], XmSTRING_DEFAULT_CHARSET, &fname);
|
||||
pathEval (efname, fname);
|
||||
XtFree (fname);
|
||||
XtFree (fname);
|
||||
/* Make the url something HTFTPSend will understand */
|
||||
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
|
||||
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
|
||||
@@ -135,7 +135,7 @@ static XmxCallback (ftpput_win_cb)
|
||||
NULL);
|
||||
XmStringGetLtoR (st, XmSTRING_DEFAULT_CHARSET, &fname);
|
||||
pathEval (efname, fname);
|
||||
XtFree (fname);
|
||||
XtFree (fname);
|
||||
sprintf (tbuf, "%s&%s", win->ftp_site, efname);
|
||||
if ((ret = HTFTPSend (tbuf)) != 0) { /* !HT_LOADED */
|
||||
if (ret != -2) { /* If the user interrupted us, forget about telling them */
|
||||
@@ -147,8 +147,8 @@ static XmxCallback (ftpput_win_cb)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Clear out the selections, we have to do this because the XmFSB has no clue
|
||||
|
||||
/* Clear out the selections, we have to do this because the XmFSB has no clue
|
||||
it is being used in extended selection mode. */
|
||||
XmListDeselectAllItems(fsbList);
|
||||
free(win->ftp_site);
|
||||
@@ -160,7 +160,7 @@ mo_status mo_post_ftpput_window (mo_window *win)
|
||||
{
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
Widget fsbList;
|
||||
|
||||
|
||||
if( win->ftp_site == NULL ) {
|
||||
return mo_fail;
|
||||
}
|
||||
@@ -171,14 +171,14 @@ mo_status mo_post_ftpput_window (mo_window *win)
|
||||
{
|
||||
win->ftpput_win = XmxMakeFileSBDialog(win->base, tbuf, "Name of local file to send:", ftpput_win_cb, 0);
|
||||
/* Change the selection mode */
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
fsbList = XmFileSelectionBoxGetChild (win->ftpput_win, XmDIALOG_LIST);
|
||||
XtVaSetValues (fsbList,
|
||||
XmNselectionPolicy, XmEXTENDED_SELECT,
|
||||
NULL);
|
||||
} else {
|
||||
XmFileSelectionDoSearch (win->ftpput_win, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->ftpput_win);
|
||||
return mo_succeed;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ mo_status mo_handle_ftpmkdir(mo_window *win)
|
||||
{
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
|
||||
if (!win->current_node)
|
||||
if (!win->current_node)
|
||||
return mo_fail;
|
||||
|
||||
/* Check to see if the url is somethin' like ftp://somewarez.31337.com */
|
||||
@@ -197,12 +197,12 @@ mo_status mo_handle_ftpmkdir(mo_window *win)
|
||||
win->ftp_site = strdup(win->current_node->url);
|
||||
mo_post_ftpmkdir_window(win);
|
||||
} else {
|
||||
sprintf(tbuf, "FTP MkDir requires you to be on a page with an FTP url.");
|
||||
sprintf(tbuf, "FTP MkDir requires you to be on a page with an FTP url.");
|
||||
application_user_info_wait(tbuf);
|
||||
return mo_fail;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
/*--------------------- mo_post_ftpmkdir_window ---------------------------------*/
|
||||
static XmxCallback (ftpmkdir_win_cb)
|
||||
@@ -212,7 +212,7 @@ static XmxCallback (ftpmkdir_win_cb)
|
||||
int ret;
|
||||
|
||||
switch (XmxExtractToken ((int)client_data)) {
|
||||
|
||||
|
||||
case 0: /* Create dir */
|
||||
XtUnmanageChild (win->ftpmkdir_win);
|
||||
dirpath = XmxTextGetString (win->ftpmkdir_text);
|
||||
@@ -252,29 +252,29 @@ mo_status mo_post_ftpmkdir_window (mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget form, label;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->ftpmkdir_win = XmxMakeFormDialog (win->base, "NCSA Mosaic: FTP MkDir");
|
||||
dialog_frame = XmxMakeFrame (win->ftpmkdir_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
label = XmxMakeLabel (form, "Directory to Create: ");
|
||||
XmxSetArg (XmNwidth, 310);
|
||||
win->ftpmkdir_text = XmxMakeTextField (form);
|
||||
XmxAddCallbackToText (win->ftpmkdir_text, ftpmkdir_win_cb, 0);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndFourButtons
|
||||
(form, ftpmkdir_win_cb, "Create", "Clear", "Dismiss", "Help...",
|
||||
(form, ftpmkdir_win_cb, "Create", "Clear", "Dismiss", "Help...",
|
||||
0, 3, 1, 2);
|
||||
|
||||
/* Constraints for form. */
|
||||
@@ -287,24 +287,24 @@ mo_status mo_post_ftpmkdir_window (mo_window *win)
|
||||
(win->ftpmkdir_text, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, NULL, NULL, label, NULL);
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
win->ftpmkdir_text, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->ftpmkdir_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------- mo_handle_ftpremove ----------------------- */
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite)
|
||||
static mo_status mo_handle_ftpremove (mo_window *win, char *urlNsite)
|
||||
{
|
||||
int ret;
|
||||
char tbuf[MAX_BUF_LEN+1];
|
||||
@@ -328,16 +328,16 @@ void ftp_rmbm_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
char *xurl, tbuf[MAX_BUF_LEN+1];
|
||||
extern mo_window *current_win;
|
||||
struct ele_rec *eptr;
|
||||
|
||||
|
||||
which = acst->act_code;
|
||||
eptr = acst->eptr;
|
||||
|
||||
|
||||
switch(which) {
|
||||
|
||||
case mo_ftp_put:
|
||||
mo_handle_ftpput (current_win);
|
||||
break;
|
||||
|
||||
|
||||
case mo_ftp_mkdir:
|
||||
mo_handle_ftpmkdir (current_win);
|
||||
break;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -69,10 +69,10 @@
|
||||
|
||||
mo_status mo_handle_ftpput(mo_window *win);
|
||||
mo_status mo_handle_ftpmkdir(mo_window *win);
|
||||
mo_status mo_post_ftpput_window(mo_window *);
|
||||
mo_status mo_post_ftpremove_window(mo_window *);
|
||||
mo_status mo_post_ftpmkdir_window(mo_window *);
|
||||
mo_status mo_post_ftpbar_window(mo_window *);
|
||||
mo_status mo_post_ftpput_window(mo_window *);
|
||||
mo_status mo_post_ftpremove_window(mo_window *);
|
||||
mo_status mo_post_ftpmkdir_window(mo_window *);
|
||||
mo_status mo_post_ftpbar_window(mo_window *);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -133,7 +133,7 @@ static XmxCallback (exit_confirm_cb)
|
||||
mo_exit ();
|
||||
else
|
||||
XtUnmanageChild (w);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ mo_status mo_set_underlines (mo_window *win, int choice)
|
||||
WbNanchorUnderlines, &(win->underlines),
|
||||
WbNvisitedAnchorUnderlines, &(win->visited_underlines),
|
||||
WbNdashedAnchorUnderlines, &(win->dashed_underlines),
|
||||
WbNdashedVisitedAnchorUnderlines,
|
||||
WbNdashedVisitedAnchorUnderlines,
|
||||
&(win->dashed_visited_underlines),
|
||||
NULL);
|
||||
win->underlines_snarfed = 1;
|
||||
@@ -482,7 +482,7 @@ mo_status mo_set_underlines (mo_window *win, int choice)
|
||||
XmxSetArg (WbNanchorUnderlines, win->underlines);
|
||||
XmxSetArg (WbNvisitedAnchorUnderlines, win->visited_underlines);
|
||||
XmxSetArg (WbNdashedAnchorUnderlines, win->dashed_underlines);
|
||||
XmxSetArg (WbNdashedVisitedAnchorUnderlines,
|
||||
XmxSetArg (WbNdashedVisitedAnchorUnderlines,
|
||||
win->dashed_visited_underlines);
|
||||
XmxSetValues (win->scrolled_win);
|
||||
break;
|
||||
@@ -519,7 +519,7 @@ mo_status mo_set_underlines (mo_window *win, int choice)
|
||||
XmxRSetToggleState (win->menubar, win->underlines_state, XmxNotSet);
|
||||
XmxRSetToggleState (win->menubar, choice, XmxSet);
|
||||
win->underlines_state = choice;
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ mo_status mo_set_underlines (mo_window *win, int choice)
|
||||
static XmxCallback (clear_history_confirm_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
|
||||
|
||||
if (XmxExtractToken ((int)client_data))
|
||||
{
|
||||
mo_window *w = NULL;
|
||||
@@ -539,7 +539,7 @@ static XmxCallback (clear_history_confirm_cb)
|
||||
}
|
||||
else
|
||||
XtUnmanageChild (w);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -558,9 +558,9 @@ static mo_status mo_do_delete_annotation (mo_window *win)
|
||||
{
|
||||
mo_grok_pan_pieces (win->current_node->url,
|
||||
win->current_node->text,
|
||||
&title, &author, &text,
|
||||
&title, &author, &text,
|
||||
&id, &fname);
|
||||
|
||||
|
||||
mo_delete_annotation (win, id);
|
||||
}
|
||||
else if (win->current_node->annotation_type == mo_annotation_workgroup)
|
||||
@@ -580,10 +580,10 @@ static XmxCallback (delete_annotation_confirm_cb)
|
||||
|
||||
if (!mo_is_editable_annotation (win, win->current_node->text))
|
||||
return;
|
||||
|
||||
|
||||
if (XmxExtractToken ((int)client_data))
|
||||
mo_do_delete_annotation (win);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ int i = XmxExtractToken ((int)client_data);
|
||||
mo_set_agents(win,i);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* ------------------------------ menubar_cb ------------------------------ */
|
||||
|
||||
@@ -630,7 +630,7 @@ XmxCallback (menubar_cb)
|
||||
win = current_win;
|
||||
eptr = acst->eptr;
|
||||
}
|
||||
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case mo_reload_document:
|
||||
@@ -749,7 +749,7 @@ XmxCallback (menubar_cb)
|
||||
mo_access_document (win, NETWORK_STARTING_POINTS_DEFAULT);
|
||||
break;
|
||||
case mo_internet_metaindex:
|
||||
if (cci_event)
|
||||
if (cci_event)
|
||||
MoCCISendEventOutput(NAVIGATE_INTERNET_RESOURCES_META_INDEX);
|
||||
mo_access_document (win, INTERNET_METAINDEX_DEFAULT);
|
||||
break;
|
||||
@@ -810,7 +810,7 @@ XmxCallback (menubar_cb)
|
||||
}
|
||||
mo_rbm_myself_to_death(win,0);
|
||||
break;
|
||||
/* removed 5/17/96 - bjs
|
||||
/* removed 5/17/96 - bjs
|
||||
case mo_fancy_selections:
|
||||
win->pretty = 1 - win->pretty;
|
||||
mo_set_fancy_selections_toggle (win);
|
||||
@@ -848,8 +848,8 @@ XmxCallback (menubar_cb)
|
||||
(win->binary_transfer ? 0 : 1);
|
||||
if (cci_event)
|
||||
{
|
||||
if (win->binary_transfer)
|
||||
MoCCISendEventOutput(OPTIONS_LOAD_TO_LOCAL_DISK_ON);
|
||||
if (win->binary_transfer)
|
||||
MoCCISendEventOutput(OPTIONS_LOAD_TO_LOCAL_DISK_ON);
|
||||
else
|
||||
MoCCISendEventOutput(OPTIONS_LOAD_TO_LOCAL_DISK_OFF);
|
||||
}
|
||||
@@ -975,17 +975,17 @@ XmxCallback (menubar_cb)
|
||||
break;
|
||||
case mo_help_faq:
|
||||
if (cci_event) MoCCISendEventOutput(HELP_ON_FAQ);
|
||||
mo_open_another_window (win, mo_assemble_help_url ("mosaic-faq.html"),
|
||||
mo_open_another_window (win, mo_assemble_help_url ("mosaic-faq.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
case mo_help_html:
|
||||
if (cci_event) MoCCISendEventOutput(HELP_ON_HTML);
|
||||
mo_open_another_window (win, HTMLPRIMER_PAGE_DEFAULT,
|
||||
mo_open_another_window (win, HTMLPRIMER_PAGE_DEFAULT,
|
||||
NULL, NULL);
|
||||
break;
|
||||
case mo_help_url:
|
||||
if (cci_event) MoCCISendEventOutput(HELP_ON_URLS);
|
||||
mo_open_another_window (win, URLPRIMER_PAGE_DEFAULT,
|
||||
mo_open_another_window (win, URLPRIMER_PAGE_DEFAULT,
|
||||
NULL, NULL);
|
||||
break;
|
||||
#ifndef PRERELEASE
|
||||
@@ -995,18 +995,18 @@ XmxCallback (menubar_cb)
|
||||
CommentCard(win);
|
||||
break;
|
||||
#endif
|
||||
case mo_techsupport:
|
||||
case mo_techsupport:
|
||||
if (cci_event) MoCCISendEventOutput(HELP_MAIL_TECH_SUPPORT);
|
||||
|
||||
{
|
||||
char subj[128];
|
||||
|
||||
|
||||
sprintf (subj, "User Feedback -- NCSA Mosaic %s on %s.",
|
||||
MO_VERSION_STRING, MO_MACHINE_TYPE);
|
||||
|
||||
|
||||
mo_post_mailto_win(MO_DEVELOPER_ADDRESS,subj);
|
||||
}
|
||||
|
||||
|
||||
/* mo_post_techsupport_win (win);*/
|
||||
break;
|
||||
case mo_annotate:
|
||||
@@ -1101,7 +1101,7 @@ XmxCallback (menubar_cb)
|
||||
sprintf (buf, "news:*");
|
||||
mo_load_window_text (win, buf, NULL);
|
||||
break;
|
||||
|
||||
|
||||
case mo_news_mread:
|
||||
gui_news_markGroupRead (win);
|
||||
break;
|
||||
@@ -1182,21 +1182,21 @@ XmxCallback (menubar_cb)
|
||||
{
|
||||
char *author, *title, *text, *fname;
|
||||
int id;
|
||||
|
||||
|
||||
if (win->current_node->annotation_type == mo_annotation_private)
|
||||
{
|
||||
mo_grok_pan_pieces (win->current_node->url,
|
||||
win->current_node->text,
|
||||
&title, &author, &text,
|
||||
&title, &author, &text,
|
||||
&id, &fname);
|
||||
|
||||
|
||||
mo_post_annotate_win (win, 1, id, title, author, text, fname);
|
||||
}
|
||||
else if (win->current_node->annotation_type == mo_annotation_workgroup)
|
||||
{
|
||||
mo_grok_grpan_pieces (win->current_node->url,
|
||||
win->current_node->text,
|
||||
&title, &author, &text,
|
||||
&title, &author, &text,
|
||||
&id, &fname);
|
||||
mo_post_annotate_win (win, 1, id, title, author, text, fname);
|
||||
}
|
||||
@@ -1779,13 +1779,13 @@ char buf[BUFSIZ];
|
||||
|
||||
/* -------------------- mo_make_document_view_menubar --------------------- */
|
||||
|
||||
/* We now allow a single customizable menu.
|
||||
/* We now allow a single customizable menu.
|
||||
|
||||
First choice for the spec file is the value of the resource
|
||||
documentsMenuSpecfile.
|
||||
If that doesn't exist, second choice is the value of the
|
||||
environment variable MOSAIC_DOCUMENTS_MENU_SPECFILE.
|
||||
If *that* doesn't exist, third choice is specified in
|
||||
If *that* doesn't exist, third choice is specified in
|
||||
#define DOCUMENTS_MENU_SPECFILE. */
|
||||
|
||||
static mo_status mo_file_exists (char *filename)
|
||||
@@ -1793,7 +1793,7 @@ static mo_status mo_file_exists (char *filename)
|
||||
struct stat buf;
|
||||
int r;
|
||||
|
||||
r = stat (filename, &buf);
|
||||
r = stat (filename, &buf);
|
||||
if (r != -1)
|
||||
return mo_succeed;
|
||||
else
|
||||
@@ -1814,10 +1814,10 @@ static void mo_grok_menubar (char *filename)
|
||||
/* goto screwed_no_file;*/
|
||||
|
||||
/* Make the menu. */
|
||||
menu = (XmxMenubarStruct *) malloc
|
||||
menu = (XmxMenubarStruct *) malloc
|
||||
(MAX_DOCUMENTS_MENU_ITEMS * sizeof (XmxMenubarStruct));
|
||||
count = 0;
|
||||
|
||||
|
||||
/* File consists of alternating titles and URL's.
|
||||
A title consisting of at least two leading dashes
|
||||
is a separator. */
|
||||
@@ -1849,17 +1849,17 @@ static void mo_grok_menubar (char *filename)
|
||||
menu[count].func = (void (*)())menubar_cb;
|
||||
menu[count].data = count + DOCUMENTS_MENU_COUNT_OFFSET;
|
||||
menu[count].sub_menu = 0;
|
||||
|
||||
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
{
|
||||
/* Oops, something went wrong. */
|
||||
menu[count].namestr = 0;
|
||||
|
||||
|
||||
/* goto done;*/
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* There's a URL. */
|
||||
urllist[count] = strdup (line);
|
||||
urllist[count][strlen(line)-1] = '\0';
|
||||
@@ -1908,7 +1908,7 @@ static void mo_grok_menubar (char *filename)
|
||||
static void mo_try_to_grok_menubar (void)
|
||||
{
|
||||
char *filename = get_pref_string(eDOCUMENTS_MENU_SPECFILE);
|
||||
|
||||
|
||||
if (filename && mo_file_exists (filename))
|
||||
{
|
||||
mo_grok_menubar (filename);
|
||||
@@ -1948,7 +1948,7 @@ XmxMenuRecord *toBeReturned;
|
||||
mo_try_to_grok_menubar ();
|
||||
}
|
||||
|
||||
toBeReturned = XmxRMakeMenubar(form,
|
||||
toBeReturned = XmxRMakeMenubar(form,
|
||||
get_pref_boolean(eSIMPLE_INTERFACE) ?
|
||||
simple_menuspec : menuspec);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
134
src/gui-news.c
134
src/gui-news.c
@@ -2,7 +2,7 @@
|
||||
* NCSA Mosaic for the X Window System *
|
||||
* Software Development Group *
|
||||
* National Center for Supercomputing Applications *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* University of Illinois at Urbana-Champaign *
|
||||
* 605 E. Springfield, Champaign IL 61820 *
|
||||
* mosaic@ncsa.uiuc.edu *
|
||||
* *
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
#define MAX_BUF 512
|
||||
|
||||
void gui_news_post_subgroupwin (mo_window *win)
|
||||
void gui_news_post_subgroupwin (mo_window *win)
|
||||
{
|
||||
Widget w, f, b, s;
|
||||
XmString str;
|
||||
@@ -184,7 +184,7 @@ void gui_news_showGroups (mo_window *win)
|
||||
|
||||
void gui_news_showReadGroups (mo_window *win)
|
||||
{
|
||||
HTSetNewsConfig (-1,-1,0,1,-1,-1,-1,-1);
|
||||
HTSetNewsConfig (-1,-1,0,1,-1,-1,-1,-1);
|
||||
gui_news_updateprefs (win);
|
||||
mo_load_window_text (win, "news:*", NULL);
|
||||
}
|
||||
@@ -193,14 +193,14 @@ void gui_news_showAllArticles (mo_window *win)
|
||||
{
|
||||
char buf[512+1];
|
||||
|
||||
HTSetNewsConfig (-1,1,-1,-1,-1,-1,-1,-1);
|
||||
HTSetNewsConfig (-1,1,-1,-1,-1,-1,-1,-1);
|
||||
gui_news_updateprefs (win);
|
||||
|
||||
if (!NewsGroup && !NewsGroupS)
|
||||
return;
|
||||
if (NewsGroupS)
|
||||
sprintf (buf, "news:%s", NewsGroupS->name);
|
||||
else
|
||||
else
|
||||
sprintf (buf, "news:%s", NewsGroup);
|
||||
mo_load_window_text (win, buf, NULL);
|
||||
}
|
||||
@@ -209,14 +209,14 @@ void gui_news_showArticles (mo_window *win)
|
||||
{
|
||||
char buf[512+1];
|
||||
|
||||
HTSetNewsConfig (-1,0,-1,-1,-1,-1,-1,-1);
|
||||
HTSetNewsConfig (-1,0,-1,-1,-1,-1,-1,-1);
|
||||
gui_news_updateprefs (win);
|
||||
|
||||
if (!NewsGroup && !NewsGroupS)
|
||||
return;
|
||||
if (NewsGroup)
|
||||
sprintf (buf, "news:%s", NewsGroup);
|
||||
else
|
||||
else
|
||||
sprintf (buf, "news:%s", NewsGroupS->name);
|
||||
mo_load_window_text (win, buf, NULL);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ void gui_news_index(mo_window *win)
|
||||
newsrc_flush ();
|
||||
strcpy(url,win->current_node->url);
|
||||
news_index(url);
|
||||
if(url[0])
|
||||
if(url[0])
|
||||
mo_load_window_text(win,url,NULL);
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ static XmxCallback (include_fsb_cb)
|
||||
|
||||
XtUnmanageChild (win->news_fsb_win);
|
||||
fname = (char *)malloc (128 * sizeof (char));
|
||||
|
||||
|
||||
XmStringGetLtoR (((XmFileSelectionBoxCallbackStruct *)call_data)->value,
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&fname);
|
||||
@@ -347,8 +347,8 @@ static XmxCallback (include_fsb_cb)
|
||||
|
||||
sprintf(final,"\nUnable to Open Include File:\n %s\n\nOpen Error:\n %s\n" ,(!efname || !*efname?" ":efname),buf);
|
||||
|
||||
XmxMakeErrorDialog (win->news_win,
|
||||
final,
|
||||
XmxMakeErrorDialog (win->news_win,
|
||||
final,
|
||||
"News Include Error" );
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
@@ -358,14 +358,14 @@ static XmxCallback (include_fsb_cb)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
long pos;
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto done;
|
||||
|
||||
|
||||
XmTextInsert (win->news_text,
|
||||
pos = XmTextGetInsertionPosition (win->news_text),
|
||||
line);
|
||||
@@ -431,7 +431,7 @@ static XmxCallback (news_win_cb)
|
||||
break;
|
||||
case 2: /* HELP */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-news.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -445,13 +445,13 @@ static XmxCallback (news_win_cb)
|
||||
} else {
|
||||
XmFileSelectionDoSearch (win->news_fsb_win, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->news_fsb_win);
|
||||
|
||||
|
||||
break;
|
||||
case 4: /* QUOTE */
|
||||
break;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ static XmxCallback (follow_win_cb)
|
||||
if (msg[0] == '\0')
|
||||
return;
|
||||
|
||||
NNTPpost(from, subj, win->newsfollow_ref, group, msg);
|
||||
NNTPpost(from, subj, win->newsfollow_ref, group, msg);
|
||||
|
||||
free(msg);
|
||||
free(from);
|
||||
@@ -489,12 +489,12 @@ static XmxCallback (follow_win_cb)
|
||||
|
||||
case 1: /* DISMISS */
|
||||
|
||||
if(win->newsfollow_ref) free(win->newsfollow_ref);
|
||||
if(win->newsfollow_grp) free(win->newsfollow_grp);
|
||||
if(win->newsfollow_subj) free(win->newsfollow_subj);
|
||||
if(win->newsfollow_from) free(win->newsfollow_from);
|
||||
if(win->newsfollow_artid) free(win->newsfollow_artid);
|
||||
|
||||
if(win->newsfollow_ref) free(win->newsfollow_ref);
|
||||
if(win->newsfollow_grp) free(win->newsfollow_grp);
|
||||
if(win->newsfollow_subj) free(win->newsfollow_subj);
|
||||
if(win->newsfollow_from) free(win->newsfollow_from);
|
||||
if(win->newsfollow_artid) free(win->newsfollow_artid);
|
||||
|
||||
XtUnmanageChild (win->news_win);
|
||||
/* since we're going to re-use this in different configs
|
||||
we'll destroy it */
|
||||
@@ -505,7 +505,7 @@ static XmxCallback (follow_win_cb)
|
||||
break;
|
||||
case 2: /* HELP */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-news.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -519,9 +519,9 @@ static XmxCallback (follow_win_cb)
|
||||
} else {
|
||||
XmFileSelectionDoSearch (win->news_fsb_win, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->news_fsb_win);
|
||||
|
||||
|
||||
break;
|
||||
case 4: /* QUOTE */
|
||||
line = malloc(strlen(win->newsfollow_from)+30);
|
||||
@@ -530,7 +530,7 @@ static XmxCallback (follow_win_cb)
|
||||
XmTextInsert(win->news_text,
|
||||
pos = XmTextGetInsertionPosition (win->news_text),
|
||||
line);
|
||||
/* move insertion position to past this line to avoid
|
||||
/* move insertion position to past this line to avoid
|
||||
inserting the lines in reverse order */
|
||||
XmTextSetInsertionPosition (win->news_text, pos+strlen(line));
|
||||
|
||||
@@ -539,7 +539,7 @@ static XmxCallback (follow_win_cb)
|
||||
XmTextInsert(win->news_text,
|
||||
pos = XmTextGetInsertionPosition (win->news_text),
|
||||
line);
|
||||
/* move insertion position to past this line to avoid
|
||||
/* move insertion position to past this line to avoid
|
||||
inserting the lines in reverse order */
|
||||
XmTextSetInsertionPosition (win->news_text, pos+strlen(line));
|
||||
} while (line = NNTPgetquoteline(NULL));
|
||||
@@ -553,7 +553,7 @@ static XmxCallback (follow_win_cb)
|
||||
|
||||
mo_status mo_post_news_win (mo_window *win)
|
||||
{
|
||||
return mo_post_generic_news_win(win,0);
|
||||
return mo_post_generic_news_win(win,0);
|
||||
}
|
||||
|
||||
mo_status mo_post_follow_win (mo_window *win)
|
||||
@@ -562,16 +562,16 @@ mo_status mo_post_follow_win (mo_window *win)
|
||||
|
||||
if(strncmp("news:",win->current_node->url,5))
|
||||
return mo_fail; /* fix me */
|
||||
|
||||
|
||||
NNTPgetarthdrs(&(win->current_node->url)[5],
|
||||
&(win->newsfollow_ref),
|
||||
&(win->newsfollow_grp),
|
||||
&(win->newsfollow_subj),
|
||||
|
||||
NNTPgetarthdrs(&(win->current_node->url)[5],
|
||||
&(win->newsfollow_ref),
|
||||
&(win->newsfollow_grp),
|
||||
&(win->newsfollow_subj),
|
||||
&(win->newsfollow_from));
|
||||
|
||||
|
||||
/* add a re: if needed*/
|
||||
if(strncmp("Re: ",win->newsfollow_subj,4) &&
|
||||
if(strncmp("Re: ",win->newsfollow_subj,4) &&
|
||||
strncmp("re: ",win->newsfollow_subj,4)){
|
||||
s = malloc(strlen(win->newsfollow_subj)+5); /* this sucks -bjs*/
|
||||
sprintf(s,"Re: %s",win->newsfollow_subj);
|
||||
@@ -593,7 +593,7 @@ mo_status mo_post_follow_win (mo_window *win)
|
||||
free(win->newsfollow_ref);
|
||||
win->newsfollow_ref = s;
|
||||
}
|
||||
return mo_post_generic_news_win(win,1);
|
||||
return mo_post_generic_news_win(win,1);
|
||||
}
|
||||
|
||||
mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
@@ -605,25 +605,25 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
FILE *fp;
|
||||
long pos;
|
||||
|
||||
sprintf (namestr, "%s <%s>",
|
||||
sprintf (namestr, "%s <%s>",
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME),
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
|
||||
|
||||
if (!win->news_win)
|
||||
{
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
|
||||
Xmx_n = 0;
|
||||
win->news_win = XmxMakeFormDialog
|
||||
win->news_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: News" );
|
||||
dialog_frame = XmxMakeFrame (win->news_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
news_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
@@ -651,7 +651,7 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
XmxSetArg (XmNcolumns, 65);
|
||||
XmxSetArg (XmNeditable, False);
|
||||
win->news_text_from = XmxMakeText (news_form);
|
||||
|
||||
|
||||
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
|
||||
XmxSetArg (XmNscrolledWindowMarginHeight, 10);
|
||||
XmxSetArg (XmNcursorPositionVisible, True);
|
||||
@@ -659,21 +659,21 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
XmxSetArg (XmNeditMode, XmMULTI_LINE_EDIT);
|
||||
XmxSetArg (XmNrows, 30);
|
||||
XmxSetArg (XmNcolumns, 80);
|
||||
XmxSetArg (XmNwordWrap, True);
|
||||
XmxSetArg (XmNscrollHorizontal, False);
|
||||
XmxSetArg (XmNwordWrap, True);
|
||||
XmxSetArg (XmNscrollHorizontal, False);
|
||||
win->news_text = XmxMakeScrolledText (news_form);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (news_form);
|
||||
|
||||
|
||||
if(follow)
|
||||
buttons_form = XmxMakeFormAndFiveButtons
|
||||
(news_form, follow_win_cb,
|
||||
"Post" , "Quote" , "Include File..." , "Dismiss" , "Help..." ,
|
||||
(news_form, follow_win_cb,
|
||||
"Post" , "Quote" , "Include File..." , "Dismiss" , "Help..." ,
|
||||
0, 4, 3, 1, 2);
|
||||
else
|
||||
buttons_form = XmxMakeFormAndFourButtons
|
||||
(news_form, news_win_cb,
|
||||
"Post" , "Include File..." , "Dismiss" , "Help..." ,
|
||||
(news_form, news_win_cb,
|
||||
"Post" , "Include File..." , "Dismiss" , "Help..." ,
|
||||
0, 3, 1, 2);
|
||||
|
||||
|
||||
@@ -682,14 +682,14 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
|
||||
XmxSetOffsets (yap_label, 10, 20, 0, 0);
|
||||
XmxSetConstraints
|
||||
(yap_label,
|
||||
(yap_label,
|
||||
XmATTACH_FORM, XmATTACH_NONE ,XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
XmxSetOffsets (win->news_text_from, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->news_text_from,
|
||||
(win->news_text_from,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
yap_label, NULL, f_label, NULL);
|
||||
|
||||
@@ -701,7 +701,7 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
|
||||
XmxSetOffsets (win->news_text_subj, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->news_text_subj,
|
||||
(win->news_text_subj,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
win->news_text_from, NULL, s_label, NULL);
|
||||
|
||||
@@ -713,7 +713,7 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
|
||||
XmxSetOffsets (win->news_text_group, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->news_text_group,
|
||||
(win->news_text_group,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
win->news_text_subj, NULL, g_label, NULL);
|
||||
|
||||
@@ -725,23 +725,23 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
|
||||
XmxSetOffsets (XtParent (win->news_text), 10, 0, 3, 3);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->news_text),
|
||||
(XtParent (win->news_text),
|
||||
XmATTACH_WIDGET, XmATTACH_WIDGET,XmATTACH_FORM, XmATTACH_FORM,
|
||||
win->news_text_group, dialog_sep, NULL, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
|
||||
XmxSetConstraints
|
||||
(buttons_form,
|
||||
XmxSetConstraints
|
||||
(buttons_form,
|
||||
XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
XmxTextSetString (win->news_text, "");
|
||||
|
||||
|
||||
/* tack signature on the end if it exists - code from Martin Hamilton */
|
||||
if (get_pref_string(eSIGNATURE)) {
|
||||
XmxTextSetString (win->news_text, "\n\n");
|
||||
@@ -758,10 +758,10 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
} else {
|
||||
XmxTextSetString (win->news_text, "");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
XmTextSetInsertionPosition (win->news_text, 0);
|
||||
|
||||
|
||||
if(follow){
|
||||
XmxTextSetString (win->news_text_group, win->newsfollow_grp);
|
||||
XmxTextSetString (win->news_text_subj, win->newsfollow_subj);
|
||||
@@ -772,8 +772,8 @@ mo_status mo_post_generic_news_win(mo_window *win, int follow)
|
||||
XmxTextSetString (win->news_text_from, namestr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->news_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
214
src/gui-popup.c
214
src/gui-popup.c
@@ -93,11 +93,11 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
if(hw == NULL)
|
||||
return;
|
||||
|
||||
eptr = LocateElement(hw, BuEvent->x, BuEvent->y,
|
||||
eptr = LocateElement(hw, BuEvent->x, BuEvent->y,
|
||||
&epos);
|
||||
|
||||
if(!popup)
|
||||
{
|
||||
{
|
||||
/* before we build the popup see if the user has a .mosiac/user-defs
|
||||
file and if so use it to build a user menu */
|
||||
popup_items[3].sub_items = popup_build_user_defs();
|
||||
@@ -108,7 +108,7 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
if(popup_items[3].sub_items == NULL)
|
||||
popup_items[3].types = 0;
|
||||
|
||||
popup = _PopupMenuBuilder((Widget) w, XmMENU_POPUP,
|
||||
popup = _PopupMenuBuilder((Widget) w, XmMENU_POPUP,
|
||||
"popup", 0, popup_items);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
|
||||
if(eptr)
|
||||
{
|
||||
type = eptr->type;
|
||||
type = eptr->type;
|
||||
if((type == E_IMAGE) && (eptr->anchorHRef))
|
||||
{ /* turn on anchor and off text */
|
||||
type |= E_ANCHOR;
|
||||
@@ -128,13 +128,13 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
}
|
||||
else
|
||||
type = E_HRULE; /* pick a good normal little element */
|
||||
|
||||
for(i = 0; popup_items[i].class != LastItem; i++)
|
||||
|
||||
for(i = 0; popup_items[i].class != LastItem; i++)
|
||||
{
|
||||
if(popup_items[i]._w) /* anything is possible in Mosaic */
|
||||
{
|
||||
int good = True;
|
||||
|
||||
|
||||
/* take care of session menu */
|
||||
if(popup_items[i].acst.act_code == -2)
|
||||
XtVaSetValues(popup_items[i]._w, XmNsubMenuId,
|
||||
@@ -145,12 +145,12 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
good = good && (popup_items[i].types & type);
|
||||
else
|
||||
good = good && (popup_items[i].types == type);
|
||||
|
||||
|
||||
if(popup_items[i].modes_method == LOOSE)
|
||||
good = good && (popup_items[i].modes & mode);
|
||||
else
|
||||
good = good && (popup_items[i].modes == mode);
|
||||
|
||||
|
||||
if(good)
|
||||
{
|
||||
if(popup_items[i].class == Separator)
|
||||
@@ -182,7 +182,7 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
break;
|
||||
}
|
||||
}
|
||||
XtManageChild(popup_items[i]._w);
|
||||
XtManageChild(popup_items[i]._w);
|
||||
}
|
||||
else
|
||||
XtUnmanageChild(popup_items[i]._w);
|
||||
@@ -192,7 +192,7 @@ void ThirdButtonMenu(w, client_data, event, ctd)
|
||||
/* set all the widgets eptr data */
|
||||
_set_eptr_field(popup_items, eptr);
|
||||
|
||||
/* motif puts the menu in a boring place lets fix it */
|
||||
/* motif puts the menu in a boring place lets fix it */
|
||||
/* BuEvent->x_root -= 40; */ /* middle of buttons */
|
||||
BuEvent->y_root -= del; /* first active button or first specialty
|
||||
item if we're over element that has em */
|
||||
@@ -209,14 +209,14 @@ PopupItem *popup_build_user_defs()
|
||||
FILE *fp;
|
||||
int num, i;
|
||||
|
||||
if ((num=get_home(&str))!=0)
|
||||
if ((num=get_home(&str))!=0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
file = malloc(sizeof(char) * (strlen(str)+strlen("/.mosaic/user-defs")+1)); // SAM
|
||||
sprintf(file, "%s/.mosaic/user-defs", str); // SAM
|
||||
|
||||
|
||||
free(str);
|
||||
|
||||
if(!file_exists(file))
|
||||
@@ -245,7 +245,7 @@ PopupItem *popup_build_user_defs()
|
||||
|
||||
if(items)
|
||||
return items;
|
||||
else
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -267,9 +267,9 @@ void mo_make_popup(Widget view)
|
||||
{
|
||||
have_popup = True; /* this will cause it to be created later */
|
||||
popup = NULL;
|
||||
|
||||
|
||||
XtInsertEventHandler(view, ButtonPressMask, False,
|
||||
(XtEventHandler)ThirdButtonMenu, NULL,
|
||||
(XtEventHandler)ThirdButtonMenu, NULL,
|
||||
XtListHead);
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void mo_popup_set_something(char *what, int to, PopupItem *items)
|
||||
XtSetSensitive(w, to);
|
||||
}
|
||||
|
||||
Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
char mnem, PopupItem *items)
|
||||
{
|
||||
Widget menu, cascade;
|
||||
@@ -316,14 +316,14 @@ Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
menu = XmCreatePopupMenu(parent, title, NULL, 0);
|
||||
}
|
||||
else if(type == XmMENU_PULLDOWN)
|
||||
{
|
||||
{
|
||||
menu = XmCreatePulldownMenu(parent, title, NULL, 0);
|
||||
str = XmStringCreateLtoR(title, XmSTRING_DEFAULT_CHARSET);
|
||||
mapping_del = get_pref_int(ePOPUPCASCADEMAPPINGDELAY);
|
||||
cascade = XtVaCreateManagedWidget(title, xmCascadeButtonGadgetClass,
|
||||
parent, XmNsubMenuId, menu,
|
||||
XmNlabelString, str,
|
||||
XmNmnemonic, mnem,
|
||||
XmNmnemonic, mnem,
|
||||
XmNmappingDelay, mapping_del, NULL);
|
||||
XmStringFree(str);
|
||||
}
|
||||
@@ -336,54 +336,54 @@ Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
{
|
||||
case PushButton:
|
||||
{
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmPushButtonGadgetClass,
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmPushButtonGadgetClass,
|
||||
menu, NULL);
|
||||
if(items[i].mnemonic)
|
||||
XtVaSetValues(items[i]._w, XmNmnemonic, items[i].mnemonic,
|
||||
NULL);
|
||||
if(items[i].accel)
|
||||
{
|
||||
XtVaSetValues(items[i]._w,
|
||||
XmNaccelerator , items[i].accel,
|
||||
XtVaSetValues(items[i]._w,
|
||||
XmNaccelerator , items[i].accel,
|
||||
NULL);
|
||||
}
|
||||
if(items[i].accel_text)
|
||||
{
|
||||
str = XmStringCreateLtoR(items[i].accel_text, XmSTRING_DEFAULT_CHARSET);
|
||||
XtVaSetValues(items[i]._w,
|
||||
XtVaSetValues(items[i]._w,
|
||||
XmNacceleratorText, str,
|
||||
NULL);
|
||||
XmStringFree(str);
|
||||
}
|
||||
if(items[i].cbfp)
|
||||
XtAddCallback(items[i]._w, XmNactivateCallback,
|
||||
XtAddCallback(items[i]._w, XmNactivateCallback,
|
||||
items[i].cbfp, &(items[i].acst));
|
||||
|
||||
|
||||
|
||||
XtSetSensitive(items[i]._w, items[i].startup);
|
||||
|
||||
if(items[i].acst.str && items[i].acst.act_code==69)
|
||||
{
|
||||
XtAddCallback(items[i]._w,
|
||||
XmNarmCallback, rbm_ballonify,
|
||||
XtAddCallback(items[i]._w,
|
||||
XmNarmCallback, rbm_ballonify,
|
||||
items[i].acst.str);
|
||||
XtAddCallback(items[i]._w,
|
||||
XtAddCallback(items[i]._w,
|
||||
XmNdisarmCallback, rbm_ballonify, NULL);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case Separator:
|
||||
{
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmSeparatorGadgetClass,
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmSeparatorGadgetClass,
|
||||
menu, NULL);
|
||||
}
|
||||
break;
|
||||
case ToggleButton:
|
||||
{
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmToggleButtonGadgetClass,
|
||||
items[i]._w = XtVaCreateManagedWidget(items[i].label,
|
||||
xmToggleButtonGadgetClass,
|
||||
menu, NULL);
|
||||
}
|
||||
break;
|
||||
@@ -391,26 +391,26 @@ Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
{
|
||||
if(items[i].sub_items && (items[i].acst.act_code != -2))
|
||||
items[i]._w = _PopupMenuBuilder(menu, XmMENU_PULLDOWN,
|
||||
items[i].label,
|
||||
items[i].label,
|
||||
items[i].mnemonic,
|
||||
items[i].sub_items);
|
||||
else
|
||||
{
|
||||
int mapping_del;
|
||||
|
||||
|
||||
if(get_pref_boolean(eSESSION_HISTORY_ON_RBM))
|
||||
{
|
||||
mapping_del = get_pref_int(ePOPUPCASCADEMAPPINGDELAY);
|
||||
items[i]._w = XtVaCreateManagedWidget("Session History",
|
||||
items[i]._w = XtVaCreateManagedWidget("Session History",
|
||||
xmCascadeButtonGadgetClass,
|
||||
menu, XmNsubMenuId,
|
||||
menu, XmNsubMenuId,
|
||||
current_win->session_menu,
|
||||
XmNmappingDelay, mapping_del, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return type == XmMENU_POPUP ? menu : cascade;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ int which;
|
||||
return;
|
||||
}
|
||||
|
||||
xurl=mo_url_canonicalize(eptr->anchorHRef,
|
||||
xurl=mo_url_canonicalize(eptr->anchorHRef,
|
||||
strdup(current_win->current_node->url));
|
||||
do_meta=2;
|
||||
mo_load_window_text(current_win, xurl, NULL);
|
||||
@@ -483,7 +483,7 @@ void image_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
act_struct *acst = (act_struct *) client_data;
|
||||
char *src, *xurl;
|
||||
struct ele_rec *eptr;
|
||||
int which,tmp;
|
||||
int which,tmp;
|
||||
|
||||
eptr = acst->eptr;
|
||||
which = acst->act_code;
|
||||
@@ -499,7 +499,7 @@ void image_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
case I_Save:
|
||||
{
|
||||
/* FIXME: this should be
|
||||
/* FIXME: this should be
|
||||
fsb(eptr->edata); */
|
||||
fsb(eptr->pic_data->src);
|
||||
}
|
||||
@@ -536,11 +536,11 @@ void fsb(char *src)
|
||||
XmString str,fbfn;
|
||||
char *fname, *tmpstr, fBuf[1024];
|
||||
static char *last_src=NULL;
|
||||
|
||||
|
||||
if ( !dialog ) {
|
||||
last_src=strdup(src);
|
||||
dialog = XmCreateFileSelectionDialog (current_win->view,
|
||||
"Save Image File",
|
||||
dialog = XmCreateFileSelectionDialog (current_win->view,
|
||||
"Save Image File",
|
||||
NULL, 0 );
|
||||
XtAddCallback(dialog,
|
||||
XmNcancelCallback,
|
||||
@@ -553,7 +553,7 @@ void fsb(char *src)
|
||||
|
||||
XtSetSensitive(XmFileSelectionBoxGetChild(dialog, XmDIALOG_HELP_BUTTON),
|
||||
False);
|
||||
|
||||
|
||||
XtVaSetValues(dialog,
|
||||
XmNfileTypeMask, XmFILE_REGULAR,
|
||||
NULL);
|
||||
@@ -582,11 +582,11 @@ void fsb(char *src)
|
||||
XtVaGetValues(dialog,
|
||||
XmNdirSpec, &str,
|
||||
NULL);
|
||||
|
||||
|
||||
XmStringGetLtoR(str,XmSTRING_DEFAULT_CHARSET,&fname);
|
||||
XmStringFree(str);
|
||||
|
||||
if (fname)
|
||||
if (fname)
|
||||
{
|
||||
if(src && *src)
|
||||
sprintf(fBuf,"%s%s",fname,getFileName(src));
|
||||
@@ -594,15 +594,15 @@ void fsb(char *src)
|
||||
sprintf(fBuf,"%s",fname);
|
||||
|
||||
str=XmStringCreateLtoR(fBuf,XmSTRING_DEFAULT_CHARSET);
|
||||
|
||||
|
||||
XtVaSetValues(dialog,
|
||||
XmNdirSpec, str,
|
||||
NULL);
|
||||
|
||||
|
||||
XmStringFree(str);
|
||||
free(fname);
|
||||
}
|
||||
|
||||
|
||||
XtManageChild ( dialog );
|
||||
}
|
||||
|
||||
@@ -610,16 +610,16 @@ void fsb(char *src)
|
||||
void fsb_OKCallback (
|
||||
Widget w, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
XmFileSelectionBoxCallbackStruct *cbs =
|
||||
XmFileSelectionBoxCallbackStruct *cbs =
|
||||
(XmFileSelectionBoxCallbackStruct *) call_data;
|
||||
char *filename, *url = (char *) client_data, efilename[MO_LINE_LENGTH];
|
||||
|
||||
|
||||
/* Remove the widget from the screen, and kill it. */
|
||||
|
||||
XtUnmanageChild ( w );
|
||||
|
||||
|
||||
/* Retrieve the character string from the compound string format. */
|
||||
|
||||
|
||||
XmStringGetLtoR ( cbs->value, XmSTRING_DEFAULT_CHARSET, &filename );
|
||||
|
||||
/* Expand any ~ */
|
||||
@@ -647,7 +647,7 @@ void fsb_OKCallback (
|
||||
mo_gui_notify_progress("Image has been downloaded and saved.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
void fsb_CancelCallback (
|
||||
Widget w,
|
||||
XtPointer clientData,
|
||||
@@ -671,7 +671,7 @@ void hot_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
char *xurl;
|
||||
int i;
|
||||
mo_hot_item *hn = (mo_hot_item *) acst->str;
|
||||
|
||||
|
||||
switch(acst->act_code) {
|
||||
case 1: /* add item */
|
||||
mo_add_item_to_hotlist (acst->str, mo_t_url,
|
||||
@@ -687,13 +687,13 @@ void hot_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
mo_add_item_to_hotlist (acst->str, mo_t_list, xurl, NULL, 0,
|
||||
get_pref_boolean(eADD_RBM_ADDS_RBM));
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
default: /* goto link */
|
||||
if(acst->str) {
|
||||
xurl=mo_url_prepend_protocol(acst->str);
|
||||
mo_load_window_text (current_win, xurl, NULL);
|
||||
mo_load_window_text (current_win, xurl, NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -705,15 +705,15 @@ void mo_destroy_hot_menu(PopupItem *pmenu)
|
||||
for(i=0;pmenu[i].class != LastItem;i++) {
|
||||
if((pmenu[i].class != Separator) &&
|
||||
(pmenu[i].acst.act_code != 1) &&
|
||||
(pmenu[i].acst.act_code != 2))
|
||||
(pmenu[i].acst.act_code != 2))
|
||||
free(pmenu[i].label);
|
||||
|
||||
|
||||
if(pmenu[i].class == CascadeButton)
|
||||
mo_destroy_hot_menu(pmenu[i].sub_items);
|
||||
}
|
||||
free(pmenu);
|
||||
}
|
||||
|
||||
|
||||
PopupItem *mo_assemble_hot_menu(mo_hotlist *list)
|
||||
{
|
||||
mo_hot_item *item;
|
||||
@@ -743,7 +743,7 @@ PopupItem *mo_assemble_hot_menu(mo_hotlist *list)
|
||||
pmenu[i].label = strdup(str);
|
||||
if(item->type == mo_t_url){
|
||||
pmenu[i].acst.str = item->hot.url;
|
||||
pmenu[i].acst.act_code = 69; /* identifies this as a hotlist
|
||||
pmenu[i].acst.act_code = 69; /* identifies this as a hotlist
|
||||
button so we can ballon it */
|
||||
}
|
||||
pmenu[i].cbfp = hot_cb;
|
||||
@@ -766,7 +766,7 @@ PopupItem *mo_assemble_hot_menu(mo_hotlist *list)
|
||||
pmenu[i].sub_items = NULL;
|
||||
pmenu[i].label = strdup("Sep");
|
||||
i++;
|
||||
|
||||
|
||||
pmenu[i].class = PushButton;
|
||||
pmenu[i].label = "Add current URL...";
|
||||
pmenu[i].types = 0;
|
||||
@@ -796,7 +796,7 @@ PopupItem *mo_assemble_hot_menu(mo_hotlist *list)
|
||||
pmenu[i].startup=1;
|
||||
pmenu[i].sub_items = NULL;
|
||||
i++;
|
||||
|
||||
|
||||
pmenu[i].class = LastItem;
|
||||
return pmenu;
|
||||
}
|
||||
@@ -807,9 +807,9 @@ void mo_init_hotlist_menu(mo_hotlist *list)
|
||||
{
|
||||
/* this doesn't check the first button but that is okay because
|
||||
the first two buttons are always back and forward */
|
||||
while(popup_items[hot_button].acst.act_code != -1)
|
||||
while(popup_items[hot_button].acst.act_code != -1)
|
||||
hot_button++;
|
||||
|
||||
|
||||
popup_items[hot_button].sub_items = mo_assemble_hot_menu(list);
|
||||
/* popup_items[hot_button].class = CascadeButton; not necassary */
|
||||
}
|
||||
@@ -817,9 +817,9 @@ void mo_init_hotlist_menu(mo_hotlist *list)
|
||||
void mo_reinit_hotlist_menu(mo_hotlist *list)
|
||||
{
|
||||
short pos;
|
||||
|
||||
|
||||
if(!popup) return;
|
||||
|
||||
|
||||
mo_destroy_hot_menu(popup_items[hot_button].sub_items);
|
||||
|
||||
popup_items[hot_button].sub_items = mo_assemble_hot_menu(list);
|
||||
@@ -827,15 +827,15 @@ void mo_reinit_hotlist_menu(mo_hotlist *list)
|
||||
/*
|
||||
XtVaGetValues(popup_items[hot_button]._w,XmNpositionIndex, &pos, NULL);
|
||||
*/
|
||||
|
||||
|
||||
XtDestroyWidget(popup);
|
||||
|
||||
popup = _PopupMenuBuilder(current_win->view, XmMENU_POPUP,
|
||||
|
||||
popup = _PopupMenuBuilder(current_win->view, XmMENU_POPUP,
|
||||
"popup", 0, popup_items);
|
||||
|
||||
|
||||
/* popup_items[hot_button]._w =
|
||||
_PopupMenuBuilder(popup, XmMENU_PULLDOWN,
|
||||
popup_items[hot_button].label,
|
||||
popup_items[hot_button].label,
|
||||
popup_items[hot_button].mnemonic,
|
||||
popup_items[hot_button].sub_items);*/
|
||||
|
||||
@@ -886,7 +886,7 @@ char **user_defs_get_entries(FILE *fp, int *num)
|
||||
else
|
||||
{
|
||||
entries[i]=strdup(&(str[index]));
|
||||
entries[i]=my_chop(entries[i]);
|
||||
entries[i]=my_chop(entries[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -910,7 +910,7 @@ PopupItem *build_user_defs_items(char **entries, int num)
|
||||
|
||||
if(!items || !entries || num<=0)
|
||||
return NULL;
|
||||
|
||||
|
||||
for(i=0;i<num;i++)
|
||||
{
|
||||
items[i].class = PushButton;
|
||||
@@ -937,11 +937,11 @@ PopupItem *build_user_defs_items(char **entries, int num)
|
||||
return items;
|
||||
}
|
||||
|
||||
void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
XtPointer value, unsigned long *length, int *format)
|
||||
{
|
||||
char *pt, *end = NULL, *bptr,
|
||||
*select = (char *) value,
|
||||
char *pt, *end = NULL, *bptr,
|
||||
*select = (char *) value,
|
||||
*str = (char *) client_data,
|
||||
*nselect, *begin;
|
||||
char mode;
|
||||
@@ -956,7 +956,7 @@ void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
|
||||
/* do this cause select is not null terminated sometimes */
|
||||
pt = my_strndup(select, *length);
|
||||
|
||||
|
||||
if(pt)
|
||||
{
|
||||
select = pt;
|
||||
@@ -1018,7 +1018,7 @@ void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
if(pt && *pt)
|
||||
pt = strchr(pt, '_');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(pt && *pt && end && nselect)
|
||||
{
|
||||
@@ -1026,12 +1026,12 @@ void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
if(srcTrace)
|
||||
fprintf(stderr, "Popup getting %s from user menu.\n", pt);
|
||||
#endif
|
||||
|
||||
|
||||
if(mode=='P')
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
ptr = strrchr(bptr, ' '); /* This shouldn't fail because bptr is
|
||||
|
||||
ptr = strrchr(bptr, ' '); /* This shouldn't fail because bptr is
|
||||
chopped */
|
||||
ptr[0]='\0'; /* make bptr not have name value pair */
|
||||
ptr++; /* get back to a real string */
|
||||
@@ -1042,7 +1042,7 @@ void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
pt= malloc(sizeof(char) * (strlen(end)+strlen(nselect)+strlen(ptr)+1));
|
||||
sprintf(pt,"%s%s%s", ptr, nselect, end);
|
||||
|
||||
mo_post_access_document (current_win, bptr,
|
||||
mo_post_access_document (current_win, bptr,
|
||||
"application/x-www-form-urlencoded",
|
||||
pt);
|
||||
free(pt);
|
||||
@@ -1052,7 +1052,7 @@ void select_cb(Widget w, XtPointer client_data, Atom *sel, Atom *type,
|
||||
pt[0] = '\0';
|
||||
pt= malloc(sizeof(char) * (strlen(end)+strlen(bptr)+strlen(nselect)+1));
|
||||
sprintf(pt,"%s%s%s", bptr, nselect, end);
|
||||
mo_load_window_text(current_win, pt, NULL);
|
||||
mo_load_window_text(current_win, pt, NULL);
|
||||
free(pt);
|
||||
}
|
||||
else if(mode=='F')
|
||||
@@ -1069,11 +1069,11 @@ void user_defs_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
act_struct *acst = (act_struct *) client_data; /* acst->str is the url */
|
||||
XmPushButtonCallbackStruct *cbs = (XmPushButtonCallbackStruct *) call_data;
|
||||
char *str = acst->str;
|
||||
|
||||
|
||||
if(!str)
|
||||
return;
|
||||
|
||||
XtGetSelectionValue(current_win->scrolled_win, XA_PRIMARY, XA_STRING,
|
||||
XtGetSelectionValue(current_win->scrolled_win, XA_PRIMARY, XA_STRING,
|
||||
select_cb, str, cbs->event->xbutton.time);
|
||||
}
|
||||
|
||||
@@ -1089,12 +1089,12 @@ void copy_link_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
|
||||
url = mo_url_canonicalize(acst->eptr->anchorHRef, strdup(current_win->current_node->url));
|
||||
|
||||
if(XtOwnSelection((Widget) current_win->scrolled_win, XA_PRIMARY,
|
||||
if(XtOwnSelection((Widget) current_win->scrolled_win, XA_PRIMARY,
|
||||
cbs->event->xbutton.time, convert_selection,
|
||||
NULL, NULL) == False)
|
||||
NULL, NULL) == False)
|
||||
{
|
||||
fprintf(stderr, "Mosaic: Error: Could not copy selection, try again.\n");
|
||||
if (url)
|
||||
if (url)
|
||||
{
|
||||
free(url);
|
||||
}
|
||||
@@ -1102,12 +1102,12 @@ void copy_link_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for(i=0;popup_items[i].class!=LastItem; i++)
|
||||
{
|
||||
if(!strcmp(popup_items[i].label, COPY_URL_LABEL) && url)
|
||||
{
|
||||
char *copy_str = malloc((strlen(url) +
|
||||
char *copy_str = malloc((strlen(url) +
|
||||
strlen("URL: has been copied ")) * sizeof(char));
|
||||
if(popup_items[i].acst.str)
|
||||
free(popup_items[i].acst.str);
|
||||
@@ -1129,7 +1129,7 @@ void copy_link_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
}
|
||||
|
||||
static Boolean convert_selection(Widget w, Atom *sel, Atom *tar, Atom *typ_ret,
|
||||
XtPointer *val_ret, unsigned long *val_len,
|
||||
XtPointer *val_ret, unsigned long *val_len,
|
||||
int *format)
|
||||
{
|
||||
char *url;
|
||||
@@ -1138,7 +1138,7 @@ static Boolean convert_selection(Widget w, Atom *sel, Atom *tar, Atom *typ_ret,
|
||||
if(*tar == XA_STRING)
|
||||
{
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
if (srcTrace)
|
||||
{
|
||||
fprintf (stderr, "Pasting text selection.\n");
|
||||
}
|
||||
@@ -1174,24 +1174,24 @@ void mo_add_to_rbm_history(mo_window *win, char *url, char *title)
|
||||
if(!get_pref_boolean(eSESSION_HISTORY_ON_RBM))
|
||||
return;
|
||||
else if(!win->session_menu)
|
||||
win->session_menu = XmCreatePulldownMenu(win->view, "session_menu",
|
||||
win->session_menu = XmCreatePulldownMenu(win->view, "session_menu",
|
||||
NULL, 0);
|
||||
|
||||
compact_string(title, label, 31, 3, 3);
|
||||
|
||||
if(win->num_session_items < max)
|
||||
{
|
||||
win->session_items[win->num_session_items] =
|
||||
XtVaCreateManagedWidget(label, xmPushButtonGadgetClass,
|
||||
win->session_items[win->num_session_items] =
|
||||
XtVaCreateManagedWidget(label, xmPushButtonGadgetClass,
|
||||
win->session_menu,NULL);
|
||||
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XmNactivateCallback, session_cb, url);
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XmNarmCallback, rbm_ballonify, url);
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XtAddCallback(win->session_items[win->num_session_items],
|
||||
XmNdisarmCallback, rbm_ballonify, " ");
|
||||
win->num_session_items++;
|
||||
win->num_session_items++;
|
||||
}
|
||||
else if (win && win->session_items)
|
||||
{
|
||||
@@ -1201,14 +1201,14 @@ void mo_add_to_rbm_history(mo_window *win, char *url, char *title)
|
||||
for(i=0;i<max-1;i++)
|
||||
win->session_items[i] = win->session_items[i+1];
|
||||
|
||||
win->session_items[max-1] =
|
||||
win->session_items[max-1] =
|
||||
XtVaCreateManagedWidget(label, xmPushButtonGadgetClass,
|
||||
win->session_menu, NULL);
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XmNactivateCallback, session_cb, url);
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XmNarmCallback, rbm_ballonify, url);
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XtAddCallback(win->session_items[max-1],
|
||||
XmNdisarmCallback, rbm_ballonify, " ");
|
||||
}
|
||||
}
|
||||
@@ -1217,7 +1217,7 @@ void session_cb(Widget w, XtPointer client_data, XtPointer call_data)
|
||||
{
|
||||
char *xurl = (char *) client_data;
|
||||
|
||||
mo_load_window_text (current_win, xurl, NULL);
|
||||
mo_load_window_text (current_win, xurl, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
156
src/gui-popup.h
156
src/gui-popup.h
@@ -81,7 +81,7 @@ typedef enum _w_class { LastItem=1, PushButton, Separator, CascadeButton,
|
||||
enum { I_Save, I_ViewExternal, I_ViewInternal, I_Reload,
|
||||
M_ImageData, M_LinkData, M_FileData };
|
||||
|
||||
typedef struct act_struct
|
||||
typedef struct act_struct
|
||||
{
|
||||
int act_code;
|
||||
struct ele_rec *eptr;
|
||||
@@ -93,7 +93,7 @@ typedef struct PopupItem
|
||||
/* the top half must be filled in if this is to appear in the popup */
|
||||
|
||||
w_class class; /* this is a button, separator, label, cascade */
|
||||
unsigned long int types; /* for which widget elements this button is to
|
||||
unsigned long int types; /* for which widget elements this button is to
|
||||
popup for (the list of elements is below) */
|
||||
int types_method; /* if TIGHT use == if LOOSE use & */
|
||||
|
||||
@@ -116,14 +116,14 @@ typedef struct PopupItem
|
||||
|
||||
/* this is needed for a cascade class */
|
||||
|
||||
struct PopupItem *sub_items; /* NULL if this isn't a
|
||||
struct PopupItem *sub_items; /* NULL if this isn't a
|
||||
pull_right */
|
||||
|
||||
/* this is for internal uses */
|
||||
|
||||
Widget _w;
|
||||
int startup; /* are we sensitive when we start */
|
||||
|
||||
|
||||
} PopupItem;
|
||||
|
||||
XmxCallbackPrototype (menubar_cb);
|
||||
@@ -139,14 +139,14 @@ XmxCallbackPrototype (rbm_ballonify);
|
||||
void fsb();
|
||||
void ThirdButtonMenu();
|
||||
char *getFileName(char *file_src);
|
||||
Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
Widget _PopupMenuBuilder(Widget parent, int type, char *title,
|
||||
char mnem, PopupItem *items);
|
||||
extern struct ele_rec *LocateElement();
|
||||
void _set_eptr_field();
|
||||
void mo_popup_set_something();
|
||||
PopupItem *popup_build_user_defs();
|
||||
PopupItem *build_user_defs_items();
|
||||
char **user_defs_get_entries();
|
||||
char **user_defs_get_entries();
|
||||
extern mo_window *current_win;
|
||||
extern int file_exists();
|
||||
extern char *my_chop();
|
||||
@@ -161,22 +161,22 @@ void mo_add_to_rbm_history(mo_window *win, char *url, char *title);
|
||||
static Boolean convert_selection(Widget, Atom *, Atom *, Atom *, XtPointer *,
|
||||
unsigned long *, int *);
|
||||
|
||||
#ifdef GUI_POPUP_H /* this is set in gui-popup.c -- it prevents multiple
|
||||
#ifdef GUI_POPUP_H /* this is set in gui-popup.c -- it prevents multiple
|
||||
instances of the following variables */
|
||||
|
||||
Boolean have_popup;
|
||||
Widget popup = NULL;
|
||||
|
||||
PopupItem image_menu[] = {
|
||||
{PushButton, 0, 0, 0, 0, "Save", {I_Save, NULL, NULL}, image_cb, 0, NULL,
|
||||
{PushButton, 0, 0, 0, 0, "Save", {I_Save, NULL, NULL}, image_cb, 0, NULL,
|
||||
NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Reload", {I_Reload, NULL, NULL}, image_cb, 0,
|
||||
{PushButton, 0, 0, 0, 0, "Reload", {I_Reload, NULL, NULL}, image_cb, 0,
|
||||
NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "View External", {I_ViewExternal, NULL, NULL},
|
||||
{PushButton, 0, 0, 0, 0, "View External", {I_ViewExternal, NULL, NULL},
|
||||
image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "View Internal", {I_ViewInternal, NULL, NULL},
|
||||
{PushButton, 0, 0, 0, 0, "View Internal", {I_ViewInternal, NULL, NULL},
|
||||
image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Get Image Metadata", {M_ImageData, NULL, NULL},
|
||||
{PushButton, 0, 0, 0, 0, "Get Image Metadata", {M_ImageData, NULL, NULL},
|
||||
metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
/*
|
||||
{LastItem, 0, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}
|
||||
@@ -188,7 +188,7 @@ PopupItem pan_menu[] = {
|
||||
{PushButton, 0, 0, 0, 0, "Right", {0, NULL, NULL}, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Up", {0, NULL, NULL}, NULL,
|
||||
0, NULL, NULL, NULL, NULL, 1},
|
||||
0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Left", {0, NULL, NULL}, NULL, 0,
|
||||
NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Down", {0, NULL, NULL}, NULL,
|
||||
@@ -201,30 +201,30 @@ PopupItem pan_menu[] = {
|
||||
|
||||
PopupItem photo_cd_sub_menu[] = {
|
||||
{PushButton, 0, 0, 0, 0,"Zoom In", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0,"Zoom Out", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0,"Zoom Out", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Zoom Crop", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Crop", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Crop", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0,0, 0, "Enlarge", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Reduce", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Reduce", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0,0, 0, "Undo", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{Separator, 0, 0, 0, 0, "Sep", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Rotate Clockwise", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL,
|
||||
{PushButton, 0, 0, 0, 0, "Rotate Clockwise", {0, NULL, NULL} , NULL, 0, NULL, NULL, NULL,
|
||||
NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Rotate Counter-Clockwise", {0, NULL, NULL}, NULL,
|
||||
0, NULL, NULL, NULL, NULL, 1},
|
||||
{CascadeButton, 0, 0,0, 0, "Pan", {0, NULL, NULL}, NULL, 0, NULL, NULL, pan_menu, NULL, 1},
|
||||
0, NULL, NULL, NULL, NULL, 1},
|
||||
{CascadeButton, 0, 0,0, 0, "Pan", {0, NULL, NULL}, NULL, 0, NULL, NULL, pan_menu, NULL, 1},
|
||||
{Separator, 0, 0,0, 0, "Sep", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Full Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0,0, 0,"Reset To Original", {0, NULL, NULL}, NULL, 0, NULL, NULL,
|
||||
NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Full Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{PushButton, 0, 0,0, 0,"Reset To Original", {0, NULL, NULL}, NULL, 0, NULL, NULL,
|
||||
NULL, NULL, 1},
|
||||
{Separator, 0, 0,0, 0, "Separator", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL},
|
||||
{PushButton, 0, 0,0, 0,"Print This Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL,
|
||||
{PushButton, 0, 0,0, 0,"Print This Image", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL,
|
||||
NULL, 1},
|
||||
{ToggleButton, 0, 0,0, 0, "Display PhotoCD Icon", {0, NULL, NULL}, NULL, 0, NULL, NULL,
|
||||
NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Options", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{ToggleButton, 0, 0,0, 0, "Display PhotoCD Icon", {0, NULL, NULL}, NULL, 0, NULL, NULL,
|
||||
NULL, NULL, 1},
|
||||
{PushButton, 0, 0, 0, 0, "Options", {0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
/*
|
||||
{LastItem, 0, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL}
|
||||
*/
|
||||
@@ -254,23 +254,23 @@ PopupItem popup_items[] = {
|
||||
Permanent stuff
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE,"Back",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE,"Back",
|
||||
{mo_back, NULL, NULL},
|
||||
menubar_cb, 0, "B", NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Forward",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Forward",
|
||||
{mo_forward, NULL, NULL},
|
||||
menubar_cb, 0, "F", NULL, NULL, NULL, 1},
|
||||
menubar_cb, 0, "F", NULL, NULL, NULL, 1},
|
||||
|
||||
/* negative one means this is a hotlist */
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Hotlist",
|
||||
{-1, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Hotlist",
|
||||
{-1, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "User",
|
||||
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "User",
|
||||
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Session History",
|
||||
{-2, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{CascadeButton, ALL_TYPES, LOOSE, moMODE_ALL, LOOSE, "Session History",
|
||||
{-2, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Stuff if on a html page and not on a image or anchor
|
||||
@@ -278,9 +278,9 @@ PopupItem popup_items[] = {
|
||||
|
||||
{Separator, (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |E_TABLE),
|
||||
LOOSE, moMODE_ALL, LOOSE, "Separator", {0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{CascadeButton, (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |
|
||||
{CascadeButton, (E_TEXT | E_BULLET | E_LINEFEED | E_WIDGET | E_HRULE |
|
||||
E_TABLE),LOOSE, moMODE_ALL, LOOSE, "File",
|
||||
{0, NULL, NULL}, NULL, 0, NULL, NULL, file_menu, NULL, 1},
|
||||
|
||||
@@ -288,139 +288,139 @@ PopupItem popup_items[] = {
|
||||
Stuff if on any page and an anchor (including image anchor)
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{Separator, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Separator",
|
||||
{Separator, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Separator",
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, COPY_URL_LABEL,
|
||||
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, COPY_URL_LABEL,
|
||||
{0, NULL, NULL}, copy_link_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Get Link Metadata",
|
||||
{PushButton, E_ANCHOR | E_IMAGE, LOOSE, moMODE_ALL, LOOSE, "Get Link Metadata",
|
||||
{M_LinkData, NULL, NULL}, metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Stuff if on any page and a image (not including image link)
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{Separator, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Separator",
|
||||
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
{Separator, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Separator",
|
||||
{0, NULL, NULL}, NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Save",
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Save",
|
||||
{I_Save, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Reload",
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Reload",
|
||||
{I_Reload, NULL, NULL},
|
||||
image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View External",
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View External",
|
||||
{I_ViewExternal, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View Internal",
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "View Internal",
|
||||
{I_ViewInternal, NULL, NULL}, image_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Get Image Metadata",
|
||||
{PushButton, E_IMAGE, TIGHT, moMODE_ALL, LOOSE, "Get Image Metadata",
|
||||
{M_ImageData, NULL, NULL}, metadata_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Stuff if on any page and a image link
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{Separator, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Separator",
|
||||
{Separator, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Separator",
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{CascadeButton, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Image",
|
||||
{0, NULL, NULL},
|
||||
{CascadeButton, E_IMAGE | E_ANCHOR, TIGHT, moMODE_PLAIN, LOOSE, "Image",
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, image_menu, NULL, 1},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Stuff if on a ftp page
|
||||
Stuff if on a ftp page
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Separator",
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Separator",
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Put ...",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Put ...",
|
||||
{mo_ftp_put, NULL, NULL},
|
||||
ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Make Directory",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_FTP, TIGHT, "Make Directory",
|
||||
{mo_ftp_mkdir, NULL, NULL}, ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR, TIGHT, moMODE_FTP, TIGHT, "Remove",
|
||||
{PushButton, E_ANCHOR, TIGHT, moMODE_FTP, TIGHT, "Remove",
|
||||
{mo_ftp_remove, NULL, NULL}, ftp_rmbm_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
/*---------------------------------------------------------------
|
||||
Stuff if on a news page and not a link
|
||||
---------------------------------------------------------------*/
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Separator",
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Separator",
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Article",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Article",
|
||||
{mo_news_next, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Article",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Article",
|
||||
{mo_news_prev, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Thread",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Next Thread",
|
||||
{mo_news_nextt, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Thread",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Previous Thread",
|
||||
{mo_news_prevt, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Article Index",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Article Index",
|
||||
{mo_news_index, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Group Index",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Group Index",
|
||||
{mo_news_groups, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Post",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Post",
|
||||
{mo_news_post, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Followup",
|
||||
{PushButton, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, "Followup",
|
||||
{mo_news_follow, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
|
||||
|
||||
{Separator, ALL_TYPES, LOOSE, moMODE_NEWS, TIGHT, NULL,
|
||||
{0, NULL, NULL},
|
||||
NULL, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
|
||||
{mo_news_sub, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
|
||||
{mo_news_unsub, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Subscribe",
|
||||
{mo_news_sub_anchor, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Unsubscribe",
|
||||
{mo_news_unsub_anchor, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
|
||||
{PushButton, NEWS_NOANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
|
||||
{mo_news_mread, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
|
||||
{PushButton, E_ANCHOR, LOOSE, moMODE_NEWS, TIGHT, "Mark Group Read",
|
||||
{mo_news_mread_anchor, NULL, NULL},
|
||||
menubar_cb, 0, NULL, NULL, NULL, NULL, 1},
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
330
src/hdf-browse.c
330
src/hdf-browse.c
@@ -2,7 +2,7 @@
|
||||
/*After much deliberation, it was decided NOT to Internationalize this file.*/
|
||||
|
||||
/*
|
||||
|
||||
|
||||
This module provides access routines to take an HDF file and return an
|
||||
HTML description of its contents.
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
The function hdfGrokReference() will return a description of what can
|
||||
be "seen" from a given location in the file. Typically, this will be how
|
||||
users can navigate their way through a forest of Vgroups.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -117,7 +117,7 @@ int32 nt;
|
||||
|
||||
case DFNT_FLOAT32 : return("32-bit floating point numbers");
|
||||
case DFNT_FLOAT64 : return("64-bit floating point numbers");
|
||||
|
||||
|
||||
default : return("unknown number type");
|
||||
|
||||
}
|
||||
@@ -139,7 +139,7 @@ int32 count;
|
||||
{
|
||||
intn i;
|
||||
char * buffer;
|
||||
|
||||
|
||||
if(nt == DFNT_CHAR) {
|
||||
tbuff[count] = '\0';
|
||||
return tbuff;
|
||||
@@ -151,31 +151,31 @@ int32 count;
|
||||
buffer[0] = '\0';
|
||||
|
||||
switch(nt) {
|
||||
case DFNT_INT8 :
|
||||
case DFNT_UINT8 :
|
||||
case DFNT_INT8 :
|
||||
case DFNT_UINT8 :
|
||||
sprintf(buffer, "%d", ((int8 *)tbuff)[0]);
|
||||
for(i = 1; i < count; i++)
|
||||
sprintf(buffer, "%s, %d", buffer, ((int8 *)tbuff)[i]);
|
||||
break;
|
||||
case DFNT_INT16 :
|
||||
case DFNT_UINT16 :
|
||||
case DFNT_INT16 :
|
||||
case DFNT_UINT16 :
|
||||
sprintf(buffer, "%d", ((int16 *)tbuff)[0]);
|
||||
for(i = 1; i < count; i++)
|
||||
sprintf(buffer, "%s, %d", buffer, ((int16 *)tbuff)[i]);
|
||||
break;
|
||||
case DFNT_INT32 :
|
||||
case DFNT_UINT32 :
|
||||
case DFNT_INT32 :
|
||||
case DFNT_UINT32 :
|
||||
sprintf(buffer, "%d", ((int32 *)tbuff)[0]);
|
||||
for(i = 1; i < count; i++)
|
||||
sprintf(buffer, "%s, %d", buffer, ((int32 *)tbuff)[i]);
|
||||
break;
|
||||
case DFNT_FLOAT32 :
|
||||
case DFNT_FLOAT32 :
|
||||
sprintf(buffer, "%f", ((float32 *)tbuff)[0]);
|
||||
for(i = 1; i < count; i++)
|
||||
sprintf(buffer, "%s, %f", buffer, ((float32 *)tbuff)[i]);
|
||||
break;
|
||||
case DFNT_FLOAT64 :
|
||||
sprintf(buffer, "%f", ((float64 *)tbuff)[0]);
|
||||
case DFNT_FLOAT64 :
|
||||
sprintf(buffer, "%f", ((float64 *)tbuff)[0]);
|
||||
for(i = 1; i < count; i++)
|
||||
sprintf(buffer, "%s, %f", buffer, ((float64 *)tbuff)[i]);
|
||||
break;
|
||||
@@ -219,7 +219,7 @@ int32 num;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
Print out the info for data sets in the file. This code is based on
|
||||
the multi-file interface of HDF 3.3 so it is able to decode netCDF files
|
||||
@@ -230,7 +230,7 @@ int32 num;
|
||||
do_sds(char *fname)
|
||||
#else
|
||||
do_sds(fname)
|
||||
char *fname;
|
||||
char *fname;
|
||||
#endif
|
||||
{
|
||||
|
||||
@@ -263,8 +263,8 @@ char *fname;
|
||||
if(dsets > MAX_DATASET_DISPLAY)
|
||||
brief = TRUE;
|
||||
|
||||
fprintf(fp, "There are %d dataset%s and %d global attribute%s in this file.<P>\n",
|
||||
dsets, (dsets == 1 ? "" : "s"),
|
||||
fprintf(fp, "There are %d dataset%s and %d global attribute%s in this file.<P>\n",
|
||||
dsets, (dsets == 1 ? "" : "s"),
|
||||
nattr, (nattr == 1 ? "" : "s"));
|
||||
|
||||
if(dsets) {
|
||||
@@ -297,18 +297,18 @@ char *fname;
|
||||
}
|
||||
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "<LI> <A NAME=\"DataSet%d\"><B>%s(%s)</B></A> rank %d : [",
|
||||
fprintf(fp, "<LI> <A NAME=\"DataSet%d\"><B>%s(%s)</B></A> rank %d : [",
|
||||
i, name, longname, rank);
|
||||
else
|
||||
fprintf(fp, "<LI> Dataset <A NAME=\"DataSet%d\"><B>%s(%s)</B></A> has rank %d with dimensions [",
|
||||
fprintf(fp, "<LI> Dataset <A NAME=\"DataSet%d\"><B>%s(%s)</B></A> has rank %d with dimensions [",
|
||||
i, name, longname, rank);
|
||||
}
|
||||
else {
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "<LI> <A NAME=\"DataSet%d\"><B>%s</B></A> rank %d : [",
|
||||
fprintf(fp, "<LI> <A NAME=\"DataSet%d\"><B>%s</B></A> rank %d : [",
|
||||
i, name, rank);
|
||||
else
|
||||
fprintf(fp, "<LI> Dataset <A NAME=\"DataSet%d\"><B>%s</B></A> has rank %d with dimensions [",
|
||||
fprintf(fp, "<LI> Dataset <A NAME=\"DataSet%d\"><B>%s</B></A> has rank %d with dimensions [",
|
||||
i, name, rank);
|
||||
}
|
||||
|
||||
@@ -317,14 +317,14 @@ char *fname;
|
||||
hdfXsds(name, rank);
|
||||
#endif /* CHOUCK */
|
||||
|
||||
for(j = 0; j < rank; j++)
|
||||
for(j = 0; j < rank; j++)
|
||||
if(j == 0)
|
||||
fprintf(fp, "%d", dimsizes[j]);
|
||||
else
|
||||
fprintf(fp, ", %d", dimsizes[j]);
|
||||
|
||||
fprintf(fp, "]");
|
||||
|
||||
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "; %s.\n", get_type(nt));
|
||||
else
|
||||
@@ -332,18 +332,18 @@ char *fname;
|
||||
|
||||
#ifdef HAVE_DTM
|
||||
if (mo_dtm_out_active_p () && ((rank == 2) || (rank == 3)))
|
||||
fprintf (fp, "(To broadcast this dataset over DTM, click <A HREF=\"#hdfdtm;tag=%d,ref=%d\">here</A>.)\n",
|
||||
fprintf (fp, "(To broadcast this dataset over DTM, click <A HREF=\"#hdfdtm;tag=%d,ref=%d\">here</A>.)\n",
|
||||
(int32) DFTAG_NDG, i);
|
||||
#endif
|
||||
if(nattrs) {
|
||||
if(brief || nattrs > MAX_ATTRIBUTE_DISPLAY) {
|
||||
|
||||
fprintf(fp, "There %s %d <A HREF=\"#hdfref;tag=%d,ref=%d\">attribute%s</A>.\n",
|
||||
(nattrs == 1 ? "is" : "are"), nattrs, (int32) DFTAG_NDG, i,
|
||||
|
||||
fprintf(fp, "There %s %d <A HREF=\"#hdfref;tag=%d,ref=%d\">attribute%s</A>.\n",
|
||||
(nattrs == 1 ? "is" : "are"), nattrs, (int32) DFTAG_NDG, i,
|
||||
(nattrs == 1 ? "" : "s"));
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "Attributes :\n");
|
||||
else
|
||||
@@ -354,17 +354,17 @@ char *fname;
|
||||
char *valstr;
|
||||
status = SDattrinfo(sds, j, name, &nt, &count);
|
||||
if(status == FAIL) return;
|
||||
|
||||
|
||||
valstr = get_attribute(sds, j, nt, count);
|
||||
if(valstr == NULL) continue;
|
||||
|
||||
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "<LI> <i>%s</i> : <B>%s</B>", name, valstr);
|
||||
else
|
||||
fprintf(fp, "<LI> Attribute <i>%s</i> has the value : <B>%s</B>", name, valstr);
|
||||
|
||||
HDfreespace((void *)valstr);
|
||||
|
||||
|
||||
}
|
||||
fprintf(fp, "</UL>\n");
|
||||
}
|
||||
@@ -395,7 +395,7 @@ char *fname;
|
||||
fprintf(fp, "<LI> Attribute <i>%s</i> has the value : <B>%s</B>", name, valstr);
|
||||
|
||||
HDfreespace((void *)valstr);
|
||||
|
||||
|
||||
}
|
||||
fprintf(fp, "</UL>\n");
|
||||
}
|
||||
@@ -406,14 +406,14 @@ char *fname;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
If there are a lot of attributes we need to do them in a separate window
|
||||
|
||||
|
||||
That's what this function is for
|
||||
|
||||
*/
|
||||
do_attributes(char *fname, int index) {
|
||||
|
||||
|
||||
char name[MAX_NC_NAME];
|
||||
int32 nattrs, nt, dims[MAX_VAR_DIMS], rank, status;
|
||||
int32 fid, sds;
|
||||
@@ -436,27 +436,27 @@ do_attributes(char *fname, int index) {
|
||||
char *valstr;
|
||||
status = SDattrinfo(sds, j, name, &nt, &count);
|
||||
if(status == FAIL) return;
|
||||
|
||||
|
||||
valstr = get_attribute(sds, j, nt, count);
|
||||
if(valstr == NULL) continue;
|
||||
|
||||
|
||||
if(POWER_USER)
|
||||
fprintf(fp, "<LI> <i>%s</i> : <B>%s</B>", name, valstr);
|
||||
else
|
||||
fprintf(fp, "<LI> Attribute <i>%s</i> has the value : <B>%s</B>", name, valstr);
|
||||
|
||||
HDfreespace((void *)valstr);
|
||||
|
||||
|
||||
}
|
||||
fprintf(fp, "</UL>\n");
|
||||
}
|
||||
|
||||
|
||||
SDend(fid);
|
||||
|
||||
} /* do_attributes */
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
Print out info about file ids and descriptions
|
||||
|
||||
@@ -465,7 +465,7 @@ do_attributes(char *fname, int index) {
|
||||
do_fanns(int32 fid)
|
||||
#else
|
||||
do_fanns(fid)
|
||||
int32 fid;
|
||||
int32 fid;
|
||||
#endif
|
||||
{
|
||||
char *buffer;
|
||||
@@ -497,7 +497,7 @@ int32 fid;
|
||||
if(status == FAIL) return;
|
||||
|
||||
buffer[len] = '\0';
|
||||
fprintf(fp, "Here is the file description: <BLOCKQUOTE> %s </BLOCKQUOTE>\n", buffer);
|
||||
fprintf(fp, "Here is the file description: <BLOCKQUOTE> %s </BLOCKQUOTE>\n", buffer);
|
||||
|
||||
HDfreespace((void *)buffer);
|
||||
|
||||
@@ -529,7 +529,7 @@ char *name;
|
||||
|
||||
buffer = HDgetspace(len + 1);
|
||||
if(buffer == NULL) return;
|
||||
|
||||
|
||||
status = DFANgetlabel(fname, tag, ref, buffer, len + 1);
|
||||
if(status == SUCCEED) {
|
||||
name[0] = tolower(name[0]);
|
||||
@@ -541,13 +541,13 @@ char *name;
|
||||
}
|
||||
HDfreespace((void *)buffer);
|
||||
}
|
||||
|
||||
|
||||
len = DFANgetdesclen(fname, tag, ref);
|
||||
if(len > 0) {
|
||||
|
||||
|
||||
buffer = HDgetspace(len + 1);
|
||||
if(buffer == NULL) return;
|
||||
|
||||
|
||||
status = DFANgetdesc(fname, tag, ref, buffer, len + 1);
|
||||
if(status == SUCCEED) {
|
||||
buffer[len] = '\0';
|
||||
@@ -556,20 +556,20 @@ char *name;
|
||||
}
|
||||
HDfreespace((void *)buffer);
|
||||
}
|
||||
|
||||
|
||||
} /* print_desc */
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
print out the info for RIGSs in the file
|
||||
print out the info for RIGSs in the file
|
||||
|
||||
*/
|
||||
#ifdef PROTOTYPE
|
||||
do_rigs(char *fname)
|
||||
#else
|
||||
do_rigs(fname)
|
||||
char *fname;
|
||||
char *fname;
|
||||
#endif
|
||||
{
|
||||
int32 count, i, ref, len;
|
||||
@@ -586,35 +586,35 @@ char *fname;
|
||||
fprintf(fp, "There is 1 image in this file :\n");
|
||||
else
|
||||
fprintf(fp, "There are %d images in this file :\n", count);
|
||||
|
||||
|
||||
fprintf(fp, "<UL>\n");
|
||||
|
||||
for(i = 0; i < count; i++) {
|
||||
status = DFR8getdims(fname, &w, &h, &ip);
|
||||
if(status == FAIL) return;
|
||||
|
||||
|
||||
ref = DFR8lastref();
|
||||
if(ref == FAIL) return;
|
||||
|
||||
if(POWER_USER) {
|
||||
fprintf(fp, "<LI> Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> [%d by %d]\n",
|
||||
fprintf(fp, "<LI> Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> [%d by %d]\n",
|
||||
(int32) DFTAG_RIG, ref, w, h);
|
||||
|
||||
|
||||
if(w > hdfImageSize || h > hdfImageSize)
|
||||
fprintf(fp, " (subsampled)");
|
||||
|
||||
|
||||
if(ip) fprintf(fp, " has a palette\n");
|
||||
|
||||
fprintf(fp, ". ");
|
||||
|
||||
} else {
|
||||
fprintf(fp, "<LI> This image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> has dimensions %d by %d\n",
|
||||
fprintf(fp, "<LI> This image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> has dimensions %d by %d\n",
|
||||
(int32) DFTAG_RIG, ref, w, h);
|
||||
|
||||
|
||||
if(w > hdfImageSize || h > hdfImageSize)
|
||||
fprintf(fp, " (the image has been subsampled for display)");
|
||||
fprintf(fp, ". ");
|
||||
|
||||
|
||||
if(ip) fprintf(fp, "There is also a palette associated with this image.\n");
|
||||
}
|
||||
|
||||
@@ -632,16 +632,16 @@ char *fname;
|
||||
} /* do_rigs */
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
print out the info for Palettes in the file
|
||||
print out the info for Palettes in the file
|
||||
|
||||
*/
|
||||
#ifdef PROTOTYPE
|
||||
do_pals(char *fname)
|
||||
#else
|
||||
do_pals(fname)
|
||||
char *fname;
|
||||
char *fname;
|
||||
#endif
|
||||
{
|
||||
int32 count, i, ref, len;
|
||||
@@ -658,13 +658,13 @@ char *fname;
|
||||
fprintf(fp, "There is 1 palette in this file :\n");
|
||||
else
|
||||
fprintf(fp, "There are %d palettes in this file :\n", count);
|
||||
|
||||
|
||||
fprintf(fp, "<UL>\n");
|
||||
|
||||
for(i = 0; i < count; i++) {
|
||||
status = DFPgetpal(fname, pal);
|
||||
if(status == FAIL) return;
|
||||
|
||||
|
||||
ref = DFPlastref();
|
||||
if(ref < 1) return;
|
||||
|
||||
@@ -700,46 +700,46 @@ int32 ref;
|
||||
int32 intr, sz, cnt;
|
||||
int32 nfields, single;
|
||||
char * p, * q;
|
||||
|
||||
|
||||
vd = VSattach(fid, ref, "r");
|
||||
if(vd == FAIL) return;
|
||||
|
||||
|
||||
VSinquire(vd, &cnt, &intr, fields, &sz, name);
|
||||
VSgetclass(vd, class);
|
||||
|
||||
|
||||
nfields = VFnfields(vd);
|
||||
single = FALSE;
|
||||
if((cnt == 1) && (nfields == 1))
|
||||
single = TRUE;
|
||||
|
||||
if(name[0] == '\0') sprintf(name, "[no name value]");
|
||||
|
||||
|
||||
fprintf(fp, "<LI> Vdata <B>%s</B>", name);
|
||||
if(class[0])
|
||||
fprintf(fp, " of class <B>%s</B>", class);
|
||||
if(!single)
|
||||
fprintf(fp," contains %d record%s", cnt, (cnt == 1 ? "" : "s"));
|
||||
fprintf(fp,". \n");
|
||||
|
||||
|
||||
for(p = fields, q = padded_fields; *p; p++, q++) {
|
||||
*q = *p;
|
||||
if(*q == ',') *(++q) = ' ';
|
||||
}
|
||||
*q = '\0';
|
||||
|
||||
|
||||
fprintf(fp, "This Vdata contains the field%s <B>%s</B>\n",
|
||||
(nfields == 1 ? "" : "s"), padded_fields);
|
||||
|
||||
|
||||
/* if there is a single field with one value print out its values */
|
||||
if(single) {
|
||||
|
||||
|
||||
uint8 *tbuff;
|
||||
|
||||
|
||||
/* Attempted bugfix -- added 1 -- marca, 10:52pm sep 23. */
|
||||
tbuff = (uint8 *)HDgetspace(VFfieldisize(vd, 0) + 1);
|
||||
if(tbuff == NULL)
|
||||
return;
|
||||
|
||||
|
||||
VSsetfields(vd, fields);
|
||||
VSread(vd, tbuff, 1, 0);
|
||||
tbuff = buffer_to_string(tbuff, VFfieldtype(vd, 0), VFfieldorder(vd, 0));
|
||||
@@ -748,7 +748,7 @@ int32 ref;
|
||||
fprintf(fp, ": %s", tbuff);
|
||||
HDfreespace((void *)tbuff);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
fprintf(fp, ". \n");
|
||||
@@ -781,22 +781,22 @@ int32 X;
|
||||
|
||||
vg = Vattach(fid, ref, "r");
|
||||
if(vg == FAIL) return;
|
||||
|
||||
|
||||
Vgetname(vg, name);
|
||||
Vgetclass(vg, class);
|
||||
count = Vntagrefs(vg);
|
||||
|
||||
|
||||
if(name[0] == '\0') sprintf(name, "[no name value]");
|
||||
if(class[0] == '\0') sprintf(class, "[no class value]");
|
||||
|
||||
if(count)
|
||||
|
||||
if(count)
|
||||
fprintf(fp, "<LI> Vgroup <A HREF=\"#hdfref;tag=%d,ref=%d\">%s</A> of class <B>%s</B> has %d element%s.\n",
|
||||
DFTAG_VG, ref, name, class, count, (count == 1 ? "" : "s"));
|
||||
|
||||
|
||||
else
|
||||
fprintf(fp, "<LI> Vgroup %s of class <B>%s</B> is empty.\n",
|
||||
name, class);
|
||||
|
||||
|
||||
#ifdef CHOUCK
|
||||
if(X)
|
||||
hdfXvgroup(name, class, count);
|
||||
@@ -807,7 +807,7 @@ int32 X;
|
||||
} /* dump_vg */
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
print out the info for Vgroups in the file
|
||||
|
||||
If where is -1 print out info for the Vgroups we can see at the top level
|
||||
@@ -837,11 +837,11 @@ int32 where;
|
||||
int32 tag, ref, myref, intr, sz;
|
||||
int any;
|
||||
char name[VSNAMELENMAX], class[VSNAMELENMAX];
|
||||
|
||||
|
||||
if(where == -1) {
|
||||
|
||||
|
||||
if(Hnumber(fid, DFTAG_VG) < 1) return;
|
||||
|
||||
|
||||
any = FALSE;
|
||||
|
||||
/* looking for top level VGroups */
|
||||
@@ -885,18 +885,18 @@ int32 where;
|
||||
|
||||
} else {
|
||||
/* looking for stuff inside a given VGroup */
|
||||
|
||||
|
||||
vg = Vattach(fid, where, "r");
|
||||
if(vg == FAIL) return;
|
||||
|
||||
Vgetname(vg, name);
|
||||
Vgetclass(vg, class);
|
||||
count = Vntagrefs(vg);
|
||||
|
||||
|
||||
/* set up title and stuff */
|
||||
fprintf(fp, "<TITLE>Vgroup: %s</TITLE>\n", name);
|
||||
fprintf(fp, "<H1>Vgroup %s</H1>\n", name);
|
||||
|
||||
|
||||
fprintf(fp, "This Vgroup is named %s and is of class <B>%s</B>.\n", name, class);
|
||||
|
||||
if(count == 0) {
|
||||
@@ -908,7 +908,7 @@ int32 where;
|
||||
fprintf(fp, "There is %d element in Vgroup %s : \n", count, name);
|
||||
else
|
||||
fprintf(fp, "There are %d elements in Vgroup %s : \n", count, name);
|
||||
|
||||
|
||||
fprintf(fp, "<UL>\n");
|
||||
|
||||
for(i = 0; i < count; i++) {
|
||||
@@ -927,44 +927,44 @@ int32 where;
|
||||
int32 count, i, len;
|
||||
int32 status, w, h;
|
||||
intn ip;
|
||||
|
||||
|
||||
DFR8readref(fname, (uint16) ref);
|
||||
|
||||
status = DFR8getdims(fname, &w, &h, &ip);
|
||||
if(status == FAIL) return;
|
||||
|
||||
|
||||
if(POWER_USER) {
|
||||
fprintf(fp, "<LI> Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> [%d by %d]\n",
|
||||
fprintf(fp, "<LI> Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> [%d by %d]\n",
|
||||
(int32) DFTAG_RIG, ref, w, h);
|
||||
|
||||
|
||||
if(w > hdfImageSize || h > hdfImageSize)
|
||||
fprintf(fp, " (subsampled)");
|
||||
|
||||
|
||||
if(ip) fprintf(fp, " has a palette\n");
|
||||
|
||||
|
||||
fprintf(fp, ". ");
|
||||
|
||||
|
||||
} else {
|
||||
fprintf(fp, "<LI> Nested Raster Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> has dimensions %d by %d\n",
|
||||
fprintf(fp, "<LI> Nested Raster Image : <IMG SRC=\"#hdfref;tag=%d,ref=%d\"> has dimensions %d by %d\n",
|
||||
(int32) DFTAG_RIG, ref, w, h);
|
||||
|
||||
|
||||
if(w > hdfImageSize || h > hdfImageSize)
|
||||
fprintf(fp, " (the image has been subsampled for display)");
|
||||
fprintf(fp, ". ");
|
||||
|
||||
|
||||
if(ip) fprintf(fp, "There is also a palette associated with this image.\n");
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_DTM
|
||||
if (mo_dtm_out_active_p ())
|
||||
fprintf (fp, "(To broadcast this image over DTM, click <A HREF=\"#hdfdtm;tag=%d,ref=%d\">here</A>.)\n", (int32) DFTAG_RIG, ref);
|
||||
#endif
|
||||
|
||||
|
||||
print_desc(fname, DFTAG_RIG, ref, strdup ("image"));
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
if(HDgettagsname((uint16)tag))
|
||||
fprintf(fp, "<LI> HDF object : %s (Ref = %d)\n", HDgettagsname((uint16)tag), ref);
|
||||
@@ -983,8 +983,8 @@ int32 where;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Process Vdatas that are visible from the top level
|
||||
|
||||
Process Vdatas that are visible from the top level
|
||||
(i.e. they are not inside any Vgroups)
|
||||
|
||||
*/
|
||||
@@ -1001,7 +1001,7 @@ int32 fid;
|
||||
|
||||
count = VSlone(fid, NULL, 0);
|
||||
if(count < 1) return;
|
||||
|
||||
|
||||
ids = (int32 *) HDgetspace(sizeof(int32) * count);
|
||||
if(ids == NULL) return;
|
||||
|
||||
@@ -1011,10 +1011,10 @@ int32 fid;
|
||||
fprintf(fp, "<H2>Vdatas</H2>\n");
|
||||
fprintf(fp, "There are %d Vdatas visible at this level of the file.\n", count);
|
||||
fprintf(fp, "<UL>\n");
|
||||
|
||||
for(i = 0; i < count; i++)
|
||||
|
||||
for(i = 0; i < count; i++)
|
||||
dump_vdata(fid, ids[i]);
|
||||
|
||||
|
||||
fprintf(fp, "<UL>\n");
|
||||
HDfreespace((void *)ids);
|
||||
|
||||
@@ -1065,7 +1065,7 @@ char *realname;
|
||||
if(fid != FAIL) {
|
||||
|
||||
Vstart(fid);
|
||||
|
||||
|
||||
/* Do file annotations */
|
||||
do_fanns(fid);
|
||||
|
||||
@@ -1078,20 +1078,20 @@ char *realname;
|
||||
|
||||
/* Do RIGs */
|
||||
do_rigs(fname);
|
||||
|
||||
|
||||
/* Do Pals */
|
||||
do_pals(fname);
|
||||
|
||||
|
||||
/* Do Vgroups */
|
||||
do_vgs(fid, fname, -1);
|
||||
|
||||
|
||||
/* Do lone Vdatas */
|
||||
do_lone_vds(fid);
|
||||
|
||||
|
||||
/* close the file */
|
||||
Vend(fid);
|
||||
Hclose(fid);
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef CHOUCK
|
||||
@@ -1123,7 +1123,7 @@ char *realname;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
} /* hdfGrokFile */
|
||||
|
||||
|
||||
@@ -1154,12 +1154,12 @@ char *realname;
|
||||
fprintf (fp, "This file was accessed as URL <code>%s</code> <p>\n", realname);
|
||||
|
||||
if(sscanf(ref, "tag=%d,ref=%d", &t, &r) == 2) {
|
||||
|
||||
|
||||
switch((uint16) t) {
|
||||
case DFTAG_VG :
|
||||
case DFTAG_VG :
|
||||
fid = Hopen(fname, DFACC_RDONLY, 0);
|
||||
if(fid == FAIL) return(NULL);
|
||||
|
||||
|
||||
Vstart(fid);
|
||||
|
||||
do_vgs(fid, fname, r);
|
||||
@@ -1180,7 +1180,7 @@ char *realname;
|
||||
if(sscanf(ref, "fileImageHit?%d,%d", &x, &y) == 2) {
|
||||
char *buf;
|
||||
fprintf(fp, "<H2>File Image Hit</H2>\n");
|
||||
fprintf(fp, "We're sorry, but we really have no clue what is at location %d %d\n", x, y);
|
||||
fprintf(fp, "We're sorry, but we really have no clue what is at location %d %d\n", x, y);
|
||||
|
||||
buf = malloc(100);
|
||||
sprintf(buf, "#DataSet%d", 2);
|
||||
@@ -1189,11 +1189,11 @@ char *realname;
|
||||
|
||||
} else {
|
||||
fprintf(fp, "<H2>Sorry, Bad Reference</H2>\n");
|
||||
fprintf(fp, "We're sorry, but reference <I>%s</I> is bad and we can't figure out what to do about it.<P>\n",
|
||||
fprintf(fp, "We're sorry, but reference <I>%s</I> is bad and we can't figure out what to do about it.<P>\n",
|
||||
ref);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
fp = fopen(tmp, "r");
|
||||
@@ -1217,9 +1217,9 @@ char *realname;
|
||||
return(data);
|
||||
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
} /* hdfGrokReference */
|
||||
|
||||
|
||||
@@ -1227,7 +1227,7 @@ char *realname;
|
||||
|
||||
ImageInfo *hdfGetImage(char *filename, char *reference, int subsample)
|
||||
returns an ImageInfo struct corresponding to the named reference,
|
||||
as in hdfGrokReference. If subsample == TRUE then subsample the
|
||||
as in hdfGrokReference. If subsample == TRUE then subsample the
|
||||
image to fit within a hdfImageSize X hdfImageSize box
|
||||
|
||||
Return the backgroud pixel's index in bg only if the file Image
|
||||
@@ -1253,7 +1253,7 @@ intn *bg;
|
||||
int32 status, w, h;
|
||||
intn isp;
|
||||
char pal[768];
|
||||
|
||||
|
||||
Image = NULL;
|
||||
|
||||
#ifdef CHOUCK
|
||||
@@ -1272,7 +1272,7 @@ intn *bg;
|
||||
#endif
|
||||
|
||||
if((uint16)tag == DFTAG_RIG || (uint16)tag == DFTAG_RI8) {
|
||||
|
||||
|
||||
status = DFR8readref(filename, (uint16) ref);
|
||||
if(status == FAIL) return NULL;
|
||||
|
||||
@@ -1337,19 +1337,19 @@ intn *bg;
|
||||
skip = max / hdfImageSize;
|
||||
|
||||
if(skip) {
|
||||
|
||||
|
||||
/* allocate space for the data */
|
||||
int i, j;
|
||||
int cnt = 0;
|
||||
unsigned char * newSpace =
|
||||
unsigned char * newSpace =
|
||||
(unsigned char *) HDgetspace(max * max * sizeof(unsigned char));
|
||||
if(newSpace == NULL) return NULL;
|
||||
|
||||
skip++;
|
||||
for(j = 0; j < h; j += skip)
|
||||
for(i = 0; i < w; i += skip)
|
||||
for(i = 0; i < w; i += skip)
|
||||
newSpace[cnt++] = Image->image_data[i + j * w];
|
||||
|
||||
|
||||
HDfreespace((void *)(Image->image_data));
|
||||
Image->image_data = newSpace;
|
||||
Image->height = h / skip;
|
||||
@@ -1402,17 +1402,17 @@ intn *bg;
|
||||
Image->reds [i] = (int)pal[i * 3] << 8;
|
||||
Image->greens[i] = (int)pal[i * 3 + 1] << 8;
|
||||
Image->blues [i] = (int)pal[i * 3 + 2] << 8;
|
||||
for(j = 0; j < h; j++)
|
||||
for(j = 0; j < h; j++)
|
||||
Image->image_data[i + j * 256] = i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return Image;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} /* hdfGetImage */
|
||||
|
||||
|
||||
@@ -1440,7 +1440,7 @@ int *bg;
|
||||
|
||||
} /* hdfGrokImage */
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_DTM
|
||||
/* Send the referenced image over DTM. This is bad architecture.
|
||||
But what else is new? */
|
||||
@@ -1460,7 +1460,7 @@ char *reference;
|
||||
/* Check for presence of DTM output port. */
|
||||
if (!mo_dtm_out_active_p ())
|
||||
return;
|
||||
|
||||
|
||||
if(sscanf(reference, "tag=%d,ref=%d", &tag, &ref) == 2) {
|
||||
|
||||
if((uint16)tag == DFTAG_RIG) {
|
||||
@@ -1478,7 +1478,7 @@ char *reference;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if((uint16)tag == DFTAG_IP8) {
|
||||
|
||||
img = hdfGrokImage(filename, reference, NULL);
|
||||
@@ -1507,19 +1507,19 @@ char *reference;
|
||||
|
||||
sds = SDselect(fid, (int32) ref);
|
||||
if(sds == FAIL) return;
|
||||
|
||||
|
||||
/* davet what the hell is this about ???? */
|
||||
if (!(d = DataNew()))
|
||||
if (!(d = DataNew()))
|
||||
return;
|
||||
d->entity = ENT_Internal;
|
||||
d->dot = DOT_Array;
|
||||
|
||||
|
||||
/* get all basic meta-data */
|
||||
sprintf(name, "(no name)");
|
||||
SDgetinfo(sds, name, &(d->rank), d->dim, &nt, &nattr);
|
||||
|
||||
if((d->rank > 3) || (d->rank < 2)) return;
|
||||
|
||||
|
||||
switch(nt) {
|
||||
case DFNT_INT8:
|
||||
case DFNT_UINT8:
|
||||
@@ -1540,24 +1540,24 @@ char *reference;
|
||||
d->dost = DOST_Double;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* set up the region we want to read */
|
||||
for(i = 0; i < d->rank; i++) {
|
||||
start[i] = 0;
|
||||
end[i] = d->dim[i];
|
||||
}
|
||||
|
||||
|
||||
/* figger out how much space */
|
||||
for(i = 0, size = 1; i < d->rank; i++)
|
||||
size *= d->dim[i];
|
||||
|
||||
|
||||
/* allocate storage to store the raw numbers */
|
||||
if (!(d->data = (VOIDP) HDgetspace(size * DFKNTsize(nt))))
|
||||
return;
|
||||
|
||||
/* read that crazy data */
|
||||
SDreaddata(sds, start, NULL, end, d->data);
|
||||
|
||||
|
||||
/* set the name */
|
||||
if (d->label = (char *) MALLOC(strlen(name)+1)){
|
||||
strcpy(d->label,name);
|
||||
@@ -1565,14 +1565,14 @@ char *reference;
|
||||
|
||||
SDendaccess(sds);
|
||||
SDend(fid);
|
||||
|
||||
|
||||
/* swap numbers because Collage was written by a bunch of idiots */
|
||||
for(i = 0; i < ( d->rank / 2 ); i++) {
|
||||
tmp = d->dim[i];
|
||||
d->dim[i] = d->dim[d->rank - i - 1];
|
||||
d->dim[d->rank - i - 1] = tmp;
|
||||
}
|
||||
|
||||
|
||||
mo_dtm_send_dataset(d);
|
||||
|
||||
/* free it */
|
||||
@@ -1621,8 +1621,8 @@ hdfStartImage()
|
||||
*/
|
||||
view = current_win->scrolled_win;
|
||||
|
||||
/*
|
||||
* Remember the display
|
||||
/*
|
||||
* Remember the display
|
||||
*/
|
||||
dsp = XtDisplay(view);
|
||||
|
||||
@@ -1630,7 +1630,7 @@ hdfStartImage()
|
||||
* Create the Graphics Context
|
||||
*/
|
||||
scrGC = XCreateGC(dsp, XtWindow(view), 0, NULL);
|
||||
|
||||
|
||||
/*
|
||||
* Create a ImSizexImSize pixmap to draw in, and clear it to the background
|
||||
*/
|
||||
@@ -1638,7 +1638,7 @@ hdfStartImage()
|
||||
DefaultDepth(dsp, DefaultScreen(dsp)));
|
||||
XSetForeground(dsp, scrGC, WhitePixel(dsp, DefaultScreen(dsp)));
|
||||
XFillRectangle(dsp, scrPix, scrGC, 0, 0, ImSize, ImSize);
|
||||
|
||||
|
||||
/*
|
||||
* Prepare to draw our stuff in Black on White
|
||||
*/
|
||||
@@ -1654,10 +1654,10 @@ hdfStartImage()
|
||||
argcnt = 0;
|
||||
XtSetArg(arg[argcnt], XmNfontList, &font_list); argcnt++;
|
||||
XtGetValues(view, arg, argcnt);
|
||||
|
||||
if (font_list == (XmFontList)NULL)
|
||||
|
||||
if (font_list == (XmFontList)NULL)
|
||||
return;
|
||||
|
||||
|
||||
ret = XmFontListInitFontContext(&font_context, font_list);
|
||||
if(ret == False)
|
||||
return;
|
||||
@@ -1676,7 +1676,7 @@ hdfStartImage()
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
} /* hdfStartImage */
|
||||
|
||||
|
||||
@@ -1684,7 +1684,7 @@ hdfStartImage()
|
||||
* Place drawing calls here.
|
||||
* XDrawPoint, XDrawLine, XDrawArc, etc.
|
||||
*/
|
||||
|
||||
|
||||
#define sdsDepth 5
|
||||
#define sdsWidth 35
|
||||
#define sdsSep 20
|
||||
@@ -1711,7 +1711,7 @@ hdfXsds(char *name, int32 rank)
|
||||
y = sdsY; /* all SDSs on same line */
|
||||
x = sdsSep + (sdsWidth + sdsSep) * sds;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Make sure our box is big enough by seeing how big the rank
|
||||
* string is going to be
|
||||
*/
|
||||
@@ -1742,7 +1742,7 @@ hdfXsds(char *name, int32 rank)
|
||||
Points[5].y = (short) y - sdsDepth + sz ;
|
||||
Points[6].x = (short) x + sz;
|
||||
Points[6].y = (short) y + sz;
|
||||
|
||||
|
||||
XDrawLines(dsp, scrPix, scrGC, Points, 7, CoordModeOrigin);
|
||||
XDrawRectangle(dsp, scrPix, scrGC, x, y, sz, sz);
|
||||
|
||||
@@ -1773,10 +1773,10 @@ hdfXsds(char *name, int32 rank)
|
||||
/*
|
||||
|
||||
Draw a Vgroup object into our image
|
||||
|
||||
|
||||
*/
|
||||
void
|
||||
hdfXvgroup(char *name, char *class, int32 count)
|
||||
hdfXvgroup(char *name, char *class, int32 count)
|
||||
{
|
||||
char classString[512];
|
||||
char nameString[512];
|
||||
@@ -1790,14 +1790,14 @@ hdfXvgroup(char *name, char *class, int32 count)
|
||||
y = vgroupY; /* all Vgroups on same line */
|
||||
x = sdsSep + (vgroupWidth + sdsSep) * vgroups;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Make sure our box is big enough by seeing how big the name
|
||||
* string is going to be
|
||||
*/
|
||||
sprintf(nameString, "%s", name);
|
||||
if(strlen(nameString) > 7)
|
||||
nameString[7] = '\0';
|
||||
|
||||
|
||||
XTextExtents(myFont, nameString, strlen(nameString), &dir, &asc, &des, &overall);
|
||||
height = asc + des;
|
||||
width = overall.width;
|
||||
@@ -1846,9 +1846,9 @@ hdfEndImage()
|
||||
|
||||
|
||||
/* XtVaGetValues (view, XtNforeground, &fg_pixel, XtNbackground, &bg_pixel, NULL); */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
scrImage = XGetImage(dsp, scrPix, 0, 0, ImSize, ImSize,
|
||||
AllPlanes, ZPixmap);
|
||||
XFreePixmap(dsp, scrPix);
|
||||
@@ -1896,7 +1896,7 @@ hdfEndImage()
|
||||
|
||||
|
||||
ImageInfo *
|
||||
hdfFetchImage(intn *bg)
|
||||
hdfFetchImage(intn *bg)
|
||||
{
|
||||
if(bg) *bg = 0;
|
||||
return (img);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
138
src/history.c
138
src/history.c
@@ -187,11 +187,11 @@ mo_status mo_add_node_to_history (mo_window *win, mo_node *node)
|
||||
|
||||
if (win->history_list)
|
||||
{
|
||||
XmString xmstr =
|
||||
XmString xmstr =
|
||||
XmxMakeXmstrFromString(
|
||||
get_pref_boolean(eDISPLAY_URLS_NOT_TITLES) ?
|
||||
node->url : node->title);
|
||||
XmListAddItemUnselected
|
||||
XmListAddItemUnselected
|
||||
(win->history_list, xmstr, node->position);
|
||||
XmStringFree (xmstr);
|
||||
}
|
||||
@@ -228,14 +228,14 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
if (foo2)
|
||||
{
|
||||
char *server = (char *) malloc ((foo2 - foo1 + 2));
|
||||
|
||||
|
||||
/* bcopy (foo1, server, (foo2 - foo1));*/
|
||||
memcpy(server, foo1, (foo2 - foo1));
|
||||
server[(foo2 - foo1)] = '\0';
|
||||
|
||||
|
||||
title = (char *) malloc ((strlen (server) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Gopher server at" , server);
|
||||
|
||||
|
||||
/* OK, we got a title... */
|
||||
free (server);
|
||||
|
||||
@@ -252,7 +252,7 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
|
||||
/* If we got here, assume we should use 'ref' if possible
|
||||
for the WAIS title. */
|
||||
if (!strncmp (url, "wais:", 5) ||
|
||||
if (!strncmp (url, "wais:", 5) ||
|
||||
!strncmp (url, "http://info.cern.ch:8001/", 25) ||
|
||||
!strncmp (url, "http://info.cern.ch.:8001/", 26) ||
|
||||
!strncmp (url, "http://www.ncsa.uiuc.edu:8001/", 30))
|
||||
@@ -273,14 +273,14 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
if (foo2)
|
||||
{
|
||||
char *server = (char *) malloc ((foo2 - foo1 + 2));
|
||||
|
||||
|
||||
/* bcopy (foo1, server, (foo2 - foo1));*/
|
||||
memcpy(server, foo1, (foo2 - foo1));
|
||||
server[(foo2 - foo1)] = '\0';
|
||||
|
||||
|
||||
title = (char *) malloc ((strlen (server) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "WAIS server at" , server);
|
||||
|
||||
|
||||
/* OK, we got a title... */
|
||||
free (server);
|
||||
|
||||
@@ -302,7 +302,7 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
{
|
||||
/* It's a news article. */
|
||||
foo1 = url + 5;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "USENET article" , foo1);
|
||||
|
||||
@@ -312,7 +312,7 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
{
|
||||
/* It's a newsgroup. */
|
||||
foo1 = url + 5;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "USENET newsgroup" , foo1);
|
||||
|
||||
@@ -327,51 +327,51 @@ static char *mo_grok_alternate_title (char *url, char *ref)
|
||||
{
|
||||
/* It's a local file. */
|
||||
foo1 = url + 7;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Local file" , foo1);
|
||||
|
||||
|
||||
goto done;
|
||||
}
|
||||
else if (strncmp (url, "file://localhost/", 17) == 0)
|
||||
{
|
||||
/* It's a local file. */
|
||||
foo1 = url + 16;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Local file" , foo1);
|
||||
|
||||
|
||||
goto done;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* It's a remote file. */
|
||||
foo1 = url + 7;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Remote file" , foo1);
|
||||
|
||||
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!strncmp (url, "ftp:", 4))
|
||||
{
|
||||
{
|
||||
/* It's a remote file. */
|
||||
foo1 = url + 6;
|
||||
|
||||
|
||||
title = (char *)malloc ((strlen (foo1) + 32) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Remote file" , foo1);
|
||||
|
||||
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Punt... */
|
||||
title = (char *) malloc ((strlen (url) + 24) * sizeof (char));
|
||||
sprintf (title, "%s %s", "Untitled" , url);
|
||||
|
||||
|
||||
done:
|
||||
return title;
|
||||
}
|
||||
@@ -413,7 +413,7 @@ extern int securityType;
|
||||
to figure out what the title is, and call mo_node_to_history
|
||||
to add the new mo_node to both the window's data structures and
|
||||
to its Motif history list. */
|
||||
mo_status mo_record_visit (mo_window *win, char *url, char *newtext,
|
||||
mo_status mo_record_visit (mo_window *win, char *url, char *newtext,
|
||||
char *newtexthead, char *ref,
|
||||
char *last_modified, char *expires)
|
||||
{
|
||||
@@ -483,7 +483,7 @@ mo_status mo_forward_node (mo_window *win)
|
||||
mo_status mo_visit_position (mo_window *win, int pos)
|
||||
{
|
||||
mo_node *node;
|
||||
|
||||
|
||||
for (node = win->history; node != NULL; node = node->next)
|
||||
{
|
||||
if (node->position == pos)
|
||||
@@ -528,7 +528,7 @@ mo_status mo_dump_history (mo_window *win)
|
||||
#endif
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* ----------------------------- HISTORY GUI ------------------------------ */
|
||||
@@ -539,17 +539,17 @@ mo_status mo_dump_history (mo_window *win)
|
||||
static void mo_load_history_list (mo_window *win, Widget list)
|
||||
{
|
||||
mo_node *node;
|
||||
|
||||
|
||||
for (node = win->history; node != NULL; node = node->next)
|
||||
{
|
||||
XmString xmstr =
|
||||
XmString xmstr =
|
||||
XmxMakeXmstrFromString (get_pref_boolean(eDISPLAY_URLS_NOT_TITLES) ?
|
||||
node->url : node->title);
|
||||
XmListAddItemUnselected
|
||||
XmListAddItemUnselected
|
||||
(list, xmstr, 0);
|
||||
XmStringFree (xmstr);
|
||||
}
|
||||
|
||||
|
||||
XmListSetBottomPos (list, 0);
|
||||
if (win->current_node)
|
||||
XmListSelectPos (win->history_list, win->current_node->position, False);
|
||||
@@ -587,20 +587,20 @@ static XmxCallback (mailhist_win_cb)
|
||||
|
||||
{
|
||||
mo_node *node;
|
||||
|
||||
|
||||
fprintf (fp, "<HTML>\n");
|
||||
fprintf (fp, "<H1>History Path From %s</H1>\n",
|
||||
get_pref_string(eDEFAULT_AUTHOR_NAME));
|
||||
fprintf (fp, "<DL>\n");
|
||||
for (node = win->history; node != NULL; node = node->next)
|
||||
{
|
||||
fprintf (fp, "<DT>%s\n<DD><A HREF=\"%s\">%s</A>\n",
|
||||
fprintf (fp, "<DT>%s\n<DD><A HREF=\"%s\">%s</A>\n",
|
||||
node->title, node->url, node->url);
|
||||
}
|
||||
fprintf (fp, "</DL>\n");
|
||||
fprintf (fp, "</HTML>\n");
|
||||
}
|
||||
|
||||
|
||||
mo_finish_sending_mail_message ();
|
||||
|
||||
oops:
|
||||
@@ -608,7 +608,7 @@ static XmxCallback (mailhist_win_cb)
|
||||
free (subj);
|
||||
|
||||
mo_not_busy ();
|
||||
|
||||
|
||||
break;
|
||||
case 1:
|
||||
XtUnmanageChild (win->mailhist_win);
|
||||
@@ -616,8 +616,8 @@ static XmxCallback (mailhist_win_cb)
|
||||
break;
|
||||
case 2:
|
||||
mo_open_another_window
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-nested-hotlists.html"),
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-nested-hotlists.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
}
|
||||
@@ -636,30 +636,30 @@ static mo_status mo_post_mailhist_win (mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget mailhist_form, to_label, subj_label;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->mailhist_win = XmxMakeFormDialog
|
||||
win->mailhist_win = XmxMakeFormDialog
|
||||
(win->history_win, "NCSA Mosaic: Mail Window History" );
|
||||
dialog_frame = XmxMakeFrame (win->mailhist_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
mailhist_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
to_label = XmxMakeLabel (mailhist_form, "Mail To:" );
|
||||
XmxSetArg (XmNwidth, 335);
|
||||
win->mailhist_to_text = XmxMakeTextField (mailhist_form);
|
||||
|
||||
|
||||
subj_label = XmxMakeLabel (mailhist_form, "Subject:" );
|
||||
win->mailhist_subj_text = XmxMakeTextField (mailhist_form);
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (mailhist_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtons
|
||||
(mailhist_form, mailhist_win_cb, "Mail" ,
|
||||
"Dismiss" , "Help..." , 0, 1, 2);
|
||||
@@ -676,28 +676,28 @@ static mo_status mo_post_mailhist_win (mo_window *win)
|
||||
|
||||
XmxSetOffsets (subj_label, 14, 0, 10, 0);
|
||||
XmxSetConstraints
|
||||
(subj_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(subj_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE,
|
||||
win->mailhist_to_text, NULL, NULL, NULL);
|
||||
XmxSetOffsets (win->mailhist_subj_text, 10, 0, 5, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailhist_subj_text, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
(win->mailhist_subj_text, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, win->mailhist_to_text, NULL, subj_label, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
win->mailhist_subj_text, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
XtManageChild (win->mailhist_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ static XmxCallback (history_win_cb)
|
||||
break;
|
||||
case 2:
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("docview-menubar-navigate.html#history"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -731,7 +731,7 @@ static XmxCallback (history_list_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
XmListCallbackStruct *cs = (XmListCallbackStruct *)call_data;
|
||||
|
||||
|
||||
mo_visit_position (win, cs->item_position);
|
||||
|
||||
return;
|
||||
@@ -751,18 +751,18 @@ mo_status mo_post_history_win (mo_window *win)
|
||||
~Shift ~Ctrl ~Meta ~Alt <Btn2Up>: ListEndSelect() ListKbdActivate()";
|
||||
|
||||
listTable = XtParseTranslationTable(listTranslations);
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->history_win = XmxMakeFormDialog
|
||||
win->history_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Window History" );
|
||||
dialog_frame = XmxMakeFrame (win->history_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
history_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
@@ -775,17 +775,17 @@ mo_status mo_post_history_win (mo_window *win)
|
||||
XmxSetArg (XmNlistSizePolicy, XmCONSTANT);
|
||||
XmxSetArg (XmNwidth, 380);
|
||||
XmxSetArg (XmNheight, 184);
|
||||
win->history_list = XmxMakeScrolledList
|
||||
win->history_list = XmxMakeScrolledList
|
||||
(history_form, history_list_cb, 0);
|
||||
XtAugmentTranslations (win->history_list, listTable);
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (history_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtons(history_form,
|
||||
history_win_cb,
|
||||
"Mail To...",
|
||||
"Dismiss",
|
||||
"Help...",
|
||||
"Dismiss",
|
||||
"Help...",
|
||||
1,
|
||||
0,
|
||||
2);
|
||||
@@ -798,16 +798,16 @@ mo_status mo_post_history_win (mo_window *win)
|
||||
/* History list is stretchable. */
|
||||
XmxSetOffsets (XtParent (win->history_list), 0, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->history_list),
|
||||
XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
(XtParent (win->history_list),
|
||||
XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
history_label, dialog_sep, NULL, NULL);
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
@@ -816,6 +816,6 @@ mo_status mo_post_history_win (mo_window *win)
|
||||
}
|
||||
|
||||
XmxManageRemanage (win->history_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -71,7 +71,7 @@ mo_status mo_kill_node (mo_window *, mo_node *);
|
||||
mo_status mo_kill_node_descendents (mo_window *, mo_node *);
|
||||
mo_status mo_add_node_to_history (mo_window *, mo_node *);
|
||||
char *mo_grok_title (mo_window *, char *, char *);
|
||||
mo_status mo_record_visit (mo_window *, char *, char *,
|
||||
mo_status mo_record_visit (mo_window *, char *, char *,
|
||||
char *, char *, char *, char *);
|
||||
mo_status mo_back_node (mo_window *);
|
||||
mo_status mo_forward_node (mo_window *);
|
||||
|
||||
@@ -186,7 +186,7 @@ static void mo_parse_hotlist_list(mo_hotlist *list, struct mark_up **current)
|
||||
char *url = NULL, *title = NULL, *rbm=NULL;
|
||||
struct mark_up *mptr;
|
||||
int done = 0;
|
||||
|
||||
|
||||
for (mptr = *current; mptr != NULL && !done; mptr && (mptr = mptr->next))
|
||||
switch (mptr->type)
|
||||
{
|
||||
@@ -439,13 +439,13 @@ mo_status mo_write_hotlist (mo_hotlist *list, FILE *fp)
|
||||
|
||||
fputs("<TITLE>Hotlist from ", fp);
|
||||
if (!get_pref_string(eDEFAULT_AUTHOR_NAME)) {
|
||||
fputExpanded("Unknown", fp);
|
||||
fputExpanded("Unknown", fp);
|
||||
}
|
||||
else {
|
||||
fputExpanded(get_pref_string(eDEFAULT_AUTHOR_NAME), fp);
|
||||
fputExpanded(get_pref_string(eDEFAULT_AUTHOR_NAME), fp);
|
||||
}
|
||||
fputs("</TITLE>\n", fp);
|
||||
|
||||
|
||||
mo_write_list_r(list, fp);
|
||||
|
||||
fputs("</HTML>\n", fp);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
234
src/hotlist.c
234
src/hotlist.c
@@ -77,11 +77,11 @@ void mo_reinit_hotmenu();
|
||||
|
||||
/* This file provides support for hotlists of interesting
|
||||
documents within the browser.
|
||||
|
||||
|
||||
Initially there will be a single hotlist, 'Default'.
|
||||
|
||||
The old hotlist file format look like this:
|
||||
|
||||
|
||||
ncsa-mosaic-hotlist-format-1 [identifying string]
|
||||
Default [title]
|
||||
url Fri Sep 13 00:00:00 1986 [first word is url;
|
||||
@@ -90,7 +90,7 @@ void mo_reinit_hotmenu();
|
||||
document title cached here [cached title for above]
|
||||
[2-line sequence for single document repeated as necessary]
|
||||
...
|
||||
|
||||
|
||||
Turns out this format is bad for two reasons:
|
||||
(1) Document titles can have embedded carriage returns (usually
|
||||
on purpose).
|
||||
@@ -171,14 +171,14 @@ void mo_append_item_to_hotlist (mo_hotlist *list,
|
||||
node->any.previous = list->nodelist_last;
|
||||
node->any.next = 0;
|
||||
node->any.position = node->any.previous->any.position + 1;
|
||||
|
||||
|
||||
/* Now point forward from previous nodelist_last. */
|
||||
list->nodelist_last->any.next = node;
|
||||
|
||||
|
||||
/* Now set up new nodelist_last. */
|
||||
list->nodelist_last = node;
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -244,11 +244,11 @@ static void mo_recalculate_hotlist_positions (mo_hotlist *list)
|
||||
{
|
||||
mo_hot_item *hotnode;
|
||||
int count = 1;
|
||||
|
||||
|
||||
for (hotnode = list->nodelist; hotnode != NULL;
|
||||
hotnode = hotnode->any.next)
|
||||
hotnode->any.position = count++;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ static void mo_gui_add_hot_item (mo_hotlist *list, mo_hot_item *item)
|
||||
(highlight = mo_highlight_hotlist(&item->list)));
|
||||
if (item->type == mo_t_list && highlight)
|
||||
free(highlight);
|
||||
XmListAddItemUnselected
|
||||
XmListAddItemUnselected
|
||||
(win->hotlist_list,
|
||||
xmstr,
|
||||
item->any.position);
|
||||
@@ -460,9 +460,9 @@ mo_status mo_add_item_to_hotlist (mo_hotlist *list, mo_item_type type,
|
||||
mo_insert_item_in_hotlist(list, item, position);
|
||||
else
|
||||
mo_append_item_to_hotlist (list, item);
|
||||
|
||||
|
||||
mo_gui_add_hot_item (list, item);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -476,21 +476,21 @@ mo_status mo_add_item_to_hotlist (mo_hotlist *list, mo_item_type type,
|
||||
static void mo_load_hotlist_list (mo_window *win, Widget list)
|
||||
{
|
||||
mo_hot_item *node;
|
||||
|
||||
|
||||
if (win->edithot_win && XtIsManaged(win->edithot_win))
|
||||
XtUnmanageChild (win->edithot_win);
|
||||
for (node = win->current_hotlist->nodelist; node != NULL;
|
||||
node = node->any.next)
|
||||
{
|
||||
char *highlight = NULL;
|
||||
XmString xmstr =
|
||||
XmString xmstr =
|
||||
XmxMakeXmstrFromString
|
||||
(node->type == mo_t_url ?
|
||||
(get_pref_boolean(eDISPLAY_URLS_NOT_TITLES) ? node->hot.url : node->hot.title) :
|
||||
(highlight = mo_highlight_hotlist(&node->list)));
|
||||
if (node->type == mo_t_list && highlight)
|
||||
free(highlight);
|
||||
XmListAddItemUnselected
|
||||
XmListAddItemUnselected
|
||||
(list, xmstr, 0);
|
||||
XmStringFree (xmstr);
|
||||
}
|
||||
@@ -531,7 +531,7 @@ static void mo_visit_hotlist_position (mo_window *win, int position)
|
||||
|
||||
static XmxCallback (edit_or_insert_hot_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
(XmxExtractUniqid ((int)client_data));
|
||||
char *title;
|
||||
edit_or_insert_hot_info *eht_info;
|
||||
@@ -546,13 +546,13 @@ static XmxCallback (edit_or_insert_hot_cb)
|
||||
Xmx_n = 0;
|
||||
XtUnmanageChild (win->edithot_win);
|
||||
title = XmxTextGetString (eht_info->title_text);
|
||||
|
||||
|
||||
{
|
||||
/* OK, now position is still cached in win->edithot_pos. */
|
||||
mo_hotlist *list = win->current_hotlist;
|
||||
mo_hot_item *hotnode;
|
||||
mo_window *w = NULL;
|
||||
|
||||
|
||||
FindHotFromPos(hotnode, list, eht_info->pos);
|
||||
|
||||
if (hotnode == NULL)
|
||||
@@ -588,17 +588,17 @@ static XmxCallback (edit_or_insert_hot_cb)
|
||||
hotnode->any.position);
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf (stderr,
|
||||
fprintf (stderr,
|
||||
"w->hotlist_list 0x%08x, xmstr 0x%08x, hotnode->position %d\n",
|
||||
w->hotlist_list,
|
||||
xmstr,
|
||||
w->hotlist_list,
|
||||
xmstr,
|
||||
hotnode->any.position);
|
||||
}
|
||||
#endif
|
||||
/* There is what appears to be a Motif UMR here... */
|
||||
XmListAddItemUnselected
|
||||
(w->hotlist_list,
|
||||
xmstr,
|
||||
XmListAddItemUnselected
|
||||
(w->hotlist_list,
|
||||
xmstr,
|
||||
hotnode->any.position);
|
||||
XmStringFree (xmstr);
|
||||
}
|
||||
@@ -610,7 +610,7 @@ static XmxCallback (edit_or_insert_hot_cb)
|
||||
free(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* That's it! */
|
||||
}
|
||||
punt:
|
||||
@@ -689,8 +689,8 @@ static XmxCallback (edit_or_insert_hot_cb)
|
||||
case 2: /* Help... (Edit) */
|
||||
case 5: /* Help... (Insert) */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-hotlist-view.html"),
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-hotlist-view.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
}
|
||||
@@ -732,12 +732,12 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
Widget eht_form, title_label, url_label, url_val, sep2;
|
||||
edit_or_insert_hot_info *eht_info;
|
||||
Widget togm, togm2, insert_tog, append_tog;
|
||||
|
||||
|
||||
XmxSetUniqid (win->id);
|
||||
eht_info = (edit_or_insert_hot_info *)
|
||||
malloc(sizeof(edit_or_insert_hot_info));
|
||||
XmxSetArg (XmNuserData, (XtArgVal)eht_info);
|
||||
ed_or_ins_w = XmxMakeFormDialog
|
||||
ed_or_ins_w = XmxMakeFormDialog
|
||||
(win->hotlist_win, isInsert ? "NCSA Mosaic: Insert Hotlist Entry" :
|
||||
"NCSA Mosaic: Edit Hotlist Entry" );
|
||||
XtAddCallback(ed_or_ins_w, XmNdestroyCallback, mo_destroy_hot,
|
||||
@@ -751,19 +751,19 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
dialog_frame = XmxMakeFrame (ed_or_ins_w, XmxShadowOut);
|
||||
|
||||
/* Constraints for ed_or_ins_w. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
eht_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
title_label = XmxMakeLabel (eht_form, "Entry Title:" );
|
||||
XmxSetArg (XmNwidth, 335);
|
||||
eht_info->title_text = XmxMakeTextField (eht_form);
|
||||
XmxAddCallbackToText (eht_info->title_text, edit_or_insert_hot_cb,
|
||||
isInsert*3);
|
||||
|
||||
|
||||
eht_info->url_lab =
|
||||
url_label = XmxMakeLabel (eht_form, "URL:" );
|
||||
|
||||
@@ -803,12 +803,12 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
XmNset, True, NULL);
|
||||
sep2 = XmxMakeHorizontalSeparator (eht_form);
|
||||
}
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtons
|
||||
(eht_form, edit_or_insert_hot_cb, "Save" ,
|
||||
(eht_form, edit_or_insert_hot_cb, "Save" ,
|
||||
"Dismiss" , "Help..." ,
|
||||
isInsert*3, isInsert*3+1, isInsert*3+2);
|
||||
|
||||
|
||||
/* Constraints for eht_form. */
|
||||
XmxSetOffsets (title_label, 14, 0, 10, 0);
|
||||
XmxSetConstraints
|
||||
@@ -818,7 +818,7 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
XmxSetConstraints
|
||||
(eht_info->title_text, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, NULL, NULL, title_label, NULL);
|
||||
|
||||
|
||||
XmxSetOffsets (url_label, 12, 0, 10, 0);
|
||||
XmxSetConstraints
|
||||
(url_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_NONE,
|
||||
@@ -829,8 +829,8 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
XmATTACH_FORM, title_label, NULL, url_label, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
url_val, isInsert ? togm : buttons_form, NULL, NULL);
|
||||
if (isInsert)
|
||||
@@ -851,15 +851,15 @@ static mo_status mo_create_ed_or_ins_hot_win (mo_window *win, int isInsert)
|
||||
(sep2, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM, NULL, buttons_form, NULL, NULL);
|
||||
}
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static mo_status mo_do_edit_hotnode_title_win (mo_window *win, mo_hot_item
|
||||
*item, int position)
|
||||
{
|
||||
@@ -868,7 +868,7 @@ static mo_status mo_do_edit_hotnode_title_win (mo_window *win, mo_hot_item
|
||||
/* This shouldn't happen. */
|
||||
if (!win->hotlist_win)
|
||||
return mo_fail;
|
||||
|
||||
|
||||
if (!win->edithot_win)
|
||||
mo_create_ed_or_ins_hot_win (win, 0);
|
||||
|
||||
@@ -880,7 +880,7 @@ static mo_status mo_do_edit_hotnode_title_win (mo_window *win, mo_hot_item
|
||||
|
||||
/* Manage the little sucker. */
|
||||
XmxManageRemanage (win->edithot_win);
|
||||
|
||||
|
||||
/* Insert this title as a starting point. */
|
||||
XmxTextSetString (eht_info->title_text, item->hot.title);
|
||||
|
||||
@@ -915,7 +915,7 @@ static mo_status mo_edit_title_in_current_hotlist (mo_window *win,
|
||||
{
|
||||
mo_hotlist *list = win->current_hotlist;
|
||||
mo_hot_item *hotnode;
|
||||
|
||||
|
||||
FindHotFromPos(hotnode, list, position);
|
||||
|
||||
/* OK, now we have hotnode loaded. */
|
||||
@@ -963,7 +963,7 @@ static mo_status mo_rbm_toggle_in_hotlist(mo_window *win,int position) {
|
||||
|
||||
mo_hotlist *list = win->current_hotlist;
|
||||
mo_hot_item *hotnode;
|
||||
|
||||
|
||||
FindHotFromPos(hotnode, list, position);
|
||||
|
||||
if (!hotnode) { /* How did this happen? */
|
||||
@@ -1038,7 +1038,7 @@ static void mo_insert_item_in_current_hotlist(mo_window *win)
|
||||
}
|
||||
|
||||
mo_reinit_hotmenu();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1049,7 +1049,7 @@ static void mo_insert_item_in_current_hotlist(mo_window *win)
|
||||
static mo_root_hotlist *mo_new_root_hotlist (char *filename, char *title)
|
||||
{
|
||||
mo_root_hotlist *list;
|
||||
|
||||
|
||||
list = (mo_root_hotlist *)malloc (sizeof (mo_root_hotlist));
|
||||
list->type = mo_t_list;
|
||||
list->nodelist = list->nodelist_last = 0;
|
||||
@@ -1194,9 +1194,9 @@ static mo_root_hotlist *mo_read_hotlist (char *filename, char *home)
|
||||
|
||||
/* amb - display update message for 2.4 users */
|
||||
{
|
||||
fputs("Your hotlist file has been updated and is now saved as:\n",
|
||||
fputs("Your hotlist file has been updated and is now saved as:\n",
|
||||
stderr);
|
||||
fputs(filename, stderr);
|
||||
fputs(filename, stderr);
|
||||
putc('\n', stderr);
|
||||
}
|
||||
/* Hey, whaddaya know, it is. */
|
||||
@@ -1206,11 +1206,11 @@ static mo_root_hotlist *mo_read_hotlist (char *filename, char *home)
|
||||
while (1)
|
||||
{
|
||||
mo_hotnode *node;
|
||||
|
||||
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto done;
|
||||
|
||||
|
||||
/* We've got a new node. */
|
||||
node = (mo_hotnode *)malloc (sizeof (mo_hotnode));
|
||||
node->type = mo_t_url;
|
||||
@@ -1237,16 +1237,16 @@ static mo_root_hotlist *mo_read_hotlist (char *filename, char *home)
|
||||
free (node);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
node->title = strtok (line, "\n");
|
||||
if (!node->title)
|
||||
goto screwed_open_file;
|
||||
node->title = strdup (node->title);
|
||||
mo_convert_newlines_to_spaces (node->title);
|
||||
|
||||
|
||||
mo_append_item_to_hotlist ((mo_hotlist *)list, (mo_hot_item *)node);
|
||||
}
|
||||
|
||||
|
||||
done:
|
||||
fclose (fp);
|
||||
return list;
|
||||
@@ -1285,12 +1285,12 @@ mo_status mo_dump_hotlist (mo_hotlist *list)
|
||||
Upon program startup an attempt will be made to load it out
|
||||
of its file; if this attempt isn't successful, it just plain
|
||||
doesn't exist yet. Bummer.
|
||||
|
||||
|
||||
Upon program exit it will be stored to its file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Called on initialization.
|
||||
* Called on initialization.
|
||||
* Tries to load the default hotlist.
|
||||
*/
|
||||
mo_status mo_setup_default_hotlist (void)
|
||||
@@ -1299,12 +1299,12 @@ mo_status mo_setup_default_hotlist (void)
|
||||
char *default_filename = get_pref_string(eDEFAULT_HOTLIST_FILE);
|
||||
char *hot_filename = get_pref_string(eDEFAULT_HOT_FILE);
|
||||
char *filename;
|
||||
|
||||
|
||||
/* This shouldn't happen. */
|
||||
if (!home)
|
||||
home = "/tmp";
|
||||
|
||||
filename = (char *)malloc
|
||||
|
||||
filename = (char *)malloc
|
||||
((strlen (home) + strlen (default_filename) + 8) * sizeof (char));
|
||||
sprintf (filename, "%s/%s", home, default_filename);
|
||||
|
||||
@@ -1318,12 +1318,12 @@ mo_status mo_setup_default_hotlist (void)
|
||||
/* sprintf(filename, "%s/%s.html", home, default_filename); */
|
||||
/* New hotlist format... SWP */
|
||||
free(filename);
|
||||
filename = (char *)malloc
|
||||
filename = (char *)malloc
|
||||
((strlen (home) + strlen (hot_filename) + 8) * sizeof (char));
|
||||
sprintf (filename, "%s/%s", home, hot_filename);
|
||||
default_hotlist = mo_new_root_hotlist (filename, "Default");
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -1509,7 +1509,7 @@ static void delete_hot_from_list (mo_hotlist *list, mo_hot_item *hotnode,
|
||||
free (hotnode);
|
||||
/* Recalculate positions in this hotlist. */
|
||||
mo_recalculate_hotlist_positions (list);
|
||||
|
||||
|
||||
/* Do the GUI stuff. */
|
||||
while (win = mo_next_window (win))
|
||||
{
|
||||
@@ -1519,12 +1519,12 @@ static void delete_hot_from_list (mo_hotlist *list, mo_hot_item *hotnode,
|
||||
win->hot_cut_buffer = NULL;
|
||||
}
|
||||
mo_reinit_hotmenu();
|
||||
|
||||
|
||||
}
|
||||
|
||||
static XmxCallback (remove_confirm_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
(XmxExtractUniqid ((int)client_data));
|
||||
int position = XmxExtractToken ((int)client_data);
|
||||
|
||||
@@ -1543,12 +1543,12 @@ static mo_status mo_delete_position_from_current_hotlist (mo_window *win,
|
||||
{
|
||||
mo_hotlist *list = win->current_hotlist;
|
||||
mo_hot_item *hotnode;
|
||||
|
||||
|
||||
FindHotFromPos(hotnode, list, position);
|
||||
|
||||
if (hotnode == NULL)
|
||||
return mo_fail;
|
||||
|
||||
|
||||
/* OK, now we have hotnode loaded. */
|
||||
|
||||
if (hotnode->type == mo_t_list)
|
||||
@@ -1586,7 +1586,7 @@ static mo_status mo_delete_position_from_current_hotlist (mo_window *win,
|
||||
|
||||
static XmxCallback (mailhot_win_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
mo_window *win = mo_fetch_window_by_id
|
||||
(XmxExtractUniqid ((int)client_data));
|
||||
char *to, *subj;
|
||||
FILE *fp;
|
||||
@@ -1616,13 +1616,13 @@ static XmxCallback (mailhot_win_cb)
|
||||
}
|
||||
|
||||
mo_finish_sending_mail_message ();
|
||||
|
||||
|
||||
oops:
|
||||
free (to);
|
||||
free (subj);
|
||||
|
||||
mo_not_busy ();
|
||||
|
||||
|
||||
break;
|
||||
case 1:
|
||||
XtUnmanageChild (win->mailhot_win);
|
||||
@@ -1630,8 +1630,8 @@ static XmxCallback (mailhot_win_cb)
|
||||
break;
|
||||
case 2:
|
||||
mo_open_another_window
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-hotlist-view.html"),
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-hotlist-view.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
}
|
||||
@@ -1650,32 +1650,32 @@ static mo_status mo_post_mailhot_win (mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget mailhot_form, to_label, subj_label;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->mailhot_win = XmxMakeFormDialog
|
||||
win->mailhot_win = XmxMakeFormDialog
|
||||
(win->hotlist_win, "NCSA Mosaic: Mail Hotlist" );
|
||||
dialog_frame = XmxMakeFrame (win->mailhot_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
mailhot_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
to_label = XmxMakeLabel (mailhot_form, "Mail To:" );
|
||||
XmxSetArg (XmNwidth, 335);
|
||||
win->mailhot_to_text = XmxMakeTextField (mailhot_form);
|
||||
|
||||
|
||||
subj_label = XmxMakeLabel (mailhot_form, "Subject:" );
|
||||
win->mailhot_subj_text = XmxMakeTextField (mailhot_form);
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (mailhot_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtons
|
||||
(mailhot_form, mailhot_win_cb, "Mail" ,
|
||||
(mailhot_form, mailhot_win_cb, "Mail" ,
|
||||
"Dismiss" , "Help..." , 0, 1, 2);
|
||||
|
||||
/* Constraints for mailhot_form. */
|
||||
@@ -1690,28 +1690,28 @@ static mo_status mo_post_mailhot_win (mo_window *win)
|
||||
|
||||
XmxSetOffsets (subj_label, 14, 0, 10, 0);
|
||||
XmxSetConstraints
|
||||
(subj_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(subj_label, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE,
|
||||
win->mailhot_to_text, NULL, NULL, NULL);
|
||||
XmxSetOffsets (win->mailhot_subj_text, 10, 0, 5, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailhot_subj_text, XmATTACH_WIDGET,
|
||||
(win->mailhot_subj_text, XmATTACH_WIDGET,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, win->mailhot_to_text, NULL, subj_label, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
win->mailhot_subj_text, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
XtManageChild (win->mailhot_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -1769,7 +1769,7 @@ static XmxCallback (hotlist_win_cb)
|
||||
break;
|
||||
case 2:
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-hotlist-view.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -1963,9 +1963,9 @@ static XmxCallback (hotlist_list_cb)
|
||||
URL_Include_Set(win,0,0);
|
||||
|
||||
mo_visit_hotlist_position (win, cs->item_position);
|
||||
|
||||
|
||||
/* Don't unmanage the list. */
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1993,15 +1993,15 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
XmxSetUniqid (win->id);
|
||||
XmxSetArg (XmNwidth, 475);
|
||||
XmxSetArg (XmNheight, 342);
|
||||
win->hotlist_win = XmxMakeFormDialog
|
||||
win->hotlist_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Hotlist View" );
|
||||
dialog_frame = XmxMakeFrame (win->hotlist_win, XmxShadowOut);
|
||||
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
hotlist_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
@@ -2013,10 +2013,10 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
|
||||
buttons1_form = XmxMakeFormAndFourButtons
|
||||
(hotlist_form, hotlist_win_cb, "Add Current" ,
|
||||
"Goto URL" , "Remove" ,
|
||||
"Goto URL" , "Remove" ,
|
||||
"Edit" , 3, 4, 5, 6);
|
||||
buttons2_form = XmxMakeFormAndThreeButtons
|
||||
(hotlist_form, hotlist_win_cb, "Copy" ,
|
||||
(hotlist_form, hotlist_win_cb, "Copy" ,
|
||||
"Insert" , "Up" ,
|
||||
7, 8, 9);
|
||||
XmxSetArg (XmNfractionBase, (XtArgVal)4);
|
||||
@@ -2027,7 +2027,7 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
XmxSetArg (XmNresizable, False);
|
||||
XmxSetArg (XmNscrollBarDisplayPolicy, XmSTATIC);
|
||||
XmxSetArg (XmNlistSizePolicy, XmCONSTANT);
|
||||
win->hotlist_list =
|
||||
win->hotlist_list =
|
||||
XmxMakeScrolledList (hotlist_form, hotlist_list_cb, 0);
|
||||
XtAugmentTranslations (win->hotlist_list, listTable);
|
||||
XtAddCallback(win->hotlist_list,
|
||||
@@ -2041,7 +2041,7 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
URL_Include_Set(win,0,0);
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (hotlist_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndFiveButtons(hotlist_form,
|
||||
hotlist_win_cb,
|
||||
"Mail To...",
|
||||
@@ -2054,7 +2054,7 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
11,
|
||||
0,
|
||||
2);
|
||||
|
||||
|
||||
/* Constraints for hotlist_form. */
|
||||
/* buttons1_form: top to nothing, bottom to hotlist_list,
|
||||
left to form, right to form. */
|
||||
@@ -2064,32 +2064,32 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
XmxSetOffsets (buttons1_form, 0, 0, 0, 0);
|
||||
XmxSetConstraints
|
||||
(buttons1_form,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
(buttons1_form,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
win->hotlist_label, NULL, NULL, NULL);
|
||||
XmxSetOffsets (buttons2_form, 0, 2, 0, 0);
|
||||
XmxSetConstraints
|
||||
(buttons2_form,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
(buttons2_form,
|
||||
XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
buttons1_form, NULL, NULL, NULL);
|
||||
/* list: top to form, bottom to rbm_toggle,
|
||||
etc... */
|
||||
XmxSetOffsets (XtParent (win->hotlist_list), 10, 10, 8, 8);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->hotlist_list),
|
||||
XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
(XtParent (win->hotlist_list),
|
||||
XmATTACH_WIDGET, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
buttons2_form, win->hotlist_rbm_toggle, NULL, NULL);
|
||||
XmxSetOffsets (win->hotlist_rbm_toggle, 0, 10, 6, 6);
|
||||
XmxSetConstraints
|
||||
(win->hotlist_rbm_toggle,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_NONE,
|
||||
(win->hotlist_rbm_toggle,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_NONE,
|
||||
NULL, dialog_sep, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmxSetConstraints
|
||||
(dialog_sep,
|
||||
XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
win->save_hotlist_win = win->load_hotlist_win = NULL;
|
||||
@@ -2097,9 +2097,9 @@ mo_status mo_post_hotlist_win (mo_window *win)
|
||||
/* Go get the hotlist up to this point set up... */
|
||||
mo_load_hotlist_list (win, win->hotlist_list);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->hotlist_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
60
src/img.c
60
src/img.c
@@ -284,17 +284,17 @@ ImageInfo *ImageResolve (Widget w, char *src, int noload, char *wid, char *hei)
|
||||
while(*src != '\n') src++;
|
||||
*src='\0';
|
||||
src++;
|
||||
|
||||
|
||||
goto stuffcache;
|
||||
}
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
fprintf (stderr,
|
||||
"[ImageResolve] I'm entering, src '%s', noload %d!\n",
|
||||
src, noload);
|
||||
#endif
|
||||
|
||||
|
||||
if (!src)
|
||||
return NULL;
|
||||
|
||||
@@ -313,14 +313,14 @@ ImageInfo *ImageResolve (Widget w, char *src, int noload, char *wid, char *hei)
|
||||
if (win->scrolled_win == w)
|
||||
{
|
||||
mo_set_current_cached_win (win);
|
||||
|
||||
|
||||
cached_url = win->current_node ? win->current_node->url : "lose";
|
||||
win->cached_url = cached_url;
|
||||
|
||||
|
||||
goto foundit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Shit outta luck. */
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
@@ -328,7 +328,7 @@ ImageInfo *ImageResolve (Widget w, char *src, int noload, char *wid, char *hei)
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
|
||||
|
||||
foundit:
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
@@ -344,7 +344,7 @@ foundit:
|
||||
if(strstr(cached_url, imagekill_sites[i])) {
|
||||
extern Widget view; /*hw->html.view*/
|
||||
Widget swin = current_win->scrolled_win;
|
||||
|
||||
|
||||
if (!done_fetch_colors){
|
||||
if (!view)
|
||||
return NULL;
|
||||
@@ -354,24 +354,24 @@ foundit:
|
||||
XtNbackground, &bg_pixel,
|
||||
NULL);
|
||||
done_fetch_colors = 1;
|
||||
}
|
||||
}
|
||||
RETURN_IMGINFO_FROM_BITMAP(blank);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* Internal images. */
|
||||
if (strncmp (src, "internal-", 9) == 0)
|
||||
{
|
||||
{
|
||||
|
||||
if (!done_fetch_colors)
|
||||
{
|
||||
|
||||
if (!view)
|
||||
return NULL;
|
||||
|
||||
|
||||
/* First, go fetch the pixels. */
|
||||
XtVaGetValues(view,
|
||||
XtNforeground, &fg_pixel,
|
||||
@@ -476,7 +476,7 @@ stuffcache:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
fprintf (stderr, "GOING ON THROUGH...\n");
|
||||
@@ -491,14 +491,14 @@ stuffcache:
|
||||
if (ishdf)
|
||||
{
|
||||
img_data =
|
||||
(ImageInfo *)hdfGrokImage
|
||||
(mo_hdf_fetch_local_filename (src),
|
||||
(ImageInfo *)hdfGrokImage
|
||||
(mo_hdf_fetch_local_filename (src),
|
||||
hdfref,
|
||||
&bg);
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
fprintf (stderr, "[ImageResolve] Did hdfGrokImage, got back 0x%08x\n",
|
||||
fprintf (stderr, "[ImageResolve] Did hdfGrokImage, got back 0x%08x\n",
|
||||
img_data);
|
||||
#endif
|
||||
|
||||
@@ -533,7 +533,7 @@ stuffcache:
|
||||
/* if w is NULL we're stuffing the cache with our own info...
|
||||
BJS */
|
||||
if(w) {
|
||||
|
||||
|
||||
/* We have to load the image. */
|
||||
fnam = mo_tmpnam(src);
|
||||
|
||||
@@ -550,11 +550,11 @@ stuffcache:
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace)
|
||||
fprintf (stderr,
|
||||
"[ImageResolve] Got through mo_pull_er_over_virgin, rc %d\n",
|
||||
fprintf (stderr,
|
||||
"[ImageResolve] Got through mo_pull_er_over_virgin, rc %d\n",
|
||||
rc);
|
||||
#endif
|
||||
|
||||
@@ -575,7 +575,7 @@ stuffcache:
|
||||
/* Send it through CCI if need be */
|
||||
MoCCISendBrowserViewFile(src, "unknown", fnam);
|
||||
}
|
||||
|
||||
|
||||
data = ReadBitmap(fnam, &width, &height, colrs, &bg);
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -610,13 +610,13 @@ stuffcache:
|
||||
|
||||
bg_map = (unsigned char *)malloc(width * height);
|
||||
}
|
||||
|
||||
|
||||
/* Now delete the file. */
|
||||
unlink(fnam);
|
||||
unlink(fnam);
|
||||
{
|
||||
char *hfnam = (char *)malloc ((strlen (fnam) + strlen(".html") + 5) * sizeof (char));
|
||||
sprintf (hfnam, "%s.html", fnam);
|
||||
unlink(hfnam);
|
||||
unlink(hfnam);
|
||||
free(hfnam);
|
||||
}
|
||||
|
||||
@@ -728,10 +728,10 @@ int found_bg=0;
|
||||
*/
|
||||
if ((cnt > get_pref_int(eCOLORS_PER_INLINED_IMAGE))&&(Vclass != TrueColor))
|
||||
{
|
||||
MedianCut(img_data->image_data, &img_data->width,
|
||||
&img_data->height, colrs, 256,
|
||||
MedianCut(img_data->image_data, &img_data->width,
|
||||
&img_data->height, colrs, 256,
|
||||
get_pref_int(eCOLORS_PER_INLINED_IMAGE));
|
||||
|
||||
|
||||
for (i=0; i < 256; i++)
|
||||
Used[i] = 0;
|
||||
cnt = 1;
|
||||
@@ -770,7 +770,7 @@ int found_bg=0;
|
||||
for (i=0; i < 256; i++)
|
||||
{
|
||||
int indx;
|
||||
|
||||
|
||||
if (Used[i] != 0)
|
||||
{
|
||||
indx = Used[i] - 1;
|
||||
@@ -796,7 +796,7 @@ int found_bg=0;
|
||||
img_data->blues[cnt - 1] = bg_blue;
|
||||
img_data->bg_index=(cnt-1);
|
||||
}
|
||||
|
||||
|
||||
bgptr = bg_map;
|
||||
cptr = img_data->clip_data;
|
||||
ptr = img_data->image_data;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ struct LISTINSTANCE {
|
||||
struct LISTSTRUCT {
|
||||
struct LISTINSTANCE *head;
|
||||
struct LISTINSTANCE *tail;
|
||||
struct LISTINSTANCE *current;
|
||||
struct LISTINSTANCE *current;
|
||||
int listCount;
|
||||
};
|
||||
|
||||
|
||||
142
src/mailto.c
142
src/mailto.c
@@ -72,9 +72,9 @@ extern char pre_title[80];
|
||||
|
||||
extern mo_window *current_win;
|
||||
mo_status mo_post_mailto_form_win (char *to_address, char *subject);
|
||||
mo_status mo_send_mailto_message (char *text, char *to, char *subj,
|
||||
mo_status mo_send_mailto_message (char *text, char *to, char *subj,
|
||||
char *content_type, char *url);
|
||||
void do_mailto_post(mo_window *win, char *to, char *from, char *subject,
|
||||
void do_mailto_post(mo_window *win, char *to, char *from, char *subject,
|
||||
char *body);
|
||||
|
||||
/* ----------------------- mo_post_mailto_window ------------------------ */
|
||||
@@ -91,7 +91,7 @@ static XmxCallback (include_fsb_cb)
|
||||
|
||||
XtUnmanageChild (win->mail_fsb_win);
|
||||
fname = (char *)malloc (128 * sizeof (char));
|
||||
|
||||
|
||||
XmStringGetLtoR (((XmFileSelectionBoxCallbackStruct *)call_data)->value,
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&fname);
|
||||
@@ -119,8 +119,8 @@ static XmxCallback (include_fsb_cb)
|
||||
sprintf(final+strlen(final),"\nOpen Error:\n");
|
||||
sprintf(final+strlen(final)," %s\n",buf);
|
||||
|
||||
XmxMakeErrorDialog (win->mailto_win,
|
||||
final,
|
||||
XmxMakeErrorDialog (win->mailto_win,
|
||||
final,
|
||||
"Open Error");
|
||||
XtManageChild (Xmx_w);
|
||||
|
||||
@@ -130,14 +130,14 @@ static XmxCallback (include_fsb_cb)
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
long pos;
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
break;
|
||||
|
||||
|
||||
XmTextInsert (win->mailto_text,
|
||||
pos = XmTextGetInsertionPosition (win->mailto_text),
|
||||
line);
|
||||
@@ -154,24 +154,24 @@ static XmxCallback (mailto_win_cb)
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
char *msg, *subj, *to;
|
||||
long pos;
|
||||
|
||||
|
||||
|
||||
|
||||
switch (XmxExtractToken ((int)client_data))
|
||||
{
|
||||
case 0: /* send */
|
||||
XtUnmanageChild (win->mailto_win);
|
||||
|
||||
|
||||
msg = XmxTextGetString (win->mailto_text);
|
||||
if (!msg)
|
||||
return;
|
||||
if (msg[0] == '\0')
|
||||
return;
|
||||
|
||||
|
||||
|
||||
to = XmxTextGetString (win->mailto_tofield);
|
||||
subj = XmxTextGetString (win->mailto_subfield);
|
||||
|
||||
mo_send_mailto_message (msg, to, subj, "text/plain",
|
||||
mo_send_mailto_message (msg, to, subj, "text/plain",
|
||||
win->current_node->url);
|
||||
free (msg);
|
||||
free (to);
|
||||
@@ -179,16 +179,16 @@ static XmxCallback (mailto_win_cb)
|
||||
|
||||
break;
|
||||
case 1: /* dismiss */
|
||||
XtUnmanageChild (win->mailto_win);
|
||||
XtUnmanageChild (win->mailto_win);
|
||||
/* Do nothing. */
|
||||
break;
|
||||
case 2: /* help */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-mailto.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
|
||||
|
||||
case 3: /* insert file */
|
||||
if (!win->mail_fsb_win) {
|
||||
win->mail_fsb_win = XmxMakeFileSBDialog
|
||||
@@ -199,7 +199,7 @@ static XmxCallback (mailto_win_cb)
|
||||
} else {
|
||||
XmFileSelectionDoSearch (win->mail_fsb_win, NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->mail_fsb_win);
|
||||
break;
|
||||
case 4:
|
||||
@@ -222,12 +222,12 @@ static XmxCallback (mailto_form_win_cb)
|
||||
{
|
||||
mo_window *win = mo_fetch_window_by_id (XmxExtractUniqid ((int)client_data));
|
||||
char *subj, *to, *namestr;
|
||||
|
||||
|
||||
switch (XmxExtractToken ((int)client_data))
|
||||
{
|
||||
case 0: /* send */
|
||||
XtUnmanageChild (win->mailto_form_win);
|
||||
|
||||
|
||||
to = XmxTextGetString (win->mailto_form_tofield);
|
||||
subj = XmxTextGetString (win->mailto_form_subfield);
|
||||
namestr = XmxTextGetString(win->mailto_form_fromfield);
|
||||
@@ -244,7 +244,7 @@ static XmxCallback (mailto_form_win_cb)
|
||||
|
||||
break;
|
||||
case 1: /* dismiss */
|
||||
XtUnmanageChild (win->mailto_form_win);
|
||||
XtUnmanageChild (win->mailto_form_win);
|
||||
/* Do nothing. */
|
||||
if (win->post_data) {
|
||||
free (win->post_data);
|
||||
@@ -254,7 +254,7 @@ static XmxCallback (mailto_form_win_cb)
|
||||
break;
|
||||
case 2: /* help */
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-mailto-form.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -289,21 +289,21 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget mailto_form;
|
||||
Widget tolabel, sublabel, fromlabel;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->mailto_win = XmxMakeFormDialog
|
||||
win->mailto_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Mail To Author");
|
||||
dialog_frame = XmxMakeFrame (win->mailto_win, XmxShadowOut);
|
||||
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
mailto_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
|
||||
XmxSetArg (XmNscrolledWindowMarginHeight, 10);
|
||||
XmxSetArg (XmNcursorPositionVisible, True);
|
||||
@@ -314,7 +314,7 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
/* XmxSetArg (XmNwordWrap, True); */
|
||||
/* XmxSetArg (XmNscrollHorizontal, False); */
|
||||
win->mailto_text = XmxMakeScrolledText (mailto_form);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (mailto_form);
|
||||
|
||||
/* create from, to, and subject widgets */
|
||||
@@ -331,7 +331,7 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
/* constraints for FROM */
|
||||
XmxSetOffsets(fromlabel, 14, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(fromlabel, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(fromlabel, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE, NULL, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_fromfield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
@@ -345,18 +345,18 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
win->mailto_fromfield, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_tofield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailto_tofield, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
(win->mailto_tofield, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, win->mailto_fromfield, NULL, tolabel, NULL);
|
||||
|
||||
/* constraints for SUBJECT */
|
||||
XmxSetOffsets(sublabel, 14, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(sublabel, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(sublabel, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE, win->mailto_tofield, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_subfield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailto_subfield, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_FORM, win->mailto_tofield, NULL,
|
||||
(win->mailto_subfield, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_FORM, win->mailto_tofield, NULL,
|
||||
sublabel, NULL);
|
||||
|
||||
/* create buttons */
|
||||
@@ -367,17 +367,17 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
|
||||
XmxSetOffsets (XtParent (win->mailto_text), 3, 0, 3, 3);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->mailto_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
(XtParent (win->mailto_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, XmATTACH_FORM,
|
||||
win->mailto_subfield, dialog_sep, NULL, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
|
||||
sprintf(namestr, "%s <%s>", get_pref_string(eDEFAULT_AUTHOR_NAME),
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
|
||||
|
||||
XmxTextSetString (win->mailto_fromfield, namestr);
|
||||
XmxTextSetString (win->mailto_tofield, to_address);
|
||||
if (!subject || !*subject) {
|
||||
@@ -399,7 +399,7 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
}
|
||||
|
||||
XmxTextSetString (win->mailto_text, "");
|
||||
|
||||
|
||||
/* tack signature on the end if it exists - code from Martin Hamilton */
|
||||
if (get_pref_string(eSIGNATURE)) {
|
||||
XmxTextSetString (win->mailto_text, "\n\n");
|
||||
@@ -416,10 +416,10 @@ mo_status mo_post_mailto_win (char *to_address, char *subject)
|
||||
} else {
|
||||
XmxTextSetString (win->mailto_text, "");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
XmTextSetInsertionPosition (win->mailto_text, 0);
|
||||
|
||||
|
||||
XmxManageRemanage (win->mailto_win);
|
||||
|
||||
return mo_succeed;
|
||||
@@ -507,21 +507,21 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget mailto_form_form;
|
||||
Widget tolabel, sublabel, fromlabel;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->mailto_form_win = XmxMakeFormDialog
|
||||
win->mailto_form_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Mail Form Results To Author");
|
||||
dialog_frame = XmxMakeFrame (win->mailto_form_win, XmxShadowOut);
|
||||
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
mailto_form_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
|
||||
XmxSetArg (XmNscrolledWindowMarginHeight, 10);
|
||||
XmxSetArg (XmNcursorPositionVisible, True);
|
||||
@@ -532,7 +532,7 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
XmxSetArg (XmNwordWrap, True);
|
||||
XmxSetArg (XmNscrollHorizontal, False);
|
||||
win->mailto_form_text = XmxMakeScrolledText (mailto_form_form);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (mailto_form_form);
|
||||
|
||||
/* create from, to, and subject widgets */
|
||||
@@ -551,7 +551,7 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
/* constraints for FROM */
|
||||
XmxSetOffsets(fromlabel, 14, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(fromlabel, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(fromlabel, XmATTACH_FORM, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE, NULL, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_form_fromfield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
@@ -565,18 +565,18 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
win->mailto_form_fromfield, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_form_tofield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailto_form_tofield, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
(win->mailto_form_tofield, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, win->mailto_form_fromfield, NULL, tolabel, NULL);
|
||||
|
||||
/* constraints for SUBJECT */
|
||||
XmxSetOffsets(sublabel, 14, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(sublabel, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
(sublabel, XmATTACH_WIDGET, XmATTACH_NONE, XmATTACH_FORM,
|
||||
XmATTACH_NONE, win->mailto_form_tofield, NULL, NULL, NULL);
|
||||
XmxSetOffsets(win->mailto_form_subfield, 10, 10, 10, 10);
|
||||
XmxSetConstraints
|
||||
(win->mailto_form_subfield, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_FORM, win->mailto_form_tofield, NULL,
|
||||
(win->mailto_form_subfield, XmATTACH_WIDGET, XmATTACH_NONE,
|
||||
XmATTACH_WIDGET, XmATTACH_FORM, win->mailto_form_tofield, NULL,
|
||||
sublabel, NULL);
|
||||
|
||||
/* create buttons */
|
||||
@@ -587,17 +587,17 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
|
||||
XmxSetOffsets (XtParent (win->mailto_form_text), 3, 0, 3, 3);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->mailto_form_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
(XtParent (win->mailto_form_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, XmATTACH_FORM,
|
||||
win->mailto_form_subfield, dialog_sep, NULL, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -605,7 +605,7 @@ mo_status mo_post_mailto_form_win (char *to_address, char *subject)
|
||||
|
||||
sprintf(namestr, "%s <%s>", get_pref_string(eDEFAULT_AUTHOR_NAME),
|
||||
get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
|
||||
|
||||
XmxTextSetString (win->mailto_form_fromfield, namestr);
|
||||
XmxTextSetString (win->mailto_form_tofield, to_address);
|
||||
if (subject != NULL)
|
||||
@@ -650,7 +650,7 @@ void do_mailto_post(mo_window *win, char *to, char *from, char *subject, char *b
|
||||
}
|
||||
#endif
|
||||
|
||||
mo_send_mailto_message(buf, to, subject, post_content_type,
|
||||
mo_send_mailto_message(buf, to, subject, post_content_type,
|
||||
win->current_node->url);
|
||||
|
||||
if (buf) {
|
||||
@@ -664,7 +664,7 @@ void do_mailto_post(mo_window *win, char *to, char *from, char *subject, char *b
|
||||
}
|
||||
#endif
|
||||
|
||||
mo_send_mailto_message(body, to, subject, post_content_type,
|
||||
mo_send_mailto_message(body, to, subject, post_content_type,
|
||||
win->current_node->url);
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ void do_mailto_post(mo_window *win, char *to, char *from, char *subject, char *b
|
||||
|
||||
static FILE *_fp = NULL;
|
||||
|
||||
FILE *mo_start_sending_mailto_message (char *to, char *subj,
|
||||
FILE *mo_start_sending_mailto_message (char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
char cmd[2048];
|
||||
@@ -686,10 +686,10 @@ FILE *mo_start_sending_mailto_message (char *to, char *subj,
|
||||
|
||||
if (!to)
|
||||
return NULL;
|
||||
|
||||
|
||||
if (get_pref_string(eMAIL_FILTER_COMMAND))
|
||||
{
|
||||
sprintf (cmd, "%s | %s", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
sprintf (cmd, "%s | %s", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
get_pref_string(eSENDMAIL_COMMAND));
|
||||
}
|
||||
else
|
||||
@@ -704,15 +704,15 @@ FILE *mo_start_sending_mailto_message (char *to, char *subj,
|
||||
fprintf (_fp, "Subject: %s\n", subj);
|
||||
fprintf (_fp, "Content-Type: %s\n", content_type);
|
||||
fprintf (_fp, "Mime-Version: 1.0\n");
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
MO_VERSION_STRING, MO_MACHINE_TYPE);
|
||||
if (url)
|
||||
fprintf (_fp, "X-URL: %s\n", url);
|
||||
|
||||
fprintf (_fp, "\n");
|
||||
|
||||
|
||||
/* Stick in BASE tag as appropriate. */
|
||||
if (url && content_type &&
|
||||
if (url && content_type &&
|
||||
strcmp (content_type, "text/x-html") == 0)
|
||||
fprintf (_fp, "<base href=\"%s\">\n", url);
|
||||
|
||||
@@ -731,7 +731,7 @@ mo_status mo_finish_sending_mailto_message (void)
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
mo_status mo_send_mailto_message (char *text, char *to, char *subj,
|
||||
mo_status mo_send_mailto_message (char *text, char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -739,7 +739,7 @@ mo_status mo_send_mailto_message (char *text, char *to, char *subj,
|
||||
fp = mo_start_sending_mailto_message (to, subj, content_type, url);
|
||||
if (!fp)
|
||||
return mo_fail;
|
||||
|
||||
|
||||
fputs (text, fp);
|
||||
|
||||
mo_finish_sending_mailto_message ();
|
||||
|
||||
12
src/main.c
12
src/main.c
@@ -102,7 +102,7 @@ MO_SIGHANDLER_RETURNTYPE ProcessExternalDirective (MO_SIGHANDLER_ARGS)
|
||||
char filename[64];
|
||||
char line[MO_LINE_LENGTH], *status, *directive, *url;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
|
||||
signal (SIGUSR1, SIG_IGN);
|
||||
|
||||
@@ -127,7 +127,7 @@ MO_SIGHANDLER_RETURNTYPE ProcessExternalDirective (MO_SIGHANDLER_ARGS)
|
||||
url = strdup ("dummy");
|
||||
else
|
||||
url = strdup (line);
|
||||
|
||||
|
||||
mo_process_external_directive (directive, url);
|
||||
|
||||
free (directive);
|
||||
@@ -138,7 +138,7 @@ MO_SIGHANDLER_RETURNTYPE ProcessExternalDirective (MO_SIGHANDLER_ARGS)
|
||||
done:
|
||||
signal (SIGUSR1, (void *)ProcessExternalDirective);
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void RealFatal (void)
|
||||
@@ -163,7 +163,7 @@ static MO_SIGHANDLER_RETURNTYPE FatalProblem
|
||||
#endif /* not __STDC__ */
|
||||
{
|
||||
fprintf (stderr, "\nCongratulations, you have found a bug in\n");
|
||||
fprintf (stderr, "NCSA Mosaic %s on %s.\n\n", MO_VERSION_STRING,
|
||||
fprintf (stderr, "NCSA Mosaic %s on %s.\n\n", MO_VERSION_STRING,
|
||||
MO_MACHINE_TYPE);
|
||||
fprintf (stderr, "If a core file was generated in your directory,\n");
|
||||
fprintf (stderr, "please do one of the following:\n\n");
|
||||
@@ -173,7 +173,7 @@ static MO_SIGHANDLER_RETURNTYPE FatalProblem
|
||||
fprintf (stderr, " %% gdb /path/to/Mosaic /path/to/core\n");
|
||||
fprintf (stderr, " gdb> where\n\n");
|
||||
fprintf (stderr, "Mail the results, and a description of what you were doing at the time,\n");
|
||||
fprintf (stderr, "(include any URLs involved!) to %s.\n\nWe thank you for your support.\n\n",
|
||||
fprintf (stderr, "(include any URLs involved!) to %s.\n\nWe thank you for your support.\n\n",
|
||||
MO_DEVELOPER_ADDRESS);
|
||||
fprintf (stderr, "...exiting NCSA Mosaic now.\n\n");
|
||||
|
||||
@@ -200,7 +200,7 @@ main (int argc, char **argv, char **envp)
|
||||
perror("uname");
|
||||
}
|
||||
else {
|
||||
if (!strcmp(u.sysname,"SunOS") &&
|
||||
if (!strcmp(u.sysname,"SunOS") &&
|
||||
(!strcmp(u.release,"5.0")
|
||||
|| !strcmp(u.release,"5.1")
|
||||
|| !strcmp(u.release,"5.2")
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
10
src/md5.c
10
src/md5.c
@@ -318,7 +318,7 @@ unsigned char block[64];
|
||||
state[1] += b;
|
||||
state[2] += c;
|
||||
state[3] += d;
|
||||
|
||||
|
||||
/* Zeroize sensitive information.*/
|
||||
|
||||
MD5_memset ((POINTER)x, 0, sizeof (x));
|
||||
@@ -378,7 +378,7 @@ int value;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
((char *)output)[i] = (char)value;
|
||||
}
|
||||
@@ -402,7 +402,7 @@ void MD5Mem(unsigned char *mem, long len, unsigned char *result) {
|
||||
MD5Init (&context);
|
||||
MD5Update (&context, mem, len);
|
||||
MD5Final (digest, &context);
|
||||
|
||||
|
||||
memcpy(result, digest, 16);
|
||||
|
||||
}
|
||||
@@ -420,7 +420,7 @@ void MD5File(char *filename, unsigned char *result) {
|
||||
MD5_CTX context;
|
||||
int len;
|
||||
unsigned char buffer[1024], digest[16];
|
||||
|
||||
|
||||
if ((file = fopen (filename, "rb")) == NULL)
|
||||
printf ("%s can't be opened\n", filename);
|
||||
|
||||
@@ -431,7 +431,7 @@ void MD5File(char *filename, unsigned char *result) {
|
||||
MD5Final (digest, &context);
|
||||
|
||||
fclose (file);
|
||||
|
||||
|
||||
memcpy(result, digest, 16);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
/* Author: DXP */
|
||||
|
||||
/* most of this stuff was taken from the original code from RSA Data Security, Inc.
|
||||
/* most of this stuff was taken from the original code from RSA Data Security, Inc.
|
||||
The appropriate header comments will be included where appropriate */
|
||||
|
||||
/**************************************************/
|
||||
|
||||
@@ -350,7 +350,7 @@ int boxnum, color_indx;
|
||||
} /* end while med_cnt */
|
||||
C_boxes[Lesser].count = Low_cnt;
|
||||
C_boxes[Greater].count = High_cnt;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ int e_cnt;
|
||||
while (BoxCount < e_cnt)
|
||||
{
|
||||
int target, color_indx;
|
||||
|
||||
|
||||
target = 0;
|
||||
color_indx = 0;
|
||||
color_indx = FindTarget(&target);
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
28
src/mo-dtm.c
28
src/mo-dtm.c
@@ -64,7 +64,7 @@
|
||||
#include "libhtmlw/HTML.h" /* for ImageInfo */
|
||||
|
||||
/* Creation of an input port implies done_init and done_register
|
||||
as well as done_inport. Creation of an output port implies
|
||||
as well as done_inport. Creation of an output port implies
|
||||
all of these (since an input port is always created prior to
|
||||
creating an output port). */
|
||||
static int done_init = 0; /* called NetInit?? */
|
||||
@@ -77,13 +77,13 @@ static int done_inport = 0; /* called NetCreateInPort?? */
|
||||
mo_status mo_dtm_in (char *path)
|
||||
{
|
||||
NetPort *inport;
|
||||
|
||||
|
||||
if (!done_init)
|
||||
{
|
||||
NetInit ("Mosaic");
|
||||
done_init = 1;
|
||||
}
|
||||
|
||||
|
||||
if (!done_register)
|
||||
{
|
||||
#if 0
|
||||
@@ -95,7 +95,7 @@ mo_status mo_dtm_in (char *path)
|
||||
#endif
|
||||
done_register = 1;
|
||||
}
|
||||
|
||||
|
||||
if (!done_inport)
|
||||
{
|
||||
inport = NetCreateInPort (path);
|
||||
@@ -103,7 +103,7 @@ mo_status mo_dtm_in (char *path)
|
||||
}
|
||||
|
||||
mo_register_dtm_blip ();
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -127,13 +127,13 @@ mo_status mo_dtm_out (char *port)
|
||||
if (!done_outport)
|
||||
{
|
||||
mo_dtm_in (":0");
|
||||
|
||||
|
||||
/* Make the output port. */
|
||||
NetCreateOutPort (port);
|
||||
|
||||
done_outport = 1;
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ mo_status mo_dtm_poll_and_read ()
|
||||
{
|
||||
if (done_inport)
|
||||
NetClientPollAndRead ();
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ mo_status mo_dtm_send_image (void *data)
|
||||
}
|
||||
}
|
||||
|
||||
rv = NetSendRaster8Group
|
||||
rv = NetSendRaster8Group
|
||||
(NULL, "Mosaic Image", img->image_data,
|
||||
img->width, img->height, palette, TRUE, FALSE, NULL);
|
||||
|
||||
@@ -254,10 +254,10 @@ mo_status mo_dtm_send_dataset (void *spanker)
|
||||
Data *d = (Data *) spanker;
|
||||
int rv, i;
|
||||
char palette[768];
|
||||
|
||||
|
||||
if (!mo_dtm_out_active_p ())
|
||||
return mo_fail;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
@@ -276,8 +276,8 @@ mo_status mo_dtm_send_dataset (void *spanker)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
#define COLLAGE_SUCKS
|
||||
|
||||
#define COLLAGE_SUCKS
|
||||
#ifdef COLLAGE_SUCKS
|
||||
rv = NetSendArray
|
||||
(NULL, d, TRUE, FALSE, NULL, (d->rank == 3 ? TRUE : FALSE));
|
||||
@@ -285,7 +285,7 @@ mo_status mo_dtm_send_dataset (void *spanker)
|
||||
rv = NetSendArray
|
||||
(NULL, d, TRUE, FALSE, NULL, TRUE);
|
||||
#endif
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
30
src/mo-hdf.c
30
src/mo-hdf.c
@@ -81,19 +81,19 @@ static char *pull_guts_from_hdfref (char *target)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* name: mo_hdf_fetch_local_filename
|
||||
* purpose: Given an HDF URL (we will canonicalize it), return the
|
||||
* filename of the local cached copy of the file.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL to use.
|
||||
* returns:
|
||||
* returns:
|
||||
* The local filename (char *).
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
char *mo_hdf_fetch_local_filename (char *url)
|
||||
{
|
||||
@@ -112,14 +112,14 @@ char *mo_hdf_fetch_local_filename (char *url)
|
||||
* ), and a target anchor (can be NULL), pull the filename out
|
||||
* of the internal HTML reference and do the right thing
|
||||
* with the resulting HDF file.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL we're visiting.
|
||||
* - char *newtext: The block of HTML containing the internal
|
||||
* HTML reference.
|
||||
* - char *target: The target anchor in the URL, or NULL.
|
||||
* returns:
|
||||
* returns:
|
||||
* HTML (char *)
|
||||
* remarks:
|
||||
* remarks:
|
||||
* When we're called, we've already pulled over something from the net.
|
||||
* So no matter what, nuke any existing file and cache the current
|
||||
* file.
|
||||
@@ -142,7 +142,7 @@ char *mo_decode_internal_reference (char *url, char *newtext, char *target)
|
||||
system (cmd);
|
||||
free (cmd);
|
||||
*/
|
||||
unlink(fname);
|
||||
unlink(fname);
|
||||
}
|
||||
|
||||
/* Now go get the new filename. */
|
||||
@@ -174,21 +174,21 @@ char *mo_decode_internal_reference (char *url, char *newtext, char *target)
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* name: mo_decode_hdfref
|
||||
* purpose: Given a URL (canonicalized with or without target still
|
||||
* attached) and a target anchor which is an hdfref,
|
||||
* look up the cached local file and decode the href.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL for the data file on the net.
|
||||
* - char *target: Target anchor (hdfref).
|
||||
* returns:
|
||||
* returns:
|
||||
* HTML for the hdfref.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* The URL is canonicalized (target anchor stripped out) for the call
|
||||
* to mo_fetch_cached_data(), so it can return the appropriate local
|
||||
* to mo_fetch_cached_data(), so it can return the appropriate local
|
||||
* filename for all internal references.
|
||||
* --> We assume the file is already stored locally. ???
|
||||
****************************************************************************/
|
||||
@@ -251,7 +251,7 @@ mo_status mo_do_hdf_dtm_thang (char *url, char *hdfdtmref)
|
||||
free (cache_url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
hdfDtmThang (fname, hdfdtmref);
|
||||
|
||||
return mo_succeed;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
178
src/mo-www.c
178
src/mo-www.c
@@ -189,11 +189,11 @@ static void frame_hack()
|
||||
}
|
||||
/*
|
||||
start = strstr(HTMainText->htmlSrc, "<frameset");
|
||||
|
||||
|
||||
if(!start)
|
||||
start = strstr(HTMainText->htmlSrc, "<FRAMESET");
|
||||
*/
|
||||
|
||||
|
||||
if(!start)
|
||||
return;
|
||||
|
||||
@@ -203,7 +203,7 @@ static void frame_hack()
|
||||
{
|
||||
url = ParseMarkTag(tmp, "FRAME", "SRC");
|
||||
if (url) {
|
||||
frame_anchors[num_frames] = malloc(strlen(url)*2 +
|
||||
frame_anchors[num_frames] = malloc(strlen(url)*2 +
|
||||
strlen("<LI> <A HREF= > </A> ")+4);
|
||||
sprintf(frame_anchors[num_frames], "<LI> <A HREF=\"%s\"> %s </A>", url, url);
|
||||
new_size += strlen(frame_anchors[num_frames])+1;
|
||||
@@ -222,7 +222,7 @@ static void frame_hack()
|
||||
new_src[strlen(HTMainText->htmlSrc) - strlen(start)]='\0';
|
||||
|
||||
sprintf(new_src, "%s <H2> Frame Index: </H2> <UL>", new_src);
|
||||
|
||||
|
||||
for(i=0;i<num_frames;i++)
|
||||
{
|
||||
sprintf(new_src, "%s%s", new_src, frame_anchors[i]);
|
||||
@@ -243,12 +243,12 @@ static void frame_hack()
|
||||
* name: hack_htmlsrc (PRIVATE)
|
||||
* purpose: Do really nasty things to a stream of HTML that just got
|
||||
* pulled over from a server.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - none (global HTMainText is assumed to contain current
|
||||
* HText object)
|
||||
* returns:
|
||||
* returns:
|
||||
* - HTMainText->htmlSrc (char *)
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This is ugly but it gets the job done.
|
||||
* The job is this:
|
||||
* - Filter out repeated instances of <PLAINTEXT>.
|
||||
@@ -277,7 +277,7 @@ static char *hack_htmlsrc (void)
|
||||
|
||||
/* Keep pointer to real head of htmlSrc memory block. */
|
||||
HTMainText->htmlSrcHead = HTMainText->htmlSrc;
|
||||
|
||||
|
||||
if (HTMainText->htmlSrc && HTMainText->srclen > 30)
|
||||
{
|
||||
if (!strncmp (HTMainText->htmlSrc, "<plaintext>", 11) ||
|
||||
@@ -308,7 +308,7 @@ static char *hack_htmlsrc (void)
|
||||
HTMainText->htmlSrc += 12;
|
||||
}
|
||||
}
|
||||
if (!strncmp (HTMainText->htmlSrc,
|
||||
if (!strncmp (HTMainText->htmlSrc,
|
||||
"<TITLE>Document</TITLE>\n<PLAINTEXT>", 35))
|
||||
{
|
||||
if (!strncmp (HTMainText->htmlSrc + 35, "\n<title>", 8) ||
|
||||
@@ -325,12 +325,12 @@ static char *hack_htmlsrc (void)
|
||||
/****************************************************************************
|
||||
* name: doit (PRIVATE)
|
||||
* purpose: Given a URL, go fetch information.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL to fetch.
|
||||
* - char **texthead: Return pointer for the head of the allocated
|
||||
* text block (which may be different than the
|
||||
* return text intended for display).
|
||||
* returns:
|
||||
* returns:
|
||||
* The text intended for display (char *).
|
||||
****************************************************************************/
|
||||
static char *doit (char *url, char **texthead)
|
||||
@@ -384,11 +384,11 @@ static char *doit (char *url, char **texthead)
|
||||
}
|
||||
|
||||
/*
|
||||
** Just because we errored out, doesn't mean there isn't markup to
|
||||
** Just because we errored out, doesn't mean there isn't markup to
|
||||
** look at. For example, an FTP site that doesn't let a user in because
|
||||
** the maximum number of users has been reached often has a message
|
||||
** telling about other mirror sites. The failed FTP connection returns
|
||||
** a message that is taken care of below.
|
||||
** a message that is taken care of below.
|
||||
*/
|
||||
if (HTMainText) {
|
||||
char *txt = hack_htmlsrc();
|
||||
@@ -399,10 +399,10 @@ static char *doit (char *url, char **texthead)
|
||||
return txt;
|
||||
else
|
||||
/* take care of failed local access */
|
||||
txt = strdup("<H1>ERROR</H1>");
|
||||
txt = strdup("<H1>ERROR</H1>");
|
||||
}
|
||||
return txt;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* Return proper error message if we experienced redirection. */
|
||||
@@ -419,13 +419,13 @@ static char *doit (char *url, char **texthead)
|
||||
/****************************************************************************
|
||||
* name: mo_pull_er_over
|
||||
* purpose: Given a URL, pull 'er over.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL to pull over.
|
||||
* - char **texthead: Return pointer to head of allocated block.
|
||||
* returns:
|
||||
* returns:
|
||||
* Text to display (char *).
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
char *mo_pull_er_over (char *url, char **texthead)
|
||||
{
|
||||
@@ -459,7 +459,7 @@ char *mo_pull_er_over (char *url, char **texthead)
|
||||
}
|
||||
|
||||
|
||||
char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
char **texthead)
|
||||
{
|
||||
char *rv;
|
||||
@@ -489,7 +489,7 @@ char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
do_post = 0;
|
||||
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -498,12 +498,12 @@ char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
* purpose: Given a URL, pull 'er over in such a way that no format
|
||||
* handling takes place and the data gets dumped in the filename
|
||||
* of the calling routine's choice.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL to pull over.
|
||||
* - char *fnam: Filename in which to dump the received data.
|
||||
* returns:
|
||||
* returns:
|
||||
* mo_succeed on success; mo_fail otherwise.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* This routine is called when we know there's data out there we
|
||||
* want to get and we know we just want it dumped in a file, no
|
||||
* questions asked, by the WWW library. Appropriate global flags
|
||||
@@ -660,7 +660,7 @@ void HText_appendCharacter (HText *text, char ch)
|
||||
{
|
||||
if (text->srcalloc < text->srclen + 1)
|
||||
new_chunk (text);
|
||||
|
||||
|
||||
text->htmlSrc[text->srclen++] = ch;
|
||||
|
||||
return;
|
||||
@@ -691,7 +691,7 @@ void HText_appendBlock (HText *text, char *data, int len)
|
||||
{
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
|
||||
while (text->srcalloc < text->srclen + len + 1)
|
||||
new_chunk (text);
|
||||
|
||||
@@ -770,11 +770,11 @@ BOOL HText_select (HText *text)
|
||||
* purpose: Given a string, checks to see if it can stat it. If so, it is
|
||||
* assumed the user expects to open the file, not a web site. If not, we
|
||||
* assume it is supposed to be a server and prepend the default protocol.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to canonicalize.
|
||||
* returns:
|
||||
* returns:
|
||||
* The canonical representation of the URL.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* Written by spowers@ncsa.uiuc.edu
|
||||
****************************************************************************/
|
||||
char *fileOrServer(char *url) {
|
||||
@@ -790,7 +790,7 @@ char *xurl;
|
||||
if (!stat(url,&buf)) { /*its a file and we have access*/
|
||||
xurl=mo_url_canonicalize_local(url);
|
||||
}
|
||||
else if (!(get_pref_string(eDEFAULT_PROTOCOL)) ||
|
||||
else if (!(get_pref_string(eDEFAULT_PROTOCOL)) ||
|
||||
!*(get_pref_string(eDEFAULT_PROTOCOL))) {
|
||||
xurl=(char *)calloc(strlen(url)+15,sizeof(char));
|
||||
sprintf(xurl,"http://%s",url);
|
||||
@@ -807,11 +807,11 @@ char *xurl;
|
||||
/****************************************************************************
|
||||
* name: mo_url_prepend_protocol
|
||||
* purpose: To prepend the proper protocol to the url if it is not present.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to canonicalize.
|
||||
* returns:
|
||||
* returns:
|
||||
* The canonical representation of the URL.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* Contributed by martin@gizmo.lut.ac.uk, modified by spowers@ncsa.uiuc.edu
|
||||
****************************************************************************/
|
||||
char *mo_url_prepend_protocol(char *url) {
|
||||
@@ -870,14 +870,14 @@ char *xurl;
|
||||
/****************************************************************************
|
||||
* name: mo_url_canonicalize
|
||||
* purpose: Turn a URL into its canonical form, based on the previous
|
||||
* URL in this context (if appropriate).
|
||||
* URL in this context (if appropriate).
|
||||
* INTERNAL ANCHORS ARE STRIPPED OFF.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to canonicalize.
|
||||
* - char *oldurl: The previous URL in this context.
|
||||
* returns:
|
||||
* returns:
|
||||
* The canonical representation of the URL.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* All we do is call HTParse.
|
||||
****************************************************************************/
|
||||
char *mo_url_canonicalize (char *url, char *oldurl)
|
||||
@@ -892,14 +892,14 @@ char *mo_url_canonicalize (char *url, char *oldurl)
|
||||
/****************************************************************************
|
||||
* name: mo_url_canonicalize_keep_anchor
|
||||
* purpose: Turn a URL into its canonical form, based on the previous
|
||||
* URL in this context (if appropriate).
|
||||
* URL in this context (if appropriate).
|
||||
* INTERNAL ANCHORS ARE *NOT* STRIPPED OFF.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to canonicalize.
|
||||
* - char *oldurl: The previous URL in this context.
|
||||
* returns:
|
||||
* returns:
|
||||
* The canonical representation of the URL.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* All we do is call HTParse.
|
||||
****************************************************************************/
|
||||
char *mo_url_canonicalize_keep_anchor (char *url, char *oldurl)
|
||||
@@ -926,12 +926,12 @@ char *mo_url_canonicalize_keep_anchor (char *url, char *oldurl)
|
||||
* URL's, etc. Generally this will be the URL without the
|
||||
* target anchor, except for automatically generated representations
|
||||
* of internal parts of HDF files.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: The URL.
|
||||
* returns:
|
||||
* returns:
|
||||
* URL corresponding to a unique document.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
char *mo_url_to_unique_document (char *url)
|
||||
{
|
||||
@@ -953,12 +953,12 @@ char *mo_url_to_unique_document (char *url)
|
||||
* name: mo_url_extract_anchor
|
||||
* purpose: Given a URL (presumably in canonical form), extract
|
||||
* the internal anchor, if any.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to use.
|
||||
* returns:
|
||||
* returns:
|
||||
* Internal anchor, if one exists in the URL; else NULL.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
char *mo_url_extract_anchor (char *url)
|
||||
{
|
||||
@@ -970,12 +970,12 @@ char *mo_url_extract_anchor (char *url)
|
||||
* name: mo_url_extract_access
|
||||
* purpose: Given a URL (presumably in canonical form), extract
|
||||
* the access method, if any.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* - char *url: URL to use.
|
||||
* returns:
|
||||
* returns:
|
||||
* Access method, if one exists in the URL; else NULL.
|
||||
* remarks:
|
||||
*
|
||||
* remarks:
|
||||
*
|
||||
****************************************************************************/
|
||||
char *mo_url_extract_access (char *url, char *oldurl)
|
||||
{
|
||||
@@ -1001,7 +1001,7 @@ char *mo_url_canonicalize_local (char *url)
|
||||
tmp = (char *)malloc ((strlen (url) +
|
||||
strlen (cwd) + 32));
|
||||
if (url[0] == '/')
|
||||
sprintf (tmp, "file://localhost%s",
|
||||
sprintf (tmp, "file://localhost%s",
|
||||
url);
|
||||
else
|
||||
sprintf (tmp, "file://localhost%s/%s",
|
||||
@@ -1012,7 +1012,7 @@ char *mo_url_canonicalize_local (char *url)
|
||||
#ifndef CONVEX
|
||||
free (cwd);
|
||||
#endif
|
||||
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@@ -1020,11 +1020,11 @@ char *mo_url_canonicalize_local (char *url)
|
||||
/****************************************************************************
|
||||
* name: mo_tmpnam
|
||||
* purpose: Make a temporary, unique filename.
|
||||
* inputs:
|
||||
* inputs:
|
||||
* none
|
||||
* returns:
|
||||
* returns:
|
||||
* The new temporary filename.
|
||||
* remarks:
|
||||
* remarks:
|
||||
* We call tmpnam() to get the actual filename, and use the value
|
||||
* of Rdata.tmp_directory, if any, for the directory.
|
||||
* added code for url=NULL, bjs, 2/7/96
|
||||
@@ -1058,13 +1058,13 @@ char *mo_tmpnam (char *url)
|
||||
if (oldtmp[i] == '/')
|
||||
goto found_it;
|
||||
}
|
||||
|
||||
|
||||
/* No luck, just punt. */
|
||||
if(url) MoCCIAddFileURLToList(tmp,url);
|
||||
return tmp;
|
||||
|
||||
found_it:
|
||||
tmp = (char *)malloc (sizeof (char) * (strlen (tmp_dir) +
|
||||
tmp = (char *)malloc (sizeof (char) * (strlen (tmp_dir) +
|
||||
strlen (&(oldtmp[i])) + 8));
|
||||
if (tmp_dir[strlen(tmp_dir)-1] == '/')
|
||||
{
|
||||
@@ -1204,7 +1204,7 @@ char *mo_escape_part (char *part)
|
||||
return NULL;
|
||||
|
||||
escaped = (char *)malloc (strlen (part) * 3 + 1);
|
||||
|
||||
|
||||
for (q = escaped, p = part; *p != '\0'; p++)
|
||||
{
|
||||
/*
|
||||
@@ -1227,17 +1227,17 @@ char *mo_escape_part (char *part)
|
||||
*q++ = MO_HEX(c % 16);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*q=0;
|
||||
|
||||
|
||||
return escaped;
|
||||
}
|
||||
|
||||
|
||||
static char mo_from_hex (char c)
|
||||
{
|
||||
return ((c >= '0' && c <= '9') ? (c - '0') :
|
||||
((c >= 'A' && c <= 'F') ? (c - 'A' + 10) :
|
||||
return ((c >= '0' && c <= '9') ? (c - '0') :
|
||||
((c >= 'A' && c <= 'F') ? (c - 'A' + 10) :
|
||||
(c - 'a' + 10)));
|
||||
}
|
||||
|
||||
@@ -1245,7 +1245,7 @@ char *mo_unescape_part (char *str)
|
||||
{
|
||||
char *p = str, *q = str;
|
||||
|
||||
while (*p)
|
||||
while (*p)
|
||||
{
|
||||
/* Plus's turn back into spaces. */
|
||||
if (*p == '+')
|
||||
@@ -1253,21 +1253,21 @@ char *mo_unescape_part (char *str)
|
||||
*q++ = ' ';
|
||||
p++;
|
||||
}
|
||||
else if (*p == '%')
|
||||
else if (*p == '%')
|
||||
{
|
||||
p++;
|
||||
if (*p)
|
||||
if (*p)
|
||||
*q = mo_from_hex(*p++) * 16;
|
||||
if (*p)
|
||||
if (*p)
|
||||
*q += mo_from_hex(*p++);
|
||||
q++;
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
*q++ = *p++;
|
||||
*q++ = *p++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
*q++ = 0;
|
||||
return str;
|
||||
}
|
||||
@@ -1364,10 +1364,10 @@ char buf[512];
|
||||
static struct tms tbuf;
|
||||
static int gtime;
|
||||
|
||||
void StartClock (void)
|
||||
void StartClock (void)
|
||||
{
|
||||
gtime = times (&tbuf);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1393,7 +1393,7 @@ void StopClock ()
|
||||
|
||||
static FILE *_fp = NULL;
|
||||
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
char cmd[2048];
|
||||
@@ -1408,7 +1408,7 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
#ifdef OLD
|
||||
if (get_pref_string(eMAIL_FILTER_COMMAND))
|
||||
{
|
||||
sprintf (cmd, "%s | %s -t", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
sprintf (cmd, "%s | %s -t", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
get_pref_string(eSENDMAIL_COMMAND));
|
||||
}
|
||||
else
|
||||
@@ -1424,7 +1424,7 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
if (get_pref_string(eMAIL_FILTER_COMMAND) && content_type &&
|
||||
strcmp (content_type, "application/postscript"))
|
||||
{
|
||||
sprintf (cmd, "%s | %s %s", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
sprintf (cmd, "%s | %s %s", get_pref_string(eMAIL_FILTER_COMMAND),
|
||||
get_pref_string(eSENDMAIL_COMMAND), to);
|
||||
}
|
||||
else
|
||||
@@ -1443,15 +1443,15 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
fprintf (_fp, "Reply-To: %s <%s>\n",get_pref_string(eDEFAULT_AUTHOR_NAME),get_pref_string(eDEFAULT_AUTHOR_EMAIL));
|
||||
fprintf (_fp, "Content-Type: %s\n", content_type);
|
||||
fprintf (_fp, "Mime-Version: 1.0\n");
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
MO_VERSION_STRING, MO_MACHINE_TYPE);
|
||||
if (url)
|
||||
fprintf (_fp, "X-URL: %s\n", url);
|
||||
|
||||
fprintf (_fp, "\n");
|
||||
|
||||
fprintf (_fp, "\n");
|
||||
|
||||
/* Stick in BASE tag as appropriate. */
|
||||
if (url && content_type &&
|
||||
if (url && content_type &&
|
||||
strcmp (content_type, "text/x-html") == 0)
|
||||
fprintf (_fp, "<base href=\"%s\">\n", url);
|
||||
|
||||
@@ -1470,7 +1470,7 @@ mo_status mo_finish_sending_mail_message (void)
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -1485,7 +1485,7 @@ mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
} else {
|
||||
fputs (text, fp);
|
||||
}
|
||||
|
||||
|
||||
mo_finish_sending_mail_message ();
|
||||
|
||||
return mo_succeed;
|
||||
@@ -1513,7 +1513,7 @@ char *rv;
|
||||
do_put=do_post=0;
|
||||
|
||||
return(rv);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int upload(mo_window *win,FILE *fp, char *fname) {
|
||||
@@ -1675,7 +1675,7 @@ int res;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!(fp=fopen(efname,"r"))) {
|
||||
|
||||
char *buf, *final, tmpbuf[80];
|
||||
@@ -1726,7 +1726,7 @@ mo_window *win = mo_fetch_window_by_id(XmxExtractUniqid ((int)client_data));
|
||||
mo_busy();
|
||||
|
||||
XtUnmanageChild(win->upload_win);
|
||||
|
||||
|
||||
XmStringGetLtoR(((XmFileSelectionBoxCallbackStruct *)call_data)->value,
|
||||
XmSTRING_DEFAULT_CHARSET,
|
||||
&fname);
|
||||
@@ -1736,7 +1736,7 @@ mo_window *win = mo_fetch_window_by_id(XmxExtractUniqid ((int)client_data));
|
||||
mo_not_busy();
|
||||
|
||||
free(fname);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1768,7 +1768,7 @@ mo_status mo_post_upload_window (mo_window *win) {
|
||||
XmFileSelectionDoSearch(win->upload_win,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->upload_win);
|
||||
|
||||
return mo_succeed;
|
||||
|
||||
10
src/mo-www.h
10
src/mo-www.h
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -63,10 +63,10 @@
|
||||
the source whenever something changed. */
|
||||
|
||||
#ifndef __MOWWW_H__
|
||||
#define __MOWWW_H__
|
||||
#define __MOWWW_H__
|
||||
|
||||
char *mo_pull_er_over (char *, char **);
|
||||
char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
char *mo_post_pull_er_over (char *url, char *content_type, char *data,
|
||||
char **texthead);
|
||||
mo_status mo_pull_er_over_virgin (char *, char *);
|
||||
mo_status mo_re_init_formats (void);
|
||||
@@ -87,10 +87,10 @@ void application_user_feedback (char *);
|
||||
char *mo_escape_part (char *);
|
||||
char *mo_unescape_part (char *);
|
||||
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
char *content_type, char *url);
|
||||
mo_status mo_finish_sending_mail_message (void);
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
char *content_type, char *url);
|
||||
|
||||
void application_error(char *str, char *title);
|
||||
|
||||
32
src/mosaic.h
32
src/mosaic.h
@@ -132,7 +132,7 @@ typedef enum
|
||||
#endif
|
||||
|
||||
#ifndef HOME_PAGE_DEFAULT
|
||||
/* This must be a straight string as it is included into a struct;
|
||||
/* This must be a straight string as it is included into a struct;
|
||||
no tricks. */
|
||||
#define HOME_PAGE_DEFAULT \
|
||||
"http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html"
|
||||
@@ -292,8 +292,8 @@ typedef struct mo_window
|
||||
int id;
|
||||
Widget base;
|
||||
int mode;
|
||||
|
||||
|
||||
|
||||
|
||||
/* Subwindows. */
|
||||
Widget source_win;
|
||||
Widget save_win;
|
||||
@@ -332,13 +332,13 @@ typedef struct mo_window
|
||||
Widget session_menu;
|
||||
Widget *session_items;
|
||||
int num_session_items;
|
||||
|
||||
/* Tag 'n Bag
|
||||
|
||||
/* Tag 'n Bag
|
||||
Widget tag_win;
|
||||
Widget tag_list;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_DTM
|
||||
Widget dtmout_win;
|
||||
#endif
|
||||
@@ -365,8 +365,8 @@ typedef struct mo_window
|
||||
int toolset;
|
||||
int toolbardetached;
|
||||
int toolbarorientation;
|
||||
|
||||
|
||||
|
||||
|
||||
Widget meter, meter_frame;
|
||||
int meter_level,meter_width,meter_height;
|
||||
int meter_notext;
|
||||
@@ -428,7 +428,7 @@ typedef struct mo_window
|
||||
Widget print_us_toggle_mail;
|
||||
Widget print_url_only;
|
||||
Widget print_doc_only;
|
||||
|
||||
|
||||
Widget history_list;
|
||||
|
||||
Widget hotlist_list;
|
||||
@@ -450,7 +450,7 @@ typedef struct mo_window
|
||||
Widget mailto_fromfield;
|
||||
Widget mailto_tofield;
|
||||
Widget mailto_subfield;
|
||||
|
||||
|
||||
Widget mailto_form_text;
|
||||
Widget mailto_form_fromfield;
|
||||
Widget mailto_form_tofield;
|
||||
@@ -613,7 +613,7 @@ typedef enum
|
||||
mo_kerberosv5_login,
|
||||
#endif
|
||||
mo_proxy, mo_no_proxy,
|
||||
mo_reload_document, mo_reload_document_and_images,
|
||||
mo_reload_document, mo_reload_document_and_images,
|
||||
mo_refresh_document, mo_clear_image_cache,
|
||||
mo_cci,
|
||||
mo_document_source, mo_document_edit, mo_document_date, mo_search,
|
||||
@@ -623,7 +623,7 @@ typedef enum
|
||||
mo_close_window, mo_exit_program,
|
||||
mo_home_document, mo_ncsa_document,
|
||||
mo_mosaic_manual, mo_mosaic_demopage,
|
||||
mo_back, mo_forward, mo_history_list,
|
||||
mo_back, mo_forward, mo_history_list,
|
||||
mo_clear_global_history,
|
||||
mo_hotlist_postit, mo_register_node_in_default_hotlist,
|
||||
mo_all_hotlist_to_rbm, mo_all_hotlist_from_rbm,
|
||||
@@ -645,7 +645,7 @@ typedef enum
|
||||
mo_default_underlines, mo_l1_underlines, mo_l2_underlines, mo_l3_underlines,
|
||||
mo_no_underlines, mo_binary_transfer,
|
||||
/* links window */
|
||||
mo_links_window,
|
||||
mo_links_window,
|
||||
/* News Menu & Stuff */
|
||||
mo_news_prev, mo_news_next, mo_news_prevt, mo_news_nextt,
|
||||
mo_news_post, mo_news_cancel, mo_news_reply, mo_news_follow,
|
||||
@@ -653,9 +653,9 @@ typedef enum
|
||||
mo_news_groups, mo_news_flush, mo_news_flushgroup,
|
||||
mo_news_grp0, mo_news_grp1, mo_news_grp2,
|
||||
mo_news_art0, mo_news_art1, mo_use_flush,
|
||||
mo_news_sub, mo_news_unsub, mo_news_sub_anchor, mo_news_unsub_anchor,
|
||||
mo_news_sub, mo_news_unsub, mo_news_sub_anchor, mo_news_unsub_anchor,
|
||||
mo_news_mread, mo_news_mread_anchor, mo_news_munread, mo_news_maunread,
|
||||
|
||||
|
||||
/* Other stuff */
|
||||
mo_re_init, mo_delay_image_loads, mo_table_support, mo_expand_images_current,
|
||||
mo_image_view_internal,
|
||||
|
||||
114
src/newsrc.c
114
src/newsrc.c
@@ -94,8 +94,8 @@ int newsNoNewsRC = 0;
|
||||
Expects: ng -- newsgroup
|
||||
art -- article number
|
||||
Returns: 0 if not read, 1 if read
|
||||
|
||||
Notes:
|
||||
|
||||
Notes:
|
||||
*/
|
||||
int isread (newsgroup_t *ng, long art)
|
||||
{
|
||||
@@ -114,8 +114,8 @@ int isread (newsgroup_t *ng, long art)
|
||||
Expects: ng -- newsgroup
|
||||
art -- article number
|
||||
Returns: nothing
|
||||
|
||||
Notes:
|
||||
|
||||
Notes:
|
||||
*/
|
||||
void markread (newsgroup_t *ng, long art)
|
||||
{
|
||||
@@ -140,8 +140,8 @@ void markread (newsgroup_t *ng, long art)
|
||||
Expects: ng -- newsgroup
|
||||
art -- article number
|
||||
Returns: nothing
|
||||
|
||||
Notes:
|
||||
|
||||
Notes:
|
||||
*/
|
||||
void markunread (newsgroup_t *ng, long art)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ void markrangeunread (newsgroup_t *ng, long start, long stop)
|
||||
/* issubscribed ()
|
||||
Expects: name -- name of newsgroup
|
||||
Returns: pointer to group or NULL if not subscribed
|
||||
|
||||
|
||||
Notes:
|
||||
*/
|
||||
newsgroup_t *issubscribed (char *name)
|
||||
@@ -231,7 +231,7 @@ newsgroup_t *subscribegroup (char *name)
|
||||
|
||||
if (!ng) {
|
||||
sprintf (junk, "%s: ", name);
|
||||
if (ng = addgroup (junk, 0, 0, 0)) {
|
||||
if (ng = addgroup (junk, 0, 0, 0)) {
|
||||
ng->attribs |= naUPDATE;
|
||||
ng->attribs |= naSUBSCRIBED;
|
||||
ng->attribs |= naSHOWME;
|
||||
@@ -251,7 +251,7 @@ newsgroup_t *subscribegroup (char *name)
|
||||
Expects: name -- group name
|
||||
Returns: pointer to unsubed group
|
||||
|
||||
Notes:
|
||||
Notes:
|
||||
*/
|
||||
newsgroup_t *unsubscribegroup (char *name)
|
||||
{
|
||||
@@ -270,7 +270,7 @@ newsgroup_t *unsubscribegroup (char *name)
|
||||
/* dumpgroup ()
|
||||
Expects: ng -- newsgroup to dump
|
||||
Returns: nothing
|
||||
|
||||
|
||||
Notes: Displays some useful info on the given group
|
||||
*/
|
||||
void dumpgroup (newsgroup_t *ng)
|
||||
@@ -282,7 +282,7 @@ void dumpgroup (newsgroup_t *ng)
|
||||
return;
|
||||
}
|
||||
|
||||
printf ("Name: %s [%ld %ld] %ld %c%c%c\n",
|
||||
printf ("Name: %s [%ld %ld] %ld %c%c%c\n",
|
||||
ng->name?ng->name: "NULL",
|
||||
ng->minart,
|
||||
ng->maxart,
|
||||
@@ -298,7 +298,7 @@ void dumpgroup (newsgroup_t *ng)
|
||||
/* dumphash ()
|
||||
Expects: nothing
|
||||
Returns: nothing
|
||||
|
||||
|
||||
Notes: Displays some useful info on the hash table
|
||||
*/
|
||||
void dumphash ()
|
||||
@@ -345,7 +345,7 @@ int hashgroup (char *name)
|
||||
Expects: name -- name of the group
|
||||
Returns: pointer to group info, NULL if it is not in the table
|
||||
|
||||
Notes:
|
||||
Notes:
|
||||
*/
|
||||
newsgroup_t *findgroup (char *name)
|
||||
{
|
||||
@@ -372,7 +372,7 @@ newsgroup_t *findgroup (char *name)
|
||||
|
||||
Notes: Returns the first group in the hash table with the given attribute.
|
||||
*/
|
||||
newsgroup_t *firstgroup (int mask)
|
||||
newsgroup_t *firstgroup (int mask)
|
||||
{
|
||||
int i;
|
||||
newsgroup_t *n;
|
||||
@@ -395,7 +395,7 @@ newsgroup_t *firstgroup (int mask)
|
||||
|
||||
Notes: Returns the next group in the hash table with the suggested attribute.
|
||||
*/
|
||||
newsgroup_t *nextgroup (newsgroup_t *ng)
|
||||
newsgroup_t *nextgroup (newsgroup_t *ng)
|
||||
{
|
||||
int i;
|
||||
newsgroup_t *n;
|
||||
@@ -406,13 +406,13 @@ newsgroup_t *nextgroup (newsgroup_t *ng)
|
||||
for (i=ng->h; i<ACTIVE_BINS; i++) {
|
||||
n = newsrc_groups[i];
|
||||
if (i == ng->h) {
|
||||
while (n && n!=ng)
|
||||
while (n && n!=ng)
|
||||
n=n->next;
|
||||
if (!n)
|
||||
if (!n)
|
||||
continue;
|
||||
n=n->next;
|
||||
}
|
||||
if (!n)
|
||||
if (!n)
|
||||
continue;
|
||||
while (n) {
|
||||
if (newsrc_smask == -1 || n->attribs & newsrc_smask) {
|
||||
@@ -435,7 +435,7 @@ newsgroup_t *nextgroup (newsgroup_t *ng)
|
||||
|
||||
Notes: Adds a group to the active table
|
||||
*/
|
||||
newsgroup_t *addgroup (char *nline, long min, long max, int dri)
|
||||
newsgroup_t *addgroup (char *nline, long min, long max, int dri)
|
||||
{
|
||||
char *name;
|
||||
int hash;
|
||||
@@ -449,8 +449,8 @@ newsgroup_t *addgroup (char *nline, long min, long max, int dri)
|
||||
|
||||
/* Pull out the name */
|
||||
name = nline;
|
||||
while (*nline && *nline != ' ' && *nline != '\t' && *nline != ':' && *nline != '!'
|
||||
&& *nline != '\n')
|
||||
while (*nline && *nline != ' ' && *nline != '\t' && *nline != ':' && *nline != '!'
|
||||
&& *nline != '\n')
|
||||
nline++;
|
||||
|
||||
if (*nline == ':')
|
||||
@@ -487,9 +487,9 @@ newsgroup_t *addgroup (char *nline, long min, long max, int dri)
|
||||
/* pull out bitarray info from newsrc */
|
||||
if (nline && *nline)
|
||||
setseq (ng, nline);
|
||||
|
||||
|
||||
/* Do some checks to make sure numbers are valid */
|
||||
if (ng->newsrcmin < ng->minart)
|
||||
if (ng->newsrcmin < ng->minart)
|
||||
ng->newsrcmin = ng->minart;
|
||||
if (ng->newsrcmax > ng->maxart)
|
||||
ng->newsrcmax = ng->maxart;
|
||||
@@ -513,10 +513,10 @@ newsgroup_t *addgroup (char *nline, long min, long max, int dri)
|
||||
Expects: ng -- newsgroup struct
|
||||
str -- active articles string
|
||||
Returns: nothing
|
||||
|
||||
|
||||
Notes: Updates the newsgroup read article bit array for the newgroup in ng
|
||||
according to the sequence info in the newsrc line passed in str. If
|
||||
the sequence info specifies nonavailable articles in the read bitarray,
|
||||
according to the sequence info in the newsrc line passed in str. If
|
||||
the sequence info specifies nonavailable articles in the read bitarray,
|
||||
the info is ignored.
|
||||
*/
|
||||
void setseq (newsgroup_t *ng, char *str)
|
||||
@@ -536,7 +536,7 @@ void setseq (newsgroup_t *ng, char *str)
|
||||
while (*str && (*str < '0' || *str > '9')) str++;
|
||||
if (!(*str)) /* Done */
|
||||
break;
|
||||
|
||||
|
||||
/* Chomp out a number */
|
||||
tok = str;
|
||||
while (*str && (*str >= '0' && *str <= '9')) str++;
|
||||
@@ -603,14 +603,14 @@ void allocminmax (newsgroup_t *ng, long min, long max)
|
||||
|
||||
if (!ng)
|
||||
return;
|
||||
|
||||
|
||||
if (max<min)
|
||||
return;
|
||||
|
||||
if ((tr = malloc ((max-min+7)/8+1)) == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
memset (tr, 0, ((max-min+7)/8)+1);
|
||||
if (ng->read)
|
||||
free (ng->read);
|
||||
@@ -628,7 +628,7 @@ void allocminmax (newsgroup_t *ng, long min, long max)
|
||||
Returns: nothing
|
||||
|
||||
Notes: re-allocates the read bitarray for a newsgroup.
|
||||
This is slightly slower than etching the new array in
|
||||
This is slightly slower than etching the new array in
|
||||
stone with a small hammer and a large peanut butter sandwich.
|
||||
*/
|
||||
void setminmax (newsgroup_t *ng, long min, long max)
|
||||
@@ -643,7 +643,7 @@ void setminmax (newsgroup_t *ng, long min, long max)
|
||||
if ((tr = malloc (s)) == NULL ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
memset (tr, 0, s);
|
||||
lo = (min>ng->minart)? min : ng->minart; /* max (min, ng->min); */
|
||||
hi = (max<ng->maxart)? max : ng->maxart; /* min (max, ng->max); */
|
||||
@@ -672,7 +672,7 @@ void setminmax (newsgroup_t *ng, long min, long max)
|
||||
Expects: buffer -- buffer to read line into
|
||||
Returns: 0 if valid line, nonzero on error
|
||||
|
||||
Notes: Reads the next valid line of the newsrc.
|
||||
Notes: Reads the next valid line of the newsrc.
|
||||
Skips comments (as first character) and blank lines.
|
||||
Line still has \n on end.
|
||||
*/
|
||||
@@ -682,15 +682,15 @@ int newsrc_readline (char *buffer)
|
||||
|
||||
/* get a valid line, i.e. non blank, non comment */
|
||||
while (1) {
|
||||
if (!fgets (tbuf, MAX_BUF, newsrc_fp))
|
||||
if (!fgets (tbuf, MAX_BUF, newsrc_fp))
|
||||
return 1;
|
||||
|
||||
|
||||
newsrc_line++;
|
||||
tp = tbuf;
|
||||
while ( (*tp) && ((*tp == ' ') || (*tp == '\t')) )
|
||||
while ( (*tp) && ((*tp == ' ') || (*tp == '\t')) )
|
||||
tp++;
|
||||
|
||||
if (!(*tp) || (*tp == '#') || (*tp == '\n'))
|
||||
if (!(*tp) || (*tp == '#') || (*tp == '\n'))
|
||||
continue;
|
||||
|
||||
/* Good line */
|
||||
@@ -722,7 +722,7 @@ char *newsrc_getseq (char *name, char *buf)
|
||||
while (*c && !strchr (" :!\t\n", *c)) c++;
|
||||
d = *c;
|
||||
*c = 0;
|
||||
if (strcmp (b, name))
|
||||
if (strcmp (b, name))
|
||||
continue;
|
||||
c++;
|
||||
strcpy (buf, c);
|
||||
@@ -734,7 +734,7 @@ char *newsrc_getseq (char *name, char *buf)
|
||||
}
|
||||
|
||||
|
||||
/* newsrc_backup ()
|
||||
/* newsrc_backup ()
|
||||
Expects: Nothing
|
||||
Returns: Nothing
|
||||
|
||||
@@ -755,7 +755,7 @@ void newsrc_backup ()
|
||||
return;
|
||||
}
|
||||
|
||||
while (fgets (b,MAX_BUF,new))
|
||||
while (fgets (b,MAX_BUF,new))
|
||||
fprintf (old, b);
|
||||
|
||||
fclose (old);
|
||||
@@ -788,7 +788,7 @@ long findnextrun (newsgroup_t *n, long art)
|
||||
Expects: ng -- newsgroup to write info for
|
||||
buf -- a buffer to put string into
|
||||
Returns: a pointer to the buffer
|
||||
|
||||
|
||||
Notes: Writes out the sequence information for ng
|
||||
*/
|
||||
char *newsrc_writeseq (newsgroup_t *ng, char *buf, int max)
|
||||
@@ -800,11 +800,11 @@ char *newsrc_writeseq (newsgroup_t *ng, char *buf, int max)
|
||||
s = buf;
|
||||
while (lo = findnextrun (ng,hi+1)) {
|
||||
hi = findendrun (ng,lo);
|
||||
if (lo==hi)
|
||||
sprintf (b, "%ld, ", lo);
|
||||
else
|
||||
sprintf (b, "%ld-%ld, ", lo, hi);
|
||||
|
||||
if (lo==hi)
|
||||
sprintf (b, "%ld, ", lo);
|
||||
else
|
||||
sprintf (b, "%ld-%ld, ", lo, hi);
|
||||
|
||||
strcat (s, b);
|
||||
s += strlen (b);
|
||||
len += strlen (b);
|
||||
@@ -813,9 +813,9 @@ char *newsrc_writeseq (newsgroup_t *ng, char *buf, int max)
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Remove the trailing comma */
|
||||
if ((s = strrchr (buf,',')) != NULL)
|
||||
if ((s = strrchr (buf,',')) != NULL)
|
||||
*s = 0;
|
||||
return buf;
|
||||
}
|
||||
@@ -824,7 +824,7 @@ char *newsrc_writeseq (newsgroup_t *ng, char *buf, int max)
|
||||
/* newsrc_flush ()
|
||||
Expects: Nothing
|
||||
Returns: 0 if ok, nonzero otherwise
|
||||
|
||||
|
||||
Notes: Writes out the data for the current groups hash table, updating the
|
||||
current newsrc as it goes.
|
||||
*/
|
||||
@@ -848,7 +848,7 @@ int newsrc_flush ()
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
n = firstgroup (-1);
|
||||
while (n) {
|
||||
seq[0] = 0;
|
||||
@@ -862,7 +862,7 @@ int newsrc_flush ()
|
||||
fclose (new);
|
||||
newsrc_flushit = 0;
|
||||
newsNoNewsRC = 0;
|
||||
|
||||
|
||||
if (newsrc_timer) {
|
||||
del = get_pref_int (eBACKGROUNDFLUSHTIME);
|
||||
newsrc_ti = XtAppAddTimeOut (app_context, 1000L*del, newsrc_flushcb, NULL);
|
||||
@@ -906,7 +906,7 @@ void newsrc_initflush ()
|
||||
/* newsrc_kill ()
|
||||
Expects: Nothing
|
||||
Returns: 0 if ok, nonzero otherwise
|
||||
|
||||
|
||||
Notes: Does any cleanup for the currently active newsrc.
|
||||
Runs through hash table and writes out any groups that need to be updated.
|
||||
Frees hash table entries.
|
||||
@@ -947,7 +947,7 @@ int newsrc_kill (void)
|
||||
/* newsrc_init ()
|
||||
Expects: newshost -- name of newshost to open the newsrc for.
|
||||
Returns: 0 if ok, nonzero otherwise
|
||||
|
||||
|
||||
Notes: Does any onetime initialization for the newsrc stuff for the given host.
|
||||
Opens .mosaic-newsrc-newshost and initializes hash table.
|
||||
*/
|
||||
@@ -966,7 +966,7 @@ int newsrc_init (char *newshost)
|
||||
return 1;
|
||||
|
||||
/* If they want to reinit the current system, they have to do it the hard way */
|
||||
if (newsrc_active)
|
||||
if (newsrc_active)
|
||||
return 0;
|
||||
|
||||
sprintf (buf, "Initializing newsrc for %s", newshost);
|
||||
@@ -987,7 +987,7 @@ int newsrc_init (char *newshost)
|
||||
spref = get_pref_boolean (eUSESHORTNEWSRC);
|
||||
sprintf (newsrc_filename, "%s/%s%s%s", home, npref, spref?"":"-",spref?"":newshost);
|
||||
if ((newsrc_fp = fopen (newsrc_filename, "r")) == NULL) {
|
||||
sprintf (buf, "News file %s/%s%s%s does not exist",
|
||||
sprintf (buf, "News file %s/%s%s%s does not exist",
|
||||
home, npref, spref?"":"-",spref?"":newshost);
|
||||
HTProgress (buf);
|
||||
newsNoNewsRC = 1;
|
||||
@@ -997,13 +997,13 @@ int newsrc_init (char *newshost)
|
||||
|
||||
newsrc_line = 0;
|
||||
while (newsrc_readline (buf) == 0) {
|
||||
if (strchr (buf, ':'))
|
||||
if (strchr (buf, ':'))
|
||||
addgroup (buf, 0, -1, 0) ;
|
||||
}
|
||||
fclose (newsrc_fp);
|
||||
|
||||
|
||||
if (get_pref_boolean (eUSEBACKGROUNDFLUSH)) {
|
||||
newsrc_ti = XtAppAddTimeOut (app_context,
|
||||
newsrc_ti = XtAppAddTimeOut (app_context,
|
||||
1000L*get_pref_int (eBACKGROUNDFLUSHTIME),
|
||||
newsrc_flushcb, NULL);
|
||||
newsrc_timer = 1;
|
||||
|
||||
104
src/pan.c
104
src/pan.c
@@ -99,7 +99,7 @@ extern int srcTrace;
|
||||
|
||||
<ncsa-annotation-format-1> [cookie]
|
||||
<title>This is the title.</title> [title]
|
||||
<h1>This is the title, again.</h1> [line skipped; expected
|
||||
<h1>This is the title, again.</h1> [line skipped; expected
|
||||
to be title]
|
||||
<address>This is the author.</address> [author]
|
||||
<address>This is the date.</address> [date of annotation/
|
||||
@@ -209,7 +209,7 @@ static entry *new_entry (int buck, char *href)
|
||||
/* bzero ((void *)(l->an), MAX_PANS_PER_HREF * 4);*/
|
||||
memset((void *)(l->an), 0, MAX_PANS_PER_HREF * 4);
|
||||
l->next = NULL;
|
||||
|
||||
|
||||
if (bkt->head == NULL)
|
||||
bkt->head = l;
|
||||
else
|
||||
@@ -236,7 +236,7 @@ static entry *fetch_entry (char *href)
|
||||
if (!strcmp (l->href, href))
|
||||
return l;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ static void add_an_to_entry (entry *l, int an)
|
||||
{
|
||||
if (l->num_pans == MAX_PANS_PER_HREF)
|
||||
return;
|
||||
|
||||
|
||||
l->an[l->num_pans] = an;
|
||||
|
||||
l->num_pans++;
|
||||
@@ -268,7 +268,7 @@ static void remove_an_from_entry (entry *l, int an)
|
||||
|
||||
/* Couldn't find an in the list of annoations. */
|
||||
return;
|
||||
|
||||
|
||||
ok:
|
||||
/* Found an in the list of annotations. */
|
||||
l->an[place] = 0;
|
||||
@@ -319,35 +319,35 @@ static void mo_read_pan_file (char *filename)
|
||||
char line[MO_LINE_LENGTH];
|
||||
char *status;
|
||||
entry *l;
|
||||
|
||||
|
||||
fp = fopen (filename, "r");
|
||||
if (!fp)
|
||||
goto screwed_no_file;
|
||||
|
||||
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto screwed_with_file;
|
||||
|
||||
|
||||
/* See if it's our format. */
|
||||
if (strncmp (line, NCSA_PAN_LOG_FORMAT_COOKIE_ONE,
|
||||
strlen (NCSA_PAN_LOG_FORMAT_COOKIE_ONE)))
|
||||
goto screwed_with_file;
|
||||
|
||||
|
||||
/* Go fetch the name on the next line. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto screwed_with_file;
|
||||
|
||||
|
||||
/* Start grabbing documents and lists of annotations. */
|
||||
while (1)
|
||||
{
|
||||
char *url;
|
||||
char *p;
|
||||
|
||||
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
if (!status || !(*line))
|
||||
goto done;
|
||||
|
||||
|
||||
url = strtok (line, " ");
|
||||
if (!url)
|
||||
goto screwed_with_file;
|
||||
@@ -369,7 +369,7 @@ static void mo_read_pan_file (char *filename)
|
||||
max_pan_id = a;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
done:
|
||||
fclose (fp);
|
||||
@@ -410,7 +410,7 @@ void ensure_pan_directory_exists (void)
|
||||
|
||||
sprintf (filename, "%s/%s", home, default_directory);
|
||||
|
||||
r = stat (filename, &buf);
|
||||
r = stat (filename, &buf);
|
||||
if (r == -1)
|
||||
{
|
||||
#ifdef NeXT
|
||||
@@ -419,7 +419,7 @@ void ensure_pan_directory_exists (void)
|
||||
mkdir (filename, S_IRUSR | S_IWUSR | S_IXUSR);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -455,9 +455,9 @@ mo_status mo_setup_pan_list (void)
|
||||
/* This shouldn't happen. */
|
||||
if (!home)
|
||||
home = "/tmp";
|
||||
|
||||
filename = (char *)malloc
|
||||
((strlen (home) + strlen (default_directory) +
|
||||
|
||||
filename = (char *)malloc
|
||||
((strlen (home) + strlen (default_directory) +
|
||||
strlen (default_filename) + 8) * sizeof (char));
|
||||
sprintf (filename, "%s/%s/%s", home, default_directory, default_filename);
|
||||
cached_global_pan_fname = filename;
|
||||
@@ -481,7 +481,7 @@ mo_status mo_write_pan_list (void)
|
||||
return mo_fail;
|
||||
|
||||
fprintf (fp, "%s\n%s\n", NCSA_PAN_LOG_FORMAT_COOKIE_ONE, "Personal");
|
||||
|
||||
|
||||
for (i = 0; i < HASHSIZE; i++)
|
||||
for (l = hash_table[i].head; l != NULL; l = l->next)
|
||||
if (l->num_pans)
|
||||
@@ -492,9 +492,9 @@ mo_status mo_write_pan_list (void)
|
||||
fprintf (fp, " %d", l->an[j]);
|
||||
fprintf (fp, "\n");
|
||||
}
|
||||
|
||||
|
||||
fclose (fp);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -505,11 +505,11 @@ static mo_status mo_write_pan (int id, char *title, char *author, char *text)
|
||||
FILE *fp;
|
||||
time_t foo = time (NULL);
|
||||
char *ts = ctime (&foo);
|
||||
|
||||
|
||||
ts[strlen(ts)-1] = '\0';
|
||||
|
||||
ensure_pan_directory_exists ();
|
||||
|
||||
|
||||
/* Write the new annotation to its appropriate file. */
|
||||
sprintf (filename, "%s/%s/%s%d.html", home, default_directory,
|
||||
PAN_ANNOTATION_PREFIX, id);
|
||||
@@ -581,7 +581,7 @@ mo_status mo_delete_pan (int id)
|
||||
system (cmd);
|
||||
free (cmd);
|
||||
*/
|
||||
unlink(filename);
|
||||
unlink(filename);
|
||||
|
||||
#ifdef HAVE_AUDIO_ANNOTATIONS
|
||||
#if defined(__sgi)
|
||||
@@ -594,8 +594,8 @@ mo_status mo_delete_pan (int id)
|
||||
system (cmd);
|
||||
free (cmd);
|
||||
*/
|
||||
unlink(filename);
|
||||
|
||||
unlink(filename);
|
||||
|
||||
#else /* sun or HP, probably */
|
||||
/* Remove a possible audio annotation. */
|
||||
sprintf (filename, "%s/%s/%s%d.au", home, default_directory,
|
||||
@@ -606,7 +606,7 @@ mo_status mo_delete_pan (int id)
|
||||
system (cmd);
|
||||
free (cmd);
|
||||
*/
|
||||
unlink(filename);
|
||||
unlink(filename);
|
||||
#endif
|
||||
#endif /* HAVE_AUDIO_ANNOTATIONS */
|
||||
|
||||
@@ -616,7 +616,7 @@ mo_status mo_delete_pan (int id)
|
||||
/* We're modifying an existing pan. Pass in the id,
|
||||
the title, author, and text.
|
||||
Check for null text -- NOT AT THE MOMENT */
|
||||
mo_status mo_modify_pan (int id, char *title, char *author,
|
||||
mo_status mo_modify_pan (int id, char *title, char *author,
|
||||
char *text)
|
||||
{
|
||||
if (!title || !*title)
|
||||
@@ -649,7 +649,7 @@ static char *smart_append (char *s1, char *s2)
|
||||
make a copy of the string starting at the offset;
|
||||
step through that string and nil'ify the first '<' we see.
|
||||
Return the resulting string.
|
||||
Example:
|
||||
Example:
|
||||
extract_meat ("<foo>barblegh</foo>", 5) returns "barblegh". */
|
||||
static char *extract_meat (char *s, int offset)
|
||||
{
|
||||
@@ -662,7 +662,7 @@ static char *extract_meat (char *s, int offset)
|
||||
|
||||
if (*bar == '<')
|
||||
*bar = '\0';
|
||||
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
@@ -673,7 +673,7 @@ char *mo_fetch_personal_annotations (char *url)
|
||||
char line[MO_LINE_LENGTH];
|
||||
char *default_directory = get_pref_string(ePRIVATE_ANNOTATION_DIRECTORY);
|
||||
int i, count = 0;
|
||||
|
||||
|
||||
if (!l || !l->num_pans)
|
||||
{
|
||||
return NULL;
|
||||
@@ -710,7 +710,7 @@ char *mo_fetch_personal_annotations (char *url)
|
||||
if (an_anno)
|
||||
free(an_anno);
|
||||
}
|
||||
|
||||
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@ char *mo_fetch_pan_links (char *url, int on_top)
|
||||
char *status;
|
||||
char *default_directory = get_pref_string(ePRIVATE_ANNOTATION_DIRECTORY);
|
||||
int i, count = 0;
|
||||
|
||||
|
||||
if (!l)
|
||||
{
|
||||
return NULL;
|
||||
@@ -748,7 +748,7 @@ char *mo_fetch_pan_links (char *url, int on_top)
|
||||
*/
|
||||
|
||||
msg = smart_append (msg, "<h2>Personal Annotations</h2>\n<ul>\n");
|
||||
|
||||
|
||||
for (i = 0; i < l->num_pans; i++)
|
||||
{
|
||||
/* What's the annotation called? */
|
||||
@@ -767,17 +767,17 @@ char *mo_fetch_pan_links (char *url, int on_top)
|
||||
if (status && *line)
|
||||
{
|
||||
/* See if it's our format. */
|
||||
if (!strncmp (line, NCSA_ANNOTATION_FORMAT_ONE,
|
||||
if (!strncmp (line, NCSA_ANNOTATION_FORMAT_ONE,
|
||||
strlen (NCSA_ANNOTATION_FORMAT_ONE)))
|
||||
{
|
||||
char chunk[500];
|
||||
|
||||
|
||||
count++;
|
||||
|
||||
|
||||
/* Second line is the title. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
|
||||
sprintf (chunk, "<li> <a href=\"file://%s%s\">%s</a> ",
|
||||
|
||||
sprintf (chunk, "<li> <a href=\"file://%s%s\">%s</a> ",
|
||||
"localhost", filename, extract_meat (line, 7));
|
||||
msg = smart_append (msg, chunk);
|
||||
|
||||
@@ -795,7 +795,7 @@ char *mo_fetch_pan_links (char *url, int on_top)
|
||||
/* That's it. */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fclose (fp);
|
||||
}
|
||||
}
|
||||
@@ -832,7 +832,7 @@ mo_status mo_grok_pan_pieces (char *url, char *t,
|
||||
return mo_fail;
|
||||
|
||||
*fn = filename;
|
||||
|
||||
|
||||
fp = fopen (filename, "r");
|
||||
if (fp)
|
||||
{
|
||||
@@ -840,33 +840,33 @@ mo_status mo_grok_pan_pieces (char *url, char *t,
|
||||
if (status && *line)
|
||||
{
|
||||
/* See if it's our format. */
|
||||
if (!strncmp (line, NCSA_ANNOTATION_FORMAT_ONE,
|
||||
if (!strncmp (line, NCSA_ANNOTATION_FORMAT_ONE,
|
||||
strlen (NCSA_ANNOTATION_FORMAT_ONE)))
|
||||
{
|
||||
/*char chunk[500];*/
|
||||
|
||||
|
||||
/* Second line is the title. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
*title = extract_meat (line, 7);
|
||||
|
||||
|
||||
/* Third line is skipped. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
|
||||
|
||||
/* Fourth line is the author. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
*author = extract_meat (line, 9);
|
||||
|
||||
|
||||
/* Fifth line is the date. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
|
||||
|
||||
/* Sixth line is separator. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
/* Sixth line is pre. */
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
|
||||
|
||||
/* Remaining lines are the text. */
|
||||
*text = NULL;
|
||||
|
||||
|
||||
while (1)
|
||||
{
|
||||
status = fgets (line, MO_LINE_LENGTH, fp);
|
||||
@@ -875,13 +875,13 @@ mo_status mo_grok_pan_pieces (char *url, char *t,
|
||||
else
|
||||
goto got_it;
|
||||
}
|
||||
|
||||
|
||||
got_it:
|
||||
/* That's it. */
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fclose (fp);
|
||||
}
|
||||
else
|
||||
@@ -900,7 +900,7 @@ mo_status mo_grok_pan_pieces (char *url, char *t,
|
||||
*id = atoi (keepit);
|
||||
free (keepit);
|
||||
}
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -73,7 +73,7 @@ mo_status mo_setup_pan_list (void);
|
||||
mo_status mo_write_pan_list (void);
|
||||
mo_status mo_new_pan (char *url, char *title, char *author, char *text);
|
||||
mo_status mo_delete_pan (int id);
|
||||
mo_status mo_modify_pan (int id, char *title, char *author,
|
||||
mo_status mo_modify_pan (int id, char *title, char *author,
|
||||
char *text);
|
||||
char *mo_fetch_personal_annotations (char *url);
|
||||
char *mo_fetch_pan_links (char *url, int on_top);
|
||||
|
||||
@@ -354,21 +354,21 @@ XColor *colrs;
|
||||
/* First, go fetch the pixels. */
|
||||
XtVaGetValues (view, XtNforeground, &fg_pixel,
|
||||
XtNbackground, &bg_pixel, NULL);
|
||||
|
||||
|
||||
/* Now, load up fg_color and bg_color. */
|
||||
fg_color.pixel = fg_pixel;
|
||||
bg_color.pixel = bg_pixel;
|
||||
|
||||
|
||||
/* Now query for the full color info. */
|
||||
XQueryColor
|
||||
(XtDisplay (view),
|
||||
XQueryColor
|
||||
(XtDisplay (view),
|
||||
(installed_colormap ?
|
||||
installed_cmap :
|
||||
DefaultColormap (XtDisplay (view),
|
||||
DefaultScreen (XtDisplay (view)))),
|
||||
&fg_color);
|
||||
XQueryColor
|
||||
(XtDisplay (view),
|
||||
XQueryColor
|
||||
(XtDisplay (view),
|
||||
(installed_colormap ?
|
||||
installed_cmap :
|
||||
DefaultColormap (XtDisplay (view),
|
||||
@@ -400,7 +400,7 @@ XColor *colrs;
|
||||
blackbit = fg_color.pixel;
|
||||
whitebit = bg_color.pixel;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Error out here on visuals we can't handle so we won't core dump
|
||||
* later.
|
||||
@@ -420,7 +420,7 @@ XColor *colrs;
|
||||
colrs[blackbit].blue = bg_color.blue;
|
||||
colrs[blackbit].pixel = bg_color.pixel;
|
||||
colrs[blackbit].flags = DoRed|DoGreen|DoBlue;
|
||||
|
||||
|
||||
colrs[whitebit].red = fg_color.red;
|
||||
colrs[whitebit].green = fg_color.green;
|
||||
colrs[whitebit].blue = fg_color.blue;
|
||||
@@ -434,7 +434,7 @@ XColor *colrs;
|
||||
colrs[blackbit].blue = fg_color.blue;
|
||||
colrs[blackbit].pixel = fg_color.pixel;
|
||||
colrs[blackbit].flags = DoRed|DoGreen|DoBlue;
|
||||
|
||||
|
||||
colrs[whitebit].red = bg_color.red;
|
||||
colrs[whitebit].green = bg_color.green;
|
||||
colrs[whitebit].blue = bg_color.blue;
|
||||
@@ -643,9 +643,9 @@ int *bg;
|
||||
{
|
||||
unsigned char *bit_data;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
*bg = -1;
|
||||
|
||||
|
||||
/* Obviously this isn't going to work. */
|
||||
if ((datafile == NULL)||(datafile[0] == '\0'))
|
||||
{
|
||||
@@ -655,10 +655,10 @@ int *bg;
|
||||
{
|
||||
fp = fopen(datafile, "r");
|
||||
}
|
||||
|
||||
|
||||
if (fp != NULL)
|
||||
{
|
||||
|
||||
|
||||
bit_data = ReadGIF(fp, w, h, colrs, bg);
|
||||
if (bit_data != NULL)
|
||||
{
|
||||
@@ -666,7 +666,7 @@ int *bg;
|
||||
return(bit_data);
|
||||
}
|
||||
rewind(fp);
|
||||
|
||||
|
||||
bit_data = ReadXbmBitmap(fp, datafile, w, h, colrs);
|
||||
if (bit_data != NULL)
|
||||
{
|
||||
@@ -674,7 +674,7 @@ int *bg;
|
||||
return(bit_data);
|
||||
}
|
||||
rewind(fp);
|
||||
|
||||
|
||||
bit_data = ReadXpm3Pixmap(fp, datafile, w, h, colrs, bg);
|
||||
if (bit_data != NULL)
|
||||
{
|
||||
@@ -682,10 +682,10 @@ int *bg;
|
||||
return(bit_data);
|
||||
}
|
||||
rewind(fp);
|
||||
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
/* I can't believe Mosaic works this way... - DXP */
|
||||
/* I have to put this BEFORE ReadJPEG, because that code
|
||||
/* I have to put this BEFORE ReadJPEG, because that code
|
||||
screws up the file pointer by closing it if there is an error - go fig. */
|
||||
bit_data = ReadPNG(fp, w, h, colrs);
|
||||
if (bit_data != NULL) /* ie. it was able to read the image */
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
102
src/pixmaps.c
102
src/pixmaps.c
@@ -176,17 +176,17 @@ struct pixload_info {
|
||||
{lock_domain_xpm,&securityDomain,0},
|
||||
{lock_md5_xpm,&securityMd5,0},
|
||||
{lock_login_xpm,&securityLogin,0},
|
||||
|
||||
{toolbar_back_1_xpm,&toolbarBack,0},
|
||||
{toolbar_forw_1_xpm,&toolbarForward,0},
|
||||
{toolbar_back_1_xpm,&toolbarBackGRAY,1},
|
||||
{toolbar_forw_1_xpm,&toolbarForwardGRAY,1},
|
||||
{toolbar_home_1_xpm,&toolbarHome,0},
|
||||
{toolbar_reload_1_xpm,&toolbarReload,0},
|
||||
{toolbar_open_1_xpm,&toolbarOpen,0},
|
||||
{toolbar_save_1_xpm,&toolbarSave,0},
|
||||
{toolbar_open_window_1_xpm,&toolbarNew,0},
|
||||
{toolbar_clone_window_1_xpm,&toolbarClone,0},
|
||||
|
||||
{toolbar_back_1_xpm,&toolbarBack,0},
|
||||
{toolbar_forw_1_xpm,&toolbarForward,0},
|
||||
{toolbar_back_1_xpm,&toolbarBackGRAY,1},
|
||||
{toolbar_forw_1_xpm,&toolbarForwardGRAY,1},
|
||||
{toolbar_home_1_xpm,&toolbarHome,0},
|
||||
{toolbar_reload_1_xpm,&toolbarReload,0},
|
||||
{toolbar_open_1_xpm,&toolbarOpen,0},
|
||||
{toolbar_save_1_xpm,&toolbarSave,0},
|
||||
{toolbar_open_window_1_xpm,&toolbarNew,0},
|
||||
{toolbar_clone_window_1_xpm,&toolbarClone,0},
|
||||
{toolbar_close_window_1_xpm,&toolbarClose,0},
|
||||
{toolbar_hotlist_1_xpm,&toolbarAddHotlist,0},
|
||||
{toolbar_news_groups_1_xpm,&toolbarNewsGroups,0},
|
||||
@@ -207,20 +207,20 @@ struct pixload_info {
|
||||
{toolbar_print_1_xpm,&toolbarPrint,0},
|
||||
{toolbar_ftp_put_1_xpm,&toolbarFTPput,0},
|
||||
{toolbar_ftp_mkdir_1_xpm,&toolbarFTPmkdir,0},
|
||||
|
||||
{tearv_xpm,&tearv,0},
|
||||
{tearh_xpm,&tearh,0},
|
||||
|
||||
{xm_error_xpm,&dialogError,0},
|
||||
{xm_question_xpm,&dialogQuestion,0},
|
||||
{xm_information_xpm,&dialogInformation,0},
|
||||
{xm_warning_xpm,&dialogWarning,0},
|
||||
{tearv_xpm,&tearv,0},
|
||||
{tearh_xpm,&tearh,0},
|
||||
|
||||
{xm_error_xpm,&dialogError,0},
|
||||
{xm_question_xpm,&dialogQuestion,0},
|
||||
{xm_information_xpm,&dialogInformation,0},
|
||||
{xm_warning_xpm,&dialogWarning,0},
|
||||
|
||||
{not_secure_xpm, &enc_not_secure, 0},
|
||||
{NULL, NULL,0}
|
||||
};
|
||||
|
||||
|
||||
|
||||
static GC DrawGC = NULL;
|
||||
int IconWidth = 0;
|
||||
int IconHeight = 0;
|
||||
@@ -250,7 +250,7 @@ static char **LoadPixmapFile(char *file)
|
||||
char **pdata;
|
||||
char buf[256],*p;
|
||||
int j;
|
||||
|
||||
|
||||
FILE *fp;
|
||||
|
||||
int x,y,c,i;
|
||||
@@ -266,21 +266,21 @@ static char **LoadPixmapFile(char *file)
|
||||
while(!feof(fp)) {
|
||||
if(!fgets(buf,PBUF,fp)) return NULL;
|
||||
if(buf[0]=='"') {
|
||||
|
||||
|
||||
if(sscanf(&buf[1],"%d %d %d ",&x,&y,&c) != 3) {
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(p=&buf[1];*p && *p!='"';p++);
|
||||
if(!*p) {
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
} else {
|
||||
} else {
|
||||
*p=0;
|
||||
}
|
||||
|
||||
|
||||
pdata = (char **) malloc(sizeof(char *) * (y+c+2));
|
||||
pdata[0] = strdup(&buf[1]);
|
||||
|
||||
@@ -289,12 +289,12 @@ static char **LoadPixmapFile(char *file)
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if(buf[0]=='"') {
|
||||
for(p=&buf[1];*p && *p!='"';p++);
|
||||
if(!*p) {
|
||||
while(i<0) free(pdata[--i]);
|
||||
free(pdata);
|
||||
free(pdata);
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
} else {
|
||||
@@ -304,21 +304,21 @@ static char **LoadPixmapFile(char *file)
|
||||
} else {
|
||||
i--; /* skip comments, etc */
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
pdata[y+c+1]=NULL; /*for ease of deletion - trust me. -bjs */
|
||||
fclose(fp);
|
||||
|
||||
|
||||
return pdata;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static XColor def_colrs[256];
|
||||
static int init_colors = 1;
|
||||
|
||||
@@ -455,7 +455,7 @@ highbit(unsigned long ul)
|
||||
* returns position of highest set bit in 'ul' as an integer (0-31),
|
||||
* or -1 if none.
|
||||
*/
|
||||
|
||||
|
||||
int i;
|
||||
for (i=31; ((ul&0x80000000) == 0) && i>=0; i--, ul<<=1);
|
||||
return i;
|
||||
@@ -488,7 +488,7 @@ PixmapFromData(Widget wid, unsigned char *data, int width, int height,
|
||||
unsigned long c;
|
||||
int rshift, gshift, bshift;
|
||||
|
||||
|
||||
|
||||
if (data == NULL)
|
||||
{
|
||||
return(0);
|
||||
@@ -555,7 +555,7 @@ PixmapFromData(Widget wid, unsigned char *data, int width, int height,
|
||||
datap++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free((char *)data);
|
||||
data = tmpdata;
|
||||
|
||||
@@ -756,7 +756,7 @@ void ReleaseSplashColors(Widget wid)
|
||||
DefaultColormapOfScreen(XtScreen(wid))),p,j,0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* try to alloc *colorcount colors.
|
||||
set *colorcount to 1 if ok.
|
||||
@@ -769,7 +769,7 @@ Pixmap LoadSplashXPM(Widget wid, int *colorcount)
|
||||
int indx, w, h, bg;
|
||||
XColor colrs[256];
|
||||
int i;
|
||||
|
||||
|
||||
Pixmap r;
|
||||
|
||||
/* try to grab *colorcount colors */
|
||||
@@ -787,10 +787,10 @@ Pixmap LoadSplashXPM(Widget wid, int *colorcount)
|
||||
*colorcount = 1;
|
||||
else
|
||||
*colorcount = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitHash();
|
||||
|
||||
|
||||
data = ProcessXpm3Data(wid, splash_xpm, &w, &h, colrs, &bg);
|
||||
r = PixmapFromData(wid, data, w, h, colrs,0);
|
||||
init_colors = 1;
|
||||
@@ -816,13 +816,13 @@ void MakePixmaps(Widget wid)
|
||||
int pix_count = get_pref_int(ePIX_COUNT);
|
||||
char *pix_basename = get_pref_string(ePIX_BASENAME);
|
||||
int number_of_frames = NUMBER_OF_FRAMES;
|
||||
|
||||
|
||||
|
||||
if (!been_here) {
|
||||
been_here=1;
|
||||
been_here=1;
|
||||
InitHash();
|
||||
}
|
||||
|
||||
|
||||
/* load pixmaps */
|
||||
for(i=0;pix_info[i].raw;i++) {
|
||||
data = ProcessXpm3Data(wid, pix_info[i].raw, &w, &h, colrs, &bg);
|
||||
@@ -840,7 +840,7 @@ void MakePixmaps(Widget wid)
|
||||
|
||||
IconPixBig = (Pixmap *) malloc(sizeof(Pixmap)*pix_count);
|
||||
fname = (char *) malloc(strlen(pix_basename)+8);
|
||||
|
||||
|
||||
for (i=0; i<pix_count; i++) {
|
||||
sprintf(fname,"%s%d.xpm",pix_basename,i+1);
|
||||
if(!(pdata=LoadPixmapFile(fname))){
|
||||
@@ -850,26 +850,26 @@ void MakePixmaps(Widget wid)
|
||||
set_pref(ePIX_COUNT, (void *)&number_of_frames);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
data = ProcessXpm3Data(wid, pdata, &w, &h, colrs, &bg);
|
||||
IconPixBig[i] = PixmapFromData(wid, data, w, h, colrs,0);
|
||||
|
||||
if ((IconWidth == 0)||(IconHeight == 0)) {
|
||||
IconWidth = w; IconHeight = h;
|
||||
|
||||
if ((IconWidth == 0)||(IconHeight == 0)) {
|
||||
IconWidth = w; IconHeight = h;
|
||||
}
|
||||
|
||||
|
||||
/* delete the temp pixmap data */
|
||||
for(j=0;pdata[j];j++) free(pdata[j]);
|
||||
free(pdata);
|
||||
}
|
||||
free(fname);
|
||||
free(fname);
|
||||
}
|
||||
else {
|
||||
set_pref(ePIX_COUNT, &number_of_frames);
|
||||
}
|
||||
|
||||
IconPix = IconPixBig;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
80
src/prefs.c
80
src/prefs.c
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Sep 20 11:05:19 CDT 1995
|
||||
* Modified: All the time.
|
||||
* Author: Dan Pape
|
||||
@@ -144,7 +144,7 @@ Boolean preferences_armegeddon(void) {
|
||||
|
||||
/* free preferences structure */
|
||||
free(thePrefsStructP);
|
||||
|
||||
|
||||
return(successful);
|
||||
|
||||
}
|
||||
@@ -159,14 +159,14 @@ Boolean preferences_armegeddon(void) {
|
||||
***************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
Function: create_prefs_filename(char *fname)
|
||||
Function: create_prefs_filename(char *fname)
|
||||
Desc: Generates a full path name for the preferences file
|
||||
***************************************************************************/
|
||||
static Boolean create_prefs_filename(char *fname) {
|
||||
|
||||
char *home_ptr, home[256];
|
||||
struct passwd *pwdent;
|
||||
|
||||
|
||||
/*
|
||||
* Try the HOME environment variable, then the password file, and
|
||||
* finally give up.
|
||||
@@ -182,17 +182,17 @@ static Boolean create_prefs_filename(char *fname) {
|
||||
else {
|
||||
strcpy(home,home_ptr);
|
||||
}
|
||||
|
||||
|
||||
sprintf(fname,"%s/%s",home,PREFERENCES_FILENAME);
|
||||
|
||||
|
||||
return(1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Function: read_preferences_file(prefsStructP inPrefsStruct)
|
||||
Desc: Read the prefs file into the incoming prefs struct.
|
||||
Desc: Read the prefs file into the incoming prefs struct.
|
||||
***************************************************************************/
|
||||
Boolean read_preferences_file(prefsStructP inPrefsStruct) {
|
||||
|
||||
@@ -205,8 +205,8 @@ Boolean read_preferences_file(prefsStructP inPrefsStruct) {
|
||||
inPrefsStruct = thePrefsStructP;
|
||||
|
||||
#if PREFS_FILE_IO
|
||||
|
||||
/* look for the file */
|
||||
|
||||
/* look for the file */
|
||||
if(!create_prefs_filename(prefs_file_pathname)) {
|
||||
fprintf(stderr, "Error: Can't generate pathname for preferences file\n");
|
||||
return 0;
|
||||
@@ -220,28 +220,28 @@ Boolean read_preferences_file(prefsStructP inPrefsStruct) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* open it and read all the stuff from the file into the prefs struct */
|
||||
if(!(fp=fopen(prefs_file_pathname, "r"))) {
|
||||
|
||||
fprintf(stderr, "Error: Can't open preferences file for reading\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* but first, check the version number of the prefs file */
|
||||
|
||||
fclose(fp);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
return successful;
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Function: revert_preferences_file(prefsStructP inPrefsStruct)
|
||||
Desc: Reverts the incoming prefs struct to the one last saved to
|
||||
disk.
|
||||
Desc: Reverts the incoming prefs struct to the one last saved to
|
||||
disk.
|
||||
***************************************************************************/
|
||||
static Boolean revert_preferences_file(prefsStructP inPrefsStruct) {
|
||||
|
||||
@@ -251,7 +251,7 @@ static Boolean revert_preferences_file(prefsStructP inPrefsStruct) {
|
||||
|
||||
/****************************************************************************
|
||||
Function: write_pref_string(FILE *fp, long pref_id, char *string)
|
||||
Desc:
|
||||
Desc:
|
||||
***************************************************************************/
|
||||
static Boolean write_pref_string(FILE *fp, long pref_id, char *string) {
|
||||
|
||||
@@ -269,12 +269,12 @@ static Boolean write_pref_string(FILE *fp, long pref_id, char *string) {
|
||||
return 1;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Function: write_pref_int(FILE *fp, long pref_id, char *string)
|
||||
Desc:
|
||||
Desc:
|
||||
***************************************************************************/
|
||||
static Boolean write_pref_int(FILE *fp, long pref_id, char *string) {
|
||||
|
||||
@@ -287,14 +287,14 @@ static Boolean write_pref_int(FILE *fp, long pref_id, char *string) {
|
||||
fprintf(fp, "%s: %d\n", string, narf);
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Function: write_pref_boolean(FILE *fp, long pref_id, char *string)
|
||||
Desc:
|
||||
Desc:
|
||||
***************************************************************************/
|
||||
static Boolean write_pref_boolean(FILE *fp, long pref_id, char *string) {
|
||||
|
||||
@@ -310,14 +310,14 @@ static Boolean write_pref_boolean(FILE *fp, long pref_id, char *string) {
|
||||
fprintf(fp, "%s: False\n", string);
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
Function: write_pref_float(FILE *fp, long pref_id, char *string)
|
||||
Desc:
|
||||
Desc:
|
||||
***************************************************************************/
|
||||
static Boolean write_pref_float(FILE *fp, long pref_id, char *string) {
|
||||
|
||||
@@ -330,9 +330,9 @@ static Boolean write_pref_float(FILE *fp, long pref_id, char *string) {
|
||||
fprintf(fp, "%s: %f\n", string, narf);
|
||||
|
||||
return 1;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -351,9 +351,9 @@ static Boolean write_preferences_file(prefsStructP inPrefsStruct) {
|
||||
|
||||
Boolean successful = 1;
|
||||
FILE *fp;
|
||||
|
||||
|
||||
if(!(fp=fopen(prefs_file_pathname, "w"))) {
|
||||
|
||||
|
||||
if(!(fp=fopen(prefs_file_pathname, "w"))) {
|
||||
fprintf(stderr, "Error: Can't open preferences file for writing\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -368,7 +368,7 @@ static Boolean write_preferences_file(prefsStructP inPrefsStruct) {
|
||||
fprintf(fp, "# Warning - this is NOT a user editable file!!!\n");
|
||||
fprintf(fp, "# If a character is out of place...it will be very bad.\n\n");
|
||||
|
||||
|
||||
|
||||
/* access all the fields in the prefs structure, and write them out */
|
||||
|
||||
write_pref_boolean(fp, eTRACK_VISITED_ANCHORS, "TRACK_VISITED_ANCHORS");
|
||||
@@ -520,15 +520,15 @@ static Boolean write_preferences_file(prefsStructP inPrefsStruct) {
|
||||
|
||||
write_pref_boolean(fp, eFOCUS_FOLLOWS_MOUSE, "FOCUS_FOLLOWS_MOUSE");
|
||||
write_pref_boolean(fp, eSESSION_HISTORY_ON_RBM, "SESSION_HISTORY_ON_RBM");
|
||||
write_pref_int(fp, eNUMBER_OF_ITEMS_IN_RBM_HISTORY,
|
||||
write_pref_int(fp, eNUMBER_OF_ITEMS_IN_RBM_HISTORY,
|
||||
"NUMBER_OF_ITEMS_IN_RBM_HISTORY");
|
||||
|
||||
write_pref_boolean (fp, eUSESHORTNEWSRC, "USESHORTNEWSRC");
|
||||
fclose(fp);
|
||||
return successful;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -948,7 +948,7 @@ void *get_pref(long pref_id) {
|
||||
case eUSETHREADVIEW:
|
||||
return (void *)&(thePrefsStructP->RdataP->newsConfigView);
|
||||
break;
|
||||
|
||||
|
||||
case eSHOWREADGROUPS:
|
||||
return (void *)&(thePrefsStructP->RdataP->newsShowReadGroups);
|
||||
break;
|
||||
@@ -960,7 +960,7 @@ void *get_pref(long pref_id) {
|
||||
case eSHOWALLGROUPS:
|
||||
return (void *)&(thePrefsStructP->RdataP->newsShowAllGroups);
|
||||
break;
|
||||
|
||||
|
||||
case eSHOWALLARTICLES:
|
||||
return (void *)&(thePrefsStructP->RdataP->newsShowAllArticles);
|
||||
break;
|
||||
@@ -1108,7 +1108,7 @@ int val=value;
|
||||
|
||||
/****************************************************************************
|
||||
Function: set_pref(long pref_id, void *incoming)
|
||||
Desc: set the single preference variable denoted by pref_id, to
|
||||
Desc: set the single preference variable denoted by pref_id, to
|
||||
whatever incoming points to.
|
||||
***************************************************************************/
|
||||
void set_pref(long pref_id, void *incoming) {
|
||||
@@ -1612,13 +1612,13 @@ void set_pref(long pref_id, void *incoming) {
|
||||
case ePOPUPCASCADEMAPPINGDELAY:
|
||||
thePrefsStructP->RdataP->popupCascadeMappingDelay =
|
||||
*((int *)incoming);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case eUSETHREADVIEW:
|
||||
thePrefsStructP->RdataP->newsConfigView = *((int *)incoming);
|
||||
break;
|
||||
|
||||
|
||||
case eSHOWREADGROUPS:
|
||||
thePrefsStructP->RdataP->newsShowReadGroups = *((int *)incoming);
|
||||
break;
|
||||
@@ -1630,7 +1630,7 @@ void set_pref(long pref_id, void *incoming) {
|
||||
case eSHOWALLGROUPS:
|
||||
thePrefsStructP->RdataP->newsShowAllGroups = *((int *)incoming);
|
||||
break;
|
||||
|
||||
|
||||
case eSHOWALLARTICLES:
|
||||
thePrefsStructP->RdataP->newsShowAllArticles = *((int *)incoming);
|
||||
break;
|
||||
@@ -1693,7 +1693,7 @@ void set_pref(long pref_id, void *incoming) {
|
||||
case eSESSION_HISTORY_ON_RBM:
|
||||
thePrefsStructP->RdataP->sessionHistoryOnRBM =
|
||||
*((Boolean *)incoming);
|
||||
break;
|
||||
break;
|
||||
case eNUMBER_OF_ITEMS_IN_RBM_HISTORY:
|
||||
thePrefsStructP->RdataP->numberOfItemsInRBMHistory = *((int *)incoming);
|
||||
break;
|
||||
|
||||
92
src/prefs.h
92
src/prefs.h
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Dec 20 11:08:12 CDT 1995
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -73,77 +73,77 @@ typedef struct
|
||||
/* anchors */
|
||||
|
||||
Boolean track_visited_anchors;
|
||||
Boolean display_urls_not_titles;
|
||||
Boolean display_urls_not_titles;
|
||||
Boolean track_pointer_motion;
|
||||
Boolean track_full_url_names;
|
||||
|
||||
/* annotations */
|
||||
|
||||
|
||||
Boolean annotations_on_top;
|
||||
Boolean confirm_delete_annotation;
|
||||
char *annotation_server;
|
||||
|
||||
|
||||
/* audio */
|
||||
|
||||
char *record_command_location;
|
||||
char *record_command;
|
||||
|
||||
|
||||
/* cache */
|
||||
|
||||
Boolean reload_pragma_no_cache;
|
||||
|
||||
/* strings (command names, file names) */
|
||||
|
||||
|
||||
char *sendmail_command;
|
||||
char *edit_command;
|
||||
char *xterm_command;
|
||||
char *mail_filter_command;
|
||||
|
||||
|
||||
/* directories */
|
||||
|
||||
char *private_annotation_directory;
|
||||
|
||||
/* document */
|
||||
|
||||
char *home_document;
|
||||
|
||||
char *home_document;
|
||||
char *tmp_directory;
|
||||
char *docs_directory;
|
||||
|
||||
|
||||
/* fonts */
|
||||
|
||||
|
||||
char *default_font_choice;
|
||||
|
||||
|
||||
/* history */
|
||||
|
||||
|
||||
char *global_history_file;
|
||||
char *history_file;
|
||||
Boolean use_global_history;
|
||||
|
||||
Boolean use_global_history;
|
||||
|
||||
/* hotlist */
|
||||
|
||||
|
||||
char *default_hotlist_file;
|
||||
char *default_hot_file;
|
||||
char *documents_menu_specfile;
|
||||
Boolean addHotlistAddsRBM;
|
||||
Boolean addRBMAddsRBM;
|
||||
|
||||
|
||||
/* images */
|
||||
|
||||
|
||||
int colors_per_inlined_image;
|
||||
int image_cache_size;
|
||||
Boolean reload_reloads_images;
|
||||
Boolean reverse_inlined_bitmap_colors;
|
||||
Boolean delay_image_loads;
|
||||
|
||||
|
||||
/* mail */
|
||||
|
||||
|
||||
char *default_author_name;
|
||||
char *default_author_email;
|
||||
char *signature;
|
||||
char *mail_mode;
|
||||
|
||||
|
||||
/* MIME */
|
||||
|
||||
|
||||
char *print_command;
|
||||
char *uncompress_command;
|
||||
char *gunzip_command;
|
||||
@@ -157,23 +157,23 @@ typedef struct
|
||||
|
||||
/* layout info form main gui */
|
||||
char *gui_layout;
|
||||
|
||||
|
||||
/* news */
|
||||
|
||||
|
||||
/* printing */
|
||||
|
||||
|
||||
char *print_mode;
|
||||
Boolean print_banners;
|
||||
Boolean print_footnotes;
|
||||
Boolean print_us;
|
||||
|
||||
|
||||
/* proxy */
|
||||
|
||||
|
||||
char *proxy_specfile;
|
||||
char *noproxy_specfile;
|
||||
|
||||
|
||||
/* services */
|
||||
|
||||
|
||||
int cciPort;
|
||||
int max_num_of_cci_connections;
|
||||
int max_wais_responses;
|
||||
@@ -182,15 +182,15 @@ typedef struct
|
||||
Boolean kioskNoExit;
|
||||
Boolean keepAlive;
|
||||
int ftp_timeout_val;
|
||||
|
||||
|
||||
/* tables */
|
||||
|
||||
|
||||
Boolean enable_tables;
|
||||
|
||||
|
||||
/* window */
|
||||
|
||||
int default_width;
|
||||
int default_height;
|
||||
|
||||
int default_width;
|
||||
int default_height;
|
||||
Boolean auto_place_windows;
|
||||
Boolean initial_window_iconic;
|
||||
Boolean titleIsWindowTitle;
|
||||
@@ -203,15 +203,15 @@ typedef struct
|
||||
/* Save file stuff */
|
||||
|
||||
char *save_mode;
|
||||
|
||||
|
||||
/* HDF stuff */
|
||||
|
||||
|
||||
int hdf_max_image_dimension;
|
||||
int hdf_max_displayed_datasets;
|
||||
int hdf_max_displayed_attributes;
|
||||
Boolean hdf_power_user;
|
||||
Boolean hdflongname;
|
||||
|
||||
|
||||
/* miscellaneous */
|
||||
|
||||
char *full_hostname;
|
||||
@@ -219,12 +219,12 @@ typedef struct
|
||||
Boolean edit_command_use_xterm;
|
||||
Boolean confirm_exit;
|
||||
Boolean default_fancy_selections;
|
||||
Boolean catch_prior_and_next;
|
||||
Boolean simple_interface;
|
||||
Boolean protect_me_from_myself;
|
||||
Boolean gethostbyname_is_evil;
|
||||
Boolean catch_prior_and_next;
|
||||
Boolean simple_interface;
|
||||
Boolean protect_me_from_myself;
|
||||
Boolean gethostbyname_is_evil;
|
||||
Boolean useAFSKlog;
|
||||
|
||||
|
||||
#ifdef __sgi
|
||||
Boolean debugging_malloc;
|
||||
#endif
|
||||
@@ -275,8 +275,8 @@ typedef struct
|
||||
Boolean imageViewInternal;
|
||||
int urlExpired;
|
||||
int popupCascadeMappingDelay;
|
||||
Boolean frame_hack;
|
||||
|
||||
Boolean frame_hack;
|
||||
|
||||
/* newest in 2.7 (ha top that) */
|
||||
Boolean newsNoThreadJumping;
|
||||
Boolean newsShowAllArticles;
|
||||
@@ -353,7 +353,7 @@ void mo_preferences_dialog(mo_window *win);
|
||||
4) Add an enumeration for the varuable in the prefs_defs.h file.
|
||||
|
||||
(the rest of the changes are in prefs.c)
|
||||
|
||||
|
||||
5) Add a write_pref_* function call to the list in
|
||||
write_preferences_file() so that your preference will be added to the
|
||||
new prefs file.
|
||||
|
||||
166
src/prefs_defs.h
166
src/prefs_defs.h
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Fri Dec 22 21:14:56 CDT 1995
|
||||
* Author: Dan Pape
|
||||
*
|
||||
@@ -63,99 +63,99 @@
|
||||
|
||||
enum pref_item {
|
||||
|
||||
eTRACK_VISITED_ANCHORS,
|
||||
eDISPLAY_URLS_NOT_TITLES,
|
||||
eTRACK_POINTER_MOTION,
|
||||
eTRACK_FULL_URL_NAMES,
|
||||
eANNOTATIONS_ON_TOP,
|
||||
eCONFIRM_DELETE_ANNOTATION,
|
||||
eANNOTATION_SERVER,
|
||||
eRECORD_COMMAND_LOCATION,
|
||||
eRECORD_COMMAND,
|
||||
eRELOAD_PRAGMA_NO_CACHE,
|
||||
eSENDMAIL_COMMAND,
|
||||
eEDIT_COMMAND,
|
||||
eXTERM_COMMAND,
|
||||
eMAIL_FILTER_COMMAND,
|
||||
ePRIVATE_ANNOTATION_DIRECTORY,
|
||||
eHOME_DOCUMENT,
|
||||
eTMP_DIRECTORY,
|
||||
eDOCS_DIRECTORY,
|
||||
eDEFAULT_FONT_CHOICE,
|
||||
eGLOBAL_HISTORY_FILE,
|
||||
eTRACK_VISITED_ANCHORS,
|
||||
eDISPLAY_URLS_NOT_TITLES,
|
||||
eTRACK_POINTER_MOTION,
|
||||
eTRACK_FULL_URL_NAMES,
|
||||
eANNOTATIONS_ON_TOP,
|
||||
eCONFIRM_DELETE_ANNOTATION,
|
||||
eANNOTATION_SERVER,
|
||||
eRECORD_COMMAND_LOCATION,
|
||||
eRECORD_COMMAND,
|
||||
eRELOAD_PRAGMA_NO_CACHE,
|
||||
eSENDMAIL_COMMAND,
|
||||
eEDIT_COMMAND,
|
||||
eXTERM_COMMAND,
|
||||
eMAIL_FILTER_COMMAND,
|
||||
ePRIVATE_ANNOTATION_DIRECTORY,
|
||||
eHOME_DOCUMENT,
|
||||
eTMP_DIRECTORY,
|
||||
eDOCS_DIRECTORY,
|
||||
eDEFAULT_FONT_CHOICE,
|
||||
eGLOBAL_HISTORY_FILE,
|
||||
eUSE_GLOBAL_HISTORY,
|
||||
eHISTORY_FILE,
|
||||
eDEFAULT_HOTLIST_FILE,
|
||||
eDEFAULT_HOT_FILE,
|
||||
eDEFAULT_HOTLIST_FILE,
|
||||
eDEFAULT_HOT_FILE,
|
||||
eADD_HOTLIST_ADDS_RBM,
|
||||
eADD_RBM_ADDS_RBM,
|
||||
eDOCUMENTS_MENU_SPECFILE,
|
||||
eCOLORS_PER_INLINED_IMAGE,
|
||||
eIMAGE_CACHE_SIZE,
|
||||
eRELOAD_RELOADS_IMAGES,
|
||||
eREVERSE_INLINED_BITMAP_COLORS,
|
||||
eDELAY_IMAGE_LOADS,
|
||||
eDOCUMENTS_MENU_SPECFILE,
|
||||
eCOLORS_PER_INLINED_IMAGE,
|
||||
eIMAGE_CACHE_SIZE,
|
||||
eRELOAD_RELOADS_IMAGES,
|
||||
eREVERSE_INLINED_BITMAP_COLORS,
|
||||
eDELAY_IMAGE_LOADS,
|
||||
eSCREEN_GAMMA,
|
||||
eDEFAULT_AUTHOR_NAME,
|
||||
eDEFAULT_AUTHOR_EMAIL,
|
||||
eSIGNATURE,
|
||||
eMAIL_MODE,
|
||||
ePRINT_COMMAND,
|
||||
eUNCOMPRESS_COMMAND,
|
||||
eGUNZIP_COMMAND,
|
||||
eUSE_DEFAULT_EXTENSION_MAP,
|
||||
eUSE_DEFAULT_TYPE_MAP,
|
||||
eGLOBAL_EXTENSION_MAP,
|
||||
ePERSONAL_EXTENSION_MAP,
|
||||
eGLOBAL_TYPE_MAP,
|
||||
ePERSONAL_TYPE_MAP,
|
||||
eDEFAULT_AUTHOR_NAME,
|
||||
eDEFAULT_AUTHOR_EMAIL,
|
||||
eSIGNATURE,
|
||||
eMAIL_MODE,
|
||||
ePRINT_COMMAND,
|
||||
eUNCOMPRESS_COMMAND,
|
||||
eGUNZIP_COMMAND,
|
||||
eUSE_DEFAULT_EXTENSION_MAP,
|
||||
eUSE_DEFAULT_TYPE_MAP,
|
||||
eGLOBAL_EXTENSION_MAP,
|
||||
ePERSONAL_EXTENSION_MAP,
|
||||
eGLOBAL_TYPE_MAP,
|
||||
ePERSONAL_TYPE_MAP,
|
||||
eTWEAK_GOPHER_TYPES,
|
||||
eGUI_LAYOUT,
|
||||
ePRINT_MODE,
|
||||
ePRINT_BANNERS,
|
||||
ePRINT_FOOTNOTES,
|
||||
ePRINT_PAPER_SIZE_US,
|
||||
ePROXY_SPECFILE,
|
||||
eNOPROXY_SPECFILE,
|
||||
eCCIPORT,
|
||||
eMAX_NUM_OF_CCI_CONNECTIONS,
|
||||
eMAX_WAIS_RESPONSES,
|
||||
eKIOSK,
|
||||
ePRINT_MODE,
|
||||
ePRINT_BANNERS,
|
||||
ePRINT_FOOTNOTES,
|
||||
ePRINT_PAPER_SIZE_US,
|
||||
ePROXY_SPECFILE,
|
||||
eNOPROXY_SPECFILE,
|
||||
eCCIPORT,
|
||||
eMAX_NUM_OF_CCI_CONNECTIONS,
|
||||
eMAX_WAIS_RESPONSES,
|
||||
eKIOSK,
|
||||
eKIOSKPRINT,
|
||||
eKIOSKNOEXIT,
|
||||
eKEEPALIVE,
|
||||
eFTP_TIMEOUT_VAL,
|
||||
eENABLE_TABLES,
|
||||
eDEFAULT_WIDTH,
|
||||
eDEFAULT_HEIGHT,
|
||||
eAUTO_PLACE_WINDOWS,
|
||||
eINITIAL_WINDOW_ICONIC,
|
||||
eTITLEISWINDOWTITLE,
|
||||
eUSEICONBAR,
|
||||
eUSETEXTBUTTONBAR,
|
||||
eTWIRLING_TRANSFER_ICON,
|
||||
eSECURITYICON,
|
||||
eTWIRL_INCREMENT,
|
||||
eSAVE_MODE,
|
||||
eHDF_MAX_IMAGE_DIMENSION,
|
||||
eHDF_MAX_DISPLAYED_DATASETS,
|
||||
eHDF_MAX_DISPLAYED_ATTRIBUTES,
|
||||
eHDF_POWER_USER,
|
||||
eHDFLONGNAME,
|
||||
eFULL_HOSTNAME,
|
||||
eLOAD_LOCAL_FILE,
|
||||
eEDIT_COMMAND_USE_XTERM,
|
||||
eCONFIRM_EXIT,
|
||||
eDEFAULT_FANCY_SELECTIONS,
|
||||
eCATCH_PRIOR_AND_NEXT,
|
||||
eSIMPLE_INTERFACE,
|
||||
ePROTECT_ME_FROM_MYSELF,
|
||||
eGETHOSTBYNAME_IS_EVIL,
|
||||
eKIOSKNOEXIT,
|
||||
eKEEPALIVE,
|
||||
eFTP_TIMEOUT_VAL,
|
||||
eENABLE_TABLES,
|
||||
eDEFAULT_WIDTH,
|
||||
eDEFAULT_HEIGHT,
|
||||
eAUTO_PLACE_WINDOWS,
|
||||
eINITIAL_WINDOW_ICONIC,
|
||||
eTITLEISWINDOWTITLE,
|
||||
eUSEICONBAR,
|
||||
eUSETEXTBUTTONBAR,
|
||||
eTWIRLING_TRANSFER_ICON,
|
||||
eSECURITYICON,
|
||||
eTWIRL_INCREMENT,
|
||||
eSAVE_MODE,
|
||||
eHDF_MAX_IMAGE_DIMENSION,
|
||||
eHDF_MAX_DISPLAYED_DATASETS,
|
||||
eHDF_MAX_DISPLAYED_ATTRIBUTES,
|
||||
eHDF_POWER_USER,
|
||||
eHDFLONGNAME,
|
||||
eFULL_HOSTNAME,
|
||||
eLOAD_LOCAL_FILE,
|
||||
eEDIT_COMMAND_USE_XTERM,
|
||||
eCONFIRM_EXIT,
|
||||
eDEFAULT_FANCY_SELECTIONS,
|
||||
eCATCH_PRIOR_AND_NEXT,
|
||||
eSIMPLE_INTERFACE,
|
||||
ePROTECT_ME_FROM_MYSELF,
|
||||
eGETHOSTBYNAME_IS_EVIL,
|
||||
#ifdef __sgi
|
||||
eDEBUGGING_MALLOC,
|
||||
#endif
|
||||
eUSEAFSKLOG,
|
||||
|
||||
|
||||
eSEND_REFERER,
|
||||
eSEND_AGENT,
|
||||
eEXPAND_URLS,
|
||||
@@ -190,7 +190,7 @@ enum pref_item {
|
||||
eCACHETRACE,
|
||||
eNUTTRACE,
|
||||
eANIMATEBUSYICON,
|
||||
|
||||
|
||||
eSPLASHSCREEN,
|
||||
eINSTALL_COLORMAP,
|
||||
eIMAGEVIEWINTERNAL,
|
||||
|
||||
@@ -112,8 +112,8 @@ struct EditInfo {
|
||||
int type; /* Is this an Edit or an Add ? */
|
||||
int domaintype; /* Is this an Edit or an Add ? */
|
||||
char *help_file;
|
||||
Widget scrolled;
|
||||
Widget translation;
|
||||
Widget scrolled;
|
||||
Widget translation;
|
||||
struct Proxy *editing;
|
||||
struct InfoFields *IF;
|
||||
struct ProxyDomain *editingDomain;
|
||||
@@ -123,9 +123,9 @@ struct EditInfo {
|
||||
|
||||
void AddProxyToList(), ShowProxyList(), EditProxyInfo(), CommitProxyInfo(),
|
||||
DismissProxy(), ClearProxyText(), FillProxyText(), WriteProxies(),
|
||||
RemoveProxyInfo(), EditProxyDomainInfo(), DisplayErrorMessage(),
|
||||
RemoveProxyInfo(), EditProxyDomainInfo(), DisplayErrorMessage(),
|
||||
ShowProxyDomainList(), CommitProxyDomainInfo(),
|
||||
CallEdit(), CallAdd(), CallEditDomain(), CallAddDomain(),
|
||||
CallEdit(), CallAdd(), CallEditDomain(), CallAddDomain(),
|
||||
CallRemoveProxy(), DestroyDialog(), PopProxyDialog(), DeleteProxy(),
|
||||
EditNoProxyInfo(), CenterDialog(), ProxyHelpWindow(), HelpWindow(),
|
||||
DisableProxy();
|
||||
@@ -187,7 +187,7 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
}
|
||||
|
||||
/*
|
||||
** Try and get a nice non-proportional font. If we can't get
|
||||
** Try and get a nice non-proportional font. If we can't get
|
||||
** it, then the heck with it, just use the default.
|
||||
*/
|
||||
font = XLoadQueryFont(XtDisplay(win->base), FONTNAME);
|
||||
@@ -222,7 +222,7 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNfractionBase, 6,
|
||||
NULL);
|
||||
|
||||
save = XtVaCreateManagedWidget("Save",
|
||||
save = XtVaCreateManagedWidget("Save",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -233,8 +233,8 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
edit = XtVaCreateManagedWidget("Edit",
|
||||
|
||||
edit = XtVaCreateManagedWidget("Edit",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -246,7 +246,7 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
add = XtVaCreateManagedWidget("Add",
|
||||
add = XtVaCreateManagedWidget("Add",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -257,8 +257,8 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
remove = XtVaCreateManagedWidget("Remove",
|
||||
|
||||
remove = XtVaCreateManagedWidget("Remove",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -270,7 +270,7 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Dismiss",
|
||||
dismiss = XtVaCreateManagedWidget("Dismiss",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -281,8 +281,8 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_FORM,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
@@ -312,7 +312,7 @@ PopProxyDialog(mo_window *win, struct Proxy *list, int fProxy)
|
||||
XtSetArg(args[n], XmNbottomWidget, action_area); n++;
|
||||
if (font)
|
||||
XtSetArg(args[n], XmNfontList, fontlist); n++;
|
||||
|
||||
|
||||
scrolled = XmCreateScrolledList(main_form, "proxy_info", args, n);
|
||||
|
||||
XtManageChild(scrolled);
|
||||
@@ -420,13 +420,13 @@ CallAdd(Widget w, XtPointer client, XtPointer call)
|
||||
pEditInfo = (struct EditInfo *)client;
|
||||
|
||||
if (pdList != NULL) {
|
||||
p = pdList;
|
||||
p = pdList;
|
||||
while (p != NULL) {
|
||||
next = p->next;
|
||||
DeleteProxyDomain(p);
|
||||
p = next;
|
||||
}
|
||||
pdList = NULL;
|
||||
pdList = NULL;
|
||||
}
|
||||
|
||||
if (pEditInfo->fProxy)
|
||||
@@ -507,7 +507,7 @@ int type;
|
||||
return;
|
||||
}
|
||||
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
&selected_text);
|
||||
|
||||
pEditInfo->editing = FindProxyEntry(pEditInfo, selected_text);
|
||||
@@ -558,7 +558,7 @@ int type;
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -568,8 +568,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, sep,
|
||||
@@ -581,8 +581,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -620,7 +620,7 @@ int type;
|
||||
pEditInfo->IF->domain_text = NULL;
|
||||
pEditInfo->IF->trans_menu = NULL;
|
||||
pEditInfo->IF->alive = NULL;
|
||||
|
||||
|
||||
form = XtVaCreateWidget("form1",
|
||||
xmFormWidgetClass, rc2,
|
||||
XmNfractionBase, 10,
|
||||
@@ -643,7 +643,7 @@ int type;
|
||||
NULL);
|
||||
|
||||
XtManageChild(form);
|
||||
|
||||
|
||||
form = XtVaCreateWidget("form2",
|
||||
xmFormWidgetClass, rc2,
|
||||
XmNfractionBase, 10,
|
||||
@@ -734,7 +734,7 @@ int type;
|
||||
return;
|
||||
}
|
||||
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
&selected_text);
|
||||
|
||||
pEditInfo->editing = FindProxyEntry(pEditInfo, selected_text);
|
||||
@@ -793,7 +793,7 @@ int type;
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -803,8 +803,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, sep,
|
||||
@@ -816,8 +816,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -873,7 +873,7 @@ int type;
|
||||
NULL);
|
||||
|
||||
XtManageChild(form);
|
||||
|
||||
|
||||
form = XtVaCreateWidget("form2",
|
||||
xmFormWidgetClass, rc2,
|
||||
XmNfractionBase, 10,
|
||||
@@ -906,7 +906,7 @@ int type;
|
||||
NULL);
|
||||
|
||||
XtManageChild(form);
|
||||
|
||||
|
||||
form = XtVaCreateWidget("form3",
|
||||
xmFormWidgetClass, rc2,
|
||||
XmNfractionBase, 10,
|
||||
@@ -990,7 +990,7 @@ int type;
|
||||
XmStringFree(trans_string);
|
||||
XmStringFree(http_string);
|
||||
XmStringFree(cci_string);
|
||||
|
||||
|
||||
|
||||
XtManageChild(pEditInfo->IF->trans_menu);
|
||||
#endif
|
||||
@@ -1002,13 +1002,13 @@ int type;
|
||||
|
||||
trans_rc = XtVaCreateWidget("trans_rc",
|
||||
xmRowColumnWidgetClass, rc,
|
||||
XmNorientation, XmVERTICAL,
|
||||
XmNorientation, XmVERTICAL,
|
||||
NULL);
|
||||
|
||||
label = XtVaCreateManagedWidget("Scheme Info",
|
||||
xmLabelWidgetClass, trans_rc,
|
||||
NULL);
|
||||
|
||||
|
||||
pEditInfo->translation = XmCreateScrolledList(trans_rc, "trans_info", NULL, 0);
|
||||
|
||||
XtVaSetValues(pEditInfo->translation,
|
||||
@@ -1036,17 +1036,17 @@ int type;
|
||||
add = XtVaCreateManagedWidget("Add",
|
||||
xmPushButtonWidgetClass, rc3,
|
||||
NULL);
|
||||
|
||||
|
||||
remove = XtVaCreateManagedWidget("Remove",
|
||||
xmPushButtonWidgetClass, rc3,
|
||||
NULL);
|
||||
|
||||
|
||||
edit = XtVaCreateManagedWidget("Edit",
|
||||
xmPushButtonWidgetClass, rc3,
|
||||
NULL);
|
||||
|
||||
XtManageChild(rc3);
|
||||
|
||||
|
||||
XtManageChild(trans_rc);
|
||||
|
||||
XtManageChild(rc);
|
||||
@@ -1121,7 +1121,7 @@ int type;
|
||||
return;
|
||||
}
|
||||
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
XmStringGetLtoR(selected_string, XmSTRING_DEFAULT_CHARSET,
|
||||
&selected_text);
|
||||
|
||||
if (pdList)
|
||||
@@ -1170,7 +1170,7 @@ int type;
|
||||
XmNrightAttachment, XmATTACH_FORM,
|
||||
NULL);
|
||||
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
dismiss = XtVaCreateManagedWidget("Abort",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNtopAttachment, XmATTACH_WIDGET,
|
||||
XmNtopWidget, sep,
|
||||
@@ -1182,8 +1182,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
|
||||
commit = XtVaCreateManagedWidget("Commit",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -1193,8 +1193,8 @@ int type;
|
||||
XmNshowAsDefault, True,
|
||||
XmNdefaultButtonShadowThickness, 1,
|
||||
NULL);
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
|
||||
help = XtVaCreateManagedWidget("Help...",
|
||||
xmPushButtonWidgetClass, action_area,
|
||||
XmNbottomAttachment, XmATTACH_FORM,
|
||||
XmNleftAttachment, XmATTACH_POSITION,
|
||||
@@ -1250,7 +1250,7 @@ int type;
|
||||
XtAddCallback(commit, XmNactivateCallback, CommitProxyDomainInfo, pEditInfo);
|
||||
XtAddCallback(EditProxyDomainDialog, XmNdestroyCallback, DestroyDialog, &fEditProxyDomainDialog);
|
||||
XtAddCallback(EditProxyDomainDialog, XmNpopupCallback, CenterDialog, NULL);
|
||||
|
||||
|
||||
XtAddCallback(help, XmNactivateCallback, HelpWindow, "help-proxy-domain-edit.html");
|
||||
|
||||
XtPopup(EditProxyDomainDialog, XtGrabNone);
|
||||
@@ -1264,7 +1264,7 @@ ShowProxyList(struct EditInfo *pEditInfo)
|
||||
|
||||
scrolled = pEditInfo->scrolled;
|
||||
|
||||
proxy = pEditInfo->proxy_list;
|
||||
proxy = pEditInfo->proxy_list;
|
||||
|
||||
XmListDeleteAllItems(pEditInfo->scrolled);
|
||||
|
||||
@@ -1325,7 +1325,7 @@ GetNoProxy(char *access, char *site)
|
||||
if (strstr(site,p->address)) {
|
||||
if (p->port == NULL) {
|
||||
break;
|
||||
} else {
|
||||
} else {
|
||||
int match_port = atoi(p->port);
|
||||
if (match_port == portnum)
|
||||
break;
|
||||
@@ -1375,10 +1375,10 @@ GetProxy(char *proxy, char *access, int fMatchEnd)
|
||||
** everything. Bale out here.
|
||||
*/
|
||||
if (p->list == NULL)
|
||||
return p;
|
||||
|
||||
return p;
|
||||
|
||||
pd = p->list;
|
||||
|
||||
|
||||
while (pd != NULL) {
|
||||
char *ptr;
|
||||
|
||||
@@ -1387,11 +1387,11 @@ GetProxy(char *proxy, char *access, int fMatchEnd)
|
||||
if (ptr) {
|
||||
if (fMatchEnd) {
|
||||
/* at the end? */
|
||||
if (strlen(ptr) == strlen(pd->domain))
|
||||
if (strlen(ptr) == strlen(pd->domain))
|
||||
break;
|
||||
} else {
|
||||
/* at beginning? */
|
||||
if (ptr == access)
|
||||
if (ptr == access)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1418,7 +1418,7 @@ FindProxyEntry(struct EditInfo *pEditInfo, char *txt)
|
||||
fProxy = pEditInfo->fProxy;
|
||||
|
||||
if (fProxy) {
|
||||
sscanf(txt,"%s %s",proxy,address);
|
||||
sscanf(txt,"%s %s",proxy,address);
|
||||
ptr = strchr(address,':');
|
||||
if (ptr) { /* which should always be true.... */
|
||||
*ptr++ = '\0';
|
||||
@@ -1427,7 +1427,7 @@ FindProxyEntry(struct EditInfo *pEditInfo, char *txt)
|
||||
}
|
||||
else {
|
||||
if ((ptr = strchr(txt,':')) != NULL) {
|
||||
*ptr = ' ';
|
||||
*ptr = ' ';
|
||||
sscanf(txt,"%s %s", address, port);
|
||||
} else {
|
||||
sscanf(txt,"%s",address);
|
||||
@@ -1451,7 +1451,7 @@ FindProxyEntry(struct EditInfo *pEditInfo, char *txt)
|
||||
}
|
||||
p = p->next;
|
||||
}
|
||||
|
||||
|
||||
if (p == NULL)
|
||||
return NULL; /* whoops */
|
||||
return p;
|
||||
@@ -1490,7 +1490,7 @@ FillProxyText(struct EditInfo *p)
|
||||
XmToggleButtonSetState(p->IF->alive, True, False);
|
||||
}
|
||||
|
||||
if (p->editing->list == NULL)
|
||||
if (p->editing->list == NULL)
|
||||
return;
|
||||
|
||||
ShowProxyDomainList(p);
|
||||
@@ -1541,7 +1541,7 @@ ClearProxyText(struct EditInfo *p)
|
||||
XmToggleButtonSetState(p->IF->alive, True, False);
|
||||
if (p->translation)
|
||||
XmListDeleteAllItems(p->translation);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CommitProxyInfo(w, client, call)
|
||||
@@ -1678,9 +1678,9 @@ CommitProxyDomainInfo(Widget w, XtPointer client, XtPointer call)
|
||||
|
||||
domain = XmTextGetString(p->IF->domain_text);
|
||||
if (domain[0] == '\0') {
|
||||
|
||||
|
||||
XmxMakeErrorDialog(mo_main_window->base, COMMIT_DOMAIN_EMPTY_ERROR, "No Entry Selected");
|
||||
|
||||
|
||||
XtManageChild (Xmx_w);
|
||||
return;
|
||||
}
|
||||
@@ -1713,11 +1713,11 @@ CommitProxyDomainInfo(Widget w, XtPointer client, XtPointer call)
|
||||
AddProxyDomain(domain, &pd);
|
||||
}
|
||||
} else {
|
||||
p->editingDomain->domain =
|
||||
p->editingDomain->domain =
|
||||
(char *)realloc(p->editingDomain->domain,strlen(domain)+1);
|
||||
strcpy(p->editingDomain->domain, domain);
|
||||
}
|
||||
|
||||
|
||||
ShowProxyDomainList(p);
|
||||
XtPopdown(EditProxyDomainDialog);
|
||||
return;
|
||||
@@ -1763,7 +1763,7 @@ RemoveProxyInfo(Widget w, XtPointer client, XtPointer call, int type)
|
||||
XmString selected_string;
|
||||
char *selected_text;
|
||||
struct EditInfo *pEditInfo = (struct EditInfo *)client;
|
||||
|
||||
|
||||
if (type == PROXY)
|
||||
selected_string = GetStringFromScrolled(pEditInfo->scrolled);
|
||||
else
|
||||
@@ -1789,7 +1789,7 @@ RemoveProxyInfo(Widget w, XtPointer client, XtPointer call, int type)
|
||||
pdEntry = FindProxyDomainEntry(pdList, selected_text);
|
||||
else
|
||||
pdEntry = FindProxyDomainEntry(pEditInfo->editing->list, selected_text);
|
||||
|
||||
|
||||
if (pdList != NULL) {
|
||||
if (pdEntry == pdList)
|
||||
pdList = pdEntry->next;
|
||||
@@ -1827,7 +1827,7 @@ WriteProxies(Widget w, XtPointer client, XtPointer call)
|
||||
XtManageChild (Xmx_w);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
if ((fp = fopen(get_pref_string(eNOPROXY_SPECFILE),"w")) == NULL) {
|
||||
sprintf(msgbuf,SAVE_ERROR, get_pref_string(eNOPROXY_SPECFILE));
|
||||
XmxMakeErrorDialog(mo_main_window->base, msgbuf, "Error writing file");
|
||||
@@ -1845,7 +1845,7 @@ WriteProxies(Widget w, XtPointer client, XtPointer call)
|
||||
fprintf(fp,"%s ",p->port);
|
||||
if (p->transport)
|
||||
fprintf(fp,"%s ",p->transport);
|
||||
|
||||
|
||||
pd = p->list;
|
||||
|
||||
if (pd != NULL) {
|
||||
@@ -1891,7 +1891,7 @@ AppendProxy(struct EditInfo *pEditInfo, struct Proxy *p)
|
||||
p->prev = NULL;
|
||||
|
||||
if (cur != NULL) {
|
||||
while (cur->next != NULL)
|
||||
while (cur->next != NULL)
|
||||
cur = cur->next;
|
||||
|
||||
p->prev = cur;
|
||||
@@ -1928,7 +1928,7 @@ DeleteProxy(struct EditInfo *pEditInfo, struct Proxy *p)
|
||||
pEditInfo->proxy_list = NULL;
|
||||
if (pEditInfo->fProxy)
|
||||
proxy_list = NULL;
|
||||
|
||||
|
||||
else
|
||||
noproxy_list = NULL;
|
||||
} else {
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -71,7 +71,7 @@ ReadProxies(char *filename)
|
||||
struct Proxy *head, *cur, *next, *p;
|
||||
struct ProxyDomain *pCurList, *pNewDomain;
|
||||
extern void FreeProxy();
|
||||
|
||||
|
||||
if ((fp = fopen(filename,"r")) == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -86,7 +86,7 @@ ReadProxies(char *filename)
|
||||
while (fgets(buf, BUFLEN, fp) != 0) {
|
||||
|
||||
p = (struct Proxy *)calloc(1,sizeof(struct Proxy));
|
||||
|
||||
|
||||
p->next = NULL;
|
||||
p->prev = NULL;
|
||||
|
||||
@@ -181,7 +181,7 @@ ReadNoProxies(char *filename)
|
||||
char buf[BUFLEN], *psb;
|
||||
struct Proxy *head, *cur, *next, *p;
|
||||
extern void FreeProxy();
|
||||
|
||||
|
||||
if ((fp = fopen(filename,"r")) == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -196,7 +196,7 @@ ReadNoProxies(char *filename)
|
||||
while (fgets(buf, BUFLEN, fp) != 0) {
|
||||
|
||||
p = (struct Proxy *)calloc(1, sizeof(struct Proxy));
|
||||
|
||||
|
||||
p->next = NULL;
|
||||
p->prev = NULL;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -64,7 +64,7 @@ struct ProxyDomain {
|
||||
struct ProxyDomain *prev;
|
||||
char *domain;
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct Proxy {
|
||||
struct Proxy *next;
|
||||
@@ -82,9 +82,9 @@ struct Proxy {
|
||||
|
||||
void AddProxyToList(), ShowProxyList(), EditProxyInfo(), CommitProxyInfo(),
|
||||
DismissProxy(), ClearProxyText(), FillProxyText(), WriteProxies(),
|
||||
RemoveProxyInfo(), EditProxyDomainInfo(), DisplayErrorMessage(),
|
||||
RemoveProxyInfo(), EditProxyDomainInfo(), DisplayErrorMessage(),
|
||||
ShowProxyDomainList(), CommitProxyDomainInfo(),
|
||||
CallEdit(), CallAdd(), CallEditDomain(), CallAddDomain(),
|
||||
CallEdit(), CallAdd(), CallEditDomain(), CallAddDomain(),
|
||||
CallRemoveProxy(), DestroyDialog(), PopProxyDialog(), DeleteProxy(),
|
||||
EditNoProxyInfo(), CenterDialog(), ProxyHelpWindow(), HelpWindow();
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ int i;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* We set up the normal JPEG error routines,
|
||||
/* We set up the normal JPEG error routines,
|
||||
then override error_exit. */
|
||||
cinfo.err = jpeg_std_error(&jerr.pub);
|
||||
jerr.pub.error_exit = my_error_exit;
|
||||
@@ -82,14 +82,14 @@ int i;
|
||||
* See libjpeg.doc for more info.
|
||||
*/
|
||||
|
||||
cinfo.quantize_colors = TRUE;
|
||||
cinfo.quantize_colors = TRUE;
|
||||
/*cinfo.desired_number_of_colors = 50;*/
|
||||
cinfo.desired_number_of_colors = get_pref_int(eCOLORS_PER_INLINED_IMAGE);
|
||||
cinfo.two_pass_quantize = TRUE;
|
||||
|
||||
jpeg_start_decompress(&cinfo);
|
||||
|
||||
if (!(retBuffer = (unsigned char *) malloc(cinfo.output_width
|
||||
if (!(retBuffer = (unsigned char *) malloc(cinfo.output_width
|
||||
* cinfo.output_height * cinfo.output_components))) {
|
||||
jpeg_destroy_decompress(&cinfo);
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -103,7 +103,7 @@ int i;
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr,"buffer size is width=%d x height=%d x depth=%d\n",
|
||||
cinfo.output_width , cinfo.output_height ,
|
||||
cinfo.output_width , cinfo.output_height ,
|
||||
cinfo.output_components);
|
||||
}
|
||||
#endif
|
||||
@@ -141,7 +141,7 @@ int i;
|
||||
}
|
||||
else {
|
||||
for (i=0; i < cinfo.actual_number_of_colors; i++) {
|
||||
colrs[i].red = colrs[i].green =
|
||||
colrs[i].red = colrs[i].green =
|
||||
colrs[i].blue = cinfo.colormap[0][i] << 8;
|
||||
colrs[i].pixel = i;
|
||||
colrs[i].flags = DoRed|DoGreen|DoBlue;
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
106
src/readPNG.c
106
src/readPNG.c
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/* Author: DXP
|
||||
/* Author: DXP
|
||||
|
||||
A lot of this is copied from the PNGLIB file example.c
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
March 21 1996 - DXP
|
||||
Fixed some interlacing problems.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -103,25 +103,25 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
|
||||
png_color std_color_cube[216];
|
||||
|
||||
|
||||
|
||||
/* first check to see if its a valid PNG file. If not, return. */
|
||||
/* we assume that infile is a valid filepointer */
|
||||
{
|
||||
int ret;
|
||||
png_byte buf[8];
|
||||
|
||||
|
||||
ret = fread(buf, 1, 8, infile);
|
||||
|
||||
|
||||
if(ret != 8)
|
||||
return 0;
|
||||
|
||||
|
||||
ret = png_sig_cmp(buf, 0, 8);
|
||||
|
||||
|
||||
if(ret)
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* OK, it is a valid PNG file, so let's rewind it, and start
|
||||
/* OK, it is a valid PNG file, so let's rewind it, and start
|
||||
decoding it */
|
||||
rewind(infile);
|
||||
|
||||
@@ -140,7 +140,7 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
|
||||
/* Establish the setjmp return context for png_error to use. */
|
||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr, "\n!!!libpng read error!!!\n");
|
||||
@@ -154,28 +154,28 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
free((char *)png_pixels);
|
||||
if(row_pointers != NULL)
|
||||
free((png_byte **)row_pointers);
|
||||
|
||||
|
||||
/*free((char *)png_ptr);*/
|
||||
free((char *)info_ptr);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SAM_NO
|
||||
/* SWP -- Hopefully to fix cores on bad PNG files */
|
||||
png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL);
|
||||
png_set_message_fn(png_ptr,png_get_msg_ptr(png_ptr),NULL,NULL);
|
||||
#endif
|
||||
|
||||
/*png_read_init(png_ptr);*/
|
||||
|
||||
|
||||
/* set up the input control */
|
||||
png_init_io(png_ptr, infile);
|
||||
|
||||
|
||||
/* read the file information */
|
||||
png_read_info(png_ptr, info_ptr);
|
||||
|
||||
|
||||
/* setup other stuff using the fields of png_info. */
|
||||
|
||||
|
||||
*width = (int)png_ptr->width;
|
||||
*height = (int)png_ptr->height;
|
||||
|
||||
@@ -195,13 +195,13 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
|
||||
|
||||
#if 0
|
||||
/* This handles alpha and transparency by replacing it with
|
||||
/* This handles alpha and transparency by replacing it with
|
||||
a background value. */
|
||||
/* its #if'ed out for now cause I don't have anything to
|
||||
/* its #if'ed out for now cause I don't have anything to
|
||||
test it with */
|
||||
{
|
||||
png_color_16 my_background;
|
||||
|
||||
|
||||
if (info_ptr->valid & PNG_INFO_bKGD)
|
||||
png_set_background(png_ptr, &(info_ptr->background),
|
||||
PNG_GAMMA_FILE, 1, 1.0);
|
||||
@@ -237,24 +237,24 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
std_color_cube[i].blue=(i/36)*51;
|
||||
}
|
||||
|
||||
/* this should probably be dithering to
|
||||
/* this should probably be dithering to
|
||||
Rdata.colors_per_inlined_image colors */
|
||||
png_set_dither(png_ptr, std_color_cube,
|
||||
216,
|
||||
png_set_dither(png_ptr, std_color_cube,
|
||||
216,
|
||||
216, NULL, 1);
|
||||
|
||||
|
||||
} else {
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr,"dithering (RGB->file supplied palette)...\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
png_set_dither(png_ptr, info_ptr->palette,
|
||||
|
||||
png_set_dither(png_ptr, info_ptr->palette,
|
||||
info_ptr->num_palette,
|
||||
get_pref_int(eCOLORS_PER_INLINED_IMAGE),
|
||||
get_pref_int(eCOLORS_PER_INLINED_IMAGE),
|
||||
info_ptr->hist, 1);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
if (get_pref_boolean(eUSE_SCREEN_GAMMA)) { /*SWP*/
|
||||
if (info_ptr->bit_depth != 16) { /* temporary .. glennrp */
|
||||
screen_gamma=(double)(get_pref_float(eSCREEN_GAMMA));
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr,"screen gamma=%f\n",screen_gamma);
|
||||
@@ -295,12 +295,12 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (info_ptr->interlace_type)
|
||||
png_set_interlace_handling(png_ptr);
|
||||
|
||||
png_read_update_info(png_ptr, info_ptr);
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr,"\n\nAFTER\nheight = %d\n", (int)png_ptr->width);
|
||||
@@ -315,26 +315,26 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* allocate the pixel grid which we will need to send to
|
||||
/* allocate the pixel grid which we will need to send to
|
||||
png_read_image(). */
|
||||
png_pixels = (png_byte *)malloc(info_ptr->rowbytes *
|
||||
png_pixels = (png_byte *)malloc(info_ptr->rowbytes *
|
||||
(*height) * sizeof(png_byte));
|
||||
|
||||
|
||||
|
||||
row_pointers = (png_byte **) malloc((*height) * sizeof(png_byte *));
|
||||
for (i=0; i < *height; i++)
|
||||
row_pointers[i]=png_pixels+(info_ptr->rowbytes*i);
|
||||
|
||||
|
||||
|
||||
/* FINALLY - read the darn thing. */
|
||||
png_read_image(png_ptr, row_pointers);
|
||||
|
||||
|
||||
|
||||
|
||||
/* now that we have the (transformed to 8-bit RGB) image, we have
|
||||
to copy the resulting palette to our colormap. */
|
||||
if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) {
|
||||
if (info_ptr->valid & PNG_INFO_PLTE) {
|
||||
|
||||
|
||||
for (i=0; i < info_ptr->num_palette; i++) {
|
||||
colrs[i].red = info_ptr->palette[i].red << 8;
|
||||
colrs[i].green = info_ptr->palette[i].green << 8;
|
||||
@@ -342,7 +342,7 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
colrs[i].pixel = i;
|
||||
colrs[i].flags = DoRed|DoGreen|DoBlue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
for (i=0; i < 216; i++) {
|
||||
@@ -351,24 +351,24 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
colrs[i].blue = std_color_cube[i].blue << 8;
|
||||
colrs[i].pixel = i;
|
||||
colrs[i].flags = DoRed|DoGreen|DoBlue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* grayscale image */
|
||||
|
||||
|
||||
for(i=0; i < 256; i++ ) {
|
||||
colrs[i].red = i << 8;
|
||||
colrs[i].green = i << 8;
|
||||
colrs[i].green = i << 8;
|
||||
colrs[i].blue = i << 8;
|
||||
colrs[i].pixel = i;
|
||||
colrs[i].flags = DoRed|DoGreen|DoBlue;
|
||||
colrs[i].flags = DoRed|DoGreen|DoBlue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Now copy the pixel data from png_pixels to pixmap */
|
||||
|
||||
|
||||
pixmap = (png_byte *)malloc((*width) * (*height) * sizeof(png_byte));
|
||||
|
||||
|
||||
p = pixmap; q = png_pixels;
|
||||
|
||||
/* if there is an alpha channel, we have to get rid of it in the
|
||||
@@ -387,39 +387,39 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
q++; /* skip the alpha pixel */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free((char *)png_pixels);
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
#ifndef DISABLE_TRACE
|
||||
if (srcTrace) {
|
||||
fprintf(stderr,"No alpha channel\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
for(i=0; i<*height; i++) {
|
||||
q = row_pointers[i];
|
||||
for(j=0; j<*width; j++) {
|
||||
*p++ = *q++; /*palette index*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free((char *)png_pixels);
|
||||
|
||||
|
||||
}
|
||||
|
||||
free((png_byte **)row_pointers);
|
||||
|
||||
|
||||
/* clean up after the read, and free any memory allocated */
|
||||
/*png_read_destroy(png_ptr, info_ptr, (png_info *)0);*/
|
||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||
|
||||
|
||||
|
||||
/* free the structures */
|
||||
/*free((char *)png_ptr);*/
|
||||
free((char *)info_ptr);
|
||||
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ int numRead = 0;
|
||||
|
||||
char *GetLine(s) /****** this routine needs an overhaul.... */
|
||||
MCCIPort s;
|
||||
/* This routine returns a line read in from the socket file descriptor.
|
||||
/* This routine returns a line read in from the socket file descriptor.
|
||||
* The location of the string returned is good until the next call.
|
||||
* Limitation of this routine: A line read in must not be bigger than
|
||||
* the buffersize.
|
||||
@@ -179,7 +179,7 @@ register int count;
|
||||
s->numInBuffer += numBytes;
|
||||
s->buffer[s->numInBuffer]='\0';
|
||||
if (!(endptr = strstr(s->buffer, "\r\n"))) {
|
||||
/* protocol error on server end
|
||||
/* protocol error on server end
|
||||
Everything sent should be terminated with
|
||||
a <CRLF>... just return for now */
|
||||
#ifndef DISABLE_TRACE
|
||||
@@ -209,7 +209,7 @@ register int count;
|
||||
memcpy(s->buffer,ptr,s->numInBuffer);
|
||||
|
||||
return(returnLine);
|
||||
|
||||
|
||||
} /* NNTPGetLine() */
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Toolbar Stuff -- BJS */
|
||||
|
||||
struct toolbar
|
||||
struct toolbar
|
||||
{
|
||||
Widget w;
|
||||
int gray;
|
||||
@@ -26,7 +26,7 @@ struct tool {
|
||||
int toolset; /* toolset it belongs too (0=always on) */
|
||||
int kioskok; /* allowed in kiosk mode */
|
||||
char *unused;
|
||||
|
||||
|
||||
};
|
||||
|
||||
int mo_tool_state(struct toolbar *t,int state, int index);
|
||||
|
||||
50
src/whine.c
50
src/whine.c
@@ -82,7 +82,7 @@ static XmxCallback (whine_win_cb)
|
||||
|
||||
sprintf (subj, "User Feedback -- NCSA Mosaic %s on %s.",
|
||||
MO_VERSION_STRING, MO_MACHINE_TYPE);
|
||||
|
||||
|
||||
mo_send_mail_message (msg, MO_DEVELOPER_ADDRESS, subj, "text/plain",
|
||||
NULL);
|
||||
|
||||
@@ -95,7 +95,7 @@ static XmxCallback (whine_win_cb)
|
||||
break;
|
||||
case 2:
|
||||
mo_open_another_window
|
||||
(win,
|
||||
(win,
|
||||
mo_assemble_help_url ("help-on-whining.html"),
|
||||
NULL, NULL);
|
||||
break;
|
||||
@@ -111,21 +111,21 @@ mo_status mo_post_whine_win (mo_window *win)
|
||||
Widget dialog_frame;
|
||||
Widget dialog_sep, buttons_form;
|
||||
Widget whine_form, yap_label;
|
||||
|
||||
|
||||
/* Create it for the first time. */
|
||||
XmxSetUniqid (win->id);
|
||||
win->whine_win = XmxMakeFormDialog
|
||||
win->whine_win = XmxMakeFormDialog
|
||||
(win->base, "NCSA Mosaic: Mail Tech Support");
|
||||
dialog_frame = XmxMakeFrame (win->whine_win, XmxShadowOut);
|
||||
|
||||
/* Constraints for base. */
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_frame, XmATTACH_FORM, XmATTACH_FORM,
|
||||
XmATTACH_FORM, XmATTACH_FORM, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
/* Main form. */
|
||||
whine_form = XmxMakeForm (dialog_frame);
|
||||
|
||||
|
||||
yap_label = XmxMakeLabel (whine_form, yap_msg);
|
||||
|
||||
XmxSetArg (XmNscrolledWindowMarginWidth, 10);
|
||||
@@ -138,9 +138,9 @@ mo_status mo_post_whine_win (mo_window *win)
|
||||
/* XmxSetArg (XmNwordWrap, True); */
|
||||
/* XmxSetArg (XmNscrollHorizontal, False); */
|
||||
win->whine_text = XmxMakeScrolledText (whine_form);
|
||||
|
||||
|
||||
dialog_sep = XmxMakeHorizontalSeparator (whine_form);
|
||||
|
||||
|
||||
buttons_form = XmxMakeFormAndThreeButtonsSqueezed
|
||||
(whine_form, whine_win_cb, "Send", "Dismiss", "Help...", 0, 1, 2);
|
||||
|
||||
@@ -152,23 +152,23 @@ mo_status mo_post_whine_win (mo_window *win)
|
||||
|
||||
XmxSetOffsets (XtParent (win->whine_text), 3, 0, 3, 3);
|
||||
XmxSetConstraints
|
||||
(XtParent (win->whine_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
(XtParent (win->whine_text), XmATTACH_WIDGET, XmATTACH_WIDGET,
|
||||
XmATTACH_FORM, XmATTACH_FORM,
|
||||
yap_label, dialog_sep, NULL, NULL);
|
||||
|
||||
XmxSetArg (XmNtopOffset, 10);
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmxSetConstraints
|
||||
(dialog_sep, XmATTACH_NONE, XmATTACH_WIDGET, XmATTACH_FORM,
|
||||
XmATTACH_FORM,
|
||||
NULL, buttons_form, NULL, NULL);
|
||||
XmxSetConstraints
|
||||
XmxSetConstraints
|
||||
(buttons_form, XmATTACH_NONE, XmATTACH_FORM, XmATTACH_FORM, XmATTACH_FORM,
|
||||
NULL, NULL, NULL, NULL);
|
||||
XmxTextSetString (win->whine_text, "");
|
||||
}
|
||||
|
||||
|
||||
XmxManageRemanage (win->whine_win);
|
||||
|
||||
|
||||
return mo_succeed;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ mo_status mo_post_whine_win (mo_window *win)
|
||||
|
||||
static FILE *_fp = NULL;
|
||||
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
char cmd[2048];
|
||||
@@ -184,11 +184,11 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
|
||||
if (!to)
|
||||
return NULL;
|
||||
|
||||
|
||||
#ifdef OLD
|
||||
if (Rdata.mail_filter_command)
|
||||
{
|
||||
sprintf (cmd, "%s | %s -t", Rdata.mail_filter_command,
|
||||
sprintf (cmd, "%s | %s -t", Rdata.mail_filter_command,
|
||||
Rdata.sendmail_command);
|
||||
}
|
||||
else
|
||||
@@ -204,7 +204,7 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
if (Rdata.mail_filter_command && content_type &&
|
||||
strcmp (content_type, "application/postscript"))
|
||||
{
|
||||
sprintf (cmd, "%s | %s %s", Rdata.mail_filter_command,
|
||||
sprintf (cmd, "%s | %s %s", Rdata.mail_filter_command,
|
||||
Rdata.sendmail_command, to);
|
||||
}
|
||||
else
|
||||
@@ -222,15 +222,15 @@ FILE *mo_start_sending_mail_message (char *to, char *subj,
|
||||
fprintf (_fp, "Subject: %s\n", subj);
|
||||
fprintf (_fp, "Content-Type: %s\n", content_type);
|
||||
fprintf (_fp, "Mime-Version: 1.0\n");
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
fprintf (_fp, "X-Mailer: NCSA Mosaic %s on %s\n",
|
||||
MO_VERSION_STRING, MO_MACHINE_TYPE);
|
||||
if (url)
|
||||
fprintf (_fp, "X-URL: %s\n", url);
|
||||
|
||||
fprintf (_fp, "\n");
|
||||
|
||||
|
||||
/* Stick in BASE tag as appropriate. */
|
||||
if (url && content_type &&
|
||||
if (url && content_type &&
|
||||
strcmp (content_type, "text/x-html") == 0)
|
||||
fprintf (_fp, "<base href=\"%s\">\n", url);
|
||||
|
||||
@@ -249,7 +249,7 @@ mo_status mo_finish_sending_mail_message (void)
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
char *content_type, char *url)
|
||||
{
|
||||
FILE *fp;
|
||||
@@ -257,7 +257,7 @@ mo_status mo_send_mail_message (char *text, char *to, char *subj,
|
||||
fp = mo_start_sending_mail_message (to, subj, content_type, url);
|
||||
if (!fp)
|
||||
return mo_fail;
|
||||
|
||||
|
||||
fputs (text, fp);
|
||||
|
||||
mo_finish_sending_mail_message ();
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
* indirect or consequential damages or any damages
|
||||
* whatsoever resulting from loss of use, data or profits,
|
||||
* whether in an action of contract, negligence or other tortious
|
||||
* action, arising out of or in connection with the use
|
||||
* action, arising out of or in connection with the use
|
||||
* or performance of this software.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
* indirect or consequential damages or any damages
|
||||
* whatsoever resulting from loss of use, data or profits,
|
||||
* whether in an action of contract, negligence or other tortious
|
||||
* action, arising out of or in connection with the use
|
||||
* action, arising out of or in connection with the use
|
||||
* or performance of this software.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
* indirect or consequential damages or any damages
|
||||
* whatsoever resulting from loss of use, data or profits,
|
||||
* whether in an action of contract, negligence or other tortious
|
||||
* action, arising out of or in connection with the use
|
||||
* action, arising out of or in connection with the use
|
||||
* or performance of this software.
|
||||
*
|
||||
*/
|
||||
@@ -272,7 +272,7 @@ xpmReadFile(filename, mdata)
|
||||
/*
|
||||
* close the file related to the xpmData if any
|
||||
*/
|
||||
int
|
||||
int
|
||||
xpmDataClose(mdata)
|
||||
xpmData *mdata;
|
||||
{
|
||||
@@ -408,7 +408,7 @@ ParseComment(mdata)
|
||||
/*
|
||||
* skip to the end of the current string and the beginning of the next one
|
||||
*/
|
||||
int
|
||||
int
|
||||
xpmNextString(mdata)
|
||||
xpmData *mdata;
|
||||
{
|
||||
@@ -804,7 +804,7 @@ xpmNextUI(mdata, ui_return)
|
||||
/*
|
||||
* parse xpm header
|
||||
*/
|
||||
int
|
||||
int
|
||||
xpmParseHeader(mdata)
|
||||
xpmData *mdata;
|
||||
{
|
||||
@@ -860,7 +860,7 @@ xpmParseHeader(mdata)
|
||||
/*
|
||||
* get the current comment line
|
||||
*/
|
||||
int
|
||||
int
|
||||
xpmGetCmt(mdata, cmt)
|
||||
xpmData *mdata;
|
||||
char **cmt;
|
||||
@@ -1080,7 +1080,7 @@ unsigned char *ReadXpm3Pixmap(FILE *fp, char *datafile, int *w, int *h,
|
||||
tmpcolr.pixel = bg_pixel;
|
||||
|
||||
/* Now query for the full color info. */
|
||||
XQueryColor (XtDisplay (view),
|
||||
XQueryColor (XtDisplay (view),
|
||||
(installed_colormap ?
|
||||
installed_cmap :
|
||||
DefaultColormap (XtDisplay (view),
|
||||
@@ -1203,7 +1203,7 @@ unsigned char *ProcessXpm3Data(Widget wid, char **xpmdata, int *w,
|
||||
tmpcolr.pixel = bg_pixel;
|
||||
|
||||
/* Now query for the full color info. */
|
||||
XQueryColor (XtDisplay (wid),
|
||||
XQueryColor (XtDisplay (wid),
|
||||
(installed_colormap ?
|
||||
installed_cmap :
|
||||
DefaultColormap (XtDisplay (wid),
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
* mosaic-x@ncsa.uiuc.edu. *
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
/*
|
||||
* Created: Wed Apr 10 17:41:00 CDT 1996
|
||||
* Author: Dan Pape
|
||||
*
|
||||
|
||||
@@ -66,20 +66,20 @@ static XtResource resources[] = {
|
||||
/* default font choice from Options menu choices */
|
||||
{ "defaultFontChoice", "DefaultFontChoice", XtRString, sizeof (char *),
|
||||
offset (default_font_choice), XtRString, "TimesRegular" },
|
||||
{ "kiosk", "Kiosk", XtRBoolean, sizeof (Boolean),
|
||||
{ "kiosk", "Kiosk", XtRBoolean, sizeof (Boolean),
|
||||
offset (kiosk), XtRString, "False" },
|
||||
{ "kioskPrint", "KioskPrint", XtRBoolean, sizeof (Boolean),
|
||||
{ "kioskPrint", "KioskPrint", XtRBoolean, sizeof (Boolean),
|
||||
offset (kioskPrint), XtRString, "False" },
|
||||
{ "kioskNoExit", "KioskNoExit", XtRBoolean, sizeof (Boolean),
|
||||
offset (kioskNoExit), XtRString, "False" },
|
||||
/* Whether Mosaic reads and writes global history from
|
||||
/* Whether Mosaic reads and writes global history from
|
||||
~/.mosaic-global-history
|
||||
and thus provides persistent history tracking. */
|
||||
{ "useGlobalHistory", "UseGlobalHistory", XtRBoolean, sizeof (Boolean),
|
||||
offset (use_global_history), XtRString, "True" },
|
||||
/* Whether titles will be displayed wherever URL\'s are normally
|
||||
displayed. */
|
||||
{ "displayURLsNotTitles", "DisplayURLsNotTitles", XtRBoolean,
|
||||
{ "displayURLsNotTitles", "DisplayURLsNotTitles", XtRBoolean,
|
||||
sizeof (Boolean),
|
||||
offset (display_urls_not_titles), XtRString, "False" },
|
||||
/* Default width for a Document View window. This will change as windows
|
||||
@@ -91,7 +91,7 @@ static XtResource resources[] = {
|
||||
offset (default_height), XtRString, "700" },
|
||||
/* Startup document. */
|
||||
{ "homeDocument", "HomeDocument", XtRString, sizeof (char *),
|
||||
offset (home_document), XtRString,
|
||||
offset (home_document), XtRString,
|
||||
HOME_PAGE_DEFAULT },
|
||||
{ "confirmExit", "ConfirmExit", XtRBoolean, sizeof (Boolean),
|
||||
offset (confirm_exit), XtRString, "True" },
|
||||
@@ -120,38 +120,38 @@ static XtResource resources[] = {
|
||||
offset (edit_command_use_xterm), XtRString, "True" },
|
||||
#ifdef _AIX
|
||||
{ "xtermCommand", "XtermCommand", XtRString, sizeof (char *),
|
||||
offset (xterm_command), XtRString,
|
||||
offset (xterm_command), XtRString,
|
||||
"aixterm -v",
|
||||
},
|
||||
#else /* not _AIX */
|
||||
{ "xtermCommand", "XtermCommand", XtRString, sizeof (char *),
|
||||
offset (xterm_command), XtRString,
|
||||
offset (xterm_command), XtRString,
|
||||
"xterm",
|
||||
},
|
||||
#endif /* not _AIX */
|
||||
{ "globalHistoryFile", "GlobalHistoryFile", XtRString,
|
||||
{ "globalHistoryFile", "GlobalHistoryFile", XtRString,
|
||||
sizeof (char *),
|
||||
offset (global_history_file), XtRString, ".mosaic/global-history" }, // SAM
|
||||
{ "historyFile", "HistoryFile", XtRString,
|
||||
{ "historyFile", "HistoryFile", XtRString,
|
||||
sizeof (char *),
|
||||
offset (history_file), XtRString, ".mosaic/x-history" }, // SAM
|
||||
{ "defaultHotlistFile", "DefaultHotlistFile", XtRString,
|
||||
{ "defaultHotlistFile", "DefaultHotlistFile", XtRString,
|
||||
sizeof (char *),
|
||||
offset (default_hotlist_file), XtRString, ".mosaic/hotlist-default" }, // SAM
|
||||
{ "defaultHotFile", "DefaultHotFile", XtRString,
|
||||
{ "defaultHotFile", "DefaultHotFile", XtRString,
|
||||
sizeof (char *),
|
||||
offset (default_hot_file), XtRString, ".mosaic/hot.html" }, // SAM
|
||||
{ "addHotlistAddsRBM", "AddHotlistAddsRBM", XtRBoolean, sizeof (Boolean),
|
||||
offset (addHotlistAddsRBM), XtRString, "True" },
|
||||
{ "addRBMAddsRBM", "AddRBMAddsRBM", XtRBoolean, sizeof (Boolean),
|
||||
offset (addRBMAddsRBM), XtRString, "True" },
|
||||
{ "personalAnnotationDirectory", "PersonalAnnotationDirectory", XtRString,
|
||||
{ "personalAnnotationDirectory", "PersonalAnnotationDirectory", XtRString,
|
||||
sizeof (char *),
|
||||
offset (private_annotation_directory), XtRString,
|
||||
offset (private_annotation_directory), XtRString,
|
||||
".mosaic/personal-annotations" }, // SAM
|
||||
/* Whether selections should be fancy, by default. */
|
||||
{ "fancySelections", "FancySelections", XtRBoolean,
|
||||
sizeof (Boolean), offset (default_fancy_selections),
|
||||
sizeof (Boolean), offset (default_fancy_selections),
|
||||
XtRString, "False" },
|
||||
{ "defaultAuthorName", "DefaultAuthorName", XtRString, sizeof (char *),
|
||||
offset (default_author_name), XtRString, NULL },
|
||||
@@ -167,27 +167,27 @@ static XtResource resources[] = {
|
||||
{ "trackVisitedAnchors", "TrackVisitedAnchors", XtRBoolean, sizeof (Boolean),
|
||||
offset (track_visited_anchors), XtRString, "True" },
|
||||
|
||||
{ "uncompressCommand", "UncompressCommand", XtRString, sizeof (char *),
|
||||
{ "uncompressCommand", "UncompressCommand", XtRString, sizeof (char *),
|
||||
offset (uncompress_command), XtRString, "uncompress" },
|
||||
{ "gunzipCommand", "GunzipCommand", XtRString,
|
||||
{ "gunzipCommand", "GunzipCommand", XtRString,
|
||||
sizeof (char *), offset (gunzip_command), XtRString, "gunzip -f -n" },
|
||||
|
||||
#if defined(__hpux)
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
sizeof (char *), offset (record_command_location), XtRString,
|
||||
"/usr/audio/bin/srecorder" },
|
||||
#else
|
||||
#if defined(__sgi)
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
sizeof (char *), offset (record_command_location), XtRString,
|
||||
"/usr/sbin/recordaiff" },
|
||||
#else
|
||||
#if defined (sun)
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
sizeof (char *), offset (record_command_location), XtRString,
|
||||
"/usr/demo/SOUND/record" },
|
||||
#else
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
{ "recordCommandLocation", "RecordCommandLocation", XtRString,
|
||||
sizeof (char *), offset (record_command_location), XtRString,
|
||||
"/bin/true" },
|
||||
#endif /* if sun */
|
||||
@@ -235,7 +235,7 @@ static XtResource resources[] = {
|
||||
{ "reverseInlinedBitmapColors", "ReverseInlinedBitmapColors", XtRBoolean,
|
||||
sizeof (Boolean),
|
||||
offset (reverse_inlined_bitmap_colors), XtRString, "False" },
|
||||
{ "confirmDeleteAnnotation", "ConfirmDeleteAnnotation",
|
||||
{ "confirmDeleteAnnotation", "ConfirmDeleteAnnotation",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (confirm_delete_annotation), XtRString, "True"},
|
||||
{ "tweakGopherTypes", "TweakGopherTypes", XtRBoolean, sizeof (Boolean),
|
||||
@@ -262,7 +262,7 @@ static XtResource resources[] = {
|
||||
offset (docs_directory), XtRString, NULL },
|
||||
|
||||
{ "documentsMenuSpecfile", "DocumentsMenuSpecfile", XtRString, sizeof (char *),
|
||||
offset (documents_menu_specfile), XtRString,
|
||||
offset (documents_menu_specfile), XtRString,
|
||||
"/usr/local/lib/mosaic/documents.menu" },
|
||||
|
||||
{ "reloadReloadsImages", "ReloadReloadsImages", XtRBoolean, sizeof (Boolean),
|
||||
@@ -282,40 +282,40 @@ static XtResource resources[] = {
|
||||
{ "disableMiddleButton", "DisableMiddleButton", XtRBoolean, sizeof(Boolean),
|
||||
offset(disableMiddleButton), XtRString, "False"},
|
||||
|
||||
{ "useDefaultExtensionMap", "UseDefaultExtensionMap",
|
||||
{ "useDefaultExtensionMap", "UseDefaultExtensionMap",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (use_default_extension_map), XtRString, "True" },
|
||||
{ "globalExtensionMap", "GlobalExtensionMap",
|
||||
{ "globalExtensionMap", "GlobalExtensionMap",
|
||||
XtRString, sizeof (char *),
|
||||
offset (global_extension_map), XtRString, GLOBAL_EXTENSION_MAP },
|
||||
{ "personalExtensionMap", "PersonalExtensionMap",
|
||||
{ "personalExtensionMap", "PersonalExtensionMap",
|
||||
XtRString, sizeof (char *),
|
||||
offset (personal_extension_map), XtRString, ".mime.types" },
|
||||
|
||||
{ "useDefaultTypeMap", "UseDefaultTypeMap",
|
||||
{ "useDefaultTypeMap", "UseDefaultTypeMap",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (use_default_type_map), XtRString, "True" },
|
||||
{ "globalTypeMap", "GlobalTypeMap",
|
||||
{ "globalTypeMap", "GlobalTypeMap",
|
||||
XtRString, sizeof (char *),
|
||||
offset (global_type_map), XtRString, GLOBAL_TYPE_MAP },
|
||||
{ "personalTypeMap", "PersonalTypeMap",
|
||||
{ "personalTypeMap", "PersonalTypeMap",
|
||||
XtRString, sizeof (char *),
|
||||
offset (personal_type_map), XtRString, ".mailcap" },
|
||||
|
||||
{ "twirlingTransferIcon", "TwirlingTransferIcon",
|
||||
{ "twirlingTransferIcon", "TwirlingTransferIcon",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (twirling_transfer_icon), XtRString, "True" },
|
||||
{ "twirlIncrement", "TwirlIncrement", XtRInt, sizeof (int),
|
||||
offset (twirl_increment), XtRString, "4096" },
|
||||
|
||||
{ "securityIcon", "securityIcon",
|
||||
{ "securityIcon", "securityIcon",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (securityIcon), XtRString, "True" },
|
||||
|
||||
{ "imageCacheSize", "ImageCacheSize", XtRInt, sizeof (int),
|
||||
offset (image_cache_size), XtRString, "2048" },
|
||||
|
||||
{ "protectMeFromMyself", "ProtectMeFromMyself",
|
||||
{ "protectMeFromMyself", "ProtectMeFromMyself",
|
||||
XtRBoolean, sizeof (Boolean),
|
||||
offset (protect_me_from_myself), XtRString, "False" },
|
||||
|
||||
@@ -476,29 +476,29 @@ static XtResource resources[] = {
|
||||
offset (useTextButtonBar), XtRString, "True" },
|
||||
|
||||
{ "proxySpecfile", "ProxySpecfile", XtRString, sizeof (char *),
|
||||
offset (proxy_specfile), XtRString,
|
||||
offset (proxy_specfile), XtRString,
|
||||
"/usr/local/lib/mosaic/proxy" },
|
||||
|
||||
{ "noproxySpecfile", "NoproxySpecfile", XtRString, sizeof (char *),
|
||||
offset (noproxy_specfile), XtRString,
|
||||
offset (noproxy_specfile), XtRString,
|
||||
"/usr/local/lib/mosaic/no_proxy" },
|
||||
|
||||
|
||||
{ "useScreenGamma", "UseScreenGamma", XtRBoolean, sizeof (Boolean),
|
||||
offset (useScreenGamma), XtRString, "False" },
|
||||
|
||||
{ "screenGamma", "ScreenGamma", XtRFloat, sizeof (float),
|
||||
offset (screen_gamma), XtRString, "2.2" },
|
||||
|
||||
{ "popupCascadeMappingDelay", "PopupCascadeMappingDelay", XtRInt,
|
||||
{ "popupCascadeMappingDelay", "PopupCascadeMappingDelay", XtRInt,
|
||||
sizeof(int), offset(popupCascadeMappingDelay), XtRString, "500" },
|
||||
|
||||
{ "frameHack", "FrameHack", XtRBoolean, sizeof (Boolean),
|
||||
offset (frame_hack), XtRString, "False" },
|
||||
|
||||
|
||||
/* New news stuff in B4 */
|
||||
{ "newsUseThreadView", "NewsUseThreadView", XtRBoolean,
|
||||
sizeof(Boolean), offset(newsConfigView), XtRString, "True" },
|
||||
|
||||
|
||||
{ "newsNoThreadJumping", "NewsNoThreadJumping", XtRBoolean,
|
||||
sizeof(Boolean), offset(newsNoThreadJumping), XtRString, "True" },
|
||||
|
||||
@@ -541,7 +541,7 @@ static XtResource resources[] = {
|
||||
|
||||
{ "sessionHistoryOnRBM", "SessionHistoryOnRBM", XtRBoolean,
|
||||
sizeof(Boolean), offset(sessionHistoryOnRBM), XtRString, "True" },
|
||||
|
||||
|
||||
{ "numberOfItemsInRBMHistory", "NumberOfItemsInRBMHistory", XtRInt,
|
||||
sizeof(int), offset(numberOfItemsInRBMHistory), XtRString, "12" },
|
||||
|
||||
@@ -568,7 +568,7 @@ static XrmOptionDescRec options[] = {
|
||||
{"-i", "*initialWindowIconic", XrmoptionNoArg, "True"},
|
||||
/* New in 1.1 */
|
||||
/* -nd isn't documented since defaults in the widget still take effect,
|
||||
so the benefits of using it are kinda iffy (as if they weren't
|
||||
so the benefits of using it are kinda iffy (as if they weren't
|
||||
anyway)... */
|
||||
{"-nd", "*nothingUseful", XrmoptionNoArg, "True"},
|
||||
{"-tmpdir", "*tmpDirectory", XrmoptionSepArg, NULL},
|
||||
@@ -614,7 +614,7 @@ static String color_resources[] = {
|
||||
"*XmList*fontList: -*-helvetica-medium-r-normal-*-14-*-iso8859-1",
|
||||
"*XmText.fontList: -*-lucidatypewriter-medium-r-normal-*-14-*-iso8859-1",
|
||||
"*XmTextField.fontList: -*-lucidatypewriter-medium-r-normal-*-14-*-iso8859-1",
|
||||
|
||||
|
||||
"*optionmenu*marginHeight: 0",
|
||||
"*optionmenu*marginTop: 5",
|
||||
"*optionmenu*marginBottom: 5",
|
||||
@@ -654,7 +654,7 @@ static String color_resources[] = {
|
||||
"*highlightThickness: 0",
|
||||
/* "*geometry: +400+200", */
|
||||
/* "*keyboardFocusPolicy: pointer",*/
|
||||
|
||||
|
||||
"*TitleFont: -adobe-times-bold-r-normal-*-24-*-*-*-*-*-iso8859-1",
|
||||
"*Font: -adobe-times-medium-r-normal-*-17-*-*-*-*-*-iso8859-1",
|
||||
"*ItalicFont: -adobe-times-medium-i-normal-*-17-*-*-*-*-*-iso8859-1",
|
||||
@@ -700,7 +700,7 @@ static String color_resources[] = {
|
||||
"*XmText*TopShadowColor: #dfdfdfdfdfdf",
|
||||
"*XmSelectionBox*TopShadowColor: #dfdfdfdfdfdf",
|
||||
"*XmMessageBox*TopShadowColor: #dfdfdfdfdfdf",
|
||||
|
||||
|
||||
"*visitedAnchorColor: #272705055b5b",
|
||||
"*anchorColor: #00000000b0b0",
|
||||
"*activeAnchorFG: #ffff00000000",
|
||||
@@ -727,7 +727,7 @@ static String color_resources[] = {
|
||||
"*XmText*TopShadowColor: #e7e7e7e7e7e7",
|
||||
"*XmSelectionBox*TopShadowColor: #e7e7e7e7e7e7",
|
||||
"*XmMessageBox*TopShadowColor: #e7e7e7e7e7e7",
|
||||
|
||||
|
||||
"*TroughColor: #646464646464",
|
||||
"*SelectColor: #ffffffff0000",
|
||||
"*HighlightColor: #bfbfbfbfbfbf",
|
||||
@@ -741,7 +741,7 @@ static String color_resources[] = {
|
||||
/* Disable Motif Drag-N-Drop - BJS */
|
||||
"*dragInitiatorProtocolStyle: XmDRAG_NONE",
|
||||
"*dragReceiverProtocolStyle: XmDRAG_NONE",
|
||||
|
||||
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -848,7 +848,7 @@ static String mono_resources[] = {
|
||||
/* Disable Motif Drag-N-Drop - BJS */
|
||||
"*dragInitiatorProtocolStyle: XmDRAG_NONE",
|
||||
"*dragReceiverProtocolStyle: XmDRAG_NONE",
|
||||
|
||||
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user