This commit is contained in:
purplerain 2024-10-06 22:33:21 +00:00
parent ac06c97e30
commit f3c6f98243
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
19 changed files with 118 additions and 114 deletions

View file

@ -25,7 +25,7 @@ build:
build: build:
umask ${WOBJUMASK}; exec ${MAKE} do-build umask ${WOBJUMASK}; exec ${MAKE} do-build
do-build: do-build:
@if [[ `id -u` -ne 0 ]]; then \ @if [[ `id -u` -ne 0 ]]; then \
echo $@ must be called by root >&2; \ echo $@ must be called by root >&2; \
false; \ false; \

View file

@ -1,6 +1,6 @@
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that # documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that # the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@
# specific, written prior permission. Red Hat makes no # specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It # representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty. # is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -1,5 +1,5 @@
/* /*
* *
Copyright 1989, 1998 The Open Group Copyright 1989, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its Permission to use, copy, modify, distribute, and sell this software and its
@ -54,8 +54,8 @@ usage (int exitval)
} }
/* stolen from Xlib Xrm.c */ /* stolen from Xlib Xrm.c */
static void static void
PrintBindingQuarkList(XrmBindingList bindings, PrintBindingQuarkList(XrmBindingList bindings,
XrmQuarkList quarks, XrmQuarkList quarks,
FILE* stream) FILE* stream)
{ {
@ -75,12 +75,12 @@ PrintBindingQuarkList(XrmBindingList bindings,
/* stolen from Xlib Xrm.c */ /* stolen from Xlib Xrm.c */
/* output out the entry in correct file syntax */ /* output out the entry in correct file syntax */
/*ARGSUSED*/ /*ARGSUSED*/
static Bool static Bool
DumpEntry(XrmDatabase *db, DumpEntry(XrmDatabase *db,
XrmBindingList bindings, XrmBindingList bindings,
XrmQuarkList quarks, XrmQuarkList quarks,
XrmRepresentation *type, XrmRepresentation *type,
XrmValuePtr value, XrmValuePtr value,
XPointer data) XPointer data)
{ {
FILE *stream = (FILE *)data; FILE *stream = (FILE *)data;

View file

@ -1,6 +1,6 @@
dnl Copyright 2005 Red Hat, Inc. dnl Copyright 2005 Red Hat, Inc.
dnl dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that dnl the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@ dnl advertising or publicity pertaining to distribution of the software without
dnl specific, written prior permission. Red Hat makes no dnl specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any purpose. It dnl representations about the suitability of this software for any purpose. It
dnl is provided "as is" without express or implied warranty. dnl is provided "as is" without express or implied warranty.
dnl dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -1,6 +1,6 @@
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software # Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without fee, # and its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and that # provided that the above copyright notice appear in all copies and that
@ -10,7 +10,7 @@
# without specific, written prior permission. Red Hat makes no # without specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any # representations about the suitability of this software for any
# purpose. It is provided "as is" without express or implied warranty. # purpose. It is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -208,6 +208,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;; exit ;;
*:SecBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-secbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*) *:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;; exit ;;

View file

@ -1363,7 +1363,7 @@ case $os in
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \ | -bitrig* | -openbsd* | -secbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \

View file

@ -1,5 +1,5 @@
dnl Copyright 2005 Red Hat, Inc. dnl Copyright 2005 Red Hat, Inc.
dnl dnl
dnl Permission to use, copy, modify, distribute, and sell this software dnl Permission to use, copy, modify, distribute, and sell this software
dnl and its documentation for any purpose is hereby granted without fee, dnl and its documentation for any purpose is hereby granted without fee,
dnl provided that the above copyright notice appear in all copies and dnl provided that the above copyright notice appear in all copies and
@ -9,7 +9,7 @@ dnl advertising or publicity pertaining to distribution of the software
dnl without specific, written prior permission. Red Hat makes no dnl without specific, written prior permission. Red Hat makes no
dnl representations about the suitability of this software for any dnl representations about the suitability of this software for any
dnl purpose. It is provided "as is" without express or implied warranty. dnl purpose. It is provided "as is" without express or implied warranty.
dnl dnl
dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
dnl NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR dnl NO EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -1,7 +1,7 @@
# $Id: Makefile.am,v 1.7 2023/04/10 15:20:48 matthieu Exp $ # $Id: Makefile.am,v 1.7 2023/04/10 15:20:48 matthieu Exp $
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that # documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that # the above copyright notice appear in all copies and that both that
@ -11,7 +11,7 @@
# specific, written prior permission. Red Hat makes no # specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It # representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty. # is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -141,7 +141,7 @@ Draw (Moving *mp, int n)
{ {
XPoint xp[MAX_POINTS]; XPoint xp[MAX_POINTS];
int i; int i;
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
xp[i].x = mp[i].x; xp[i].y = mp[i].y; xp[i].x = mp[i].x; xp[i].y = mp[i].y;
} }
@ -242,7 +242,7 @@ Timeout (XtPointer closure, XtIntervalId *id)
} }
} }
static void static void
StartSaver (void) StartSaver (void)
{ {
if (screen_saved) if (screen_saved)
@ -261,13 +261,13 @@ StopSaver (void)
screen_saved = False; screen_saved = False;
} }
static int static int
ignoreError (Display *dpy, XErrorEvent *error) ignoreError (Display *dpy, XErrorEvent *error)
{ {
return 0; return 0;
} }
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
Widget toplevel; Widget toplevel;
@ -348,14 +348,14 @@ main(int argc, char *argv[])
saver = info->window; saver = info->window;
if (info->state == ScreenSaverOn) if (info->state == ScreenSaverOn)
{ {
if (info->kind != ScreenSaverExternal) if (info->kind != ScreenSaverExternal)
{ {
XResetScreenSaver (display); XResetScreenSaver (display);
XActivateScreenSaver (display); XActivateScreenSaver (display);
} }
StartSaver (); StartSaver ();
} }
for (;;) for (;;)
{ {
XtAppNextEvent (app_con, &event); XtAppNextEvent (app_con, &event);
if (event.type == ss_event) { if (event.type == ss_event) {

View file

@ -735,7 +735,7 @@ kbfunc_menu_ssh(void *ctx, struct cargs *cargs)
buf = lbuf; buf = lbuf;
if (buf[slen - 1] == '\n') if (buf[slen - 1] == '\n')
buf[slen - 1] = '\0'; buf[slen - 1] = '\0';
/* skip hashed hosts */ /* skip hashed hosts */
if (strncmp(buf, HASH_MARKER, strlen(HASH_MARKER)) == 0) if (strncmp(buf, HASH_MARKER, strlen(HASH_MARKER)) == 0)
continue; continue;

View file

@ -210,7 +210,7 @@ menu_complete_path(struct menu_ctx *mc)
else if (!mr->abort) else if (!mr->abort)
strlcpy(mr->text, mc->searchstr, sizeof(mr->text)); strlcpy(mr->text, mc->searchstr, sizeof(mr->text));
} }
menuq_clear(&menuq); menuq_clear(&menuq);
return mr; return mr;

View file

@ -71,7 +71,7 @@ static Event * BuildEvent ( ProtocolStream * stream );
static void FreeEvent ( Event * event ); static void FreeEvent ( Event * event );
static char * DispatchEvent ( Event * event ); static char * DispatchEvent ( Event * event );
/* Function Name: ClientTimedOut /* Function Name: ClientTimedOut
* Description: Called if the client takes too long to take our selection. * Description: Called if the client takes too long to take our selection.
@ -96,7 +96,7 @@ ClientTimedOut(XtPointer data, XtIntervalId *id)
SetMessage(global_screen_data.info_label, msg); SetMessage(global_screen_data.info_label, msg);
} }
/* Function Name: GetClientWindow /* Function Name: GetClientWindow
* Description: Gets the Client's window by asking the user. * Description: Gets the Client's window by asking the user.
@ -169,7 +169,7 @@ GetClientWindow(Widget w, int *x, int *y)
return(XmuClientWindow(dpy, target_win)); return(XmuClientWindow(dpy, target_win));
} }
/* Function Name: SetCommand /* Function Name: SetCommand
* Description: Causes this widget to own the resource editor's * Description: Causes this widget to own the resource editor's
@ -244,7 +244,7 @@ SetCommand(Widget w, ResCommand command, String msg)
ClientTimedOut, (XtPointer) w); ClientTimedOut, (XtPointer) w);
} }
/* Function Name: TellUserAboutMessage /* Function Name: TellUserAboutMessage
* Description: Informs the user that we have sent a message to the client * Description: Informs the user that we have sent a message to the client
@ -285,7 +285,7 @@ TellUserAboutMessage(Widget label, ResCommand command)
SetMessage(label, msg); SetMessage(label, msg);
} }
/* Function Name: ConvertCommand /* Function Name: ConvertCommand
* Description: Converts the command string into a selection that can * Description: Converts the command string into a selection that can
@ -310,7 +310,7 @@ ConvertCommand(Widget w, Atom *selection, Atom *target, Atom *type_ret,
return(TRUE); return(TRUE);
} }
/* Function Name: SelectionDone /* Function Name: SelectionDone
* Description: done with the selection. * Description: done with the selection.
@ -325,7 +325,7 @@ SelectionDone(Widget w, Atom *sel, Atom *targ)
/* Keep the toolkit from automatically freeing the selection value */ /* Keep the toolkit from automatically freeing the selection value */
} }
/* Function Name: LoseSelection /* Function Name: LoseSelection
* Description: Called when we have lost the selection, asks client * Description: Called when we have lost the selection, asks client
@ -347,7 +347,7 @@ LoseSelection(Widget w, Atom *sel)
NULL, XtLastTimestampProcessed(XtDisplay(w))); NULL, XtLastTimestampProcessed(XtDisplay(w)));
} }
/* Function Name: GetClientValue /* Function Name: GetClientValue
* Description: Gets the value out of the client, and does good things * Description: Gets the value out of the client, and does good things
@ -459,7 +459,7 @@ GetClientValue(Widget w, XtPointer data, Atom *selection, Atom *type,
XtFree(error_str); XtFree(error_str);
} }
/* Function Name: BuildHeader /* Function Name: BuildHeader
* Description: Puts the header into the message. * Description: Puts the header into the message.
@ -529,7 +529,7 @@ BuildHeader(CurrentClient *client_data)
stream->size = old_size; stream->size = old_size;
} }
/* Function Name: BuildEvent /* Function Name: BuildEvent
* Description: Builds the event structure from the * Description: Builds the event structure from the
@ -758,7 +758,7 @@ BuildEvent(ProtocolStream *stream)
return(NULL); return(NULL);
} }
/* Function Name: FreeEvent /* Function Name: FreeEvent
* Description: Frees all memory associated with the event. * Description: Frees all memory associated with the event.
@ -860,7 +860,7 @@ FreeEvent(Event *event)
} }
} }
/* Function Name: DispatchEvent /* Function Name: DispatchEvent
* Description: Handles the event, calling the proper function. * Description: Handles the event, calling the proper function.
@ -903,7 +903,7 @@ DispatchEvent(Event *event)
return(error); return(error);
} }
/* Function Name: InternAtoms /* Function Name: InternAtoms
* Description: interns all static atoms. * Description: interns all static atoms.

View file

@ -53,7 +53,7 @@ in this Software without prior written authorization from The Open Group.
#include "editresP.h" #include "editresP.h"
/* /*
* functions. * functions.
@ -74,7 +74,7 @@ static void PopupOnNode ( WNode * node, Widget shell );
static void FreeClientData ( Widget w, XtPointer ptr, XtPointer junk ); static void FreeClientData ( Widget w, XtPointer ptr, XtPointer junk );
static void FreeResBox ( Widget w, XtPointer ptr, XtPointer junk ); static void FreeResBox ( Widget w, XtPointer ptr, XtPointer junk );
/* Function Name: RebuildMenusAndLabel /* Function Name: RebuildMenusAndLabel
* Description: Determines if the user has selected an application * Description: Determines if the user has selected an application
@ -156,7 +156,7 @@ RebuildMenusAndLabel(const char *toolkit)
} }
} }
/* Function Name: BuildWidgetTree /* Function Name: BuildWidgetTree
* Description: Creates all widgets for Editres. * Description: Creates all widgets for Editres.
@ -189,7 +189,7 @@ BuildWidgetTree(Widget parent)
global_tree_parent = porthole; global_tree_parent = porthole;
} }
/* Function Name: CreateTopArea /* Function Name: CreateTopArea
@ -229,7 +229,7 @@ CreateTopArea(Widget parent)
return(panner); return(panner);
} }
/* Function Name: SetEntriesInsensitive /* Function Name: SetEntriesInsensitive
* Description: Make menu entries unusable. * Description: Make menu entries unusable.
@ -244,7 +244,7 @@ SetEntriesSensitive(Widget *entries, int num, Boolean sensitive)
int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive); int i; for (i=0; i<num; i++) XtSetSensitive(entries[i], sensitive);
} }
/* Function Name: CreateCommandMenu /* Function Name: CreateCommandMenu
* Description: Creates the command menu. * Description: Creates the command menu.
@ -311,7 +311,7 @@ CreateCommandMenu(Widget parent, const char *toolkit)
SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False); SetEntriesSensitive(&CM_entries[CM_OFFSET], CM_NUM, False);
} }
/* Function Name: CreateTreeCommandMenu /* Function Name: CreateTreeCommandMenu
* Description: Creates the command menu. * Description: Creates the command menu.
@ -406,7 +406,7 @@ CreateTreeCommandMenu(Widget parent, const char *toolkit)
TM_NUM, False); TM_NUM, False);
} }
static Pixmap old_pixmap; static Pixmap old_pixmap;
@ -430,7 +430,7 @@ PrepareToLayoutTree(Widget tree)
XtUnmapWidget(tree); XtUnmapWidget(tree);
} }
/* Function Name: LayoutTree /* Function Name: LayoutTree
* Description: Laysout the tree widget. * Description: Laysout the tree widget.
@ -450,7 +450,7 @@ LayoutTree(Widget tree)
XtSetValues(XtParent(tree), args, ONE); XtSetValues(XtParent(tree), args, ONE);
} }
/************************************************************ /************************************************************
* *
@ -533,7 +533,7 @@ CreateResourceBoxWidgets(WNode *node, char **names, char **cons_names)
PopupOnNode(node, res_box->shell); PopupOnNode(node, res_box->shell);
} }
/* Function Name: CreateResourceNameForm /* Function Name: CreateResourceNameForm
* Description: Creates the Form widget with children that represent * Description: Creates the Form widget with children that represent
@ -672,7 +672,7 @@ CreateResourceNameForm(Widget parent, WNode *node)
XtFree((char *)classes); XtFree((char *)classes);
} }
/* Function Name: SetToggleGroupLeaders /* Function Name: SetToggleGroupLeaders
* Description: Sets the leaders of each toggle group. * Description: Sets the leaders of each toggle group.
@ -697,7 +697,7 @@ SetToggleGroupLeaders(WNode *node)
SetResourceString(NULL, (XtPointer) node, NULL); SetResourceString(NULL, (XtPointer) node, NULL);
} }
/* Function Name: MakeBoxLookNice /* Function Name: MakeBoxLookNice
* Description: Resizes the box that contains the resource names * Description: Resizes the box that contains the resource names
@ -807,7 +807,7 @@ MakeBoxLookNice(Widget dot, Widget star, Widget any, Widget single,
XtSetValues(single, args, num_args); XtSetValues(single, args, num_args);
} }
/* Function Name: CreateLists /* Function Name: CreateLists
* Description: Creates the list widgets for the normal and constraint * Description: Creates the list widgets for the normal and constraint
@ -911,7 +911,7 @@ CreateValueWidget(Widget parent, WNode *node)
#endif #endif
} }
/* Function Name: PopupOnNode /* Function Name: PopupOnNode
* Description: Pops a shell widget up centered on the node specified. * Description: Pops a shell widget up centered on the node specified.
@ -969,7 +969,7 @@ PopupOnNode(WNode *node, Widget shell)
XtPopup(shell, XtGrabNone); XtPopup(shell, XtGrabNone);
} }
/* Function Name: FreeClientData /* Function Name: FreeClientData
* Description: Frees the client data passed to this function. * Description: Frees the client data passed to this function.
@ -986,7 +986,7 @@ FreeClientData(Widget w, XtPointer ptr, XtPointer junk)
XtFree(ptr); XtFree(ptr);
} }
/* Function Name: FreeResBox. /* Function Name: FreeResBox.
* Description: Frees resource box allocated memory. * Description: Frees resource box allocated memory.

View file

@ -1,6 +1,6 @@
# #
# Copyright 2005 Red Hat, Inc. # Copyright 2005 Red Hat, Inc.
# #
# Permission to use, copy, modify, distribute, and sell this software and its # Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that # documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that # the above copyright notice appear in all copies and that both that
@ -10,7 +10,7 @@
# specific, written prior permission. Red Hat makes no # specific, written prior permission. Red Hat makes no
# representations about the suitability of this software for any purpose. It # representations about the suitability of this software for any purpose. It
# is provided "as is" without express or implied warranty. # is provided "as is" without express or implied warranty.
# #
# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR # EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR

View file

@ -38,7 +38,7 @@ static void
usage(void) usage(void)
{ {
fprintf(stderr, "Usage:\n"); fprintf(stderr, "Usage:\n");
fprintf(stderr, fprintf(stderr,
"fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.otb " "fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.otb "
"[ -- ] [ font ] ...\n"); "[ -- ] [ font ] ...\n");
} }

View file

@ -106,7 +106,7 @@ readFile(char *filename, FontPtr font)
const char *family_name, *encoding_name, *file_format; const char *family_name, *encoding_name, *file_format;
FontMapPtr mapping = NULL; FontMapPtr mapping = NULL;
FontMapReversePtr reverse = NULL; FontMapReversePtr reverse = NULL;
rc = FT_Ensure_Inited(); rc = FT_Ensure_Inited();
if(rc != 0) if(rc != 0)
@ -189,7 +189,7 @@ readFile(char *filename, FontPtr font)
if(strcmp(face->style_name, "Regular") == 0) if(strcmp(face->style_name, "Regular") == 0)
full_name = sprintf_alloc("%s", family_name); full_name = sprintf_alloc("%s", family_name);
else else
full_name = sprintf_alloc("%s %s", full_name = sprintf_alloc("%s %s",
family_name, face->style_name); family_name, face->style_name);
/* The unique name doesn't actually need to be globally /* The unique name doesn't actually need to be globally
@ -198,16 +198,16 @@ readFile(char *filename, FontPtr font)
if(face->num_fixed_sizes <= 0) if(face->num_fixed_sizes <= 0)
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT" bitmap", unique_name = sprintf_alloc("%s "XVENDORNAMESHORT" bitmap",
full_name); full_name);
else if(face->available_sizes[0].width == else if(face->available_sizes[0].width ==
face->available_sizes[0].height) face->available_sizes[0].height)
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT unique_name = sprintf_alloc("%s "XVENDORNAMESHORT
" bitmap size %d", " bitmap size %d",
full_name, full_name,
face->available_sizes[0].height); face->available_sizes[0].height);
else else
unique_name = sprintf_alloc("%s "XVENDORNAMESHORT unique_name = sprintf_alloc("%s "XVENDORNAMESHORT
" bitmap size %dx%d", " bitmap size %dx%d",
full_name, full_name,
face->available_sizes[0].width, face->available_sizes[0].width,
face->available_sizes[0].height); face->available_sizes[0].height);
@ -313,7 +313,7 @@ readFile(char *filename, FontPtr font)
for(int i = 0; i < face->num_fixed_sizes; i++) { for(int i = 0; i < face->num_fixed_sizes; i++) {
if(verbose_flag) if(verbose_flag)
fprintf(stderr, "size %d: %dx%d\n", fprintf(stderr, "size %d: %dx%d\n",
i, i,
(int)((face->available_sizes[i].x_ppem + 32) >> 6), (int)((face->available_sizes[i].x_ppem + 32) >> 6),
(int)((face->available_sizes[i].y_ppem + 32) >> 6)); (int)((face->available_sizes[i].y_ppem + 32) >> 6));
@ -325,7 +325,7 @@ readFile(char *filename, FontPtr font)
return -1; return -1;
} }
strike = makeStrike(font, strike = makeStrike(font,
(face->available_sizes[i].x_ppem + 32) >> 6, (face->available_sizes[i].x_ppem + 32) >> 6,
(face->available_sizes[i].y_ppem + 32) >> 6); (face->available_sizes[i].y_ppem + 32) >> 6);
if(strike == NULL) { if(strike == NULL) {
@ -356,7 +356,7 @@ readFile(char *filename, FontPtr font)
FT_Pos_DOWN(face->glyph->metrics.horiBearingY), FT_Pos_DOWN(face->glyph->metrics.horiBearingY),
face->glyph->bitmap.width, face->glyph->bitmap.width,
face->glyph->bitmap.rows, face->glyph->bitmap.rows,
face->glyph->bitmap.pitch, face->glyph->bitmap.pitch,
face->glyph->bitmap.buffer, face->glyph->bitmap.buffer,
crop_flag); crop_flag);
@ -381,7 +381,7 @@ readFile(char *filename, FontPtr font)
found = 1; found = 1;
} else { } else {
if(i == 0) { if(i == 0) {
fprintf(stderr, fprintf(stderr,
"Warning: no bitmap for the undefined glyph.\n"); "Warning: no bitmap for the undefined glyph.\n");
found = 1; found = 1;
} }

View file

@ -127,7 +127,7 @@ makeBitmap(StrikePtr strike, int code,
int dx, dy, new_width, new_height; int dx, dy, new_width, new_height;
bitmap = malloc(sizeof(BitmapRec)); bitmap = malloc(sizeof(BitmapRec));
if(bitmap == NULL) if(bitmap == NULL)
return NULL; return NULL;
*bitmap = (BitmapRec) { *bitmap = (BitmapRec) {
@ -260,7 +260,7 @@ makeIndexSubTables(StrikePtr strike, CmapPtr cmap)
last = NULL; last = NULL;
/* Assuming that we're writing bit-aligned data, small metrics /* Assuming that we're writing bit-aligned data, small metrics
and short offsets, a constant metrics segment saves 5 bytes and short offsets, a constant metrics segment saves 5 bytes
per glyph in the EBDT table, and 2 bytes per glyph in the EBLC per glyph in the EBDT table, and 2 bytes per glyph in the EBLC
table. On the other hand, the overhead for a supplementary table. On the other hand, the overhead for a supplementary
type 2 indexSubTable is 8 bytes for the indexSubTableArray type 2 indexSubTable is 8 bytes for the indexSubTableArray
@ -295,9 +295,9 @@ makeIndexSubTables(StrikePtr strike, CmapPtr cmap)
BitmapPtr b3 = strikeBitmapIndex(strike, cmap, index + n + 3); BitmapPtr b3 = strikeBitmapIndex(strike, cmap, index + n + 3);
BitmapPtr b4 = strikeBitmapIndex(strike, cmap, index + n + 4); BitmapPtr b4 = strikeBitmapIndex(strike, cmap, index + n + 4);
if(b1 && b2 && b3 && b4 && if(b1 && b2 && b3 && b4 &&
SAME_METRICS(bitmap, b1) && SAME_METRICS(bitmap, b1) &&
SAME_METRICS(bitmap, b2) && SAME_METRICS(bitmap, b2) &&
SAME_METRICS(bitmap, b3) && SAME_METRICS(bitmap, b3) &&
SAME_METRICS(bitmap, b4)) { SAME_METRICS(bitmap, b4)) {
break; break;
} }
@ -363,7 +363,7 @@ makeCmap(FontPtr font)
continue; continue;
} }
i = 1; i = 1;
while(code + i < FONT_CODES && while(code + i < FONT_CODES &&
fontIndex(font, code + i) == index + i) { fontIndex(font, code + i) == index + i) {
i++; i++;
} }
@ -456,16 +456,16 @@ glyphMetrics(FontPtr font, int code,
BitmapPtr bitmap = STRIKE_BITMAP(strike, code); BitmapPtr bitmap = STRIKE_BITMAP(strike, code);
if(bitmap) { if(bitmap) {
if(width_return) if(width_return)
*width_return = *width_return =
(((float)bitmap->advanceWidth) / strike->sizeX) * (((float)bitmap->advanceWidth) / strike->sizeX) *
TWO_SIXTEENTH; TWO_SIXTEENTH;
if(x_min_return) if(x_min_return)
*x_min_return = *x_min_return =
((float)bitmap->horiBearingX / strike->sizeX) * ((float)bitmap->horiBearingX / strike->sizeX) *
TWO_SIXTEENTH; TWO_SIXTEENTH;
if(y_min_return) if(y_min_return)
*y_min_return = *y_min_return =
(((float)bitmap->horiBearingY - bitmap->height) (((float)bitmap->horiBearingY - bitmap->height)
/ strike->sizeY) * TWO_SIXTEENTH; / strike->sizeY) * TWO_SIXTEENTH;
if(x_max_return) if(x_max_return)
*x_max_return = *x_max_return =

View file

@ -67,7 +67,7 @@ static int write_error_occurred, read_error_occurred;
/* floor(log2(x)) */ /* floor(log2(x)) */
static int static int
log2_floor(int x) log2_floor(int x)
{ {
int i, j; int i, j;
@ -88,7 +88,7 @@ static int
two_log2_floor(int x) two_log2_floor(int x)
{ {
int j; int j;
if(x <= 0) if(x <= 0)
abort(); abort();
@ -312,7 +312,7 @@ fontMetrics(FontPtr font)
* font->metrics.size / font->pxMetrics.size; * font->metrics.size / font->pxMetrics.size;
} }
int int
writeFile(char *filename, FontPtr font) writeFile(char *filename, FontPtr font)
{ {
int rc; int rc;
@ -380,11 +380,11 @@ writeFile(char *filename, FontPtr font)
tables[i] = makeName("head"); table_writers[i] = writehead; i++; tables[i] = makeName("head"); table_writers[i] = writehead; i++;
tables[i] = makeName("hhea"); table_writers[i] = writehhea; i++; tables[i] = makeName("hhea"); table_writers[i] = writehhea; i++;
if(nummetrics >= 1) { if(nummetrics >= 1) {
tables[i] = makeName("hmtx"); tables[i] = makeName("hmtx");
table_writers[i] = writehmtx; i++; table_writers[i] = writehmtx; i++;
} }
if(numglyphs >= 1) { if(numglyphs >= 1) {
tables[i] = makeName("loca"); tables[i] = makeName("loca");
table_writers[i] = writeloca; i++; table_writers[i] = writeloca; i++;
} }
tables[i] = makeName("maxp"); table_writers[i] = writemaxp; i++; tables[i] = makeName("maxp"); table_writers[i] = writemaxp; i++;
@ -533,8 +533,8 @@ fixupChecksum(FILE *out, int full_length, int head_position)
return 0; return 0;
} }
static int static int
writehead(FILE* out, FontPtr font) writehead(FILE* out, FontPtr font)
{ {
int time_hi = 0; int time_hi = 0;
@ -603,7 +603,7 @@ outputRaster(FILE *out, char *raster, int width, int height, int stride,
return len; return len;
} }
static int static int
writeEBDT(FILE* out, FontPtr font) writeEBDT(FILE* out, FontPtr font)
{ {
StrikePtr strike; StrikePtr strike;
@ -634,8 +634,8 @@ writeEBDT(FILE* out, FontPtr font)
writeBYTE(out, bitmap->advanceWidth); writeBYTE(out, bitmap->advanceWidth);
offset += 5; offset += 5;
} }
offset += outputRaster(out, offset += outputRaster(out,
bitmap->raster, bitmap->raster,
bitmap->width, bitmap->height, bitmap->width, bitmap->height,
bitmap->stride, bitmap->stride,
bit_aligned_flag); bit_aligned_flag);
@ -650,7 +650,7 @@ writeEBDT(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writeEBLC(FILE* out, FontPtr font) writeEBLC(FILE* out, FontPtr font)
{ {
int numstrikes, eblc_start, num, den; int numstrikes, eblc_start, num, den;
@ -666,7 +666,7 @@ writeEBLC(FILE* out, FontPtr font)
} }
eblc_start = ftell(out); eblc_start = ftell(out);
writeULONG(out, 0x00020000); /* version */ writeULONG(out, 0x00020000); /* version */
writeULONG(out, numstrikes); /* numSizes */ writeULONG(out, numstrikes); /* numSizes */
@ -724,7 +724,7 @@ writeEBLC(FILE* out, FontPtr font)
perror("Couldn't seek"); perror("Couldn't seek");
return -1; return -1;
} }
writeULONG(out, strike->indexSubTableLocation - eblc_start); writeULONG(out, strike->indexSubTableLocation - eblc_start);
/* indexSubTableArrayOffset */ /* indexSubTableArrayOffset */
writeULONG(out, endoffset - strike->indexSubTableLocation); writeULONG(out, endoffset - strike->indexSubTableLocation);
/* indexTablesSize */ /* indexTablesSize */
@ -793,12 +793,12 @@ writeEBLC(FILE* out, FontPtr font)
writeULONG(out, data_location); writeULONG(out, data_location);
if(table->constantMetrics) { if(table->constantMetrics) {
int size; int size;
BitmapPtr bitmap = BitmapPtr bitmap =
strikeBitmapIndex(strike, current_cmap, strikeBitmapIndex(strike, current_cmap,
table->firstGlyphIndex); table->firstGlyphIndex);
size = size =
strikeBitmapIndex(strike, current_cmap, strikeBitmapIndex(strike, current_cmap,
table->firstGlyphIndex + 1)->location - table->firstGlyphIndex + 1)->location -
bitmap->location; bitmap->location;
writeULONG(out, size); /* imageSize */ writeULONG(out, size); /* imageSize */
@ -814,7 +814,7 @@ writeEBLC(FILE* out, FontPtr font)
} else { } else {
for(int i = table->firstGlyphIndex; for(int i = table->firstGlyphIndex;
i <= table->lastGlyphIndex; i++) { i <= table->lastGlyphIndex; i++) {
int offset = int offset =
strikeBitmapIndex(strike, current_cmap, i)->location - strikeBitmapIndex(strike, current_cmap, i)->location -
data_location; data_location;
if(short_offsets) if(short_offsets)
@ -843,7 +843,7 @@ writeEBLC(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writecmap(FILE* out, FontPtr font) writecmap(FILE* out, FontPtr font)
{ {
int rc, cmap_start, cmap_end; int rc, cmap_start, cmap_end;
@ -876,7 +876,7 @@ writecmap(FILE* out, FontPtr font)
writeUSHORT(out, segcount * 2); /* segCountX2 */ writeUSHORT(out, segcount * 2); /* segCountX2 */
writeUSHORT(out, 2 * two_log2_floor(segcount)); /* searchRange */ writeUSHORT(out, 2 * two_log2_floor(segcount)); /* searchRange */
writeUSHORT(out, 1 + log2_floor(segcount)); /* entrySelector */ writeUSHORT(out, 1 + log2_floor(segcount)); /* entrySelector */
writeUSHORT(out, 2 * (segcount - two_log2_floor(segcount))); writeUSHORT(out, 2 * (segcount - two_log2_floor(segcount)));
/* rangeShift */ /* rangeShift */
cmap = current_cmap; cmap = current_cmap;
@ -928,7 +928,7 @@ writecmap(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writeglyf(FILE* out, FontPtr font) writeglyf(FILE* out, FontPtr font)
{ {
return 0; return 0;
@ -962,7 +962,7 @@ writehhea(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writehmtx(FILE* out, FontPtr font) writehmtx(FILE* out, FontPtr font)
{ {
for(int i = 0; i <= numglyphs; i++) { for(int i = 0; i <= numglyphs; i++) {
@ -986,7 +986,7 @@ writehmtx(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writeloca(FILE* out, FontPtr font) writeloca(FILE* out, FontPtr font)
{ {
/* All glyphs undefined -- loca table is empty, so offset 0 */ /* All glyphs undefined -- loca table is empty, so offset 0 */
@ -997,7 +997,7 @@ writeloca(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writemaxp(FILE* out, FontPtr font) writemaxp(FILE* out, FontPtr font)
{ {
writeLONG(out, 0x00010000); /* version */ writeLONG(out, 0x00010000); /* version */
@ -1018,7 +1018,7 @@ writemaxp(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writename(FILE* out, FontPtr font) writename(FILE* out, FontPtr font)
{ {
int offset; int offset;
@ -1041,7 +1041,7 @@ writename(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writepost(FILE* out, FontPtr font) writepost(FILE* out, FontPtr font)
{ {
int previous_width, fixed_pitch; int previous_width, fixed_pitch;
@ -1061,7 +1061,7 @@ writepost(FILE* out, FontPtr font)
} }
previous_width = width; previous_width = width;
} }
writeULONG(out, 0x00030000); /* FormatType */ writeULONG(out, 0x00030000); /* FormatType */
writeULONG(out, font->italicAngle); /* italicAngle */ writeULONG(out, font->italicAngle); /* italicAngle */
writeSHORT(out, FONT_UNITS(font->metrics.underlinePosition)); writeSHORT(out, FONT_UNITS(font->metrics.underlinePosition));
@ -1074,7 +1074,7 @@ writepost(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writeOS2(FILE* out, FontPtr font) writeOS2(FILE* out, FontPtr font)
{ {
int i; int i;
@ -1138,12 +1138,12 @@ writeOS2(FILE* out, FontPtr font)
return 0; return 0;
} }
static int static int
writePCLT(FILE* out, FontPtr font) writePCLT(FILE* out, FontPtr font)
{ {
char name[16] = "X11 font "; char name[16] = "X11 font ";
char filename[6] = "X11R00"; char filename[6] = "X11R00";
unsigned char charComplement[8] = unsigned char charComplement[8] =
{0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0xFF, 0xFF, 0xFE}; {0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0xFF, 0xFF, 0xFE};
int style, w, strokeWeight, widthType; int style, w, strokeWeight, widthType;