Refactor and reimplement dtudcfonted

This commit is contained in:
chase
2018-07-27 16:44:10 -05:00
committed by Jon Trulson
parent 0f1aaa3e46
commit b491f9134f
83 changed files with 3706 additions and 7498 deletions

View File

@@ -96,25 +96,17 @@ typedef struct {
} ListData;
#ifndef NO_MESSAGE_CATALOG
# ifdef __ultrix
# define _CLIENT_CAT_NAME "dtudcexch.cat"
# else /* __ultrix */
# define _CLIENT_CAT_NAME "dtudcexch"
# endif /* __ultrix */
# ifdef _NO_PROTO
extern char *_DtGetMessage();
# else /* _NO_PROTO */
# define _CLIENT_CAT_NAME "dtudcexch"
extern char *_DtGetMessage(
char *filename,
int set,
int n,
char *s );
# endif /* _NO_PROTO */
#define GETMESSAGE(set, number, string) GetMessage(set, number, string)
static char *
GetMessage(set, number, string)
int set, number;
char *string;
GetMessage(int set, int number, char *string)
{
char *tmp;
static char * point[100];

View File

@@ -65,10 +65,7 @@ sigint_out()
}
int
expCheckCode( code, code_num, code_list )
unsigned int code ;
int code_num ;
int *code_list ;
expCheckCode( unsigned int code, int code_num, int *code_list )
{
int i ;
@@ -80,14 +77,15 @@ int *code_list ;
}
int
ExpGpftoBDF( gpf_name, bdf_name, code_num, code_list, comment_num, comment_list, make_all )
char *gpf_name ; /* pointer to GPF file name area */
char *bdf_name ; /* pointer to BDF file name area */
int code_num ; /* number of GPF code */
int *code_list ; /* pointer to GPF code lists */
int comment_num ; /* number comments */
char **comment_list ;/* pointer to the list of comments */
int make_all ; /* convert whole GPF fomat file to BDF */
ExpGpftoBDF(
char *gpf_name, /* pointer to GPF file name area */
char *bdf_name, /* pointer to BDF file name area */
int code_num, /* number of GPF code */
int *code_list, /* pointer to GPF code lists */
int comment_num, /* number comments */
char **comment_list, /* pointer to the list of comments */
int make_all /* convert whole GPF fomat file to BDF */
)
{
struct stat statbuf ;
struct btophead r_gpf ;
@@ -168,7 +166,7 @@ int make_all ; /* convert whole GPF fomat file to BDF */
w_bdf.code = r_gpf.code ;
w_bdf.ptn = r_gpf.ptn ;
if( (rtn = WritePtnToBdf( &w_bdf, buf )) ){
if( (rtn = WritePtnToBdf( &w_bdf )) ){
fprintf(stderr, "\"%s\" cannot write glyph.\n", bdf_name ) ;
fclose(w_bdf.output) ;
return rtn ;
@@ -193,10 +191,10 @@ int make_all ; /* convert whole GPF fomat file to BDF */
}
static int
writeBdfHeader(head, comment_num, comment_list)
struct ptobhead *head;
int comment_num ; /* number comments */
char **comment_list ;/* pointer to the list of comments */
writeBdfHeader(struct ptobhead *head,
int comment_num, /* number comments */
char **comment_list /*pointer to the list of comments */
)
{
FILE *fp;
int fd[2];
@@ -276,7 +274,7 @@ char **comment_list ;/* pointer to the list of comments */
char *ep ;
if( (ep = (char *)strchr( comment_list[i], '\n' )) != NULL )
*ep = '\0' ;
if( comment_list[i] == '\0' ) continue ;
if( !comment_list[i] ) continue ;
fprintf(head->output, "COMMENT %s\n", comment_list[i]);
}
fprintf(head->output, "COMMENT\n");
@@ -327,12 +325,11 @@ char **comment_list ;/* pointer to the list of comments */
static int
readBdfToMemory(head, buf, code_num, code_list, make_all)
struct btophead *head;
char *buf;
int code_num ; /* number of GPF code */
int *code_list ; /* pointer to GPF code lists */
int make_all ; /* convert whole GPF fomat file to BDF */
readBdfToMemory(struct btophead *head, char *buf,
int code_num, /* number of GPF code */
int *code_list, /* pointer to GPF code lists */
int make_all /* convert whole GPF fomat file to BDF */
)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;

View File

@@ -83,7 +83,7 @@ static char *targ_file = NULL; /* UDC_file_name */
static void
sigint_out()
sigint_out(void)
{
if (WriteGpf.out_file) {
UNLINK_TMPFILE( WriteGpf.out_file );
@@ -95,10 +95,7 @@ sigint_out()
int
ImpBDFCodeList( bdf_name, code_num, code_list )
char *bdf_name ;
int *code_num ;
int **code_list ;
ImpBDFCodeList(char *bdf_name, int *code_num, int **code_list)
{
int *glyph_list ;
FILE *bdfp ;
@@ -165,8 +162,7 @@ int **code_list ;
int
ImpBDFCodeListFree( code_list )
int **code_list ;
ImpBDFCodeListFree(int **code_list)
{
free( *code_list ) ;
return(0) ;
@@ -175,9 +171,10 @@ int **code_list ;
int
ImpBDFCheck( bdf_name, gpf_name )
char *bdf_name ; /* BDF file name */
char *gpf_name ; /* GPF file name */
ImpBDFCheck(
char *bdf_name, /* BDF file name */
char *gpf_name /* GPF file name */
)
{
/* parameter check */
if( bdf_name == NULL || gpf_name == NULL ){
@@ -190,11 +187,12 @@ char *gpf_name ; /* GPF file name */
int
ImpBDFtoGpf( bdf_name, gpf_name, bdf_codenum, bdf_codelist)
char *bdf_name ;
char *gpf_name ;
int bdf_codenum ;
int *bdf_codelist ;
ImpBDFtoGpf(
char *bdf_name,
char *gpf_name,
int bdf_codenum,
int *bdf_codelist
)
{
int rtn ;
int exit_stat;
@@ -359,10 +357,11 @@ int *bdf_codelist ;
*/
static
impFileConvInit(r_udc, r_gpf, w_gpf )
struct btophead *r_udc;
struct btophead *r_gpf;
struct ptobhead *w_gpf;
impFileConvInit(
struct btophead *r_udc,
struct btophead *r_gpf,
struct ptobhead *w_gpf
)
{
int fd[2], snf_fd, permission;
char buf[BUFSIZE];
@@ -386,11 +385,6 @@ struct ptobhead *w_gpf;
if ( ChkPcfFontFile( w_gpf->snf_file ) ) {
/* snf */
if ( ( snf_fd = open( w_gpf->snf_file, O_RDONLY ) ) >= 0 ) {
COMM_SNF_FILEVERSION( snf_fd, finf, buf, permission ) ;
if( permission < 0 ) {
return BDF_INVAL;
}
} else {
return BDF_OPEN_IN;
}
}
@@ -477,11 +471,12 @@ struct ptobhead *w_gpf;
static
impGetGpfInf( r_gpf, w_gpf, buf, bdf_codenum )
struct btophead *r_gpf;
struct ptobhead *w_gpf;
char *buf;
int bdf_codenum ;
impGetGpfInf(
struct btophead *r_gpf,
struct ptobhead *w_gpf,
char *buf,
int bdf_codenum
)
{
int nchar, rtn;
@@ -505,10 +500,11 @@ int bdf_codenum ;
static
impReadBdfHeaderAndPut(r_gpf, w_gpf, buf)
struct btophead *r_gpf;
struct ptobhead *w_gpf;
char *buf;
impReadBdfHeaderAndPut(
struct btophead *r_gpf,
struct ptobhead *w_gpf,
char *buf
)
{
char *p;
unsigned int getstat = 0;
@@ -555,12 +551,13 @@ char *buf;
static
impMergePtn(r_udc, r_gpf, buf, bdf_codenum, bdf_codelist )
struct btophead *r_udc;
struct btophead *r_gpf;
char *buf;
int bdf_codenum ;
int *bdf_codelist ;
impMergePtn(
struct btophead *r_udc,
struct btophead *r_gpf,
char *buf,
int bdf_codenum,
int *bdf_codelist
)
{
int code, rtn, msize, i, j;
char *ptn;
@@ -615,11 +612,7 @@ int *bdf_codelist ;
}
static
impModifyPtn( r_udc, r_gpf, buf, ix )
struct btophead *r_udc;
struct btophead *r_gpf;
char *buf;
int ix;
impModifyPtn(struct btophead *r_udc, struct btophead *r_gpf, char *buf, int ix)
{
int mwidth, msize, rtn;
@@ -644,12 +637,13 @@ int ix;
}
static
impInsertPtn( r_udc, r_gpf, buf, code, ix )
struct btophead *r_udc;
struct btophead *r_gpf;
char *buf;
int code;
int ix;
impInsertPtn(
struct btophead *r_udc,
struct btophead *r_gpf,
char *buf,
int code,
int ix
)
{
int mwidth, msize, rtn, i;
@@ -688,9 +682,7 @@ int ix;
}
static
impWriteSnf( r_gpf, w_gpf )
struct btophead *r_gpf;
struct ptobhead *w_gpf;
impWriteSnf(struct btophead *r_gpf, struct ptobhead *w_gpf)
{
w_gpf->zoomf = 0;
w_gpf->num_chars = r_gpf->num_chars;

View File

@@ -134,8 +134,7 @@ static Widget *button4=NULL;
*/
void
xlfdPopupDialog(w)
Widget w;
xlfdPopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);
@@ -144,8 +143,7 @@ Widget w;
}
void
ForcePopdownDialog(w)
Widget w;
ForcePopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(w);
@@ -367,10 +365,7 @@ char_set(char *str) /* dtex */
}
static char *
spc(str, ch, count)
char * str;
char ch;
int count;
spc(char *str, char ch, int count)
{
char *p;
p = str + strlen(str);
@@ -506,10 +501,8 @@ static void OpenWindowCB() /* dtex change */
/*ARGSUSED*/
static void
OpenCancelCB( widget, clientData, callData ) /* dtex change */
Widget widget;
caddr_t clientData;
caddr_t callData;
OpenCancelCB( Widget widget, caddr_t clientData, caddr_t callData )
/* dtex change */
{
/* extern void ForcePopdownDialog();
if ( !editPtnW ){
@@ -523,8 +516,7 @@ caddr_t callData;
* create selection window view
*/
void
PopupSelectXLFD( top )
Widget top ;
PopupSelectXLFD( Widget top )
{
if( xlfdDialog == NULL ){
@@ -584,8 +576,7 @@ create_xlfd()
}
static void
udc_call(w)
Widget w;
udc_call(Widget w)
{
XmString label;
char *moji;
@@ -621,8 +612,7 @@ Widget w;
}
static void
sty_call(w)
Widget w;
sty_call(Widget w)
{
XmString label;
char *moji;
@@ -651,8 +641,7 @@ Widget w;
}
static void
wls_call(w)
Widget w;
wls_call(Widget w)
{
XmString label;
char *moji;
@@ -678,8 +667,7 @@ Widget w;
}
static void
hls_call(w)
Widget w;
hls_call(Widget w)
{
XmString label;
char *moji;
@@ -899,9 +887,7 @@ button_set4()
}
void
data_sort(data, count)
int *data;
int count;
data_sort(int *data, int count)
{
int *p1, *p2, tmp, i;
@@ -1071,8 +1057,7 @@ font_init() /* dtex change */
static Widget
CreateSelectXLFD( top ) /* dtex change */
Widget top ;
CreateSelectXLFD( Widget top ) /* dtex change */
{
int n;

View File

@@ -168,7 +168,7 @@ void setallcode(ListData *ld)
}
}
FalFontID openfont()
FalFontID openfont(void)
{
int protect_key = FAL_FONT_DISPLAY;
int codeset;
@@ -311,8 +311,7 @@ void getexistcode(ListData *ld)
*/
void
xlfdPopupDialog(w)
Widget w;
xlfdPopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);
@@ -321,8 +320,7 @@ Widget w;
}
void
xlfdPopdownDialog(w)
Widget w;
xlfdPopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(w);
@@ -334,10 +332,7 @@ Widget w;
* get pixel width
*/
Dimension
GetPixelWidth( w, columns, width )
Widget w ;
int columns ;
Dimension *width ;
GetPixelWidth(Widget w, int columns, Dimension *width)
{
Arg args[1] ;
XtSetArg( args[0], XmNwidth, width ) ;
@@ -350,9 +345,7 @@ Dimension *width ;
* callbacks *
***************************************************************/
void quit(w, client_data, call_data)
Widget w;
caddr_t *client_data, *call_data;
void quit(Widget w, caddr_t *client_data, caddr_t *call_data)
{
char *msg;
int ans;
@@ -374,9 +367,7 @@ caddr_t *client_data, *call_data;
* Unmanage widgets
*/
int
ClearText( num, slctBText )
int num ;
Widget *slctBText ;
ClearText(int num, Widget *slctBText)
{
int i ;
/* toggle button unset */
@@ -389,9 +380,7 @@ Widget *slctBText ;
}
int
ClearButtons( num, slctButton )
int num ;
Widget *slctButton ;
ClearButtons(int num, Widget *slctButton)
{
int i, cnt ;
Boolean isSet ;
@@ -418,13 +407,13 @@ Widget *slctButton ;
* get text field position
*/
int
GetPositionOfLists( num, xlfdDialog, listPop, slctBText, x, y )
int num ;
Widget xlfdDialog ;
Widget *listPop ;
Widget *slctBText ;
Position *x ;
Position *y ;
GetPositionOfLists(
int num,
Widget xlfdDialog,
Widget *listPop,
Widget *slctBText,
Position *x,
Position *y)
{
int i ;
Position tbx, tby, tx, ty ;
@@ -462,10 +451,7 @@ Position *y ;
void listEH(w, num, event)
Widget w ;
int num ;
XButtonEvent *event;
void listEH(Widget w, int num, XButtonEvent *event)
{
int i, j, ITEM_COUNT;
Arg args[10];
@@ -536,10 +522,7 @@ XButtonEvent *event;
void listPrintCB(w, num, call_data)
Widget w;
int num ;
XmListCallbackStruct *call_data;
void listPrintCB(Widget w, int num, XmListCallbackStruct *call_data)
{
char *str ;
@@ -568,9 +551,7 @@ XmListCallbackStruct *call_data;
void OpenWindow(w, client_data, call_data)
Widget w;
caddr_t client_data, *call_data;
void OpenWindow(Widget w, caddr_t client_data, caddr_t *call_data)
{
int r ;
int i ;
@@ -680,11 +661,11 @@ caddr_t client_data, *call_data;
int
CreateXLFDLabelAndText( owner, slctBLabel, slctBText, slctButton )
Widget owner ;
Widget *slctBLabel ;
Widget *slctBText ;
Widget *slctButton ;
CreateXLFDLabelAndText(
Widget owner,
Widget *slctBLabel,
Widget *slctBText,
Widget *slctButton)
{
Widget _slctBLabel ;
@@ -769,15 +750,14 @@ Widget *slctButton ;
int
CreateOtherLabelAndText( num, owner, baseForm,
slctBLabel, topW, slctBText, slctButton )
int num ;
Widget owner ;
Widget baseForm ;
Widget *slctBLabel ;
Widget topW ;
Widget *slctBText ;
Widget *slctButton ;
CreateOtherLabelAndText(
int num,
Widget owner,
Widget baseForm,
Widget *slctBLabel,
Widget topW,
Widget *slctBText,
Widget *slctButton)
{
Widget _slctBLabel ;
@@ -875,11 +855,7 @@ Widget *slctButton ;
Widget
xlfdCreateScrolledList ( owner, name, args, n )
Widget owner ;
char *name ;
Arg *args ;
int n ;
xlfdCreateScrolledList (Widget owner, char *name, Arg *args, int n)
{
Widget listW ;
@@ -901,8 +877,7 @@ int n ;
* create selection window view
*/
void
PopupSelectXLFD( top )
Widget top ;
PopupSelectXLFD(Widget top)
{
int n, i, j;

View File

@@ -132,10 +132,7 @@ GetXLFDInfomations()
int
GetItemsToDisplay( num, itemcnt, xms_list )
int num ;
int *itemcnt ;
XmString **xms_list ;
GetItemsToDisplay( int num, int *itemcnt, XmString **xms_list )
{
int i, j, cnt ;
char *sp ,string[256], buf[256] ;
@@ -252,9 +249,7 @@ XmString **xms_list ;
static char*
skipSpace( str, skipcnt )
char *str ;
int skipcnt ;
skipSpace( char *str, int skipcnt )
{
int i, spacecnt ;
char *sp ;
@@ -276,9 +271,7 @@ int skipcnt ;
int
SetKeyBuff( num, str )
int num ;
char *str ;
SetKeyBuff( int num, char *str )
{
int i, j ;
int cdset, start, end ;