Fix whitespace errors as reported by 'git diff --check'
This commit is contained in:
parent
e9ba313131
commit
2cd784b75c
12
CHANGES
12
CHANGES
|
@ -403,7 +403,7 @@ Added for check "id" attribute. Erik Corry <erik@kroete2.freinet.de>
|
||||||
The HTML code now has a timeout that will destroy an inline if it
|
The HTML code now has a timeout that will destroy an inline if it
|
||||||
takes too long to find its size.
|
takes too long to find its size.
|
||||||
Moved the cache code into www/.
|
Moved the cache code into www/.
|
||||||
|
|
||||||
alpha 110
|
alpha 110
|
||||||
---------
|
---------
|
||||||
Frames are refreshed when they are resized.
|
Frames are refreshed when they are resized.
|
||||||
|
@ -550,7 +550,7 @@ URL failure was not being reported back to the parent frame. This caused
|
||||||
HTML rendering to stop forever waiting for the image. Partially fixed.
|
HTML rendering to stop forever waiting for the image. Partially fixed.
|
||||||
Reported by Karl Eichwalder <ke@ke.Central.DE>.
|
Reported by Karl Eichwalder <ke@ke.Central.DE>.
|
||||||
Added support for the size attribute for form text input.
|
Added support for the size attribute for form text input.
|
||||||
Larry Doolittle <doolitt@recycle.cebaf.gov>
|
Larry Doolittle <doolitt@recycle.cebaf.gov>
|
||||||
Paragraph align attribute was being carried over into the following
|
Paragraph align attribute was being carried over into the following
|
||||||
paragraphs if the aligned paragraph didn't have an end tag. Fixed.
|
paragraphs if the aligned paragraph didn't have an end tag. Fixed.
|
||||||
Reported by Karl Eichwalder <ke@ke.Central.DE>
|
Reported by Karl Eichwalder <ke@ke.Central.DE>
|
||||||
|
@ -727,7 +727,7 @@ The cancel button sort of works. The inlines don't get cancelled.
|
||||||
GIF patches that fixed the endless loop problem and some other
|
GIF patches that fixed the endless loop problem and some other
|
||||||
problems. Shigeru Yamamoto <shige-y@is.aist-nara.ac.jp>
|
problems. Shigeru Yamamoto <shige-y@is.aist-nara.ac.jp>
|
||||||
GIF patch that fixed problems with interfaced 2-color GIFs.
|
GIF patch that fixed problems with interfaced 2-color GIFs.
|
||||||
Erik Corry <ehcorry@inet.uni-c.dk>
|
Erik Corry <ehcorry@inet.uni-c.dk>
|
||||||
Added patch that reduced memory usage in proto/file.c, added
|
Added patch that reduced memory usage in proto/file.c, added
|
||||||
HAVE_STRING_H to proto/error.c (now message.c), and fixed prototype
|
HAVE_STRING_H to proto/error.c (now message.c), and fixed prototype
|
||||||
in image/image.c. Larry Doolittle <doolitt@recycle.cebaf.gov>
|
in image/image.c. Larry Doolittle <doolitt@recycle.cebaf.gov>
|
||||||
|
@ -750,7 +750,7 @@ The y coordinate of the rectangle to refresh in CreateRenderLine() was
|
||||||
visible area to not be refreshed.
|
visible area to not be refreshed.
|
||||||
Placement of text and other items has changed. Changes in text.c and
|
Placement of text and other items has changed. Changes in text.c and
|
||||||
layout.c.
|
layout.c.
|
||||||
|
|
||||||
alpha 77
|
alpha 77
|
||||||
--------
|
--------
|
||||||
Incorporated the second big patch to the color/image handling code.
|
Incorporated the second big patch to the color/image handling code.
|
||||||
|
@ -925,7 +925,7 @@ alpha 10
|
||||||
HTML widget changed a lot. Expose and reformat code changed.
|
HTML widget changed a lot. Expose and reformat code changed.
|
||||||
Changed the title/message widget to just a plain pane (basically).
|
Changed the title/message widget to just a plain pane (basically).
|
||||||
Added anchor URL display.
|
Added anchor URL display.
|
||||||
Roman Czyborra <czyborra@cs.tu-berlin.de>
|
Roman Czyborra <czyborra@cs.tu-berlin.de>
|
||||||
|
|
||||||
alpha 1-9
|
alpha 1-9
|
||||||
---------
|
---------
|
||||||
|
@ -948,7 +948,7 @@ Added strlen(anchor) to MakeURL. I think Martin made this fix too. I
|
||||||
Added patch to local.c so that local file directory listings contain
|
Added patch to local.c so that local file directory listings contain
|
||||||
lots of useful information. Didn't include the FTP part because it
|
lots of useful information. Didn't include the FTP part because it
|
||||||
won't work on all FTP servers. Patch is at
|
won't work on all FTP servers. Patch is at
|
||||||
http://xph029.physics.montana.edu/chimera/filesize.patch if you
|
http://xph029.physics.montana.edu/chimera/filesize.patch if you
|
||||||
would like to try it. It needs work for 2.0...
|
would like to try it. It needs work for 2.0...
|
||||||
Added patch for SGML escape stuff. Jim Rees <rees@umich.edu>
|
Added patch for SGML escape stuff. Jim Rees <rees@umich.edu>
|
||||||
Patch to HTML.c to make scrolling work right.
|
Patch to HTML.c to make scrolling work right.
|
||||||
|
|
|
@ -167,7 +167,7 @@ OS_LIBS =
|
||||||
#define NEED_SNPRINTF 1
|
#define NEED_SNPRINTF 1
|
||||||
OS_DEFINES = -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H \
|
OS_DEFINES = -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H \
|
||||||
-DHAVE_STDDEF_H -DHAVE_SIZE_T -DHAVE_SSIZE_T \
|
-DHAVE_STDDEF_H -DHAVE_SIZE_T -DHAVE_SSIZE_T \
|
||||||
-DHAVE_STDARG_H
|
-DHAVE_STDARG_H
|
||||||
OS_LIBS =-lsocket
|
OS_LIBS =-lsocket
|
||||||
#define CConfigSet 1
|
#define CConfigSet 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -172,7 +172,7 @@ OS_LIBS =
|
||||||
#define NEED_SNPRINTF 1
|
#define NEED_SNPRINTF 1
|
||||||
OS_DEFINES = -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H \
|
OS_DEFINES = -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_UNISTD_H \
|
||||||
-DHAVE_STDDEF_H -DHAVE_SIZE_T -DHAVE_SSIZE_T \
|
-DHAVE_STDDEF_H -DHAVE_SIZE_T -DHAVE_SSIZE_T \
|
||||||
-DHAVE_STDARG_H
|
-DHAVE_STDARG_H
|
||||||
OS_LIBS =-lsocket
|
OS_LIBS =-lsocket
|
||||||
#define CConfigSet 1
|
#define CConfigSet 1
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -27,5 +27,5 @@ typedef void (*ChimeraAuthCallback) _ArgProto((void *, char *, char *));
|
||||||
ChimeraAuth AuthCreate _ArgProto((ChimeraResources, char *, char *,
|
ChimeraAuth AuthCreate _ArgProto((ChimeraResources, char *, char *,
|
||||||
ChimeraAuthCallback, void *));
|
ChimeraAuthCallback, void *));
|
||||||
void AuthDestroy _ArgProto((ChimeraAuth));
|
void AuthDestroy _ArgProto((ChimeraAuth));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -102,7 +102,7 @@ GeomGeometryManager(w, request, reply)
|
||||||
Widget w;
|
Widget w;
|
||||||
XtWidgetGeometry *request;
|
XtWidgetGeometry *request;
|
||||||
XtWidgetGeometry *reply;
|
XtWidgetGeometry *reply;
|
||||||
{
|
{
|
||||||
return(XtGeometryNo);
|
return(XtGeometryNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -313,7 +313,7 @@ WWWGeometryManager(w, request, reply)
|
||||||
Widget w;
|
Widget w;
|
||||||
XtWidgetGeometry *request;
|
XtWidgetGeometry *request;
|
||||||
XtWidgetGeometry *reply;
|
XtWidgetGeometry *reply;
|
||||||
{
|
{
|
||||||
return(XtGeometryNo);
|
return(XtGeometryNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,7 +348,7 @@ WWWWidget rw;
|
||||||
(float)top/(float)total,
|
(float)top/(float)total,
|
||||||
(float)length/(float)total);
|
(float)length/(float)total);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rw->www.vert_bar != (Widget)NULL)
|
if (rw->www.vert_bar != (Widget)NULL)
|
||||||
{
|
{
|
||||||
top = -(child->core.y);
|
top = -(child->core.y);
|
||||||
|
@ -376,18 +376,18 @@ int x, y;
|
||||||
{
|
{
|
||||||
x = -(child->core.width - clip->core.width);
|
x = -(child->core.width - clip->core.width);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (-y + (int)clip->core.height > (int)child->core.height)
|
if (-y + (int)clip->core.height > (int)child->core.height)
|
||||||
{
|
{
|
||||||
y = -(child->core.height - clip->core.height);
|
y = -(child->core.height - clip->core.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x >= 0) x = 0;
|
if (x >= 0) x = 0;
|
||||||
if (y >= 0) y = 0;
|
if (y >= 0) y = 0;
|
||||||
|
|
||||||
/* Mmmm hairy cast */
|
/* Mmmm hairy cast */
|
||||||
XtMoveWidget(child, (Position)x, (Position)y);
|
XtMoveWidget(child, (Position)x, (Position)y);
|
||||||
|
|
||||||
RedrawThumbs(rw);
|
RedrawThumbs(rw);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -403,9 +403,9 @@ XtPointer call_data;
|
||||||
register Widget child = rw->www.child;
|
register Widget child = rw->www.child;
|
||||||
int pix = (int)call_data;
|
int pix = (int)call_data;
|
||||||
Position x, y;
|
Position x, y;
|
||||||
|
|
||||||
if (child == NULL) return; /* no child to scroll. */
|
if (child == NULL) return; /* no child to scroll. */
|
||||||
|
|
||||||
x = child->core.x - ((widget == rw->www.horiz_bar) ? pix : 0);
|
x = child->core.x - ((widget == rw->www.horiz_bar) ? pix : 0);
|
||||||
y = child->core.y - ((widget == rw->www.vert_bar) ? pix : 0);
|
y = child->core.y - ((widget == rw->www.vert_bar) ? pix : 0);
|
||||||
WWWMoveChild((Widget)rw, (int)x, (int)y);
|
WWWMoveChild((Widget)rw, (int)x, (int)y);
|
||||||
|
@ -423,9 +423,9 @@ XtPointer call_data;
|
||||||
register Widget child = rw->www.child;
|
register Widget child = rw->www.child;
|
||||||
Position x, y;
|
Position x, y;
|
||||||
float *percent = (float *)call_data;
|
float *percent = (float *)call_data;
|
||||||
|
|
||||||
if (child == NULL) return; /* no child to scroll. */
|
if (child == NULL) return; /* no child to scroll. */
|
||||||
|
|
||||||
if (widget == rw->www.horiz_bar) x = -(int)(*percent * child->core.width);
|
if (widget == rw->www.horiz_bar) x = -(int)(*percent * child->core.width);
|
||||||
else x = child->core.x;
|
else x = child->core.x;
|
||||||
|
|
||||||
|
@ -480,7 +480,7 @@ Cardinal *count;
|
||||||
ScrollUpDownProc, (XtPointer)new);
|
ScrollUpDownProc, (XtPointer)new);
|
||||||
XtAddCallback(new->www.vert_bar, XtNjumpProc,
|
XtAddCallback(new->www.vert_bar, XtNjumpProc,
|
||||||
ThumbProc, (XtPointer)new);
|
ThumbProc, (XtPointer)new);
|
||||||
|
|
||||||
new->www.horiz_bar = XtVaCreateWidget("horiz_bar",
|
new->www.horiz_bar = XtVaCreateWidget("horiz_bar",
|
||||||
scrollbarWidgetClass, n,
|
scrollbarWidgetClass, n,
|
||||||
XtNorientation, XtorientHorizontal,
|
XtNorientation, XtorientHorizontal,
|
||||||
|
@ -657,7 +657,7 @@ Widget w;
|
||||||
bool use_scroll;
|
bool use_scroll;
|
||||||
{
|
{
|
||||||
WWWWidget rw = (WWWWidget)w;
|
WWWWidget rw = (WWWWidget)w;
|
||||||
|
|
||||||
rw->www.use_scroll = use_scroll;
|
rw->www.use_scroll = use_scroll;
|
||||||
if (!rw->www.use_scroll)
|
if (!rw->www.use_scroll)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,7 +127,7 @@ void *closure;
|
||||||
wa->callback = callback;
|
wa->callback = callback;
|
||||||
wa->closure = closure;
|
wa->closure = closure;
|
||||||
wa->cres = cres;
|
wa->cres = cres;
|
||||||
|
|
||||||
XQueryPointer(cres->dpy, DefaultRootWindow(cres->dpy),
|
XQueryPointer(cres->dpy, DefaultRootWindow(cres->dpy),
|
||||||
&rw, &cw,
|
&rw, &cw,
|
||||||
&rx, &ry,
|
&rx, &ry,
|
||||||
|
@ -147,7 +147,7 @@ void *closure;
|
||||||
AuthDialogAddButton(dw, "ok", AuthOKCallback, wa);
|
AuthDialogAddButton(dw, "ok", AuthOKCallback, wa);
|
||||||
AuthDialogAddButton(dw, "dismiss", AuthDismissCallback, wa);
|
AuthDialogAddButton(dw, "dismiss", AuthDismissCallback, wa);
|
||||||
XtAddCallback(dw, XtNcallback, AuthActivateCallback, wa);
|
XtAddCallback(dw, XtNcallback, AuthActivateCallback, wa);
|
||||||
|
|
||||||
XtRealizeWidget(wa->w);
|
XtRealizeWidget(wa->w);
|
||||||
|
|
||||||
return(wa);
|
return(wa);
|
||||||
|
|
|
@ -330,7 +330,7 @@ MLElement p;
|
||||||
if (bc->is_group_element || bc->is_mark_element) GListAddTail(bc->nel, p);
|
if (bc->is_group_element || bc->is_mark_element) GListAddTail(bc->nel, p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(name) == 2 && strcasecmp("h3", name) == 0)
|
if (strlen(name) == 2 && strcasecmp("h3", name) == 0)
|
||||||
{
|
{
|
||||||
if (MLGetType(p) == ML_ENDTAG)
|
if (MLGetType(p) == ML_ENDTAG)
|
||||||
|
@ -557,8 +557,8 @@ XtPointer cldata, cbdata;
|
||||||
|
|
||||||
BMChangeGroupList(bc);
|
BMChangeGroupList(bc);
|
||||||
BMChangeMarkList(bc);
|
BMChangeMarkList(bc);
|
||||||
|
|
||||||
BMWrite(bc);
|
BMWrite(bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -665,7 +665,7 @@ XtPointer cldata, cbdata;
|
||||||
{
|
{
|
||||||
GListRemoveItem(g->mlist, m);
|
GListRemoveItem(g->mlist, m);
|
||||||
BMChangeMarkList(bc);
|
BMChangeMarkList(bc);
|
||||||
|
|
||||||
BMWrite(bc);
|
BMWrite(bc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -700,7 +700,7 @@ XtPointer cldata, cbdata;
|
||||||
BookmarkContext bc = (BookmarkContext)cldata;
|
BookmarkContext bc = (BookmarkContext)cldata;
|
||||||
|
|
||||||
BMChangeMarkList(bc);
|
BMChangeMarkList(bc);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,7 +745,7 @@ ChimeraResources cres;
|
||||||
{
|
{
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
mp = MPCreate();
|
mp = MPCreate();
|
||||||
bc = (BookmarkContext)MPCGet(mp, sizeof(struct BookmarkContextP));
|
bc = (BookmarkContext)MPCGet(mp, sizeof(struct BookmarkContextP));
|
||||||
bc->mp = mp;
|
bc->mp = mp;
|
||||||
|
@ -783,7 +783,7 @@ ChimeraResources cres;
|
||||||
XtNfromHoriz, w,
|
XtNfromHoriz, w,
|
||||||
NULL);
|
NULL);
|
||||||
XtAddCallback(w, XtNcallback, BMRMGroup, (XtPointer)bc);
|
XtAddCallback(w, XtNcallback, BMRMGroup, (XtPointer)bc);
|
||||||
|
|
||||||
/* Mark widgets */
|
/* Mark widgets */
|
||||||
mvw = XtVaCreateManagedWidget("markview",
|
mvw = XtVaCreateManagedWidget("markview",
|
||||||
viewportWidgetClass, fw,
|
viewportWidgetClass, fw,
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
MemPool mp; /* memory descriptor */
|
MemPool mp; /* memory descriptor */
|
||||||
char *filename; /* name of cache file */
|
char *filename; /* name of cache file */
|
||||||
char *url; /* URL string */
|
char *url; /* URL string */
|
||||||
int cid; /* cache ID */
|
int cid; /* cache ID */
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ void *closure;
|
||||||
CRDestroy(cr);
|
CRDestroy(cr);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->wt = TaskSchedule(cr->cres, CRRead, cr);
|
cr->wt = TaskSchedule(cr->cres, CRRead, cr);
|
||||||
|
|
||||||
return(cr);
|
return(cr);
|
||||||
|
@ -304,7 +304,7 @@ int cid;
|
||||||
ce->cid = cid;
|
ce->cid = cid;
|
||||||
if (cid > cc->next_cid) cc->next_cid = cid + 1;
|
if (cid > cc->next_cid) cc->next_cid = cid + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (filename, len, "%s/%d.ccf", cc->dirname, ce->cid);
|
snprintf (filename, len, "%s/%d.ccf", cc->dirname, ce->cid);
|
||||||
|
|
||||||
ce->filename = filename;
|
ce->filename = filename;
|
||||||
|
@ -530,7 +530,7 @@ void *closure;
|
||||||
CRDestroy(cr);
|
CRDestroy(cr);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
cr->wt = TaskSchedule(cc->cres, CRRead, cr);
|
cr->wt = TaskSchedule(cc->cres, CRRead, cr);
|
||||||
|
|
||||||
return(cr);
|
return(cr);
|
||||||
|
|
|
@ -48,7 +48,7 @@ ChimeraSourceHooks *shooks;
|
||||||
|
|
||||||
nhooks = (ChimeraSourceHooks *)MPCGet(cres->mp, sizeof(ChimeraSourceHooks));
|
nhooks = (ChimeraSourceHooks *)MPCGet(cres->mp, sizeof(ChimeraSourceHooks));
|
||||||
memcpy(nhooks, shooks, sizeof(ChimeraSourceHooks));
|
memcpy(nhooks, shooks, sizeof(ChimeraSourceHooks));
|
||||||
|
|
||||||
GListAddHead(cres->sourcehooks, nhooks);
|
GListAddHead(cres->sourcehooks, nhooks);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
|
@ -201,11 +201,11 @@ char *filelist;
|
||||||
|
|
||||||
fp = fopen(filename, "r");
|
fp = fopen(filename, "r");
|
||||||
if (fp == NULL) continue;
|
if (fp == NULL) continue;
|
||||||
|
|
||||||
while (fgets(buffer, sizeof(buffer), fp))
|
while (fgets(buffer, sizeof(buffer), fp))
|
||||||
{
|
{
|
||||||
if (buffer[0] == '#' || buffer[0] == '\n') continue;
|
if (buffer[0] == '#' || buffer[0] == '\n') continue;
|
||||||
|
|
||||||
if (sscanf(buffer, "%s %[^\n]", content, exts) == 2)
|
if (sscanf(buffer, "%s %[^\n]", content, exts) == 2)
|
||||||
{
|
{
|
||||||
cp = exts;
|
cp = exts;
|
||||||
|
@ -222,7 +222,7 @@ char *filelist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ void *closure;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = FixPath(di->mp, filename);
|
filename = FixPath(di->mp, filename);
|
||||||
if ((fp = fopen(filename, "w")) == NULL)
|
if ((fp = fopen(filename, "w")) == NULL)
|
||||||
{
|
{
|
||||||
XBell(di->cres->dpy, 100);
|
XBell(di->cres->dpy, 100);
|
||||||
|
@ -139,10 +139,10 @@ void *closure;
|
||||||
}
|
}
|
||||||
|
|
||||||
SinkGetData(di->wp, &data, &len, &mh);
|
SinkGetData(di->wp, &data, &len, &mh);
|
||||||
|
|
||||||
fwrite(data, 1, len, fp);
|
fwrite(data, 1, len, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
DownloadDestroy(di);
|
DownloadDestroy(di);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
char *fallback_resources[] =
|
char *fallback_resources[] =
|
||||||
|
|
|
@ -207,7 +207,7 @@ ChimeraGUI wd;
|
||||||
unsigned int *width, *height;
|
unsigned int *width, *height;
|
||||||
{
|
{
|
||||||
if (!wd->size_set) return(-1);
|
if (!wd->size_set) return(-1);
|
||||||
WWWGetDrawSize(wd->www, width, height);
|
WWWGetDrawSize(wd->www, width, height);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,14 +250,14 @@ int *x, *y;
|
||||||
unsigned int *width, *height;
|
unsigned int *width, *height;
|
||||||
{
|
{
|
||||||
WWWWidget rw = (WWWWidget)wd->www;
|
WWWWidget rw = (WWWWidget)wd->www;
|
||||||
|
|
||||||
*x = -(int)rw->www.child->core.x;
|
*x = -(int)rw->www.child->core.x;
|
||||||
*y = -(int)rw->www.child->core.y;
|
*y = -(int)rw->www.child->core.y;
|
||||||
*width = (unsigned int)rw->www.child->core.width;
|
*width = (unsigned int)rw->www.child->core.width;
|
||||||
*height = (unsigned int)rw->www.clip->core.height;
|
*height = (unsigned int)rw->www.clip->core.height;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GUIReset
|
* GUIReset
|
||||||
|
@ -468,7 +468,7 @@ int *x, *y;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GUIBackgroundPixel
|
* GUIBackgroundPixel
|
||||||
*/
|
*/
|
||||||
Pixel
|
Pixel
|
||||||
GUIBackgroundPixel(wd)
|
GUIBackgroundPixel(wd)
|
||||||
ChimeraGUI wd;
|
ChimeraGUI wd;
|
||||||
|
@ -487,4 +487,3 @@ ChimeraGUI wd;
|
||||||
{
|
{
|
||||||
return(WWWGetDrawWidget(wd->www));
|
return(WWWGetDrawWidget(wd->www));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ char *list;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(accel, sizeof(accel) - 1,
|
snprintf(accel, sizeof(accel) - 1,
|
||||||
"%s: set() notify() unset()", btp->accel);
|
"%s: set() notify() unset()", btp->accel);
|
||||||
btp->w = XtVaCreateManagedWidget(btp->name,
|
btp->w = XtVaCreateManagedWidget(btp->name,
|
||||||
commandWidgetClass, box,
|
commandWidgetClass, box,
|
||||||
|
@ -231,7 +231,7 @@ char *name;
|
||||||
* Main window pane
|
* Main window pane
|
||||||
*/
|
*/
|
||||||
paned = XtCreateManagedWidget("paned",
|
paned = XtCreateManagedWidget("paned",
|
||||||
panedWidgetClass, wc->toplevel,
|
panedWidgetClass, wc->toplevel,
|
||||||
NULL, 0);
|
NULL, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -258,7 +258,7 @@ char *name;
|
||||||
textfieldWidgetClass, form,
|
textfieldWidgetClass, form,
|
||||||
XtNstring, "",
|
XtNstring, "",
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtOverrideTranslations(wc->url,
|
XtOverrideTranslations(wc->url,
|
||||||
XtParseTranslationTable
|
XtParseTranslationTable
|
||||||
("<Key>Return: ReturnAction()"));
|
("<Key>Return: ReturnAction()"));
|
||||||
|
@ -387,7 +387,7 @@ XtPointer cldata, cbdata;
|
||||||
if ((url = MyDialogGetValue(GetDialogWidget(wc->openpop))) == NULL) return;
|
if ((url = MyDialogGetValue(GetDialogWidget(wc->openpop))) == NULL) return;
|
||||||
|
|
||||||
StackOpen(wc->tstack, RequestCreate(wc->cres, url, NULL));
|
StackOpen(wc->tstack, RequestCreate(wc->cres, url, NULL));
|
||||||
XtPopdown(wc->openpop);
|
XtPopdown(wc->openpop);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ Widget w;
|
||||||
XtPointer cldata, cbdata;
|
XtPointer cldata, cbdata;
|
||||||
{
|
{
|
||||||
ChimeraContext wc = (ChimeraContext)cldata;
|
ChimeraContext wc = (ChimeraContext)cldata;
|
||||||
XtPopdown(wc->openpop);
|
XtPopdown(wc->openpop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,7 +668,7 @@ XtPointer cldata, cbdata;
|
||||||
|
|
||||||
RenderSearch(StackToRender(wc->tstack), str, 0);
|
RenderSearch(StackToRender(wc->tstack), str, 0);
|
||||||
|
|
||||||
XtPopdown(wc->findpop);
|
XtPopdown(wc->findpop);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -682,7 +682,7 @@ Widget w;
|
||||||
XtPointer cldata, cbdata;
|
XtPointer cldata, cbdata;
|
||||||
{
|
{
|
||||||
ChimeraContext wc = (ChimeraContext)cldata;
|
ChimeraContext wc = (ChimeraContext)cldata;
|
||||||
XtPopdown(wc->findpop);
|
XtPopdown(wc->findpop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,14 +762,14 @@ ChimeraRequest *lastresort;
|
||||||
url = (char *)MPCGet(mp, count + 1);
|
url = (char *)MPCGet(mp, count + 1);
|
||||||
memcpy(url, buffer, count);
|
memcpy(url, buffer, count);
|
||||||
url[count] = '\0';
|
url[count] = '\0';
|
||||||
|
|
||||||
XFree(buffer);
|
XFree(buffer);
|
||||||
|
|
||||||
if ((wr = RequestCreate(wc->cres, url, base_url)) != NULL)
|
if ((wr = RequestCreate(wc->cres, url, base_url)) != NULL)
|
||||||
{
|
{
|
||||||
XStoreBytes(cres->dpy, "", 0);
|
XStoreBytes(cres->dpy, "", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
MPDestroy(mp);
|
MPDestroy(mp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
chimera/io.c
10
chimera/io.c
|
@ -68,7 +68,7 @@ union sockaddr_union
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
struct sockaddr_in6 sin6;
|
struct sockaddr_in6 sin6;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
struct ChimeraStreamP
|
struct ChimeraStreamP
|
||||||
{
|
{
|
||||||
bool destroyed;
|
bool destroyed;
|
||||||
|
@ -80,7 +80,7 @@ struct ChimeraStreamP
|
||||||
int port;
|
int port;
|
||||||
bool bound;
|
bool bound;
|
||||||
bool accepted;
|
bool accepted;
|
||||||
|
|
||||||
/* read callback */
|
/* read callback */
|
||||||
ChimeraStreamCallback rdfunc;
|
ChimeraStreamCallback rdfunc;
|
||||||
void *rdclosure;
|
void *rdclosure;
|
||||||
|
@ -330,13 +330,13 @@ int port;
|
||||||
s = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ;
|
s = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP ) ;
|
||||||
if (s < 0) return(NULL);
|
if (s < 0) return(NULL);
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
memcpy( &addr.sin.sin_addr, *(hp->h_addr_list++),
|
memcpy( &addr.sin.sin_addr, *(hp->h_addr_list++),
|
||||||
hp->h_length ) ;
|
hp->h_length ) ;
|
||||||
|
|
||||||
rval = connect(s, (struct sockaddr *)&addr, sizeof(addr) ) ;
|
rval = connect(s, (struct sockaddr *)&addr, sizeof(addr) ) ;
|
||||||
if( rval >= 0 || errno == EINPROGRESS )
|
if( rval >= 0 || errno == EINPROGRESS )
|
||||||
goto Connected ; /* Eeurgh, a goto :) */
|
goto Connected ; /* Eeurgh, a goto :) */
|
||||||
} while( *(hp->h_addr_list) ) ;
|
} while( *(hp->h_addr_list) ) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,16 +155,16 @@ ChimeraCleanup(cres)
|
||||||
ChimeraResources cres;
|
ChimeraResources cres;
|
||||||
{
|
{
|
||||||
if (cres->bc != NULL) BookmarkDestroyContext(cres->bc);
|
if (cres->bc != NULL) BookmarkDestroyContext(cres->bc);
|
||||||
|
|
||||||
ResourcesDestroy(cres);
|
ResourcesDestroy(cres);
|
||||||
|
|
||||||
if (cres->logfp != NULL) fclose(cres->logfp);
|
if (cres->logfp != NULL) fclose(cres->logfp);
|
||||||
|
|
||||||
GListDestroy(cres->heads);
|
GListDestroy(cres->heads);
|
||||||
|
|
||||||
MPPrintStatus();
|
MPPrintStatus();
|
||||||
GListPrintStatus();
|
GListPrintStatus();
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,7 +275,7 @@ URLParts *up;
|
||||||
if (up->hostname &&
|
if (up->hostname &&
|
||||||
/*
|
/*
|
||||||
* Allow localhost and hostname proxies
|
* Allow localhost and hostname proxies
|
||||||
*
|
*
|
||||||
strcmp(up->hostname, "localhost") != 0 &&
|
strcmp(up->hostname, "localhost") != 0 &&
|
||||||
! match_host_name(up->hostname, thishostname.nodename) &&
|
! match_host_name(up->hostname, thishostname.nodename) &&
|
||||||
*/
|
*/
|
||||||
|
@ -321,7 +321,7 @@ char *c1, *c2;
|
||||||
|
|
||||||
c1 = MPStrDup(mp, c1);
|
c1 = MPStrDup(mp, c1);
|
||||||
c2 = MPStrDup(mp, c2);
|
c2 = MPStrDup(mp, c2);
|
||||||
|
|
||||||
error = true;
|
error = true;
|
||||||
for (cp = c1; *cp != '\0'; cp++)
|
for (cp = c1; *cp != '\0'; cp++)
|
||||||
{
|
{
|
||||||
|
@ -348,10 +348,10 @@ char *c1, *c2;
|
||||||
}
|
}
|
||||||
if (error) return(false);
|
if (error) return(false);
|
||||||
|
|
||||||
if ((strlen(c1) == 1 && *c1 == '*') ||
|
if ((strlen(c1) == 1 && *c1 == '*') ||
|
||||||
(strlen(c1) == strlen(c2) && strcasecmp(c1, c2) == 0))
|
(strlen(c1) == strlen(c2) && strcasecmp(c1, c2) == 0))
|
||||||
{
|
{
|
||||||
if ((strlen(p1) == 1 && *p1 == '*') ||
|
if ((strlen(p1) == 1 && *p1 == '*') ||
|
||||||
(strlen(p1) == strlen(p2) && strcasecmp(p1, p2) == 0))
|
(strlen(p1) == strlen(p2) && strcasecmp(p1, p2) == 0))
|
||||||
{
|
{
|
||||||
return(true);
|
return(true);
|
||||||
|
@ -404,7 +404,7 @@ char *base;
|
||||||
* always be possible to get the schemes so that the source hooks
|
* always be possible to get the schemes so that the source hooks
|
||||||
* can be found to see if an alternate parsing method is going to
|
* can be found to see if an alternate parsing method is going to
|
||||||
* be used.
|
* be used.
|
||||||
*/
|
*/
|
||||||
uscheme = URLGetScheme(mp, url);
|
uscheme = URLGetScheme(mp, url);
|
||||||
if (base != NULL) bscheme = URLGetScheme(mp, base);
|
if (base != NULL) bscheme = URLGetScheme(mp, base);
|
||||||
else bscheme = NULL;
|
else bscheme = NULL;
|
||||||
|
@ -519,7 +519,7 @@ char *base;
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(&(wr->hooks), hooks, sizeof(ChimeraSourceHooks));
|
memcpy(&(wr->hooks), hooks, sizeof(ChimeraSourceHooks));
|
||||||
|
|
||||||
wr->scheme = URLGetScheme(wr->mp, wr->url);
|
wr->scheme = URLGetScheme(wr->mp, wr->url);
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ ChimeraSource ws;
|
||||||
myassert(c->state == SinkStateDestroyed, "Sink not destroyed");
|
myassert(c->state == SinkStateDestroyed, "Sink not destroyed");
|
||||||
|
|
||||||
if (c->wt != NULL) TaskRemove(cres, c->wt);
|
if (c->wt != NULL) TaskRemove(cres, c->wt);
|
||||||
MPDestroy(c->mp);
|
MPDestroy(c->mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ws->closure != NULL) CMethod(ws->shooks.destroy)(ws->closure);
|
if (ws->closure != NULL) CMethod(ws->shooks.destroy)(ws->closure);
|
||||||
|
@ -252,7 +252,7 @@ ChimeraSource ws;
|
||||||
{
|
{
|
||||||
ws->closure = CMethodVoidPtr(wr->hooks.init)(ws,
|
ws->closure = CMethodVoidPtr(wr->hooks.init)(ws,
|
||||||
wr, wr->hooks.class_closure);
|
wr, wr->hooks.class_closure);
|
||||||
memcpy(&(ws->shooks), &(wr->hooks), sizeof(ws->shooks));
|
memcpy(&(ws->shooks), &(wr->hooks), sizeof(ws->shooks));
|
||||||
if (ws->closure != NULL) detail = wr->hooks.name;
|
if (ws->closure != NULL) detail = wr->hooks.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,13 +352,13 @@ void *closure;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wp->ws->sstate == SourceStateComplete)
|
if (wp->ws->sstate == SourceStateComplete)
|
||||||
{
|
{
|
||||||
ChangeSinkState(wp, SourceEndTask, SinkStateComplete);
|
ChangeSinkState(wp, SourceEndTask, SinkStateComplete);
|
||||||
}
|
}
|
||||||
else ChangeSinkState(wp, NULL, SinkStateLoading);
|
else ChangeSinkState(wp, NULL, SinkStateLoading);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ ChimeraRequest *wr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -704,7 +704,7 @@ ChimeraRequest *wr;
|
||||||
memset(&wp->dhooks, 1, sizeof(wp->dhooks));
|
memset(&wp->dhooks, 1, sizeof(wp->dhooks));
|
||||||
|
|
||||||
GListAddTail(ws->sinks, wp);
|
GListAddTail(ws->sinks, wp);
|
||||||
|
|
||||||
if (cres->printLoadMessages)
|
if (cres->printLoadMessages)
|
||||||
{
|
{
|
||||||
fprintf (stderr, "Sink(%d) Create %s %s\n", wp->debug,
|
fprintf (stderr, "Sink(%d) Create %s %s\n", wp->debug,
|
||||||
|
@ -739,7 +739,7 @@ void *closure;
|
||||||
myassert(hooks->add != NULL, "Add function is NULL.");
|
myassert(hooks->add != NULL, "Add function is NULL.");
|
||||||
myassert(hooks->end != NULL, "End function is NULL.");
|
myassert(hooks->end != NULL, "End function is NULL.");
|
||||||
myassert(hooks->message != NULL, "Message function is NULL.");
|
myassert(hooks->message != NULL, "Message function is NULL.");
|
||||||
|
|
||||||
memcpy(&wp->dhooks, hooks, sizeof(wp->dhooks));
|
memcpy(&wp->dhooks, hooks, sizeof(wp->dhooks));
|
||||||
wp->closure = closure;
|
wp->closure = closure;
|
||||||
|
|
||||||
|
|
|
@ -172,7 +172,7 @@ StackHome(cs)
|
||||||
ChimeraStack cs;
|
ChimeraStack cs;
|
||||||
{
|
{
|
||||||
URLInfo *u;
|
URLInfo *u;
|
||||||
|
|
||||||
if (GListGetTail(cs->urls) == GListGetHead(cs->urls)) return;
|
if (GListGetTail(cs->urls) == GListGetHead(cs->urls)) return;
|
||||||
if ((u = (URLInfo *)GListGetTail(cs->urls)) == NULL) return;
|
if ((u = (URLInfo *)GListGetTail(cs->urls)) == NULL) return;
|
||||||
StackOp(cs, RequestCreate(cs->wc->cres, u->url, NULL), StackHomeAction);
|
StackOp(cs, RequestCreate(cs->wc->cres, u->url, NULL), StackHomeAction);
|
||||||
|
@ -324,7 +324,7 @@ void *closure;
|
||||||
|
|
||||||
url = SinkGetInfo(wp, "x-url");
|
url = SinkGetInfo(wp, "x-url");
|
||||||
ctype = SinkGetInfo(wp, "content-type");
|
ctype = SinkGetInfo(wp, "content-type");
|
||||||
|
|
||||||
if (cs->rh != NULL) rh = cs->rh;
|
if (cs->rh != NULL) rh = cs->rh;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -340,7 +340,7 @@ void *closure;
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cs->wn != NULL)
|
if (cs->wn != NULL)
|
||||||
{
|
{
|
||||||
curstate = RenderGetState(cs->wn);
|
curstate = RenderGetState(cs->wn);
|
||||||
|
@ -349,7 +349,7 @@ void *closure;
|
||||||
cs->wn = NULL;
|
cs->wn = NULL;
|
||||||
}
|
}
|
||||||
else curstate = NULL;
|
else curstate = NULL;
|
||||||
|
|
||||||
if (cs->wp != NULL) SinkDestroy(cs->wp);
|
if (cs->wp != NULL) SinkDestroy(cs->wp);
|
||||||
cs->wp = cs->pending;
|
cs->wp = cs->pending;
|
||||||
cs->pending = NULL;
|
cs->pending = NULL;
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void TimeOutHandler _ArgProto((XtPointer, XtIntervalId *));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TimeOutCreate
|
* TimeOutCreate
|
||||||
*/
|
*/
|
||||||
ChimeraTimeOut
|
ChimeraTimeOut
|
||||||
TimeOutCreate(cres, interval, func, closure)
|
TimeOutCreate(cres, interval, func, closure)
|
||||||
ChimeraResources cres;
|
ChimeraResources cres;
|
||||||
|
@ -62,7 +62,7 @@ void *closure;
|
||||||
pto->iid = XtAppAddTimeOut(pto->cres->appcon,
|
pto->iid = XtAppAddTimeOut(pto->cres->appcon,
|
||||||
(unsigned long)interval,
|
(unsigned long)interval,
|
||||||
TimeOutHandler, cres);
|
TimeOutHandler, cres);
|
||||||
|
|
||||||
return(pto);
|
return(pto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
|
|
||||||
#include "ChimeraP.h"
|
#include "ChimeraP.h"
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
MemPool mp;
|
MemPool mp;
|
||||||
ChimeraSink wp;
|
ChimeraSink wp;
|
||||||
|
@ -88,14 +88,14 @@ char *content;
|
||||||
{
|
{
|
||||||
filename = FixPath(mp, filename);
|
filename = FixPath(mp, filename);
|
||||||
if (filename == NULL) continue;
|
if (filename == NULL) continue;
|
||||||
|
|
||||||
fp = fopen(filename, "r");
|
fp = fopen(filename, "r");
|
||||||
if (fp == NULL) continue;
|
if (fp == NULL) continue;
|
||||||
|
|
||||||
while (fgets(buffer, sizeof(buffer), fp))
|
while (fgets(buffer, sizeof(buffer), fp))
|
||||||
{
|
{
|
||||||
if (buffer[0] == '#' || buffer[0] == '\n') continue;
|
if (buffer[0] == '#' || buffer[0] == '\n') continue;
|
||||||
|
|
||||||
if (sscanf(buffer, "%[^;]%[;]%[^;\n]", ctype, junk, command) == 3)
|
if (sscanf(buffer, "%[^;]%[;]%[^;\n]", ctype, junk, command) == 3)
|
||||||
{
|
{
|
||||||
if (RequestMatchContent(tmp, ctype, content))
|
if (RequestMatchContent(tmp, ctype, content))
|
||||||
|
@ -146,7 +146,7 @@ void *closure;
|
||||||
{
|
{
|
||||||
if ((path = getenv("PATH")) == NULL) path = "";
|
if ((path = getenv("PATH")) == NULL) path = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
finallen = strlen(" ; rm &") + strlen(path) + strlen(filename) * 2 +
|
finallen = strlen(" ; rm &") + strlen(path) + strlen(filename) * 2 +
|
||||||
strlen(vi->command) + strlen("PATH=") + 1;
|
strlen(vi->command) + strlen("PATH=") + 1;
|
||||||
final = (char *)MPGet(vi->mp, finallen);
|
final = (char *)MPGet(vi->mp, finallen);
|
||||||
|
@ -274,7 +274,7 @@ ViewInfo *vi;
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
paned = XtCreateManagedWidget("paned",
|
paned = XtCreateManagedWidget("paned",
|
||||||
panedWidgetClass, vi->pop,
|
panedWidgetClass, vi->pop,
|
||||||
NULL, 0);
|
NULL, 0);
|
||||||
|
|
||||||
box = XtCreateManagedWidget("box", boxWidgetClass, paned, NULL, 0);
|
box = XtCreateManagedWidget("box", boxWidgetClass, paned, NULL, 0);
|
||||||
|
|
|
@ -82,7 +82,7 @@ char *cwd;
|
||||||
strcat(r, c);
|
strcat(r, c);
|
||||||
}
|
}
|
||||||
else r = MPStrDup(mp, c);
|
else r = MPStrDup(mp, c);
|
||||||
|
|
||||||
for (p = r; *p != '\0'; )
|
for (p = r; *p != '\0'; )
|
||||||
{
|
{
|
||||||
if (*p == '/')
|
if (*p == '/')
|
||||||
|
|
|
@ -180,7 +180,7 @@ char *file;
|
||||||
f->next = track_list;
|
f->next = track_list;
|
||||||
track_list = f;
|
track_list = f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return(mp);
|
return(mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ char *line;
|
||||||
t = (char *)MPGet(mp, cp - ps + 1);
|
t = (char *)MPGet(mp, cp - ps + 1);
|
||||||
strncpy(t, ps, cp - ps);
|
strncpy(t, ps, cp - ps);
|
||||||
t[cp - ps] = '\0';
|
t[cp - ps] = '\0';
|
||||||
|
|
||||||
if (mf->value == NULL) mf->value = t;
|
if (mf->value == NULL) mf->value = t;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -216,7 +216,7 @@ size_t len;
|
||||||
*/
|
*/
|
||||||
if (*pcp == '\r') le = pcp;
|
if (*pcp == '\r') le = pcp;
|
||||||
else le = cp;
|
else le = cp;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the line start is the same as the line end then it must be
|
* If the line start is the same as the line end then it must be
|
||||||
* a blank line and its time to bail out.
|
* a blank line and its time to bail out.
|
||||||
|
@ -259,7 +259,7 @@ size_t len;
|
||||||
usedlen += le - ls;
|
usedlen += le - ls;
|
||||||
line[usedlen] = '\0';
|
line[usedlen] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Start the next line after the \n
|
* Start the next line after the \n
|
||||||
*/
|
*/
|
||||||
|
@ -372,12 +372,12 @@ MIMEHeader mh;
|
||||||
char *line;
|
char *line;
|
||||||
{
|
{
|
||||||
MIMEField f;
|
MIMEField f;
|
||||||
|
|
||||||
if ((f = parse_line(mh->mp, line)) != NULL)
|
if ((f = parse_line(mh->mp, line)) != NULL)
|
||||||
{
|
{
|
||||||
GListAddTail(mh->list, f);
|
GListAddTail(mh->list, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,4 +34,3 @@ int MIMEFindData _ArgProto((MIMEHeader, char *, size_t, size_t *));
|
||||||
int MIMEWriteHeader _ArgProto((MIMEHeader, FILE *));
|
int MIMEWriteHeader _ArgProto((MIMEHeader, FILE *));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct MLAttributeP
|
||||||
|
|
||||||
struct MLElementP
|
struct MLElementP
|
||||||
{
|
{
|
||||||
MLElementType type;
|
MLElementType type;
|
||||||
char *ptext; /* processed text */
|
char *ptext; /* processed text */
|
||||||
size_t plen; /* processed text length */
|
size_t plen; /* processed text length */
|
||||||
MLAttribute ta; /* attribute list */
|
MLAttribute ta; /* attribute list */
|
||||||
|
@ -292,7 +292,7 @@ size_t *newlen;
|
||||||
}
|
}
|
||||||
if (cp < x)
|
if (cp < x)
|
||||||
{
|
{
|
||||||
*bcp = *cp;
|
*bcp = *cp;
|
||||||
bcp++;
|
bcp++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -387,7 +387,7 @@ size_t len;
|
||||||
return(tahead);
|
return(tahead);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* hs_add_element
|
* hs_add_element
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
@ -494,7 +494,7 @@ void *closure;
|
||||||
|
|
||||||
hs_push(hs, MLS_START);
|
hs_push(hs, MLS_START);
|
||||||
hs_push(hs, MLS_DATA);
|
hs_push(hs, MLS_DATA);
|
||||||
|
|
||||||
return(hs);
|
return(hs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,4 +785,3 @@ char *name;
|
||||||
|
|
||||||
return(atoi(value));
|
return(atoi(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ ReapChild()
|
||||||
#if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4) && !defined(__QNX__) && !defined(__EMX__)
|
#if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4) && !defined(__QNX__) && !defined(__EMX__)
|
||||||
int st;
|
int st;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
pid = wait3(&st, WNOHANG, 0);
|
pid = wait3(&st, WNOHANG, 0);
|
||||||
|
|
|
@ -190,7 +190,7 @@ bool addfrag;
|
||||||
|
|
||||||
if (NullString(up->scheme)) scheme = "file";
|
if (NullString(up->scheme)) scheme = "file";
|
||||||
else scheme = up->scheme;
|
else scheme = up->scheme;
|
||||||
|
|
||||||
if (NullString(up->hostname))
|
if (NullString(up->hostname))
|
||||||
{
|
{
|
||||||
delim = "";
|
delim = "";
|
||||||
|
@ -477,7 +477,7 @@ char *url;
|
||||||
* the rest is a filename because there is no // or it appears
|
* the rest is a filename because there is no // or it appears
|
||||||
* after other characters
|
* after other characters
|
||||||
*/
|
*/
|
||||||
if (colon != NULL && colon < slash)
|
if (colon != NULL && colon < slash)
|
||||||
{
|
{
|
||||||
up->filename = MPStrDup(mp, colon + 1);
|
up->filename = MPStrDup(mp, colon + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,4 +58,3 @@ int URLReadTranslations _ArgProto((GList, char *));
|
||||||
char *URLTranslate _ArgProto((MemPool, GList, char *));
|
char *URLTranslate _ArgProto((MemPool, GList, char *));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@ chimera2 (2.0a19-8) unstable; urgency=low
|
||||||
chimera2 (2.0a19-7) unstable; urgency=low
|
chimera2 (2.0a19-7) unstable; urgency=low
|
||||||
|
|
||||||
* Use libpng-dev in build-depends instead of libpng12-dev (Closes: #662286)
|
* Use libpng-dev in build-depends instead of libpng12-dev (Closes: #662286)
|
||||||
* Fix so it will build on kfreebsd; thanks Petr Salinger for patch
|
* Fix so it will build on kfreebsd; thanks Petr Salinger for patch
|
||||||
(Closes: #537821)
|
(Closes: #537821)
|
||||||
* Changes to work with libpng 1.5; thanks Nobuhiro Iwamatsu for patch
|
* Changes to work with libpng 1.5; thanks Nobuhiro Iwamatsu for patch
|
||||||
(Closes: #635743)
|
(Closes: #635743)
|
||||||
* Move to correct place in current menu structure (Closes: #496099)
|
* Move to correct place in current menu structure (Closes: #496099)
|
||||||
* Support nostrip build option (Closes: #436628)
|
* Support nostrip build option (Closes: #436628)
|
||||||
|
@ -21,8 +21,8 @@ chimera2 (2.0a19-6) unstable; urgency=low
|
||||||
|
|
||||||
* Replace libjpeg62-dev with libjpeg-dev in Build-Depends (Closes: #641097)
|
* Replace libjpeg62-dev with libjpeg-dev in Build-Depends (Closes: #641097)
|
||||||
|
|
||||||
-- Mark Baker <mark@mnb.org.uk> Thu, 15 Sep 2011 20:52:50 +0100
|
-- Mark Baker <mark@mnb.org.uk> Thu, 15 Sep 2011 20:52:50 +0100
|
||||||
|
|
||||||
chimera2 (2.0a19-5.1) unstable; urgency=medium
|
chimera2 (2.0a19-5.1) unstable; urgency=medium
|
||||||
|
|
||||||
* Non-maintainer upload.
|
* Non-maintainer upload.
|
||||||
|
@ -173,7 +173,7 @@ chimera2 (2.0a11-2) unstable; urgency=low
|
||||||
|
|
||||||
chimera2 (2.0a11-1) unstable; urgency=low
|
chimera2 (2.0a11-1) unstable; urgency=low
|
||||||
|
|
||||||
* New upstream release (fixes memory bugs; unfortunately doesn't fix
|
* New upstream release (fixes memory bugs; unfortunately doesn't fix
|
||||||
rendering bugs AFAICS)
|
rendering bugs AFAICS)
|
||||||
|
|
||||||
-- Mark Baker <mbaker@iee.org> Mon, 20 Oct 1997 00:14:15 +0100
|
-- Mark Baker <mbaker@iee.org> Mon, 20 Oct 1997 00:14:15 +0100
|
||||||
|
|
|
@ -11,8 +11,8 @@ This debian package is copyright 1997 Mark Baker.
|
||||||
[what follows is the file doc/COPYRIGHT from the original distribution]
|
[what follows is the file doc/COPYRIGHT from the original distribution]
|
||||||
|
|
||||||
Most of the code was written by John and Erik and is GPL'd. See
|
Most of the code was written by John and Erik and is GPL'd. See
|
||||||
/usr/share/common-licenses/GPL for details. If I've left anything out below
|
/usr/share/common-licenses/GPL for details. If I've left anything out below
|
||||||
please let me know. Also, if you see GPL'd replacements for anything
|
please let me know. Also, if you see GPL'd replacements for anything
|
||||||
not GPL'd please send it (or a pointer to it) to john@cs.unlv.edu.
|
not GPL'd please send it (or a pointer to it) to john@cs.unlv.edu.
|
||||||
|
|
||||||
Other GPL'd code used:
|
Other GPL'd code used:
|
||||||
|
@ -89,13 +89,13 @@ Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Register in menu
|
# Register in menu
|
||||||
if [ "$1" = "configure" ] && [ -x "$(which update-menus 2>/dev/null)" ]; then
|
if [ "$1" = "configure" ] && [ -x "$(which update-menus 2>/dev/null)" ]; then
|
||||||
|
|
|
@ -73,13 +73,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -134,7 +134,7 @@ such a program is covered only if its contents constitute a work based
|
||||||
on the Library (independent of the use of the Library in a tool for
|
on the Library (independent of the use of the Library in a tool for
|
||||||
writing it). Whether that is true depends on what the Library does
|
writing it). Whether that is true depends on what the Library does
|
||||||
and what the program that uses the Library does.
|
and what the program that uses the Library does.
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Library's
|
1. You may copy and distribute verbatim copies of the Library's
|
||||||
complete source code as you receive it, in any medium, provided that
|
complete source code as you receive it, in any medium, provided that
|
||||||
you conspicuously and appropriately publish on each copy an
|
you conspicuously and appropriately publish on each copy an
|
||||||
|
@ -480,4 +480,3 @@ necessary. Here is a sample; alter the names:
|
||||||
Ty Coon, President of Vice
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
That's all there is to it!
|
That's all there is to it!
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ size_t slen;
|
||||||
if ((colon = ParseToChar(s, ep, ':', true)) == NULL) return(NULL);
|
if ((colon = ParseToChar(s, ep, ':', true)) == NULL) return(NULL);
|
||||||
|
|
||||||
prop = (CSSProperty)MPCGet(mp, sizeof(struct CSSPropertyP));
|
prop = (CSSProperty)MPCGet(mp, sizeof(struct CSSPropertyP));
|
||||||
|
|
||||||
prop->name = (char *)MPGet(mp, colon - s + 1);
|
prop->name = (char *)MPGet(mp, colon - s + 1);
|
||||||
strncpy(prop->name, s, colon - s);
|
strncpy(prop->name, s, colon - s);
|
||||||
prop->name[colon - s] = '\0';
|
prop->name[colon - s] = '\0';
|
||||||
|
@ -523,7 +523,7 @@ CSSContext css;
|
||||||
if (!ParseAt(css, ci)) return;
|
if (!ParseAt(css, ci)) return;
|
||||||
}
|
}
|
||||||
else if (!ParseRule(css, ci)) return;
|
else if (!ParseRule(css, ci)) return;
|
||||||
|
|
||||||
ci->cp = ParseSpace(ci->cp, ci->ep);
|
ci->cp = ParseSpace(ci->cp, ci->ep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -762,7 +762,7 @@ char *argv[];
|
||||||
fread(b, 1, st.st_size, fp);
|
fread(b, 1, st.st_size, fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
css = CSSParseBuffer(NULL, b, st.st_size, NULL, NULL);
|
css = CSSParseBuffer(NULL, b, st.st_size, NULL, NULL);
|
||||||
|
|
||||||
mp = MPCreate();
|
mp = MPCreate();
|
||||||
slist = GListCreate();
|
slist = GListCreate();
|
||||||
|
|
|
@ -78,7 +78,7 @@ static void RenderFlow _ArgProto((HTMLInfo, HTMLBox, Region));
|
||||||
static void SetupHLine _ArgProto((HTMLInfo, HFlow *, HLine *));
|
static void SetupHLine _ArgProto((HTMLInfo, HFlow *, HLine *));
|
||||||
static HLine *StartLine _ArgProto((HTMLInfo, HTMLEnv, HFlow *, HTMLBox));
|
static HLine *StartLine _ArgProto((HTMLInfo, HTMLEnv, HFlow *, HTMLBox));
|
||||||
static void EndLine _ArgProto((HTMLInfo, HFlow *, HLine *, HTMLBox));
|
static void EndLine _ArgProto((HTMLInfo, HFlow *, HLine *, HTMLBox));
|
||||||
static void AddFloater _ArgProto((HTMLInfo, HFlow *, HTMLBox, HTMLBox));
|
static void AddFloater _ArgProto((HTMLInfo, HFlow *, HTMLBox, HTMLBox));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* DestroyFlow
|
* DestroyFlow
|
||||||
|
@ -259,7 +259,7 @@ HTMLBox parent;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add a new line to the end.
|
* Add a new line to the end.
|
||||||
*/
|
*/
|
||||||
hl = (HLine *)MPCGet(li->mp, sizeof(HLine));
|
hl = (HLine *)MPCGet(li->mp, sizeof(HLine));
|
||||||
hl->boxes = GListCreateX(li->mp);
|
hl->boxes = GListCreateX(li->mp);
|
||||||
hl->ff = env->ff;
|
hl->ff = env->ff;
|
||||||
|
@ -587,6 +587,6 @@ HTMLBox box;
|
||||||
|
|
||||||
HTMLSetFinalPosition(li);
|
HTMLSetFinalPosition(li);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,10 +108,10 @@ HTMLFont lfi;
|
||||||
|
|
||||||
if (strcmp(fields[XLFD_WEIGHT_NAME], "bold") == 0 ||
|
if (strcmp(fields[XLFD_WEIGHT_NAME], "bold") == 0 ||
|
||||||
strcmp(fields[XLFD_WEIGHT_NAME], "demi") == 0 ||
|
strcmp(fields[XLFD_WEIGHT_NAME], "demi") == 0 ||
|
||||||
strcmp(fields[XLFD_WEIGHT_NAME], "demibold") == 0)
|
strcmp(fields[XLFD_WEIGHT_NAME], "demibold") == 0)
|
||||||
{
|
{
|
||||||
lfi->weight = 1;
|
lfi->weight = 1;
|
||||||
}
|
}
|
||||||
else lfi->weight = 0;
|
else lfi->weight = 0;
|
||||||
|
|
||||||
lfi->size = atoi(fields[XLFD_PIXEL_SIZE]);
|
lfi->size = atoi(fields[XLFD_PIXEL_SIZE]);
|
||||||
|
@ -258,7 +258,7 @@ char *pattern;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Find sizes for each of the font scales. There must be a better way.
|
* Find sizes for each of the font scales. There must be a better way.
|
||||||
* This should probably not take
|
* This should probably not take
|
||||||
*/
|
*/
|
||||||
scale_count = 0;
|
scale_count = 0;
|
||||||
for (i = 0; i < count && scale_count < FONT_SCALE_COUNT; i++)
|
for (i = 0; i < count && scale_count < FONT_SCALE_COUNT; i++)
|
||||||
|
@ -295,7 +295,7 @@ char *pattern;
|
||||||
fl->scale[0] = fl->fontInfo[0].size;
|
fl->scale[0] = fl->fontInfo[0].size;
|
||||||
scale_count++;
|
scale_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill out the rest if there aren't FONT_SCALE_COUNT
|
* Fill out the rest if there aren't FONT_SCALE_COUNT
|
||||||
*/
|
*/
|
||||||
|
|
40
html/form.c
40
html/form.c
|
@ -148,7 +148,7 @@ static void HandleSubmit _ArgProto((HTMLInfo, FormState *, InputState *,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functions
|
* Functions
|
||||||
*/
|
*/
|
||||||
static XFontStruct *
|
static XFontStruct *
|
||||||
GetFont(w)
|
GetFont(w)
|
||||||
Widget w;
|
Widget w;
|
||||||
|
@ -196,7 +196,7 @@ int count;
|
||||||
n = URLEscape(mp, names[i], 0);
|
n = URLEscape(mp, names[i], 0);
|
||||||
if (values[i] != NULL) v = URLEscape(mp, values[i], 1);
|
if (values[i] != NULL) v = URLEscape(mp, values[i], 1);
|
||||||
else v = "";
|
else v = "";
|
||||||
|
|
||||||
alen = flen + strlen(n) + strlen(v) + strlen(sep) + strlen(format) + 1;
|
alen = flen + strlen(n) + strlen(v) + strlen(sep) + strlen(format) + 1;
|
||||||
|
|
||||||
nf = (char *)MPGet(mp, alen);
|
nf = (char *)MPGet(mp, alen);
|
||||||
|
@ -270,7 +270,7 @@ char *action;
|
||||||
{
|
{
|
||||||
names[i] = NULL;
|
names[i] = NULL;
|
||||||
values[i] = NULL;
|
values[i] = NULL;
|
||||||
|
|
||||||
if ((n = MLFindAttribute(xi->p, "name")) == NULL) continue;
|
if ((n = MLFindAttribute(xi->p, "name")) == NULL) continue;
|
||||||
|
|
||||||
if (xi->id == INPUT_TEXT || xi->id == INPUT_PASSWORD)
|
if (xi->id == INPUT_TEXT || xi->id == INPUT_PASSWORD)
|
||||||
|
@ -289,7 +289,7 @@ char *action;
|
||||||
}
|
}
|
||||||
else if (xi->id == INPUT_CHECKBOX || xi->id == INPUT_RADIO)
|
else if (xi->id == INPUT_CHECKBOX || xi->id == INPUT_RADIO)
|
||||||
{
|
{
|
||||||
XtVaGetValues(xi->w, XtNstate, &checked, NULL);
|
XtVaGetValues(xi->w, XtNstate, &checked, NULL);
|
||||||
if (checked)
|
if (checked)
|
||||||
{
|
{
|
||||||
names[i] = n;
|
names[i] = n;
|
||||||
|
@ -417,7 +417,7 @@ XtPointer cldata, cbdata;
|
||||||
co = (OptionState *)GListGetNext(ci->oplist))
|
co = (OptionState *)GListGetNext(ci->oplist))
|
||||||
{
|
{
|
||||||
if (co->sme == w)
|
if (co->sme == w)
|
||||||
{
|
{
|
||||||
if (co->selected)
|
if (co->selected)
|
||||||
{
|
{
|
||||||
if (ci->multi) co->selected = false;
|
if (ci->multi) co->selected = false;
|
||||||
|
@ -502,7 +502,7 @@ InputType type;
|
||||||
ci->fs = fs;
|
ci->fs = fs;
|
||||||
|
|
||||||
GListAddTail(fs->islist, ci);
|
GListAddTail(fs->islist, ci);
|
||||||
|
|
||||||
return(ci);
|
return(ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ InputType type;
|
||||||
ci = CreateInputState(fs, p, type);
|
ci = CreateInputState(fs, p, type);
|
||||||
box = CreateInputBox(fs->li, env, ci, width, height);
|
box = CreateInputBox(fs->li, env, ci, width, height);
|
||||||
ci->w = w;
|
ci->w = w;
|
||||||
|
|
||||||
if (type == INPUT_SUBMIT)
|
if (type == INPUT_SUBMIT)
|
||||||
{
|
{
|
||||||
XtAddCallback(w, XtNcallback, SubmitCallback, (XtPointer)ci);
|
XtAddCallback(w, XtNcallback, SubmitCallback, (XtPointer)ci);
|
||||||
|
@ -777,14 +777,14 @@ MLElement p;
|
||||||
FormState *fs;
|
FormState *fs;
|
||||||
|
|
||||||
HTMLAddLineBreak(li, env);
|
HTMLAddLineBreak(li, env);
|
||||||
|
|
||||||
fs = (FormState *)MPCGet(li->mp, sizeof(FormState));
|
fs = (FormState *)MPCGet(li->mp, sizeof(FormState));
|
||||||
fs->p = p;
|
fs->p = p;
|
||||||
fs->li = li;
|
fs->li = li;
|
||||||
fs->islist = GListCreateX(li->mp);
|
fs->islist = GListCreateX(li->mp);
|
||||||
fs->rslist = GListCreateX(li->mp);
|
fs->rslist = GListCreateX(li->mp);
|
||||||
fs->action = MLFindAttribute(p, "action");
|
fs->action = MLFindAttribute(p, "action");
|
||||||
|
|
||||||
env->closure = fs;
|
env->closure = fs;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -814,7 +814,7 @@ MLElement p;
|
||||||
else if (strcasecmp(type, "checkbox") == 0) CreateCheckbox(fs, env, p);
|
else if (strcasecmp(type, "checkbox") == 0) CreateCheckbox(fs, env, p);
|
||||||
else if (strcasecmp(type, "hidden") == 0) CreateHidden(fs, env, p);
|
else if (strcasecmp(type, "hidden") == 0) CreateHidden(fs, env, p);
|
||||||
else if (strcasecmp(type, "image") == 0) CreateImage(fs, env, p);
|
else if (strcasecmp(type, "image") == 0) CreateImage(fs, env, p);
|
||||||
else if (strcasecmp(type, "password") == 0)
|
else if (strcasecmp(type, "password") == 0)
|
||||||
{
|
{
|
||||||
CreateText(fs, env, p, INPUT_PASSWORD);
|
CreateText(fs, env, p, INPUT_PASSWORD);
|
||||||
}
|
}
|
||||||
|
@ -857,7 +857,7 @@ MLElement p;
|
||||||
if ((tatext = HTMLGetEnvText(li->mp, env)) == NULL) tatext = NULL;
|
if ((tatext = HTMLGetEnvText(li->mp, env)) == NULL) tatext = NULL;
|
||||||
|
|
||||||
obj = (HTMLObject)GListGetHead(env->slist);
|
obj = (HTMLObject)GListGetHead(env->slist);
|
||||||
|
|
||||||
w = XtVaCreateWidget("textarea",
|
w = XtVaCreateWidget("textarea",
|
||||||
asciiTextWidgetClass, li->widget,
|
asciiTextWidgetClass, li->widget,
|
||||||
XtNeditType, XtEtextEdit,
|
XtNeditType, XtEtextEdit,
|
||||||
|
@ -870,17 +870,17 @@ MLElement p;
|
||||||
if (font == NULL) height = 20;
|
if (font == NULL) height = 20;
|
||||||
else height = font->ascent + font->descent + 2;
|
else height = font->ascent + font->descent + 2;
|
||||||
width = XTextWidth(font, "X", 1);
|
width = XTextWidth(font, "X", 1);
|
||||||
|
|
||||||
if ((rows = MLAttributeToInt(obj->o.p, "rows")) <= 0) rows = 5;
|
if ((rows = MLAttributeToInt(obj->o.p, "rows")) <= 0) rows = 5;
|
||||||
height *= rows;
|
height *= rows;
|
||||||
|
|
||||||
if ((cols = MLAttributeToInt(obj->o.p, "cols")) <= 0) cols = 20;
|
if ((cols = MLAttributeToInt(obj->o.p, "cols")) <= 0) cols = 20;
|
||||||
width *= cols;
|
width *= cols;
|
||||||
|
|
||||||
ci = CreateInputState(fs, obj->o.p, INPUT_TEXTAREA);
|
ci = CreateInputState(fs, obj->o.p, INPUT_TEXTAREA);
|
||||||
box = CreateInputBox(fs->li, env, ci, width, height);
|
box = CreateInputBox(fs->li, env, ci, width, height);
|
||||||
ci->w = w;
|
ci->w = w;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -927,13 +927,13 @@ HTMLEnv env;
|
||||||
XtNmenuName, "simplemenu",
|
XtNmenuName, "simplemenu",
|
||||||
XtNlabel, c->text,
|
XtNlabel, c->text,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
smw = XtVaCreatePopupShell("simplemenu",
|
smw = XtVaCreatePopupShell("simplemenu",
|
||||||
simpleMenuWidgetClass, w,
|
simpleMenuWidgetClass, w,
|
||||||
XtNwidth, 0,
|
XtNwidth, 0,
|
||||||
XtNheight, 0,
|
XtNheight, 0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtVaGetValues(w, XtNfont, &font, NULL);
|
XtVaGetValues(w, XtNfont, &font, NULL);
|
||||||
width = 0;
|
width = 0;
|
||||||
for (c = (OptionState *)GListGetHead(oplist); c != NULL;
|
for (c = (OptionState *)GListGetHead(oplist); c != NULL;
|
||||||
|
@ -942,7 +942,7 @@ HTMLEnv env;
|
||||||
c->sme = XtVaCreateManagedWidget(c->text,
|
c->sme = XtVaCreateManagedWidget(c->text,
|
||||||
smeBSBObjectClass, smw,
|
smeBSBObjectClass, smw,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
twidth = XTextWidth(font, c->text, strlen(c->text));
|
twidth = XTextWidth(font, c->text, strlen(c->text));
|
||||||
if (width < twidth) width = twidth;
|
if (width < twidth) width = twidth;
|
||||||
}
|
}
|
||||||
|
@ -961,7 +961,7 @@ HTMLEnv env;
|
||||||
{
|
{
|
||||||
XtAddCallback(c->sme, XtNcallback, SmeCallback, (XtPointer)ci);
|
XtAddCallback(c->sme, XtNcallback, SmeCallback, (XtPointer)ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ MLElement p;
|
||||||
n->value = MLFindAttribute(obj->o.p, "value");
|
n->value = MLFindAttribute(obj->o.p, "value");
|
||||||
if (MLFindAttribute(obj->o.p, "selected") != NULL) n->selected = true;
|
if (MLFindAttribute(obj->o.p, "selected") != NULL) n->selected = true;
|
||||||
GListAddTail(formstate->oplist, n);
|
GListAddTail(formstate->oplist, n);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -143,7 +143,7 @@ MLElement p;
|
||||||
if ((height = MLAttributeToInt(p, "height")) < 0) height = 500;
|
if ((height = MLAttributeToInt(p, "height")) < 0) height = 500;
|
||||||
|
|
||||||
box = HTMLCreateBox(li, env);
|
box = HTMLCreateBox(li, env);
|
||||||
|
|
||||||
aid = HTMLAttributeToID(p, "align");
|
aid = HTMLAttributeToID(p, "align");
|
||||||
if (aid == ATTRIB_MIDDLE) box->baseline = height / 2;
|
if (aid == ATTRIB_MIDDLE) box->baseline = height / 2;
|
||||||
else if (aid == ATTRIB_TOP) box->baseline = 0;
|
else if (aid == ATTRIB_TOP) box->baseline = 0;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* hr.c
|
* hr.c
|
||||||
*
|
*
|
||||||
* libhtml - HTML->X renderer
|
* libhtml - HTML->X renderer
|
||||||
*
|
*
|
||||||
* Copyright (c) 1995-1997, John Kilburg <john@cs.unlv.edu>
|
* Copyright (c) 1995-1997, John Kilburg <john@cs.unlv.edu>
|
||||||
*
|
*
|
||||||
|
|
12
html/html.c
12
html/html.c
|
@ -152,7 +152,7 @@ HTMLTagID tagid;
|
||||||
GList list;
|
GList list;
|
||||||
|
|
||||||
list = li->envstack;
|
list = li->envstack;
|
||||||
for (env = (HTMLEnv)GListGetHead(list); env != NULL;
|
for (env = (HTMLEnv)GListGetHead(list); env != NULL;
|
||||||
env = (HTMLEnv)GListGetNext(list))
|
env = (HTMLEnv)GListGetNext(list))
|
||||||
{
|
{
|
||||||
if (env->tag->id == tagid) return(env);
|
if (env->tag->id == tagid) return(env);
|
||||||
|
@ -386,7 +386,7 @@ MLElement p;
|
||||||
env = (HTMLEnv)GListPop(li->envstack);
|
env = (HTMLEnv)GListPop(li->envstack);
|
||||||
|
|
||||||
AddObject(li, HTML_ENV, env);
|
AddObject(li, HTML_ENV, env);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ MLElement p;
|
||||||
AddObject(li, HTML_BEGINTAG, p);
|
AddObject(li, HTML_BEGINTAG, p);
|
||||||
}
|
}
|
||||||
else AddObject(li, HTML_TAG, p);
|
else AddObject(li, HTML_TAG, p);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -524,7 +524,7 @@ MLElement p;
|
||||||
HTMLInfo li = (HTMLInfo)closure;
|
HTMLInfo li = (HTMLInfo)closure;
|
||||||
HTMLTag tag;
|
HTMLTag tag;
|
||||||
MLElementType mt;
|
MLElementType mt;
|
||||||
|
|
||||||
if ((mt = MLGetType(p)) == ML_EOF)
|
if ((mt = MLGetType(p)) == ML_EOF)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -548,7 +548,7 @@ MLElement p;
|
||||||
{
|
{
|
||||||
printf ("Unknown tag: %s\n", MLTagName(p));
|
printf ("Unknown tag: %s\n", MLTagName(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +585,7 @@ HTMLObject obj;
|
||||||
cenv->ff = env->ff;
|
cenv->ff = env->ff;
|
||||||
cenv->anchor = env->anchor;
|
cenv->anchor = env->anchor;
|
||||||
cenv->fi = HTMLDupFont(li, env->fi);
|
cenv->fi = HTMLDupFont(li, env->fi);
|
||||||
|
|
||||||
if (HTMLTestM(cenv->tag, MARKUP_SPACER))
|
if (HTMLTestM(cenv->tag, MARKUP_SPACER))
|
||||||
{
|
{
|
||||||
HTMLAddBlankLine(li, env);
|
HTMLAddBlankLine(li, env);
|
||||||
|
|
|
@ -204,7 +204,7 @@ struct HTMLEnvP
|
||||||
bool visited; /* used by boxify functions */
|
bool visited; /* used by boxify functions */
|
||||||
MLElement anchor; /* anchor to use in environment */
|
MLElement anchor; /* anchor to use in environment */
|
||||||
HTMLFont fi; /* font to use in environment */
|
HTMLFont fi; /* font to use in environment */
|
||||||
HTMLFlowAlign ff; /* alignment in flow box */
|
HTMLFlowAlign ff; /* alignment in flow box */
|
||||||
void *closure; /* environment specific data */
|
void *closure; /* environment specific data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ struct HTMLInfoP
|
||||||
Pixel anchor_color;
|
Pixel anchor_color;
|
||||||
Pixel anchor_select_color;
|
Pixel anchor_select_color;
|
||||||
Pixel fg, bg;
|
Pixel fg, bg;
|
||||||
|
|
||||||
/* www lib */
|
/* www lib */
|
||||||
ChimeraContext wc;
|
ChimeraContext wc;
|
||||||
ChimeraResources cres;
|
ChimeraResources cres;
|
||||||
|
@ -311,7 +311,7 @@ struct HTMLInfoP
|
||||||
GList envstack; /* tag hierarchy */
|
GList envstack; /* tag hierarchy */
|
||||||
GList selectors; /* CSS selector list */
|
GList selectors; /* CSS selector list */
|
||||||
GList oldselectors; /* old CSS selector list */
|
GList oldselectors; /* old CSS selector list */
|
||||||
GList endstack; /* pending end tags */
|
GList endstack; /* pending end tags */
|
||||||
|
|
||||||
GList alist; /* anchor box list */
|
GList alist; /* anchor box list */
|
||||||
ChimeraTimeOut sto; /* select timeout */
|
ChimeraTimeOut sto; /* select timeout */
|
||||||
|
|
|
@ -245,7 +245,7 @@ static struct HTMLTagP tlist[] =
|
||||||
NULL, NULL, NULL },
|
NULL, NULL, NULL },
|
||||||
|
|
||||||
/* Internal tags */
|
/* Internal tags */
|
||||||
{ "xxx-document", TAG_DOCUMENT, HTMLDocumentBegin, HTMLDocumentEnd,
|
{ "xxx-document", TAG_DOCUMENT, HTMLDocumentBegin, HTMLDocumentEnd,
|
||||||
HTMLFillData, HTMLDocumentAddBox, HTMLDocumentWidth,
|
HTMLFillData, HTMLDocumentAddBox, HTMLDocumentWidth,
|
||||||
MARKUP_FAKE, NULL, NULL, NULL }
|
MARKUP_FAKE, NULL, NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
|
@ -149,7 +149,7 @@ HTMLInline isp;
|
||||||
int border;
|
int border;
|
||||||
|
|
||||||
isp->box = box = HTMLCreateBox(isp->li, isp->env);
|
isp->box = box = HTMLCreateBox(isp->li, isp->env);
|
||||||
|
|
||||||
if ((border = MLAttributeToInt(isp->ii.p, "border")) < 0) isp->border = 0;
|
if ((border = MLAttributeToInt(isp->ii.p, "border")) < 0) isp->border = 0;
|
||||||
else isp->border = border;
|
else isp->border = border;
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ HTMLInline isp;
|
||||||
box->width = isp->width + isp->hspace * 2;
|
box->width = isp->width + isp->hspace * 2;
|
||||||
box->height = isp->height + isp->vspace * 2;
|
box->height = isp->height + isp->vspace * 2;
|
||||||
box->closure = isp;
|
box->closure = isp;
|
||||||
|
|
||||||
HTMLEnvAddBox(isp->li, isp->env, box);
|
HTMLEnvAddBox(isp->li, isp->env, box);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -409,7 +409,7 @@ void *rc;
|
||||||
else isp->hspace = hspace;
|
else isp->hspace = hspace;
|
||||||
isp->ismap = MLFindAttribute(ii->p, "ismap") != NULL ? true:false;
|
isp->ismap = MLFindAttribute(ii->p, "ismap") != NULL ? true:false;
|
||||||
isp->mapurl = MLFindAttribute(ii->p, "usemap");
|
isp->mapurl = MLFindAttribute(ii->p, "usemap");
|
||||||
|
|
||||||
if (isp->width == 0 || isp->height == 0)
|
if (isp->width == 0 || isp->height == 0)
|
||||||
{
|
{
|
||||||
isp->delayed = true;
|
isp->delayed = true;
|
||||||
|
|
|
@ -77,7 +77,7 @@ HTMLBox box;
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
{
|
{
|
||||||
GUIGetOnScreenDimensions(li->wd, &x, &y, &width, &height);
|
GUIGetOnScreenDimensions(li->wd, &x, &y, &width, &height);
|
||||||
|
|
||||||
r = XCreateRegion();
|
r = XCreateRegion();
|
||||||
rec.x = (short)x;
|
rec.x = (short)x;
|
||||||
rec.y = (short)y;
|
rec.y = (short)y;
|
||||||
|
|
16
html/list.c
16
html/list.c
|
@ -156,7 +156,7 @@ CreateList(li, env)
|
||||||
HTMLInfo li;
|
HTMLInfo li;
|
||||||
HTMLEnv env;
|
HTMLEnv env;
|
||||||
{
|
{
|
||||||
HList *ls;
|
HList *ls;
|
||||||
|
|
||||||
ls = (HList *)MPCGet(li->mp, sizeof(HList));
|
ls = (HList *)MPCGet(li->mp, sizeof(HList));
|
||||||
ls->lbox = HTMLCreateBox(li, env);
|
ls->lbox = HTMLCreateBox(li, env);
|
||||||
|
@ -224,11 +224,11 @@ MLElement p;
|
||||||
* If the <ol> specifies a START or SEQNUM attribute, handle that,
|
* If the <ol> specifies a START or SEQNUM attribute, handle that,
|
||||||
* otherwise the default is 1
|
* otherwise the default is 1
|
||||||
*/
|
*/
|
||||||
if((startstr = MLFindAttribute(p, "start"))!= NULL)
|
if((startstr = MLFindAttribute(p, "start"))!= NULL)
|
||||||
{
|
{
|
||||||
ls->count = atoi(startstr);
|
ls->count = atoi(startstr);
|
||||||
}
|
}
|
||||||
else if((startstr = MLFindAttribute(p, "seqnum"))!= NULL)
|
else if((startstr = MLFindAttribute(p, "seqnum"))!= NULL)
|
||||||
{
|
{
|
||||||
ls->count = atoi(startstr);
|
ls->count = atoi(startstr);
|
||||||
}
|
}
|
||||||
|
@ -237,7 +237,7 @@ MLElement p;
|
||||||
ls->count = 1;
|
ls->count = 1;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Now see if said <ol> has a TYPE attribute.
|
* Now see if said <ol> has a TYPE attribute.
|
||||||
* Types are:
|
* Types are:
|
||||||
* 1 ==> std numbering
|
* 1 ==> std numbering
|
||||||
* aA ==>[aA]lphabetic
|
* aA ==>[aA]lphabetic
|
||||||
|
@ -255,7 +255,7 @@ MLElement p;
|
||||||
{
|
{
|
||||||
ls->type = OL_NUMERIC;
|
ls->type = OL_NUMERIC;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ MLElement p;
|
||||||
ls->ibox = HTMLCreateFlowBox(li, env, HTMLGetMaxWidth(li, env->penv));
|
ls->ibox = HTMLCreateFlowBox(li, env, HTMLGetMaxWidth(li, env->penv));
|
||||||
GListAddTail(ls->klist, ls->ibox);
|
GListAddTail(ls->klist, ls->ibox);
|
||||||
env->closure = ls;
|
env->closure = ls;
|
||||||
|
|
||||||
if (HTMLTagToID(env->penv->tag) == TAG_OL)
|
if (HTMLTagToID(env->penv->tag) == TAG_OL)
|
||||||
{
|
{
|
||||||
OLNext(buffer, sizeof(buffer), ls->count++, ls->type);
|
OLNext(buffer, sizeof(buffer), ls->count++, ls->type);
|
||||||
|
@ -392,13 +392,13 @@ OListType oltype;
|
||||||
|
|
||||||
if (oltype == OL_ALPHA_CAP)
|
if (oltype == OL_ALPHA_CAP)
|
||||||
{
|
{
|
||||||
number = (number-1) % 26;
|
number = (number-1) % 26;
|
||||||
number += 65;
|
number += 65;
|
||||||
snprintf(buffer, bsize, "%c.", (char)number);
|
snprintf(buffer, bsize, "%c.", (char)number);
|
||||||
}
|
}
|
||||||
else if (oltype == OL_ALPHA_MINISCULE)
|
else if (oltype == OL_ALPHA_MINISCULE)
|
||||||
{
|
{
|
||||||
number = (number-1) % 26;
|
number = (number-1) % 26;
|
||||||
number += 97;
|
number += 97;
|
||||||
snprintf(buffer, bsize, "%c.", (char)number);
|
snprintf(buffer, bsize, "%c.", (char)number);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* load.c
|
* load.c
|
||||||
*
|
*
|
||||||
* libhtml - HTML->X renderer
|
* libhtml - HTML->X renderer
|
||||||
*
|
*
|
||||||
* Copyright (c) 1996-1997, John Kilburg <john@cs.unlv.edu>
|
* Copyright (c) 1996-1997, John Kilburg <john@cs.unlv.edu>
|
||||||
*
|
*
|
||||||
|
@ -45,7 +45,7 @@ char *action;
|
||||||
HTMLFindName(li, url + 1);
|
HTMLFindName(li, url + 1);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
wr = RequestCreate(li->cres, url, li->burl);
|
wr = RequestCreate(li->cres, url, li->burl);
|
||||||
RenderAction(li->wn, wr, action);
|
RenderAction(li->wn, wr, action);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ HTMLInfo li;
|
||||||
HTMLAnchor anchor;
|
HTMLAnchor anchor;
|
||||||
int x, y;
|
int x, y;
|
||||||
bool ismap;
|
bool ismap;
|
||||||
{
|
{
|
||||||
char *url, *aurl;
|
char *url, *aurl;
|
||||||
MemPool mp;
|
MemPool mp;
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ int x, y;
|
||||||
if (map == NULL) return(NULL);
|
if (map == NULL) return(NULL);
|
||||||
|
|
||||||
list = map->areas;
|
list = map->areas;
|
||||||
for (area = (HTMLArea)GListGetHead(list); area != NULL;
|
for (area = (HTMLArea)GListGetHead(list); area != NULL;
|
||||||
area = (HTMLArea)GListGetNext(list))
|
area = (HTMLArea)GListGetNext(list))
|
||||||
{
|
{
|
||||||
if (area->shape == HTMLMapShapeRect)
|
if (area->shape == HTMLMapShapeRect)
|
||||||
|
|
|
@ -135,7 +135,7 @@ MLElement p;
|
||||||
HTMLAddFontWeight(env->fi);
|
HTMLAddFontWeight(env->fi);
|
||||||
}
|
}
|
||||||
else if (tagid == TAG_TT) HTMLSetFontFixed(env->fi);
|
else if (tagid == TAG_TT) HTMLSetFontFixed(env->fi);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,4 +295,3 @@ MLElement p;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -208,7 +208,7 @@ int x, y;
|
||||||
{
|
{
|
||||||
if (InAnchor(x, y, a->box)) break;
|
if (InAnchor(x, y, a->box)) break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (a == NULL || a->p == NULL) RenderSendMessage(li->wn, NULL);
|
if (a == NULL || a->p == NULL) RenderSendMessage(li->wn, NULL);
|
||||||
else HTMLPrintAnchor(li, a, x, y, false);
|
else HTMLPrintAnchor(li, a, x, y, false);
|
||||||
li->over = a;
|
li->over = a;
|
||||||
|
@ -403,7 +403,7 @@ void *state;
|
||||||
GUIGetNamedColor(wd, "black", &(li->fg));
|
GUIGetNamedColor(wd, "black", &(li->fg));
|
||||||
|
|
||||||
XSetForeground(li->dpy, li->gc, li->fg);
|
XSetForeground(li->dpy, li->gc, li->fg);
|
||||||
|
|
||||||
HTMLSetupFonts(li);
|
HTMLSetupFonts(li);
|
||||||
|
|
||||||
GUISetScrollBar(wd, true);
|
GUISetScrollBar(wd, true);
|
||||||
|
@ -503,7 +503,7 @@ ChimeraResources cres;
|
||||||
|
|
||||||
if (blen == st.st_size)
|
if (blen == st.st_size)
|
||||||
{
|
{
|
||||||
lc->css = CSSParseBuffer(NULL, b, blen, NULL, NULL);
|
lc->css = CSSParseBuffer(NULL, b, blen, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
free_mem(b);
|
free_mem(b);
|
||||||
|
|
15
html/table.c
15
html/table.c
|
@ -393,7 +393,7 @@ MLElement p;
|
||||||
else if (x >= 100) width = x;
|
else if (x >= 100) width = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (width > 0) ts->max_width = width;
|
if (width > 0) ts->max_width = width;
|
||||||
else ts->max_width = 0;
|
else ts->max_width = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -448,7 +448,7 @@ MLElement p;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TablePosition2(ts);
|
TablePosition2(ts);
|
||||||
|
|
||||||
HTMLEnvAddBox(li, env->penv, ts->box);
|
HTMLEnvAddBox(li, env->penv, ts->box);
|
||||||
}
|
}
|
||||||
|
@ -457,7 +457,7 @@ MLElement p;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FillSpans
|
* FillSpans
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
FillSpans(ts)
|
FillSpans(ts)
|
||||||
|
@ -524,7 +524,7 @@ HTable *ts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now extend HData to the right depending on the colspan.
|
* Now extend HData to the right depending on the colspan.
|
||||||
*/
|
*/
|
||||||
|
@ -545,7 +545,7 @@ HTable *ts;
|
||||||
if (rs->ca[i].ds == NULL) break;
|
if (rs->ca[i].ds == NULL) break;
|
||||||
}
|
}
|
||||||
myassert(ts->colcount != i, "Table column count confused.");
|
myassert(ts->colcount != i, "Table column count confused.");
|
||||||
|
|
||||||
rs->ca[i].original = true;
|
rs->ca[i].original = true;
|
||||||
for (j = 0; j < ds->colspan; j++, i++)
|
for (j = 0; j < ds->colspan; j++, i++)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +729,7 @@ HTable *ts;
|
||||||
ds = rs->ca[i].ds;
|
ds = rs->ca[i].ds;
|
||||||
width = ds->box->width / ds->colspan;
|
width = ds->box->width / ds->colspan;
|
||||||
if (width > ts->cwidth[i]) ts->cwidth[i] = width;
|
if (width > ts->cwidth[i]) ts->cwidth[i] = width;
|
||||||
|
|
||||||
height = ds->box->height / ds->rowspan;
|
height = ds->box->height / ds->rowspan;
|
||||||
if (height > ts->rheight[j]) ts->rheight[j] = height;
|
if (height > ts->rheight[j]) ts->rheight[j] = height;
|
||||||
}
|
}
|
||||||
|
@ -739,7 +739,7 @@ HTable *ts;
|
||||||
ds = rs->ca[i].ds2;
|
ds = rs->ca[i].ds2;
|
||||||
width = ds->box->width / ds->colspan;
|
width = ds->box->width / ds->colspan;
|
||||||
if (width > ts->cwidth[i]) ts->cwidth[i] = width;
|
if (width > ts->cwidth[i]) ts->cwidth[i] = width;
|
||||||
|
|
||||||
height = ds->box->height / ds->rowspan;
|
height = ds->box->height / ds->rowspan;
|
||||||
if (height > ts->rheight[j]) ts->rheight[j] = height;
|
if (height > ts->rheight[j]) ts->rheight[j] = height;
|
||||||
}
|
}
|
||||||
|
@ -897,4 +897,3 @@ HTMLEnv env;
|
||||||
HTable *ts = (HTable *)env->closure;
|
HTable *ts = (HTable *)env->closure;
|
||||||
return(HTMLGetBoxWidth(li, ts->dbox));
|
return(HTMLGetBoxWidth(li, ts->dbox));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
html/text.c
10
html/text.c
|
@ -177,7 +177,7 @@ size_t len;
|
||||||
}
|
}
|
||||||
else ptlen++;
|
else ptlen++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tabbed)
|
if (tabbed)
|
||||||
{
|
{
|
||||||
s = ExpandTabs(li, start, cp - start, ptlen);
|
s = ExpandTabs(li, start, cp - start, ptlen);
|
||||||
|
@ -244,7 +244,7 @@ MLElement p;
|
||||||
if (text == NULL) return;
|
if (text == NULL) return;
|
||||||
|
|
||||||
HTMLPreformatted(li, env, text, len);
|
HTMLPreformatted(li, env, text, len);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,16 +300,16 @@ MLElement p;
|
||||||
{
|
{
|
||||||
found_space = true;
|
found_space = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found_space)
|
if (found_space)
|
||||||
{
|
{
|
||||||
HTMLEnvAddBox(li, env, HTMLCreateTextBox(li, env, NULL, 0));
|
HTMLEnvAddBox(li, env, HTMLCreateTextBox(li, env, NULL, 0));
|
||||||
}
|
}
|
||||||
if (cp == lastcp) break;
|
if (cp == lastcp) break;
|
||||||
|
|
||||||
for (s = cp; cp < lastcp && !isspace8(*cp); cp++)
|
for (s = cp; cp < lastcp && !isspace8(*cp); cp++)
|
||||||
;
|
;
|
||||||
|
|
||||||
HTMLEnvAddBox(li, env, HTMLCreateTextBox(li, env, s, cp - s));
|
HTMLEnvAddBox(li, env, HTMLCreateTextBox(li, env, s, cp - s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ lf_create_dither_matrix(
|
||||||
/* Make sure the column count is <= row count */
|
/* Make sure the column count is <= row count */
|
||||||
|
|
||||||
if (tc > tr)
|
if (tc > tr)
|
||||||
{
|
{
|
||||||
int t = tc;
|
int t = tc;
|
||||||
tc = tr;
|
tc = tr;
|
||||||
tr = t;
|
tr = t;
|
||||||
|
@ -101,7 +101,7 @@ lf_create_dither_matrix(
|
||||||
for (y = 0; y < r; y++)
|
for (y = 0; y < r; y++)
|
||||||
{
|
{
|
||||||
for (x= 0; x < c2; x++)
|
for (x= 0; x < c2; x++)
|
||||||
{
|
{
|
||||||
matrix[(y + r2) % r][x + c2] = matrix[y][x] * 2 -1;
|
matrix[(y + r2) % r][x + c2] = matrix[y][x] * 2 -1;
|
||||||
matrix[y][x] *= 2;
|
matrix[y][x] *= 2;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ lf_create_dither_matrix(
|
||||||
/* Swap matrix width/height if necessary */
|
/* Swap matrix width/height if necessary */
|
||||||
|
|
||||||
if (swapped)
|
if (swapped)
|
||||||
{
|
{
|
||||||
for (r = 0; r < tr; r++)
|
for (r = 0; r < tr; r++)
|
||||||
{
|
{
|
||||||
for (c = 0; c < r; c++)
|
for (c = 0; c < r; c++)
|
||||||
|
@ -142,7 +142,7 @@ lf_calculate_dither_table(
|
||||||
unsigned long pixel_values[256])
|
unsigned long pixel_values[256])
|
||||||
{
|
{
|
||||||
int i, c, j;
|
int i, c, j;
|
||||||
double brightness_factor = 255.0 /
|
double brightness_factor = 255.0 /
|
||||||
(brightnesses[value_count - 1] -
|
(brightnesses[value_count - 1] -
|
||||||
brightnesses[0]);
|
brightnesses[0]);
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ ccf_create_true_true_conversion_table(cct_cube cube)
|
||||||
}
|
}
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For 8-bit palette input we do not need to convert to true-color
|
* For 8-bit palette input we do not need to convert to true-color
|
||||||
* one component at a time. We can do it in one lookup. This generates
|
* one component at a time. We can do it in one lookup. This generates
|
||||||
|
@ -526,7 +526,7 @@ ccf_gray_to_gray_dither_convert(
|
||||||
|
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we are converting 8-bit palette to grayscale, we do not
|
* If we are converting 8-bit palette to grayscale, we do not
|
||||||
* need to convert every pixel to gray, we can simply integrate
|
* need to convert every pixel to gray, we can simply integrate
|
||||||
|
@ -559,4 +559,3 @@ ccf_gray_to_gray_conversion_convert(
|
||||||
|
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ typedef struct ccs_8_8_dither_table *cct_8_8_dither_table;
|
||||||
typedef struct ccs_8_true_conversion_table *cct_8_true_conversion_table;
|
typedef struct ccs_8_true_conversion_table *cct_8_true_conversion_table;
|
||||||
typedef struct ccs_true_true_conversion_table *cct_true_true_conversion_table;
|
typedef struct ccs_true_true_conversion_table *cct_true_true_conversion_table;
|
||||||
|
|
||||||
union ccu_dither_table
|
union ccu_dither_table
|
||||||
{
|
{
|
||||||
void *generic_dither_table;
|
void *generic_dither_table;
|
||||||
cct_true_8_dither_table true_8_dither;
|
cct_true_8_dither_table true_8_dither;
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_4_no_mapping(
|
lf_color_dither_line_24_4_no_mapping(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -89,7 +89,7 @@ lf_color_dither_line_24_4_no_mapping(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_4_mapping(
|
lf_color_dither_line_24_4_mapping(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -125,7 +125,7 @@ lf_color_dither_line_24_4_mapping(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_4(
|
lf_color_dither_line_24_4(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -139,7 +139,7 @@ lf_color_dither_line_24_4(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_8_no_mapping(
|
lf_color_dither_line_24_8_no_mapping(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -157,7 +157,7 @@ lf_color_dither_line_24_8_no_mapping(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_8_mapping(
|
lf_color_dither_line_24_8_mapping(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -177,7 +177,7 @@ lf_color_dither_line_24_8_mapping(
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_8(
|
lf_color_dither_line_24_8(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned char *output,
|
unsigned char *output,
|
||||||
|
@ -195,7 +195,7 @@ lf_color_dither_line_24_8(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_color_dither_line_24_16(
|
lf_color_dither_line_24_16(
|
||||||
cct_true_8_dither_table table,
|
cct_true_8_dither_table table,
|
||||||
unsigned char *input,
|
unsigned char *input,
|
||||||
unsigned short *output,
|
unsigned short *output,
|
||||||
|
@ -1037,4 +1037,3 @@ ddf_gray_convert_line_24(
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
|
|
28
image/gif.c
28
image/gif.c
|
@ -187,10 +187,10 @@ gifState *gs;
|
||||||
gs->prefix[i] = NULL_CODE;
|
gs->prefix[i] = NULL_CODE;
|
||||||
gs->extnsn[i] = i;
|
gs->extnsn[i] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize pixel stack */
|
/* initialize pixel stack */
|
||||||
gs->pstk_idx = 0;
|
gs->pstk_idx = 0;
|
||||||
|
|
||||||
gs->state = GS_MAKE_IMAGE;
|
gs->state = GS_MAKE_IMAGE;
|
||||||
|
|
||||||
return(GS_SUCCESS);
|
return(GS_SUCCESS);
|
||||||
|
@ -219,7 +219,7 @@ gifState *gs;
|
||||||
gs->pos = pos;
|
gs->pos = pos;
|
||||||
return(GS_NEED_DATA);
|
return(GS_NEED_DATA);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*b == 0xf9)
|
if (*b == 0xf9)
|
||||||
{
|
{
|
||||||
if ((rval = gs_read_data_block(gs)) != GS_SUCCESS)
|
if ((rval = gs_read_data_block(gs)) != GS_SUCCESS)
|
||||||
|
@ -312,7 +312,7 @@ gifState *gs;
|
||||||
|
|
||||||
return(GS_SUCCESS);
|
return(GS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gs_load_g_cmap
|
* gs_load_g_cmap
|
||||||
*
|
*
|
||||||
|
@ -325,7 +325,7 @@ gifState *gs;
|
||||||
byte *b;
|
byte *b;
|
||||||
|
|
||||||
if (gs_read(gs, &b, 3) != 3) return(GS_NEED_DATA);
|
if (gs_read(gs, &b, 3) != 3) return(GS_NEED_DATA);
|
||||||
|
|
||||||
gs->g_cmap[GIF_RED][gs->g_ncolors_pos] = b[GIF_RED] << 8;
|
gs->g_cmap[GIF_RED][gs->g_ncolors_pos] = b[GIF_RED] << 8;
|
||||||
gs->g_cmap[GIF_GRN][gs->g_ncolors_pos] = b[GIF_GRN] << 8;
|
gs->g_cmap[GIF_GRN][gs->g_ncolors_pos] = b[GIF_GRN] << 8;
|
||||||
gs->g_cmap[GIF_BLU][gs->g_ncolors_pos] = b[GIF_BLU] << 8;
|
gs->g_cmap[GIF_BLU][gs->g_ncolors_pos] = b[GIF_BLU] << 8;
|
||||||
|
@ -335,7 +335,7 @@ gifState *gs;
|
||||||
|
|
||||||
return(GS_SUCCESS);
|
return(GS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gs_read_data_block
|
* gs_read_data_block
|
||||||
*
|
*
|
||||||
|
@ -394,7 +394,7 @@ gifState *gs;
|
||||||
|
|
||||||
image->rgb.red = gs->g_cmap[GIF_RED];
|
image->rgb.red = gs->g_cmap[GIF_RED];
|
||||||
image->rgb.green = gs->g_cmap[GIF_GRN];
|
image->rgb.green = gs->g_cmap[GIF_GRN];
|
||||||
image->rgb.blue = gs->g_cmap[GIF_BLU];
|
image->rgb.blue = gs->g_cmap[GIF_BLU];
|
||||||
image->rgb.used = gs->g_ncolors;
|
image->rgb.used = gs->g_ncolors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -446,16 +446,16 @@ int *pel;
|
||||||
return(rval);
|
return(rval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gs->work_data |= ((unsigned) gs->buf[gs->buf_idx++]) << gs->work_bits;
|
gs->work_data |= ((unsigned) gs->buf[gs->buf_idx++]) << gs->work_bits;
|
||||||
gs->work_bits += 8;
|
gs->work_bits += 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the next code */
|
/* get the next code */
|
||||||
code = gs->work_data & gs->code_mask;
|
code = gs->work_data & gs->code_mask;
|
||||||
gs->work_data >>= gs->code_size;
|
gs->work_data >>= gs->code_size;
|
||||||
gs->work_bits -= gs->code_size;
|
gs->work_bits -= gs->code_size;
|
||||||
|
|
||||||
/* interpret the code */
|
/* interpret the code */
|
||||||
if (code > gs->table_size || code == gs->eoi_code)
|
if (code > gs->table_size || code == gs->eoi_code)
|
||||||
{
|
{
|
||||||
|
@ -720,21 +720,17 @@ void *closure;
|
||||||
struct ifs_vector *if_vector;
|
struct ifs_vector *if_vector;
|
||||||
{
|
{
|
||||||
gifState *gs;
|
gifState *gs;
|
||||||
|
|
||||||
gs = (gifState *)alloc_mem(sizeof(gifState));
|
gs = (gifState *)alloc_mem(sizeof(gifState));
|
||||||
memset(gs, 0, sizeof(gifState));
|
memset(gs, 0, sizeof(gifState));
|
||||||
gs->state = GS_READ_SIG;
|
gs->state = GS_READ_SIG;
|
||||||
gs->transparent = -1;
|
gs->transparent = -1;
|
||||||
gs->lineProc = lineProc;
|
gs->lineProc = lineProc;
|
||||||
gs->closure = closure;
|
gs->closure = closure;
|
||||||
|
|
||||||
if_vector->image_format_closure = (void *)gs;
|
if_vector->image_format_closure = (void *)gs;
|
||||||
if_vector->initProc = &gifInit;
|
if_vector->initProc = &gifInit;
|
||||||
if_vector->destroyProc = &gifDestroy;
|
if_vector->destroyProc = &gifDestroy;
|
||||||
if_vector->addDataProc = &gifAddData;
|
if_vector->addDataProc = &gifAddData;
|
||||||
if_vector->getImageProc = &gifGetImage;
|
if_vector->getImageProc = &gifGetImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ typedef struct _gif_state
|
||||||
#define GS_ERR_NOMEM -11 /* allocation failure */
|
#define GS_ERR_NOMEM -11 /* allocation failure */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* colormap indices
|
* colormap indices
|
||||||
*/
|
*/
|
||||||
#define GIF_RED 0
|
#define GIF_RED 0
|
||||||
#define GIF_GRN 1
|
#define GIF_GRN 1
|
||||||
|
@ -141,5 +141,3 @@ typedef struct _gif_state
|
||||||
#define GS_INIT_DECODER 8
|
#define GS_INIT_DECODER 8
|
||||||
#define GS_READ_SIG 9
|
#define GS_READ_SIG 9
|
||||||
#define GS_READ_IMAGE_HEADER 10
|
#define GS_READ_IMAGE_HEADER 10
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ typedef void (*lt_expansion_fn) _ArgProto((byte *, byte *,
|
||||||
Intensity, Intensity,
|
Intensity, Intensity,
|
||||||
Intensity));
|
Intensity));
|
||||||
|
|
||||||
#define IMAGE_GIF 0
|
#define IMAGE_GIF 0
|
||||||
#define IMAGE_XBM 1
|
#define IMAGE_XBM 1
|
||||||
#define IMAGE_JPEG 2
|
#define IMAGE_JPEG 2
|
||||||
#define IMAGE_PNG 3
|
#define IMAGE_PNG 3
|
||||||
|
@ -216,7 +216,7 @@ ImageState *is;
|
||||||
Intensity intensities[3];
|
Intensity intensities[3];
|
||||||
|
|
||||||
is->expanded_type = image->type;
|
is->expanded_type = image->type;
|
||||||
|
|
||||||
if(image->type == IBITMAP)
|
if(image->type == IBITMAP)
|
||||||
{
|
{
|
||||||
is->bg = is->bgcolor.pixel;
|
is->bg = is->bgcolor.pixel;
|
||||||
|
@ -462,7 +462,7 @@ ImageState *is;
|
||||||
{
|
{
|
||||||
maps[0][image->transparent] = is->bgcolor.red >> 8;
|
maps[0][image->transparent] = is->bgcolor.red >> 8;
|
||||||
maps[1][image->transparent] = is->bgcolor.green >> 8;
|
maps[1][image->transparent] = is->bgcolor.green >> 8;
|
||||||
maps[2][image->transparent] = is->bgcolor.blue >> 8;
|
maps[2][image->transparent] = is->bgcolor.blue >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -574,7 +574,7 @@ ImageState *is;
|
||||||
is->fg = ic->grayscale->u.grayscale.pixel_values[1];
|
is->fg = ic->grayscale->u.grayscale.pixel_values[1];
|
||||||
is->bg = ic->grayscale->u.grayscale.pixel_values[0];
|
is->bg = ic->grayscale->u.grayscale.pixel_values[0];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
is->fg = ic->grayscale->u.grayscale.pixel_values[0];
|
is->fg = ic->grayscale->u.grayscale.pixel_values[0];
|
||||||
is->bg = ic->grayscale->u.grayscale.pixel_values[1];
|
is->bg = ic->grayscale->u.grayscale.pixel_values[1];
|
||||||
|
@ -618,7 +618,7 @@ ImageState *is;
|
||||||
* True-color-to-grayscale type situtation
|
* True-color-to-grayscale type situtation
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < TCOUNT; i++)
|
for (i = 0; i < TCOUNT; i++)
|
||||||
is->dither_table[i].true_8_dither =
|
is->dither_table[i].true_8_dither =
|
||||||
ic->gray_tables[i].true_8_dither;
|
ic->gray_tables[i].true_8_dither;
|
||||||
is->free_dither_table = 0; /* don't free it its a copied pointer!! */
|
is->free_dither_table = 0; /* don't free it its a copied pointer!! */
|
||||||
is->dither_function = &ddf_gray_dither_line_24;
|
is->dither_function = &ddf_gray_dither_line_24;
|
||||||
|
@ -640,7 +640,7 @@ ImageState *is;
|
||||||
maps[1][image->transparent] = is->bgcolor.green >> 8;
|
maps[1][image->transparent] = is->bgcolor.green >> 8;
|
||||||
maps[2][image->transparent] = is->bgcolor.blue >> 8;
|
maps[2][image->transparent] = is->bgcolor.blue >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ic->gray_tables[0].eight_true_conversion)
|
if (!ic->gray_tables[0].eight_true_conversion)
|
||||||
ic->gray_tables[0].eight_true_conversion =
|
ic->gray_tables[0].eight_true_conversion =
|
||||||
ccf_create_gray_conversion_table(ic->grayscale);
|
ccf_create_gray_conversion_table(ic->grayscale);
|
||||||
|
@ -661,7 +661,7 @@ ImageState *is;
|
||||||
for (i = 0; i < TCOUNT; i++)
|
for (i = 0; i < TCOUNT; i++)
|
||||||
is->dither_table[i].eight_true_conversion =
|
is->dither_table[i].eight_true_conversion =
|
||||||
ccf_gray_to_gray_conversion_convert(ic->gray_tables[0].
|
ccf_gray_to_gray_conversion_convert(ic->gray_tables[0].
|
||||||
eight_true_conversion,
|
eight_true_conversion,
|
||||||
image->rgb.used,
|
image->rgb.used,
|
||||||
maps);
|
maps);
|
||||||
is->free_dither_table = TCOUNT;
|
is->free_dither_table = TCOUNT;
|
||||||
|
@ -682,7 +682,7 @@ ImageState *is;
|
||||||
is->dithering = true;
|
is->dithering = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maps[0] = maps[1] = maps[2] = 0;
|
maps[0] = maps[1] = maps[2] = 0;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -848,7 +848,7 @@ int lline;
|
||||||
|
|
||||||
if (image->pixlen == 1) depth = 1;
|
if (image->pixlen == 1) depth = 1;
|
||||||
else depth = is->depth;
|
else depth = is->depth;
|
||||||
|
|
||||||
if(image->depth == 1)
|
if(image->depth == 1)
|
||||||
{
|
{
|
||||||
lf_set_up_bitmap(is);
|
lf_set_up_bitmap(is);
|
||||||
|
@ -878,19 +878,19 @@ int lline;
|
||||||
xccf_allocate_grays(is->dpy, is->cmap, is->v, is->depth);
|
xccf_allocate_grays(is->dpy, is->cmap, is->v, is->depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
is->xi = XCreateImage(is->dpy, is->v,
|
is->xi = XCreateImage(is->dpy, is->v,
|
||||||
depth,
|
depth,
|
||||||
depth == 1 ? XYBitmap : ZPixmap,
|
depth == 1 ? XYBitmap : ZPixmap,
|
||||||
0, NULL,
|
0, NULL,
|
||||||
image->width, image->height,
|
image->width, image->height,
|
||||||
32, 0);
|
32, 0);
|
||||||
|
|
||||||
/* Make sure we have plenty of padding at the end of each line */
|
/* Make sure we have plenty of padding at the end of each line */
|
||||||
is->xi->bytes_per_line += 16;
|
is->xi->bytes_per_line += 16;
|
||||||
is->xi->data = (char *)MPCGet(is->mp,
|
is->xi->data = (char *)MPCGet(is->mp,
|
||||||
image->height * is->xi->bytes_per_line);
|
image->height * is->xi->bytes_per_line);
|
||||||
|
|
||||||
#ifdef CHIMERA_LITTLE_ENDIAN
|
#ifdef CHIMERA_LITTLE_ENDIAN
|
||||||
is->xi->byte_order = is->xi->bitmap_bit_order = LSBFirst;
|
is->xi->byte_order = is->xi->bitmap_bit_order = LSBFirst;
|
||||||
#else
|
#else
|
||||||
|
@ -958,7 +958,7 @@ int lline;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Paint line
|
* Paint line
|
||||||
*/
|
*/
|
||||||
|
@ -990,7 +990,7 @@ Display *dpy;
|
||||||
ic->icount = 0;
|
ic->icount = 0;
|
||||||
ic->init = True;
|
ic->init = True;
|
||||||
ic->gc = XCreateGC(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, NULL);
|
ic->gc = XCreateGC(dpy, RootWindow(dpy, DefaultScreen(dpy)), 0, NULL);
|
||||||
|
|
||||||
if (getenv("CHIMERA_MAX_SPECIAL_COLORS"))
|
if (getenv("CHIMERA_MAX_SPECIAL_COLORS"))
|
||||||
{
|
{
|
||||||
ic->special_max = atoi(getenv("CHIMERA_MAX_SPECIAL_COLORS"));
|
ic->special_max = atoi(getenv("CHIMERA_MAX_SPECIAL_COLORS"));
|
||||||
|
@ -1132,7 +1132,7 @@ void *closure;
|
||||||
is->if_vector.addDataProc(is->if_vector.image_format_closure,
|
is->if_vector.addDataProc(is->if_vector.image_format_closure,
|
||||||
data, len, false);
|
data, len, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
* look in the compiler manual. Try to find a symbol that identifies the
|
* look in the compiler manual. Try to find a symbol that identifies the
|
||||||
* processor, rather than the OS or compiler. If you have gcc on a Unix
|
* processor, rather than the OS or compiler. If you have gcc on a Unix
|
||||||
* system, the following will tell you what symbols it defines:
|
* system, the following will tell you what symbols it defines:
|
||||||
*
|
*
|
||||||
* ln -s /dev/null null.c
|
* ln -s /dev/null null.c
|
||||||
* gcc -ansi -dM -E null.c
|
* gcc -ansi -dM -E null.c
|
||||||
*
|
*
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -314,16 +314,16 @@ lf_read_image(jpegState *jpeg)
|
||||||
scanline_pointers[i] = output_addr;
|
scanline_pointers[i] = output_addr;
|
||||||
output_addr += jpeg->image->bytes_per_line;
|
output_addr += jpeg->image->bytes_per_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
scanline_count =
|
scanline_count =
|
||||||
jpeg_read_scanlines(&jpeg->cinfo, scanline_pointers, max_scanlines);
|
jpeg_read_scanlines(&jpeg->cinfo, scanline_pointers, max_scanlines);
|
||||||
|
|
||||||
if (scanline_count == 0) return CH_JPEG_NEED_DATA;
|
if (scanline_count == 0) return CH_JPEG_NEED_DATA;
|
||||||
|
|
||||||
if (jpeg->lineProc != NULL)
|
if (jpeg->lineProc != NULL)
|
||||||
(jpeg->lineProc)(jpeg->lineClosure, jpeg->ypos,
|
(jpeg->lineProc)(jpeg->lineClosure, jpeg->ypos,
|
||||||
jpeg->ypos + scanline_count - 1);
|
jpeg->ypos + scanline_count - 1);
|
||||||
|
|
||||||
jpeg->ypos += scanline_count;
|
jpeg->ypos += scanline_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -416,7 +416,7 @@ bool data_ended;
|
||||||
/* Update libjpeg's input pointers */
|
/* Update libjpeg's input pointers */
|
||||||
jpeg->input_state.pub.next_input_byte =
|
jpeg->input_state.pub.next_input_byte =
|
||||||
((JOCTET*) data) + jpeg->input_state.bytes_consumed;
|
((JOCTET*) data) + jpeg->input_state.bytes_consumed;
|
||||||
jpeg->input_state.pub.bytes_in_buffer =
|
jpeg->input_state.pub.bytes_in_buffer =
|
||||||
len - jpeg->input_state.bytes_consumed;
|
len - jpeg->input_state.bytes_consumed;
|
||||||
jpeg->input_state.faked_eoi = false; /* next_input_byte is valid */
|
jpeg->input_state.faked_eoi = false; /* next_input_byte is valid */
|
||||||
if (data_ended)
|
if (data_ended)
|
||||||
|
|
22
image/new.c
22
image/new.c
|
@ -76,19 +76,19 @@ unsigned int width, height, depth;
|
||||||
Image *image;
|
Image *image;
|
||||||
unsigned int pixlen;
|
unsigned int pixlen;
|
||||||
unsigned long datasize;
|
unsigned long datasize;
|
||||||
|
|
||||||
if(depth == 1)
|
if(depth == 1)
|
||||||
{
|
{
|
||||||
image = newBitImage(width, height);
|
image = newBitImage(width, height);
|
||||||
image->type = IRGB;
|
image->type = IRGB;
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
pixlen = ((depth - 1) / CHAR_BITS) + 1;
|
pixlen = ((depth - 1) / CHAR_BITS) + 1;
|
||||||
pixlen *= CHAR_BITS;
|
pixlen *= CHAR_BITS;
|
||||||
|
|
||||||
if (pixlen == 0) pixlen = 1;
|
if (pixlen == 0) pixlen = 1;
|
||||||
|
|
||||||
image = (Image *)alloc_mem(sizeof(Image));
|
image = (Image *)alloc_mem(sizeof(Image));
|
||||||
if (!image) return((Image *)0);
|
if (!image) return((Image *)0);
|
||||||
|
|
||||||
|
@ -113,13 +113,13 @@ unsigned int width, height, depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(image->data, 0, datasize);
|
memset(image->data, 0, datasize);
|
||||||
|
|
||||||
image->rgb.used = 0;
|
image->rgb.used = 0;
|
||||||
image->rgb.compressed = 0;
|
image->rgb.compressed = 0;
|
||||||
image->rgb.size = 2;
|
image->rgb.size = 2;
|
||||||
|
|
||||||
image->transparent = -1;
|
image->transparent = -1;
|
||||||
|
|
||||||
return(image);
|
return(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ unsigned int width, height;
|
||||||
{
|
{
|
||||||
Image *image;
|
Image *image;
|
||||||
unsigned long datasize;
|
unsigned long datasize;
|
||||||
|
|
||||||
image = (Image *)alloc_mem(sizeof(Image));
|
image = (Image *)alloc_mem(sizeof(Image));
|
||||||
if (!image) return((Image *) 0);
|
if (!image) return((Image *) 0);
|
||||||
|
|
||||||
|
@ -154,13 +154,13 @@ unsigned int width, height;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(image->data, 0, datasize);
|
memset(image->data, 0, datasize);
|
||||||
|
|
||||||
image->rgb.used = 0;
|
image->rgb.used = 0;
|
||||||
image->rgb.compressed = 0;
|
image->rgb.compressed = 0;
|
||||||
image->rgb.size = 2;
|
image->rgb.size = 2;
|
||||||
|
|
||||||
image->transparent = -1;
|
image->transparent = -1;
|
||||||
|
|
||||||
return(image);
|
return(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
image/png.c
14
image/png.c
|
@ -60,18 +60,18 @@ lf_info_callback(png_struct *state, png_info *info)
|
||||||
int orig_depth = 0;
|
int orig_depth = 0;
|
||||||
pngState *png = (pngState *) png_get_progressive_ptr(state);
|
pngState *png = (pngState *) png_get_progressive_ptr(state);
|
||||||
|
|
||||||
png_byte bit_depth = png_get_bit_depth(state, info),
|
png_byte bit_depth = png_get_bit_depth(state, info),
|
||||||
color_type = png_get_color_type(state, info);
|
color_type = png_get_color_type(state, info);
|
||||||
png_uint_32 width = png_get_image_width(state, info),
|
png_uint_32 width = png_get_image_width(state, info),
|
||||||
height = png_get_image_height(state, info),
|
height = png_get_image_height(state, info),
|
||||||
valid_tRNS = png_get_valid(state, info, PNG_INFO_tRNS),
|
valid_tRNS = png_get_valid(state, info, PNG_INFO_tRNS),
|
||||||
valid_gAMA = png_get_valid(state, info, PNG_INFO_gAMA);
|
valid_gAMA = png_get_valid(state, info, PNG_INFO_gAMA);
|
||||||
png_colorp palette;
|
png_colorp palette;
|
||||||
png_color_16p trans_values;
|
png_color_16p trans_values;
|
||||||
png_bytep trans;
|
png_bytep trans;
|
||||||
int num_palette, num_trans;
|
int num_palette, num_trans;
|
||||||
double gamma;
|
double gamma;
|
||||||
|
|
||||||
png_get_PLTE(state, info, &palette, &num_palette);
|
png_get_PLTE(state, info, &palette, &num_palette);
|
||||||
png_get_tRNS(state, info, &trans, &num_trans, &trans_values);
|
png_get_tRNS(state, info, &trans, &num_trans, &trans_values);
|
||||||
png_get_gAMA(state, info, &gamma);
|
png_get_gAMA(state, info, &gamma);
|
||||||
|
@ -100,7 +100,7 @@ lf_info_callback(png_struct *state, png_info *info)
|
||||||
orig_depth = bit_depth;
|
orig_depth = bit_depth;
|
||||||
png_set_packing(state);
|
png_set_packing(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tell libpng to strip 16 bit depth files down to 8 bits */
|
/* tell libpng to strip 16 bit depth files down to 8 bits */
|
||||||
if (bit_depth > 8)
|
if (bit_depth > 8)
|
||||||
png_set_strip_16(state);
|
png_set_strip_16(state);
|
||||||
|
|
15
image/pnm.c
15
image/pnm.c
|
@ -149,9 +149,9 @@ lf_skip_whitespace(
|
||||||
{
|
{
|
||||||
while(pnm->pos < len)
|
while(pnm->pos < len)
|
||||||
{
|
{
|
||||||
while(data[pnm->pos] == ' ' ||
|
while(data[pnm->pos] == ' ' ||
|
||||||
data[pnm->pos] == '\n' ||
|
data[pnm->pos] == '\n' ||
|
||||||
data[pnm->pos] == '\r' ||
|
data[pnm->pos] == '\r' ||
|
||||||
data[pnm->pos] == '\t')
|
data[pnm->pos] == '\t')
|
||||||
{
|
{
|
||||||
if(pnm->pos && data[pnm->pos] == '\r' && data[pnm->pos-1] != '\n')
|
if(pnm->pos && data[pnm->pos] == '\r' && data[pnm->pos-1] != '\n')
|
||||||
|
@ -354,7 +354,7 @@ lf_read_raw(
|
||||||
byte *imagepos = pnm->imagepos;
|
byte *imagepos = pnm->imagepos;
|
||||||
byte *sourcepos = data + pnm->pos;
|
byte *sourcepos = data + pnm->pos;
|
||||||
byte *table = pnm->input_table;
|
byte *table = pnm->input_table;
|
||||||
|
|
||||||
if(table) for(i = bytes_per_line; i; i--)
|
if(table) for(i = bytes_per_line; i; i--)
|
||||||
{
|
{
|
||||||
*imagepos++ = table[*sourcepos++];
|
*imagepos++ = table[*sourcepos++];
|
||||||
|
@ -365,7 +365,7 @@ lf_read_raw(
|
||||||
imagepos += bytes_per_line;
|
imagepos += bytes_per_line;
|
||||||
sourcepos += bytes_per_line;
|
sourcepos += bytes_per_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
pnm->imagepos += pnm->image->bytes_per_line;
|
pnm->imagepos += pnm->image->bytes_per_line;
|
||||||
pnm->pos += bytes_per_line;
|
pnm->pos += bytes_per_line;
|
||||||
if(pnm->lineProc) pnm->lineProc(pnm->closure, pnm->ypos, pnm->ypos);
|
if(pnm->lineProc) pnm->lineProc(pnm->closure, pnm->ypos, pnm->ypos);
|
||||||
|
@ -385,7 +385,7 @@ lf_read_asc(
|
||||||
int bytes_per_line = pnm->image->width * pnm->image->pixlen;
|
int bytes_per_line = pnm->image->width * pnm->image->pixlen;
|
||||||
bytes_per_line += CHAR_BITS - 1;
|
bytes_per_line += CHAR_BITS - 1;
|
||||||
bytes_per_line /= CHAR_BITS;
|
bytes_per_line /= CHAR_BITS;
|
||||||
|
|
||||||
while(pnm->ypos < pnm->image->height)
|
while(pnm->ypos < pnm->image->height)
|
||||||
{
|
{
|
||||||
if(lf_skip_whitespace(pnm, data, len) == PNM_NEED_DATA)
|
if(lf_skip_whitespace(pnm, data, len) == PNM_NEED_DATA)
|
||||||
|
@ -552,7 +552,7 @@ void *closure;
|
||||||
struct ifs_vector *if_vector;
|
struct ifs_vector *if_vector;
|
||||||
{
|
{
|
||||||
pnmState *pnm;
|
pnmState *pnm;
|
||||||
|
|
||||||
pnm = (pnmState *)alloc_mem(sizeof(pnmState));
|
pnm = (pnmState *)alloc_mem(sizeof(pnmState));
|
||||||
memset(pnm, 0, sizeof(pnmState));
|
memset(pnm, 0, sizeof(pnmState));
|
||||||
pnm->state = PNM_READ_MAGIC;
|
pnm->state = PNM_READ_MAGIC;
|
||||||
|
@ -565,4 +565,3 @@ struct ifs_vector *if_vector;
|
||||||
if_vector->addDataProc = &pnmAddData;
|
if_vector->addDataProc = &pnmAddData;
|
||||||
if_vector->getImageProc = &pnmGetImage;
|
if_vector->getImageProc = &pnmGetImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,7 @@ lf_read_header(
|
||||||
|
|
||||||
static void
|
static void
|
||||||
lf_wrap_x(xbmState *xbm)
|
lf_wrap_x(xbmState *xbm)
|
||||||
{
|
{
|
||||||
if(xbm->xpos >= xbm->image->width)
|
if(xbm->xpos >= xbm->image->width)
|
||||||
{
|
{
|
||||||
if (xbm->lineProc != NULL)
|
if (xbm->lineProc != NULL)
|
||||||
|
@ -363,7 +363,7 @@ void *closure;
|
||||||
struct ifs_vector *if_vector;
|
struct ifs_vector *if_vector;
|
||||||
{
|
{
|
||||||
xbmState *xbm;
|
xbmState *xbm;
|
||||||
|
|
||||||
xbm = (xbmState *)alloc_mem(sizeof(xbmState));
|
xbm = (xbmState *)alloc_mem(sizeof(xbmState));
|
||||||
memset(xbm, 0, sizeof(xbmState));
|
memset(xbm, 0, sizeof(xbmState));
|
||||||
xbm->state = XBM_READ_HEADER;
|
xbm->state = XBM_READ_HEADER;
|
||||||
|
|
|
@ -425,7 +425,7 @@ xccf_color_compare(
|
||||||
int r2,
|
int r2,
|
||||||
int g2,
|
int g2,
|
||||||
int b2)
|
int b2)
|
||||||
{
|
{
|
||||||
if(lf_abs(r1 - r2) > 6) return false;
|
if(lf_abs(r1 - r2) > 6) return false;
|
||||||
if(lf_abs(g1 - g2) > 3) return false;
|
if(lf_abs(g1 - g2) > 3) return false;
|
||||||
if(lf_abs(b1 - b2) > 6) return false;
|
if(lf_abs(b1 - b2) > 6) return false;
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
@ -59,7 +59,7 @@ SOFTWARE.
|
||||||
#include <X11/Xmu/Misc.h>
|
#include <X11/Xmu/Misc.h>
|
||||||
|
|
||||||
#include <X11/Xaw/XawInit.h>
|
#include <X11/Xaw/XawInit.h>
|
||||||
#include <X11/Xaw/Command.h>
|
#include <X11/Xaw/Command.h>
|
||||||
#include <X11/Xaw/Label.h>
|
#include <X11/Xaw/Label.h>
|
||||||
#include <X11/Xaw/Cardinals.h>
|
#include <X11/Xaw/Cardinals.h>
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ static XtResource resources[] = {
|
||||||
XtOffsetOf(AuthDialogRec, authdialog.username), XtRString, NULL },
|
XtOffsetOf(AuthDialogRec, authdialog.username), XtRString, NULL },
|
||||||
{ XtNicon, XtCIcon, XtRBitmap, sizeof(Pixmap),
|
{ XtNicon, XtCIcon, XtRBitmap, sizeof(Pixmap),
|
||||||
XtOffsetOf(AuthDialogRec, authdialog.icon), XtRImmediate, 0 },
|
XtOffsetOf(AuthDialogRec, authdialog.icon), XtRImmediate, 0 },
|
||||||
{ XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
|
{ XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
|
||||||
XtOffsetOf(AuthDialogRec, authdialog.callbacks),XtRCallback, NULL },
|
XtOffsetOf(AuthDialogRec, authdialog.callbacks),XtRCallback, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -314,7 +314,7 @@ static void
|
||||||
CreateAuthDialogFields(w)
|
CreateAuthDialogFields(w)
|
||||||
Widget w;
|
Widget w;
|
||||||
{
|
{
|
||||||
AuthDialogWidget dw = (AuthDialogWidget) w;
|
AuthDialogWidget dw = (AuthDialogWidget) w;
|
||||||
|
|
||||||
dw->authdialog.usernameW =
|
dw->authdialog.usernameW =
|
||||||
XtVaCreateWidget("username",
|
XtVaCreateWidget("username",
|
||||||
|
@ -361,7 +361,7 @@ Widget w;
|
||||||
XtManageChild(dw->authdialog.usernameW);
|
XtManageChild(dw->authdialog.usernameW);
|
||||||
XtManageChild(dw->authdialog.passwordW);
|
XtManageChild(dw->authdialog.passwordW);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Value widget gets the keyboard focus.
|
* Value widget gets the keyboard focus.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ XtPointer param;
|
||||||
*/
|
*/
|
||||||
Widget button;
|
Widget button;
|
||||||
|
|
||||||
button = XtCreateManagedWidget( name, commandWidgetClass, authdialog,
|
button = XtCreateManagedWidget( name, commandWidgetClass, authdialog,
|
||||||
(ArgList)NULL, (Cardinal)0 );
|
(ArgList)NULL, (Cardinal)0 );
|
||||||
|
|
||||||
if (function != NULL) /* don't add NULL callback func. */
|
if (function != NULL) /* don't add NULL callback func. */
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
HEADERS = MyDialog.h MyDialogP.h TextField.h TextFieldP.h AuthDialogP.h \
|
HEADERS = MyDialog.h MyDialogP.h TextField.h TextFieldP.h AuthDialogP.h \
|
||||||
AuthDialog.h
|
AuthDialog.h
|
||||||
|
|
||||||
SRCS = MyDialog.c TextField.c AuthDialog.c
|
SRCS = MyDialog.c TextField.c AuthDialog.c
|
||||||
OBJS = MyDialog.o TextField.o AuthDialog.o
|
OBJS = MyDialog.o TextField.o AuthDialog.o
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
@ -59,7 +59,7 @@ SOFTWARE.
|
||||||
#include <X11/Xmu/Misc.h>
|
#include <X11/Xmu/Misc.h>
|
||||||
|
|
||||||
#include <X11/Xaw/XawInit.h>
|
#include <X11/Xaw/XawInit.h>
|
||||||
#include <X11/Xaw/Command.h>
|
#include <X11/Xaw/Command.h>
|
||||||
#include <X11/Xaw/Cardinals.h>
|
#include <X11/Xaw/Cardinals.h>
|
||||||
|
|
||||||
#include "TextField.h"
|
#include "TextField.h"
|
||||||
|
@ -73,7 +73,7 @@ static char defaultTranslations[] =
|
||||||
static XtResource resources[] = {
|
static XtResource resources[] = {
|
||||||
{ XtNlabel, XtCLabel, XtRString, sizeof(String),
|
{ XtNlabel, XtCLabel, XtRString, sizeof(String),
|
||||||
XtOffsetOf(MyDialogRec, mydialog.label), XtRString, NULL },
|
XtOffsetOf(MyDialogRec, mydialog.label), XtRString, NULL },
|
||||||
{XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
|
{XtNcallback, XtCCallback, XtRCallback, sizeof(XtPointer),
|
||||||
XtOffsetOf(MyDialogRec, mydialog.callbacks),XtRCallback,(XtPointer)NULL},
|
XtOffsetOf(MyDialogRec, mydialog.callbacks),XtRCallback,(XtPointer)NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -195,12 +195,12 @@ Cardinal *num_args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XtOverrideTranslations(dw->mydialog.valueW,
|
XtOverrideTranslations(dw->mydialog.valueW,
|
||||||
XtParseTranslationTable(defaultTranslations));
|
XtParseTranslationTable(defaultTranslations));
|
||||||
|
|
||||||
XtManageChild(dw->mydialog.valueW);
|
XtManageChild(dw->mydialog.valueW);
|
||||||
|
|
||||||
XtSetKeyboardFocus(new, dw->mydialog.valueW);
|
XtSetKeyboardFocus(new, dw->mydialog.valueW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -30,13 +30,13 @@ Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
|
||||||
|
|
||||||
All Rights Reserved
|
All Rights Reserved
|
||||||
|
|
||||||
Permission to use, copy, modify, and distribute this software and its
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
documentation for any purpose and without fee is hereby granted,
|
documentation for any purpose and without fee is hereby granted,
|
||||||
provided that the above copyright notice appear in all copies and that
|
provided that the above copyright notice appear in all copies and that
|
||||||
both that copyright notice and this permission notice appear in
|
both that copyright notice and this permission notice appear in
|
||||||
supporting documentation, and that the name of Digital not be
|
supporting documentation, and that the name of Digital not be
|
||||||
used in advertising or publicity pertaining to distribution of the
|
used in advertising or publicity pertaining to distribution of the
|
||||||
software without specific, written prior permission.
|
software without specific, written prior permission.
|
||||||
|
|
||||||
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
|
||||||
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
#ifndef XtIsTextField
|
#ifndef XtIsTextField
|
||||||
#define XtIsTextField(w) XtIsSubclass((Widget)w, textfieldWidgetClass)
|
#define XtIsTextField(w) XtIsSubclass((Widget)w, textfieldWidgetClass)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Athena style resource names */
|
/* Athena style resource names */
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ size_t len;
|
||||||
li->len = len;
|
li->len = len;
|
||||||
li->y = pi->height;
|
li->y = pi->height;
|
||||||
pi->height += pi->lineheight;
|
pi->height += pi->lineheight;
|
||||||
|
|
||||||
li->width = XTextWidth(pi->font, s, len);
|
li->width = XTextWidth(pi->font, s, len);
|
||||||
if (li->width > pi->width) pi->width = li->width + PLAIN_MARGIN * 2;
|
if (li->width > pi->width) pi->width = li->width + PLAIN_MARGIN * 2;
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ void *state;
|
||||||
pi->bg = GUIBackgroundPixel(wd);
|
pi->bg = GUIBackgroundPixel(wd);
|
||||||
|
|
||||||
XSetForeground(pi->dpy, pi->gc, pi->fg);
|
XSetForeground(pi->dpy, pi->gc, pi->fg);
|
||||||
|
|
||||||
GUISetScrollBar(wd, true);
|
GUISetScrollBar(wd, true);
|
||||||
if (GUIGetDimensions(wd, &width, &height) == -1)
|
if (GUIGetDimensions(wd, &width, &height) == -1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* getcwd.c --
|
* getcwd.c --
|
||||||
*
|
*
|
||||||
* This file provides an implementation of the getcwd procedure
|
* This file provides an implementation of the getcwd procedure
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
* software and its documentation for any purpose, provided that the
|
* software and its documentation for any purpose, provided that the
|
||||||
* above copyright notice and the following two paragraphs appear in
|
* above copyright notice and the following two paragraphs appear in
|
||||||
* all copies of this software.
|
* all copies of this software.
|
||||||
*
|
*
|
||||||
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
||||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
||||||
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
||||||
|
@ -62,4 +62,3 @@ getcwd(buf, size)
|
||||||
strcpy(buf, realBuffer);
|
strcpy(buf, realBuffer);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ typedef int bool;
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
#define MAX(a,b) ((a) < (b) ? (b) : (a))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MIN
|
#ifndef MIN
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -130,7 +130,7 @@ static void dopr( char *buffer, const char *format, va_list args )
|
||||||
case '%':
|
case '%':
|
||||||
ljust = len = zpad = 0;
|
ljust = len = zpad = 0;
|
||||||
precision = -1; set_precision = 0;
|
precision = -1; set_precision = 0;
|
||||||
nextch:
|
nextch:
|
||||||
ch = *format++;
|
ch = *format++;
|
||||||
switch( ch ){
|
switch( ch ){
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -267,7 +267,7 @@ fmtnum( long value, int base, int dosign, int ljust,
|
||||||
if( dosign ){
|
if( dosign ){
|
||||||
if( value < 0 ) {
|
if( value < 0 ) {
|
||||||
signvalue = '-';
|
signvalue = '-';
|
||||||
uvalue = -value;
|
uvalue = -value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( base < 0 ){
|
if( base < 0 ){
|
||||||
|
@ -350,5 +350,3 @@ static void dopr_outch( int c )
|
||||||
*output++ = c;
|
*output++ = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* strstr.c --
|
* strstr.c --
|
||||||
*
|
*
|
||||||
* Source code for the "strstr" library routine.
|
* Source code for the "strstr" library routine.
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
* software and its documentation for any purpose, provided that the
|
* software and its documentation for any purpose, provided that the
|
||||||
* above copyright notice and the following two paragraphs appear in
|
* above copyright notice and the following two paragraphs appear in
|
||||||
* all copies of this software.
|
* all copies of this software.
|
||||||
*
|
*
|
||||||
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
||||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
||||||
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* strtol.c --
|
* strtol.c --
|
||||||
*
|
*
|
||||||
* Source code for the "strtol" library procedure.
|
* Source code for the "strtol" library procedure.
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
* software and its documentation for any purpose, provided that the
|
* software and its documentation for any purpose, provided that the
|
||||||
* above copyright notice and the following two paragraphs appear in
|
* above copyright notice and the following two paragraphs appear in
|
||||||
* all copies of this software.
|
* all copies of this software.
|
||||||
*
|
*
|
||||||
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
||||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
||||||
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
* strtoul.c --
|
* strtoul.c --
|
||||||
*
|
*
|
||||||
* Source code for the "strtoul" library procedure.
|
* Source code for the "strtoul" library procedure.
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
* software and its documentation for any purpose, provided that the
|
* software and its documentation for any purpose, provided that the
|
||||||
* above copyright notice and the following two paragraphs appear in
|
* above copyright notice and the following two paragraphs appear in
|
||||||
* all copies of this software.
|
* all copies of this software.
|
||||||
*
|
*
|
||||||
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
* IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
|
||||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
|
||||||
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
* OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
|
||||||
|
@ -101,7 +101,7 @@ strtoul(string, endPtr, base)
|
||||||
* If no base was provided, pick one from the leading characters
|
* If no base was provided, pick one from the leading characters
|
||||||
* of the string.
|
* of the string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (base == 0)
|
if (base == 0)
|
||||||
{
|
{
|
||||||
if (*p == '0') {
|
if (*p == '0') {
|
||||||
|
|
|
@ -174,7 +174,7 @@ FileInfo *fi;
|
||||||
}
|
}
|
||||||
*cp++ = '\0';
|
*cp++ = '\0';
|
||||||
snprintf(f + strlen(f), flen - strlen(f),
|
snprintf(f + strlen(f), flen - strlen(f),
|
||||||
format, fi->di.dirname, sa[i], sa[i], cp);
|
format, fi->di.dirname, sa[i], sa[i], cp);
|
||||||
}
|
}
|
||||||
strcat(f, trailer1);
|
strcat(f, trailer1);
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ void *closure;
|
||||||
else strcpy(fi->mbuf, " <unknown>");
|
else strcpy(fi->mbuf, " <unknown>");
|
||||||
}
|
}
|
||||||
else strcpy(fi->mbuf, " ");
|
else strcpy(fi->mbuf, " ");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resize the file entry table if needed.
|
* Resize the file entry table if needed.
|
||||||
*/
|
*/
|
||||||
|
@ -238,7 +238,7 @@ void *closure;
|
||||||
fi->di.size *= 2;
|
fi->di.size *= 2;
|
||||||
fi->di.sa = nsa;
|
fi->di.sa = nsa;
|
||||||
}
|
}
|
||||||
|
|
||||||
salen = strlen(de->d_name) + strlen(fi->mbuf) + 2 * sizeof(char);
|
salen = strlen(de->d_name) + strlen(fi->mbuf) + 2 * sizeof(char);
|
||||||
fi->di.sa[fi->di.used] = (char *)MPGet(fi->mp, salen);
|
fi->di.sa[fi->di.used] = (char *)MPGet(fi->mp, salen);
|
||||||
strcpy(fi->di.sa[fi->di.used], de->d_name);
|
strcpy(fi->di.sa[fi->di.used], de->d_name);
|
||||||
|
@ -409,7 +409,7 @@ void *class_closure;
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
fi->di.dirname = (char *)MPGet(fi->mp, strlen(fi->filename) +
|
fi->di.dirname = (char *)MPGet(fi->mp, strlen(fi->filename) +
|
||||||
strlen("/") + sizeof(char));
|
strlen("/") + sizeof(char));
|
||||||
strcpy(fi->di.dirname, fi->filename);
|
strcpy(fi->di.dirname, fi->filename);
|
||||||
if (fi->filename[strlen(fi->filename) - 1] != '/')
|
if (fi->filename[strlen(fi->filename) - 1] != '/')
|
||||||
|
|
25
proto/ftp.c
25
proto/ftp.c
|
@ -65,7 +65,7 @@ static struct ftp_message
|
||||||
{ NULL, NULL },
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *username;
|
char *username;
|
||||||
char *password;
|
char *password;
|
||||||
|
@ -313,7 +313,7 @@ FTPData(ios, len, closure)
|
||||||
ChimeraStream ios;
|
ChimeraStream ios;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
void *closure;
|
void *closure;
|
||||||
{
|
{
|
||||||
FTPInfo *fi = (FTPInfo *)closure;
|
FTPInfo *fi = (FTPInfo *)closure;
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
|
@ -364,7 +364,7 @@ FTPDirData(ios, len, closure)
|
||||||
ChimeraStream ios;
|
ChimeraStream ios;
|
||||||
ssize_t len;
|
ssize_t len;
|
||||||
void *closure;
|
void *closure;
|
||||||
{
|
{
|
||||||
FTPInfo *fi = (FTPInfo *)closure;
|
FTPInfo *fi = (FTPInfo *)closure;
|
||||||
|
|
||||||
if (len > 0)
|
if (len > 0)
|
||||||
|
@ -572,10 +572,10 @@ FTPInfo *fi;
|
||||||
/* error */
|
/* error */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (dhost, sizeof(dhost), "%d.%d.%d.%d", h0, h1, h2, h3);
|
snprintf (dhost, sizeof(dhost), "%d.%d.%d.%d", h0, h1, h2, h3);
|
||||||
dport = (p0 << 8) + p1;
|
dport = (p0 << 8) + p1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check for error here.
|
* Check for error here.
|
||||||
*/
|
*/
|
||||||
|
@ -669,7 +669,7 @@ FTPInfo *fi;
|
||||||
{
|
{
|
||||||
snprintf (fi->request, sizeof(fi->request),
|
snprintf (fi->request, sizeof(fi->request),
|
||||||
"PASS -nobody@nowhere.org\r\n");
|
"PASS -nobody@nowhere.org\r\n");
|
||||||
}
|
}
|
||||||
FTPSimple(fi, FTPType, false);
|
FTPSimple(fi, FTPType, false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -733,7 +733,7 @@ FTPInfo *fi;
|
||||||
{
|
{
|
||||||
snprintf (fi->request, sizeof(fi->request), "USER anonymous\r\n");
|
snprintf (fi->request, sizeof(fi->request), "USER anonymous\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
FTPSimple(fi, FTPPass, false);
|
FTPSimple(fi, FTPPass, false);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -771,7 +771,7 @@ void *class_closure;
|
||||||
{
|
{
|
||||||
fi->msg[i] = ftp_messages[i].def;
|
fi->msg[i] = ftp_messages[i].def;
|
||||||
}
|
}
|
||||||
if ((tlen = strlen(fi->msg[i])) > mlen) mlen = tlen;
|
if ((tlen = strlen(fi->msg[i])) > mlen) mlen = tlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf (fi->msgbuf, sizeof(fi->msgbuf),
|
snprintf (fi->msgbuf, sizeof(fi->msgbuf),
|
||||||
|
@ -836,7 +836,7 @@ MIMEHeader *mh;
|
||||||
*data = fi->db;
|
*data = fi->db;
|
||||||
*len = fi->dblen;
|
*len = fi->dblen;
|
||||||
*mh = fi->mh;
|
*mh = fi->mh;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -873,7 +873,7 @@ ChimeraResources cres;
|
||||||
ph.stop = FTPCancel;
|
ph.stop = FTPCancel;
|
||||||
ph.getdata = FTPGetData;
|
ph.getdata = FTPGetData;
|
||||||
SourceAddHooks(cres, &ph);
|
SourceAddHooks(cres, &ph);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,12 +921,12 @@ FTPInfo *fi;
|
||||||
{
|
{
|
||||||
hostname = fi->wr->up->hostname;
|
hostname = fi->wr->up->hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
filename = fi->wr->up->filename;
|
filename = fi->wr->up->filename;
|
||||||
hlen = strlen(hostname);
|
hlen = strlen(hostname);
|
||||||
flen = strlen(filename);
|
flen = strlen(filename);
|
||||||
elen = strlen(entry);
|
elen = strlen(entry);
|
||||||
|
|
||||||
sacount = 0;
|
sacount = 0;
|
||||||
for (cp = fi->db, lastcp = cp + fi->dblen; cp < lastcp; cp++)
|
for (cp = fi->db, lastcp = cp + fi->dblen; cp < lastcp; cp++)
|
||||||
{
|
{
|
||||||
|
@ -967,4 +967,3 @@ FTPInfo *fi;
|
||||||
|
|
||||||
return(f);
|
return(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
60
proto/http.c
60
proto/http.c
|
@ -77,7 +77,7 @@ static struct http_message
|
||||||
{ NULL, NULL },
|
{ NULL, NULL },
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
char *username;
|
char *username;
|
||||||
char *password;
|
char *password;
|
||||||
|
@ -132,7 +132,7 @@ typedef struct
|
||||||
size_t bsize;
|
size_t bsize;
|
||||||
size_t bmax;
|
size_t bmax;
|
||||||
size_t doff; /* offset to data beyond header */
|
size_t doff; /* offset to data beyond header */
|
||||||
MIMEHeader mh;
|
MIMEHeader mh;
|
||||||
} HTTPInfo;
|
} HTTPInfo;
|
||||||
|
|
||||||
static int uuencode _ArgProto((unsigned char *, unsigned int, char *));
|
static int uuencode _ArgProto((unsigned char *, unsigned int, char *));
|
||||||
|
@ -206,20 +206,20 @@ char *bufcoded;
|
||||||
{
|
{
|
||||||
/* ENC is the basic 1 character encoding function to make a char printing */
|
/* ENC is the basic 1 character encoding function to make a char printing */
|
||||||
#define ENC(c) six2pr[c]
|
#define ENC(c) six2pr[c]
|
||||||
|
|
||||||
register char *outptr = bufcoded;
|
register char *outptr = bufcoded;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i=0; i<nbytes; i += 3)
|
for (i=0; i<nbytes; i += 3)
|
||||||
{
|
{
|
||||||
*(outptr++) = ENC(*bufin >> 2); /* c1 */
|
*(outptr++) = ENC(*bufin >> 2); /* c1 */
|
||||||
*(outptr++) = ENC(((*bufin << 4) & 060) | ((bufin[1] >> 4) & 017)); /*c2*/
|
*(outptr++) = ENC(((*bufin << 4) & 060) | ((bufin[1] >> 4) & 017)); /*c2*/
|
||||||
*(outptr++) = ENC(((bufin[1] << 2) & 074) | ((bufin[2] >> 6) & 03));/*c3*/
|
*(outptr++) = ENC(((bufin[1] << 2) & 074) | ((bufin[2] >> 6) & 03));/*c3*/
|
||||||
*(outptr++) = ENC(bufin[2] & 077); /* c4 */
|
*(outptr++) = ENC(bufin[2] & 077); /* c4 */
|
||||||
|
|
||||||
bufin += 3;
|
bufin += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If nbytes was not a multiple of 3, then we have encoded too
|
/* If nbytes was not a multiple of 3, then we have encoded too
|
||||||
* many characters. Adjust appropriately.
|
* many characters. Adjust appropriately.
|
||||||
*/
|
*/
|
||||||
|
@ -267,7 +267,7 @@ char *password;
|
||||||
HTTPFailure(hi);
|
HTTPFailure(hi);
|
||||||
}
|
}
|
||||||
HTTPDestroyInfo(hi);
|
HTTPDestroyInfo(hi);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ ssize_t *len;
|
||||||
strlen(authfield) +
|
strlen(authfield) +
|
||||||
2 * strlen(username) + 2 * strlen(":") +
|
2 * strlen(username) + 2 * strlen(":") +
|
||||||
2 * strlen(password != NULL ? password:"") +
|
2 * strlen(password != NULL ? password:"") +
|
||||||
2 * strlen(hi->hp->type) +
|
2 * strlen(hi->hp->type) +
|
||||||
strlen("\r\n") + 1);
|
strlen("\r\n") + 1);
|
||||||
strcpy(line, username);
|
strcpy(line, username);
|
||||||
if (password != NULL)
|
if (password != NULL)
|
||||||
|
@ -413,7 +413,7 @@ ssize_t *len;
|
||||||
line = (char *)MPGet(hi->rmp, linelen);
|
line = (char *)MPGet(hi->rmp, linelen);
|
||||||
snprintf (line, linelen, uaformat, ua);
|
snprintf (line, linelen, uaformat, ua);
|
||||||
|
|
||||||
if (line != NULL) *len = strlen(line);
|
if (line != NULL) *len = strlen(line);
|
||||||
|
|
||||||
return((byte *)line);
|
return((byte *)line);
|
||||||
}
|
}
|
||||||
|
@ -469,7 +469,7 @@ ssize_t *len;
|
||||||
{
|
{
|
||||||
rlen += strlen(nr) + delimlen;
|
rlen += strlen(nr) + delimlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
line = (char *)MPGet(hi->rmp, strlen(accfield) +
|
line = (char *)MPGet(hi->rmp, strlen(accfield) +
|
||||||
rlen + strlen("\r\n") + 1);
|
rlen + strlen("\r\n") + 1);
|
||||||
strcpy(line, accfield);
|
strcpy(line, accfield);
|
||||||
|
@ -529,7 +529,7 @@ ssize_t *len;
|
||||||
{
|
{
|
||||||
linelen = strlen(getformat2) + wr->input_len + strlen(filename) +
|
linelen = strlen(getformat2) + wr->input_len + strlen(filename) +
|
||||||
strlen("?") + 1;
|
strlen("?") + 1;
|
||||||
|
|
||||||
line = (char *)MPGet(hi->rmp, linelen);
|
line = (char *)MPGet(hi->rmp, linelen);
|
||||||
snprintf (line, linelen, getformat2, filename, "?", wr->input_data);
|
snprintf (line, linelen, getformat2, filename, "?", wr->input_data);
|
||||||
}
|
}
|
||||||
|
@ -641,7 +641,7 @@ ssize_t *len;
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* HTTPBuildRequest
|
* HTTPBuildRequest
|
||||||
*
|
*
|
||||||
* This became less efficient but easier to hack, I think.
|
* This became less efficient but easier to hack, I think.
|
||||||
|
@ -752,15 +752,15 @@ void *closure;
|
||||||
HTTPInfo *hi = *hip;
|
HTTPInfo *hi = *hip;
|
||||||
long rnum;
|
long rnum;
|
||||||
char *rmsg;
|
char *rmsg;
|
||||||
|
|
||||||
if (len < 0)
|
if (len < 0)
|
||||||
{
|
{
|
||||||
HTTPFailure(hi);
|
HTTPFailure(hi);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len > 0) hi->blen += len;
|
if (len > 0) hi->blen += len;
|
||||||
|
|
||||||
if (len == 0 || ((hi->blen - hi->doff) == hi->bmax && hi->bmax > 0))
|
if (len == 0 || ((hi->blen - hi->doff) == hi->bmax && hi->bmax > 0))
|
||||||
{
|
{
|
||||||
SourceSendMessage(hi->ws, hi->hc->msg[HM_DONE]);
|
SourceSendMessage(hi->ws, hi->hc->msg[HM_DONE]);
|
||||||
|
@ -783,16 +783,16 @@ void *closure;
|
||||||
rmsg = hi->hc->msg[HM_RU];
|
rmsg = hi->hc->msg[HM_RU];
|
||||||
rnum = (long)(hi->blen - hi->doff);
|
rnum = (long)(hi->blen - hi->doff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hi->rcount++ % PRINT_RATE == 0)
|
if (hi->rcount++ % PRINT_RATE == 0)
|
||||||
{
|
{
|
||||||
snprintf (hi->msgbuf, sizeof(hi->msgbuf), "%ld %s", rnum, rmsg);
|
snprintf (hi->msgbuf, sizeof(hi->msgbuf), "%ld %s", rnum, rmsg);
|
||||||
SourceSendMessage(hi->ws, hi->msgbuf);
|
SourceSendMessage(hi->ws, hi->msgbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPRead(hip, HTTPReadData);
|
HTTPRead(hip, HTTPReadData);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,14 +836,14 @@ HTTPInfo **hip;
|
||||||
pup = up;
|
pup = up;
|
||||||
up = hi->up;
|
up = hi->up;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HTTPCreateInfo(hip, hi->ws, hi->wr, hi->hc,
|
if (HTTPCreateInfo(hip, hi->ws, hi->wr, hi->hc,
|
||||||
up, pup, hi->hp) == -1)
|
up, pup, hi->hp) == -1)
|
||||||
{
|
{
|
||||||
HTTPFailure(hi);
|
HTTPFailure(hi);
|
||||||
}
|
}
|
||||||
HTTPDestroyInfo(hi);
|
HTTPDestroyInfo(hi);
|
||||||
|
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
if (MIMEGetField(hi->mh, "content-length", &value) == 0 && value != NULL)
|
if (MIMEGetField(hi->mh, "content-length", &value) == 0 && value != NULL)
|
||||||
|
@ -869,7 +869,7 @@ HTTPInfo **hip;
|
||||||
value != NULL && hi->hp == NULL)
|
value != NULL && hi->hp == NULL)
|
||||||
{
|
{
|
||||||
cache = false;
|
cache = false;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Look for the authorization type and realm
|
* Look for the authorization type and realm
|
||||||
*/
|
*/
|
||||||
|
@ -892,7 +892,7 @@ HTTPInfo **hip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is an authorization type and realm then try to
|
* If there is an authorization type and realm then try to
|
||||||
* see if the password is already known. If not then ask the user
|
* see if the password is already known. If not then ask the user
|
||||||
|
@ -924,7 +924,7 @@ HTTPInfo **hip;
|
||||||
else username = hi->up->username;
|
else username = hi->up->username;
|
||||||
}
|
}
|
||||||
else username = "";
|
else username = "";
|
||||||
|
|
||||||
hi->wa = AuthCreate(hi->cres, "Enter password", username,
|
hi->wa = AuthCreate(hi->cres, "Enter password", username,
|
||||||
HTTPAuthCallback, hip);
|
HTTPAuthCallback, hip);
|
||||||
|
|
||||||
|
@ -938,7 +938,7 @@ HTTPInfo **hip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MIMEGetField(hi->mh, "content-type", &value) != 0 || value == NULL)
|
if (MIMEGetField(hi->mh, "content-type", &value) != 0 || value == NULL)
|
||||||
{
|
{
|
||||||
if ((value = ChimeraExt2Content(hi->cres, HTTPGetFilename(hi))) == NULL)
|
if ((value = ChimeraExt2Content(hi->cres, HTTPGetFilename(hi))) == NULL)
|
||||||
|
@ -947,15 +947,15 @@ HTTPInfo **hip;
|
||||||
}
|
}
|
||||||
MIMEAddField(hi->mh, "content-type", value);
|
MIMEAddField(hi->mh, "content-type", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hi->url != NULL) url = hi->url;
|
if (hi->url != NULL) url = hi->url;
|
||||||
else url = "unknown:/";
|
else url = "unknown:/";
|
||||||
|
|
||||||
MIMEAddField(hi->mh, "x-url", url);
|
MIMEAddField(hi->mh, "x-url", url);
|
||||||
|
|
||||||
/* Do not call this before dealing with "Location:" */
|
/* Do not call this before dealing with "Location:" */
|
||||||
SourceInit(hi->ws, cache && hi->hp == NULL);
|
SourceInit(hi->ws, cache && hi->hp == NULL);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1249,7 +1249,7 @@ void *closure;
|
||||||
StreamDestroy(hi->ios);
|
StreamDestroy(hi->ios);
|
||||||
hi->ios = NULL;
|
hi->ios = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1310,7 +1310,7 @@ ChimeraResources cres;
|
||||||
{
|
{
|
||||||
hc->msg[i] = http_messages[i].def;
|
hc->msg[i] = http_messages[i].def;
|
||||||
}
|
}
|
||||||
if ((tlen = strlen(hc->msg[i])) > hc->mlen) hc->mlen = tlen;
|
if ((tlen = strlen(hc->msg[i])) > hc->mlen) hc->mlen = tlen;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&ph, 0, sizeof(ph));
|
memset(&ph, 0, sizeof(ph));
|
||||||
|
|
|
@ -149,7 +149,7 @@ ChimeraResources cres;
|
||||||
ph.stop = MailtoCancel;
|
ph.stop = MailtoCancel;
|
||||||
ph.getdata = MailtoGetData;
|
ph.getdata = MailtoGetData;
|
||||||
SourceAddHooks(cres, &ph);
|
SourceAddHooks(cres, &ph);
|
||||||
|
|
||||||
memset(&ph, 0, sizeof(ph));
|
memset(&ph, 0, sizeof(ph));
|
||||||
ph.name = "x-mailtoaction";
|
ph.name = "x-mailtoaction";
|
||||||
ph.init = MailtoActionInit;
|
ph.init = MailtoActionInit;
|
||||||
|
@ -157,7 +157,7 @@ ChimeraResources cres;
|
||||||
ph.stop = MailtoActionCancel;
|
ph.stop = MailtoActionCancel;
|
||||||
ph.getdata = MailtoActionGetData;
|
ph.getdata = MailtoActionGetData;
|
||||||
SourceAddHooks(cres, &ph);
|
SourceAddHooks(cres, &ph);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ MIMEHeader *mh;
|
||||||
*data = mi->data;
|
*data = mi->data;
|
||||||
*len = mi->len;
|
*len = mi->len;
|
||||||
*mh = mi->mh;
|
*mh = mi->mh;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ void *closure;
|
||||||
strcat(f, "<INPUT type=submit name=SendMail value=\"Send mail\">\n");
|
strcat(f, "<INPUT type=submit name=SendMail value=\"Send mail\">\n");
|
||||||
strcat(f, "<INPUT type=submit name=Cancel value=\"Cancel\">\n");
|
strcat(f, "<INPUT type=submit name=Cancel value=\"Cancel\">\n");
|
||||||
strcat(f, "</FORM>\n</BODY>\n</HTML>\n");
|
strcat(f, "</FORM>\n</BODY>\n</HTML>\n");
|
||||||
|
|
||||||
mi->data = (byte *)f;
|
mi->data = (byte *)f;
|
||||||
mi->len = strlen(f);
|
mi->len = strlen(f);
|
||||||
SourceInit(mi->ws, false);
|
SourceInit(mi->ws, false);
|
||||||
|
@ -401,7 +401,7 @@ char *data;
|
||||||
{
|
{
|
||||||
mp = MPCreate();
|
mp = MPCreate();
|
||||||
mh = MailHeaders;
|
mh = MailHeaders;
|
||||||
|
|
||||||
for(mh = MailHeaders; mh->name != NULL; mh++)
|
for(mh = MailHeaders; mh->name != NULL; mh++)
|
||||||
{
|
{
|
||||||
p = strstr(data, mh->name) + strlen(mh->name) + 1;
|
p = strstr(data, mh->name) + strlen(mh->name) + 1;
|
||||||
|
@ -499,6 +499,6 @@ MIMEHeader *mh;
|
||||||
*data = mi->data;
|
*data = mi->data;
|
||||||
*len = mi->len;
|
*len = mi->len;
|
||||||
*mh = mi->mh;
|
*mh = mi->mh;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue