} 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];
}
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 ;
}
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 ;
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 ;
}
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];
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");
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;
static void
-sigint_out()
+sigint_out(void)
{
if (WriteGpf.out_file) {
UNLINK_TMPFILE( WriteGpf.out_file );
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 ;
int
-ImpBDFCodeListFree( code_list )
-int **code_list ;
+ImpBDFCodeListFree(int **code_list)
{
free( *code_list ) ;
return(0) ;
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 ){
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;
*/
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];
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;
}
}
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;
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;
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;
}
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;
}
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;
}
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;
*/
void
-xlfdPopupDialog(w)
-Widget w;
+xlfdPopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);
}
void
-ForcePopdownDialog(w)
-Widget w;
+ForcePopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(w);
}
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);
/*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 ){
* create selection window view
*/
void
-PopupSelectXLFD( top )
-Widget top ;
+PopupSelectXLFD( Widget top )
{
if( xlfdDialog == NULL ){
}
static void
-udc_call(w)
-Widget w;
+udc_call(Widget w)
{
XmString label;
char *moji;
}
static void
-sty_call(w)
-Widget w;
+sty_call(Widget w)
{
XmString label;
char *moji;
}
static void
-wls_call(w)
-Widget w;
+wls_call(Widget w)
{
XmString label;
char *moji;
}
static void
-hls_call(w)
-Widget w;
+hls_call(Widget w)
{
XmString label;
char *moji;
}
void
-data_sort(data, count)
-int *data;
-int count;
+data_sort(int *data, int count)
{
int *p1, *p2, tmp, i;
static Widget
-CreateSelectXLFD( top ) /* dtex change */
-Widget top ;
+CreateSelectXLFD( Widget top ) /* dtex change */
{
int n;
}
}
-FalFontID openfont()
+FalFontID openfont(void)
{
int protect_key = FAL_FONT_DISPLAY;
int codeset;
*/
void
-xlfdPopupDialog(w)
-Widget w;
+xlfdPopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);
}
void
-xlfdPopdownDialog(w)
-Widget w;
+xlfdPopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(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 ) ;
* 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;
* Unmanage widgets
*/
int
-ClearText( num, slctBText )
-int num ;
-Widget *slctBText ;
+ClearText(int num, Widget *slctBText)
{
int i ;
/* toggle button unset */
}
int
-ClearButtons( num, slctButton )
-int num ;
-Widget *slctButton ;
+ClearButtons(int num, Widget *slctButton)
{
int i, cnt ;
Boolean isSet ;
* 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 ;
-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];
-void listPrintCB(w, num, call_data)
-Widget w;
-int num ;
-XmListCallbackStruct *call_data;
+void listPrintCB(Widget w, int num, XmListCallbackStruct *call_data)
{
char *str ;
-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 ;
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 ;
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 ;
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 ;
* create selection window view
*/
void
-PopupSelectXLFD( top )
-Widget top ;
+PopupSelectXLFD(Widget top)
{
int n, i, j;
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] ;
static char*
-skipSpace( str, skipcnt )
-char *str ;
-int skipcnt ;
+skipSpace( char *str, int skipcnt )
{
int i, spacecnt ;
char *sp ;
int
-SetKeyBuff( num, str )
-int num ;
-char *str ;
+SetKeyBuff( int num, char *str )
{
int i, j ;
int cdset, start, end ;
UDC_INC_PATH1 = -I./
UDC_INC_PATH2 = -I./include
UDC_INC_PATH3 = -I./libfal
-UDC_INC_PATH4 = -I./libfal/include
-UDC_INC_PATH5 = -I$(DTSVCSRC)/DtXpm
-UDC_INC_PATH6 = -I$(TOP)/../x11/xc
+UDC_INC_PATH4 = -I$(DTSVCSRC)/DtXpm
+UDC_INC_PATH5 = -I$(TOP)/../x11/xc
#ifdef X11ProjectRoot
OPT2 = -DFONTC='"'$(XPROJECTROOT)/bin/bdftopcf'"'
DEFINES = $(OPT2)
- INCLUDES = $(UDC_INC_PATH1)\
+ INCLUDES = $(UDC_INC_PATH1)\
$(UDC_INC_PATH2)\
$(UDC_INC_PATH3)\
$(UDC_INC_PATH4)\
- $(UDC_INC_PATH5)\
- $(UDC_INC_PATH6)
+ $(UDC_INC_PATH5)
DEPLIBS = $(DEPDTSVCLIB) $(DEPTTLIB) $(DEPXMLIB) $(DEPXTOOLLIB) $(DEPXLIB)
LOCAL_LIBRARIES = $(DTSVCLIB) $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XLIB) ./libfuty/liboakfuty.a ./libfal/libfal.a
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
SUBDIRS = \
- libfal \
+ libfal \
libfuty \
dtaddcpf \
dtbdftocpf \
extern Resource resource;
static void
-OpenFont()
+OpenFont(void)
{
int mask;
FalFontData font_data;
}
static void
-CloseFont()
+CloseFont(void)
{
if (fid != font_id) {
FalCloseFont(fid);
}
static void
-DrawCode(w, low_code)
-Widget w;
-int low_code;
+DrawCode(Widget w, int low_code)
{
int hi_code;
char *f = NULL;
}
static void
-Code1Call(w, start_code, data)
-Widget w;
-int start_code;
-XmListCallbackStruct *data;
+Code1Call(Widget w, int start_code, XmListCallbackStruct *data)
{
code1 = start_code + data->item_position -1;
SetPixmap(code1);
}
static void
-Code2Call(w, code2, data)
-Widget w;
-int code2;
-XmPushButtonCallbackStruct *data;
+Code2Call(Widget w, int code2, XmPushButtonCallbackStruct *data)
{
char asc[16];
sprintf(asc, "%2.2X%2.2X", code1, code2);
}
static void
-PrevPage(w, scroll)
-Widget w, scroll;
+PrevPage(Widget w, Widget scroll)
{
int *list;
int num;
}
static void
-NextPage(w, scroll)
-Widget w, scroll;
+NextPage(Widget w, Widget scroll)
{
int *list;
int num, item;
}
static void
-Cancel()
+Cancel(void)
{
XtUnmapWidget(XtParent(code_w));
}
static void
-Apply()
+Apply(void)
{
char *asc;
XtVaGetValues(text, XmNvalue, &asc, NULL);
}
static void
-CreateItem(item, item_count, start_code)
-XmString *item;
-int *item_count;
-int *start_code;
+CreateItem(XmString *item, int *item_count, int *start_code)
{
int count;
int start, end;
}
static Widget
-CreateCodeWindow(w)
-Widget w;
+CreateCodeWindow(Widget w)
{
Widget top, base1, base2, base3, base4;
Widget frame, scroll, label, sep, form;
}
void
-CodeWindow(widget, font_name, load_font)
- Widget widget;
- char * font_name;
- Boolean load_font;
+CodeWindow(Widget widget, char *font_name, Boolean load_font)
{
static Boolean old_load_font;
extern int CodePoint;
#include <stdio.h>
+#include <stdlib.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "falfont.h"
#include "ufontrsrc.h"
-static void writePtn();
-static void sig_receive();
-char *get_cmd_path() ;
+static void writePtn(char *ptn, int width, int height, FILE *fp);
+static void sig_receive(void);
+char *get_cmd_path(char *path, char *cmd) ;
extern Resource resource;
int nptn; /* number of characters in editting */
int nmaxptn; /* maximum number of characters in editting */
int ptnsize; /* size per byte of single pattern */
- UINT ptnmemsize; /* size of memory of whole patterns */
- USHORT *ntoc; /* character list / relative code */
- USHORT *ctop; /* relative code / bitmap area */
+ unsigned int ptnmemsize; /* size of memory of whole patterns */
+ unsigned short *ntoc; /* character list / relative code */
+ unsigned short *ctop; /* relative code / bitmap area */
char *ptn; /* pointer to the bimap area */
int cptnnum; /* current pattern number */
} PATTERN_MNG;
FalFontID font_id;
static char *
-get_locale()
+get_locale(void)
{
char *loc;
*/
int
-ptnSqToNo( num )
-int num; /* sequential number */
+ptnSqToNo( int num /*sequential number */)
{
if( (pm.flag == 0) || (num >= pm.nptn) )
return( -1 );
*/
int
-ptnNoToSq( ncode )
-int ncode; /* relative code */
+ptnNoToSq( int ncode /* relative code */)
{
int sq;
*/
int
-codeToNo( code )
-int code; /* character code */
+codeToNo( int code /* character code */)
{
return( code - begin_code);
}
*/
int
-noToCode( sno )
-int sno; /* relative code */
+noToCode( int sno /* relative code */)
{
return( sno + begin_code);
}
*/
int
-codeCheck( code )
-int code;
+codeCheck( int code )
{
if (code < begin_code || code > last_code) {
return( -1 );
*/
static int
-ptnOpen(n, maxc, width, height)
-int n; /* initial number of charcters */
-int maxc;
-int width; /* pattern width */
-int height; /* pattern height */
+ptnOpen(
+int n, /* initial number of charcters */
+int maxc,
+int width, /* pattern width */
+int height /* pattern height */
+)
{
int i;
int fpsize;
pm.nmaxptn = n + GUADDPTNN;
pm.ptnsize = height * ((width+7)/8);
fpsize = pm.ptnsize + 1;
- pm.ptnmemsize = (UINT) ( fpsize * pm.nmaxptn ) ;
+ pm.ptnmemsize = (unsigned int) ( fpsize * pm.nmaxptn ) ;
- if(( pm.ntoc = (USHORT *)calloc(maxc, sizeof(USHORT)) ) == NULL) {
+ if(( pm.ntoc = (unsigned short *)calloc(maxc, sizeof(unsigned short)) ) == NULL) {
return( -1 );
}
- if(( pm.ctop = (USHORT *)calloc(maxc, sizeof(USHORT)) ) == NULL ) {
+ if(( pm.ctop = (unsigned short *)calloc(maxc, sizeof(unsigned short)) ) == NULL ) {
free( pm.ntoc );
return( -1 );
}
*/
int
-ptnClose()
+ptnClose(void)
{
if( pm.flag == 0 ) {
return( -1 );
*/
int
-ptnAdd( code, ptn )
-int code; /* code to be add */
-char *ptn; /* pointer to the pattern */
+ptnAdd(
+int code, /* code to be add */
+char *ptn) /* pointer to the pattern */
{
int fpsize;
int ncode;
- USHORT pno;
+ unsigned short pno;
char *pf;
char *pp;
int i;
char *re_ptn;
- UINT re_ptnmemsize;
+ unsigned int re_ptnmemsize;
int cpn;
if( pm.flag == 0 )
}
pm.cptnnum = cpn;
- pm.ctop[ncode] = (USHORT) cpn;
+ pm.ctop[ncode] = (unsigned short) cpn;
pf = pm.ptn + fpsize*cpn;
pp = pf + 1;
pf[0] = 1;
}
pm.ntoc[i+1] = pm.ntoc[i];
}
- pm.ntoc[i+1] = (USHORT) ncode;
+ pm.ntoc[i+1] = (unsigned short) ncode;
pm.nptn += 1;
return( 1 );
*/
int
-ptnGet( code, ptn )
-int code;
-char *ptn;
+ptnGet( int code, char *ptn )
{
int ncode;
int fpsize;
- USHORT pno;
+ unsigned short pno;
char *pf;
char *pp;
int i;
*/
int
-ptnSense( code )
-int code;
+ptnSense( int code )
{
if( (pm.flag == 0) || (codeCheck(code) == -1) )
return( -1 );
*/
int
-ptnDel( code )
-int code;
+ptnDel( int code )
{
int ncode;
int fpsize;
- USHORT pno;
+ unsigned short pno;
char *pf;
int i;
*/
int
-ptnGetInfo( n, width, height )
-int *n; /* the number of characters in editting */
-int *width; /* pattern width */
-int *height; /* pattern height */
+ptnGetInfo(
+int *n, /* the number of characters in editting */
+int *width, /* pattern width */
+int *height) /* pattern height */
{
if( pm.flag == 0 )
return( -1 );
*/
static void
-bitSetInfo( width, height)
-int width; /* pattern width */
-int height; /* pattern height */
+bitSetInfo(
+int width, /* pattern width */
+int height) /* pattern height */
{
bitInfo.width = width;
bitInfo.height = height;
*/
void
-bitSet( ptn, cx, cy )
-char *ptn;
-int cx;
-int cy;
+bitSet( char *ptn, int cx, int cy )
{
if((cx < 0) || (bitInfo.width <= cx) || (cy < 0) || (bitInfo.height <= cy))
return;
*/
void
-bitReset( ptn, cx, cy )
-char *ptn;
-int cx;
-int cy;
+bitReset( char *ptn, int cx, int cy )
{
if((cx < 0) || (bitInfo.width <= cx) || (cy < 0) || (bitInfo.height <= cy))
return;
*/
int
-bitRead( ptn, cx, cy )
-char *ptn;
-int cx;
-int cy;
+bitRead( char *ptn, int cx, int cy )
{
if((cx < 0) || (bitInfo.width <= cx) || (cy < 0) || (bitInfo.height <= cy))
return( 0 );
*/
void
-bitPtnClear( ptn )
-char *ptn;
+bitPtnClear( char *ptn )
{
int i;
*/
void
-bitPtnCopy( d_ptn, s_ptn )
-char *d_ptn; /* pointer of the destination file */
-char *s_ptn; /* pointer of the source file */
+bitPtnCopy(
+char *d_ptn, /* pointer of the destination file */
+char *s_ptn) /* pointer of the source file */
{
int i;
*/
int
-bitDrawLine( ptn, x1, y1, x2, y2 ,mode )
-char *ptn; /* pointer of the bit map file */
-int x1;
-int y1;
-int x2;
-int y2;
-int mode; /* 0: erase 1: draw */
+bitDrawLine(
+char *ptn, /* pointer of the bit map file */
+int x1,
+int y1,
+int x2,
+int y2,
+int mode) /* 0: erase 1: draw */
{
float dx, dy;
float x, y;
*/
int
-bitDrawCircle( ptn, x1, y1, x2, y2, mode )
-char *ptn;
-int x1;
-int y1;
-int x2;
-int y2;
-int mode;
+bitDrawCircle(
+char *ptn,
+int x1,
+int y1,
+int x2,
+int y2,
+int mode)
{
int dx, dy;
int i,x;
*/
int
-bitDrawRect( ptn, x, y, width, height, mode )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
-int mode;
+bitDrawRect(
+char *ptn,
+int x,
+int y,
+int width,
+int height,
+int mode)
{
int i;
*/
int
-bitDrawCls( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawCls(
+char *ptn,
+int x,
+int y,
+int width,
+int height)
{
int i, j;
*/
int
-bitDrawSet( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawSet(
+char *ptn,
+int x,
+int y,
+int width,
+int height)
{
int i, j;
*/
int
-bitDrawRev( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawRev(
+char *ptn,
+int x,
+int y,
+int width,
+int height)
{
int i, j;
*/
int
-bitDrawCpy(ptn, sx, sy, width, height, cut_flag)
-char *ptn;
-int sx;
-int sy;
-int width;
-int height;
-int cut_flag;
+bitDrawCpy(
+char *ptn,
+int sx,
+int sy,
+int width,
+int height,
+int cut_flag)
{
int i, j;
}
int
-bitDrawPaste(ptn, dx, dy)
-char *ptn;
-int dx;
-int dy;
+bitDrawPaste(char *ptn, int dx, int dy)
{
int i, j;
int width, height;
*/
int
-bitDrawRoll( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawRoll(char *ptn, int x, int y, int width, int height)
{
char *point;
int xx, yy;
*/
int
-bitDrawSymV( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawSymV( char *ptn, int x, int y, int width, int height )
{
int k, j;
int d1, d2;
*/
int
-bitDrawSymH( ptn, x, y, width, height )
-char *ptn;
-int x;
-int y;
-int width;
-int height;
+bitDrawSymH( char *ptn, int x, int y, int width, int height )
{
int k, j;
int d1, d2;
* -2 : file is locked
*/
int
-readSNF(fdata, width, height, err)
-FalFontData **fdata;
-int *width;
-int *height;
-char *err;
+readSNF(FalFontData **fdata, int *width, int *height, char *err)
{
FalFontinfo finfo;
int start, end;
}
static void
-bicopy(s1, s2, size)
-char *s1, *s2;
-int size;
+bicopy(char *s1, char *s2, int size)
{
- register int i;
+ int i;
for(i=size; i; i--, s1++, s2++)
*s2 = *s1;
}
int
-copySNF(start, end, ptn, num, err)
-int start;
-int end;
-char ***ptn;
-int *num;
-char *err;
+copySNF(int start, int end, char ***ptn, int *num, char *err)
{
FalFontID fid;
int mask;
}
void
-freeSNF(addr, count)
-char **addr;
-int count;
+freeSNF(char **addr, int count)
{
char **p;
for (p=addr; count; count--, p++)
*/
int
-writeSNF( restart, err )
-int restart; /* ON:continue OFF:initial */
-int *err; /* errors : */
+writeSNF(
+int restart, /* ON:continue OFF:initial */
+int *err) /* errors : */
{
static int pfstdi[2];
static FILE *fstdi;
case 0:
close( 0 ); /** 0 ... stdin **/
- dup( pfstdi[0] );
- close( pfstdi[0] );
- close( pfstdi[1] );
- argv[0] = resource.l_ptog_cmd;
- argv[1] = "-codeset";
- argv[2] = code_set;
- argv[3] = "-xlfd";
- argv[4] = fullFontData.xlfdname;
- argv[5] = "-init";
- argv[6] = "-f";
- argv[7] = NULL;
- execv (command, argv );
- exit( 103 );
+ if( dup( pfstdi[0] ) == -1){
+ return -1;
+ } else {
+ close( pfstdi[0] );
+ close( pfstdi[1] );
+ argv[0] = resource.l_ptog_cmd;
+ argv[1] = "-codeset";
+ argv[2] = code_set;
+ argv[3] = "-xlfd";
+ argv[4] = fullFontData.xlfdname;
+ argv[5] = "-init";
+ argv[6] = "-f";
+ argv[7] = NULL;
+ execv (command, argv );
+ exit( 103 );
+ }
}
*/
static void
-sig_receive()
+sig_receive(void)
{
sig_flg = 1;
return;
*/
static void
-writePtn(ptn, width, height, fp)
-char *ptn;
-int width;
-int height;
-FILE *fp;
+writePtn(char *ptn, int width, int height, FILE *fp)
{
int i, j, k;
int nbyte;
** ==================================================================
**/
-void PopdownCpyPtn();
-void DoCpyProc();
-void CpyPtnCB();
-void CpyCB();
+void PopdownCpyPtn(void);
+void DoCpyProc(void);
+void CpyPtnCB(void);
+void CpyCB(Widget w, XtPointer cdata);
/* static */ TextField SrcTf;
/* static */ TextField DestTf;
**/
void
-InitCpyPtn()
+InitCpyPtn(void)
{
/* initialize font infomation */
}
**/
void
-CpyPtnCB()
+CpyPtnCB(void)
{
extern void CpyPtnXLFD();
CpyPtnXLFD();
**/
void
-PopdownCpyPtn()
+PopdownCpyPtn(void)
{
ForcePopdownDialog(cpyDialog);
}
**/
String
-CpySrcCodeTfValue()
+CpySrcCodeTfValue(void)
{
return(GetTextFieldValue(&SrcTf));
}
**/
String
-CpyDestCodeTfValue()
+CpyDestCodeTfValue(void)
{
return(GetTextFieldValue(&DestTf));
}
**/
void
-PopupCpyNotice( message )
-String message;
+PopupCpyNotice( String message )
{
char bmsg[512] = "";
/*ARGSUSED*/
void
-CpyCB(w, cdata)
-Widget w;
-XtPointer cdata;
+CpyCB(Widget w, XtPointer cdata)
{
extern Boolean BeforeCpyCheck();
if (BeforeCpyCheck(cdata)){
**/
static void
-PopdownMngPtn()
+PopdownMngPtn(void)
{
PopdownDialog(mngPtnW);
}
**/
static void
-AddCB()
+AddCB(void)
{
int s_code, e_code;
extern Boolean BeforeMngCheck();
**/
static void
-DelCB()
+DelCB(void)
{
int s_code, e_code;
extern void DoDelProc();
**/
void
-MngPtnCB()
+MngPtnCB(void)
{
if (! mngPtnW){
Widget rowcol;
/**
- ** contents : get the character strings of code for add or delete from the input field
+ ** contents : get the character strings of code for add or delete from the
+ ** input field
** --------------------------------------------
**/
String
-MngCodeTfValue()
+MngCodeTfValue(void)
{
return(GetTextFieldValue(&MngCodeTf));
}
**/
void
-PopupDelNotice( owner )
-Widget owner;
+PopupDelNotice( Widget owner )
{
int i;
Widget delNoticeW = NULL;
**/
static void
-dstrypaneDelNotice()
+dstrypaneDelNotice(void)
{
int i;
**/
static void
-DelOkCB()
+DelOkCB(void)
{
CBdnOblB_del();
PopdownMngPtn();
**/
static void
-delScProc( value )
-int value;
+delScProc( int value )
{
int i;
extern int RelToAbsSq();
**/
static Widget
-CreateDelNotice(owner)
-Widget owner;
+CreateDelNotice(Widget owner)
{
Widget form, listBase, itemform[D_MAX];
char buf[64];
**/
static void
-CBdnOblB_del()
+CBdnOblB_del(void)
{
int code; /* code number for check */
int ncode; /* sequential number in the codeset system area */
**/
static void
-drawDelPtn( i )
-int i; /* window number */
+drawDelPtn( int i /* window number */)
{
if ( RelToAbsSq( dn.sq_top, i) <= dn.sq_end) {
ptnGet( noToCode(ptnSqToNo(RelToAbsSq( dn.sq_top, i))),
**/
static void
-drawDelCode( i )
-int i; /* window number */
+drawDelCode( int i /* window number */)
{
char str[20];
/*ARGSUSED*/
static void
-EHdnBulB_disp( widget, i )
-Widget widget;
-int i; /* widget that have some ivent */
+EHdnBulB_disp( Widget widget, int i /* widget that have some ivent */ )
{
drawDelPtn( i );
}
**/
static void
-DispErrorMessage( owner, title, msg )
-Widget owner;
-String title;
-String msg;
+DispErrorMessage( Widget owner, String title, String msg )
{
static NoticeButton buttons[] = {
NBTNARGS( NULL, NULL, NULL, True, False ),
**/
void
-DispMngErrorMessage( msg )
-String msg;
+DispMngErrorMessage( String msg )
{
DispErrorMessage( mngPtnW, resource.l_error_title, msg );
}
**/
void
-DispCpyErrorMessage( msg )
-String msg;
+DispCpyErrorMessage( String msg )
{
DispErrorMessage( cpyPtnW, resource.l_error_title, msg );
}
#endif
#include "pixmaps/arrow.pm"
-static Widget CreateCopyXLFD() ;
-static void CpyXLFDCB() ;
-
-extern int CreateOtherLabelAndText();
-extern Widget xlfdCreateScrolledList();
-extern int GetItemsToDisplay();
-
-extern void xlfdPopupDialog();
-
-extern void InitCpyPtn() ;
-extern void _unmap();
-extern void CpyCB() ;
-extern void PopdownCpyPtn() ;
-extern void AddPopupProc() ;
+static Widget CreateCopyXLFD(Widget Top);
+static void CpyXLFDCB(Widget w, caddr_t client_data, caddr_t *call_data);
+
+extern int CreateOtherLabelAndText(int num,
+ Widget owner,
+ Widget baseForm,
+ Widget *slctBLabel,
+ Widget topW,
+ Widget *slctBText,
+ Widget *slctButton);
+extern Widget xlfdCreateScrolledList(Widget owner,
+ char *name,
+ Arg *args,
+ int n);
+extern int GetItemsToDisplay(int num, int *itemcnt, XmString **xms_list);
+
+extern void xlfdPopupDialog(Widget w);
+
+extern void InitCpyPtn(void);
+extern void _unmap(void);
+extern void CpyCB(Widget w, XtPointer cdata);
+extern void PopdownCpyPtn(void);
+extern void AddPopupProc(Widget w, void(*popupcb)());
extern FalFontData fullFontData;
/*ARGSUSED*/
static void
-CpyXLFDCB(w, client_data, call_data)
-Widget w;
-caddr_t client_data, *call_data;
+CpyXLFDCB(Widget w, caddr_t client_data, caddr_t *call_data)
{
char *str;
XmStringTable st;
void
-CpyPtnXLFD()
+CpyPtnXLFD(void)
{
if( cpyDialog == NULL )
{
static void
-create_xlfd()
+create_xlfd(void)
{
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
FalFontData key;
}
static void
-udc_call(w)
-Widget w;
+udc_call(Widget w)
{
XmString label;
char *moji;
}
static void
-sty_call(w)
-Widget w;
+sty_call(Widget w)
{
XmString label;
char *moji;
}
static void
-wls_call(w)
-Widget w;
+wls_call(Widget w)
{
XmString label;
char *moji;
}
static void
-hls_call(w)
-Widget w;
+hls_call(Widget w)
{
XmString label;
char *moji;
}
static void
-button_set1()
+button_set1(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set2()
+button_set2(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set3()
+button_set3(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set4()
+button_set4(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
static void
-font_init()
+font_init(void)
{
FalFontDataList *fontlist;
FalFontData *f;
/*ARGSUSED*/
static void
-arrow_change(w, wid)
-Widget w;
-Widget wid;
+arrow_change(Widget w, Widget wid)
{
if (XtIsSensitive(wid)) {
XtSetSensitive(wid, False);
}
static void
-focus(w)
-Widget w;
+focus(Widget w)
{
focus_widget = w;
}
static void
-code_input()
+code_input(void)
{
char *str;
XmStringTable st;
}
static void
-code_input2()
+code_input2(void)
{
extern void CodeWindow();
CodeWindow(codeText[2], fullFontData.xlfdname, False);
}
static Widget
-CreateCopyXLFD( top )
-Widget top ;
+CreateCopyXLFD( Widget top )
{
int n;
#include <X11/Xmd.h>
#include <X11/Xproto.h>
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
#include "FaLib.h"
#include "snfstruct.h"
#include <errno.h>
-static int rw_init() ;
-static int readSnf() ;
-static int readSnf_with_init() ;
-static int readSnfHeader() ;
-static int readBdfHeaderAndPut() ;
-static int mergePtn() ;
-static int ModifyPtn() ;
-static int InsertPtn() ;
-static int writeSnf() ;
-static void put_error_and_exit();
-static void put_help();
-static int readBdfToMemory_with_init() ;
-
-extern int fal_glyph_to_code() ;
+static int rw_init(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ struct ptobhead *w_snf,
+ int init_all);
+static int readSnf(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ struct ptobhead *w_snf,
+ char *buf);
+static int readSnf_with_init(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ struct ptobhead *w_snf,
+ int init,
+ char *buf,
+ int num_gr,
+ FalGlyphRegion *gr);
+static int readSnfHeader(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ struct ptobhead *w_snf,
+ char *buf) ;
+static int readBdfHeaderAndPut(struct btophead *r_snf,
+ struct ptobhead *w_snf,
+ char *buf) ;
+static int mergePtn(char *com,
+ struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ char *buf,
+ int code_area,
+ int modify,
+ char *prog_name,
+ int num_gr,
+ FalGlyphRegion *gr,
+ int code_no) ;
+static int ModifyPtn(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ char *buf,
+ int ix);
+static int InsertPtn(struct ptobhead *r_gpf,
+ struct btophead *r_snf,
+ char *buf,
+ int code,
+ int ix);
+static int writeSnf(struct btophead *r_snf, struct ptobhead *w_snf) ;
+static void put_error_and_exit(struct ptobhead *ptob_in,
+ struct btophead *btop,
+ struct ptobhead *ptob_out,
+ int er_no,
+ char *prog_name);
+static void put_help(char *prog_name);
+static int readBdfToMemory_with_init(struct btophead *head,
+ int init,
+ char *buf,
+ int num_gr,
+ FalGlyphRegion *gr);
+
+extern int fal_glyph_to_code(char *locale,
+ char *charset_str,
+ int codeset,
+ unsigned long glyph_index,
+ unsigned long *codepoint);
static struct ptobhead WriteSnf;
static pid_t gtob_pid = 0;
static pid_t btop_pid = 0;
-#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
+#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || \
+ defined(__linux__)
static int chld_stat ;
#else
static union wait chld_stat ;
#endif
static void
-sigint_out()
+sigint_out(void)
{
if (WriteSnf.out_file) {
Unlink_Tmpfile( WriteSnf.out_file, com );
exit( 0 );
}
-main( argc, argv )
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
int code_area , init, modify, help, no_infile, no_style;
int fupd = 0 ;
}
static
-rw_init(r_gpf, r_snf, w_snf, init_all )
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-struct ptobhead *w_snf;
-int init_all;
+rw_init(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+struct ptobhead *w_snf,
+int init_all)
{
FontInfoRec *finf;
int fd[2], snf_fd, permission;
/* SNF format */
if ( ChkPcfFontFile( w_snf->snf_file ) ) {
- permission = 0 ;
if( (snf_fd = open( w_snf->snf_file, O_RDONLY ) ) >= 0 ) {
- COMM_SNF_FILEVERSION( snf_fd, finf, buf, permission ) ;
- if ( permission < 0 ) {
- return BDF_INVAL;
- }
- } else {
return BDF_OPEN_IN;
}
}
static
-readSnf(r_gpf, r_snf, w_snf, buf)
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-struct ptobhead *w_snf;
-char *buf;
+readSnf(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+struct ptobhead *w_snf,
+char *buf)
{
int nchar, rtn;
}
static
-readSnf_with_init(r_gpf, r_snf, w_snf, init, buf, num_gr, gr )
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-struct ptobhead *w_snf;
-int init;
-char *buf;
-int num_gr ;
-FalGlyphRegion *gr ;
+readSnf_with_init(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+struct ptobhead *w_snf,
+int init,
+char *buf,
+int num_gr,
+FalGlyphRegion *gr)
{
int nchar, rtn;
static
-readSnfHeader(r_gpf, r_snf, w_snf, buf)
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-struct ptobhead *w_snf;
-char *buf;
+readSnfHeader(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+struct ptobhead *w_snf,
+char *buf)
{
int rtn;
}
static
-readBdfHeaderAndPut(r_snf, w_snf, buf)
-struct btophead *r_snf;
-struct ptobhead *w_snf;
-char *buf;
+readBdfHeaderAndPut(struct btophead *r_snf, struct ptobhead *w_snf, char *buf)
{
char *p;
int getstat = 0;
}
static
-mergePtn(com, r_gpf, r_snf, buf, code_area, modify, prog_name, num_gr, gr, code_no)
-char *com ;
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-char *buf;
-int code_area;
-int modify;
-char *prog_name;
-int num_gr ;
-FalGlyphRegion *gr ;
-int code_no ;
+mergePtn(
+char *com,
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+char *buf,
+int code_area,
+int modify,
+char *prog_name,
+int num_gr,
+FalGlyphRegion *gr,
+int code_no)
{
int code, rtn, msize, i, j, dspcode;
char *ptn;
) {
DispCodePoint( com, char_set, code, dspcode, code_no, util_locale ) ;
USAGE2("%s : The font of a specified code cannot be added/changed \"0x%x\".\n", prog_name, dspcode );
- fgets(buf, BUFSIZE, r_gpf->input);
- continue;
+ if( fgets(buf, BUFSIZE, r_gpf->input) == NULL){
+ return -1;
+ } else {
+ continue;
+ }
}
for ( j = 0; j < r_snf->num_chars; j++ ) {
if ( !modify ) {
DispCodePoint( com, char_set, code, dspcode, code_no, util_locale ) ;
USAGE2("%s : The font has already been registered in a specified code. \"0x%x\"\n", prog_name, dspcode );
- fgets( buf, BUFSIZE, r_gpf->input );
- break;
+ if(fgets( buf, BUFSIZE, r_gpf->input ) == NULL){
+ return -1;
+ } else {
+ break;
+ }
}
if ( ( rtn = ModifyPtn( r_gpf, r_snf, buf, j ) ) ) {
return rtn;
static
-ModifyPtn( r_gpf, r_snf, buf, ix )
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-char *buf;
-int ix;
+ModifyPtn(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+char *buf,
+int ix)
{
int mwidth, msize, rtn;
}
static
-InsertPtn( r_gpf, r_snf, buf, code, ix )
-struct ptobhead *r_gpf;
-struct btophead *r_snf;
-char *buf;
-int code;
-int ix;
+InsertPtn(
+struct ptobhead *r_gpf,
+struct btophead *r_snf,
+char *buf,
+int code,
+int ix)
{
int mwidth, msize, rtn, i;
}
static
-writeSnf( r_snf, w_snf )
-struct btophead *r_snf;
-struct ptobhead *w_snf;
+writeSnf(struct btophead *r_snf, struct ptobhead *w_snf)
{
w_snf->zoomf = 0;
w_snf->num_chars = r_snf->num_chars;
static void
-put_error_and_exit(ptob_in, btop, ptob_out, er_no, prog_name)
-struct ptobhead *ptob_in;
-struct btophead *btop;
-struct ptobhead *ptob_out;
-int er_no;
-char *prog_name;
+put_error_and_exit(
+struct ptobhead *ptob_in,
+struct btophead *btop,
+struct ptobhead *ptob_out,
+int er_no,
+char *prog_name)
{
ErrMsgTable_AndExit( er_no, ptob_in->in_file, ptob_out->out_file,
btop->in_file, NULL,
static void
-put_help( prog_name )
-char *prog_name;
+put_help(char *prog_name)
{
USAGE1("Usage: %s -xlfd xlfd_name \n", prog_name);
USAGE("\t\t[-g character_size][-p character_pattern_file_name]\n");
USAGE1("%s can insert or modify glyphs in the following code area.\n", prog_name);
USAGE("codeset \t\tcode area\n");
USAGE("----------------------------------------\n");
- DispUdcCpArea() ;
+ DispUdcCpArea(stdout) ;
USAGE("The xlfd name and character size may be obtained using dtlsgpf command.\n");
return;
}
static int
-readBdfToMemory_with_init(head, init, buf, num_gr, gr )
-struct btophead *head;
-int init;
-char *buf;
-int num_gr ;
-FalGlyphRegion *gr ;
+readBdfToMemory_with_init(
+struct btophead *head,
+int init,
+char *buf,
+int num_gr,
+FalGlyphRegion *gr)
{
int code, mwidth, num_char, bsize, rtn ;
char *ptn;
#include "bdfgpf.h"
#include "udcutil.h"
-static void put_error();
-static void put_help() ;
-static void Usage() ;
-static void sigint_out() ;
-static int CnvBDFtoGPF() ;
+static void put_error(struct btophead *head, int er_no, char *prog_name);
+static void put_help(char *prog_name);
+static void Usage(char *prog_name) ;
+static void sigint_out(void) ;
+static int CnvBDFtoGPF(struct btophead *head) ;
static struct btophead Head;
static void
-sigint_out()
+sigint_out(void)
{
if (Head.out_file) {
unlink(Head.out_file);
exit(0);
}
-main(argc, argv)
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
int rtn, i;
char *GetTmpPath();
}
static
-CnvBDFtoGPF(head)
-struct btophead *head;
+CnvBDFtoGPF( struct btophead *head)
{
char bdfbuf[BUFSIZE];
int rtn;
}
static void
-put_error(head, er_no, prog_name)
-struct btophead *head;
-int er_no;
-char *prog_name;
+put_error(struct btophead *head, int er_no, char *prog_name)
{
switch(er_no) {
case FATAL_ERROR :
}
static void
-put_help(prog_name)
-char *prog_name;
+put_help(char *prog_name)
{
USAGE1("Usage: %s [-p character_pattern_file_name] [-bdf BDF_file_name]\n", prog_name);
USAGE("\t\t[-width character_width] [-height character_height] [-help]\n\n");
}
static void
-Usage(prog_name)
-char *prog_name;
+Usage(char *prog_name)
{
put_help(prog_name);
exit(PARAM_ERROR * (-1));
#include "bdfgpf.h"
#include "udcutil.h"
-static void put_error();
-static void put_help() ;
-static void Usage() ;
-static int CnvGPFtoBDF() ;
-static void sigint_out() ;
+static void put_error(struct ptobhead *head, int er_no, char *prog_name);
+static void put_help(char *prog_name);
+static void Usage(char *prog_name);
+static int CnvGPFtoBDF(struct ptobhead *head) ;
+static void sigint_out(void) ;
static struct ptobhead Head;
static void
-sigint_out()
+sigint_out(void)
{
if ( Head.out_file ) {
unlink( Head.out_file );
exit( 0 );
}
-main( argc, argv )
-int argc;
-char *argv[];
+int main( int argc, char *argv[])
{
int rtn, i;
char *GetTmpPath();
}
static
-CnvGPFtoBDF( head )
-struct ptobhead *head;
+CnvGPFtoBDF(struct ptobhead *head)
{
char textbuf[BUFSIZE] ;
int rtn ;
}
static void
-put_error( head, er_no, prog_name )
-struct ptobhead *head;
-int er_no;
-char *prog_name;
+put_error(struct ptobhead *head, int er_no, char *prog_name)
{
switch( er_no ) {
case FATAL_ERROR:
}
static void
-put_help( prog_name )
-char *prog_name;
+put_help( char *prog_name)
{
USAGE1("Usage: %s [-bdf BDF_file_name] [-p chracter_pattern_file_name]\n", prog_name);
USAGE("\t\t[-g user_defined_character_file_name] [-help]\n");
}
static void
-Usage( prog_name )
-char *prog_name;
+Usage( char *prog_name)
{
put_help( prog_name );
exit( PARAM_ERROR * (-1) );
#include "bdfgpf.h"
#include "snfstruct.h"
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
#include "FaLib.h"
#include "udcutil.h"
#include <errno.h>
-static void sigint_out() ;
-static void put_error_and_exit();
-static void put_help();
-static int CnvGPFtoBDF() ;
+static void sigint_out(void);
+static void put_error_and_exit(struct ptobhead *ptob,
+ int er_no,
+ char *prog_name);
+static void put_help(char *prog_name);
+static int CnvGPFtoBDF(struct ptobhead *head);
static struct ptobhead Head;
static void
-sigint_out()
+sigint_out(void)
{
if (Head.out_file) {
Unlink_Tmpfile(Head.out_file, com);
exit(0);
}
-main( argc, argv )
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
FontInfoRec *finf;
int help, no_infile, style_err, rtn, i;
char *style ; /* style */
int chk_fd;
pid_t chld_pid = 0;
-#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || defined(__linux__)
+#if defined( SVR4 ) || defined( SYSV ) || defined(CSRG_BASED) || \
+ defined(__linux__)
int chld_stat ;
#else
union wait chld_stat ;
put_error_and_exit( &Head, MKTMP_ERROR, argv[0] );
}
- permission = 0;
if ( ( snf_fd = open( Head.snf_file, O_RDONLY ) ) >= 0 ) {
if ( ChkPcfFontFile( Head.snf_file) ) {
- /* snf file */
- COMM_SNF_FILEVERSION( snf_fd, finf, buf, permission ) ;
- if( permission < 0 ) {
- put_error_and_exit( &Head, BDF_INVAL, argv[0] );
- }
- } else {
/* pcf */
close( snf_fd );
}
static
-CnvGPFtoBDF( head )
-struct ptobhead *head;
+CnvGPFtoBDF(struct ptobhead *head)
{
int rtn;
char textbuf[BUFSIZE];
static void
-put_error_and_exit( ptob, er_no, prog_name )
-struct ptobhead *ptob;
-int er_no;
-char *prog_name;
+put_error_and_exit(struct ptobhead *ptob, int er_no, char *prog_name)
{
ErrMsgTable_AndExit( er_no, ptob->snf_file, ptob->out_file,
ptob->in_file, NULL,
static void
-put_help( prog_name )
-char *prog_name;
+put_help(char *prog_name)
{
USAGE1("Usage: %s -xlfd xlfd_name\n", prog_name);
USAGE("\t\t[-g character_size][-p character_pattern_file_name]\n" );
#include <X11/Xmd.h>
#include <X11/Xproto.h>
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
#include "FaLib.h"
#include "snfstruct.h"
#define RESIZE_BY_RATE( a, r ) ((int)( (float)(a) * (r)))
#define DEF_RESOLUTION ((78 / 72.27) * 100)
-static void put_error_and_exit();
-static void put_help();
-static void sigint_out() ;
-static void getDefaultCh() ;
-static void MkFontProp() ;
-
-static int CpyGpfInit() ;
-static int writeGpf() ;
-static int check_width() ;
-static int check_height() ;
-static int check_width_height() ;
-static int getGpfFileName() ;
-static int readGpf() ;
-static int readBdfHeaderAndPut() ;
-static int check_code() ;
-static int readBdfToMemory() ;
-static int cpg_atoi() ;
-static int is_in_udcregion() ;
-
-extern int fal_code_to_glyph() ;
+static void put_error_and_exit(struct btophead *ptob_in,
+ struct ptobhead *ptob_out,
+ int er_no,
+ char *prog_name);
+static void put_help(char *prog_name);
+static void sigint_out(void);
+static void getDefaultCh(unsigned int cbuf);
+static void MkFontProp(int font_height, char *font, char *output);
+
+static int CpyGpfInit(struct btophead *i_gpf,
+ struct btophead *o_gpf,
+ struct ptobhead *w_gpf,
+ int type);
+static int writeGpf(struct btophead *i_gpf,
+ struct btophead *o_gpf,
+ struct ptobhead *w_gpf);
+static int check_width(char *prog_name, char *len_str);
+static int check_height(char *prog_name, char *len_str);
+static int check_width_height(char *prog_name, char *len_str, int mode);
+static int getGpfFileName(char *com,
+ struct btophead *gpfinf,
+ int code_area,
+ int code_no,
+ char *xlfdname,
+ char *snf_file,
+ char *style);
+static int readGpf(struct btophead *i_gpf,
+ char *buf,
+ int startcode,
+ int endcode,
+ int num_gr,
+ FalGlyphRegion *gr);
+static int readBdfHeaderAndPut(struct btophead *o_gpf,
+ struct ptobhead *w_gpf,
+ char *buf);
+static int check_code(char *prog_name,
+ char *code_str,
+ int mode,
+ char *charset,
+ int num_gr,
+ FalGlyphRegion *gr);
+static int readBdfToMemory(struct btophead *head,
+ char *buf,
+ int startcode,
+ int endcode,
+ int num_gr,
+ FalGlyphRegion *gr);
+static int cpg_atoi(char *numstr);
+static int is_in_udcregion(int start,
+ int end,
+ int num_gr,
+ FalGlyphRegion *gr);
+
+extern int fal_code_to_glyph(char *locale,
+ unsigned long codepoint,
+ FalGIInf **gi,
+ int *num_gi);
static struct ptobhead WriteGpf;
static void
-sigint_out()
+sigint_out(void)
{
if (WriteGpf.out_file) {
Unlink_Tmpfile( WriteGpf.out_file, com );
}
-main( argc, argv )
-int argc;
-char **argv ;
+int main(int argc, char **argv)
{
int code_area , help, no_infile, no_style, type ;
int rtn, i, exit_code ;
static int
-getGpfFileName( com, gpfinf, code_area, code_no, xlfdname, snf_file, style )
-char *com ;
-struct btophead *gpfinf ;
-int code_area ;
-int code_no ;
-char *xlfdname ;
-char *snf_file ;
-char *style ;
+getGpfFileName(
+char *com,
+struct btophead *gpfinf,
+int code_area,
+int code_no,
+char *xlfdname,
+char *snf_file,
+char *style)
{
static
-CpyGpfInit(i_gpf, o_gpf, w_gpf, type )
-struct btophead *i_gpf;
-struct btophead *o_gpf;
-struct ptobhead *w_gpf;
-int type ;
+CpyGpfInit(
+struct btophead *i_gpf,
+struct btophead *o_gpf,
+struct ptobhead *w_gpf,
+int type)
{
FontInfoRec *finf;
int ifd[2], ofd[2], snf_fd, permission;
/* SNF format */
if( !new_target ){
if ( ChkPcfFontFile( w_gpf->snf_file ) ) {
- permission = 0 ;
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;
}
}
static int
-readGpf(i_gpf, buf, startcode, endcode, num_gr, gr)
-struct btophead *i_gpf;
-char *buf;
-int startcode ;
-int endcode ;
-FalGlyphRegion *gr ;
+readGpf(
+struct btophead *i_gpf,
+char *buf,
+int startcode,
+int endcode,
+int num_gr,
+FalGlyphRegion *gr)
{
int nchar, rtn;
static int
-readBdfHeaderAndPut(o_gpf, w_gpf, buf)
-struct btophead *o_gpf;
-struct ptobhead *w_gpf;
-char *buf;
+readBdfHeaderAndPut(struct btophead *o_gpf, struct ptobhead *w_gpf, char *buf)
{
FILE *fp ;
char *p;
static
-writeGpf( i_gpf, o_gpf, w_gpf )
-struct btophead *i_gpf;
-struct btophead *o_gpf;
-struct ptobhead *w_gpf;
+writeGpf(struct btophead *i_gpf, struct btophead *o_gpf, struct ptobhead *w_gpf)
{
FILE *fp ;
char rdbuf[BUFSIZE] ;
static int
-check_width( prog_name, len_str )
-char *prog_name;
-char *len_str;
+check_width(char *prog_name, char *len_str)
{
return( check_width_height( prog_name, len_str, 0) );
}
static int
-check_height( prog_name, len_str )
-char *prog_name;
-char *len_str;
+check_height(char *prog_name, char *len_str)
{
return( check_width_height( prog_name, len_str, 1) );
}
static int
-check_width_height( prog_name, len_str, mode )
-char *prog_name;
-char *len_str;
-int mode; /* width ... 0 , height ... 1 */
+check_width_height(char *prog_name, char *len_str, int mode)
+/* width ... 0 , height ... 1 */
{
int ret;
char *tmp;
static int
-check_code( prog_name, code_str, mode, charset, num_gr, gr )
-char *prog_name;
-char *code_str;
-int mode; /* start_code ... 0, end_code ... 1 */
-char *charset ;
-int num_gr ;
-FalGlyphRegion *gr ;
+check_code(
+char *prog_name,
+char *code_str,
+int mode, /* start_code ... 0, end_code ... 1 */
+char *charset,
+int num_gr,
+FalGlyphRegion *gr)
{
int err_flg = 0;
int code_num;
static int
-readBdfToMemory(head, buf, startcode, endcode, num_gr, gr)
-struct btophead *head;
-char *buf;
-int startcode ;
-int endcode ;
-int num_gr ;
-FalGlyphRegion *gr ;
+readBdfToMemory(
+struct btophead *head,
+char *buf,
+int startcode,
+int endcode,
+int num_gr,
+FalGlyphRegion *gr)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;
static void
-getDefaultCh( code )
-unsigned int code ;
+getDefaultCh(unsigned int cbuf)
{
- unsigned int cbuf ;
- cbuf = code ;
if( (cbuf & 0xff) < firstCol ) firstCol = cbuf & 0xff ;
if( (cbuf >> 8) < firstRow ) firstRow = cbuf >> 8 ;
if( (cbuf & 0xff) > lastCol ) lastCol = cbuf & 0xff ;
static int
-cpg_atoi( numstr )
-char *numstr ;
+cpg_atoi(char *numstr)
{
int val ;
char *ep, *cbuf ;
}
static int
-is_in_udcregion( start, end, num_gr, gr )
-int start, end, num_gr ;
-FalGlyphRegion *gr ;
+is_in_udcregion( int start, int end, int num_gr, FalGlyphRegion *gr )
{
int i ;
if( start < gr[0].start && end < gr[0].start ){
static void
-MkFontProp(font_height, font, output)
-int font_height ;
-char *font;
-char *output;
+MkFontProp(int font_height, char *font, char *output)
{
char fbuf[BUFSIZE], split[BUFSIZE] ;
char *ep, *pix_sz, *point_sz, *rsl_x, *av_width, *char_set ;
static void
-put_error_and_exit(ptob_in, ptob_out, er_no, prog_name)
-struct btophead *ptob_in;
-struct ptobhead *ptob_out;
-int er_no;
-char *prog_name;
+put_error_and_exit(
+struct btophead *ptob_in,
+struct ptobhead *ptob_out,
+int er_no,
+char *prog_name)
{
ErrMsgTable_AndExit( er_no, ptob_in->in_file, ptob_out->out_file,
NULL, NULL, NULL, prog_name );
static void
-put_help( prog_name )
-char *prog_name;
+put_help(char *prog_name)
{
USAGE1("Usage: %s -ixlfd oxlfd -oxlfd oxlfd\n", prog_name);
USAGE("\t[in_character_size][out_character_size]\n");
USAGE1("%s can copy glyphs of gpf file in the following code area.\n", prog_name);
USAGE("codeset \t\tcode area\n");
USAGE("----------------------------------------\n");
- DispUdcCpArea() ;
+ DispUdcCpArea(stdout) ;
USAGE("If the -start and -end option is omitted, the start/end code of each extractive area is specified.\n");
USAGE("The xlfd name and character size may be obtained using dtlsgpf command.\n");
return;
# define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
# define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
-#elif defined(pegasus)
-
-# define DEFAULTGLPAD 4 /* default padding for glyphs */
-# define DEFAULTBITORDER MSBFirst /* default bitmap bit order */
-# define DEFAULTBYTEORDER MSBFirst /* default bitmap byte order */
-# define DEFAULTSCANUNIT 1 /* default bitmap scan unit */
-
#elif defined(mips)
# ifdef MIPSEL
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
-#include "font.h"
-#include "misc.h"
+#include <X11/fonts/font.h>
#include <X11/X.h>
#include <X11/Xproto.h>
#include <X11/Xmd.h>
+#include <X11/Intrinsic.h>
#include <ctype.h>
#include <errno.h>
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
#include "snfstruct.h"
#include <time.h>
#include "bdftosnf.h"
-static char *readfontfile();
-static void Anafprop();
-static void pSIZE();
-static void pPROPS();
-static void pCHARS();
-static void pfixCHARS();
-static int getarg();
-
-static Bool seekToType() ;
-static void getMetric() ;
-static Bool getAccel() ;
-static Bool getProperties() ;
-static void putPtn() ;
-static void ByteSwap() ;
-static void invertBits() ;
-
-static int getINT16() ;
-static int getINT32() ;
-static CARD32 getLSB32();
-static char *make_toptn();
-static void pSIZE_pcf();
-static PcfTmp *openPcfFont();
-static void setProp();
-static void pPROPS_pcf();
-static void pCHARS_pcf();
-static void BitOrderInvert();
+static char *readfontfile(char *fname);
+static void Anafprop(FontInfoRec *fip,
+ FontPropRec *fpropPtr,
+ char *fpropvnPtr,
+ char **fontname,
+ FontPropRec **fplistPtr,
+ FontPropRec *ps,
+ FontPropRec *res,
+ unsigned int *fplistNum);
+static void pSIZE(FontPropRec *ps, FontPropRec *res);
+static void pPROPS(FontInfoRec *fip,
+ FontPropRec *fplistPtr,
+ unsigned int fplistNum);
+static void pCHARS(FontInfoRec *fip,
+ CharInfoRec *cip,
+ char *glyphPtr,
+ unsigned int charNum,
+ unsigned int glyphPad);
+static void pfixCHARS(FontInfoRec *fip,
+ CharInfoRec *cip,
+ char *glyphPtr,
+ unsigned int charNum,
+ unsigned int glyphPad);
+static int getarg(int argc,
+ char *argv[],
+ char *fname,
+ int *bitorder,
+ int *byteorder,
+ int *scanunit,
+ int *glyphPad,
+ int *outLevel,
+ int *fix);
+
+static Bool seekToType(PCFTablePtr tables,
+ int ntables,
+ CARD32 type,
+ CARD32 *formatp,
+ CARD32 *sizep,
+ CARD32 *offsetp);
+static void getMetric(caddr_t buf, CARD32 format, xCharInfo *metric) ;
+static Bool getAccel(FontInfoPtr pFontInfo,
+ xCharInfo *maxink,
+ caddr_t buf_top,
+ PCFTablePtr tables,
+ int ntables,
+ CARD32 type);
+static Bool getProperties(PcfTmp *pcf,
+ caddr_t buf_top,
+ PCFTablePtr tables,
+ int ntables);
+static void putPtn(unsigned char *bits, int width, int height);
+static void ByteSwap(char *p, int scan);
+static void invertBits(char *src,
+ CARD32 format,
+ int width,
+ int height,
+ char *dest) ;
+
+static int getINT16(unsigned char *p, CARD32 format);
+static int getINT32(unsigned char *p, CARD32 format);
+static CARD32 getLSB32(unsigned char *p);
+static char *make_toptn(int width, int height);
+static void pSIZE_pcf(PropTmp *proptmp);
+static PcfTmp *openPcfFont(char *fontname);
+static void setProp(PcfTmp *pcf, PropTmp *proptmp);
+static void pPROPS_pcf(PcfTmp *pcf);
+static void pCHARS_pcf(PcfTmp *pcf, int fix);
+static void BitOrderInvert(unsigned char *buf, int nbytes);
static char *bufp,buf[2048];
-extern int ChkPcfFontFile();
+extern int ChkPcfFontFile(char *filename);
-main( argc,argv )
-int argc;
-char *argv[];
+int main( int argc, char *argv[] )
{
int i,k;
CharInfoRec *cip, *wkcip; /* character information */
unsigned int glyphstotal; /* glyph */
unsigned int charInfoNum ; /* character information's number */
- unsigned int charNum; /* define character number */
+ unsigned int charNum; /* define character number */
char *glyphPtr; /* glyph */
FontPropRec *fpropPtr,*fplistPtr; /* font property list */
FontPropRec psprop; /* point size property */
if ( !isPcf ) {
/* SNF format */
COMM_SNF_GETHEADER( fip, fp ) ;
- /* font file check */
- if ((fip->version1 != fip->version2) ||
- (fip->version1 != FONT_FILE_VERSION)) {
- USAGE("dtgpftobdf: illegal font version\n");
- exit( -1 );
- }
cip = (CharInfoRec *)((char *)fip + sizeof(FontInfoRec));
charNum = charInfoNum ;
wkcip = cip ;
- glyphstotal = fip->maxbounds.byteOffset;
-
- glyphPad = (((fip->maxbounds.metrics.rightSideBearing
- - fip->maxbounds.metrics.leftSideBearing)+31)/32)*4;
+ glyphPad = (((fip->maxbounds.rightSideBearing
+ - fip->maxbounds.leftSideBearing)+31)/32)*4;
if ( fix == TRUE ) {
for ( i = 0; i < charInfoNum; i++ ) {
- if ( wkcip->exists == FALSE ) {
- charNum-- ;
- }
wkcip++;
}
} else {
glyphstotal = 0 ;
for ( i = 0; i < charInfoNum; i++ ) {
- if (wkcip->exists == FALSE) {
- charNum-- ;
- wkcip++;
- continue;
- }
glyphstotal += (wkcip->metrics.ascent
+ wkcip->metrics.descent) * glyphPad;
wkcip++;
}
fpropPtr = (FontPropRec *)(glyphPtr + glyphstotal);
- fpropvnPtr = ((char *)fpropPtr) + (fip->nProps) * sizeof(FontPropRec);
+ fpropvnPtr = ((char *)fpropPtr) + (fip->nprops) * sizeof(FontPropRec);
}
fprintf( stdout,"%s",buf );
pSIZE_pcf( &proptmp );
fprintf( stdout,"FONTBOUNDINGBOX %d %d %d %d\n",
- pcf->info.maxbounds.metrics.rightSideBearing
- - pcf->info.maxbounds.metrics.leftSideBearing,
- pcf->info.maxbounds.metrics.ascent
- + pcf->info.maxbounds.metrics.descent,
- pcf->info.maxbounds.metrics.leftSideBearing,
- - ( pcf->info.maxbounds.metrics.descent )
+ pcf->info.maxbounds.rightSideBearing
+ - pcf->info.maxbounds.leftSideBearing,
+ pcf->info.maxbounds.ascent
+ + pcf->info.maxbounds.descent,
+ pcf->info.maxbounds.leftSideBearing,
+ - ( pcf->info.maxbounds.descent )
);
pPROPS_pcf( pcf );
if ( outLevel == FALSE ) {
/*
* read to font file
- *
*/
-static char *readfontfile( fname )
-char *fname;
+static char *readfontfile( char *fname )
{
int fd;
char *fp = NULL;
#define getINT8( p ) ( *p++ ) ;
static CARD32
-getLSB32( p )
-unsigned char *p;
+getLSB32( unsigned char *p )
{
CARD32 c;
static int
-getINT32( p, format )
-unsigned char *p;
-CARD32 format;
+getINT32( unsigned char *p, CARD32 format )
{
CARD32 c;
}
static int
-getINT16( p, format )
-unsigned char *p;
-CARD32 format;
+getINT16( unsigned char *p, CARD32 format )
{
CARD32 c;
}
static Bool
-seekToType( tables, ntables, type, formatp, sizep, offsetp)
-PCFTablePtr tables;
-int ntables;
-CARD32 type;
-CARD32 *formatp;
-CARD32 *sizep;
-CARD32 *offsetp;
+seekToType(
+PCFTablePtr tables,
+int ntables,
+CARD32 type,
+CARD32 *formatp,
+CARD32 *sizep,
+CARD32 *offsetp)
{
int i;
static void
-getMetric( buf, format, metric )
-caddr_t buf;
-CARD32 format;
-xCharInfo *metric;
+getMetric( caddr_t buf, CARD32 format, xCharInfo *metric)
{
metric->leftSideBearing = getINT16( (unsigned char *)buf, format);
buf += 2;
}
static Bool
-getAccel( pFontInfo, maxink, buf_top, tables, ntables, type )
-FontInfoPtr pFontInfo;
-xCharInfo *maxink;
-caddr_t buf_top;
-PCFTablePtr tables;
-int ntables;
-CARD32 type;
+getAccel(
+FontInfoPtr pFontInfo,
+xCharInfo *maxink,
+caddr_t buf_top,
+PCFTablePtr tables,
+int ntables,
+CARD32 type)
{
CARD32 format;
CARD32 size;
buffer += 4;
- getMetric(buffer, format, &pFontInfo->minbounds.metrics);
+ getMetric(buffer, format, &pFontInfo->minbounds);
buffer += 12;
- getMetric(buffer, format, &pFontInfo->maxbounds.metrics);
+ getMetric(buffer, format, &pFontInfo->maxbounds);
buffer += 12;
if ( PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ) {
buffer += 12;
getMetric( buffer, format, maxink);
} else {
- *maxink = pFontInfo->maxbounds.metrics;
+ *maxink = pFontInfo->maxbounds;
}
return TRUE;
}
static Bool
-getProperties( pcf, buf_top, tables, ntables)
-PcfTmp *pcf;
-caddr_t buf_top;
-PCFTablePtr tables;
-int ntables;
+getProperties(PcfTmp *pcf, caddr_t buf_top, PCFTablePtr tables, int ntables)
{
CARD32 format;
CARD32 size;
static PcfTmp *
-openPcfFont( fontname )
-char *fontname;
+openPcfFont(char *fontname)
{
- PcfTmp *pcf_tmp;
+ PcfTmp *pcf_tmp;
- CARD32 format;
- CARD32 size;
- CARD32 offset;
- CARD32 *bitmapSizes;
- xCharInfo maxink;
- caddr_t buffp;
- struct stat st;
+ CARD32 format;
+ CARD32 size;
+ CARD32 offset;
+ CARD32 *bitmapSizes;
+ xCharInfo maxink;
+ caddr_t buffp;
+ struct stat st;
+
+ pcf_tmp = ( PcfTmp * )calloc( 1, sizeof( PcfTmp ) );
+
+ while(1){
- pcf_tmp = ( PcfTmp * )calloc( 1, sizeof( PcfTmp ) );
if ( !pcf_tmp ) {
USAGE("dtgpftobdf : calloc() error.\n" ) ;
- goto Bail;
+ break;
}
if ( stat( fontname, &st ) ) {
- goto Bail;
+ break;
}
if ( ( pcf_tmp->pcf_buffer = readfontfile( fontname)) == (char *)-1 ) {
- goto Bail;
+ break;
}
pcf_tmp->pcf_bufsz = st.st_size;
if ( (format = getLSB32( (unsigned char *)pcf_tmp->pcf_buffer )) != PCF_FILE_VERSION ) {
USAGE1("dtgpftobdf : pcf file version(0x%x) error.\n", format ) ;
- goto Bail;
+ break;
}
pcf_tmp->ntables = getLSB32( (unsigned char *)(pcf_tmp->pcf_buffer + 4) );
)
) {
USAGE("dtgpftobdf : Cannot get accelerators.\n" ) ;
- goto Bail;
+ break;
}
}
)
) {
USAGE("dtgpftobdf : getProperties error.\n" ) ;
- goto Bail;
+ break;
}
if ( !seekToType(
pcf_tmp->tables, pcf_tmp->ntables,
)
) {
USAGE("dtgpftobdf : PCF_BITMAPS error.\n" ) ;
- goto Bail;
+ break;
}
buffp = pcf_tmp->pcf_buffer + offset;
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) {
USAGE("dtgpftobdf : error.!PCF_FORMAT_MATCH(PCF_BITMAPS)\n" ) ;
- goto Bail;
+ break;
}
pcf_tmp->nbitmaps = getINT32( (unsigned char *)buffp, format);
)
) {
USAGE("dtgpftobdf : error.(PCF_BDF_ENCODINGS)\n" ) ;
- goto Bail;
+ break;
}
buffp = pcf_tmp->pcf_buffer + offset;
buffp += 4;
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) {
USAGE("dtgpftobdf : error.!PCF_FORMAT_MATCH(PCF_BDF_ENCODINGS)\n" ) ;
- goto Bail;
+ break;
}
pcf_tmp->info.firstCol = getINT16( (unsigned char *)buffp, format);
buffp += 2;
pcf_tmp->info.lastRow = getINT16( (unsigned char *)buffp, format);
buffp += 2;
- pcf_tmp->info.chDefault = getINT16( (unsigned char *)buffp, format);
+ pcf_tmp->info.defaultCh = getINT16( (unsigned char *)buffp, format);
buffp += 2;
pcf_tmp->info.allExist = FALSE;
(CARD32)PCF_SWIDTHS, &format, &size, &offset
)
) {
- goto Bail;
+ break;
}
buffp = pcf_tmp->pcf_buffer + offset;
format = getLSB32( (unsigned char*)buffp);
buffp += 4;
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) {
- goto Bail;
+ break;
}
pcf_tmp->swd_fmt = (CARD32)format ;
pcf_tmp->swd_num = getINT32( (unsigned char*)buffp, format ) ;
(CARD32)PCF_GLYPH_NAMES, &format, &size, &offset
)
) {
- goto Bail;
+ break;
}
buffp = pcf_tmp->pcf_buffer + offset;
format = getLSB32( (unsigned char*)buffp);
buffp += 4;
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) ) {
- goto Bail;
+ break;
}
pcf_tmp->glyphs = getINT32( (unsigned char*)buffp, format ) ;
buffp += 4;
(CARD32)PCF_METRICS, &format, &size, &offset
)
) {
- goto Bail;
+ break;
}
buffp = pcf_tmp->pcf_buffer + offset;
pcf_tmp->mtr_num = (int)getINT16( (unsigned char*)buffp, format ) ;
buffp += 2;
}else{
- goto Bail;
+ break;
}
pcf_tmp->metrics = (xCharInfo *)buffp ;
pcf_tmp->mtr_fmt = (CARD32)format ;
return pcf_tmp;
-
-Bail:
- if ( pcf_tmp ) {
- free( pcf_tmp );
- }
- return NULL;
+ }
+ if ( pcf_tmp ) {
+ free( pcf_tmp );
+ }
+ return NULL;
}
static void
-Anafprop(fip,fpropPtr,fpropvnPtr,fontname,ps,res,fplistPtr,fplistNum)
-FontInfoRec *fip;
-FontPropRec *fpropPtr;
-char *fpropvnPtr;
-char **fontname;
-FontPropRec **fplistPtr;
-FontPropRec *ps;
-FontPropRec *res;
-unsigned int *fplistNum;
+Anafprop(
+FontInfoRec *fip,
+FontPropRec *fpropPtr,
+char *fpropvnPtr,
+char **fontname,
+FontPropRec **fplistPtr,
+FontPropRec *ps,
+FontPropRec *res,
+unsigned int *fplistNum)
{
FontPropRec *wkp ,*wklp;
int i, fpnL;
char *fpnp;
- *fplistNum = fip->nProps - 1;
+ *fplistNum = fip->nprops - 1;
*fplistPtr = (FontPropRec *)malloc(*fplistNum * sizeof(FontPropRec));
wkp = fpropPtr;
wklp = *fplistPtr;
- for (i = 0; i < fip->nProps; i++) {
+ for (i = 0; i < fip->nprops; i++) {
fpnp = fpropvnPtr + wkp->name;
fpnL = strlen(fpnp);
if ((fpnL == 4) && (strncmp(fpnp,"FONT",4) == 0)) {
}
}
wklp->name = (CARD32) (intptr_t) fpropvnPtr + wkp->name;
- if (wkp->indirect == TRUE) {
- wklp->value = (INT32) (intptr_t) fpropvnPtr + wkp->value;
- } else {
wklp->value = wkp->value;
- }
- wklp->indirect = wkp->indirect;
wkp++;
wklp++;
}
static void
-setProp( pcf, proptmp )
-PcfTmp *pcf;
-PropTmp *proptmp;
+setProp( PcfTmp *pcf, PropTmp *proptmp )
{
int i, fpnL;
char *fpnp;
*
*/
static void
-pSIZE( ps, res )
-FontPropRec *ps, *res;
+pSIZE( FontPropRec *ps, FontPropRec *res )
{
int k;
float f;
/* output to SIZE of pcf font */
static void
-pSIZE_pcf( proptmp )
-PropTmp *proptmp;
+pSIZE_pcf( PropTmp *proptmp )
{
int k;
float f;
static void
-pPROPS( fip,fplistPtr,fplistNum )
-FontInfoRec *fip;
-FontPropRec *fplistPtr;
-unsigned int fplistNum;
+pPROPS( FontInfoRec *fip, FontPropRec *fplistPtr, unsigned int fplistNum )
{
FontPropRec *wkp;
int i, k;
bufp += k;
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "FONT_DESCENT %d\n", fip->fontDescent );
bufp += k;
- k = snprintf( bufp, sizeof(buf) - (bufp - buf), "DEFAULT_CHAR %d\n", fip->chDefault );
+ k = snprintf( bufp, sizeof(buf) - (bufp - buf), "DEFAULT_CHAR %d\n", fip->defaultCh );
bufp += k;
wkp = fplistPtr;
for ( i = 0; i < fplistNum; i++ ) {
- if ( wkp->indirect == TRUE ) {
- k = snprintf( bufp, sizeof(buf) - (bufp - buf), "%s \"%s\"\n", (char *) (intptr_t) wkp->name, (char *) (intptr_t) wkp->value );
- bufp += k;
- } else {
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "%s %d\n", (char *) (intptr_t) wkp->name, wkp->value );
bufp += k;
- }
- wkp++;
+ wkp++;
}
k = snprintf( bufp, sizeof(buf) - (bufp - buf), "ENDPROPERTIES\n" );
bufp += k;
/* output to font property information of pcf fontpcf */
static void
-pPROPS_pcf( pcf )
-PcfTmp *pcf;
+pPROPS_pcf(PcfTmp *pcf)
{
FontPropPtr wkp;
int i, k;
k = sprintf( bufp, "STARTPROPERTIES %d\n", pcf->nprops+3 );
bufp += k;
k = sprintf( bufp, "FONT_ASCENT %d\n",
- (pcf->info.fontAscent >= pcf->info.maxbounds.metrics.ascent)
- ? pcf->info.fontAscent : pcf->info.maxbounds.metrics.ascent
+ (pcf->info.fontAscent >= pcf->info.maxbounds.ascent)
+ ? pcf->info.fontAscent : pcf->info.maxbounds.ascent
);
bufp += k;
k = sprintf( bufp, "FONT_DESCENT %d\n",
- (pcf->info.fontDescent >= pcf->info.maxbounds.metrics.descent)
- ? pcf->info.fontDescent : pcf->info.maxbounds.metrics.descent
+ (pcf->info.fontDescent >= pcf->info.maxbounds.descent)
+ ? pcf->info.fontDescent : pcf->info.maxbounds.descent
);
bufp += k;
- k = sprintf( bufp, "DEFAULT_CHAR %d\n", pcf->info.chDefault );
+ k = sprintf( bufp, "DEFAULT_CHAR %d\n", pcf->info.defaultCh );
bufp += k;
wkp = pcf->props;
for ( i = 0; i < pcf->nprops; i++ ) {
/*
* output to character information and patern
- *
*/
static void
-pCHARS(fip,cip,glyphPtr,charNum,glyphPad)
-FontInfoRec *fip;
-CharInfoRec *cip;
-char *glyphPtr;
-unsigned int charNum;
-unsigned int glyphPad;
-
+pCHARS(
+FontInfoRec *fip,
+CharInfoRec *cip,
+char *glyphPtr,
+unsigned int charNum,
+unsigned int glyphPad)
{
CharInfoRec *wkp;
int i, j;
for ( row = frow; row <= lrow; row++ ) {
for ( col = fcol; col <= lcol; col++ ) {
- if ( wkp->exists == FALSE ) {
- wkp++;
- continue;
- }
fprintf( stdout, "STARTCHAR %.2x%.2x\n", row,col );
fprintf( stdout, "ENCODING %d\n", (row << 8) + col );
fprintf( stdout, "SWIDTH 256 0\nDWIDTH %d %d\n",
/*
* output to character information and patern
- *
*/
static void
-pfixCHARS(fip,cip,glyphPtr,charNum,glyphPad)
-FontInfoRec *fip;
-CharInfoRec *cip;
-char *glyphPtr;
-unsigned int charNum;
-unsigned int glyphPad;
+pfixCHARS(
+FontInfoRec *fip,
+CharInfoRec *cip,
+char *glyphPtr,
+unsigned int charNum,
+unsigned int glyphPad)
{
CharInfoRec *wkp;
- register int i, j, k;
+ int i, j, k;
unsigned int frow,lrow,fcol,lcol;
- register int row, col;
+ int row, col;
unsigned int bbw, bbh, bbox, bboy;
unsigned int xd, yd;
unsigned int bml;
- register char *glyph;
+ char *glyph;
char fixbuf[240], *fixbufp;
int fixdl;
glyph = glyphPtr;
for ( row = frow; row <= lrow; row++ ) {
for ( col = fcol; col <= lcol; col++ ) {
- if ( wkp->exists == FALSE ) {
- wkp++;
- continue;
- }
bufp = buf;
memcpy(bufp,"STARTCHAR ",10);
bufp += 10;
static void
-putPtn( bits, width, height)
-unsigned char *bits; /* 1 byte boundary , no byte swap data */
-int width, height;
+putPtn(unsigned char *bits, /* 1 byte boundary , no byte swap data */
+ int width,
+ int height)
{
int bytewidth;
int i, j;
}
static void
-ByteSwap( p, scan)
-char *p;
-int scan;
+ByteSwap(char *p, int scan)
{
char w;
};
static void
-BitOrderInvert(buf, nbytes)
-register unsigned char *buf;
-register int nbytes;
+BitOrderInvert(unsigned char *buf, int nbytes)
{
- register unsigned char *rev = _reverse_byte;
+ unsigned char *rev = _reverse_byte;
for (; --nbytes >= 0; buf++)
*buf = rev[*buf];
}
static void
-invertBits( src, format, width, height, dest)
-char *src;
-CARD32 format;
-int width, height;
-char *dest;
+invertBits(char *src, CARD32 format, int width, int height, char *dest)
{
int bit, byte, glyph, scan;
int src_bytewidth, dest_bytewidth;
}
static void
-pCHARS_pcf (pcf, fix)
-PcfTmp *pcf;
-int fix ;
+pCHARS_pcf (PcfTmp *pcf, int fix)
{
char *bmp_ptn = NULL;
char *bitmap = NULL;
nencoding = row_width * (pcf->info.lastRow - pcf->info.firstRow + 1);
if( fix == TRUE ) {
- bmp_width = pcf->info.maxbounds.metrics.leftSideBearing
- + pcf->info.maxbounds.metrics.rightSideBearing ;
+ bmp_width = pcf->info.maxbounds.leftSideBearing
+ + pcf->info.maxbounds.rightSideBearing ;
bmp_height = pcf->info.fontAscent + pcf->info.fontDescent ;
ptn_width = bmp_width ;
- ptn_height = pcf->info.maxbounds.metrics.ascent +
- pcf->info.maxbounds.metrics.descent;
+ ptn_height = pcf->info.maxbounds.ascent +
+ pcf->info.maxbounds.descent;
if (!(bmp_ptn = make_toptn( ptn_width, ptn_height)))
return;
- if ( ( adj_hi = pcf->info.fontAscent - pcf->info.maxbounds.metrics.ascent ) > 0) {
+ if ( ( adj_hi = pcf->info.fontAscent - pcf->info.maxbounds.ascent ) > 0) {
width_bytes = 8 * PCF_GLYPH_PAD( pcf->bmp_fmt);
width_bytes = (( width_bytes + bmp_width - 1)/width_bytes) * PCF_GLYPH_PAD( pcf->bmp_fmt);
bmp_adj = width_bytes * adj_hi;
fprintf( stdout,"BBX %d %d %d %d\nBITMAP\n", bbw, bbh, bbx, bby ) ;
if( fix == FALSE ) {
- bmp_width = pcf->info.maxbounds.metrics.leftSideBearing
- + pcf->info.maxbounds.metrics.rightSideBearing ;
+ bmp_width = pcf->info.maxbounds.leftSideBearing
+ + pcf->info.maxbounds.rightSideBearing ;
bmp_height = pcf->info.fontAscent + pcf->info.fontDescent ;
ptn_width = bbw ;
ptn_height = bbh ;
if (!(bmp_ptn = make_toptn( ptn_width, ptn_height)))
return;
- if ( ( adj_hi = pcf->info.fontAscent - pcf->info.maxbounds.metrics.ascent ) > 0) {
+ if ( ( adj_hi = pcf->info.fontAscent - pcf->info.maxbounds.ascent ) > 0) {
width_bytes = 8 * PCF_GLYPH_PAD( pcf->bmp_fmt);
width_bytes = (( width_bytes + bmp_width - 1)/width_bytes) * PCF_GLYPH_PAD( pcf->bmp_fmt);
bmp_adj = width_bytes * adj_hi;
}
static char *
-make_toptn( width, height)
-int width, height;
+make_toptn(int width, int height)
{
int byte_width;
static int
-getarg(argc,argv,fname,bitorder,byteorder,scanunit,glyphPad,outLevel,fix)
-int argc;
-char *argv[];
-char *fname;
-int *bitorder;
-int *byteorder;
-int *scanunit;
-int *glyphPad;
-int *outLevel;
-int *fix;
+getarg(
+int argc,
+char *argv[],
+char *fname,
+int *bitorder,
+int *byteorder,
+int *scanunit,
+int *glyphPad,
+int *outLevel,
+int *fix)
{
int i;
int already;
#define START_CODE 0
#define END_CODE 1
-static int CnvBDFtoGPF() ;
-static int check_width() ;
-static int check_height() ;
-static int check_width_height() ;
-static int check_code() ;
-static int readBdfToMemory() ;
-static void sigint_out() ;
-static void put_error_and_exit();
-static void put_help();
-static void Usage();
-
-extern int fal_code_to_glyph() ;
+static int CnvBDFtoGPF(struct btophead *head,
+ int num_gr,
+ FalGlyphRegion *gr,
+ int code_area);
+static int check_width(char *prog_name, char *len_str);
+static int check_height(char *prog_name, char *len_str);
+static int check_width_height(char *prog_name, char *len_str, int mode);
+static int check_code(char *prog_name,
+ char *code_str,
+ int mode,
+ char *charset,
+ int num_gr,
+ FalGlyphRegion *gr);
+static int readBdfToMemory(struct btophead *head,
+ char *buf,
+ int num_gr,
+ FalGlyphRegion *gr,
+ int code_area);
+static void sigint_out(void);
+static void put_error_and_exit(struct btophead *btop,
+ int er_no,
+ char *prog_name);
+static void put_help(char *prog_name);
+static void Usage(char *prog_name);
+
+extern int fal_code_to_glyph(char *locale,
+ unsigned long codepoint,
+ FalGIInf **gi,
+ int *num_gi);
static struct btophead Head;
-static char *locale ;
-static char *spacing ;
-static char *char_set ;
+static char *locale;
+static char *spacing;
+static char *char_set;
static void
-sigint_out()
+sigint_out(void)
{
if ( Head.out_file ) {
unlink( Head.out_file );
exit( 0 );
}
-main( argc, argv )
-int argc;
-char *argv[];
+int main(int argc, char *argv[])
{
int help, code_area, fd[2], rtn, i;
struct stat st;
static int
-CnvBDFtoGPF( head, num_gr, gr, code_area )
-struct btophead *head;
-int num_gr ;
-FalGlyphRegion *gr ;
-int code_area ;
+CnvBDFtoGPF(
+struct btophead *head,
+int num_gr,
+FalGlyphRegion *gr,
+int code_area)
{
int rtn;
char bdfbuf[BUFSIZE];
static void
-put_error_and_exit(btop, er_no, prog_name)
-struct btophead *btop;
-int er_no;
-char *prog_name;
+put_error_and_exit(struct btophead *btop, int er_no, char *prog_name)
{
ErrMsgTable_AndExit( er_no, btop->in_file, NULL,
NULL, btop->out_file,
static void
-put_help(prog_name)
-char *prog_name;
+put_help(char *prog_name)
{
USAGE1("Usage : %s -xlfd xlfd_name\n", prog_name);
USAGE("\t\t[-g character_size][-p character_pattern_file_name]\n");
USAGE1("%s can extract glyphs in cpf file format in the following code area.\n", prog_name);
USAGE("codeset \t\tcode area\n");
USAGE("----------------------------------------\n");
- DispUdcCpArea() ;
+ DispUdcCpArea(stdout) ;
USAGE("If the -start and -end option is omitted, the start/end code of each extractive area is specified.\n");
USAGE("The xlfd name and character size may be obtained using dtlsgpf command.\n");
return;
}
static void
-Usage(prog_name)
-char *prog_name;
+Usage(char *prog_name)
{
put_help( prog_name );
exit(1);
static int
-check_width( prog_name, len_str )
-char *prog_name;
-char *len_str;
+check_width(char *prog_name, char *len_str)
{
return( check_width_height( prog_name, len_str, 0) );
}
static int
-check_height( prog_name, len_str )
-char *prog_name;
-char *len_str;
+check_height(char *prog_name, char *len_str)
{
return( check_width_height( prog_name, len_str, 1) );
}
static int
-check_width_height( prog_name, len_str, mode )
-char *prog_name;
-char *len_str;
-int mode; /* width ... 0 , height ... 1 */
+check_width_height(char *prog_name, char *len_str, int mode)
+/* width ... 0 , height ... 1 */
{
int ret;
char *tmp;
static int
-check_code( prog_name, code_str, mode, charset, num_gr, gr )
-char *prog_name;
-char *code_str;
-int mode; /* start_code ... 0, end_code ... 1 */
-char *charset ;
-int num_gr ;
-FalGlyphRegion *gr ;
+check_code(
+char *prog_name,
+char *code_str,
+int mode, /* start_code ... 0, end_code ... 1 */
+char *charset,
+int num_gr,
+FalGlyphRegion *gr)
{
int err_flg = 0;
int code_num;
static int
-readBdfToMemory(head, buf, num_gr, gr, code_area)
-struct btophead *head;
-char *buf;
-int num_gr ;
-FalGlyphRegion *gr ;
-int code_area ;
+readBdfToMemory(
+struct btophead *head,
+char *buf,
+int num_gr,
+FalGlyphRegion *gr,
+int code_area)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;
#include "bdfgpf.h"
#include "udcutil.h"
-
-static void dsp_info_list();
-static void dsp_title();
-static void dspinfo_1line();
-static void disp_no_fontslist();
-static void sort_offset_list() ;
-static int sort_fontlist() ;
-static void dsp_error_title() ;
-static int dsp_error_files() ;
-
-static void put_help();
-static int search_fontfile_name() ;
-static int get_new_target() ;
-
-static char *utillocale ;
-static char *fontdir ;
-static char *command_name ;
+static char *utillocale;
+static char *fontdir;
+static char *command_name;
typedef struct {
int num;
#define X_OPT (1<<3)
#define C_OPT (1<<4)
+static void dsp_info_list(char *com,
+ int dspopt,
+ FalFontDataList *lst,
+ MISS_ENTRY *unknown_file_lst,
+ int *errflg);
+static void dsp_title(FILE *fp, int dspopt);
+static void dspinfo_1line(FalFontData data,
+ FILE *fp,
+ MISS_ENTRY *unknown_file_lst,
+ int offset,
+ int *errflg,
+ int dspopt);
+static void disp_no_fontslist(int dspopt);
+static void sort_offset_list(FalFontDataList *flist,
+ int mask,
+ int **sort_list,
+ int *data_cnt);
+static int sort_fontlist(FalFontDataList *lst);
+static void dsp_error_title(char *com, int *errflg, int dspopt);
+static int dsp_error_files(FalFontDataList *lst, MISS_ENTRY *unknown);
+
+static void put_help(char *prog_name);
+static int search_fontfile_name(FalFontData data,
+ char *fname,
+ MISS_ENTRY *unknown_file_lst,
+ int offset,
+ int *errflg);
+static int get_new_target(FalFontData *target, FalFontData *choose);
+
int
-main( argc, argv )
-int argc;
-char *argv[];
+main( int argc, char *argv[] )
{
FalFontDataList *lst_m; /* font information list struct */
FalFontData key; /* font reference information creation struct */
static void
-dsp_info_list( com, dspopt, lst, unknown_file_lst, errflg )
-char *com;
-int dspopt;
-FalFontDataList *lst;
-MISS_ENTRY *unknown_file_lst;
-int *errflg ;
+dsp_info_list(
+char *com,
+int dspopt,
+FalFontDataList *lst,
+MISS_ENTRY *unknown_file_lst,
+int *errflg)
{
FalFontDataList srt_lst;
int i, j ;
static void
-dsp_error_title(com, errflg, dspopt )
-char *com;
-int *errflg ;
-int dspopt ;
+dsp_error_title(char *com, int *errflg, int dspopt)
{
USAGE("\n\n" );
if( dspopt & A_OPT ) {
static int
-dsp_error_files( lst, unknown )
-FalFontDataList *lst;
-MISS_ENTRY *unknown;
+dsp_error_files( FalFontDataList *lst, MISS_ENTRY *unknown )
{
int i,j;
int entry_start, entry_end;
static void
-sort_offset_list( flist, mask, sort_list, data_cnt )
-FalFontDataList *flist ;
-int mask ;
-int **sort_list ;
-int *data_cnt ;
+sort_offset_list(
+FalFontDataList *flist,
+int mask,
+int **sort_list,
+int *data_cnt)
{
int *size_offset_list ;
int cnt, i, j ;
static void
-dsp_title( fp, dspopt )
-FILE *fp;
-int dspopt ;
+dsp_title( FILE *fp, int dspopt )
{
if( dspopt & L_OPT || dspopt & X_OPT ) {
fprintf(fp, "\n" ) ;
static void
-dspinfo_1line( data, fp, unknown_file_lst, offset, errflg, dspopt )
-FalFontData data;
-FILE *fp;
-MISS_ENTRY *unknown_file_lst;
-int offset ;
-int *errflg ;
-int dspopt ;
+dspinfo_1line(
+FalFontData data,
+FILE *fp,
+MISS_ENTRY *unknown_file_lst,
+int offset,
+int *errflg,
+int dspopt)
{
int dsp_on ;
char *namep;
static void
-disp_no_fontslist( dspopt )
-int dspopt ;
+disp_no_fontslist( int dspopt )
{
fprintf( stdout, "\nThere are no fonts that are used for user defined character.\n" ) ;
}
static void
-put_help( prog_name )
-char *prog_name;
+put_help( char *prog_name )
{
USAGE1("Usage : %s [-lax][-la][-lx][-C][-codeset number][-help]\n", prog_name);
USAGE("\t-l : display of file name and character size\n");
static int
-search_fontfile_name( data, fname, unknown_file_lst, offset, errflg )
-FalFontData data ;
-char *fname ;
-MISS_ENTRY *unknown_file_lst;
-int offset ;
-int *errflg ;
+search_fontfile_name(
+FalFontData data,
+char *fname,
+MISS_ENTRY *unknown_file_lst,
+int offset,
+int *errflg)
{
FalFontID fid ;
FalFontDataList *flist ;
return(0) ;
}
-
-
static int
-sort_fontlist( lst )
-FalFontDataList *lst;
+sort_fontlist( FalFontDataList *lst )
{
int i,j;
FalFontDataList srt;
/* no sort ... 0 */
static int
-get_new_target( target, choose )
-FalFontData *target;
-FalFontData *choose;
+get_new_target( FalFontData *target, FalFontData *choose )
{
FalFontData diff;
DEF_STR_CHK ;
#include "udccom.h" /* 1995.10.09 */
#include "FaLib.h"
-typedef int INT;
-typedef short int SHORT;
-typedef long int LONG;
-typedef char CHAR;
-typedef unsigned int UINT;
-typedef unsigned short USHORT;
-typedef unsigned char UCHAR;
-
#define ON 1
#define OFF 0
#define MAXPTNSIZE 128
#define MAXPTNBYTE MAXPTNSIZE*((MAXPTNSIZE+7)/8)
-
#define ERROR_VAL fal_utyerror
#define EXISTS_FLAG fal_utyexists
#include <stdlib.h>
#include <dirent.h>
-#ifdef Bool
-#undef Bool
+#ifdef Bool
+#undef Bool
#endif
#include "snfstruct.h"
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
#include "pcf.h"
struct pcf_inf {
* function prototypes
*/
extern FalFontID FalOpenSysFont(
-#if NeedFunctionPrototypes
FalFontData* /* open_font_data */,
int /* font_data_mask */,
FalFontDataList** /* missing_font_list_return */
-#endif
) ;
extern int FalGetFontList(
-#if NeedFunctionPrototypes
FalFontData* /* key_data */,
int /* mask */,
FalFontDataList** /* list_ret */
-#endif
) ;
extern int FalFreeFontList(
-#if NeedFunctionPrototypes
FalFontDataList* /* list */
-#endif
) ;
extern char *
FalReadFont(
-#if NeedFunctionPrototypes
FalFontID /* fid */ ,
int /* code */ ,
int /* width */ ,
int /* height */
-#endif
) ;
extern int FalQueryFont(
-#if NeedFunctionPrototypes
FalFontID /* fid */ ,
FalFontinfo* /* fontinfo */
-#endif
) ;
extern int FalFontOfFontID(
-#if NeedFunctionPrototypes
FalFontID /* fid */,
FalFontData* /* fontdata */
-#endif
) ;
extern int FalCloseFont(
-#if NeedFunctionPrototypes
FalFontID /* fid */
-#endif
) ;
extern int FalFontIDToFileName(
-#if NeedFunctionPrototypes
FalFontID /* fid */ ,
char** /* file_name */
-#endif
) ;
extern int FalFree(
-#if NeedFunctionPrototypes
void* /* list */
-#endif
) ;
extern int FalGetUDCCPArea(
-#if NeedFunctionPrototypes
char* /* locale */ ,
int /* code_set */ ,
char* /* charset_str */ ,
FalCodeRegion** /* cr */ ,
int* /* num_cr */
-#endif
) ;
extern int FalGetUDCGIArea(
-#if NeedFunctionPrototypes
char* /* locale */ ,
int /* codeset */ ,
char* /* charset_str */ ,
FalGlyphRegion** /* gr */ ,
int* /* num_gr */
-#endif
) ;
extern FalFontID FalOpenFont() ;
*/
#include "udccom.h"
+#include "FaLib.h"
struct btophead {
char *in_file;
int bdf_width;
int bdf_height;
- int bdf_x;
- int bdf_y;
+ int bdf_x;
+ int bdf_y;
float bdf_point;
int bdf_xdpi;
- int reserve ;
+ int reserve ;
int *code;
char **ptn;
int zoomf;
- int code_category;
+ int code_category;
int start_code;
int end_code;
* Function prototypes
*/
extern int falcom_atoi(
-#if NeedFunctionPrototypes
char* /* str */,
char /* ed_cod */,
int* /* val */
-#endif
);
extern int GetDefaultFile(
-#if NeedFunctionPrototypes
int /* size */,
char* /* style */,
char* /* fname */
-#endif
);
extern int get_default_file(
-#if NeedFunctionPrototypes
FILE* /* fp */,
int /* size */,
char* /* style */,
char* /* fname */
-#endif
);
extern char *falcom_get_base_name(
-#if NeedFunctionPrototypes
char* /* str */
-#endif
);
extern int GetFileName(
-#if NeedFunctionPrototypes
char* /* com */,
char* /* size_str */,
char* /* style */,
int /* codeset */,
char* /* ofile */
-#endif
);
extern void ErrMsgTable_FalGetFontList(
-#if NeedFunctionPrototypes
char* /* com */,
int /* utyerr */,
int /* utyderr */
-#endif
);
extern void fal_cut_tailslash(
-#if NeedFunctionPrototypes
char* /* name */
-#endif
);
extern char *GetRealFileName(
-#if NeedFunctionPrototypes
char* /* name */
-#endif
);
extern int IsInRegion(
-#if NeedFunctionPrototypes
int /* code */,
int /* num_gr */,
FalGlyphRegion* /* gr */
-#endif
);
extern int GetUdcFileName(
-#if NeedFunctionPrototypes
char* /* com */,
int /* code_no */,
char* /* xlfdname */,
char* /* fname */
-#endif
);
extern int GetUdcRegion(
-#if NeedFunctionPrototypes
char* /* com */,
int /* codeset */,
char* /* gpf_file */,
int* /* num_gr */,
FalGlyphRegion** /* gr */
-#endif
);
extern int DispUdcCpArea(
-#if NeedFunctionPrototypes
FILE* /* fp */
-#endif
);
extern int GetUdcFontName(
-#if NeedFunctionPrototypes
char* /* gpf_file */,
char* /* bdf_file */,
char** /* fontname */
-#endif
);
extern int FileLock(
-#if NeedFunctionPrototypes
int /* fd */
-#endif
);
extern int FileUnLock(
-#if NeedFunctionPrototypes
int /* fd */
-#endif
);
extern int isLock(
-#if NeedFunctionPrototypes
int /* fd */
-#endif
);
extern int ReadBdfHeader(
-#if NeedFunctionPrototypes
struct btophead* /* head */,
char* /* buf */
-#endif
);
extern int ReadGpfHeader(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */,
char* /* buf */
-#endif
);
extern int WriteBdfHeader(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */
-#endif
);
extern void WriteGpfHeader(
-#if NeedFunctionPrototypes
struct btophead* /* head */
-#endif
);
extern int WritePtnToBdf(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */
-#endif
);
extern int putDefaultChars(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */
-#endif
);
extern int WritePtnToGpf(
-#if NeedFunctionPrototypes
struct btophead* /* head */
-#endif
);
extern int ReadBdfToMemory(
-#if NeedFunctionPrototypes
struct btophead* /* head */,
char* /* buf */
-#endif
);
extern int ReadBdfToMemory_with_init(
-#if NeedFunctionPrototypes
struct btophead* /* head */,
int /* init_start */,
int /* init_end */,
char* /* buf */
-#endif
);
extern int GetBdfCode(
-#if NeedFunctionPrototypes
struct btophead* /* head */,
char* /* buf */,
int* /* code */
-#endif
);
extern int GetBdfPtn(
-#if NeedFunctionPrototypes
struct btophead* /* head */,
char* /* buf */,
char* /* ptn */,
int /* mwidth */,
int /* bsize */
-#endif
);
extern int ReadGpfToMemory(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */,
char* /* buf */
-#endif
);
extern int GetGpfCode(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */,
char* /* buf */,
int* /* code */
-#endif
);
extern int GetGpfPtn(
-#if NeedFunctionPrototypes
struct ptobhead* /* head */,
char* /* buf */,
char* /* ptn */,
int /* mwidth */,
int /* bsize */
-#endif
);
extern void GetBdfLinePtn(
-#if NeedFunctionPrototypes
char* /* mem */,
char* /* buf */,
int /* width */
-#endif
);
extern void GetGpfLinePtn(
-#if NeedFunctionPrototypes
char* /* mem */,
char* /* buf */,
int /* width */
-#endif
);
extern int PutBdfPtn(
-#if NeedFunctionPrototypes
unsigned char* /* ptn */,
int /* width */,
int /* height */,
FILE* /* fp */
-#endif
);
extern int PutGpfPtn(
-#if NeedFunctionPrototypes
char* /* ptn */,
int /* width */,
int /* height */,
FILE* /* fp */
-#endif
);
extern int PtnZoom(
-#if NeedFunctionPrototypes
char* /* dmem */,
char* /* smem */,
int /* sw */,
int /* sh */,
int /* dw */,
int /* dh */
-#endif
);
extern char *GetTmpPath(
-#if NeedFunctionPrototypes
char* /* path */
-#endif
);
extern int ChkNumString(
-#if NeedFunctionPrototypes
char* /* str */
-#endif
);
extern void ErrMsgTable_AndExit(
-#if NeedFunctionPrototypes
int /* er_no */,
char* /* snf_in */,
char* /* snf_out */,
char* /* gpf_out */,
char* /* bdf_in */,
char* /* prog_name */
-#endif
);
extern void fatal_err_msg(
-#if NeedFunctionPrototypes
int /* er_no */,
char* /* prog_name */
-#endif
);
extern void ChatchSig() ;
extern void Put_File_Create_Err_Msg(
-#if NeedFunctionPrototypes
int /* msg_level */,
char* /* org_name */,
char* /* tmp_name */,
char* /* save_name */,
char* /* com */
-#endif
);
extern int Make_NewFefFile(
-#if NeedFunctionPrototypes
char* /* org_name */,
char* /* tmp_name */,
mode_t /* mode */,
uid_t /* owner */,
gid_t /* group */,
char* /* com */
-#endif
);
extern int Unlink_Tmpfile(
-#if NeedFunctionPrototypes
char* /* file */,
char* /* com */
-#endif
);
extern int Chmod_File (
-#if NeedFunctionPrototypes
char* /* fname */,
mode_t /* mode */,
char* /* com */
-#endif
);
extern int Chown_File (
-#if NeedFunctionPrototypes
char* /* fname */,
uid_t /* owner */,
gid_t /* group */,
char* /* com */
-#endif
);
extern int ChkPcfFontFile(
-#if NeedFunctionPrototypes
char* /* filename */
-#endif
);
extern int ChkSnfFontFile(
-#if NeedFunctionPrototypes
char* /* filename */
-#endif
);
extern char *get_cmd_path(
-#if NeedFunctionPrototypes
char* /* path */,
char* /* cmd */
-#endif
);
extern int SetCmdPath(
-#if NeedFunctionPrototypes
char* /* com */,
char** /* path */,
char* /* dflt_path */,
char* /* cmd */
-#endif
);
extern int
Link_NewFile(
-#if NeedFunctionPrototypes
char * /* rd_file */,
char * /* wr_file */
-#endif
-) ;
+);
--- /dev/null
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
+/* $XConsortium: pcf.h /main/2 1996/02/10 16:25:46 cde-fuj $ */
+/*
+ *
+ * Copyright 1990 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ (c) Copyright 1995 FUJITSU LIMITED
+ This is source code modified by FUJITSU LIMITED under the Joint
+ Development Agreement for the CDEnext PST.
+ This is unpublished proprietary source code of FUJITSU LIMITED
+ */
+
+#ifndef _PCF_H_
+#define _PCF_H_
+
+/*
+ * Information used to read/write PCF fonts
+ */
+
+typedef struct _PCFTable {
+ CARD32 type;
+ CARD32 format;
+ CARD32 size;
+ CARD32 offset;
+} PCFTableRec, *PCFTablePtr;
+
+#define PCF_FILE_VERSION (('p'<<24)|('c'<<16)|('f'<<8)|1)
+#define PCF_FORMAT_MASK 0xffffff00
+
+#define PCF_DEFAULT_FORMAT 0x00000000
+#define PCF_INKBOUNDS 0x00000200
+#define PCF_ACCEL_W_INKBOUNDS 0x00000100
+#define PCF_COMPRESSED_METRICS 0x00000100
+
+#define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK))
+
+#define PCF_GLYPH_PAD_MASK (3<<0)
+#define PCF_BYTE_MASK (1<<2)
+#define PCF_BIT_MASK (1<<3)
+#define PCF_SCAN_UNIT_MASK (3<<4)
+
+#define PCF_BYTE_ORDER(f) (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst)
+#define PCF_BIT_ORDER(f) (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst)
+#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK)
+#define PCF_GLYPH_PAD(f) (1<<PCF_GLYPH_PAD_INDEX(f))
+#define PCF_SCAN_UNIT_INDEX(f) (((f) & PCF_SCAN_UNIT_MASK) >> 4)
+#define PCF_SCAN_UNIT(f) (1<<PCF_SCAN_UNIT_INDEX(f))
+#define PCF_FORMAT_BITS(f) ((f) & (PCF_GLYPH_PAD_MASK|PCF_BYTE_MASK|PCF_BIT_MASK|PCF_SCAN_UNIT_MASK))
+
+#define PCF_SIZE_TO_INDEX(s) ((s) == 4 ? 2 : (s) == 2 ? 1 : 0)
+#define PCF_INDEX_TO_SIZE(b) (1<<b)
+
+#define PCF_FORMAT(bit,byte,glyph,scan) (\
+ (PCF_SIZE_TO_INDEX(scan) << 4) | \
+ (((bit) == MSBFirst ? 1 : 0) << 3) | \
+ (((byte) == MSBFirst ? 1 : 0) << 2) | \
+ (PCF_SIZE_TO_INDEX(glyph) << 0))
+
+#define PCF_PROPERTIES (1<<0)
+#define PCF_ACCELERATORS (1<<1)
+#define PCF_METRICS (1<<2)
+#define PCF_BITMAPS (1<<3)
+#define PCF_INK_METRICS (1<<4)
+#define PCF_BDF_ENCODINGS (1<<5)
+#define PCF_SWIDTHS (1<<6)
+#define PCF_GLYPH_NAMES (1<<7)
+#define PCF_BDF_ACCELERATORS (1<<8)
+
+#endif /* _PCF_H_ */
******************************************************************/
#ifndef SNFSTRUCT_H
#define SNFSTRUCT_H 1
-#include "font.h"
-#include "misc.h"
+#include <X11/fonts/font.h>
#include <X11/Xlib.h>
/*
#define FONT_FILE_VERSION 4
-typedef struct _FontProp {
- CARD32 name; /* offset of string */
- INT32 value; /* number or offset of string */
- Bool indirect; /* value is a string offset */
-} FontPropRec;
-
/*
* the following macro definitions describe a font file image in memory
*/
* pad out glyphs to a CARD32 boundary
*/
#define ADDRXFONTPROPS( pfi) \
- ((DIXFontProp *) ((char *)ADDRCHARGLYPHS( pfi) + BYTESOFGLYPHINFO(pfi)))
+ ((DIXFontProp *) (char *)ADDRCHARGLYPHS( pfi))
#define ADDRSTRINGTAB( pfi) \
((char *)ADDRXFONTPROPS( pfi) + BYTESOFPROPINFO(pfi))
#define BYTESOFCHARINFO(pfi) (sizeof(CharInfoRec) * n2dChars(pfi))
#define BYTESOFPROPINFO(pfi) (sizeof(FontPropRec) * (pfi)->nProps)
#define BYTESOFSTRINGINFO(pfi) ((pfi)->lenStrings)
-#define BYTESOFGLYPHINFO(pfi) (((pfi)->maxbounds.byteOffset+3) & ~0x3)
#define BYTESOFINKINFO(pfi) (sizeof(CharInfoRec) * (2 + n2dChars(pfi)))
#endif /* SNFSTRUCT_H */
+
snprintf( (buf), sizeof((buf)), " -i " ) ; \
snprintf( (command), sizeof((command)), "%s %s > %s", bdftosnf, (buf), (out_file) ); \
}
-#define COMM_SNF_FILEVERSION( snf_fd, finf, buf, permission ) { \
- read( (snf_fd), (buf), sizeof(FontInfoRec) ); \
- close( (snf_fd) ); \
- (finf) = (FontInfoRec *) (buf) ; \
- if( \
- ((finf)->version1 != FONT_FILE_VERSION) || \
- ((finf)->version2 != FONT_FILE_VERSION) \
- ) \
- (permission) = -1 ; \
-}
#define COMM_SNF_NEWTARGET( permission ) (permission) = 0
#define COMM_SNF_EXECLBDFTOSNF( permission, buf, snf_file ) { \
execl( bdftosnf, bdftosnf, "-i", 0 ); \
/* case of a snf former font */
#define FAL_GET_SNF_HEADER( buf, protect_key_data, fal_utyerror, fal_utyderror, fd, finf, openfontfile ) { \
(finf)->pFinf = ( FontInfoPtr )(buf); \
- if ( \
- ((finf)->pFinf->version1 != (finf)->pFinf->version2) || \
- ((finf)->pFinf->version1 != FONT_FILE_VERSION) \
- ) { \
- set_errfile_str( fal_err_file, (openfontfile) ) ; \
- (fal_utyerror) = _FAL_FONT_ER; \
- (fal_utyderror) = 0; \
- fal_utyerrno = FAL_ERR_FONT ; \
- fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ; \
- goto FalError01 ; \
- } else { \
(finf)->isFef = TRUE ; \
(finf)->isPcf = FALSE; \
- } \
}
/* falReadGpfProp() */
(finf)->isFef = TRUE; \
(finf)->isPcf = FALSE; \
(finf)->pFinf = ( FontInfoPtr )(finf)->buf ; \
- if ( /* not a snf or fef format */ \
- ((finf)->pFinf->version1 != (finf)->pFinf->version2) || \
- ((finf)->pFinf->version1 != FONT_FILE_VERSION) \
- ) { \
- return _FAL_TRY_NEXT ; \
- } \
}
#define ISOPTFONT( file ) 1
static char *neverFreeTable = NULL;
static int neverFreeTableSize = 0;
-static char *permalloc(length)
- register unsigned int length;
+static char *permalloc(unsigned int length)
{
char *ret;
return(ret);
}
-#ifndef WORD64
typedef struct {char a; double b;} TestType1;
typedef struct {char a; unsigned long b;} TestType2;
-#endif
#ifdef XTHREADS
static char *_falpermalloc();
-char *falpermalloc(length)
- unsigned int length;
+char *falpermalloc(unsigned int length)
{
char *p;
static
#endif /* XTHREADS */
-char *falpermalloc(length)
- unsigned int length;
+char *falpermalloc(unsigned int length)
{
int i;
if (neverFreeTableSize && length < NEVERFREETABLESIZE) {
-#ifndef WORD64
if ((sizeof(TestType1) !=
(sizeof(TestType2) - sizeof(unsigned long) + sizeof(double))) &&
!(length & (DALIGN-1)) &&
neverFreeTableSize -= DALIGN - i;
neverFreeTable += DALIGN - i;
} else
-#endif
if (i = (NEVERFREETABLESIZE - neverFreeTableSize) & (WALIGN-1)) {
neverFreeTableSize -= WALIGN - i;
neverFreeTable += WALIGN - i;
}
static Bool
-ExpandQuarkTable()
+ExpandQuarkTable(void)
{
unsigned long oldmask, newmask;
- register char c, *s;
- register Entry *oldentries, *entries;
- register Entry entry;
- register int oldidx, newidx, rehash;
+ char c, *s;
+ Entry *oldentries, *entries;
+ Entry entry;
+ int oldidx, newidx, rehash;
Signature sig;
XrmQuark q;
return True;
}
-#if NeedFunctionPrototypes
XrmQuark _falrmInternalStringToQuark(
- register _Xconst char *name, register int len, register Signature sig,
- Bool permstring)
-#else
-XrmQuark _falrmInternalStringToQuark(name, len, sig, permstring)
- register XrmString name;
- register int len;
- register Signature sig;
- Bool permstring;
-#endif
+ const char *name, int len, Signature sig, Bool permstring)
{
- register XrmQuark q;
- register Entry entry;
- register int idx, rehash;
- register int i;
- register char *s1, *s2;
+ XrmQuark q;
+ Entry entry;
+ int idx;
+ int rehash = 0;
+ int i;
+ char *s1, *s2;
char *new;
- rehash = 0;
idx = HASH(sig);
_XLockMutex(_Xglobal_lock);
while (entry = quarkTable[idx]) {
if (entry & LARGEQUARK)
q = entry & (LARGEQUARK-1);
else {
- if ((entry - sig) & XSIGMASK)
- goto nomatch;
+ if ((entry - sig) & XSIGMASK){
+ if (!rehash)
+ rehash = REHASHVAL(sig);
+ idx = REHASH(idx, rehash);
+ continue;
+ }
q = (entry >> QUARKSHIFT) & QUARKMASK;
}
for (i = len, s1 = (char *)name, s2 = NAME(q); --i >= 0; ) {
- if (*s1++ != *s2++)
- goto nomatch;
+ if (*s1++ != *s2++){
+ if (!rehash)
+ rehash = REHASHVAL(sig);
+ idx = REHASH(idx, rehash);
+ continue;
+ }
}
if (*s2) {
-nomatch: if (!rehash)
+ if (!rehash)
rehash = REHASHVAL(sig);
idx = REHASH(idx, rehash);
continue;
_XUnlockMutex(_Xglobal_lock);
return q;
}
- if (nextUniq == nextQuark)
- goto fail;
+ if (nextUniq == nextQuark){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
if ((nextQuark + (nextQuark >> 2)) > quarkMask) {
- if (!ExpandQuarkTable())
- goto fail;
+ if (!ExpandQuarkTable()){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
_XUnlockMutex(_Xglobal_lock);
return _falrmInternalStringToQuark(name, len, sig, permstring);
}
if (!(q & CHUNKMASK)) {
if (!(new = Xrealloc((char *)stringTable,
sizeof(XrmString *) *
- ((q >> QUANTUMSHIFT) + CHUNKPER))))
- goto fail;
+ ((q >> QUANTUMSHIFT) + CHUNKPER)))){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
stringTable = (XrmString **)new;
#ifdef PERMQ
if (!(new = Xrealloc((char *)permTable,
sizeof(Bits *) *
- ((q >> QUANTUMSHIFT) + CHUNKPER))))
- goto fail;
+ ((q >> QUANTUMSHIFT) + CHUNKPER)))){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
permTable = (Bits **)new;
#endif
}
new = falpermalloc(QUANTSIZE);
- if (!new)
- goto fail;
+ if (!new){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
stringTable[q >> QUANTUMSHIFT] = (XrmString *)new;
#ifdef PERMQ
permTable[q >> QUANTUMSHIFT] = (Bits *)(new + STRQUANTSIZE);
#else
name = permalloc(len+1);
#endif
- if (!name)
- goto fail;
+ if (!name){
+ _XUnlockMutex(_Xglobal_lock);
+ return NULLQUARK;
+ }
for (i = len, s1 = (char *)name; --i >= 0; )
*s1++ = *s2++;
*s1++ = '\0';
nextQuark++;
_XUnlockMutex(_Xglobal_lock);
return q;
- fail:
- _XUnlockMutex(_Xglobal_lock);
- return NULLQUARK;
}
-#if NeedFunctionPrototypes
-XrmQuark falrmStringToQuark(
- _Xconst char *name)
-#else
-XrmQuark falrmStringToQuark(name)
- XrmString name;
-#endif
+XrmQuark falrmStringToQuark(const char *name)
{
- register char c, *tname;
- register Signature sig = 0;
+ char c, *tname;
+ Signature sig = 0;
if (!name)
return (NULLQUARK);
return _falrmInternalStringToQuark(name, tname-(char *)name-1, sig, False);
}
-#if NeedFunctionPrototypes
XrmQuark falrmPermStringToQuark(
- _Xconst char *name)
-#else
-XrmQuark falrmPermStringToQuark(name)
- XrmString name;
-#endif
+ const char *name)
{
- register char c, *tname;
- register Signature sig = 0;
+ char c, *tname;
+ Signature sig = 0;
if (!name)
return (NULLQUARK);
return _falrmInternalStringToQuark(name, tname-(char *)name-1, sig, True);
}
-XrmQuark falrmUniqueQuark()
+XrmQuark falrmUniqueQuark(void)
{
XrmQuark q;
return q;
}
-XrmString falrmQuarkToString(quark)
- register XrmQuark quark;
+XrmString falrmQuarkToString(XrmQuark quark)
{
XrmString s;
#ifdef X_LOCALE
-/* alternative setlocale() for when the OS does not provide one */
-
-#ifdef X_NOT_STDC_ENV
-extern char *getenv();
-#endif
-
#define MAXLOCALE 64 /* buffer size of locale name */
-#if NeedFunctionPrototypes
-char *
-_falsetlocale(
- int category,
- _Xconst char *name
-)
-#else
char *
-_falsetlocale(category, name)
- int category;
- char *name;
-#endif
+_falsetlocale(int category, const char *name)
{
static char *xsl_name;
char *old_name;
*/
char *
-_fallcMapOSLocaleName(osname, siname)
- char *osname;
- char *siname;
+_fallcMapOSLocaleName(char *osname, char *siname)
{
-#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || defined(sgi) || defined(AIXV3) || defined(ultrix) || defined(WIN32)
+#if defined(hpux) || defined(CSRG_BASED) || defined(sun) || defined(SVR4) || \
+ defined(WIN32)
+
#ifdef hpux
#define SKIPCOUNT 2
#define STARTCHAR ':'
#define ENDCHAR ';'
-#else
-#ifdef ultrix
-#define SKIPCOUNT 2
-#define STARTCHAR '\001'
-#define ENDCHAR '\001'
-#else
-#ifdef WIN32
+#elif defined(WIN32)
#define SKIPCOUNT 1
#define STARTCHAR '='
#define ENDCHAR ';'
#define WHITEFILL
-#else
-#if defined(AIXV3)
-#define STARTCHAR ' '
-#define ENDCHAR ' '
-#else
-#if !defined(sun) || defined(SVR4)
+#elif !defined(sun) || defined(SVR4)
#define STARTCHAR '/'
-#endif
#define ENDCHAR '/'
-#endif
-#endif
-#endif
#endif
char *start;
char *end;
int len;
-#ifdef SKIPCOUNT
- int n;
-#endif
start = osname;
#ifdef SKIPCOUNT
+ int = n;
for (n = SKIPCOUNT;
--n >= 0 && start && (start = strchr (start, STARTCHAR));
start++)
{ "JISX0208.1983-0:GR", "\033$)B" },
{ "KSC5601.1987-0:GL", "\033$(C" },
{ "KSC5601.1987-0:GR", "\033$)C" },
-#ifdef notdef
- { "JISX0212.1990-0:GL", "\033$(D" },
- { "JISX0212.1990-0:GR", "\033$)D" },
- { "CNS11643.1986-1:GL", "\033$(G" },
- { "CNS11643.1986-1:GR", "\033$)G" },
- { "CNS11643.1986-2:GL", "\033$(H" },
- { "CNS11643.1986-2:GR", "\033$)H" },
-
- /* Non-Standard Character Set Encodings */
- { "TIS620.2533-1:GR", "\033-T"},
-#endif
} ;
#define XctC0 0x0000
static CTInfo ct_list = NULL;
static CTInfo
-_XlcGetCTInfoFromEncoding(encoding, length)
- register char *encoding;
- register int length;
+_XlcGetCTInfoFromEncoding(char *encoding, int length)
{
- register CTInfo ct_info;
+ CTInfo ct_info;
for (ct_info = ct_list; ct_info; ct_info = ct_info->next) {
if (length >= ct_info->encoding_len) {
}
static unsigned int
-_XlcParseCT(parse, text, length)
- register CTParse parse;
- char **text;
- int *length;
+_XlcParseCT(CTParse parse, char **text, int *length)
{
unsigned int ret = 0;
unsigned char ch;
- register unsigned char *str = (unsigned char *) *text;
+ unsigned char *str = (unsigned char *) *text;
bzero((char *) parse, sizeof(CTParseRec));
parse->ext_seg_length = (*str - 128) * 128 + *(str + 1) - 128;
str += 2;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
} else if (*str == XctCntrlFunc && *length >= 4 &&
*(str + 1) >= 0x20 && *(str + 1) <= 0x2f &&
(*(str + 2) == XctIgnoreExt ||
parse->version = *str++ - 0x20;
ret = *str++;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
}
if (*str == XctMB) { /* multiple-byte sets */
parse->ct_info = _XlcGetCTInfoFromEncoding(*text, *length);
}
str++;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
case XctCSI:
/* direction */
if (*str == XctLeftToRight && *(str + 1) == XctDirection) {
ret = XctLeftToRight;
str += 2;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
} else if (*str == XctRightToLeft && *(str + 1) == XctDirection) {
ret = XctRightToLeft;
str += 2;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
} else if (*str == XctDirectionEnd) {
ret = XctDirectionEnd;
str++;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
}
SKIP_P(str)
ret = XctCSISeq;
str++;
- goto done;
+ *length -= (char *) str - *text;
+ *text = (char *) str;
+ return ret;
}
if (ch & 0x80) {
ret = XctGL;
}
- return ret;
-
-done:
- *length -= (char *) str - *text;
- *text = (char *) str;
-
return ret;
}
XlcCharSet
-_fallcAddCT(name, encoding)
- char *name;
- char *encoding;
+_fallcAddCT(char *name, char *encoding)
{
CTInfo ct_info;
XlcCharSet charset;
}
static CTInfo
-_XlcGetCTInfoFromCharSet(charset)
- register XlcCharSet charset;
+_XlcGetCTInfoFromCharSet(XlcCharSet charset)
{
- register CTInfo ct_info;
+ CTInfo ct_info;
for (ct_info = ct_list; ct_info; ct_info = ct_info->next)
if (ct_info->charset == charset)
}
Bool
-_fallcParseCharSet(charset)
- XlcCharSet charset;
+_fallcParseCharSet(XlcCharSet charset)
{
CTParseRec parse;
char *ptr, buf[BUFSIZ];
static void init_converter();
Bool
-_fallcInitCTInfo()
+_fallcInitCTInfo(void)
{
- register XlcCharSet charset;
- register CTData ct_data;
- register int num;
+ XlcCharSet charset;
+ CTData ct_data;
+ int num;
if (ct_list == NULL) {
num = sizeof(default_ct_data) / sizeof(CTDataRec);
static int
-_XlcCheckCTSequence(state, ctext, ctext_len)
- State state;
- char **ctext;
- int *ctext_len;
+_XlcCheckCTSequence(State state, char **ctext, int *ctext_len)
{
XlcCharSet charset;
CTParseRec parse;
static void
-init_state(conv)
- XlcConv conv;
+init_state(XlcConv conv)
{
State state = (State) conv->state;
static XlcCharSet GL_charset = NULL;
}
static int
-cttocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+cttocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register State state = (State) conv->state;
- register unsigned char ch;
+ State state = (State) conv->state;
+ unsigned char ch;
int length;
XlcCharSet charset = NULL;
char *ctptr, *bufptr;
}
static int
-cstoct(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+cstoct(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XlcSide side;
- unsigned char min_ch, max_ch;
- register unsigned char ch;
+ unsigned char min_ch, max_ch, ch;
int length;
CTInfo ct_info;
XlcCharSet charset;
}
static int
-strtocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+strtocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
- register char *src, *dst;
+ char *src, *dst;
unsigned char side;
- register length;
+ int length;
src = (char *) *from;
dst = (char *) *to;
}
static int
-cstostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+cstostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
char *csptr, *string_ptr;
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
if (conv->state)
Xfree((char *) conv->state);
}
static XlcConv
-create_conv(methods)
- XlcConvMethods methods;
+create_conv(XlcConvMethods methods)
{
- register XlcConv conv;
+ XlcConv conv;
conv = (XlcConv) Xmalloc(sizeof(XlcConvRec));
if (conv == NULL)
return (XlcConv) NULL;
conv->state = (XPointer) Xmalloc(sizeof(StateRec));
- if (conv->state == NULL)
- goto err;
+ if (conv->state == NULL) {
+ close_converter(conv);
+ return (XlcConv) NULL;
+ }
conv->methods = methods;
init_state(conv);
return conv;
-
-err:
- close_converter(conv);
-
- return (XlcConv) NULL;
}
static XlcConvMethodsRec cttocs_methods = {
} ;
static XlcConv
-open_cttocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cttocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(&cttocs_methods);
}
} ;
static XlcConv
-open_cstoct(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstoct(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(&cstoct_methods);
}
} ;
static XlcConv
-open_strtocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_strtocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(&strtocs_methods);
}
} ;
static XlcConv
-open_cstostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstostr(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(&cstostr_methods);
}
static void
-init_converter()
+init_converter(void)
{
_fallcSetConverter((XLCd) NULL, XlcNCompoundText, (XLCd) NULL, XlcNCharSet,
open_cttocs);
#include "_fallibint.h"
#include "_fallcPublic.h"
-#if NeedVarargsPrototypes
char *
_fallcGetCSValues(XlcCharSet charset, ...)
-#else
-char *
-_fallcGetCSValues(charset, va_alist)
- XlcCharSet charset;
- va_dcl
-#endif
{
va_list var;
XlcArgList args;
static XlcCharSetList charset_list = NULL;
XlcCharSet
-_fallcGetCharSet(name)
- char *name;
+_fallcGetCharSet(char *name)
{
XlcCharSetList list;
XrmQuark xrm_name;
}
Bool
-_fallcAddCharSet(charset)
- XlcCharSet charset;
+_fallcAddCharSet(XlcCharSet charset)
{
XlcCharSetList list;
};
static char *
-get_values(charset, args, num_args)
- register XlcCharSet charset;
- register XlcArgList args;
- register int num_args;
+get_values(XlcCharSet charset, XlcArgList args, int num_args)
{
if (resources[0].xrm_name == NULLQUARK)
_fallcCompileResourceList(resources, XlcNumber(resources));
}
XlcCharSet
-_fallcCreateDefaultCharSet(name, ct_sequence)
- char *name;
- char *ct_sequence;
+_fallcCreateDefaultCharSet(char *name, char *ct_sequence)
{
XlcCharSet charset;
static XlcConverterList conv_list = NULL;
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
(*conv->methods->close)(conv);
}
static XlcConv
-get_converter(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- XrmQuark from_type;
- XLCd to_lcd;
- XrmQuark to_type;
+get_converter(
+ XLCd from_lcd,
+ XrmQuark from_type,
+ XLCd to_lcd,
+ XrmQuark to_type)
{
- register XlcConverterList list, prev = NULL;
+ XlcConverterList list, prev = NULL;
XlcConv conv;
for (list = conv_list; list; list = list->next) {
}
Bool
-_fallcSetConverter(from_lcd, from, to_lcd, to, converter)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
- XlcOpenConverterProc converter;
+_fallcSetConverter(
+ XLCd from_lcd,
+ char *from,
+ XLCd to_lcd,
+ char *to,
+ XlcOpenConverterProc converter)
{
- register XlcConverterList list;
- register XrmQuark from_type, to_type;
+ XlcConverterList list;
+ XrmQuark from_type, to_type;
from_type = falrmStringToQuark(from);
to_type = falrmStringToQuark(to);
} ConvRec, *Conv;
static int
-indirect_convert(lc_conv, from, from_left, to, to_left, args, num_args)
- XlcConv lc_conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+indirect_convert(
+ XlcConv lc_conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
Conv conv = (Conv) lc_conv->state;
XlcConv from_conv = conv->from_conv;
}
static void
-close_indirect_converter(lc_conv)
- XlcConv lc_conv;
+close_indirect_converter(XlcConv lc_conv)
{
Conv conv = (Conv) lc_conv->state;
}
static void
-reset_indirect_converter(lc_conv)
- XlcConv lc_conv;
+reset_indirect_converter(XlcConv lc_conv)
{
Conv conv = (Conv) lc_conv->state;
} ;
static XlcConv
-open_indirect_converter(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_indirect_converter(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
XlcConv lc_conv, from_conv, to_conv;
Conv conv;
lc_conv->methods = &conv_methods;
lc_conv->state = (XPointer) Xmalloc(sizeof(ConvRec));
- if (lc_conv->state == NULL)
- goto err;
+ if (lc_conv->state == NULL){
+ close_indirect_converter(lc_conv);
+ return (XlcConv) NULL;
+ }
conv = (Conv) lc_conv->state;
from_conv = get_converter((XLCd)NULL, from_type, (XLCd)NULL, QCharSet);
if (from_conv == NULL)
from_conv = get_converter(from_lcd, from_type, from_lcd, QChar);
- if (from_conv == NULL)
- goto err;
+ if (from_conv == NULL){
+ close_indirect_converter(lc_conv);
+ return (XlcConv) NULL;
+ }
conv->from_conv = from_conv;
to_conv = get_converter(to_lcd, QCTCharSet, to_lcd, to_type);
to_conv = get_converter(to_lcd, QCharSet, to_lcd, to_type);
if (to_conv == NULL)
to_conv = get_converter((XLCd) NULL, QCharSet, (XLCd) NULL, to_type);
- if (to_conv == NULL)
- goto err;
+ if (to_conv == NULL){
+ close_indirect_converter(lc_conv);
+ return (XlcConv) NULL;
+ }
conv->to_conv = to_conv;
return lc_conv;
-
-err:
- close_indirect_converter(lc_conv);
-
- return (XlcConv) NULL;
}
XlcConv
-_fallcOpenConverter(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+_fallcOpenConverter(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
XlcConv conv;
XrmQuark from_type, to_type;
}
void
-_fallcCloseConverter(conv)
- XlcConv conv;
+_fallcCloseConverter(XlcConv conv)
{
close_converter(conv);
}
int
-_fallcConvert(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+_fallcConvert(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
return (*conv->methods->convert)(conv, from, from_left, to, to_left, args,
num_args);
}
void
-_fallcResetConverter(conv)
- XlcConv conv;
+_fallcResetConverter(XlcConv conv)
{
if (conv->methods->reset)
(*conv->methods->reset)(conv);
* SOFTWARE.
*
*/
-#ifndef NOT_X_ENV
#include "syncx.h"
#include <X11/Xresource.h>
#include "_fallibint.h"
#include "_fallcPubI.h"
-#else /* NOT_X_ENV */
-
-#define Xmalloc malloc
-#define Xrealloc realloc
-#define Xfree free
-
-#endif /* NOT_X_ENV */
-
/* specifying NOT_X_ENV allows users to just use
the database parsing routine. */
/* For UDC/VW */
static DBParseInfo parse_info;
-static void init_parse_info()
+static void init_parse_info(void)
{
static int first = 1;
char *ptr;
}
static void
-clear_parse_info()
+clear_parse_info(void)
{
int i;
char *ptr;
}
static Bool
-realloc_parse_info(len)
-int len;
+realloc_parse_info(int len)
{
char *p;
} Line;
static void
-free_line(line)
- Line *line;
+free_line(Line *line)
{
if(line->str != NULL){
Xfree(line->str);
}
static int
-realloc_line(line, size)
- Line *line;
- int size;
+realloc_line(Line *line, int size)
{
char *str = line->str;
#define iswhite(ch) ((ch) == SYM_SPACE || (ch) == SYM_TAB)
static void
-zap_comment(str, quoted)
- char *str;
- int *quoted;
+zap_comment(char *str, int *quoted)
{
char *p = str;
-#ifdef never
- *quoted = 0;
- if(*p == SYM_COMMENT){
- int len = strlen(str);
- if(p[len - 1] == SYM_NEWLINE){
- *p++ = SYM_NEWLINE;
- }
- *p = '\0';
- }
-#else
+
while(*p){
if(*p == SYM_DOUBLE_QUOTE){
if(p == str || p[-1] != SYM_BACKSLASH){
}
++p;
}
-#endif
+
}
static int
-read_line(fd, line)
- FILE *fd;
- Line *line;
+read_line(FILE *fd, Line *line)
{
char buf[BUFSIZE], *p;
int len;
if(cur + len + 1 > line->maxsize){
/* need to reallocate buffer. */
if(! realloc_line(line, line->maxsize + BUFSIZE)){
- goto err; /* realloc error. */
+ return -1; /* realloc error. */
}
str = line->str;
}
}
if(quoted){
/* error. still in quoted state. */
- goto err;
+ return -1;
}
return line->cursize = cur;
-
- err:;
- return -1;
}
/************************************************************************/
static Token
-get_token(str)
- char *str;
+get_token(char *str)
{
switch(*str){
case SYM_NEWLINE: return T_NEWLINE;
}
static int
-get_word(str, word)
- char *str;
- char *word;
+get_word(char *str, char *word)
{
char *p = str, *w = word;
Token token;
}
static int
-get_quoted_word(str, word)
- char *str;
- char *word;
+get_quoted_word(char *str, char *word)
{
char *p = str, *w = word;
Token token;
token_len = token_tbl[token].len;
if(token == T_DOUBLE_QUOTE){
p += token_len;
- goto found;
+ *w = '\0';
+ return p - str;
}
if(token == T_BACKSLASH){
p += token_len;
}
/* error. cannot detect next double quote */
return 0;
-
- found:;
- *w = '\0';
- return p - str;
}
/************************************************************************/
static int
-append_value_list()
+append_value_list(void)
{
char **value_list = parse_info.value;
char *value = NULL;
parse_info.bufsize = 0;
return 1;
- err:;
+ err:
if(value_list){
Xfree((char **)value_list);
}
}
static int
-construct_name(name)
- char *name;
+construct_name(char *name)
{
- register int i, len = 0;
+ int i, len = 0;
char *p = name;
for(i = 0; i <= parse_info.nest_depth; ++i){
}
static int
-store_to_database(db)
- Database *db;
+store_to_database(Database *db)
{
Database new = (Database)NULL;
char name[BUFSIZE];
- if(parse_info.pre_state == S_VALUE){
- if(! append_value_list()){
- goto err;
+ while(1){
+
+ if(parse_info.pre_state == S_VALUE){
+ if(! append_value_list()){
+ break;
+ }
}
- }
- if(parse_info.name[parse_info.nest_depth] == NULL){
- goto err;
- }
+ if(parse_info.name[parse_info.nest_depth] == NULL){
+ break;
+ }
- new = (Database)Xmalloc(sizeof(DatabaseRec));
- if(new == (Database)NULL){
- goto err;
- }
- bzero(new, sizeof(DatabaseRec));
+ new = (Database)Xmalloc(sizeof(DatabaseRec));
+ if(new == (Database)NULL){
+ break;
+ }
+ bzero(new, sizeof(DatabaseRec));
- new->category = (char *)Xmalloc(strlen(parse_info.category) + 1);
- if(new->category == NULL){
- goto err;
- }
- strcpy(new->category, parse_info.category);
+ new->category = (char *)Xmalloc(strlen(parse_info.category) + 1);
+ if(new->category == NULL){
+ break;
+ }
+ strcpy(new->category, parse_info.category);
- if(! construct_name(name)){
- goto err;
- }
- new->name = (char *)Xmalloc(strlen(name) + 1);
- if(new->name == NULL){
- goto err;
- }
- strcpy(new->name, name);
- new->next = *db;
- new->value = parse_info.value;
- new->value_num = parse_info.value_num;
- *db = new;
+ if(! construct_name(name)){
+ break;
+ }
+ new->name = (char *)Xmalloc(strlen(name) + 1);
+ if(new->name == NULL){
+ break;
+ }
+ strcpy(new->name, name);
+ new->next = *db;
+ new->value = parse_info.value;
+ new->value_num = parse_info.value_num;
+ *db = new;
- Xfree(parse_info.name[parse_info.nest_depth]);
- parse_info.name[parse_info.nest_depth] = NULL;
+ Xfree(parse_info.name[parse_info.nest_depth]);
+ parse_info.name[parse_info.nest_depth] = NULL;
- parse_info.value = (char **)NULL;
- parse_info.value_num = 0;
- parse_info.value_len = 0;
+ parse_info.value = (char **)NULL;
+ parse_info.value_num = 0;
+ parse_info.value_len = 0;
- return 1;
+ return 1;
+ }
- err:;
if(new){
if(new->category){
Xfree(new->category);
#define END_MARK_LEN 3 /*strlen(END_MARK)*/
static int
-check_category_end(str)
- char *str;
+check_category_end(char *str)
{
char *p;
int len;
/************************************************************************/
static int
-f_newline(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_newline(char *str, Token token, Database *db)
{
switch(parse_info.pre_state){
case S_NULL:
case S_CATEGORY:
break;
case S_NAME:
- goto err; /* no value */
+ return 0; /* no value */
case S_VALUE:
if(!store_to_database(db)){
- goto err;
+ return 0;
}
parse_info.pre_state = S_CATEGORY;
break;
default:
- goto err;
+ return 0;
}
return token_tbl[token].len;
-
- err:;
- return 0;
}
static int
-f_comment(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_comment(char *str, Token token, Database *db)
{
/* NOTE: comment is already handled in read_line(),
so this function is not necessary. */
}
static int
-f_white(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_white(char *str, Token token, Database *db)
{
char *p = str;
}
static int
-f_semicolon(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_semicolon(char *str, Token token, Database *db)
{
switch(parse_info.pre_state){
case S_NULL:
case S_CATEGORY:
case S_NAME:
- goto err;
+ return 0;
case S_VALUE:
if(! append_value_list()){
- goto err;
+ return 0;
}
parse_info.pre_state = S_VALUE;
break;
default:
- goto err;
+ return 0;
}
return token_tbl[token].len;
-
- err:;
- return 0;
}
static int
-f_left_brace(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_left_brace(char *str, Token token, Database *db)
{
switch(parse_info.pre_state){
case S_NULL:
case S_CATEGORY:
- goto err;
+ return 0;
case S_NAME:
if(parse_info.name[parse_info.nest_depth] == NULL ||
parse_info.nest_depth + 1 > MAX_NAME_NEST){
- goto err;
+ return 0;
}
++parse_info.nest_depth;
parse_info.pre_state = S_CATEGORY;
break;
case S_VALUE:
default:
- goto err;
+ return 0;
}
return token_tbl[token].len;
-
- err:
- return 0;
}
static int
-f_right_brace(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_right_brace(char *str, Token token, Database *db)
{
if(parse_info.nest_depth < 1){
- goto err;
+ return 0;
}
switch(parse_info.pre_state){
case S_NULL:
case S_NAME:
- goto err;
+ return 0;
case S_VALUE:
if(! store_to_database(db)){
- goto err;
+ return 0;
}
/* fall into next case */
case S_CATEGORY:
parse_info.pre_state = S_CATEGORY;
break;
default:
- goto err;
+ return 0;
}
return token_tbl[token].len;
-
- err:;
- return 0;
}
static int
-f_double_quote(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_double_quote(char *str, Token token, Database *db)
{
char word[BUFSIZE];
int len = 0;
switch(parse_info.pre_state){
case S_NULL:
case S_CATEGORY:
- goto err;
+ return 0;
case S_NAME:
case S_VALUE:
len = get_quoted_word(str, word);
if(len < 1){
- goto err;
+ return 0;
}
if( (parse_info.bufsize + (int)strlen(word) +1)
>= parse_info.bufMaxSize){
if(realloc_parse_info(strlen(word) +1) == False){
- goto err;
+ return 0;
}
}
strcpy(&parse_info.buf[parse_info.bufsize], word);
parse_info.pre_state = S_VALUE;
break;
default:
- goto err;
+ return 0;
}
return len; /* including length of token */
-
- err:;
- return 0;
}
static int
-f_backslash(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_backslash(char *str, Token token, Database *db)
{
return f_default(str, token, db);
}
static int
-f_numeric(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_numeric(char *str, Token token, Database *db)
{
char word[BUFSIZE], *p;
int len;
switch(parse_info.pre_state){
case S_NULL:
case S_CATEGORY:
- goto err;
+ return 0;
case S_NAME:
case S_VALUE:
token_len = token_tbl[token].len;
p = str + token_len;
len = get_word(p, word);
if(len < 1){
- goto err;
+ return 0;
}
if( (parse_info.bufsize + token_len + (int)strlen(word) +1)
>= parse_info.bufMaxSize){
if(realloc_parse_info(token_len + strlen(word) +1) == False){
- goto err;
+ return 0;
}
}
strncpy(&parse_info.buf[parse_info.bufsize], str, token_len);
parse_info.pre_state = S_VALUE;
break;
default:
- goto err;
+ return 0;
}
return len + token_len;
-
- err:;
- return 0;
}
static int
-f_default(str, token, db)
- char *str;
- Token token;
- Database *db;
+f_default(char *str, Token token, Database *db)
{
char word[BUFSIZE], *p;
int len;
len = get_word(str, word);
if(len < 1){
- goto err;
+ return 0;
}
switch(parse_info.pre_state){
case S_NULL:
if(parse_info.category != NULL){
- goto err;
+ return 0;
}
p = (char *)Xmalloc(strlen(word) + 1);
if(p == NULL){
- goto err;
+ return 0;
}
strcpy(p, word);
parse_info.category = p;
}
p = (char *)Xmalloc(strlen(word) + 1);
if(p == NULL){
- goto err;
+ return 0;
}
strcpy(p, word);
if(parse_info.name[parse_info.nest_depth] != NULL){
if( (parse_info.bufsize + (int)strlen(word) +1 )
>= parse_info.bufMaxSize){
if(realloc_parse_info(strlen(word) +1) == False){
- goto err;
+ return 0;
}
}
strcpy(&parse_info.buf[parse_info.bufsize], word);
parse_info.pre_state = S_VALUE;
break;
default:
- goto err;
+ return 0;
}
return len;
-
- err:;
- return 0;
}
/************************************************************************/
#ifdef DEBUG
static void
-PrintDatabase(db)
- Database db;
+PrintDatabase(Database db)
{
Database p = db;
int i = 0, j;
#endif
static void
-DestroyDatabase(db)
- Database db;
+DestroyDatabase(Database db)
{
Database p = db;
}
static int
-CountDatabase(db)
- Database db;
+CountDatabase(Database db)
{
Database p = db;
int cnt = 0;
}
static Database
-CreateDatabase(dbfile)
- char *dbfile;
+CreateDatabase(char *dbfile)
{
Database db = (Database)NULL;
FILE *fd;
/************************************************************************/
-#ifndef NOT_X_ENV
-
/* locale framework functions */
typedef struct _XlcDatabaseRec {
/* This function retrieves XLocale database information. */
/************************************************************************/
void
-_fallcGetResource(lcd, category, class, value, count)
- XLCd lcd;
- char *category;
- char *class;
- char ***value;
- int *count;
+_fallcGetResource(
+ XLCd lcd,
+ char *category,
+ char *class,
+ char ***value,
+ int *count)
{
XLCdPublicMethodsPart *methods = XLC_PUBLIC_METHODS(lcd);
/* This function retrieves XLocale database information. */
/************************************************************************/
void
-_fallcGetLocaleDataBase(lcd, category, name, value, count)
- XLCd lcd;
- char *category;
- char *name;
- char ***value;
- int *count;
+_fallcGetLocaleDataBase(
+ XLCd lcd,
+ char *category,
+ char *name,
+ char ***value,
+ int *count)
{
XlcDatabase lc_db = (XlcDatabase)XLC_PUBLIC(lcd, xlocale_db);
XrmQuark category_q, name_q;
}
/************************************************************************/
-/* _fallcDestroyLocaleDataBase(lcd) */
+/* _fallcDestroyLocaleDataBase(lcd) */
/*----------------------------------------------------------------------*/
/* This function destroy the XLocale Database that bound to the */
/* specified lcd. If the XLocale Database is referred from some */
/* remove it from the cache list and free work area. */
/************************************************************************/
void
-_fallcDestroyLocaleDataBase(lcd)
- XLCd lcd;
+_fallcDestroyLocaleDataBase(XLCd lcd)
{
XlcDatabase lc_db = (XlcDatabase)XLC_PUBLIC(lcd, xlocale_db);
XlcDatabaseList p, prev;
/* the specified XLCd. */
/************************************************************************/
XPointer
-_fallcCreateLocaleDataBase(lcd)
- XLCd lcd;
+_fallcCreateLocaleDataBase(XLCd lcd)
{
XlcDatabaseList list, new;
Database p, database = (Database)NULL;
n = CountDatabase(database);
lc_db = (XlcDatabase)Xmalloc(sizeof(XlcDatabaseRec) * (n + 1));
if(lc_db == (XlcDatabase)NULL){
- goto err;
+ DestroyDatabase(database);
+ if(lc_db != (XlcDatabase)NULL){
+ Xfree((char *)lc_db);
+ }
+ return (XPointer)NULL;
}
bzero(lc_db, sizeof(XlcDatabaseRec) * (n + 1));
for(p = database, i = 0; p && i < n; p = p->next, ++i){
new = (XlcDatabaseList)Xmalloc(sizeof(XlcDatabaseListRec));
if(new == (XlcDatabaseList)NULL){
- goto err;
+ DestroyDatabase(database);
+ if(lc_db != (XlcDatabase)NULL){
+ Xfree((char *)lc_db);
+ }
+ return (XPointer)NULL;
}
new->name_q = name_q;
new->lc_db = lc_db;
_db_list = new;
return XLC_PUBLIC(lcd, xlocale_db) = (XPointer)lc_db;
-
- err:;
- DestroyDatabase(database);
- if(lc_db != (XlcDatabase)NULL){
- Xfree((char *)lc_db);
- }
- return (XPointer)NULL;
}
-
-#endif /* NOT_X_ENV */
} StateRec, *State;
static int
-strtostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+strtostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register char *src, *dst;
+ char *src, *dst;
unsigned char side;
- register length;
+ int length;
if (from == NULL || *from == NULL)
return 0;
}
static int
-wcstostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wcstostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register wchar_t *src, side;
- register char *dst;
- register length;
+ wchar_t *src, side;
+ char *dst;
+ int length;
if (from == NULL || *from == NULL)
return 0;
}
static int
-cstostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+cstostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register char *src, *dst;
+ char *src, *dst;
unsigned char side;
- register length;
+ int length;
if (from == NULL || *from == NULL)
return 0;
}
static int
-strtowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+strtowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register char *src;
- register wchar_t *dst;
- register length;
+ char *src;
+ wchar_t *dst;
+ int length;
if (from == NULL || *from == NULL)
return 0;
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
if (conv->state)
Xfree((char *) conv->state);
}
static XlcConv
-create_conv(methods)
- XlcConvMethods methods;
+create_conv(XlcConvMethods methods)
{
- register XlcConv conv;
+ XlcConv conv;
State state;
static XlcCharSet GL_charset = NULL;
static XlcCharSet GR_charset = NULL;
conv->state = NULL;
state = (State) Xmalloc(sizeof(StateRec));
- if (state == NULL)
- goto err;
+ if (state == NULL){
+ close_converter(conv);
+ return (XlcConv) NULL;
+ }
state->GL_charset = state->charset = GL_charset;
state->GR_charset = GR_charset;
conv->state = (XPointer) state;
return conv;
-
-err:
- close_converter(conv);
-
- return (XlcConv) NULL;
}
static XlcConvMethodsRec strtostr_methods = {
} ;
static XlcConv
-open_strtostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_strtostr( XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type )
{
return create_conv(&strtostr_methods);
}
} ;
static XlcConv
-open_wcstostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstostr( XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type )
{
return create_conv(&wcstostr_methods);
}
} ;
static XlcConv
-open_cstostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstostr( XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type )
{
return create_conv(&cstostr_methods);
}
} ;
static XlcConv
-open_strtowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_strtowcs( XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type )
{
return create_conv(&strtowcs_methods);
}
XLCd
-_fallcDefaultLoader(name)
- char *name;
+_fallcDefaultLoader(char *name)
{
XLCd lcd;
#define GLOBAL 0x100
XLCd
-_fallcDynamicLoader(name)
- char *name;
+_fallcDynamicLoader(char *name)
{
char libpath[1024];
XLCdMethods _fallcGenericMethods;
*/
static int
-euc_mbstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_mbstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
- register Uchar ch;
- register int chr_len = 0;
- register int sshift = False;
- register int shift_mult = 0;
- register Uint chrcode;
+ Uchar ch;
+ int chr_len = 0;
+ int sshift = False;
+ int shift_mult = 0;
+ Uint chrcode;
Uint wc_encode = 0;
Uint wc_tmp = 0;
static int
-euc_wcstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_wcstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
wchar_t *inbufptr = (wchar_t *) *from;
- register XPointer outbufptr = *to;
+ XPointer outbufptr = *to;
XPointer outbuf_base = outbufptr;
wchar_t wch;
- register length;
+ int length;
Uchar tmp;
int num_conv;
int unconv_num = 0;
static int
-euc_mbtocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_mbtocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
XlcCharSet charset;
int length;
int unconv_num = 0;
int min_ch = 0;
- register char *src = *from, *dst = *to;
+ char *src = *from, *dst = *to;
if (isleftside(*src)) { /* 7-bit (CS0) */
static int
-euc_mbstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_mbstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
char *tmp_from, *tmp_to;
static int
-euc_wcstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_wcstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
wchar_t *wcptr = (wchar_t *) *from;
- register char *bufptr = (char *) *to;
+ char *bufptr = (char *) *to;
wchar_t wch;
char *tmpptr;
- register length;
+ int length;
CodeSet codeset;
Ulong wc_encoding;
int unconv_num = 0;
static int
-euc_cstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_cstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
- register char *csptr = *from;
- register char *bufptr = *to;
+ char *csptr = *from;
+ char *bufptr = *to;
int csstr_len = *from_left;
- register buf_len = *to_left;
+ int buf_len = *to_left;
int length;
CodeSet codeset;
int cvt_length;
static int
-euc_cstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_cstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
- register char *csptr = *from;
+ char *csptr = *from;
wchar_t *bufptr = (wchar_t *) *to;
wchar_t *toptr = (wchar_t *) *to;
int csstr_len = *from_left;
- register buf_len = *to_left;
+ int buf_len = *to_left;
wchar_t wch;
int length;
Ulong wc_shift_bits = XLC_GENERIC(lcd, wc_shift_bits);
static CodeSet
-wc_codeset(lcd, wch)
- XLCd lcd;
- wchar_t wch;
+wc_codeset(XLCd lcd, wchar_t wch)
{
- register CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
- register int end = XLC_GENERIC(lcd, codeset_num);
- register Ulong widech = (Ulong)(wch & XLC_GENERIC(lcd, wc_encode_mask));
+ CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
+ int end = XLC_GENERIC(lcd, codeset_num);
+ Ulong widech = (Ulong)(wch & XLC_GENERIC(lcd, wc_encode_mask));
for (; --end >= 0; codesets++)
if ( widech == (*codesets)->wc_encoding )
static CodeSet
-GetCodeSetFromCharSet(lcd, charset)
- XLCd lcd;
- XlcCharSet charset;
+GetCodeSetFromCharSet(XLCd lcd, XlcCharSet charset)
{
- register CodeSet *codeset = XLC_GENERIC(lcd, codeset_list);
- register XlcCharSet *charset_list;
- register codeset_num, num_charsets;
+ CodeSet *codeset = XLC_GENERIC(lcd, codeset_list);
+ XlcCharSet *charset_list;
+ int codeset_num, num_charsets;
codeset_num = XLC_GENERIC(lcd, codeset_num);
static XlcConv
-create_conv(lcd, methods)
- XLCd lcd;
- XlcConvMethods methods;
+create_conv(XLCd lcd, XlcConvMethods methods)
{
XlcConv conv;
/*
* Stripped down Direct CT converters for EUC
- *
*/
typedef struct _CTDataRec {
* initCTptr(): Set ctdptr[] to point at ctdata[], indexed by codeset_num.
*/
static void
-initCTptr(lcd)
- XLCd lcd;
+initCTptr(XLCd lcd)
{
int num_codesets = XLC_GENERIC(lcd, codeset_num);
int num_charsets;
#define SKIP_P(str) while (*(str) >= 0x30 && *(str) <= 0x3f) (str)++;
static int
-euc_ctstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_ctstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
Ulong wc_shift_bits = XLC_GENERIC(lcd, wc_shift_bits);
- register XPointer inbufptr = *from;
+ XPointer inbufptr = *from;
XPointer inbuf_base;
- register wchar_t *outbufptr = (wchar_t *) *to;
+ wchar_t *outbufptr = (wchar_t *) *to;
wchar_t *outbuf_base = outbufptr;
- register clen, length;
+ int clen, length;
int num_conv;
int unconv_num = 0;
unsigned int ct_seglen = 0;
Uchar ct_type = 0;
- register shift_mult;
+ int shift_mult;
wchar_t wc_tmp;
wchar_t wch;
Ulong wc_encoding;
#define userdef (codeset->cs_num == 3)
static int
-euc_wcstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_wcstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register ct_len = *to_left;
- register wchar_t *inbufptr = (wchar_t *) *from;
- register char *ctptr = *to;
+ int ct_len = *to_left;
+ wchar_t *inbufptr = (wchar_t *) *from;
+ char *ctptr = *to;
XPointer ct_base = ctptr;
wchar_t wch;
- register length;
- register unconv_num = 0;
+ int length;
+ int unconv_num = 0;
Uchar tmp;
Uchar t1 = 0, t2;
int num_conv;
#define userdef (ctdp == ctdptr[Userdef])
static int
-euc_ctstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_ctstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register XPointer inbufptr = *from;
- register XPointer outbufptr = *to;
+ XPointer inbufptr = *from;
+ XPointer outbufptr = *to;
XPointer inbuf_base;
XPointer outbuf_base = outbufptr;
- register clen, length;
+ int clen, length;
int unconv_num = 0;
int num_conv;
unsigned int ct_seglen = 0;
static int
-euc_mbstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+euc_mbstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register ct_len = *to_left;
+ int ct_len = *to_left;
int cs_num;
int clen, length;
int unconv_num = 0;
int num_conv;
XPointer inbufptr = *from;
- register char *ctptr = *to;
+ char *ctptr = *to;
XPointer ct_base = ctptr;
StateRec ct_state;
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
Xfree((char *) conv);
}
static XlcConv
-open_mbstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOCS]);
}
static XlcConv
-open_wcstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOCS]);
}
static XlcConv
-open_mbtocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbtocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBTOCS]);
}
static XlcConv
-open_cstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CSTOMBS]);
}
static XlcConv
-open_cstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CSTOWCS]);
}
static XlcConv
-open_mbstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOWCS]);
}
static XlcConv
-open_wcstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOMBS]);
}
static XlcConv
-open_ctstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CTSTOWCS]);
}
static XlcConv
-open_ctstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CTSTOMBS]);
}
static XlcConv
-open_wcstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOCTS]);
}
static XlcConv
-open_mbstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOCTS]);
}
XLCd
-_fallcEucLoader(name)
- char *name;
+_fallcEucLoader(char *name)
{
XLCd lcd;
#include "_fallibint.h"
#include "_fallcPubI.h"
#include <X11/Xos.h>
-#ifdef X_NOT_STDC_ENV
-extern char *getenv();
-#endif
/************************************************************************/
*/
static int
-parse_line(line, argv, argsize)
- char *line;
- char **argv;
- int argsize;
+parse_line(char *line, char **argv, int argsize)
{
int argc = 0;
char *p = line;
#endif
static void
-xlocaledir(path)
- char *path;
+xlocaledir(char *path)
{
char *dir, *p = path;
int len;
}
static int
-parse_path(path, argv, argsize)
- char *path;
- char **argv;
- int argsize;
+parse_path(char *path, char **argv, int argsize)
{
char *p = path;
int i, n;
enum { LtoR, RtoL };
static char *
-_XlcResolveName(lc_name, file_name, direction)
- char *lc_name;
- char *file_name;
- int direction; /* mapping direction */
+_XlcResolveName(char *lc_name, char *file_name, int direction)/*mapping direction*/
{
FILE *fp;
char buf[BUFSIZE], *name = NULL;
#define tolower(ch) ((ch) - 'A' + 'a')
*/
static char *
-lowercase(dst, src)
- char *dst;
- char *src;
+lowercase(char *dst, char *src)
{
char *s, *t;
/************************************************************************/
char *
-_fallcFileName(lcd, category)
- XLCd lcd;
- char *category;
+_fallcFileName(XLCd lcd, char *category)
{
char lc_name[BUFSIZE];
char cat[BUFSIZE], dir[BUFSIZE];
#endif
int
-_fallcResolveLocaleName(lc_name, full_name, language, territory, codeset)
- char *lc_name;
- char *full_name;
- char *language;
- char *territory;
- char *codeset;
+_fallcResolveLocaleName(
+ char *lc_name,
+ char *full_name,
+ char *language,
+ char *territory,
+ char *codeset)
{
char dir[BUFSIZE], buf[BUFSIZE], *name = NULL;
int i, n;
#endif
int
-_fallcResolveDBName(lc_name, file_name)
- char *lc_name;
- char *file_name;
+_fallcResolveDBName(char *lc_name, char *file_name)
{
char dir[BUFSIZE], buf[BUFSIZE], *name = NULL;
int i, n;
/************************************************************************/
int
-_fallcResolveI18NPath(path_name)
- char *path_name;
+_fallcResolveI18NPath(char *path_name)
{
if(path_name != NULL){
xlocaledir(path_name);
{ "JISX0208.1983-0:GR", "\033$)B" },
{ "KSC5601.1987-0:GL", "\033$(C" },
{ "KSC5601.1987-0:GR", "\033$)C" },
-#ifdef notdef
- { "JISX0212.1990-0:GL", "\033$(D" },
- { "JISX0212.1990-0:GR", "\033$)D" },
- { "CNS11643.1986-1:GL", "\033$(G" },
- { "CNS11643.1986-1:GR", "\033$)G" },
- { "CNS11643.1986-2:GL", "\033$(H" },
- { "CNS11643.1986-2:GR", "\033$)H" },
-
- /* Non-Standard Character Set Encodings */
- { "TIS620.2533-1:GR", "\033-T"},
-#endif
} ;
static CTDataRec directionality_data[] =
/* -------------------------------------------------------------------------- */
static int
-compare(src, encoding, length)
- register char *src;
- register char *encoding;
- register int length;
+compare(char *src, char *encoding, int length)
{
char *start = src;
}
static unsigned long
-conv_to_dest(conv, code)
- Conversion conv;
- unsigned long code;
+conv_to_dest(Conversion conv, unsigned long code)
{
int i;
int conv_num = conv->conv_num;
}
static unsigned long
-conv_to_source(conv, code)
- Conversion conv;
- unsigned long code;
+conv_to_source(Conversion conv, unsigned long code)
{
int i;
int conv_num;
}
static unsigned long
-mb_to_gi(mb, codeset)
- unsigned long mb;
- CodeSet codeset;
+mb_to_gi(unsigned long mb, CodeSet codeset)
{
int i;
unsigned long mb_tmp, mask = 0;
}
static unsigned long
-gi_to_mb(glyph_index, codeset)
- unsigned long glyph_index;
- CodeSet codeset;
+gi_to_mb(unsigned long glyph_index, CodeSet codeset)
{
int i;
unsigned long mask = 0;
}
static Bool
-gi_to_wc(lcd, glyph_index, codeset, wc)
- XLCd lcd;
- unsigned long glyph_index;
- CodeSet codeset;
- wchar_t *wc;
+gi_to_wc(XLCd lcd, unsigned long glyph_index, CodeSet codeset, wchar_t *wc)
{
unsigned char mask = 0;
unsigned long wc_encoding = codeset->wc_encoding;
}
static Bool
-wc_to_gi(lcd, wc, glyph_index, codeset)
- XLCd lcd;
- wchar_t wc;
- unsigned long *glyph_index;
- CodeSet *codeset;
+wc_to_gi(XLCd lcd, wchar_t wc, unsigned long *glyph_index, CodeSet *codeset)
{
int i;
unsigned char mask = 0;
}
static CodeSet
-byteM_parse_codeset(lcd, inbufptr)
- XLCd lcd;
- XPointer inbufptr;
+byteM_parse_codeset(XLCd lcd, XPointer inbufptr)
{
unsigned char ch;
CodeSet codeset;
}
static CodeSet
-GLGR_parse_codeset(lcd, ch)
- XLCd lcd;
- unsigned char ch;
+GLGR_parse_codeset(XLCd lcd, unsigned char ch)
{
int i;
CodeSet initial_state_GL = XLC_GENERIC(lcd, initial_state_GL);
}
static XlcCharSet
-gi_parse_charset(glyph_index, codeset)
- unsigned long glyph_index;
- CodeSet codeset;
+gi_parse_charset(unsigned long glyph_index, CodeSet codeset)
{
int i;
size_t table_size = sizeof(default_ct_data) / sizeof(default_ct_data[0]);
return(NULL);
/* Standard Character Set Encoding ? */
- for (i = 0; i < table_size; i++)
+ for (i = 0; i < table_size; i++){
if (compare(charset->ct_sequence,
- default_ct_data[i].encoding, strlen(charset->ct_sequence)))
- goto check_extended_seg;
-
- return(charset);
-
-check_extended_seg:
- if (!ctextseg)
- return(charset);
+ default_ct_data[i].encoding, strlen(charset->ct_sequence))){
+ if (!ctextseg)
+ return(charset);
- area = ctextseg->area;
- area_num = ctextseg->area_num;
+ area = ctextseg->area;
+ area_num = ctextseg->area_num;
- for (i = 0; i < area_num; i++) {
+ for (i = 0; i < area_num; i++) {
- if (area[i].start <= glyph_index && glyph_index <= area[i].end) {
+ if (area[i].start <= glyph_index && glyph_index <= area[i].end) {
- charset = ctextseg->charset;
+ charset = ctextseg->charset;
- if (*charset->ct_sequence == '\0')
- return(NULL);
+ if (*charset->ct_sequence == '\0')
+ return(NULL);
- break;
+ break;
+ }
+ }
}
}
-
return(charset);
}
static Bool
-ct_parse_csi(inbufptr, ctr_seq_len)
- XPointer inbufptr;
- int *ctr_seq_len;
+ct_parse_csi(XPointer inbufptr, int *ctr_seq_len)
{
int i;
int num = sizeof(directionality_data) / sizeof(directionality_data[0]);
}
static int
-cmp_esc_sequence(inbufptr, ct_sequence, encoding_name)
- XPointer inbufptr;
- char *ct_sequence;
- char *encoding_name;
+cmp_esc_sequence(XPointer inbufptr, char *ct_sequence, char *encoding_name)
{
size_t table_size = sizeof(default_ct_data) / sizeof(default_ct_data[0]);
int i, seq_len, name_len, total_len;
}
static Bool
-ct_parse_charset(lcd, inbufptr, charset, ctr_seq_len)
- XLCd lcd;
- XPointer inbufptr;
- XlcCharSet *charset;
- int *ctr_seq_len;
+ct_parse_charset(
+ XLCd lcd,
+ XPointer inbufptr,
+ XlcCharSet *charset,
+ int *ctr_seq_len)
{
int i, j;
ExtdSegment ctextseg;
}
static Bool
-segment_conversion(lcd, charset, glyph_index)
- XLCd lcd;
- XlcCharSet *charset;
- unsigned long *glyph_index;
+segment_conversion(XLCd lcd, XlcCharSet *charset, unsigned long *glyph_index)
{
int i;
int segment_conv_num = XLC_GENERIC(lcd, segment_conv_num);
}
CodeSet
-_fallcGetCodeSetFromName(lcd, name)
- XLCd lcd;
- char *name;
+_fallcGetCodeSetFromName(XLCd lcd, char *name)
{
int i, j;
XlcCharSet charset;
}
static Bool
-_XlcGetCodeSetFromCharSet(lcd, charset, codeset, glyph_index)
- XLCd lcd;
- XlcCharSet charset;
- CodeSet *codeset;
- unsigned long *glyph_index;
+_XlcGetCodeSetFromCharSet(
+ XLCd lcd,
+ XlcCharSet charset,
+ CodeSet *codeset,
+ unsigned long *glyph_index)
{
int i, j, num;
CodeSet *codeset_list = XLC_GENERIC(lcd, codeset_list);
}
static Bool
-check_string_encoding(codeset)
- CodeSet codeset;
+check_string_encoding(CodeSet codeset)
{
int i;
XlcCharSet charset;
/* -------------------------------------------------------------------------- */
static void
-init_state(conv)
- XlcConv conv;
+init_state(XlcConv conv)
{
- register State state = (State) conv->state;
+ State state = (State) conv->state;
/* for CT */
state->charset = NULL;
/* -------------------------------------------------------------------------- */
static int
-mbstowcs_org(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+mbstowcs_org(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
/* same mb char data */
- if (len_left)
- goto output_one_wc;
+ if (len_left){
+ mb = (mb << 8) | ch; /* 1 byte left shift */
+ len_left--;
+
+ /* last of one mb char data */
+ if (!len_left) {
+ gi_to_wc(lcd, mb_to_gi(mb, codeset), codeset, &wc);
+ if (outbufptr) {*outbufptr++ = wc;}
+ (*to_left)--;
+ }
+ }
/* next mb char data for single shift ? */
if (mb_parse_table) {
}
/* next mb char data for byteM ? */
- if (codeset = byteM_parse_codeset(lcd, (inbufptr - 1)))
- goto next_mb_char;
-
- /* next mb char data for GL or GR side ? */
- if (codeset = GLGR_parse_codeset(lcd, ch))
- goto next_mb_char;
+ if ((codeset = byteM_parse_codeset(lcd, (inbufptr - 1))) ||
+ /* next mb char data for GL or GR side ? */
+ (codeset = GLGR_parse_codeset(lcd, ch))){
+ length = len_left = codeset->length;
+ mb = 0;
+ ss_flag = 0;
+ }
/* can't find codeset for the ch */
unconv_num++;
continue;
-next_mb_char:
- length = len_left = codeset->length;
- mb = 0;
- ss_flag = 0;
-
-output_one_wc:
- mb = (mb << 8) | ch; /* 1 byte left shift */
- len_left--;
-
- /* last of one mb char data */
- if (!len_left) {
- gi_to_wc(lcd, mb_to_gi(mb, codeset), codeset, &wc);
- if (outbufptr) {*outbufptr++ = wc;}
- (*to_left)--;
- }
-
} /* end of while */
/* error check on last char */
}
static int
-wcstombs_org(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wcstombs_org(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
static int
-wcstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wcstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
size_t table_size = sizeof(default_ct_data) / sizeof(default_ct_data[0]);
State state = (State) conv->state;
}
static int
-ctstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+ctstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
/* same glyph_index data */
- if (gi_len_left)
- goto output_one_wc;
+ if (gi_len_left){
+
+ if (state->charset->side == XlcC1 || state->charset->side == XlcGR)
+ glyph_index = (glyph_index << 8) | (ch & GL);
+ else
+ glyph_index = (glyph_index << 8) | ch;
+
+ gi_len_left--;
+
+ /* last of one glyph_index data */
+ if (!gi_len_left) {
+
+ /* segment conversion */
+ charset_tmp = state->charset;
+ if ( !segment_conversion(lcd, &charset_tmp, &glyph_index) ) {
+ unconv_num += gi_len;
+ continue;
+ }
+
+ /* get codeset */
+ if ( !_XlcGetCodeSetFromCharSet(lcd, charset_tmp,
+ &codeset, &glyph_index) ) {
+ unconv_num += gi_len;
+ continue;
+ }
+
+ /* convert glyph index to wicd char */
+ gi_to_wc(lcd, glyph_index, codeset, &wc);
+ if (outbufptr) {*outbufptr++ = wc;}
+ (*to_left)--;
+ }
+
+ continue;
+
+ }
/* control sequence ? */
if (ch == CSI) {
gi_len = gi_len_left = state->charset->char_size;
glyph_index = 0;
-output_one_wc:
- if (state->charset->side == XlcC1 || state->charset->side == XlcGR)
- glyph_index = (glyph_index << 8) | (ch & GL);
- else
- glyph_index = (glyph_index << 8) | ch;
-
- gi_len_left--;
-
- /* last of one glyph_index data */
- if (!gi_len_left) {
-
- /* segment conversion */
- charset_tmp = state->charset;
- if ( !segment_conversion(lcd, &charset_tmp, &glyph_index) ) {
- unconv_num += gi_len;
- continue;
- }
-
- /* get codeset */
- if ( !_XlcGetCodeSetFromCharSet(lcd, charset_tmp,
- &codeset, &glyph_index) ) {
- unconv_num += gi_len;
- continue;
- }
-
- /* convert glyph index to wicd char */
- gi_to_wc(lcd, glyph_index, codeset, &wc);
- if (outbufptr) {*outbufptr++ = wc;}
- (*to_left)--;
- }
-
- continue;
-
skip_the_seg:
/* skip until next escape or control sequence */
while ( *from_left ) {
}
static int
-mbstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+mbstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XPointer buf = Xmalloc((*from_left) * sizeof(wchar_t));
XPointer buf_ptr1 = buf;
unconv_num = mbstowcs_org(conv,
from, from_left, &buf_ptr1, &buf_left1, args, num_args);
- if (unconv_num < 0)
- goto ret;
+ if (unconv_num < 0){
+ if (buf)
+ Xfree((char *)buf);
+
+ return unconv_num;
+ }
buf_left2 = (buf_ptr1 - buf_ptr2) / sizeof(wchar_t);
unconv_num += wcstocts(conv,
&buf_ptr2, &buf_left2, to, to_left, args, num_args);
- if (unconv_num < 0)
- goto ret;
-
-ret:
- if (buf)
- Xfree((char *)buf);
+ if (unconv_num < 0){
+ if (buf)
+ Xfree((char *)buf);
- return unconv_num;
+ return unconv_num;
+ }
}
static int
-mbstostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+mbstostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
/* same mb char data */
- if (len_left)
- goto output_one_mb;
+ if (len_left){
+ mb = (mb << 8) | ch; /* 1 byte left shift */
+ len_left--;
+
+ /* last of one mb char data */
+ if (!len_left) {
+ if (check_string_encoding(codeset)) {
+ if (outbufptr) {*outbufptr++ = mb & 0xff;}
+ (*to_left)--;
+ } else {
+ unconv_num++;
+ }
+ }
+ }
/* next mb char data for single shift ? */
if (mb_parse_table) {
}
/* next char data : byteM ? */
- if (codeset = byteM_parse_codeset(lcd, (inbufptr - 1)))
- goto next_mb_char;
-
+ if ((codeset = byteM_parse_codeset(lcd, (inbufptr - 1))) ||
/* next char data : GL or GR side ? */
- if (codeset = GLGR_parse_codeset(lcd, ch))
- goto next_mb_char;
+ (codeset = GLGR_parse_codeset(lcd, ch))){
+ length = len_left = codeset->length;
+ mb = 0;
+ ss_flag = 0;
+ }
/* can't find codeset for the ch */
unconv_num++;
continue;
-next_mb_char:
- length = len_left = codeset->length;
- mb = 0;
- ss_flag = 0;
-
-output_one_mb:
- mb = (mb << 8) | ch; /* 1 byte left shift */
- len_left--;
-
- /* last of one mb char data */
- if (!len_left) {
- if (check_string_encoding(codeset)) {
- if (outbufptr) {*outbufptr++ = mb & 0xff;}
- (*to_left)--;
- } else {
- unconv_num++;
- }
- }
-
} /* end of while */
/* error check on last char */
}
static int
-mbtocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+mbtocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
/* next mb char data for byteM ? */
- if (codeset = byteM_parse_codeset(lcd, (inbufptr - 1)))
- goto next_mb_char;
-
+ if ((codeset = byteM_parse_codeset(lcd, (inbufptr - 1))) ||
/* next mb char data for GL or GR side ? */
- if (codeset = GLGR_parse_codeset(lcd, ch))
- goto next_mb_char;
+ (codeset = GLGR_parse_codeset(lcd, ch))){
+ length = len_left = codeset->length;
+ mb = 0;
+ }
/* can't find codeset for the ch */
unconv_num = 1;
break;
-next_mb_char:
- length = len_left = codeset->length;
- mb = 0;
-
output:
mb = (mb << 8) | ch; /* 1 byte left shift */
len_left--;
}
static int
-mbstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+mbstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
int ret;
XlcCharSet charset_old, charset = NULL;
}
static int
-wcstostr(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wcstostr(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
static int
-wctocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wctocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
static int
-wcstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+wcstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
int ret;
XlcCharSet charset_old, charset = NULL;
}
static int
-ctstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+ctstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XPointer buf = Xmalloc((*from_left) * sizeof(wchar_t));
XPointer buf_ptr1 = buf;
unconv_num = ctstowcs(conv,
from, from_left, &buf_ptr1, &buf_left1, args, num_args);
- if (unconv_num < 0)
- goto ret;
+ if (unconv_num < 0){
+ if (buf)
+ Xfree((char *)buf);
+ return unconv_num;
+ }
buf_left2 = (buf_ptr1 - buf_ptr2) / sizeof(wchar_t);
unconv_num += wcstombs_org(conv,
&buf_ptr2, &buf_left2, to, to_left, args, num_args);
- if (unconv_num < 0)
- goto ret;
+ if (unconv_num < 0){
+ if (buf)
+ Xfree((char *)buf);
-ret:
- if (buf)
- Xfree((char *)buf);
-
- return unconv_num;
+ return unconv_num;
+ }
}
static int
-strtombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+strtombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
}
static int
-strtowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+strtowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
State state = (State) conv->state;
XLCd lcd = state->lcd;
/* -------------------------------------------------------------------------- */
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
if (conv->state) {
Xfree((char *) conv->state);
/* -------------------------------------------------------------------------- */
static XlcConv
-create_conv(lcd, methods)
- XLCd lcd;
- XlcConvMethods methods;
+create_conv(XLCd lcd, XlcConvMethods methods)
{
XlcConv conv;
State state;
return (XlcConv) NULL;
conv->methods = (XlcConvMethods) Xmalloc(sizeof(XlcConvMethodsRec));
- if (conv->methods == NULL)
- goto err;
+ if (conv->methods == NULL){
+ close_converter(conv);
+ return (XlcConv) NULL;
+ }
*conv->methods = *methods;
if (XLC_PUBLIC(lcd, is_state_depend))
conv->methods->reset = init_state;
conv->state = (XPointer) Xmalloc(sizeof(StateRec));
- if (conv->state == NULL)
- goto err;
+ if (conv->state == NULL){
+ close_converter(conv);
+ return (XlcConv) NULL;
+ }
bzero((char *) conv->state, sizeof(StateRec));
state = (State) conv->state;
init_state(conv);
return conv;
-
-err:
- close_converter(conv);
-
- return (XlcConv) NULL;
}
static XlcConvMethodsRec mbstowcs_methods = {
} ;
static XlcConv
-open_mbstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &mbstowcs_methods);
}
} ;
static XlcConv
-open_mbstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &mbstocts_methods);
}
} ;
static XlcConv
-open_mbstostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstostr(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &mbstostr_methods);
}
} ;
static XlcConv
-open_mbstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &mbstocs_methods);
}
} ;
static XlcConv
-open_mbtocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbtocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &mbtocs_methods);
}
} ;
static XlcConv
-open_wcstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &wcstombs_methods);
}
} ;
static XlcConv
-open_wcstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &wcstocts_methods);
}
} ;
static XlcConv
-open_wcstostr(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstostr(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &wcstostr_methods);
}
} ;
static XlcConv
-open_wcstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &wcstocs_methods);
}
} ;
static XlcConv
-open_wctocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wctocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &wctocs_methods);
}
} ;
static XlcConv
-open_ctstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &ctstombs_methods);
}
} ;
static XlcConv
-open_ctstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &ctstowcs_methods);
}
} ;
static XlcConv
-open_strtombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_strtombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &strtombs_methods);
}
} ;
static XlcConv
-open_strtowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_strtowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &strtowcs_methods);
}
/* -------------------------------------------------------------------------- */
XLCd
-_fallcGenericLoader(name)
- char *name;
+_fallcGenericLoader(char *name)
{
XLCd lcd;
#include "_fallibint.h"
#include "_fallcGeneric.h"
-static XLCd create();
-static Bool initialize();
-static void destroy();
+static XLCd create(char *name, XLCdMethods methods);
+static Bool initialize(XLCd lcd);
+static void destroy(XLCd lcd);
static XLCdPublicMethodsRec genericMethods = {
{ NULL }, /* use default methods */
XLCdMethods _fallcGenericMethods = (XLCdMethods) &genericMethods;
static XLCd
-create(name, methods)
- char *name;
- XLCdMethods methods;
+create(char *name, XLCdMethods methods)
{
XLCd lcd;
XLCdPublicMethods new;
bzero((char *) lcd, sizeof(XLCdRec));
lcd->core = (XLCdCore) Xmalloc(sizeof(XLCdGenericRec));
- if (lcd->core == NULL)
- goto err;
+ if (lcd->core == NULL){
+ Xfree(lcd);
+ return (XLCd) NULL;
+ }
bzero((char *) lcd->core, sizeof(XLCdGenericRec));
new = (XLCdPublicMethods) Xmalloc(sizeof(XLCdPublicMethodsRec));
- if (new == NULL)
- goto err;
+ if (new == NULL){
+ Xfree(lcd);
+ return (XLCd) NULL;
+ }
*new = *((XLCdPublicMethods) methods);
lcd->methods = (XLCdMethods) new;
return lcd;
-
-err:
- Xfree(lcd);
- return (XLCd) NULL;
}
static Bool
-string_to_encoding(str, encoding)
- char *str;
- char *encoding;
+string_to_encoding(char *str, char *encoding)
{
char *next;
long value;
}
static Bool
-string_to_ulong(str, value)
-char *str;
-unsigned long *value;
+string_to_ulong(char *str, unsigned long *value)
{
char *tmp1 = str;
int base;
static Bool
-add_charset(codeset, charset)
- CodeSet codeset;
- XlcCharSet charset;
+add_charset(CodeSet codeset, XlcCharSet charset)
{
XlcCharSet *new_list;
int num;
}
static CodeSet
-add_codeset(gen)
- XLCdGenericPart *gen;
+add_codeset(XLCdGenericPart *gen)
{
CodeSet new, *new_list;
int num;
else
new_list = (CodeSet *) Xmalloc(sizeof(CodeSet));
- if (new_list == NULL)
- goto err;
+ if (new_list == NULL){
+ Xfree(new);
+ return NULL;
+ }
new_list[num] = new;
gen->codeset_list = new_list;
gen->codeset_num = num + 1;
return new;
-
-err:
- Xfree(new);
-
- return NULL;
}
static Bool
-add_parse_list(gen, type, encoding, codeset)
- XLCdGenericPart *gen;
- EncodingType type;
- char *encoding;
- CodeSet codeset;
+add_parse_list(
+ XLCdGenericPart *gen,
+ EncodingType type,
+ char *encoding,
+ CodeSet codeset)
{
ParseInfo new, *new_list;
char *str;
strcpy(str, encoding);
new = (ParseInfo) Xmalloc(sizeof(ParseInfoRec));
- if (new == NULL)
- goto err;
+ if (new == NULL){
+ Xfree(str);
+ if (new)
+ Xfree(new);
+
+ return False;
+ }
bzero((char *) new, sizeof(ParseInfoRec));
if (gen->mb_parse_table == NULL) {
gen->mb_parse_table = (unsigned char *) Xmalloc(256); /* 2^8 */
- if (gen->mb_parse_table == NULL)
- goto err;
+ if (gen->mb_parse_table == NULL){
+ Xfree(str);
+ if (new)
+ Xfree(new);
+
+ return False;
+ }
bzero((char *) gen->mb_parse_table, 256);
}
new_list = (ParseInfo *) Xmalloc(2 * sizeof(ParseInfo));
}
- if (new_list == NULL)
- goto err;
+ if (new_list == NULL){
+ Xfree(str);
+ if (new)
+ Xfree(new);
+
+ return False;
+ }
new_list[num] = new;
new_list[num + 1] = NULL;
codeset->parse_info = new;
return True;
-
-err:
- Xfree(str);
- if (new)
- Xfree(new);
-
- return False;
}
static void
-free_charset(lcd)
- XLCd lcd;
+free_charset(XLCd lcd)
{
XLCdGenericPart *gen = XLC_GENERIC_PART(lcd);
CodeSet *codeset;
#define FORWARD (unsigned long)'+'
#define BACKWARD (unsigned long)'-'
-static char *getscope(str,scp)
-char *str;
-FontScope scp;
+static char *getscope(char *str, FontScope scp)
{
char buff[256],*next;
unsigned long start=0,end=0,dest=0,shift=0,direction=0;
next = str+1 ;
return(next);
}
-static int count_scopemap(str)
-char *str;
+static int count_scopemap(char *str)
{
char *ptr;
int num=0;
}
return(num);
}
-FontScope falparse_scopemaps(str,size)
-char *str;
-int *size;
+FontScope falparse_scopemaps(char *str, int *size)
{
int num=0,i;
FontScope scope,sc_ptr;
}
void
-dbg_printValue(str,value,num)
-char *str;
-char **value;
-int num;
+dbg_printValue(char *str, char **value, int num)
{
-/*
+#ifdef DEBUG
int i;
for(i=0;i<num;i++){
fprintf(stderr,"%s value[%d] = %s\n",str,i,value[i]);
}
-*/
+#endif
}
void
-dmpscope(name,sc,num)
-FontScope sc;
-int num;
+dmpscope(char *name, FontScope sc, int num)
{
-/*
+/* should this be protected by ifdef DEBUG?
int i;
fprintf(stderr,"dmpscope %s\n",name);
for(i=0;i<num;i++){
*/
}
-static XlcCharSet srch_charset_define(name,new)
-char *name;
-int *new;
+static XlcCharSet srch_charset_define(char *name, int *new)
{
XlcCharSet charset = NULL;
*new = 0;
}
static int
-read_charset_define(lcd,gen)
-XLCd lcd;
-XLCdGenericPart *gen;
+read_charset_define(XLCd lcd, XLCdGenericPart *gen)
{
int i=0;
char csd[16],cset_name[256];
}
SegConv
-faladd_conversion(gen)
-XLCdGenericPart *gen;
+faladd_conversion(XLCdGenericPart *gen)
{
SegConv new_list;
int num;
}
static int
-read_segmentconversion(lcd,gen)
-XLCd lcd;
-XLCdGenericPart *gen;
+read_segmentconversion(XLCd lcd, XLCdGenericPart *gen)
{
int i=0;
char conv[16];
return 1;
}
-static ExtdSegment create_ctextseg(value,num)
-char **value;
-int num;
+static ExtdSegment create_ctextseg(char **value, int num)
{
ExtdSegment ret;
char side_str[128],*ptr;
/* For VW/UDC end */
static Bool
-load_generic(lcd)
- XLCd lcd;
+load_generic(XLCd lcd)
{
XLCdGenericPart *gen = XLC_GENERIC_PART(lcd);
char **value;
/***** wc_encoding_mask *****/
_fallcGetResource(lcd, "XLC_XLOCALE", "wc_encoding_mask", &value, &num);
if (num > 0) {
- if (string_to_ulong(value[0], &l) == False)
- goto err;
+ if (string_to_ulong(value[0], &l) == False){
+ free_charset(lcd);
+ return False;
+ }
gen->wc_encode_mask = l;
}
/***** wc_shift_bits *****/
if (num > 0) {
char *tmp;
- if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
- goto err;
+ if (codeset == NULL && (codeset = add_codeset(gen)) == NULL){
+ free_charset(lcd);
+ return False;
+ }
/* 3.4.1 side */
if( !_fallcNCompareISOLatin1(value[0], "none", 4) ){
sprintf(name, "%s.%s", cs , "length");
_fallcGetResource(lcd, "XLC_XLOCALE", name, &value, &num);
if (num > 0) {
- if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
- goto err;
+ if (codeset == NULL && (codeset = add_codeset(gen)) == NULL){
+ free_charset(lcd);
+ return False;
+ }
codeset->length = atoi(value[0]);
if (codeset->length < 1)
codeset->length = 1;
};
int j;
- if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
- goto err;
+ if (codeset == NULL && (codeset = add_codeset(gen)) == NULL){
+ free_charset(lcd);
+ return False;
+ }
for ( ; num-- > 0; value++) {
char encoding[256];
char *tmp = *value;
break;
}
}
- if (string_to_encoding(tmp, encoding) == False)
- goto err;
+ if (string_to_encoding(tmp, encoding) == False){
+ free_charset(lcd);
+ return False;
+ }
add_parse_list(gen, type, encoding, codeset);
}
}
sprintf(name, "%s.%s", cs, "wc_encoding");
_fallcGetResource(lcd, "XLC_XLOCALE", name, &value, &num);
if (num > 0) {
- if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
- goto err;
- if (string_to_ulong(value[0], &l) == False)
- goto err;
+ if ((codeset == NULL && (codeset = add_codeset(gen)) == NULL) || \
+ (string_to_ulong(value[0], &l) == False)){
+ free_charset(lcd);
+ return False;
+ }
codeset->wc_encoding = l;
}
XlcCharSet charset;
char *encoding;
- if (codeset == NULL && (codeset = add_codeset(gen)) == NULL)
- goto err;
+ if (codeset == NULL && (codeset = add_codeset(gen)) == NULL){
+ free_charset(lcd);
+ return False;
+ }
for ( ; num-- > 0; value++) {
string_to_encoding(*value, name);
charset = NULL;
}
}
if (charset) {
- if (add_charset(codeset, charset) == False)
- goto err;
+ if (add_charset(codeset, charset) == False){
+ free_charset(lcd);
+ return False;
+ }
}
}
}
(ByteInfoListRec *)Xmalloc(
(codeset->length)*sizeof(ByteInfoListRec));
if(codeset->byteM == NULL){
- goto err;
+ free_charset(lcd);
+ return False;
}
}
read_segmentconversion(lcd,gen); /* For VW/UDC */
return True;
-
-err:
- free_charset(lcd);
-
- return False;
}
static Bool
-initialize(lcd)
- XLCd lcd;
+initialize(XLCd lcd)
{
XLCdPublicMethods superclass = (XLCdPublicMethods) _fallcPublicMethods;
}
/* VW/UDC start 95.01.08 */
static void
-freeByteM(codeset)
- CodeSet codeset;
+freeByteM(CodeSet codeset)
{
int i;
ByteInfoList blst;
codeset->byteM = NULL;
}
static void
-freeConversion(codeset)
- CodeSet codeset;
+freeConversion(CodeSet codeset)
{
int i;
Conversion mbconv,ctconv;
}
}
static void
-freeExtdSegment(codeset)
- CodeSet codeset;
+freeExtdSegment(CodeSet codeset)
{
int i;
ExtdSegment ctextseg;
codeset->ctextseg = NULL;
}
static void
-freeParseInfo(codeset)
- CodeSet codeset;
+freeParseInfo(CodeSet codeset)
{
int i;
ParseInfo parse_info;
codeset->parse_info = NULL;
}
static void
-destroy_CodeSetList(gen)
- XLCdGenericPart *gen ;
+destroy_CodeSetList(XLCdGenericPart *gen)
{
CodeSet *codeset = gen->codeset_list;
int i;
}
Xfree(codeset); gen->codeset_list = NULL;
}
-/* */
+
static void
-destroy_SegConv(gen)
- XLCdGenericPart *gen ;
+destroy_SegConv(XLCdGenericPart *gen)
{
SegConv seg = gen->segment_conv;
int i;
}
static void
-destroy_gen(lcd)
- XLCd lcd;
+destroy_gen(XLCd lcd)
{
XLCdGenericPart *gen = XLC_GENERIC_PART(lcd);
destroy_SegConv(gen);
}
/* VW/UDC end 95.01.08 */
static void
-destroy(lcd)
- XLCd lcd;
+destroy(XLCd lcd)
{
XLCdPublicMethods superclass = XLC_PUBLIC_METHODS(lcd)->superclass;
CodeSet initial_state_GR;
int segment_conv_num; /* UDC */
SegConv segment_conv; /* UDC */
-#ifndef X_NOT_STDC_ENV
Bool use_stdc_env;
Bool force_convert_to_mb;
-#endif
} XLCdGenericPart;
typedef struct _XLCdGenericRec {
/*** #define USE_UTF_LOADER ***/
extern XLCd _fallcDefaultLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#ifdef DYNAMIC_LOAD
#ifdef sun
extern XLCd _falsunOsDynamicLoad(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif /* sun */
-
-#ifdef AIXV3
-extern XLCd _falaixOsDynamicLoad(
-#if NeedFunctionPrototypes
- char*
-#endif
-);
-#endif /* AIXV3 */
-#endif
+#endif /* DYNAMIC_LOAD */
#ifdef USE_GENERIC_LOADER
extern XLCd _fallcGenericLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
#ifdef USE_UTF_LOADER
extern XLCd _fallcUtfLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
#ifdef USE_EUC_LOADER
extern XLCd _fallcEucLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
#ifdef USE_SJIS_LOADER
extern XLCd _fallcSjisLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
#ifdef USE_JIS_LOADER
extern XLCd _XlcJisLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
#ifdef USE_DYNAMIC_LOADER
extern XLCd _fallcDynamicLoader(
-#if NeedFunctionPrototypes
char*
-#endif
);
#endif
*/
void
-_fallcInitLoader()
+_fallcInitLoader(void)
{
#ifdef USE_GENERIC_LOADER
_fallcAddLoader(_fallcGenericLoader, XlcHead);
#ifdef sun
_fallcAddLoader(_falsunOsDynamicLoad, XlcHead);
#endif /* sun */
-
-#ifdef AIXV3
- _fallcAddLoader(_falaixOsDynamicLoad, XlcHead);
-#endif /* AIXV3 */
#endif /* DYNAMIC_LOAD */
#ifdef USE_DYNAMIC_LOADER
#include <X11/Xatom.h>
static XPointer *
-alloc_list(is_wide_char, count, nitems)
- Bool is_wide_char;
- int count;
- int nitems;
+alloc_list(Bool is_wide_char, int count, int nitems)
{
if (is_wide_char) {
wchar_t **wstr_list;
}
static void
-copy_list(is_wide_char, text, list, count)
- Bool is_wide_char;
- XPointer text;
- XPointer *list;
- int count;
+copy_list(Bool is_wide_char, XPointer text, XPointer *list, int count)
{
int length;
}
static int
-_XTextPropertyToTextList(lcd, dpy, text_prop, to_type, list_ret, count_ret)
- XLCd lcd;
- Display *dpy;
- XTextProperty *text_prop;
- char *to_type;
- XPointer **list_ret;
- int *count_ret;
+_XTextPropertyToTextList(
+ XLCd lcd,
+ Display *dpy,
+ XTextProperty *text_prop,
+ char *to_type,
+ XPointer **list_ret,
+ int *count_ret)
{
XlcConv conv;
char *from_type;
}
int
-_falmbTextPropertyToTextList(lcd, dpy, text_prop, list_ret, count_ret)
- XLCd lcd;
- Display *dpy;
- XTextProperty *text_prop;
- char ***list_ret;
- int *count_ret;
+_falmbTextPropertyToTextList(
+ XLCd lcd,
+ Display *dpy,
+ XTextProperty *text_prop,
+ char ***list_ret,
+ int *count_ret)
{
return _XTextPropertyToTextList(lcd, dpy, text_prop, XlcNMultiByte,
(XPointer **) list_ret, count_ret);
}
int
-_falwcTextPropertyToTextList(lcd, dpy, text_prop, list_ret, count_ret)
- XLCd lcd;
- Display *dpy;
- XTextProperty *text_prop;
- wchar_t ***list_ret;
- int *count_ret;
+_falwcTextPropertyToTextList(
+ XLCd lcd,
+ Display *dpy,
+ XTextProperty *text_prop,
+ wchar_t ***list_ret,
+ int *count_ret)
{
return _XTextPropertyToTextList(lcd, dpy, text_prop, XlcNWideChar,
(XPointer **) list_ret, count_ret);
}
void
-_falwcFreeStringList(lcd, list)
- XLCd lcd;
- wchar_t **list;
+_falwcFreeStringList(XLCd lcd, wchar_t **list)
{
if (list) {
if (*list)
typedef struct _XLCdPublicMethodsRec *XLCdPublicMethods;
typedef XLCd (*XlcPubCreateProc)(
-#if NeedFunctionPrototypes
char* /* name */,
XLCdMethods /* methods */
-#endif
);
typedef Bool (*XlcPubInitializeProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
typedef void (*XlcPubDestroyProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
typedef char* (*XlcPubGetValuesProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef void (*XlcPubGetResourceProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* category */,
char* /* class */,
char*** /* value */,
int* /* count */
-#endif
);
typedef struct _XLCdPublicMethodsPart {
_XFUNCPROTOBEGIN
extern XLCd _fallcCreateLC(
-#if NeedFunctionPrototypes
char* /* name */,
XLCdMethods /* methods */
-#endif
);
extern void _fallcDestroyLC(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern Bool _fallcParseCharSet(
-#if NeedFunctionPrototypes
XlcCharSet /* charset */
-#endif
);
extern XlcCharSet _fallcCreateDefaultCharSet(
-#if NeedFunctionPrototypes
char* /* name */,
char* /* control_sequence */
-#endif
);
extern XlcCharSet _fallcAddCT(
-#if NeedFunctionPrototypes
char* /* name */,
char* /* control_sequence */
-#endif
);
extern XrmMethods _falrmDefaultInitParseInfo(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
XPointer* /* state */
-#endif
);
extern int _falmbTextPropertyToTextList(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
XTextProperty* /* text_prop */,
char*** /* list_ret */,
int* /* count_ret */
-#endif
);
extern int _falwcTextPropertyToTextList(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
XTextProperty* /* text_prop */,
wchar_t*** /* list_ret */,
int* /* count_ret */
-#endif
);
extern int _falmbTextListToTextProperty(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
char** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop */
-#endif
);
extern int _falwcTextListToTextProperty(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
wchar_t** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop */
-#endif
);
extern void _falwcFreeStringList(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
wchar_t** /* list */
-#endif
);
extern int _fallcResolveLocaleName(
-#if NeedFunctionPrototypes
char* /* lc_name */,
char* /* full_name */,
char* /* language */,
char* /* territory */,
char* /* codeset */
-#endif
);
extern int _fallcResolveDBName(
-#if NeedFunctionPrototypes
char* /* lc_name */,
char* /* file_name */
-#endif
);
extern int _fallcResolveI18NPath(
-#if NeedFunctionPrototypes
char* /* path_name */
-#endif
);
extern XPointer _fallcCreateLocaleDataBase(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern void _fallcDestroyLocaleDataBase(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern void _fallcGetLocaleDataBase(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* category */,
char* /* name */,
char*** /* value */,
int* /* count */
-#endif
);
_XFUNCPROTOEND
#include "_fallibint.h"
#include "_fallcPubI.h"
-#if NeedVarargsPrototypes
char *
_falGetLCValues(XLCd lcd, ...)
-#else
-char *
-_falGetLCValues(lcd, va_alist)
- XLCd lcd;
- va_dcl
-#endif
{
va_list var;
XlcArgList args;
}
void
-_fallcDestroyLC(lcd)
- XLCd lcd;
+_fallcDestroyLC(XLCd lcd)
{
XLCdPublicMethods methods = (XLCdPublicMethods) lcd->methods;
}
XLCd
-_fallcCreateLC(name, methods)
- char *name;
- XLCdMethods methods;
+_fallcCreateLC(char *name, XLCdMethods methods)
{
XLCdPublicMethods pub_methods = (XLCdPublicMethods) methods;
XLCd lcd;
if (lcd->core->name == NULL) {
lcd->core->name = (char*) Xmalloc(strlen(name) + 1);
- if (lcd->core->name == NULL)
- goto err;
+ if (lcd->core->name == NULL) {
+ _fallcDestroyLC(lcd);
+ return (XLCd) NULL;
+ }
+
strcpy(lcd->core->name, name);
}
if (lcd->methods == NULL)
lcd->methods = methods;
- if ((*pub_methods->pub.initialize)(lcd) == False)
- goto err;
+ if ((*pub_methods->pub.initialize)(lcd) == False) {
+ _fallcDestroyLC(lcd);
+ return (XLCd) NULL;
+ }
return lcd;
-
-err:
- _fallcDestroyLC(lcd);
-
- return (XLCd) NULL;
}
XLCdMethods _fallcPublicMethods = (XLCdMethods) &publicMethods;
static char *
-default_string(lcd)
- XLCd lcd;
+default_string(XLCd lcd)
{
return XLC_PUBLIC(lcd, default_string);
}
static XLCd
-create(name, methods)
- char *name;
- XLCdMethods methods;
+create(char *name, XLCdMethods methods)
{
XLCd lcd;
XLCdPublicMethods new;
bzero((char *) lcd, sizeof(XLCdRec));
lcd->core = (XLCdCore) Xmalloc(sizeof(XLCdPublicRec));
- if (lcd->core == NULL)
- goto err;
+ if (lcd->core == NULL){
+ Xfree(lcd);
+ return (XLCd) NULL;
+ }
bzero((char *) lcd->core, sizeof(XLCdPublicRec));
new = (XLCdPublicMethods) Xmalloc(sizeof(XLCdPublicMethodsRec));
- if (new == NULL)
- goto err;
+ if (new == NULL){
+ Xfree(lcd);
+ return (XLCd) NULL;
+ }
*new = *((XLCdPublicMethods) methods);
lcd->methods = (XLCdMethods) new;
return lcd;
-
-err:
- Xfree(lcd);
- return (XLCd) NULL;
}
static Bool
-load_public(lcd)
- XLCd lcd;
+load_public(XLCd lcd)
{
XLCdPublicPart *pub = XLC_PUBLIC_PART(lcd);
char **values, *str;
}
static Bool
-initialize_core(lcd)
- XLCd lcd;
+initialize_core(XLCd lcd)
{
XLCdMethods methods = lcd->methods;
XLCdMethods core = &publicMethods.core;
extern Bool _fallcInitCTInfo();
static Bool
-initialize(lcd)
- XLCd lcd;
+initialize(XLCd lcd)
{
XLCdPublicMethodsPart *methods = XLC_PUBLIC_METHODS(lcd);
XLCdPublicMethodsPart *pub_methods = &publicMethods.pub;
}
static void
-destroy_core(lcd)
- XLCd lcd;
+destroy_core(XLCd lcd)
{
if (lcd->core) {
if (lcd->core->name)
}
static void
-destroy(lcd)
- XLCd lcd;
+destroy(XLCd lcd)
{
XLCdPublicPart *pub = XLC_PUBLIC_PART(lcd);
};
static char *
-get_values(lcd, args, num_args)
- register XLCd lcd;
- register XlcArgList args;
- register int num_args;
+get_values(XLCd lcd, XlcArgList args, int num_args)
{
XLCdPublic pub = (XLCdPublic) lcd->core;
typedef struct _XlcCharSetRec *XlcCharSet;
typedef char* (*XlcGetCSValuesProc)(
-#if NeedFunctionPrototypes
XlcCharSet /* charset */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef struct _XlcCharSetRec {
typedef struct _XlcConvRec *XlcConv;
typedef XlcConv (*XlcOpenConverterProc)(
-#if NeedFunctionPrototypes
XLCd /* from_lcd */,
char* /* from_type */,
XLCd /* to_lcd */,
char* /* to_type */
-#endif
);
typedef void (*XlcCloseConverterProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
typedef int (*XlcConvertProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */,
XPointer* /* from */,
int* /* from_left */,
int* /* to_left */,
XPointer* /* args */,
int /* num_args */
-#endif
);
typedef void (*XlcResetConverterProc)(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
typedef struct _XlcConvMethodsRec{
_XFUNCPROTOBEGIN
extern Bool _falInitOM(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern Bool _XInitIM(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern char *_falGetLCValues(
-#if NeedVarargsPrototypes
XLCd /* lcd */,
...
-#endif
);
extern XlcCharSet _fallcGetCharSet(
-#if NeedFunctionPrototypes
char* /* name */
-#endif
);
extern Bool _fallcAddCharSet(
-#if NeedFunctionPrototypes
XlcCharSet /* charset */
-#endif
);
extern char *_fallcGetCSValues(
-#if NeedVarargsPrototypes
XlcCharSet /* charset */,
...
-#endif
);
extern XlcConv _fallcOpenConverter(
-#if NeedFunctionPrototypes
XLCd /* from_lcd */,
char* /* from_type */,
XLCd /* to_lcd */,
char* /* to_type */
-#endif
);
extern void _fallcCloseConverter(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
extern int _fallcConvert(
-#if NeedFunctionPrototypes
XlcConv /* conv */,
XPointer* /* from */,
int* /* from_left */,
int* /* to_left */,
XPointer* /* args */,
int /* num_args */
-#endif
);
extern void _fallcResetConverter(
-#if NeedFunctionPrototypes
XlcConv /* conv */
-#endif
);
extern Bool _fallcSetConverter(
-#if NeedFunctionPrototypes
XLCd /* from_lcd */,
char* /* from_type */,
XLCd /* to_lcd */,
char* /* to_type */,
XlcOpenConverterProc /* open_converter */
-#endif
);
extern void _fallcGetResource(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* category */,
char* /* class */,
char*** /* value */,
int* /* count */
-#endif
);
extern char *_fallcFileName(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* category */
-#endif
);
extern int _falwcslen(
-#if NeedFunctionPrototypes
wchar_t* /* wstr */
-#endif
);
extern wchar_t *_falwcscpy(
-#if NeedFunctionPrototypes
wchar_t* /* wstr1 */,
wchar_t* /* wstr2 */
-#endif
);
extern int _fallcCompareISOLatin1(
-#if NeedFunctionPrototypes
char* /* str1 */,
char* /* str2 */
-#endif
);
extern int _fallcNCompareISOLatin1(
-#if NeedFunctionPrototypes
char* /* str1 */,
char* /* str2 */,
int /* len */
-#endif
);
_XFUNCPROTOEND
} StateRec, *State;
static void
-mbinit(state)
- XPointer state;
+mbinit(XPointer state)
{
_fallcResetConverter(((State) state)->conv);
}
static char
-mbchar(state, str, lenp)
- XPointer state;
- char *str;
- int *lenp;
+mbchar(XPointer state, char *str, char *lenp)
{
XlcConv conv = ((State) state)->conv;
XlcCharSet charset;
}
static void
-mbfinish(state)
- XPointer state;
+mbfinish(XPointer state)
{
}
static char *
-lcname(state)
- XPointer state;
+lcname(XPointer state)
{
return ((State) state)->lcd->core->name;
}
static void
-destroy(state)
- XPointer state;
+destroy(XPointer state)
{
_fallcCloseConverter(((State) state)->conv);
_falCloseLC(((State) state)->lcd);
} ;
XrmMethods
-_falrmDefaultInitParseInfo(lcd, rm_state)
- XLCd lcd;
- XPointer *rm_state;
+_falrmDefaultInitParseInfo(XLCd lcd, XPointer *rm_state)
{
State state;
static int
-sjis_mbstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_mbstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
- register int chr_len = 0;
- register int outbuf = 0;
- register int shift_mult = 0;
- register Uint chrcode = 0;
+ int chr_len = 0;
+ int outbuf = 0;
+ int shift_mult = 0;
+ Uint chrcode = 0;
Uchar ch, ch2;
Uint wc_encode = 0;
#define byte2 (byte1 == 0)
static int
-sjis_wcstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_wcstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register wchar_t *inbufptr = (wchar_t *) *from;
- register XPointer outbufptr = *to;
+ wchar_t *inbufptr = (wchar_t *) *from;
+ XPointer outbufptr = *to;
XPointer outbuf_base = outbufptr;
wchar_t wch;
- register length;
+ int length;
Uchar tmp;
Uchar t1, t2;
int num_conv;
* sjis<->jis conversion for widechar kanji (See Note at top of file)
*/
static void
-sjis_to_jis(p1, p2)
- Uchar *p1;
- Uchar *p2;
+sjis_to_jis(Uchar *p1, Uchar *p2)
{
- register Uchar c1 = *p1;
- register Uchar c2 = *p2;
- register Uchar adjust = c2 < 0x9f;
- register Uchar rowOffset = c1 < 0xa0 ? 0x70 : 0xb0;
- register Uchar cellOffset = adjust ? (0x1f + (c2 > 0x7f)) : 0x7e;
+ Uchar c1 = *p1;
+ Uchar c2 = *p2;
+ Uchar adjust = c2 < 0x9f;
+ Uchar rowOffset = c1 < 0xa0 ? 0x70 : 0xb0;
+ Uchar cellOffset = adjust ? (0x1f + (c2 > 0x7f)) : 0x7e;
*p1 = ((c1 - rowOffset) << 1) - adjust;
*p2 -= cellOffset;
}
static void
-jis_to_sjis(p1, p2)
- Uchar *p1;
- Uchar *p2;
+jis_to_sjis(Uchar *p1, Uchar *p2)
{
- register Uchar c1 = *p1;
- register Uchar c2 = *p2;
- register Uchar rowOffset = c1 < 0x5f ? 0x70 : 0xb0;
- register Uchar cellOffset = c1 % 2 ? 0x1f + (c2 > 0x5f) : 0x7e;
+ Uchar c1 = *p1;
+ Uchar c2 = *p2;
+ Uchar rowOffset = c1 < 0x5f ? 0x70 : 0xb0;
+ Uchar cellOffset = c1 % 2 ? 0x1f + (c2 > 0x5f) : 0x7e;
*p1 = ((Uchar)(c1 + 1) >> 1) + rowOffset;
*p2 = c2 + cellOffset;
}
static CodeSet
-wc_codeset(lcd, wch)
- XLCd lcd;
- wchar_t wch;
+wc_codeset(XLCd lcd, wchar_t wch)
{
- register CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
-#if !defined(__sony_news) || defined(SVR4)
- register int end = XLC_GENERIC(lcd, codeset_num);
- register Ulong widech = (Ulong)(wch & XLC_GENERIC(lcd, wc_encode_mask));
+ CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
+ int end = XLC_GENERIC(lcd, codeset_num);
+ Ulong widech = (Ulong)(wch & XLC_GENERIC(lcd, wc_encode_mask));
for (; --end >= 0; codesets++)
if ( widech == (*codesets)->wc_encoding )
return *codesets;
return NULL;
-#else
- if( iskanji(wch >> 8) )
- return( codesets[1] );
- if( iskana(wch & 0xff) )
- return( codesets[2] );
- return( codesets[0] );
-#endif
}
static int
-sjis_mbtocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_mbtocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
XlcCharSet charset = NULL;
int char_size = 0;
int unconv_num = 0;
- register char *src = *from, *dst = *to;
+ char *src = *from, *dst = *to;
CodeSet *codesets = XLC_GENERIC(lcd, codeset_list);
int codeset_num = XLC_GENERIC(lcd, codeset_num);
static int
-sjis_mbstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_mbstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd) conv->state;
char *tmp_from, *tmp_to;
}
static int
-sjis_wcstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_wcstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd) conv->state;
wchar_t *wcptr = *((wchar_t **)from);
- register char *bufptr = *((char **) to);
+ char *bufptr = *((char **) to);
wchar_t wch;
char *tmpptr;
- register length;
+ int length;
CodeSet codeset;
Ulong wc_encoding;
int buf_len = *to_left;
if (wcstr_len < buf_len / codeset->length)
buf_len = wcstr_len * codeset->length;
-#if !defined(__sony_news) || defined(SVR4)
wc_encoding = codeset->wc_encoding;
for ( ; wcstr_len > 0 && buf_len > 0; wcptr++, wcstr_len--) {
wch >>= (wchar_t)XLC_GENERIC(lcd, wc_shift_bits);
}
}
-#else
- length = codeset->length;
- for( ; wcstr_len > 0 && buf_len > 0; wcptr++, wcstr_len-- ) {
- wch = *wcptr;
- if( codeset != wc_codeset( lcd, wch ) )
- break;
-
- buf_len -= length;
- if( length == 2 ) {
- unsigned short code;
-
- code = sjis2jis( wch & 0xffff );
- *bufptr++ = code >> 8;
- *bufptr++ = code & 0xff;
- }
- else
- *bufptr++ = wch & 0xff;
- }
-#endif
if (num_args > 0)
*((XlcCharSet *) args[0]) = *codeset->charset_list;
}
static CodeSet
-GetCodeSetFromCharSet(lcd, charset)
- XLCd lcd;
- XlcCharSet charset;
+GetCodeSetFromCharSet(XLCd lcd, XlcCharSet charset)
{
- register CodeSet *codeset = XLC_GENERIC(lcd, codeset_list);
- register XlcCharSet *charset_list;
- register codeset_num, num_charsets;
+ CodeSet *codeset = XLC_GENERIC(lcd, codeset_list);
+ XlcCharSet *charset_list;
+ int codeset_num, num_charsets;
codeset_num = XLC_GENERIC(lcd, codeset_num);
static int
-sjis_cstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- char **from;
- int *from_left;
- char **to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_cstombs(
+ XlcConv conv,
+ char **from,
+ int *from_left,
+ char **to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd) conv->state;
- register char *csptr = *from;
- register char *bufptr = *to;
+ char *csptr = *from;
+ char *bufptr = *to;
int csstr_len = *from_left;
- register buf_len = *to_left;
+ int buf_len = *to_left;
int length;
CodeSet codeset;
EncodingType type;
}
static int
-sjis_cstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_cstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd) conv->state;
- register char *csptr = (char *) *from;
+ char *csptr = (char *) *from;
wchar_t *bufptr = (wchar_t *) *to;
wchar_t *toptr = (wchar_t *) *to;
int csstr_len = *from_left;
- register buf_len = *to_left;
+ int buf_len = *to_left;
wchar_t wch;
int length;
Ulong wc_shift_bits = (int)XLC_GENERIC(lcd, wc_shift_bits);
/*
* Stripped down Direct CT converters for SJIS
- *
*/
#define BADCHAR(min_ch, c) (BIT8OFF(c) < (char)min_ch && BIT8OFF(c) != 0x0 && \
* initCTptr(): Set ctptr[] to point at ctdata[], indexed by codeset_num.
*/
static void
-initCTptr(lcd)
- XLCd lcd;
+initCTptr(XLCd lcd)
{
int num_codesets = XLC_GENERIC(lcd, codeset_num);
int num_charsets;
static int
-sjis_mbstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_mbstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register ct_len = *to_left;
+ int ct_len = *to_left;
int cs_num;
int clen;
int unconv_num = 0;
int num_conv;
XPointer inbufptr = *from;
- register char *ctptr = *to;
+ char *ctptr = *to;
XPointer ct_base = ctptr;
StateRec ct_state;
#define byte2 (byte1 == 0)
static int
-sjis_wcstocts(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_wcstocts(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register ct_len = *to_left;
- register wchar_t *inbufptr = (wchar_t *) *from;
- register char *ctptr = *to;
+ int ct_len = *to_left;
+ wchar_t *inbufptr = (wchar_t *) *from;
+ char *ctptr = *to;
XPointer ct_base = ctptr;
wchar_t wch;
- register length;
+ int length;
Uchar tmp;
Uchar t1 = 0, t2;
int num_conv;
#define SKIP_P(str) while (*(str) >= 0x30 && *(str) <= 0x3f) (str)++;
static int
-sjis_ctstombs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_ctstombs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
- register XPointer inbufptr = *from;
- register XPointer outbufptr = *to;
+ XPointer inbufptr = *from;
+ XPointer outbufptr = *to;
XPointer inbuf_base;
XPointer outbuf_base = outbufptr;
- register clen, length;
+ int clen, length;
int unconv_num = 0;
int num_conv;
unsigned int ct_seglen = 0;
static int
-sjis_ctstowcs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+sjis_ctstowcs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XLCd lcd = (XLCd)conv->state;
Ulong wc_shift_bits = XLC_GENERIC(lcd, wc_shift_bits);
- register XPointer inbufptr = *from;
+ XPointer inbufptr = *from;
XPointer inbuf_base;
- register wchar_t *outbufptr = (wchar_t *) *to;
+ wchar_t *outbufptr = (wchar_t *) *to;
wchar_t *outbuf_base = outbufptr;
- register clen, length;
+ int clen, length;
int num_conv;
int unconv_num = 0;
unsigned int ct_seglen = 0;
Uchar ct_type = 0;
- register shift_mult;
+ int shift_mult;
wchar_t wc_tmp;
wchar_t wch;
Ulong wc_encoding;
(*from_left) -= 2;
continue;
}
-#if !defined(__sony_news) || defined(SVR4)
wc_encoding = (ctdp == ctdptr[Kana] && isleftside(*inbufptr)) ?
ctdptr[Ascii]->wc_encoding : ctdp->wc_encoding;
shift_mult--;
} while (--clen);
*outbufptr++ = wch | wc_encoding;
-#else
- if( length == 1 )
- *outbufptr++ = (unsigned char)*inbufptr++;
- else if( length == 2 ) {
- unsigned short code;
- code = (*inbufptr << 8) | *(inbufptr+1);
- *outbufptr++ = jis2sjis( code );
- inbufptr += 2;
- }
-#endif
}
*to = (XPointer)outbufptr;
#undef BADCHAR
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
Xfree((char *) conv);
}
static XlcConv
-create_conv(lcd, methods)
- XLCd lcd;
- XlcConvMethods methods;
+create_conv(XLCd lcd, XlcConvMethods methods)
{
XlcConv conv;
static XlcConv
-open_mbstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOCS]);
}
static XlcConv
-open_wcstocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOCS]);
}
static XlcConv
-open_mbtocs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbtocs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBTOCS]);
}
static XlcConv
-open_cstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CSTOMBS]);
}
static XlcConv
-open_cstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_cstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CSTOWCS]);
}
static XlcConv
-open_mbstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOWCS]);
}
static XlcConv
-open_wcstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOMBS]);
}
static XlcConv
-open_wcstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_wcstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[WCSTOCTS]);
}
static XlcConv
-open_mbstocts(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_mbstocts(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[MBSTOCTS]);
}
static XlcConv
-open_ctstombs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstombs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CTSTOMBS]);
}
static XlcConv
-open_ctstowcs(from_lcd, from_type, to_lcd, to_type)
- XLCd from_lcd;
- char *from_type;
- XLCd to_lcd;
- char *to_type;
+open_ctstowcs(XLCd from_lcd, char *from_type, XLCd to_lcd, char *to_type)
{
return create_conv(from_lcd, &conv_methods[CTSTOWCS]);
}
XLCd
-_fallcSjisLoader(name)
- char *name;
+_fallcSjisLoader(char *name)
{
XLCd lcd;
CodeSet *codeset_list;
#include "_fallcPubI.h"
int
-_fallcmbtowc(lcd, wstr, str, len)
- XLCd lcd;
- wchar_t *wstr;
- char *str;
- int len;
+_fallcmbtowc(XLCd lcd, wchar_t *wstr, char *str, int len)
{
static XLCd last_lcd = NULL;
static XlcConv conv = NULL;
}
int
-_fallcwctomb(lcd, str, wc)
- XLCd lcd;
- char *str;
- wchar_t wc;
+_fallcwctomb(XLCd lcd, char *str, wchar_t wc)
{
static XLCd last_lcd = NULL;
static XlcConv conv = NULL;
}
int
-_fallcmbstowcs(lcd, wstr, str, len)
- XLCd lcd;
- wchar_t *wstr;
- char *str;
- int len;
+_fallcmbstowcs(XLCd lcd, wchar_t *wstr, char *str, int len)
{
XlcConv conv;
XPointer from, to;
}
int
-_fallcwcstombs(lcd, str, wstr, len)
- XLCd lcd;
- char *str;
- wchar_t *wstr;
- int len;
+_fallcwcstombs(XLCd lcd, char *str, wchar_t *wstr, int len)
{
XlcConv conv;
XPointer from, to;
int
-_falmbtowc(wstr, str, len)
- wchar_t *wstr;
- char *str;
- int len;
+_falmbtowc(wchar_t *wstr, char *str, int len)
{
return _fallcmbtowc((XLCd) NULL, wstr, str, len);
}
int
-_falmblen(str, len)
- char *str;
- int len;
+_falmblen(char *str, int len)
{
return _falmbtowc((wchar_t *) NULL, str, len);
}
int
-_falwctomb(str, wc)
- char *str;
- wchar_t wc;
+_falwctomb(char *str, wchar_t wc)
{
return _fallcwctomb((XLCd) NULL, str, wc);
}
int
-_falmbstowcs(wstr, str, len)
- wchar_t *wstr;
- char *str;
- int len;
+_falmbstowcs(wchar_t *wstr, char *str, int len)
{
return _fallcmbstowcs((XLCd) NULL, wstr, str, len);
}
int
-_falwcstombs(str, wstr, len)
- char *str;
- wchar_t *wstr;
- int len;
+_falwcstombs(char *str, wchar_t *wstr, int len)
{
return _fallcwcstombs((XLCd) NULL, str, wstr, len);
}
wchar_t *
-_falwcscpy(wstr1, wstr2)
- register wchar_t *wstr1, *wstr2;
+_falwcscpy(wchar_t *wstr1, wchar_t *wstr2)
{
wchar_t *wstr_tmp = wstr1;
}
wchar_t *
-_falwcsncpy(wstr1, wstr2, len)
- register wchar_t *wstr1, *wstr2;
- register len;
+_falwcsncpy(wchar_t *wstr1, wchar_t *wstr2, int len)
{
wchar_t *wstr_tmp = wstr1;
}
int
-_falwcslen(wstr)
- register wchar_t *wstr;
+_falwcslen(wchar_t *wstr)
{
- register wchar_t *wstr_ptr = wstr;
+ wchar_t *wstr_ptr = wstr;
while (*wstr_ptr)
wstr_ptr++;
}
int
-_falwcscmp(wstr1, wstr2)
- register wchar_t *wstr1, *wstr2;
+_falwcscmp(wchar_t *wstr1, wchar_t *wstr2)
{
for ( ; *wstr1 && *wstr2; wstr1++, wstr2++)
if (*wstr1 != *wstr2)
}
int
-_falwcsncmp(wstr1, wstr2, len)
- register wchar_t *wstr1, *wstr2;
- register len;
+_falwcsncmp(wchar_t *wstr1, wchar_t *wstr2, int len)
{
for ( ; *wstr1 && *wstr2 && len > 0; wstr1++, wstr2++, len--)
if (*wstr1 != *wstr2)
#include <stdio.h>
static int
-get_buf_size(is_wide_char, list, count)
- Bool is_wide_char;
- XPointer list;
- int count;
+get_buf_size(Bool is_wide_char, XPointer list, int count)
{
- register length = 0;
- register char **mb_list;
- register wchar_t **wc_list;
+ int length = 0;
+ char **mb_list;
+ wchar_t **wc_list;
if (list == NULL)
return 0;
}
static int
-_XTextListToTextProperty(lcd, dpy, from_type, list, count, style, text_prop)
- XLCd lcd;
- Display *dpy;
- char *from_type;
- XPointer list;
- int count;
- XICCEncodingStyle style;
- XTextProperty *text_prop;
+_XTextListToTextProperty(
+ XLCd lcd,
+ Display *dpy,
+ char *from_type,
+ XPointer list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty *text_prop)
{
Atom encoding;
XlcConv conv;
wchar_t **wc_list;
XPointer from;
char *to, *buf, *value;
- int from_left, to_left, buf_len, nitems, unconv_num, ret, i;
+ int from_left, to_left, buf_len, nitems, unconv_num, ret, i, retry, done =0;
Bool is_wide_char = False;
if (strcmp(XlcNWideChar, from_type) == 0)
mb_list++;
}
unconv_num = 0;
- goto done;
+ done++;
}
break;
default:
if (count < 1) {
nitems = 0;
- goto done;
+ done++;
}
-retry:
- conv = _fallcOpenConverter(lcd, from_type, lcd, to_type);
- if (conv == NULL) {
+ if(done == 1){
+ if (nitems <= 0)
+ nitems = 1;
+ value = (char *) Xmalloc(nitems);
+ if (value == NULL) {
+ Xfree(buf);
+ return XNoMemory;
+ }
+ if (nitems == 1)
+ *value = 0;
+ else
+ memcpy(value, buf, nitems);
+ nitems--;
Xfree(buf);
- return XConverterNotFound;
+
+ text_prop->value = (unsigned char *) value;
+ text_prop->encoding = encoding;
+ text_prop->format = 8;
+ text_prop->nitems = nitems;
+
+ return unconv_num;
}
- if (is_wide_char)
- wc_list = (wchar_t **) list;
- else
- mb_list = (char **) list;
+ do{
+ retry = 0;
+ conv = _fallcOpenConverter(lcd, from_type, lcd, to_type);
+ if (conv == NULL) {
+ Xfree(buf);
+ return XConverterNotFound;
+ }
- to = buf;
- to_left = buf_len;
+ if (is_wide_char)
+ wc_list = (wchar_t **) list;
+ else
+ mb_list = (char **) list;
- unconv_num = 0;
+ to = buf;
+ to_left = buf_len;
- for (i = 1; to_left > 0; i++) {
- if (is_wide_char) {
- from = (XPointer) *wc_list;
- from_left = _falwcslen(*wc_list);
- wc_list++;
- } else {
- from = (XPointer) *mb_list;
- from_left = strlen(*mb_list);
- mb_list++;
- }
+ unconv_num = 0;
- ret = _fallcConvert(conv, &from, &from_left, (XPointer *) &to, &to_left,
+ for (i = 1; to_left > 0; i++) {
+ if (is_wide_char) {
+ from = (XPointer) *wc_list;
+ from_left = _falwcslen(*wc_list);
+ wc_list++;
+ } else {
+ from = (XPointer) *mb_list;
+ from_left = strlen(*mb_list);
+ mb_list++;
+ }
+
+ ret = _fallcConvert(conv, &from, &from_left, (XPointer *) &to, &to_left,
NULL, 0);
- if (ret < 0)
- continue;
+ if (ret < 0)
+ continue;
- if (ret > 0 && style == XStdICCTextStyle && encoding == XA_STRING) {
- _fallcCloseConverter(conv);
- encoding = falInternAtom(dpy, "COMPOUND_TEXT", False);
- to_type = XlcNCompoundText;
- goto retry;
- }
+ if (ret > 0 && style == XStdICCTextStyle && encoding == XA_STRING) {
+ _fallcCloseConverter(conv);
+ encoding = falInternAtom(dpy, "COMPOUND_TEXT", False);
+ to_type = XlcNCompoundText;
+ retry++;
+ }
- unconv_num += ret;
- *to++ = '\0';
- to_left--;
+ unconv_num += ret;
+ *to++ = '\0';
+ to_left--;
- if (i >= count)
- break;
+ if (i >= count)
+ break;
- _fallcResetConverter(conv);
- }
+ _fallcResetConverter(conv);
+ }
_fallcCloseConverter(conv);
nitems = to - buf;
-done:
- if (nitems <= 0)
- nitems = 1;
- value = (char *) Xmalloc(nitems);
- if (value == NULL) {
- Xfree(buf);
- return XNoMemory;
- }
- if (nitems == 1)
- *value = 0;
- else
- memcpy(value, buf, nitems);
- nitems--;
- Xfree(buf);
-
- text_prop->value = (unsigned char *) value;
- text_prop->encoding = encoding;
- text_prop->format = 8;
- text_prop->nitems = nitems;
-
- return unconv_num;
+ }while (retry == 1);
}
int
-_falmbTextListToTextProperty(lcd, dpy, list, count, style, text_prop)
- XLCd lcd;
- Display *dpy;
- char **list;
- int count;
- XICCEncodingStyle style;
- XTextProperty *text_prop;
+_falmbTextListToTextProperty(
+ XLCd lcd,
+ Display *dpy,
+ char **list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty *text_prop)
{
return _XTextListToTextProperty(lcd, dpy, XlcNMultiByte, (XPointer) list,
count, style, text_prop);
}
int
-_falwcTextListToTextProperty(lcd, dpy, list, count, style, text_prop)
- XLCd lcd;
- Display *dpy;
- wchar_t **list;
- int count;
- XICCEncodingStyle style;
- XTextProperty *text_prop;
+_falwcTextListToTextProperty(
+ XLCd lcd,
+ Display *dpy,
+ wchar_t **list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty *text_prop)
{
return _XTextListToTextProperty(lcd, dpy, XlcNWideChar, (XPointer) list,
count, style, text_prop);
******************************************************************/
#include "_fallcUTF.h"
+#include <stdlib.h>
-static long getutfrune();
+static long getutfrune(char **read_from, int *from_len);
static void our_wctomb(
-#if NeedFunctionPrototypes
unsigned short r,
char **bufptr,
int *buf_len
-#endif
);
static int our_mbtowc(
-#if NeedFunctionPrototypes
unsigned long *p,
char *s,
size_t n
-#endif
);
static void latin2rune(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
);
static void jis02012rune(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
);
static void jis02082rune(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
);
static void ksc2rune(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
);
static void gb2rune(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
);
-static void init_latin1tab();
-static void init_latin2tab();
-static void init_latin3tab();
-static void init_latin4tab();
-static void init_latin5tab();
-static void init_latin6tab();
-static void init_latin7tab();
-static void init_latin8tab();
-static void init_latin9tab();
-static void init_jis0201tab();
-static void init_jis0208tab();
-static void init_ksc5601tab();
-static void init_gb2312tab();
+static void init_latin1tab(long *tbl, long fb_default);
+static void init_latin2tab(long *tbl, long fb_default);
+static void init_latin3tab(long *tbl, long fb_default);
+static void init_latin4tab(long *tbl, long fb_default);
+static void init_latin5tab(long *tbl, long fb_default);
+static void init_latin6tab(long *tbl, long fb_default);
+static void init_latin7tab(long *tbl, long fb_default);
+static void init_latin8tab(long *tbl, long fb_default);
+static void init_latin9tab(long *tbl, long fb_default);
+static void init_jis0201tab(long *tbl, long fb_default);
+static void init_jis0208tab(long *tbl, long fb_default);
+static void init_ksc5601tab(long *tbl, long fb_default);
+static void init_gb2312tab(long *tbl, long fb_default);
static char *int_locale = NULL;
static void
-set_latin_nop(table, default_val)
-long *table;
-long default_val;
+set_latin_nop(long *table, long default_val)
{
- register int i;
+ int i;
for(i = 0; i < 0x1fff; i++)
table[i] = default_val;
return;
}
static void
-set_latin_tab(fptr, table, fb_default)
-FILE *fptr;
-long *table;
-long fb_default;
+set_latin_tab(FILE *fptr, long *table, long fb_default)
{
int i = 0;
int j = 0;
#define TBL_DATA_DIR "tbl_data"
static void
-init_latin1tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin1tab(long *tbl, long fb_default)
{
FILE *fp = NULL;
char dirname[BUFSIZE];
}
static void
-init_latin2tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin2tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin3tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin3tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin4tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin4tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin5tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin5tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin6tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin6tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin7tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin7tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin8tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin8tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_latin9tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_latin9tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_jis0201tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_jis0201tab(long *tbl, long fb_default)
{
int i;
for(i = 0; i < NRUNE; i++)
}
static void
-set_cjk_nop(to_tbl, to_max, default_val)
-long **to_tbl;
-long default_val;
-int to_max;
+set_cjk_nop(long **to_tbl, int to_max, long default_val)
{
- register int i;
+ int i;
for(i = 0; i < to_max; i++)
(*to_tbl)[i] = default_val;
return;
}
static void
-set_table(fptr, to_tbl, from_tbl, to_max, fb_default)
-FILE *fptr;
-long **to_tbl, *from_tbl;
-int to_max;
-long fb_default;
+set_table(
+FILE *fptr,
+long **to_tbl,
+long *from_tbl,
+int to_max,
+long fb_default)
{
- register int i = 0;
+ int i = 0;
int j = 0;
int rv = 0;
long value;
static void
-init_jis0208tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_jis0208tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_ksc5601tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_ksc5601tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static void
-init_gb2312tab(tbl, fb_default)
-long *tbl;
-long fb_default;
+init_gb2312tab(long *tbl, long fb_default)
{
FILE *fp;
char dirname[BUFSIZE];
}
static UtfData
-make_entry()
+make_entry(void)
{
UtfData tmp = (UtfData)Xmalloc(sizeof(UtfDataRec));
bzero(tmp, sizeof(UtfDataRec));
static int once = 0;
static int
-_XlcInitUTFInfo(lcd)
-XLCd lcd;
+_XlcInitUTFInfo(XLCd lcd)
{
if(!once) {
int i;
}
static int
-utftocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- char **from;
- int *from_left;
- char **to;
- int *to_left;
- XPointer *args;
- int num_args;
+utftocs(
+ XlcConv conv,
+ char **from,
+ int *from_left,
+ char **to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
char *utfptr;
char *bufptr;
tbl += l;
if((r = *tbl) == -1) {
if(tmpcharset) {
- goto end;
+ if((num_args > 0) && tmpcharset)
+ *((XlcCharSet *) args[0]) = tmpcharset;
+
+ *from_left -= utfptr - *from;
+ *from = utfptr;
+
+ *to_left -= bufptr - *to;
+ *to = bufptr;
+
+ return 0;
+
} else {
pdata = pdata->next;
continue;
if(!tmpcharset) return (-1); /* Unknown Codepoint */
}
}
-end:
- if((num_args > 0) && tmpcharset)
- *((XlcCharSet *) args[0]) = tmpcharset;
-
- *from_left -= utfptr - *from;
- *from = utfptr;
-
- *to_left -= bufptr - *to;
- *to = bufptr;
-
- return 0;
}
static int
-utf1tocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- char **from;
- int *from_left;
- char **to;
- int *to_left;
- XPointer *args;
- int num_args;
+utf1tocs(
+ XlcConv conv,
+ char **from,
+ int *from_left,
+ char **to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
char **ptr = NULL;
char char_ptr[UTFmax];
}
static int
-ucstocs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- XPointer *from;
- int *from_left;
- char **to;
- int *to_left;
- XPointer *args;
- int num_args;
+ucstocs(
+ XlcConv conv,
+ XPointer *from,
+ int *from_left,
+ char **to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
wchar_t *ucsptr;
char *bufptr;
tbl += *ucsptr;
if((r = *tbl) == -1) {
if(tmpcharset) {
- goto end;
+ if((num_args > 0) && tmpcharset)
+ *((XlcCharSet *) args[0]) = tmpcharset;
+
+ *from_left -= ucsptr - (wchar_t *)*from;
+ *from = (XPointer)ucsptr;
+
+ *to_left -= bufptr - *to;
+ *to = bufptr;
+
+ return 0;
+
} else {
pdata = pdata->next;
continue;
}
if(!tmpcharset) return (-1); /* Unknown Codepoint */
}
-end:
- if((num_args > 0) && tmpcharset)
- *((XlcCharSet *) args[0]) = tmpcharset;
-
- *from_left -= ucsptr - (wchar_t *)*from;
- *from = (XPointer)ucsptr;
-
- *to_left -= bufptr - *to;
- *to = bufptr;
-
- return 0;
}
static long
-#if NeedFunctionPrototypes
getutfrune(char **read_from, int *from_len)
-#else
-getutfrune(read_from, from_len)
-char **read_from;
-int *from_len;
-#endif
{
int c, i;
char str[UTFmax]; /* MB_LEN_MAX really */
}
static
-cstoutf(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- char **from;
- int *from_left;
- char **to;
- int *to_left;
- XPointer *args;
- int num_args;
+cstoutf(
+ XlcConv conv,
+ char **from,
+ int *from_left,
+ char **to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XlcCharSet charset;
char *csptr, *utfptr;
int csstr_len, utf_len;
int cmp_len = 0;
void (*putrune)(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
) = NULL;
Rune r = (Rune)0;
UtfData pdata = utfdata_list;
}
static
-cstoucs(conv, from, from_left, to, to_left, args, num_args)
- XlcConv conv;
- char **from;
- int *from_left;
- XPointer *to;
- int *to_left;
- XPointer *args;
- int num_args;
+cstoucs(
+ XlcConv conv,
+ char **from,
+ int *from_left,
+ XPointer *to,
+ int *to_left,
+ XPointer *args,
+ int num_args)
{
XlcCharSet charset;
char *csptr;
int csstr_len, ucs_len;
int cmp_len = 0;
void (*putrune)(
-#if NeedFunctionPrototypes
unsigned char c,
Rune *r
-#endif
) = NULL;
Rune r = (Rune)0;
UtfData pdata = utfdata_list;
}
static void
-#if NeedFunctionPrototypes
our_wctomb(Rune r, char **utfptr, int *utf_len)
-#else
-our_wctomb(r, utfptr, utf_len)
-Rune r;
-char **utfptr;
-int *utf_len;
-#endif
{
long l = (long)r;
}
static void
-#if NeedFunctionPrototypes
latin2rune(unsigned char c, Rune *r)
-#else
-latin2rune(c, r)
-unsigned char c;
-Rune *r;
-#endif
{
*r = (Rune)c;
return;
}
static void
-#if NeedFunctionPrototypes
ksc2rune(unsigned char c, Rune *r)
-#else
-ksc2rune(c, r)
-unsigned char c;
-Rune *r;
-#endif
{
static enum { init, cs1last} state = init;
static int korean646 = 1; /* fixed to 1 for now. */
}
static void
-#if NeedFunctionPrototypes
jis02012rune(unsigned char c, Rune *r)
-#else
-jis02012rune(c, r)
-unsigned char c;
-Rune *r;
-#endif
{
/* To Be Implemented */
}
static void
-#if NeedFunctionPrototypes
gb2rune(unsigned char c, Rune *r)
-#else
-gb2rune(c, r)
-unsigned char c;
-Rune *r;
-#endif
{
static enum { state0, state1 } state = state0;
static int lastc;
long n, ch;
unsigned char ch1 = (c|0x80); /* XXX */
-again:
switch(state)
{
case state0: /* idle state */
}
static void
-#if NeedFunctionPrototypes
jis02082rune(unsigned char c, Rune *r)
-#else
-jis02082rune(c, r)
-unsigned char c;
-Rune *r;
-#endif
{
static enum { state0, state1} state = state0;
static int lastc;
unsigned char ch = (c|0x80); /* XXX */
- int n;
+ int n, again;
long l;
-again:
+do {
+ again = 0;
switch(state)
{
case state0: /* idle state */
if((lastc&0x80) != (ch&0x80)){
emit(lastc);
state = state0;
- goto again;
+ again += 1;
}
if(CANS2J(lastc, ch)){
int h = lastc, l = ch;
}
state = state0;
}
+ } while (again == 1);
}
static int
-#if NeedFunctionPrototypes
our_mbtowc(unsigned long *p, char *s, size_t n)
-#else
-our_mbtowc(p, s, n)
-unsigned long *p;
-char *s;
-size_t n;
-#endif
{
unsigned char *us;
int c0, c1, c2, c3, c4, c5;
return 0; /* no shift states */
if(n < 1)
- goto badlen;
+ return -2; /* bad length */
us = (unsigned char*)s;
c0 = us[0];
if(c0 >= T3) {
if(n < 3)
- goto badlen;
+ return -2;
c1 = us[1] ^ Tx;
c2 = us[2] ^ Tx;
if((c1|c2) & T2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
if(c0 >= T5) {
if(n < 5)
- goto badlen;
+ return -2;
c3 = us[3] ^ Tx;
c4 = us[4] ^ Tx;
if((c3|c4) & T2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
if(c0 >= T6) {
/* 6 bytes */
if(n < 6)
- goto badlen;
+ return -2;
c5 = us[5] ^ Tx;
if(c5 & T2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
wc = ((((((((((c0 & Mask6) << Bitx) |
c1) << Bitx) | c2) << Bitx) |
c3) << Bitx) | c4) << Bitx) | c5;
if(wc <= Wchar5) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = wc;
return 6;
c1) << Bitx) | c2) << Bitx) |
c3) << Bitx) | c4;
if(wc <= Wchar4) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = wc;
return 5;
if(c0 >= T4) {
/* 4 bytes */
if(n < 4)
- goto badlen;
+ return -2;
c3 = us[3] ^ Tx;
if(c3 & T2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
wc = ((((((c0 & Mask4) << Bitx) |
c1) << Bitx) | c2) << Bitx) |
c3;
if(wc <= Wchar3) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = wc;
return 4;
wc = ((((c0 & Mask3) << Bitx) |
c1) << Bitx) | c2;
if(wc <= Wchar2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = wc;
return 3;
if(c0 >= T2) {
/* 2 bytes */
if(n < 2)
- goto badlen;
+ return -2;
c1 = us[1] ^ Tx;
if(c1 & T2) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
wc = ((c0 & Mask2) << Bitx) |
c1;
if(wc <= Wchar1) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = wc;
return 2;
}
/* 1 byte */
if(c0 >= Tx) {
- goto bad;
+ errno = EILSEQ;
+ return -1;
}
*p = c0;
return 1;
-
-bad:
- errno = EILSEQ;
- return -1;
-badlen:
- return -2;
}
static void
-close_converter(conv)
- XlcConv conv;
+close_converter(XlcConv conv)
{
Xfree((char *) conv);
}
static XlcConv
-create_conv(lcd, methods)
- XLCd lcd;
- XlcConvMethods methods;
+create_conv(XLCd lcd, XlcConvMethods methods)
{
XlcConv conv;
return conv;
-err:
+/* if an error occurs somewhere
close_converter(conv);
-
return (XlcConv) NULL;
+*/
}
static XlcConvMethodsRec mbtocs_methods = {
};
static XlcConv
-open_mbtocs(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_mbtocs(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
return create_conv(from_lcd, &mbtocs_methods);
}
};
static XlcConv
-open_mbstocs(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_mbstocs(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
return create_conv(from_lcd, &mbstocs_methods);
}
};
static XlcConv
-open_wcstocs(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_wcstocs(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
return create_conv(from_lcd, &wcstocs_methods);
}
};
static XlcConv
-open_cstombs(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_cstombs(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
return create_conv(from_lcd, &cstombs_methods);
}
};
static XlcConv
-open_cstowcs(from_lcd, from, to_lcd, to)
- XLCd from_lcd;
- char *from;
- XLCd to_lcd;
- char *to;
+open_cstowcs(XLCd from_lcd, char *from, XLCd to_lcd, char *to)
{
return create_conv(from_lcd, &cstowcs_methods);
}
XLCd
-_fallcUtfLoader(name)
- char *name;
+_fallcUtfLoader(char *name)
{
XLCd lcd;
typedef struct _UtfDataRec {
XlcCharSet charset;
void (*initialize)( /* Table Initializer */
-#if NeedNestedPrototypes
long *tbl,
long fallback
-#endif
);
long *fromtbl; /* UTF -> CharSet */
NormalizeType type; /* Normalize type */
void (*cstorune)( /* CharSet -> UTF */
-#if NeedNestedPrototypes
unsigned char c,
Rune *r
-#endif
);
Bool already_init;
struct _UtfDataRec *next; /* next entry */
XlcSide side;
void (*initialize)();
void (*cstorune)(
-#if NeedNestedPrototypes
unsigned char c,
Rune *r
-#endif
);
NormalizeType type;
long fallback_value;
#endif
int
-_fallcCompareISOLatin1(str1, str2)
- char *str1, *str2;
+_fallcCompareISOLatin1(char *str1, char *str2)
{
- register char ch1, ch2;
+ char ch1, ch2;
for ( ; (ch1 = *str1) && (ch2 = *str2); str1++, str2++) {
if (islower(ch1))
}
int
-_fallcNCompareISOLatin1(str1, str2, len)
- char *str1, *str2;
- int len;
+_fallcNCompareISOLatin1(char *str1, char *str2, int len)
{
- register char ch1, ch2;
+ char ch1, ch2;
for ( ; (ch1 = *str1) && (ch2 = *str2) && len; str1++, str2++, len--) {
if (islower(ch1))
#endif
#include "_falutil.h"
-#ifdef __STDC__
-#define Const const
-#else
-#define Const /**/
-#endif
-
-#ifdef X_NOT_STDC_ENV
-extern char *getenv();
-#endif
-
extern void _fallcInitLoader(
-#if NeedFunctionPrototypes
void
-#endif
);
#ifdef XTHREADS
LockInfoPtr _Xi18n_lock;
#endif
-#if NeedFunctionPrototypes
char *
-falSetLocaleModifiers(
- _Xconst char *modifiers
-)
-#else
-char *
-falSetLocaleModifiers(modifiers)
- char *modifiers;
-#endif
+falSetLocaleModifiers(const char *modifiers)
{
XLCd lcd = _fallcCurrentLC();
char *user_mods;
}
Bool
-falSupportsLocale()
+falSupportsLocale(void)
{
return _fallcCurrentLC() != (XLCd)NULL;
}
-Bool _fallcValidModSyntax(mods, valid_mods)
- char *mods;
- char **valid_mods;
+Bool _fallcValidModSyntax(char *mods, char **valid_mods)
{
int i;
char **ptr;
return !mods || !*mods;
}
-static Const char *im_valid[] = {"im", (char *)NULL};
+static const char *im_valid[] = {"im", (char *)NULL};
/*ARGSUSED*/
char *
-_fallcDefaultMapModifiers (lcd, user_mods, prog_mods)
- XLCd lcd;
- char *user_mods;
- char *prog_mods;
+_fallcDefaultMapModifiers (XLCd lcd, char *user_mods, char *prog_mods)
{
int i;
char *mods;
static XlcLoaderList loader_list = NULL;
void
-_fallcRemoveLoader(proc)
- XLCdLoadProc proc;
+_fallcRemoveLoader(XLCdLoadProc proc)
{
XlcLoaderList loader, prev;
}
Bool
-_fallcAddLoader(proc, position)
- XLCdLoadProc proc;
- XlcPosition position;
+_fallcAddLoader(XLCdLoadProc proc, XlcPosition position)
{
XlcLoaderList loader, last;
}
XLCd
-_falOpenLC(name)
- char *name;
+_falOpenLC(char *name)
{
XLCd lcd;
XlcLoaderList loader;
if (!strcmp (cur->lcd->core->name, name)) {
lcd = cur->lcd;
cur->ref_count++;
- goto found;
+ _XUnlockMutex(_Xi18n_lock);
+ return lcd;
}
}
break;
}
}
-
-found:
- _XUnlockMutex(_Xi18n_lock);
- return lcd;
}
void
-_falCloseLC(lcd)
- XLCd lcd;
+_falCloseLC(XLCd lcd)
{
XLCdList cur, *prev;
*/
XLCd
-_fallcCurrentLC()
+_fallcCurrentLC(void)
{
XLCd lcd;
static XLCd last_lcd = NULL;
}
XrmMethods
-_falrmInitParseInfo(state)
- XPointer *state;
+_falrmInitParseInfo(XPointer *state)
{
XLCd lcd = _falOpenLC((char *) NULL);
}
int
-falmbTextPropertyToTextList(dpy, text_prop, list_ret, count_ret)
- Display *dpy;
- XTextProperty *text_prop;
- char ***list_ret;
- int *count_ret;
+falmbTextPropertyToTextList(
+ Display *dpy,
+ XTextProperty *text_prop,
+ char ***list_ret,
+ int *count_ret)
{
XLCd lcd = _fallcCurrentLC();
}
int
-falwcTextPropertyToTextList(dpy, text_prop, list_ret, count_ret)
- Display *dpy;
- XTextProperty *text_prop;
- wchar_t ***list_ret;
- int *count_ret;
+falwcTextPropertyToTextList(
+ Display *dpy,
+ XTextProperty *text_prop,
+ wchar_t ***list_ret,
+ int *count_ret)
{
XLCd lcd = _fallcCurrentLC();
}
int
-falmbTextListToTextProperty(dpy, list, count, style, text_prop)
- Display *dpy;
- char **list;
- int count;
- XICCEncodingStyle style;
- XTextProperty *text_prop;
+falmbTextListToTextProperty(
+ Display *dpy,
+ char **list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty *text_prop)
{
XLCd lcd = _fallcCurrentLC();
}
int
-falwcTextListToTextProperty(dpy, list, count, style, text_prop)
- Display *dpy;
- wchar_t **list;
- int count;
- XICCEncodingStyle style;
- XTextProperty *text_prop;
+falwcTextListToTextProperty(
+ Display *dpy,
+ wchar_t **list,
+ int count,
+ XICCEncodingStyle style,
+ XTextProperty *text_prop)
{
XLCd lcd = _fallcCurrentLC();
}
void
-falwcFreeStringList(list)
- wchar_t **list;
+falwcFreeStringList(wchar_t **list)
{
XLCd lcd = _fallcCurrentLC();
}
char *
-falDefaultString()
+falDefaultString(void)
{
XLCd lcd = _fallcCurrentLC();
}
void
-_fallcCopyFromArg(src, dst, size)
- char *src;
- register char *dst;
- register int size;
+_fallcCopyFromArg(char *src, char *dst, int size)
{
if (size == sizeof(long))
*((long *) dst) = (long) src;
}
void
-_fallcCopyToArg(src, dst, size)
- register char *src;
- register char **dst;
- register int size;
+_fallcCopyToArg(char *src, char **dst, int size)
{
if (size == sizeof(long))
*((long *) *dst) = *((long *) src);
}
void
-_fallcCountVaList(var, count_ret)
- va_list var;
- int *count_ret;
+_fallcCountVaList(va_list var, int *count_ret)
{
- register int count;
+ int count;
for (count = 0; va_arg(var, char *); count++)
va_arg(var, XPointer);
}
void
-_fallcVaToArgList(var, count, args_ret)
- va_list var;
- register int count;
- XlcArgList *args_ret;
+_fallcVaToArgList(va_list var, int count, XlcArgList *args_ret)
{
- register XlcArgList args;
+ XlcArgList args;
*args_ret = args = (XlcArgList) Xmalloc(sizeof(XlcArg) * count);
if (args == (XlcArgList) NULL)
}
void
-_fallcCompileResourceList(resources, num_resources)
- register XlcResourceList resources;
- register int num_resources;
+_fallcCompileResourceList(XlcResourceList resources, int num_resources)
{
for ( ; num_resources-- > 0; resources++)
resources->xrm_name = falrmPermStringToQuark(resources->name);
}
char *
-_fallcGetValues(base, resources, num_resources, args, num_args, mask)
- XPointer base;
- XlcResourceList resources;
- int num_resources;
- XlcArgList args;
- int num_args;
- unsigned long mask;
+_fallcGetValues(
+ XPointer base,
+ XlcResourceList resources,
+ int num_resources,
+ XlcArgList args,
+ int num_args,
+ unsigned long mask)
{
XlcResourceList res;
XrmQuark xrm_name;
}
char *
-_fallcSetValues(base, resources, num_resources, args, num_args, mask)
- XPointer base;
- XlcResourceList resources;
- int num_resources;
- XlcArgList args;
- int num_args;
- unsigned long mask;
+_fallcSetValues(
+ XPointer base,
+ XlcResourceList resources,
+ int num_resources,
+ XlcArgList args,
+ int num_args,
+ unsigned long mask)
{
XlcResourceList res;
XrmQuark xrm_name;
#include "_falvarargs.h"
typedef Bool (*XFilterEventProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
);
typedef struct _XIMFilter {
*/
typedef void (*XmbInitProc)(
-#if NeedFunctionPrototypes
XPointer /* state */
-#endif
);
typedef char (*XmbCharProc)(
-#if NeedFunctionPrototypes
XPointer /* state */,
char* /* str */,
int* /* lenp */
-#endif
);
typedef void (*XmbFinishProc)(
-#if NeedFunctionPrototypes
XPointer /* state */
-#endif
);
typedef char* (*XlcNameProc)(
-#if NeedFunctionPrototypes
XPointer /* state */
-#endif
);
typedef void (*XrmDestroyProc)(
-#if NeedFunctionPrototypes
XPointer /* state */
-#endif
);
typedef struct {
*/
typedef void (*XCloseLCProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
typedef char* (*XlcMapModifiersProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* user_mods */,
char* /* prog_mods */
-#endif
);
typedef XOM (*XOpenOMProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
- _Xconst char* /* res_name */,
- _Xconst char* /* res_class */
-#endif
+ const char* /* res_name */,
+ const char* /* res_class */
);
typedef XIM (*XOpenIMProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
char* /* res_name */,
char* /* res_class */
-#endif
);
typedef Bool (*XRegisterIMInstantiateCBProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
char* /* res_class */,
XIMProc /* callback */,
XPointer* /* client_data */
-#endif
);
typedef Bool (*XUnregisterIMInstantiateCBProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XrmDatabase /* rdb */,
char* /* res_class */,
XIMProc /* callback */,
XPointer* /* client_data */
-#endif
);
typedef XrmMethods (*XrmInitParseInfoProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
XPointer* /* state */
-#endif
);
typedef int (*falmbTextPropertyToTextListProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XTextProperty* /* text_prop */,
char*** /* list_return */,
int* /* count_return */
-#endif
);
typedef int (*falwcTextPropertyToTextListProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
XTextProperty* /* text_prop */,
wchar_t*** /* list_return */,
int* /* count_return */
-#endif
);
typedef int (*falmbTextListToTextPropertyProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
char** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop_return */
-#endif
);
typedef int (*falwcTextListToTextPropertyProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* display */,
wchar_t** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop_return */
-#endif
);
typedef void (*falwcFreeStringListProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
wchar_t** /* list */
-#endif
);
typedef char* (*falDefaultStringProc)(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
typedef struct {
#define XlcNumber(arr) (sizeof(arr) / sizeof(arr[0]))
typedef Status (*XCloseOMProc)(
-#if NeedFunctionPrototypes
XOM /* om */
-#endif
);
typedef char* (*XSetOMValuesProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef char* (*XGetOMValuesProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef XOC (*XCreateOCProc)(
-#if NeedFunctionPrototypes
XOM /* om */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef struct _XOMMethodsRec {
} XOMRec;
typedef void (*XDestroyOCProc)(
-#if NeedFunctionPrototypes
XOC /* oc */
-#endif
);
typedef char* (*XSetOCValuesProc)(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
typedef char* (*XGetOCValuesProc)(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcArgList /* args */,
int /* num_args */
-#endif
);
/*
*/
typedef int (*XmbTextEscapementProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst char* /* text */,
+ const char* /* text */,
int /* text_len */
-#endif
);
typedef int (*XmbTextExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst char* /* text */,
+ const char* /* text */,
int /* text_len */,
XRectangle* /* overall_ink_extents */,
XRectangle* /* overall_logical_extents */
-#endif
);
typedef Status (*XmbTextPerCharExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst char* /* text */,
+ const char* /* text */,
int /* text_len */,
XRectangle* /* ink_extents_buffer */,
XRectangle* /* logical_extents_buffer */,
int* /* num_chars */,
XRectangle* /* max_ink_extents */,
XRectangle* /* max_logical_extents */
-#endif
);
typedef int (*XmbDrawStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
GC /* gc */,
int /* x */,
int /* y */,
- _Xconst char* /* text */,
+ const char* /* text */,
int /* text_len */
-#endif
);
typedef void (*XmbDrawImageStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
GC /* gc */,
int /* x */,
int /* y */,
- _Xconst char* /* text */,
+ const char* /* text */,
int /* text_len */
-#endif
);
typedef int (*XwcTextEscapementProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
+ const wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef int (*XwcTextExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
+ const wchar_t* /* text */,
int /* text_len */,
XRectangle* /* overall_ink_extents */,
XRectangle* /* overall_logical_extents */
-#endif
);
typedef Status (*XwcTextPerCharExtentsProc)(
-#if NeedFunctionPrototypes
XFontSet /* font_set */,
- _Xconst wchar_t* /* text */,
+ const wchar_t* /* text */,
int /* text_len */,
XRectangle* /* ink_extents_buffer */,
XRectangle* /* logical_extents_buffer */,
int* /* num_chars */,
XRectangle* /* max_ink_extents */,
XRectangle* /* max_logical_extents */
-#endif
);
typedef int (*XwcDrawStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
GC /* gc */,
int /* x */,
int /* y */,
- _Xconst wchar_t* /* text */,
+ const wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef void (*XwcDrawImageStringProc)(
-#if NeedFunctionPrototypes
Display* /* display */,
Drawable /* drawable */,
XFontSet /* font_set */,
GC /* gc */,
int /* x */,
int /* y */,
- _Xconst wchar_t* /* text */,
+ const wchar_t* /* text */,
int /* text_len */
-#endif
);
typedef struct {
} XOCRec;
-/* current Ultrix compiler gets horribly confused */
-#if defined(FUNCPROTO) && defined(ultrix)
-#undef NeedFunctionPrototypes
-#endif
-
-
/*
* X Input Managers are an instantiable object, so we define it, the
* object itself, a method list and data.
*/
typedef struct {
Status (*close)(
-#if NeedFunctionPrototypes
XIM
-#endif
);
char* (*set_values)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
char* (*get_values)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
XIC (*create_ic)(
-#if NeedFunctionPrototypes
XIM, XIMArg*
-#endif
);
int (*ctstombs)(
-#if NeedFunctionPrototypes
XIM, char*, int, char*, int, Status *
-#endif
);
int (*ctstowcs)(
-#if NeedFunctionPrototypes
XIM, char*, int, wchar_t*, int, Status *
-#endif
);
} XIMMethodsRec, *XIMMethods;
*/
typedef struct {
void (*destroy)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
void (*set_focus)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
void (*unset_focus)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
char* (*set_values)(
-#if NeedFunctionPrototypes
XIC, XIMArg*
-#endif
);
char* (*get_values)(
-#if NeedFunctionPrototypes
XIC, XIMArg*
-#endif
);
char* (*mb_reset)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
wchar_t* (*wc_reset)(
-#if NeedFunctionPrototypes
XIC
-#endif
);
int (*mb_lookup_string)(
-#if NeedFunctionPrototypes
XIC, XKeyEvent*, char*, int, KeySym*, Status*
-#endif
);
int (*wc_lookup_string)(
-#if NeedFunctionPrototypes
XIC, XKeyEvent*, wchar_t*, int, KeySym*, Status*
-#endif
);
} XICMethodsRec, *XICMethods;
XICCoreRec core; /* data of this IC */
} XICRec;
-/* current Ultrix compiler gets horribly confused */
-#if !defined(NeedFunctionPrototypes) && defined(FUNCPROTO)
-#define NeedFunctionPrototypes 1
-#endif
-
typedef XLCd (*XLCdLoadProc)(
-#if NeedFunctionPrototypes
char*
-#endif
);
_XFUNCPROTOBEGIN
extern XLCd _falOpenLC(
-#if NeedFunctionPrototypes
char* /* name */
-#endif
);
extern void _falCloseLC(
-#if NeedFunctionPrototypes
XLCd /* lcd */
-#endif
);
extern XLCd _fallcCurrentLC(
-#if NeedFunctionPrototypes
void
-#endif
);
extern Bool _fallcValidModSyntax(
-#if NeedFunctionPrototypes
char* /* mods */,
char** /* valid */
-#endif
);
extern char *_fallcDefaultMapModifiers(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
char* /* user_mods */,
char* /* prog_mods */
-#endif
);
extern void _XIMCompileResourceList(
-#if NeedFunctionPrototypes
XIMResourceList /* res */,
unsigned int /* num_res */
-#endif
);
extern void _XCopyToArg(
-#if NeedFunctionPrototypes
XPointer /* src */,
XPointer* /* dst */,
unsigned int /* size */
-#endif
);
extern char ** _falParseBaseFontNameList(
-#if NeedFunctionPrototypes
char* /* str */,
int* /* num */
-#endif
);
extern XrmMethods _falrmInitParseInfo(
-#if NeedFunctionPrototypes
XPointer* /* statep */
-#endif
);
extern void _XRegisterFilterByMask(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
unsigned long /* event_mask */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _XRegisterFilterByType(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
int /* start_type */,
int /* end_type */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _XUnregisterFilter(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* window */,
Bool (*)(
-#if NeedNestedPrototypes
Display* /* display */,
Window /* window */,
XEvent* /* event */,
XPointer /* client_data */
-#endif
) /* filter */,
XPointer /* client_data */
-#endif
);
extern void _fallcCountVaList(
-#if NeedFunctionPrototypes
va_list /* var */,
int* /* count_return */
-#endif
);
extern void _fallcVaToArgList(
-#if NeedFunctionPrototypes
va_list /* var */,
int /* count */,
XlcArgList* /* args_return */
-#endif
);
extern void _fallcCompileResourceList(
-#if NeedFunctionPrototypes
XlcResourceList /* resources */,
int /* num_resources */
-#endif
);
extern char *_fallcGetValues(
-#if NeedFunctionPrototypes
XPointer /* base */,
XlcResourceList /* resources */,
int /* num_resources */,
XlcArgList /* args */,
int /* num_args */,
unsigned long /* mask */
-#endif
);
extern char *_fallcSetValues(
-#if NeedFunctionPrototypes
XPointer /* base */,
XlcResourceList /* resources */,
int /* num_resources */,
XlcArgList /* args */,
int /* num_args */,
unsigned long /* mask */
-#endif
);
extern Bool _fallcAddLoader(
-#if NeedFunctionPrototypes
XLCdLoadProc /* proc */,
XlcPosition /* position */
-#endif
);
extern void _fallcRemoveLoader(
-#if NeedFunctionPrototypes
XLCdLoadProc /* proc */
-#endif
);
_XFUNCPROTOEND
#define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n)
/*
- * define the following if you want the Data macro to be a procedure instead
+ * define DataRoutineIsProcedure if you want the Data macro to be a procedure
+ * instead
*/
-#ifdef CRAY
-#define DataRoutineIsProcedure
-#endif /* CRAY */
#ifndef _XEVENT_
/*
#define NEED_REPLIES
#endif
-#if NeedFunctionPrototypes /* prototypes require event type definitions */
#define NEED_EVENTS
#define NEED_REPLIES
-#endif
#include <X11/Xproto.h>
#include <errno.h>
#define _XBCOPYFUNC _Xbcopy
#include <X11/Xfuncs.h>
#include <X11/Xosdefs.h>
-/* Utek leaves kernel macros around in include files (bleah) */
-#ifdef dirty
-#undef dirty
-#endif
-
#ifndef X_NOT_STDC_ENV
#include <stdlib.h>
#include <string.h>
/* in XlibInt.c */
extern void (*_XCreateMutex_fn)(
-#if NeedFunctionPrototypes
LockInfoPtr /* lock */
-#endif
);
extern void (*_XFreeMutex_fn)(
-#if NeedFunctionPrototypes
LockInfoPtr /* lock */
-#endif
);
extern void (*_XLockMutex_fn)(
-#if NeedFunctionPrototypes
LockInfoPtr /* lock */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char * /* file */
, int /* line */
#endif
-#endif
);
extern void (*_XUnlockMutex_fn)(
-#if NeedFunctionPrototypes
LockInfoPtr /* lock */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char * /* file */
, int /* line */
#endif
-#endif
);
extern LockInfoPtr _Xglobal_lock;
#endif
-#ifndef NULL
-#define NULL 0
-#endif
#define LOCKED 1
#define UNLOCKED 0
* X Protocol packetizing macros.
*/
-/* Need to start requests on 64 bit word boundaries
- * on a CRAY computer so add a NoOp (127) if needed.
- * A character pointer on a CRAY computer will be non-zero
- * after shifting right 61 bits of it is not pointing to
- * a word boundary.
- */
-#ifdef WORD64
-#define WORD64ALIGN if ((long)dpy->bufptr >> 61) {\
- dpy->last_req = dpy->bufptr;\
- *(dpy->bufptr) = X_NoOperation;\
- *(dpy->bufptr+1) = 0;\
- *(dpy->bufptr+2) = 0;\
- *(dpy->bufptr+3) = 1;\
- dpy->request++;\
- dpy->bufptr += 4;\
- }
-#else /* else does not require alignment on 64-bit boundaries */
#define WORD64ALIGN
-#endif /* WORD64 */
-
/*
* GetReq - Get the next available X request packet in the buffer and
dpy->request++
#endif
-#ifdef WORD64
-#define MakeBigReq(req,n) \
- { \
- char _BRdat[4]; \
- unsigned long _BRlen = req->length - 1; \
- req->length = 0; \
- memcpy(_BRdat, ((char *)req) + (_BRlen << 2), 4); \
- memmove(((char *)req) + 8, ((char *)req) + 4, _BRlen << 2); \
- memcpy(((char *)req) + 4, _BRdat, 4); \
- Data32(dpy, (long *)&_BRdat, 4); \
- }
-#else
#define MakeBigReq(req,n) \
{ \
long _BRdat; \
((unsigned long *)req)[1] = _BRlen + n + 2; \
Data32(dpy, &_BRdat, 4); \
}
-#endif
#define SetReqLen(req,n,badlen) \
if ((req->length + n) > (unsigned)65535) { \
ptr = (type) dpy->bufptr; \
dpy->bufptr += (n);
-#ifdef WORD64
-#define Data16(dpy, data, len) _XData16(dpy, (short *)data, len)
-#define Data32(dpy, data, len) _XData32(dpy, (long *)data, len)
-#else
#define Data16(dpy, data, len) Data((dpy), (char *)(data), (len))
#define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len))
#define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len))
#define Data32(dpy, data, len) Data((dpy), (char *)(data), (len))
#define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len))
#endif
-#endif /* not WORD64 */
#define PackData16(dpy,data,len) Data16 (dpy, data, len)
#define PackData32(dpy,data,len) Data32 (dpy, data, len)
extern void Data();
#endif
extern int _XError(
-#if NeedFunctionPrototypes
Display* /* dpy */,
xError* /* rep */
-#endif
);
extern int _XIOError(
-#if NeedFunctionPrototypes
Display* /* dpy */
-#endif
);
extern int (*_XIOErrorFunction)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
extern int (*_XErrorFunction)(
-#if NeedNestedPrototypes
Display* /* dpy */,
XErrorEvent* /* error_event */
-#endif
);
extern void _XEatData(
-#if NeedFunctionPrototypes
Display* /* dpy */,
unsigned long /* n */
-#endif
);
extern char *_XAllocScratch(
-#if NeedFunctionPrototypes
Display* /* dpy */,
unsigned long /* nbytes */
-#endif
);
extern char *_XAllocTemp(
-#if NeedFunctionPrototypes
Display* /* dpy */,
unsigned long /* nbytes */
-#endif
);
extern void _XFreeTemp(
-#if NeedFunctionPrototypes
Display* /* dpy */,
char* /* buf */,
unsigned long /* nbytes */
-#endif
);
extern Visual *_XVIDtoVisual(
-#if NeedFunctionPrototypes
Display* /* dpy */,
VisualID /* id */
-#endif
);
extern unsigned long _XSetLastRequestRead(
-#if NeedFunctionPrototypes
Display* /* dpy */,
xGenericReply* /* rep */
-#endif
);
extern int _XGetHostname(
-#if NeedFunctionPrototypes
char* /* buf */,
int /* maxlen */
-#endif
);
extern Screen *_XScreenOfWindow(
-#if NeedFunctionPrototypes
Display* /* dpy */,
Window /* w */
-#endif
);
extern Bool _XAsyncErrorHandler(
-#if NeedFunctionPrototypes
Display* /* dpy */,
xReply* /* rep */,
char* /* buf */,
int /* len */,
XPointer /* data */
-#endif
);
extern char *_XGetAsyncReply(
-#if NeedFunctionPrototypes
Display* /* dpy */,
char* /* replbuf */,
xReply* /* rep */,
int /* len */,
int /* extra */,
Bool /* discard */
-#endif
);
extern _XFlush(
-#if NeedFunctionPrototypes
Display* /* dpy */
-#endif
);
extern int _XEventsQueued(
-#if NeedFunctionPrototypes
Display* /* dpy */,
int /* mode */
-#endif
);
extern _XReadEvents(
-#if NeedFunctionPrototypes
Display* /* dpy */
-#endif
);
extern _XRead(
-#if NeedFunctionPrototypes
Display* /* dpy */,
char* /* data */,
long /* size */
-#endif
);
extern _XReadPad(
-#if NeedFunctionPrototypes
Display* /* dpy */,
char* /* data */,
long /* size */
-#endif
);
extern _XSend(
-#if NeedFunctionPrototypes
Display* /* dpy */,
- _Xconst char* /* data */,
+ const char* /* data */,
long /* size */
-#endif
);
extern Status _XReply(
-#if NeedFunctionPrototypes
Display* /* dpy */,
xReply* /* rep */,
int /* extra */,
Bool /* discard */
-#endif
);
extern _XEnq(
-#if NeedFunctionPrototypes
Display* /* dpy */,
xEvent* /* event */
-#endif
);
extern _XDeq(
-#if NeedFunctionPrototypes
Display* /* dpy */,
_XQEvent* /* prev */,
_XQEvent* /* qelt */
-#endif
);
extern int (*XESetCreateGC(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, GC, XExtCodes*
-#endif
);
extern int (*XESetCopyGC(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, GC, XExtCodes*
-#endif
);
extern int (*XESetFlushGC(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, GC, XExtCodes*
-#endif
);
extern int (*XESetFreeGC(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
GC /* gc */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, GC, XExtCodes*
-#endif
);
extern int (*XESetCreateFont(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XFontStruct*, XExtCodes*
-#endif
);
extern int (*XESetFreeFont(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XFontStruct* /* fs */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XFontStruct*, XExtCodes*
-#endif
);
extern int (*XESetCloseDisplay(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XExtCodes* /* codes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XExtCodes*
-#endif
);
extern int (*XESetError(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
int (*) (
-#if NeedNestedPrototypes
Display* /* display */,
xError* /* err */,
XExtCodes* /* codes */,
int* /* ret_code */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, xError*, XExtCodes*, int*
-#endif
);
extern char* (*XESetErrorString(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
char* (*) (
-#if NeedNestedPrototypes
Display* /* display */,
int /* code */,
XExtCodes* /* codes */,
char* /* buffer */,
int /* nbytes */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, int, XExtCodes*, char*, int
-#endif
);
extern void (*XESetPrintErrorValues (
-#if NeedFunctionPrototypes
Display* /* display */,
int /* extension */,
void (*)(
-#if NeedNestedPrototypes
Display* /* display */,
XErrorEvent* /* ev */,
void* /* fp */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XErrorEvent*, void*
-#endif
);
extern Bool (*XESetWireToEvent(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* event_number */,
Bool (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XEvent*, xEvent*
-#endif
);
extern Status (*XESetEventToWire(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* event_number */,
Status (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XEvent* /* re */,
xEvent* /* event */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XEvent*, xEvent*
-#endif
);
extern Bool (*XESetWireToError(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* error_number */,
Bool (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XErrorEvent* /* he */,
xError* /* we */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XErrorEvent*, xError*
-#endif
);
extern void (*XESetBeforeFlush(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* error_number */,
void (*) (
-#if NeedNestedPrototypes
Display* /* display */,
XExtCodes* /* codes */,
char* /* data */,
long /* len */
-#endif
) /* proc */
-#endif
))(
-#if NeedNestedPrototypes
Display*, XExtCodes*, char*, long
-#endif
);
/* internal connections for IMs */
typedef void (*_XInternalConnectionProc)(
-#if NeedFunctionPrototypes
Display* /* dpy */,
int /* fd */,
XPointer /* call_data */
-#endif
);
extern Status _XRegisterInternalConnection(
-#if NeedFunctionPrototypes
Display* /* dpy */,
int /* fd */,
_XInternalConnectionProc /* callback */,
XPointer /* call_data */
-#endif
);
extern void _XUnregisterInternalConnection(
-#if NeedFunctionPrototypes
Display* /* dpy */,
int /* fd */
-#endif
);
/* Display structure has pointers to these */
};
extern int XTextHeight(
-#if NeedFunctionPrototypes
XFontStruct* /* font_struct */,
- _Xconst char* /* string */,
+ const char* /* string */,
int /* count */
-#endif
);
extern int XTextHeight16(
-#if NeedFunctionPrototypes
XFontStruct* /* font_struct */,
- _Xconst XChar2b* /* string */,
+ const XChar2b* /* string */,
int /* count */
-#endif
);
_XFUNCPROTOEND
};
extern xthread_t (*_Xthread_self_fn)( /* in XlibInt.c */
-#if NeedFunctionPrototypes
void
-#endif
);
/* Display->lock is a pointer to one of these */
struct _XCVList *free_cvls;
/* used only in XlibInt.c */
void (*pop_reader)(
-#if NeedNestedPrototypes
Display* /* dpy */,
struct _XCVList** /* list */,
struct _XCVList*** /* tail */
-#endif
);
struct _XCVList *(*push_reader)(
-#if NeedNestedPrototypes
Display * /* dpy */,
struct _XCVList*** /* tail */
-#endif
);
void (*condition_wait)(
-#if NeedNestedPrototypes
xcondition_t /* cv */,
xmutex_t /* mutex */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
-#endif
#endif
);
void (*internal_lock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */,
Bool /* wskip */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
-#endif
#endif
);
/* used in XlibInt.c and locking.c */
void (*condition_signal)(
-#if NeedNestedPrototypes
xcondition_t /* cv */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
-#endif
#endif
);
void (*condition_broadcast)(
-#if NeedNestedPrototypes
xcondition_t /* cv */
#if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE)
, char* /* file */,
int /* line */
-#endif
#endif
);
/* used in XlibInt.c and XLockDis.c */
void (*lock_wait)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
void (*user_lock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
void (*user_unlock_display)(
-#if NeedNestedPrototypes
Display* /* dpy */
-#endif
);
struct _XCVList *(*create_cvl)(
-#if NeedNestedPrototypes
Display * /* dpy */
-#endif
);
};
/* For VW/UDC start */
static FontData
-init_fontdata(font_data, font_data_count)
- FontData font_data;
- int font_data_count;
+init_fontdata(FontData font_data, int font_data_count)
{
FontData fd;
int i;
}
static VRotate
-init_vrotate(font_data, font_data_count, type, code_range, code_range_num)
- FontData font_data;
- int font_data_count;
- int type;
- CodeRange code_range;
- int code_range_num;
+init_vrotate(
+ FontData font_data,
+ int font_data_count,
+ int type,
+ CodeRange code_range,
+ int code_range_num)
{
VRotate vrotate;
int i;
}
static Bool
-init_fontset(oc)
- XOC oc;
+init_fontset(XOC oc)
{
XOCGenericPart *gen;
FontSet font_set;
OMData data;
int count;
+ int err = 0;
count = XOM_GENERIC(oc->core.om)->data_num;
data = XOM_GENERIC(oc->core.om)->data;
font_set->charset_list = data->charset_list;
if((font_set->font_data = init_fontdata(data->font_data,
- data->font_data_count)) == NULL)
- goto err;
+ data->font_data_count)) == NULL){
+ err += 1;
+ break;
+ }
font_set->font_data_count = data->font_data_count;
if((font_set->substitute = init_fontdata(data->substitute,
- data->substitute_num)) == NULL)
- goto err;
+ data->substitute_num)) == NULL){
+ err += 1;
+ break;
+ }
font_set->substitute_num = data->substitute_num;
if((font_set->vmap = init_fontdata(data->vmap,
- data->vmap_num)) == NULL)
- goto err;
+ data->vmap_num)) == NULL){
+ err += 1;
+ break;
+ }
font_set->vmap_num = data->vmap_num;
if(data->vrotate_type != VROTATE_NONE) {
data->font_data_count,
data->vrotate_type,
data->vrotate,
- data->vrotate_num)) == NULL)
- goto err;
+ data->vrotate_num)) == NULL){
+ err += 1;
+ break;
+ }
font_set->vrotate_num = data->font_data_count;
}
}
- return True;
-err:
- if(font_set->font_data)
- Xfree(font_set->font_data);
- if(font_set->substitute)
- Xfree(font_set->substitute);
- if(font_set->vmap)
- Xfree(font_set->vmap);
- if(font_set->vrotate)
- Xfree(font_set->vrotate);
- if(font_set)
- Xfree(font_set);
- gen->font_set = (FontSet) NULL;
- gen->font_set_num = 0;
- return False;
+ if (err == 1){
+ if(font_set->font_data)
+ Xfree(font_set->font_data);
+ if(font_set->substitute)
+ Xfree(font_set->substitute);
+ if(font_set->vmap)
+ Xfree(font_set->vmap);
+ if(font_set->vrotate)
+ Xfree(font_set->vrotate);
+ if(font_set)
+ Xfree(font_set);
+ gen->font_set = (FontSet) NULL;
+ gen->font_set_num = 0;
+ return False;
+ } else {
+ return True;
+ }
}
/* For VW/UDC end */
static char *
-get_prop_name(dpy, fs)
- Display *dpy;
- XFontStruct *fs;
+get_prop_name(Display *dpy, XFontStruct *fs)
{
unsigned long fp;
}
static FontData
-check_charset(font_set, font_name)
- FontSet font_set;
- char *font_name;
+check_charset(FontSet font_set, char *font_name)
{
FontData font_data;
char *last;
}
static int
-check_fontname(oc, name, found_num)
- XOC oc;
- char *name;
- int found_num;
+check_fontname(XOC oc, char *name, int found_num)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
/* For VW/UDC start */
static Bool
-load_fontdata(oc, font_data, font_data_num)
- XOC oc;
- FontData font_data;
- int font_data_num;
+load_fontdata(XOC oc, FontData font_data, int font_data_num)
{
Display *dpy = oc->core.om->core.display;
FontData fd = font_data;
}
static Bool
-load_font(oc)
- XOC oc;
+load_font(XOC oc)
{
int i;
XOCGenericPart *gen = XOC_GENERIC(oc);
/* For VW/UDC end */
static Bool
-load_font_info(oc)
- XOC oc;
+load_font_info(XOC oc)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
/* For Vertical Writing start */
static void
-check_fontset_extents(overall, logical_ascent, logical_descent, font)
- XCharStruct *overall;
- int *logical_ascent, *logical_descent;
- XFontStruct *font;
+check_fontset_extents(
+ XCharStruct *overall,
+ int *logical_ascent,
+ int *logical_descent,
+ XFontStruct *font)
{
overall->lbearing = min(overall->lbearing, font->min_bounds.lbearing);
overall->rbearing = max(overall->rbearing, font->max_bounds.rbearing);
/* For Vertical Writing end */
static void
-set_fontset_extents(oc)
- XOC oc;
+set_fontset_extents(XOC oc)
{
XRectangle *ink = &oc->core.font_set_extents.max_ink_extent;
XRectangle *logical = &oc->core.font_set_extents.max_logical_extent;
}
static Bool
-init_core_part(oc)
- XOC oc;
+init_core_part(XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
return False;
font_name_list = (char **) Xmalloc(sizeof(char *) * count);
- if (font_name_list == NULL)
- goto err;
+ if (font_name_list == NULL){
+ if (font_name_list)
+ Xfree(font_name_list);
+ Xfree(font_struct_list);
+ return False;
+ }
font_name_buf = (char *) Xmalloc(length);
- if (font_name_buf == NULL)
- goto err;
+ if (font_name_buf == NULL){
+ if (font_name_list)
+ Xfree(font_name_list);
+ Xfree(font_struct_list);
+ return False;
+ }
oc->core.font_info.num_font = count;
oc->core.font_info.font_name_list = font_name_list;
set_fontset_extents(oc);
return True;
-
-err:
- if (font_name_list)
- Xfree(font_name_list);
- Xfree(font_struct_list);
-
- return False;
}
static char *
-get_font_name(oc, pattern)
- XOC oc;
- char *pattern;
+get_font_name(XOC oc, char *pattern)
{
char **list, *name;
int count = 0;
/* For VW/UDC start*/
static char
-*get_rotate_fontname(font_name)
- char *font_name;
+*get_rotate_fontname(char *font_name)
{
char *pattern = NULL, *ptr = NULL;
char *fields[CHARSET_ENCODING_FIELD];
}
static Bool
-is_match_charset(font_data, font_name)
- FontData font_data;
- char *font_name;
+is_match_charset(FontData font_data, char *font_name)
{
char *last;
int length, name_len;
}
static int
-parse_all_name(oc, font_data, pattern)
- XOC oc;
- FontData font_data;
- char *pattern;
+parse_all_name(XOC oc, FontData font_data, char *pattern)
{
if(is_match_charset(font_data, pattern) != True)
}
static int
-parse_omit_name(oc, font_data, pattern)
- XOC oc;
- FontData font_data;
- char *pattern;
+parse_omit_name(XOC oc, FontData font_data, char *pattern)
{
char *font_name = (char *) NULL;
char *last = (char *) NULL;
typedef enum{C_PRIMARY, C_SUBSTITUTE, C_VMAP, C_VROTATE } ClassType;
static int
-parse_fontdata(oc, font_data, font_data_count, name_list, name_list_count,
- class)
- XOC oc;
- FontData font_data;
- int font_data_count;
- char **name_list;
- int name_list_count;
- ClassType class;
+parse_fontdata(
+ XOC oc,
+ FontData font_data,
+ int font_data_count,
+ char **name_list,
+ int name_list_count,
+ ClassType class)
{
char **cur_name_list = name_list;
char *font_name = (char *) NULL;
static int
-parse_vw(oc, font_set, name_list, count)
- XOC oc;
- FontSet font_set;
- char **name_list;
- int count;
+parse_vw(XOC oc, FontSet font_set, char **name_list, int count)
{
FontData vmap = font_set->vmap;
VRotate vrotate = font_set->vrotate;
}
static int
-parse_fontname(oc)
- XOC oc;
+parse_fontname(XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
font_set->font_data_count,
name_list, count, C_PRIMARY);
if(ret == -1) {
- goto err;
+ falFreeStringList(name_list);
+ return -1;
} else if(ret == True) {
font_set->font_name = (char *)Xmalloc
(strlen(font_set->font_data->xlfd_name) + 1);
- if(font_set->font_name == (char *) NULL)
- goto err;
+ if(font_set->font_name == (char *) NULL){
+ falFreeStringList(name_list);
+ return -1;
+ }
strcpy(font_set->font_name, font_set->font_data->xlfd_name);
font_set->side = font_set->font_data->side;
- if(parse_vw(oc, font_set, name_list, count) == -1)
- goto err;
+ if(parse_vw(oc, font_set, name_list, count) == -1){
+ falFreeStringList(name_list);
+ return -1;
+ }
found_num++;
/* The substitute font is serched, when the primary fonts */
font_set->substitute_num,
name_list, count, C_SUBSTITUTE);
if(ret == -1) {
- goto err;
+ falFreeStringList(name_list);
+ return -1;
} else if(ret == True) {
for(i=0;i<font_set->substitute_num;i++){
if(font_set->substitute[i].xlfd_name != NULL){
}
font_set->font_name = (char *)Xmalloc
(strlen(font_set->substitute[i].xlfd_name) + 1);
- if(font_set->font_name == (char *) NULL)
- goto err;
+ if(font_set->font_name == (char *) NULL){
+ falFreeStringList(name_list);
+ return -1;
+ }
strcpy(font_set->font_name,font_set->substitute[i].xlfd_name);
font_set->side = font_set->substitute[i].side;
- if(parse_vw(oc, font_set, name_list, count) == -1)
- goto err;
+ if(parse_vw(oc, font_set, name_list, count) == -1){
+ falFreeStringList(name_list);
+ return -1;
+ }
found_num++;
}
}
font_set->substitute_num,
name_list, count, C_SUBSTITUTE);
if(ret == -1) {
- goto err;
+ falFreeStringList(name_list);
+ return -1;
} else if(ret == True) {
for(i=0;i<font_set->substitute_num;i++){
if(font_set->substitute[i].xlfd_name != NULL){
}
font_set->font_name = (char *)Xmalloc
(strlen(font_set->substitute[i].xlfd_name) + 1);
- if(font_set->font_name == (char *) NULL)
- goto err;
+ if(font_set->font_name == (char *) NULL){
+ falFreeStringList(name_list);
+ return -1;
+ }
+
strcpy(font_set->font_name,font_set->substitute[i].xlfd_name);
font_set->side = font_set->substitute[i].side;
- if(parse_vw(oc, font_set, name_list, count) == -1)
- goto err;
+ if(parse_vw(oc, font_set, name_list, count) == -1){
+ falFreeStringList(name_list);
+ return -1;
+ }
found_num++;
}
}
base_name = (char *) Xmalloc(strlen(oc->core.base_name_list) + 1);
- if (base_name == NULL)
- goto err;
+ if (base_name == NULL){
+ falFreeStringList(name_list);
+ return -1;
+ }
strcpy(base_name, oc->core.base_name_list);
oc->core.base_name_list = base_name;
falFreeStringList(name_list);
return found_num;
-
-err:
- falFreeStringList(name_list);
-
- return -1;
}
/* For VW/UDC end*/
static Bool
-set_missing_list(oc)
- XOC oc;
+set_missing_list(XOC oc)
{
XOCGenericPart *gen = XOC_GENERIC(oc);
FontSet font_set;
}
static Bool
-create_fontset(oc)
- XOC oc;
+create_fontset(XOC oc)
{
XOMGenericPart *gen = XOM_GENERIC(oc->core.om);
int found_num;
/* For VW/UDC start */
static void
-free_fontdataOC(dpy,font_data, font_data_count)
- Display *dpy;
- FontData font_data;
- int font_data_count;
+free_fontdataOC(Display *dpy, FontData font_data, int font_data_count)
{
for( ; font_data_count-- ; font_data++) {
if(font_data->xlfd_name){
}
static void
-destroy_fontdata(gen,dpy)
- XOCGenericPart *gen ;
- Display *dpy ;
+destroy_fontdata(XOCGenericPart *gen, Display *dpy)
{
FontSet font_set = (FontSet) NULL;
int font_set_num = 0;
/* For VW/UDC end */
static void
-destroy_oc(oc)
- XOC oc;
+destroy_oc(XOC oc)
{
Display *dpy = oc->core.om->core.display;
XOCGenericPart *gen = XOC_GENERIC(oc);
if (oc->core.missing_list.charset_list)
falFreeStringList(oc->core.missing_list.charset_list);
-#ifdef notdef
- if (oc->core.res_name)
- Xfree(oc->core.res_name);
- if (oc->core.res_class)
- Xfree(oc->core.res_class);
-#endif
-
Xfree(oc);
}
static char *
-set_oc_values(oc, args, num_args)
- XOC oc;
- XlcArgList args;
- int num_args;
+set_oc_values(XOC oc, XlcArgList args, int num_args)
{
if (oc->core.resources == NULL)
return NULL;
}
static char *
-get_oc_values(oc, args, num_args)
- XOC oc;
- XlcArgList args;
- int num_args;
+get_oc_values(XOC oc, XlcArgList args, int num_args)
{
if (oc->core.resources == NULL)
return NULL;
};
static XOC
-create_oc(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+create_oc(XOM om, XlcArgList args, int num_args)
{
XOC oc;
XOMGenericPart *gen = XOM_GENERIC(om);
_fallcCompileResourceList(oc_resources, XlcNumber(oc_resources));
if (_fallcSetValues((XPointer) oc, oc_resources, XlcNumber(oc_resources),
- args, num_args, XlcCreateMask | XlcDefaultMask))
- goto err;
-
- if (oc->core.base_name_list == NULL)
- goto err;
-
+ args, num_args, XlcCreateMask | XlcDefaultMask)){
+ destroy_oc(oc);
+ return (XOC) NULL;
+ }
+ if (oc->core.base_name_list == NULL){
+ destroy_oc(oc);
+ return (XOC) NULL;
+ }
oc->core.resources = oc_resources;
oc->core.num_resources = XlcNumber(oc_resources);
- if (create_fontset(oc) == False)
- goto err;
-
+ if (create_fontset(oc) == False){
+ destroy_oc(oc);
+ return (XOC) NULL;
+ }
oc->methods = &oc_generic_methods;
if (gen->object_name) {
}
return oc;
-
-err:
- destroy_oc(oc);
-
- return (XOC) NULL;
}
static void
-free_fontdataOM(font_data, font_data_count)
- FontData font_data;
- int font_data_count;
+free_fontdataOM(FontData font_data, int font_data_count)
{
for( ; font_data_count-- ; font_data++) {
if(font_data->name){
}
static Status
-close_om(om)
- XOM om;
+close_om(XOM om)
{
XOMGenericPart *gen = XOM_GENERIC(om);
OMData data;
}
static char *
-set_om_values(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+set_om_values(XOM om, XlcArgList args, int num_args)
{
if (om->core.resources == NULL)
return NULL;
}
static char *
-get_om_values(om, args, num_args)
- XOM om;
- XlcArgList args;
- int num_args;
+get_om_values(XOM om, XlcArgList args, int num_args)
{
if (om->core.resources == NULL)
return NULL;
};
static XOM
-create_om(lcd, dpy, rdb, res_name, res_class)
- XLCd lcd;
- Display *dpy;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
+create_om(
+ XLCd lcd,
+ Display *dpy,
+ XrmDatabase rdb,
+ char *res_name,
+ char *res_class)
{
XOM om;
om->core.rdb = rdb;
if (res_name) {
om->core.res_name = (char *) Xmalloc(strlen(res_name) + 1);
- if (om->core.res_name == NULL)
- goto err;
+ if (om->core.res_name == NULL){
+ close_om(om);
+ return (XOM) NULL;
+ }
strcpy(om->core.res_name, res_name);
}
if (res_class) {
om->core.res_class = (char *) Xmalloc(strlen(res_class) + 1);
- if (om->core.res_class == NULL)
- goto err;
+ if (om->core.res_class == NULL){
+ close_om(om);
+ return (XOM) NULL;
+ }
strcpy(om->core.res_class, res_class);
}
om->core.num_resources = XlcNumber(om_resources);
return om;
-
-err:
- close_om(om);
-
- return (XOM) NULL;
}
static OMData
-add_data(om)
- XOM om;
+add_data(XOM om)
{
XOMGenericPart *gen = XOM_GENERIC(om);
OMData new;
/* For VW/UDC */
FontData
-falread_EncodingInfo(count,value)
-int count;
-char **value;
+falread_EncodingInfo(int count, char **value)
{
FontData font_data,ret;
char *buf, *bufptr,*scp;
return(ret);
}
-static CodeRange read_vrotate(count,value,type,vrotate_num)
-int count;
-char **value;
-int *type;
-int *vrotate_num;
+static CodeRange read_vrotate(
+int count,
+char **value,
+int *type,
+int *vrotate_num)
{
FontData font_data,ret;
char *buf, *bufptr,*scp;
}
static void
-read_vw(lcd,font_set,num)
-XLCd lcd;
-OMData font_set;
-int num;
+read_vw(XLCd lcd, OMData font_set, int num)
{
char **value, buf[BUFSIZ], *bufptr;
int count,i;
}
/* VW/UDC end */
static Bool
-init_om(om)
- XOM om;
+init_om(XOM om)
{
XLCd lcd = om->core.lcd;
XOMGenericPart *gen = XOM_GENERIC(om);
}
XOM
-#if NeedFunctionPrototypes
_falomGenericOpenOM(XLCd lcd, Display *dpy, XrmDatabase rdb,
- _Xconst char *res_name, _Xconst char *res_class)
-#else
-_falomGenericOpenOM(lcd, dpy, rdb, res_name, res_class)
- XLCd lcd;
- Display *dpy;
- XrmDatabase rdb;
- char *res_name;
- char *res_class;
-#endif
+ char *res_name, char *res_class)
{
XOM om;
if (om == NULL)
return (XOM) NULL;
- if (init_om(om) == False)
- goto err;
+ if (init_om(om) == False){
+ close_om(om);
+ return (XOM) NULL;
+ }
return om;
-
-err:
- close_om(om);
-
- return (XOM) NULL;
}
Bool
-_falInitOM(lcd)
- XLCd lcd;
+_falInitOM(XLCd lcd)
{
lcd->methods->open_om = _falomGenericOpenOM;
_XFUNCPROTOBEGIN
extern XOM _falomGenericOpenOM(
-#if NeedFunctionPrototypes
XLCd /* lcd */,
Display* /* dpy */,
XrmDatabase /* rdb */,
- _Xconst char* /* res_name */,
- _Xconst char* /* res_class */
-#endif
+ char* /* res_name */,
+ char* /* res_class */
);
extern XlcConv _XomInitConverter(
-#if NeedFunctionPrototypes
XOC /* oc */,
XOMTextType /* type */
-#endif
);
extern int _XomConvert(
-#if NeedFunctionPrototypes
XOC /* oc */,
XlcConv /* conv */,
XPointer* /* from */,
int* /* to_left */,
XPointer* /* args */,
int /* num_args */
-#endif
);
_XFUNCPROTOEND
#include "_falrmI.h"
#include <X11/Xos.h>
-#ifdef __STDC__
-#define Const const
-#else
-#define Const /**/
-#endif
-#if defined(__STDC__) && !defined(NORCONST)
-#define RConst const
-#else
-#define RConst /**/
-#endif
-
/*
These Xrm routines allow very fast lookup of resources in the resource
static XrmQuark XrmQString, XrmQANY;
typedef Bool (*DBEnumProc)(
-#if NeedNestedPrototypes /* this is Nested on purpose, to match Xlib.h */
+/* this is Nested on purpose, to match Xlib.h */
XrmDatabase* /* db */,
XrmBindingList /* bindings */,
XrmQuarkList /* quarks */,
XrmRepresentation* /* type */,
XrmValue* /* value */,
XPointer /* closure */
-#endif
);
typedef struct _VEntry {
#define is_special(bits) ((bits) & (ENDOF|BSLASH))
/* parsing types */
-static XrmBits Const xrmtypes[256] = {
+static XrmBits const xrmtypes[256] = {
EOS,0,0,0,0,0,0,0,
0,SPACE,EOL,0,0,0,0,0,
0,0,0,0,0,0,0,0,
/* The rest will be automatically initialized to zero. */
};
-void falrmInitialize()
+void falrmInitialize(void)
{
XrmQString = falrmPermStringToQuark("String");
XrmQANY = falrmPermStringToQuark("?");
return retval;
}
-void falrmSetDatabase(display, database)
- Display *display;
- XrmDatabase database;
+void falrmSetDatabase(Display *display, XrmDatabase database)
{
LockDisplay(display);
display->db = database;
UnlockDisplay(display);
}
-#if NeedFunctionPrototypes
-void falrmStringToQuarkList(
- register _Xconst char *name,
- register XrmQuarkList quarks) /* RETURN */
-#else
-void falrmStringToQuarkList(name, quarks)
- register char *name;
- register XrmQuarkList quarks; /* RETURN */
-#endif
+void falrmStringToQuarkList(const char *name, XrmQuarkList quarks)/*RETURN*/
{
- register XrmBits bits;
- register Signature sig = 0;
- register char ch, *tname;
- register int i = 0;
+ XrmBits bits;
+ Signature sig = 0;
+ char ch, *tname;
+ int i = 0;
if (tname = (char *)name) {
tname--;
*quarks = NULLQUARK;
}
-#if NeedFunctionPrototypes
void falrmStringToBindingQuarkList(
- register _Xconst char *name,
- register XrmBindingList bindings, /* RETURN */
- register XrmQuarkList quarks) /* RETURN */
-#else
-void falrmStringToBindingQuarkList(name, bindings, quarks)
- register char *name;
- register XrmBindingList bindings; /* RETURN */
- register XrmQuarkList quarks; /* RETURN */
-#endif
+ const char *name,
+ XrmBindingList bindings, /* RETURN */
+ XrmQuarkList quarks) /* RETURN */
{
- register XrmBits bits;
- register Signature sig = 0;
- register char ch, *tname;
- register XrmBinding binding;
- register int i = 0;
+ XrmBits bits;
+ Signature sig = 0;
+ char ch, *tname;
+ XrmBinding binding;
+ int i = 0;
if (tname = (char *)name) {
tname--;
#ifdef DEBUG
-static void PrintQuarkList(quarks, stream)
- XrmQuarkList quarks;
- FILE *stream;
+static void PrintQuarkList(XrmQuarkList quarks, FILE *stream)
{
Bool firstNameSeen;
#endif /* DEBUG */
/*ARGSUSED*/
-static void mbnoop(state)
- XPointer state;
+static void mbnoop(XPointer state)
{
}
/*ARGSUSED*/
-static char mbchar(state, str, lenp)
- XPointer state;
- char *str;
- int *lenp;
+static char mbchar(XPointer state, char *str, int *lenp)
{
*lenp = 1;
return *str;
}
/*ARGSUSED*/
-static char *lcname(state)
- XPointer state;
+static char *lcname(XPointer state)
{
return "C";
}
-static RConst XrmMethodsRec mb_methods = {
+static const XrmMethodsRec mb_methods = {
mbnoop,
mbchar,
mbnoop,
mbnoop
};
-static XrmDatabase NewDatabase()
+static XrmDatabase NewDatabase(void)
{
- register XrmDatabase db;
+ XrmDatabase db;
db = (XrmDatabase) Xmalloc(sizeof(XrmHashBucketRec));
if (db) {
}
/* move all values from ftable to ttable, and free ftable's buckets.
- * ttable is quaranteed empty to start with.
+ * ttable is guaranteed empty to start with.
*/
-static void MoveValues(ftable, ttable)
- LTable ftable;
- register LTable ttable;
+static void MoveValues(LTable ftable, LTable ttable)
{
- register VEntry fentry, nfentry;
- register VEntry *prev;
- register VEntry *bucket;
- register VEntry tentry;
- register int i;
+ VEntry fentry, nfentry;
+ VEntry *prev;
+ VEntry *bucket;
+ VEntry tentry;
+ int i;
for (i = ftable->table.mask, bucket = ftable->buckets; i >= 0; i--) {
for (fentry = *bucket++; fentry; fentry = nfentry) {
/* move all tables from ftable to ttable, and free ftable.
* ttable is quaranteed empty to start with.
*/
-static void MoveTables(ftable, ttable)
- NTable ftable;
- register NTable ttable;
+static void MoveTables(NTable ftable, NTable ttable)
{
- register NTable fentry, nfentry;
- register NTable *prev;
- register NTable *bucket;
- register NTable tentry;
- register int i;
+ NTable fentry, nfentry;
+ NTable *prev;
+ NTable *bucket;
+ NTable tentry;
+ int i;
for (i = ftable->mask, bucket = NodeBuckets(ftable); i >= 0; i--) {
for (fentry = *bucket++; fentry; fentry = nfentry) {
}
/* grow the table, based on current number of entries */
-static void GrowTable(prev)
- NTable *prev;
+static void GrowTable(NTable *prev)
{
- register NTable table;
- register int i;
+ NTable table;
+ int i;
table = *prev;
i = table->mask;
i = (i << 1) + 1;
i++; /* i is now the new size */
if (table->leaf) {
- register LTable ltable;
+ LTable ltable;
LTableRec otable;
ltable = (LTable)table;
bzero((char *)ltable->buckets, i * sizeof(VEntry));
MoveValues(&otable, ltable);
} else {
- register NTable ntable;
+ NTable ntable;
ntable = (NTable)Xmalloc(sizeof(NTableRec) + i * sizeof(NTable));
if (!ntable)
}
/* merge values from ftable into *pprev, destroy ftable in the process */
-static void MergeValues(ftable, pprev, override)
- LTable ftable;
- NTable *pprev;
- Bool override;
+static void MergeValues(LTable ftable, NTable *pprev, Bool override)
{
- register VEntry fentry, tentry;
- register VEntry *prev;
- register LTable ttable;
+ VEntry fentry, tentry;
+ VEntry *prev;
+ LTable ttable;
VEntry *bucket;
int i;
- register XrmQuark q;
+ XrmQuark q;
ttable = (LTable)*pprev;
if (ftable->table.hasloose)
}
/* merge tables from ftable into *pprev, destroy ftable in the process */
-static void MergeTables(ftable, pprev, override)
- NTable ftable;
- NTable *pprev;
- Bool override;
+static void MergeTables(NTable ftable, NTable *pprev, Bool override)
{
- register NTable fentry, tentry;
+ NTable fentry, tentry;
NTable nfentry;
- register NTable *prev;
- register NTable ttable;
+ NTable *prev;
+ NTable ttable;
NTable *bucket;
int i;
- register XrmQuark q;
+ XrmQuark q;
ttable = *pprev;
if (ftable->hasloose)
GROW(pprev);
}
-void falrmCombineDatabase(from, into, override)
- XrmDatabase from, *into;
- Bool override;
+void falrmCombineDatabase(XrmDatabase from, XrmDatabase *into, Bool override)
{
- register NTable *prev;
- register NTable ftable, ttable, nftable;
+ NTable *prev;
+ NTable ftable, ttable, nftable;
if (!*into) {
*into = from;
}
}
-void falrmMergeDatabases(from, into)
- XrmDatabase from, *into;
+void falrmMergeDatabases(XrmDatabase from, XrmDatabase *into)
{
falrmCombineDatabase(from, into, True);
}
/* store a value in the database, overriding any existing entry */
-static void PutEntry(db, bindings, quarks, type, value)
- XrmDatabase db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation type;
- XrmValuePtr value;
+static void PutEntry(
+ XrmDatabase db,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation type,
+ XrmValuePtr value)
{
- register NTable *pprev, *prev;
- register NTable table;
- register XrmQuark q;
- register VEntry *vprev;
- register VEntry entry;
+ NTable *pprev, *prev;
+ NTable table;
+ XrmQuark q;
+ VEntry *vprev;
+ VEntry entry;
NTable *nprev, *firstpprev;
#define NEWTABLE(q,i) \
#undef NEWTABLE
}
-void falrmQPutResource(pdb, bindings, quarks, type, value)
- XrmDatabase *pdb;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation type;
- XrmValuePtr value;
+void falrmQPutResource(
+ XrmDatabase *pdb,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation type,
+ XrmValuePtr value)
{
if (!*pdb) *pdb = NewDatabase();
_XLockMutex(&(*pdb)->linfo);
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
void falrmPutResource(
XrmDatabase *pdb,
- _Xconst char *specifier,
- _Xconst char *type,
+ const char *specifier,
+ const char *type,
XrmValuePtr value)
-#else
-void falrmPutResource(pdb, specifier, type, value)
- XrmDatabase *pdb;
- char *specifier;
- char *type;
- XrmValuePtr value;
-#endif
{
XrmBinding bindings[MAXDBDEPTH+1];
XrmQuark quarks[MAXDBDEPTH+1];
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
void falrmQPutStringResource(
XrmDatabase *pdb,
XrmBindingList bindings,
XrmQuarkList quarks,
- _Xconst char *str)
-#else
-void falrmQPutStringResource(pdb, bindings, quarks, str)
- XrmDatabase *pdb;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- char *str;
-#endif
+ const char *str)
{
XrmValue value;
static void GetIncludeFile();
-static void GetDatabase(db, str, filename, doall)
- XrmDatabase db;
- register char *str;
- char *filename;
- Bool doall;
+static void GetDatabase(
+ XrmDatabase db,
+ char *str,
+ char *filename,
+ Bool doall)
{
- register char *ptr;
- register XrmBits bits = 0;
- register char c;
+ char *ptr;
+ XrmBits bits = 0;
+ char c;
int len;
- register Signature sig;
- register char *ptr_max;
- register XrmQuarkList t_quarks;
- register XrmBindingList t_bindings;
+ Signature sig;
+ char *ptr_max;
+ XrmQuarkList t_quarks;
+ XrmBindingList t_bindings;
int alloc_chars = BUFSIZ;
char buffer[BUFSIZ], *value_str;
(*db->methods->mbfinish)(db->mbstate);
}
-#if NeedFunctionPrototypes
void falrmPutStringResource(
XrmDatabase *pdb,
- _Xconst char*specifier,
- _Xconst char*str)
-#else
-void falrmPutStringResource(pdb, specifier, str)
- XrmDatabase *pdb;
- char *specifier;
- char *str;
-#endif
+ const char*specifier,
+ const char*str)
{
XrmValue value;
XrmBinding bindings[MAXDBDEPTH+1];
}
-#if NeedFunctionPrototypes
-void falrmPutLineResource(
- XrmDatabase *pdb,
- _Xconst char*line)
-#else
-void falrmPutLineResource(pdb, line)
- XrmDatabase *pdb;
- char *line;
-#endif
+void falrmPutLineResource(XrmDatabase *pdb, char *line)
{
if (!*pdb) *pdb = NewDatabase();
_XLockMutex(&(*pdb)->linfo);
_XUnlockMutex(&(*pdb)->linfo);
}
-#if NeedFunctionPrototypes
-XrmDatabase falrmGetStringDatabase(
- _Xconst char *data)
-#else
-XrmDatabase falrmGetStringDatabase(data)
- char *data;
-#endif
+XrmDatabase falrmGetStringDatabase(char *data)
{
XrmDatabase db;
*/
static char *
-ReadInFile(filename)
-char * filename;
+ReadInFile(char *filename)
{
- register int fd, size;
+ int fd, size;
char * filebuf;
if ( (fd = OpenFile(filename)) == -1 )
}
static void
-GetIncludeFile(db, base, fname, fnamelen)
- XrmDatabase db;
- char *base;
- char *fname;
- int fnamelen;
+GetIncludeFile(
+ XrmDatabase db,
+ char *base,
+ char *fname,
+ int fnamelen)
{
int len;
char *str;
Xfree(str);
}
-#if NeedFunctionPrototypes
-XrmDatabase falrmGetFileDatabase(
- _Xconst char *filename)
-#else
-XrmDatabase falrmGetFileDatabase(filename)
- char *filename;
-#endif
+XrmDatabase falrmGetFileDatabase(char *filename)
{
XrmDatabase db;
char *str;
return db;
}
-#if NeedFunctionPrototypes
Status falrmCombineFileDatabase(
- _Xconst char *filename,
+ char *filename,
XrmDatabase *target,
Bool override)
-#else
-Status falrmCombineFileDatabase(filename, target, override)
- char *filename;
- XrmDatabase *target;
- Bool override;
-#endif
{
XrmDatabase db;
char *str;
* stop if user proc returns True. level is current depth in database.
*/
/*ARGSUSED*/
-static Bool EnumLTable(table, names, classes, level, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register int level;
- register EClosure closure;
+static Bool EnumLTable(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ int level,
+ EClosure closure)
{
- register VEntry *bucket;
- register int i;
- register VEntry entry;
+ VEntry *bucket;
+ int i;
+ VEntry entry;
XrmValue value;
XrmRepresentation type;
Bool tightOk;
return False;
}
-static Bool EnumAllNTable(table, level, closure)
- NTable table;
- register int level;
- register EClosure closure;
+static Bool EnumAllNTable(NTable table, int level, EClosure closure)
{
- register NTable *bucket;
- register int i;
- register NTable entry;
+ NTable *bucket;
+ int i;
+ NTable entry;
XrmQuark empty = NULLQUARK;
if (level >= MAXDBDEPTH)
/* recurse on every table in the table, arbitrary order.
* stop if user proc returns True. level is current depth in database.
*/
-static Bool EnumNTable(table, names, classes, level, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- register int level;
- register EClosure closure;
+static Bool EnumNTable(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ int level,
+ EClosure closure)
{
- register NTable entry;
- register XrmQuark q;
- register unsigned int leaf;
+ NTable entry;
+ XrmQuark q;
+ unsigned int leaf;
Bool (*get)();
Bool bilevel;
/* call the proc for every value in the database, arbitrary order.
* stop if the proc returns True.
*/
-Bool falrmEnumerateDatabase(db, names, classes, mode, proc, closure)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- int mode;
- DBEnumProc proc;
- XPointer closure;
+Bool falrmEnumerateDatabase(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ int mode,
+ DBEnumProc proc,
+ XPointer closure)
{
XrmBinding bindings[MAXDBDEPTH+2];
XrmQuark quarks[MAXDBDEPTH+2];
- register NTable table;
+ NTable table;
EClosureRec eclosure;
Bool retval = False;
return retval;
}
-static void PrintBindingQuarkList(bindings, quarks, stream)
- XrmBindingList bindings;
- XrmQuarkList quarks;
- FILE *stream;
+static void PrintBindingQuarkList(
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ FILE *stream)
{
Bool firstNameSeen;
/* output out the entry in correct file syntax */
/*ARGSUSED*/
-static Bool DumpEntry(db, bindings, quarks, type, value, data)
- XrmDatabase *db;
- XrmBindingList bindings;
- XrmQuarkList quarks;
- XrmRepresentation *type;
- XrmValuePtr value;
- XPointer data;
+static Bool DumpEntry(
+ XrmDatabase *db,
+ XrmBindingList bindings,
+ XrmQuarkList quarks,
+ XrmRepresentation *type,
+ XrmValuePtr value,
+ XPointer data)
{
FILE *stream = (FILE *)data;
- register unsigned int i;
- register char *s;
- register char c;
+ unsigned int i;
+ char *s;
+ char c;
if (*type != XrmQString)
(void) putc('!', stream);
#ifdef DEBUG
-void falPrintTable(table, file)
- NTable table;
- FILE *file;
+void falPrintTable(NTable table, FILE *file)
{
XrmBinding bindings[MAXDBDEPTH+1];
XrmQuark quarks[MAXDBDEPTH+1];
#endif /* DEBUG */
-#if NeedFunctionPrototypes
-void falrmPutFileDatabase(
- XrmDatabase db,
- _Xconst char *fileName)
-#else
-void falrmPutFileDatabase(db, fileName)
- XrmDatabase db;
- char *fileName;
-#endif
+void falrmPutFileDatabase(XrmDatabase db, const char *fileName)
{
FILE *file;
XrmQuark empty = NULLQUARK;
/* add tight/loose entry to the search list, return True if list is full */
/*ARGSUSED*/
-static Bool AppendLEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register SClosure closure;
+static Bool AppendLEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure)
{
/* check for duplicate */
if (closure->idx >= 0 && closure->list[closure->idx] == table)
/* add loose entry to the search list, return True if list is full */
/*ARGSUSED*/
-static Bool AppendLooseLEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- register SClosure closure;
+static Bool AppendLooseLEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure)
{
/* check for duplicate */
if (closure->idx >= 0 && closure->list[closure->idx] == table)
}
/* search for a leaf table */
-static Bool SearchNEntry(table, names, classes, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- SClosure closure;
+static Bool SearchNEntry(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ SClosure closure)
{
- register NTable entry;
- register XrmQuark q;
- register unsigned int leaf;
+ NTable entry;
+ XrmQuark q;
+ unsigned int leaf;
Bool (*get)();
if (names[1]) {
return False;
}
-Bool falrmQGetSearchList(db, names, classes, searchList, listLength)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- XrmSearchList searchList; /* RETURN */
- int listLength;
+Bool falrmQGetSearchList(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ XrmSearchList searchList, /* RETURN */
+ int listLength)
{
- register NTable table;
+ NTable table;
SClosureRec closure;
if (listLength <= 0)
return True;
}
-Bool falrmQGetSearchResource(searchList, name, class, pType, pValue)
- XrmSearchList searchList;
- register XrmName name;
- register XrmClass class;
- XrmRepresentation *pType; /* RETURN */
- XrmValue *pValue; /* RETURN */
+Bool falrmQGetSearchResource(
+ XrmSearchList searchList,
+ XrmName name,
+ XrmClass class,
+ XrmRepresentation *pType, /* RETURN */
+ XrmValue *pValue) /* RETURN */
{
- register LTable *list;
- register LTable table;
- register VEntry entry;
+ LTable *list;
+ LTable table;
+ VEntry entry;
int flags;
/* find tight or loose entry */
}
/* look for a tight/loose value */
-static Bool GetVEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetVEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
- register VEntry entry;
- register XrmQuark q;
+ VEntry entry;
+ XrmQuark q;
/* try name first */
q = *names;
}
/* look for a loose value */
-static Bool GetLooseVEntry(table, names, classes, closure)
- LTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetLooseVEntry(
+ LTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
- register VEntry entry;
- register XrmQuark q;
+ VEntry entry;
+ XrmQuark q;
#define VLOOSE(ename) \
q = ename; \
}
/* recursive search for a value */
-static Bool GetNEntry(table, names, classes, closure)
- NTable table;
- XrmNameList names;
- XrmClassList classes;
- VClosure closure;
+static Bool GetNEntry(
+ NTable table,
+ XrmNameList names,
+ XrmClassList classes,
+ VClosure closure)
{
- register NTable entry;
- register XrmQuark q;
- register unsigned int leaf;
+ NTable entry;
+ XrmQuark q;
+ unsigned int leaf;
Bool (*get)();
NTable otable;
return False;
}
-Bool falrmQGetResource(db, names, classes, pType, pValue)
- XrmDatabase db;
- XrmNameList names;
- XrmClassList classes;
- XrmRepresentation *pType; /* RETURN */
- XrmValuePtr pValue; /* RETURN */
+Bool falrmQGetResource(
+ XrmDatabase db,
+ XrmNameList names,
+ XrmClassList classes,
+ XrmRepresentation *pType, /* RETURN */
+ XrmValuePtr pValue) /* RETURN */
{
- register NTable table;
+ NTable table;
VClosureRec closure;
if (db && *names) {
return False;
}
-#if NeedFunctionPrototypes
-Bool falrmGetResource(db, name_str, class_str, pType_str, pValue)
- XrmDatabase db;
- _Xconst char *name_str;
- _Xconst char *class_str;
- XrmString *pType_str; /* RETURN */
- XrmValuePtr pValue; /* RETURN */
-#else
-Bool falrmGetResource(db, name_str, class_str, pType_str, pValue)
- XrmDatabase db;
- XrmString name_str;
- XrmString class_str;
- XrmString *pType_str; /* RETURN */
- XrmValuePtr pValue; /* RETURN */
-#endif
+Bool falrmGetResource(
+ XrmDatabase db,
+ const char *name_str,
+ const char *class_str,
+ XrmString *pType_str, /* RETURN */
+ XrmValuePtr pValue) /* RETURN */
{
XrmName names[MAXDBDEPTH+1];
XrmClass classes[MAXDBDEPTH+1];
}
/* destroy all values, plus table itself */
-static void DestroyLTable(table)
- LTable table;
+static void DestroyLTable(LTable table)
{
- register int i;
- register VEntry *buckets;
- register VEntry entry, next;
+ int i;
+ VEntry *buckets;
+ VEntry entry, next;
buckets = table->buckets;
for (i = table->table.mask; i >= 0; i--, buckets++) {
}
/* destroy all contained tables, plus table itself */
-static void DestroyNTable(table)
- NTable table;
+static void DestroyNTable(NTable table)
{
- register int i;
- register NTable *buckets;
- register NTable entry, next;
+ int i;
+ NTable *buckets;
+ NTable entry, next;
buckets = NodeBuckets(table);
for (i = table->mask; i >= 0; i--, buckets++) {
Xfree((char *)table);
}
-char *falrmLocaleOfDatabase(db)
- XrmDatabase db;
+char *falrmLocaleOfDatabase(XrmDatabase db)
{
char* retval;
_XLockMutex(&db->linfo);
return retval;
}
-void falrmDestroyDatabase(db)
- XrmDatabase db;
+void falrmDestroyDatabase(XrmDatabase db)
{
- register NTable table, next;
+ NTable table, next;
if (db) {
_XLockMutex(&db->linfo);
/*
* "code" no jyoui "i" byte me wo "unsigned char" toshite kaesu.
*/
-static unsigned char getbyte(code,i)
-unsigned long code;
-int i;
+static unsigned char getbyte(unsigned long code, int i)
{
unsigned long byteL;
unsigned char byte;
charset_str : JISX0208.1983-0
*/
-fal_get_codeset(locale,charset_str,codeset,num_codeset)
-char *locale;
-char *charset_str;
-int **codeset;
-int *num_codeset;
+fal_get_codeset(
+char *locale,
+char *charset_str,
+int **codeset,
+int *num_codeset)
{
XLCdRec lcdrec;
XLCd lcd;
return 0;
}
-static Bool gi_to_vgi(gi,vgi,scope)
-unsigned long gi,*vgi;
-FontScope scope;
+static Bool gi_to_vgi(unsigned long gi, unsigned long *vgi, FontScope scope)
{
if(scope->shift_direction == (unsigned long)'+'){
gi -= scope->shift;
return(False);
}
-static void shift_area(udc,scope)
-FalGlyphRegion *udc;
-FontScope scope;
+static void shift_area(FalGlyphRegion *udc, FontScope scope)
{
if(scope->shift_direction == (unsigned long)'+'){
udc->start += scope->shift;
locale : ja_JP
charset_str : JISX0208.1983-0
*/
-FalGetUDCGIArea(locale,codeset,charset_str,gr,num_gr)
-char *locale;
-int codeset;
-char *charset_str;
-FalGlyphRegion **gr;
-int *num_gr;
+FalGetUDCGIArea(
+char *locale,
+int codeset,
+char *charset_str,
+FalGlyphRegion **gr,
+int *num_gr)
{
XLCdRec lcdrec;
XLCd lcd;
*
*/
-int fal_gi_to_vgi(lcd,locale,charset_str,codeset,gi,vgi,charsetname)
-XLCd lcd;
-char *locale;
-char *charset_str;
-int codeset;
-unsigned long gi;
-unsigned long *vgi;
-char *charsetname;
+int fal_gi_to_vgi(
+XLCd lcd,
+char *locale,
+char *charset_str,
+int codeset,
+unsigned long gi,
+unsigned long *vgi,
+char *charsetname)
{
FalGlyphRegion *udc;
int num = 0,count,num_ret=0;
return(True);
}
-Bool falnon_standard(lcd,charset)
-XLCd lcd;
-XlcCharSet charset;
+Bool falnon_standard(XLCd lcd, XlcCharSet charset)
{
char buf[256];
int count,i;
}
void
-falmake_none_standard(from,charset,src)
-char *from;
-XlcCharSet charset;
-char *src;
+falmake_none_standard(char *from, XlcCharSet charset, char *src)
{
int name_len,seq_len,i;
name_len = 2 + strlen(charset->encoding_name) + 1;
strcpy(&from[seq_len + name_len],src);
}
int
-fal_glyph_to_code(locale,charset_str,codeset,glyph_index,codepoint)
-char *locale;
-char *charset_str;
-int codeset;
-unsigned long glyph_index;
-unsigned long *codepoint;
+fal_glyph_to_code(
+char *locale,
+char *charset_str,
+int codeset,
+unsigned long glyph_index,
+unsigned long *codepoint)
{
XLCd lcd;
unsigned char *from; int from_left;
} FalCodeRegion ;
int
-FalGetUDCCPArea(locale,codeset,charset_str,cr,num_cr)
-char *locale;
-int codeset;
-char *charset_str;
-FalCodeRegion **cr;
-int *num_cr;
+FalGetUDCCPArea(
+char *locale,
+int codeset,
+char *charset_str,
+FalCodeRegion **cr,
+int *num_cr)
{
int i,num_gr,ret;
FalGlyphRegion *gr;
*
*
*/
-static Bool vgi_to_gi(gi,vgi,scope)
-unsigned long *gi,vgi;
-FontScope scope;
+static Bool vgi_to_gi(unsigned long *gi, unsigned long vgi, FontScope scope)
{
if(vgi >= scope->start && vgi <= scope->end){
if(scope->shift_direction == (unsigned long)'+'){
*
*/
static Bool
-fal_vgi_to_gi(lcd,locale,vglyph,glyph,charset,charsetname)
-XLCd lcd;
-char *locale;
-unsigned long vglyph;
-unsigned long *glyph;
-XlcCharSet charset;
-char *charsetname;
+fal_vgi_to_gi(
+XLCd lcd,
+char *locale,
+unsigned long vglyph,
+unsigned long *glyph,
+XlcCharSet charset,
+char *charsetname)
{
int num = 0,count,num_ret=0;
int i,j,k;
return(True);
}
int
-fal_code_to_glyph(locale,codepoint,gi,num_gi)
-char *locale;
-unsigned long codepoint;
-FalGIInf **gi;
-int *num_gi;
+fal_code_to_glyph(
+char *locale,
+unsigned long codepoint,
+FalGIInf **gi,
+int *num_gi)
{
XLCd lcd;
unsigned char *from; int from_left;
/* The following declarations are alphabetized. */
extern XClassHint *XAllocClassHint (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XIconSize *XAllocIconSize (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XSizeHints *XAllocSizeHints (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XStandardColormap *XAllocStandardColormap (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XWMHints *XAllocWMHints (
-#if NeedFunctionPrototypes
void
-#endif
);
extern XClipBox(
-#if NeedFunctionPrototypes
Region /* r */,
XRectangle* /* rect_return */
-#endif
);
extern Region XCreateRegion(
-#if NeedFunctionPrototypes
void
-#endif
);
extern char *falDefaultString(
-#if NeedFunctionPrototypes
void
-#endif
);
extern int XDeleteContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */
-#endif
);
extern XDestroyRegion(
-#if NeedFunctionPrototypes
Region /* r */
-#endif
);
extern XEmptyRegion(
-#if NeedFunctionPrototypes
Region /* r */
-#endif
);
extern XEqualRegion(
-#if NeedFunctionPrototypes
Region /* r1 */,
Region /* r2 */
-#endif
);
extern int XFindContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */,
XPointer* /* data_return */
-#endif
);
extern Status XGetClassHint(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XClassHint* /* class_hints_return */
-#endif
);
extern Status XGetIconSizes(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XIconSize** /* size_list_return */,
int* /* count_return */
-#endif
);
extern Status XGetNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */
-#endif
);
extern Status XGetRGBColormaps(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap** /* stdcmap_return */,
int* /* count_return */,
Atom /* property */
-#endif
);
extern Status XGetSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
Atom /* property */
-#endif
);
extern Status XGetStandardColormap(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* colormap_return */,
Atom /* property */
-#endif
);
extern Status XGetTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* window */,
XTextProperty* /* text_prop_return */,
Atom /* property */
-#endif
);
extern XVisualInfo *XGetVisualInfo(
-#if NeedFunctionPrototypes
Display* /* display */,
long /* vinfo_mask */,
XVisualInfo* /* vinfo_template */,
int* /* nitems_return */
-#endif
);
extern Status XGetWMClientMachine(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern XWMHints *XGetWMHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */
-#endif
);
extern Status XGetWMIconName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern Status XGetWMName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop_return */
-#endif
);
extern Status XGetWMNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
long* /* supplied_return */
-#endif
);
extern Status XGetWMSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints_return */,
long* /* supplied_return */,
Atom /* property */
-#endif
);
extern Status XGetZoomHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* zhints_return */
-#endif
);
extern XIntersectRegion(
-#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
extern void XConvertCase(
-#if NeedFunctionPrototypes
KeySym /* sym */,
KeySym* /* lower */,
KeySym* /* upper */
-#endif
);
extern int XLookupString(
-#if NeedFunctionPrototypes
XKeyEvent* /* event_struct */,
char* /* buffer_return */,
int /* bytes_buffer */,
KeySym* /* keysym_return */,
XComposeStatus* /* status_in_out */
-#endif
);
extern Status XMatchVisualInfo(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* screen */,
int /* depth */,
int /* class */,
XVisualInfo* /* vinfo_return */
-#endif
);
extern XOffsetRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* dx */,
int /* dy */
-#endif
);
extern Bool XPointInRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */
-#endif
);
extern Region XPolygonRegion(
-#if NeedFunctionPrototypes
XPoint* /* points */,
int /* n */,
int /* fill_rule */
-#endif
);
extern int XRectInRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* x */,
int /* y */,
unsigned int /* width */,
unsigned int /* height */
-#endif
);
extern int XSaveContext(
-#if NeedFunctionPrototypes
Display* /* display */,
XID /* rid */,
XContext /* context */,
- _Xconst char* /* data */
-#endif
+ const char* /* data */
);
extern XSetClassHint(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XClassHint* /* class_hints */
-#endif
);
extern XSetIconSizes(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XIconSize* /* size_list */,
int /* count */
-#endif
);
extern XSetNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */
-#endif
);
extern void XSetRGBColormaps(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* stdcmaps */,
int /* count */,
Atom /* property */
-#endif
);
extern XSetSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */,
Atom /* property */
-#endif
);
extern XSetStandardProperties(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
- _Xconst char* /* window_name */,
- _Xconst char* /* icon_name */,
+ const char* /* window_name */,
+ const char* /* icon_name */,
Pixmap /* icon_pixmap */,
char** /* argv */,
int /* argc */,
XSizeHints* /* hints */
-#endif
);
extern void XSetTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */,
Atom /* property */
-#endif
);
extern void XSetWMClientMachine(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */
-#endif
);
extern XSetWMHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XWMHints* /* wm_hints */
-#endif
);
extern void XSetWMIconName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */
-#endif
);
extern void XSetWMName(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* text_prop */
-#endif
);
extern void XSetWMNormalHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */
-#endif
);
extern void XSetWMProperties(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XTextProperty* /* window_name */,
XSizeHints* /* normal_hints */,
XWMHints* /* wm_hints */,
XClassHint* /* class_hints */
-#endif
);
extern void XmbSetWMProperties(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
- _Xconst char* /* window_name */,
- _Xconst char* /* icon_name */,
+ const char* /* window_name */,
+ const char* /* icon_name */,
char** /* argv */,
int /* argc */,
XSizeHints* /* normal_hints */,
XWMHints* /* wm_hints */,
XClassHint* /* class_hints */
-#endif
);
extern void XSetWMSizeHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* hints */,
Atom /* property */
-#endif
);
extern XSetRegion(
-#if NeedFunctionPrototypes
Display* /* display */,
GC /* gc */,
Region /* r */
-#endif
);
extern void XSetStandardColormap(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XStandardColormap* /* colormap */,
Atom /* property */
-#endif
);
extern XSetZoomHints(
-#if NeedFunctionPrototypes
Display* /* display */,
Window /* w */,
XSizeHints* /* zhints */
-#endif
);
extern XShrinkRegion(
-#if NeedFunctionPrototypes
Region /* r */,
int /* dx */,
int /* dy */
-#endif
);
extern Status XStringListToTextProperty(
-#if NeedFunctionPrototypes
char** /* list */,
int /* count */,
XTextProperty* /* text_prop_return */
-#endif
);
extern XSubtractRegion(
-#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
extern int falmbTextListToTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
char** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop_return */
-#endif
);
extern int falwcTextListToTextProperty(
-#if NeedFunctionPrototypes
Display* /* display */,
wchar_t** /* list */,
int /* count */,
XICCEncodingStyle /* style */,
XTextProperty* /* text_prop_return */
-#endif
);
extern void falwcFreeStringList(
-#if NeedFunctionPrototypes
wchar_t** /* list */
-#endif
);
extern Status XTextPropertyToStringList(
-#if NeedFunctionPrototypes
XTextProperty* /* text_prop */,
char*** /* list_return */,
int* /* count_return */
-#endif
);
extern int falmbTextPropertyToTextList(
-#if NeedFunctionPrototypes
Display* /* display */,
XTextProperty* /* text_prop */,
char*** /* list_return */,
int* /* count_return */
-#endif
);
extern int falwcTextPropertyToTextList(
-#if NeedFunctionPrototypes
Display* /* display */,
XTextProperty* /* text_prop */,
wchar_t*** /* list_return */,
int* /* count_return */
-#endif
);
extern XUnionRectWithRegion(
-#if NeedFunctionPrototypes
XRectangle* /* rectangle */,
Region /* src_region */,
Region /* dest_region_return */
-#endif
);
extern XUnionRegion(
-#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
extern int XWMGeometry(
-#if NeedFunctionPrototypes
Display* /* display */,
int /* screen_number */,
- _Xconst char* /* user_geometry */,
- _Xconst char* /* default_geometry */,
+ const char* /* user_geometry */,
+ const char* /* default_geometry */,
unsigned int /* border_width */,
XSizeHints* /* hints */,
int* /* x_return */,
int* /* width_return */,
int* /* height_return */,
int* /* gravity_return */
-#endif
);
extern XXorRegion(
-#if NeedFunctionPrototypes
Region /* sra */,
Region /* srb */,
Region /* dr_return */
-#endif
);
_XFUNCPROTOEND
* Invert bit order within each BYTE of an array.
*/
void
-BitOrderInvert(buf, nbytes)
- register unsigned char *buf;
- register int nbytes;
+BitOrderInvert(unsigned char *buf, int nbytes)
{
- register unsigned char *rev = _reverse_byte;
+ unsigned char *rev = _reverse_byte;
for (; --nbytes >= 0; buf++)
*buf = rev[*buf];
* Invert byte order within each 16-bits of an array.
*/
void
-TwoByteSwap(buf, nbytes)
- register unsigned char *buf;
- register int nbytes;
+TwoByteSwap(unsigned char *buf, int nbytes)
{
- register unsigned char c;
+ unsigned char c;
for (; nbytes > 0; nbytes -= 2, buf += 2)
{
* Invert byte order within each 32-bits of an array.
*/
void
-FourByteSwap(buf, nbytes)
- register unsigned char *buf;
- register int nbytes;
+FourByteSwap(unsigned char *buf, int nbytes)
{
- register unsigned char c;
+ unsigned char c;
for (; nbytes > 0; nbytes -= 4, buf += 4)
{
*/
int
-RepadBitmap (pSrc, pDst, srcPad, dstPad, width, height)
- char *pSrc, *pDst;
- unsigned srcPad, dstPad;
- int width, height;
+RepadBitmap (
+ char *pSrc,
+ char *pDst,
+ unsigned srcPad,
+ unsigned dstPad,
+ int width,
+ int height)
{
int srcWidthBytes,dstWidthBytes;
int row,col;
#else /* !__HIGHC__ */
-#if NeedVarargsPrototypes
# include <stdarg.h>
# define Va_start(a,b) va_start(a,b)
-#else
-# include <varargs.h>
-# define Va_start(a,b) va_start(a)
-#endif
#endif /* __HIGHC__ */
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#include <X11/Intrinsic.h>
#include "FaLib.h"
#include "falfont.h"
#include "udcutil.h"
-
#define MKFONTLIST (1<<1)
#define SRCHFNAME (1<<2)
#define FONTOFID (1<<3)
static int
-fal_init()
+fal_init(void)
{
memset( fal_err_file, '\0', sizeof(fal_err_file) ) ;
memset( fal_err_file_buf, '\0', sizeof(fal_err_file_buf) ) ;
}
void
-set_errfile_str( obuf, ibuf )
-char *obuf ;
-char *ibuf ;
+set_errfile_str(char *obuf, char *ibuf)
{
char *sp ;
* open a fontfile by "RDONLY"
*/
FalFontID
-FalOpenFont( file, protect_key_data, codeset )
-char *file;
-int protect_key_data;
-int codeset;
+FalOpenFont(char *file, int protect_key_data, int codeset)
{
FalFontID __FalOpenFont();
* 0: OFF -- for "FalOpenFont()"
*/
FalFontID
-__FalOpenFont( file, protect_key_data, codeset, lockflag )
-char *file;
-int protect_key_data;
-int codeset;
-int lockflag;
+__FalOpenFont(char *file, int protect_key_data, int codeset, int lockflag)
{
- int fd ;
- char *buf;
- char *openfontfile;
- struct stat st;
- Oak_FontInf *finf;
+ int fd ;
+ char *buf;
+ char *openfontfile;
+ struct stat st;
+ Oak_FontInf *finf;
+
+ while(1){
if ( !(openfontfile = (char *)malloc( strlen( file ) + 1 )) ) {
fal_seterrcode( _FAL_MALOC_ER, 0,
fal_utyderror = 0;
fal_utyerrno = FAL_ERR_FONT ;
fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ;
- goto FalError01 ;
+ break;
}
finf->isFef = FALSE;
finf->isPcf = TRUE;
= (unsigned char *)((char *)finf->pCinf
+ (sizeof(CharInfoRec) * GETNUMCHARS(finf->pFinf)));
finf->width
- = finf->pFinf->maxbounds.metrics.rightSideBearing
- - finf->pFinf->maxbounds.metrics.leftSideBearing;
+ = finf->pFinf->maxbounds.rightSideBearing
+ - finf->pFinf->maxbounds.leftSideBearing;
finf->height
- = finf->pFinf->maxbounds.metrics.ascent
- + finf->pFinf->maxbounds.metrics.descent;
+ = finf->pFinf->maxbounds.ascent
+ + finf->pFinf->maxbounds.descent;
} else if ( finf->isPcf ) {
finf->pCinf = NULL;
finf->pGlyphs = NULL;
fal_utyderror = 0;
fal_utyerrno = FAL_ERR_FONT ;
fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ;
- goto FalError01 ;
+ break;
}
finf->start = (finf->pFinf->firstRow << 8) | finf->pFinf->firstCol;
fal_utyderror = 0;
fal_utyerrno = FAL_ERR_MALLOC ;
fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ;
- goto FalError01 ;
+ break;
}
/* Save font information */
lockflag ) == FAL_ERROR )
{
fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ;
- goto FalError01 ;
+ break;
}
/* Lock the font file */
fal_utyerror = _FAL_OPEN_ER;
fal_utyderror = errno;
fal_utyerrno |= (FAL_FUNCNUM_OPNFNT<<8) ;
- goto FalError01 ;
+ break;
}
}
free( openfontfile );
return( ( FalFontID ) finf );
-FalError01:
+ }
#if defined( SVR4 )
- if ( finf->ismmap == TRUE ) {
- munmap( buf, finf->fsize );
- } else {
- free( buf );
- close( fd );
- }
-#else
+ if ( finf->ismmap == TRUE ) {
+ munmap( buf, finf->fsize );
+ } else {
free( buf );
close( fd );
+ }
+#else
+ free( buf );
+ close( fd );
#endif
- set_errfile_str( fal_err_file, openfontfile ) ;
- free( openfontfile );
- free( finf->fname );
- finf->fname = NULL;
- free(finf);
+ set_errfile_str( fal_err_file, openfontfile ) ;
+ free( openfontfile );
+ free( finf->fname );
+ finf->fname = NULL;
+ free(finf);
- return (FalFontID)FAL_ERROR;
+ return (FalFontID)FAL_ERROR;
}
-#if NeedFunctionPrototypes
-FalCloseFont(
- FalFontID fid )
-#else
-FalCloseFont( fid )
-FalFontID fid;
-#endif
+FalCloseFont(FalFontID fid)
{
int __FalCloseFont();
FontIDInfo fontid_inf ;
* 1: ON --- open a font by "RDWR" mode
* 0: OFF -- for "FalOpenFont()"
*/
-__FalCloseFont( fid, lockflag )
-FalFontID fid;
-int lockflag;
+__FalCloseFont(FalFontID fid, int lockflag)
{
Oak_FontInf *finf;
return _FAL_OK;
}
-#if NeedFunctionPrototypes
-FalQueryFont(
- FalFontID fid,
- FalFontinfo *fontinfo )
-#else
-FalQueryFont( fid, fontinfo )
-FalFontID fid;
-FalFontinfo *fontinfo;
-#endif
+FalQueryFont(FalFontID fid, FalFontinfo *fontinfo)
{
Oak_FontInf *finf;
unsigned int inner_start, inner_end ;
return _FAL_OK;
}
-#if NeedFunctionPrototypes
char *
FalReadFont(
FalFontID fid,
int code,
int width,
int height )
-#else
-char *
-FalReadFont( fid, code, width, height )
-FalFontID fid;
-int code ;
-int width ;
-int height ;
-#endif
{
Oak_FontInf *finf;
int zoom_on ;
}
static
-falGetGlyph( glyph, finf, code )
-char *glyph;
-Oak_FontInf *finf;
-int code;
+falGetGlyph(char *glyph, Oak_FontInf *finf, int code)
{
int in_dwidth, out_dwidth, ix, i, j;
char *glyph_p, *inp, p_mask, falGetMask();
return 0;
}
- /* Get a character index */
- ix = falGetCharIndex( finf, inner_code );
- CharInfP = finf->pCinf;
-
- if ( !CharInfP[ix].exists ) {
- fal_utyexists = 1;
- return 0;
- } else {
- fal_utyexists = 0;
- }
-
in_dwidth
= (finf->width + SNF_BOUND - 1)
/ SNF_BOUND * (SNF_BOUND / 8);
p_mask = falGetMask( finf->width );
- glyph_p = (char *)finf->pGlyphs + CharInfP[ix].byteOffset;
+ glyph_p = (char *)finf->pGlyphs;
for ( i = 0; i < finf->height; i++ ) {
inp = glyph_p + ( in_dwidth * i );
for ( j = 0; j < out_dwidth-1; j++ ) {
}
static
-falGetCharIndex( finf, code )
-Oak_FontInf *finf;
-int code; /* an inside code of a file */
+falGetCharIndex(Oak_FontInf *finf, int code) /* an inside code of a file */
{
int nColperRow, nRow, nCol;
}
static
-falZoom( dmem, smem, sw, sh, dw, dh, dbuf )
-char *dmem;
-char *smem;
-int sw;
-int sh;
-int dw;
-int dh;
-char *dbuf;
+falZoom(char *dmem, char *smem, int sw, int sh, int dw, int dh, char *dbuf)
{
- int swidth;
- int dwidth;
- int i, lcnt;
+ int swidth = (sw + 7) / 8;
+ int dwidth = (dw + 7) / 8;
+ int i, lcnt = 0;
char *sp, *dp;
- swidth = (sw + 7) / 8;
- dwidth = (dw + 7) / 8;
-
- lcnt = 0;
sp = smem;
dp = dmem;
for ( i=0; i < sh; i++ ) {
}
static
-exline( sp, dbuf, sw, dw )
-char *sp;
-char *dbuf;
-int sw;
-int dw;
+exline(char *sp, char *dbuf, int sw, int dw)
{
int i, bit, sval, dval, dcnt, bcnt;
};
static char
-falGetMask( width )
-int width;
+falGetMask(int width)
{
int ix = width % 8;
return _Fal_Mask_Tab[ix];
/* make a font information list and carry to user */
/*********************************************************/
-#if NeedFunctionPrototypes
int
FalGetFontList(
- FalFontData *key_data,
- int mask,
- FalFontDataList **list_ret )
-#else
-int
-FalGetFontList( key_data, mask, list_ret )
-FalFontData *key_data; /* a structure of a searching information */
-int mask; /* a mask */
-FalFontDataList **list_ret; /* maked a address of a structure */
-#endif
+ FalFontData *key_data, /* a structure of a searching information */
+ int mask, /* a mask */
+ FalFontDataList **list_ret ) /* maked a address of a structure */
{
FalFontDataList *fls; /* a pointer of a structure of "FalFontDataList()" */
/***********************************************************************/
static int
-chk_key_str( key, mask )
-FalFontData *key; /* a structure of saerching information */
-int mask; /* a mask */
+chk_key_str(
+FalFontData *key, /* a structure of saerching information */
+int mask) /* a mask */
{
int flg = 0;
static int
-fal_make_fontlist( fls, key, mask )
-FalFontDataList *fls; /* a pointer of a structure of a font information list */
-FalFontData *key; /* a structure of searching information */
-int mask; /* a mask for a saerch */
+fal_make_fontlist(
+FalFontDataList *fls, /* a pointer of a structure of a font information list */
+FalFontData *key, /* a structure of searching information */
+int mask) /* a mask for a saerch */
{
return falReadFontInfoLists(MKFONTLIST,
key, mask, fls,
/* free a structure of "FalFontDataList()" */
/**************************************************/
-#if NeedFunctionPrototypes
int
-FalFreeFontList(
- FalFontDataList *list )
-#else
-int
-FalFreeFontList( list )
-FalFontDataList *list;
-#endif
+FalFreeFontList(FalFontDataList *list)
{
int i;
/***********************************************************************/
static int
-fal_split_data( buf, elm_num, elm)
-char *buf;
-int elm_num;
-char *elm[];
+fal_split_data(char *buf, int elm_num, char *elm[])
{
int cnt;
int strtop_flg;
/***********************************************************************/
static int
-fal_clear_data(tmp)
-FalFontData *tmp;
+fal_clear_data(FalFontData *tmp)
{
/* search a character */
free(tmp->xlfdname);
}
static int
-fal_check_already_exist( data, lst )
-FalFontData *data;
-FalFontDataList *lst;
+fal_check_already_exist(FalFontData *data, FalFontDataList *lst)
{
int i;
int mask ;
static int
-fal_sort_fontlist( lst )
-FalFontDataList *lst;
+fal_sort_fontlist(FalFontDataList *lst)
{
int i,j;
FalFontDataList srt;
/***************************************/
static int
-fal_atoi(str, val)
-char *str;
-int *val;
+fal_atoi(char *str, int *val)
{
char *ptr;
char *str_end;
/*******************************/
static int
-fal_set_cs(str, cs)
-char *str;
-int *cs;
+fal_set_cs(char *str, int *cs)
{
if (!strcmp(str, "CS0")) {
*cs = FAL_FONT_CS0;
static int
-fal_set_prm(str, prm)
-char *str;
-int *prm;
+fal_set_prm(char *str, int *prm)
{
int tmp = 0;
for ( ; *str != '\0' ; str++) {
return 0 ;
}
-static int fal_read_db( str, db )
-char *str;
-FalFontDB *db;
+static int fal_read_db(char *str, FalFontDB *db)
{
int i;
/***************************************/
int
-FalGetFontPath( dlist_ret )
-FalFontPath **dlist_ret;
+FalGetFontPath(FalFontPath **dlist_ret)
{
/* clear an error data */
}
static int
-set_default_path()
+set_default_path(void)
{
return set_font_pathlist(&orgn, 0) ;
}
static int
-cpy_default_path( p )
-FalFontPath *p;
+cpy_default_path(FalFontPath *p)
{
int i;
FalFontPath tmp;
}
static int
-comp_default_path(p)
-FalFontPath *p;
+comp_default_path(FalFontPath *p)
{
int i;
static int
-fal_clear_font_path( ls )
-FalFontPath *ls;
+fal_clear_font_path(FalFontPath *ls)
{
int i;
#define FAL_FONT_ELM_XLFDNAME 12
int
-set_struct( tmp_data, elm )
-FalFontData *tmp_data;
-char *elm[];
+set_struct(FalFontData *tmp_data, char *elm[])
{
- char *dup_p;
-
- /* data information */
+ char *dup_p;
+ /* data information */
+ while(1){
/* a width of a character size */
if ( fal_atoi(
elm[FAL_FONT_ELM_SIZE_W], &(tmp_data->size.w )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* a height of a character size */
if ( fal_atoi(
elm[FAL_FONT_ELM_SIZE_H], &(tmp_data->size.h )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* a width of a letter size */
if ( fal_atoi(
elm[FAL_FONT_ELM_LETTER_W], &(tmp_data->letter.w )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* a height of a letter size */
if ( fal_atoi(
elm[FAL_FONT_ELM_LETTER_H], &(tmp_data->letter.h )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* position x of a letter size */
if ( fal_atoi(
elm[FAL_FONT_ELM_LETTER_X], &(tmp_data->letter.x )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* position y of a letter size */
if ( fal_atoi(
elm[FAL_FONT_ELM_LETTER_Y], &(tmp_data->letter.y )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* codeset */
if ( fal_set_cs(
elm[FAL_FONT_ELM_CODE_SET], &(tmp_data->cd_set )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* a equipment of an output permission */
if ( fal_set_prm(
elm[FAL_FONT_ELM_PERMISSION], &(tmp_data->prm )
) == FAL_ERROR
) {
- goto FalError02 ;
+ break;
}
/* character information */
SET_STRUCT_OPTION( dup_p, elm, tmp_data, fal_utyerror, fal_db_group ) ;
return 0;
-FalError02:
- set_errfile_str( fal_err_file, fal_err_file_buf ) ;
- fal_utyerrno = FAL_ERR_FDATA_DSC ;
- return FAL_ERROR;
+ }
+ set_errfile_str( fal_err_file, fal_err_file_buf ) ;
+ fal_utyerrno = FAL_ERR_FDATA_DSC ;
+ return FAL_ERROR;
}
/* get a full path name */
-int searchFontFileName( data, fullPathName )
-FalFontData data;
-char *fullPathName;
+int searchFontFileName(FalFontData data, char *fullPathName)
{
int rtn ;
rtn = falReadFontInfoLists(SRCHFNAME,
}
-int fal_eq_data( data, tmp_data )
-FalFontData data;
-FalFontData tmp_data;
+int fal_eq_data(FalFontData data, FalFontData tmp_data)
{
int flg = 0;
static int
-CR_to_NULL(buf)
-char *buf;
+CR_to_NULL(char *buf)
{
for( ; *buf != '\0'; buf++ ) {
if (*buf == '\n') {
return 0 ;
}
-char *fal_get_base_name( str )
-char *str;
+char *fal_get_base_name(char *str)
{
char *str_slash;
static int
-fal_cmp_data( op1, key, mask )
-FalFontData *op1;
-FalFontData *key;
-int mask ;
+fal_cmp_data(FalFontData *op1, FalFontData *key, int mask)
{
if ( mask == 0 ) {
return(0);
/* no sort ... 0 */
static int
-new_target( target, choose )
-FalFontData *target;
-FalFontData *choose;
+new_target(FalFontData *target, FalFontData *choose)
{
FalFontData diff;
DEF_STR_CHK ;
return 0;
}
-#if NeedFunctionPrototypes
int FalFontOfFontID(
FalFontID fid,
FalFontData *fontdata )
-#else
-int FalFontOfFontID( fid, fontdata )
-FalFontID fid;
-FalFontData *fontdata;
-#endif
{
int rtn ;
rtn = falReadFontInfoLists(FONTOFID,
return rtn ;
}
-#if NeedFunctionPrototypes
FalFontID
FalOpenSysFont(
FalFontData *open_font_data,
int font_data_mask,
FalFontDataList **missing_font_list_return )
-#else
-FalFontID
-FalOpenSysFont( open_font_data, font_data_mask, missing_font_list_return )
-FalFontData *open_font_data;
-int font_data_mask;
-FalFontDataList **missing_font_list_return;
-#endif
{
int retFL; /* return a data of FontList */
FalFontID retOF; /* return a data of OpenFont */
* function to access fonts.list
********************************************************/
static
-FILE *open_fonts_list()
+FILE *open_fonts_list(void)
{
FILE *fp;
static int
-set_font_pathlist(pathlist, nodef)
-FalFontPath *pathlist ;
-int nodef ;
+set_font_pathlist(FalFontPath *pathlist, int nodef)
{
FILE *fp;
char buf[FAL_LINE_MAX];
static int
-make_default_path(pathlist)
-FalFontPath *pathlist ;
+make_default_path(FalFontPath *pathlist)
{
struct stat statbuf ;
char pbuf[FAL_LINE_MAX], *dir, *p ;
static int
-falReadFontInfoLists(func, lstkey, mask, fls, fnkey, fullpath, fid, fdata)
-int func ;
+falReadFontInfoLists(
+int func,
/* parameters for FalGetFontList */
-FalFontData *lstkey;
-int mask;
-FalFontDataList *fls;
+FalFontData *lstkey,
+int mask,
+FalFontDataList *fls,
/* parameters for searchFontFileName */
-FalFontData fnkey;
-char *fullpath;
+FalFontData fnkey,
+char *fullpath,
/* parameters for FalFontOfFontID */
-FalFontID fid ;
-FalFontData *fdata;
+FalFontID fid,
+FalFontData *fdata)
{
FILE *fp;
char pname[ FAL_LINE_MAX ] ;
/* clear code set informations */
static void
-clear_charset_info()
+clear_charset_info(void)
{
if( charset_str_buf ) free( charset_str_buf ) ;
charset_str_buf = NULL ;
static int
-fal_get_def_fontdata(func, pname, buf, elm, tmp_data, key_fname)
-int func ;
-char *pname ; /* font path */
-char *buf ; /* buffer for fgets() */
-char **elm ;
-FalFontData *tmp_data ;
-char *key_fname ;
+fal_get_def_fontdata(
+int func,
+char *pname, /* font path */
+char *buf, /* buffer for fgets() */
+char **elm,
+FalFontData *tmp_data,
+char *key_fname)
{
int rtn ;
char tmp_fname[FAL_LINE_MAX] ;
static int
-falgetfontlist(tmp_data, key, mask, fls, fontnum)
-FalFontData *tmp_data ;
-FalFontData *key ;
-int mask ;
-FalFontDataList *fls ;
-int fontnum ;
+falgetfontlist(
+FalFontData *tmp_data,
+FalFontData *key,
+int mask,
+FalFontDataList *fls,
+int fontnum)
{
FalFontData *p_bak ;
static int
-fal_get_undef_fontdata(func, full_path, xlfd, tmp_data, key_fname, codeset_num, codeset_list)
-int func ;
-char *full_path ;
-char *xlfd ;
-FalFontData *tmp_data ;
-char *key_fname ;
-int *codeset_num ;
-int **codeset_list ;
+fal_get_undef_fontdata(
+int func,
+char *full_path,
+char *xlfd,
+FalFontData *tmp_data,
+char *key_fname,
+int *codeset_num,
+int **codeset_list)
{
int rtn, pix ;
char *char_set ;
* get file name of fonts
*/
-#if NeedFunctionPrototypes
int
FalFontIDToFileName(
FalFontID fid,
char **file_name )
-#else
-int
-FalFontIDToFileName( fid, file_name )
-FalFontID fid;
-char **file_name;
-#endif
{
char *fname ;
Oak_FontInf *finf ;
}
-#if NeedFunctionPrototypes
int
-FalFree(
- void *list )
-#else
-int
-FalFree( list )
-void *list ;
-#endif
+FalFree(void *list)
{
if( list == NULL ) {
fal_utyerror = _FAL_PARM_ER ;
int
-FalFreeGI( ginf, num )
-FalGIInf *ginf ;
-int num ;
+FalFreeGI(FalGIInf *ginf, int num)
{
int i ;
if( ginf == NULL ) {
*/
static int
-fal_add_fidinf( fid, dspcode, cd_set, islock )
-FalFontID fid ;
-int dspcode ;
-int cd_set ;
-int islock ;
+fal_add_fidinf(FalFontID fid, int dspcode, int cd_set, int islock)
{
int exist, i, cnt ;
FontIDInfo **flist ;
}
static int
-fal_read_fidinf( fid, fontid_inf )
-FalFontID fid ;
-FontIDInfo *fontid_inf;
+fal_read_fidinf(FalFontID fid, FontIDInfo *fontid_inf)
{
int i ;
if( fid == NULL ) {
static int
-fal_del_fidinf( fid )
-FalFontID fid ;
+fal_del_fidinf(FalFontID fid)
{
int i, cnt, target ;
FontIDInfo **flist ;
*/
static int
-fal_conv_code_to_glyph( fid, code, glidx )
-FalFontID fid ;
-unsigned int code ;
-unsigned int *glidx ;
+fal_conv_code_to_glyph(FalFontID fid, unsigned int code, unsigned int *glidx)
{
Oak_FontInf *finf ;
FalFontData tmp_data ;
*/
static int
-fal_conv_glyph_to_code( finf, dspcode, cd_set, glidx, code )
-Oak_FontInf *finf ;
-int dspcode ;
-int cd_set ;
-unsigned int glidx ;
-unsigned int *code ;
+fal_conv_glyph_to_code(
+Oak_FontInf *finf,
+int dspcode,
+int cd_set,
+unsigned int glidx,
+unsigned int *code)
{
FalFontData tmp_data ;
int inner_code ;
static int
-file_lock( fd )
-int fd; /* a file descripter */
+file_lock(int fd) /* a file descripter */
{
struct flock flpar;
}
static int
-file_unlock( fd )
-int fd; /* a file descripter */
+file_unlock(int fd) /* a file descripter */
{
struct flock flpar;
}
static int
-is_lock( fd )
-int fd; /* file descripter */
+is_lock(int fd) /* file descripter */
{
struct flock flpar;
#############################################################################
##### #####
##### fonts.list #####
-##### #####
+##### #####
##### All Rights Reserved, Copyright (C) FUJITSU LIMITED 1995 #####
-##### #####
+##### #####
#############################################################################
#
# This file is referenced by :
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: font.h /main/1 1995/09/14 20:54:34 cde-fuj2 $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-(c) Copyright 1995 FUJITSU LIMITED
-This is source code modified by FUJITSU LIMITED under the Joint
-Development Agreement for the CDEnext PST.
-This is unpublished proprietary source code of FUJITSU LIMITED
-
-******************************************************************/
-#ifndef FONT_H
-#define FONT_H 1
-
-#include "servermd.h"
-
-#define NullCharInfo ((CharInfoPtr)0)
-#define NullFontInfo ((FontInfoPtr)0)
-#define LeftToRight 0
-#define RightToLeft 1
-/*
- * for linear char sets
- */
-#define n1dChars(pfi) ((pfi)->lastCol - (pfi)->firstCol + 1)
-#define chFirst firstCol /* usage: pfi->chFirst */
-#define chLast lastCol /* usage: pfi->chLast */
-
-/*
- * for 2D char sets
- */
-#define n2dChars(pfi) (((pfi)->lastCol - (pfi)->firstCol + 1) * \
- ((pfi)->lastRow - (pfi)->firstRow + 1))
-
-#define ADDRXTHISCHARINFO( pf, ch ) \
- ((CharInfoRec *) &((pf)->pCI[(ch) - (pf)->pFI->chFirst]))
-
-#define GLWIDTHPIXELS(pci) \
- ((pci)->metrics.rightSideBearing - (pci)->metrics.leftSideBearing)
-#define GLHEIGHTPIXELS(pci) \
- ((pci)->metrics.ascent + (pci)->metrics.descent)
-
-
-#define GLYPHWIDTHBYTES(pci) (((GLYPHWIDTHPIXELS(pci))+7) >> 3)
-#define GLYPHHEIGHTPIXELS(pci) (pci->metrics.ascent + pci->metrics.descent)
-#define GLYPHWIDTHPIXELS(pci) (pci->metrics.rightSideBearing \
- - pci->metrics.leftSideBearing)
-#define GLWIDTHPADDED( bc) ((bc+7) & ~0x7)
-
-#if GLYPHPADBYTES == 0 || GLYPHPADBYTES == 1
-#define GLYPHWIDTHBYTESPADDED(pci) (GLYPHWIDTHBYTES(pci))
-#define PADGLYPHWIDTHBYTES(w) (((w)+7)>>3)
-#endif
-
-#if GLYPHPADBYTES == 2
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+1) & ~0x1)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+1) & ~0x1)
-#endif
-
-#if GLYPHPADBYTES == 4
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+3) & ~0x3)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+3) & ~0x3)
-#endif
-
-#if GLYPHPADBYTES == 8 /* for a cray? */
-#define GLYPHWIDTHBYTESPADDED(pci) ((GLYPHWIDTHBYTES(pci)+7) & ~0x7)
-#define PADGLYPHWIDTHBYTES(w) (((((w)+7)>>3)+7) & ~0x7)
-#endif
-
-typedef struct _FontProp *FontPropPtr;
-typedef struct _CharInfo *CharInfoPtr;
-typedef struct _FontInfo *FontInfoPtr;
-typedef unsigned int DrawDirection;
-typedef struct _ExtentInfo *ExtentInfoPtr;
-
-
-#endif /* FONT_H */
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: fontstruct.h /main/3 1996/04/08 15:58:01 cde-fuj $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-(c) Copyright 1995 FUJITSU LIMITED
-This is source code modified by FUJITSU LIMITED under the Joint
-Development Agreement for the CDEnext PST.
-This is unpublished proprietary source code of FUJITSU LIMITED
-
-******************************************************************/
-#ifndef FONTSTRUCT_H
-#define FONTSTRUCT_H 1
-#include "font.h"
-#include "misc.h"
-
-typedef struct _CharInfo {
- xCharInfo metrics; /* info preformatted for Queries */
- unsigned byteOffset:24; /* byte offset of the raster from pGlyphs */
- Bool exists:1; /* true iff glyph exists for this char */
- unsigned pad:7; /* must be zero for now */
-} CharInfoRec;
-
-typedef struct _FontInfo {
- unsigned int version1; /* version stamp */
- unsigned int allExist;
- unsigned int drawDirection;
- unsigned int noOverlap; /* true if:
- * max(rightSideBearing-characterWidth)
- * <= minbounds->metrics.leftSideBearing
- */
- unsigned int constantMetrics;
- unsigned int terminalFont; /* Should be deprecated! true if:
- constant metrics &&
- leftSideBearing == 0 &&
- rightSideBearing == characterWidth &&
- ascent == fontAscent &&
- descent == fontDescent
- */
- unsigned int linear:1; /* true if firstRow == lastRow */
- unsigned int constantWidth:1; /* true if minbounds->metrics.characterWidth
- * == maxbounds->metrics.characterWidth
- */
- unsigned int inkInside:1; /* true if for all defined glyphs:
- * leftSideBearing >= 0 &&
- * rightSideBearing <= characterWidth &&
- * -fontDescent <= ascent <= fontAscent &&
- * -fontAscent <= descent <= fontDescent
- */
- unsigned int inkMetrics:1; /* ink metrics != bitmap metrics */
- /* used with terminalFont */
- /* see font's pInk{CI,Min,Max} */
- unsigned int padding:28;
- unsigned int firstCol;
- unsigned int lastCol;
- unsigned int firstRow;
- unsigned int lastRow;
- unsigned int nProps;
- unsigned int lenStrings; /* length in bytes of string table */
- unsigned int chDefault; /* default character */
- int fontDescent; /* minimum for quality typography */
- int fontAscent; /* minimum for quality typography */
- CharInfoRec minbounds; /* MIN of glyph metrics over all chars */
- CharInfoRec maxbounds; /* MAX of glyph metrics over all chars */
- unsigned int pixDepth; /* intensity bits per pixel */
- unsigned int glyphSets; /* number of sets of glyphs, for
- sub-pixel positioning */
- unsigned int version2; /* version stamp double-check */
-} FontInfoRec;
-
-typedef struct _ExtentInfo {
- DrawDirection drawDirection;
- int fontAscent;
- int fontDescent;
- int overallAscent;
- int overallDescent;
- int overallWidth;
- int overallLeft;
- int overallRight;
-} ExtentInfoRec;
-
-#endif /* FONTSTRUCT_H */
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: misc.h /main/7 1996/04/08 15:58:10 cde-fuj $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-(c) Copyright 1995 FUJITSU LIMITED
-This is source code modified by FUJITSU LIMITED under the Joint
-Development Agreement for the CDEnext PST.
-This is unpublished proprietary source code of FUJITSU LIMITED
-
-******************************************************************/
-#ifndef MISC_H
-#define MISC_H 1
-/*
- * X internal definitions
- *
- */
-
-
-extern unsigned long globalSerialNumber;
-extern unsigned long serverGeneration;
-
-#ifndef NULL
-#if __STDC__ && !NOSTDHDRS
-#include <stddef.h>
-#else
-#define NULL 0
-#endif
-#endif
-
-#define MAXSCREENS 3
-#define MAXCLIENTS 128
-#define MAXFORMATS 8
-#define MAXVISUALS_PER_SCREEN 50
-
-typedef unsigned char *pointer;
-typedef int Bool;
-typedef unsigned long PIXEL;
-typedef unsigned long ATOM;
-
-
-#ifndef TRUE
-#define TRUE 1
-#define FALSE 0
-#endif
-#include "os.h" /* for ALLOCATE_LOCAL and DEALLOCATE_LOCAL */
-
-#define NullBox ((BoxPtr)0)
-#define MILLI_PER_MIN (1000 * 60)
-#define MILLI_PER_SECOND (1000)
-
- /* this next is used with None and ParentRelative to tell
- PaintWin() what to use to paint the background. Also used
- in the macro IS_VALID_PIXMAP */
-
-#define USE_BACKGROUND_PIXEL 3
-#define USE_BORDER_PIXEL 3
-
-
-/* byte swap a long literal */
-#define lswapl(x) ((((x) & 0xff) << 24) |\
- (((x) & 0xff00) << 8) |\
- (((x) & 0xff0000) >> 8) |\
- (((x) >> 24) & 0xff))
-
-/* byte swap a short literal */
-#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
-
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-#ifndef abs
-#define abs(a) ((a) > 0 ? (a) : -(a))
-#endif
-#ifndef fabs
-#define fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
-#endif
-#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
-/* this assumes b > 0 */
-#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
-/*
- * return the least significant bit in x which is set
- *
- * This works on 1's complement and 2's complement machines.
- * If you care about the extra instruction on 2's complement
- * machines, change to ((x) & (-(x)))
- */
-#define lowbit(x) ((x) & (~(x) + 1))
-
-#define MAXSHORT 32767
-#define MINSHORT -MAXSHORT
-
-
-/* some macros to help swap requests, replies, and events */
-
-#define LengthRestB(stuff) \
- (((unsigned long)stuff->length << 2) - sizeof(*stuff))
-
-#define LengthRestS(stuff) \
- (((unsigned long)stuff->length << 1) - (sizeof(*stuff) >> 1))
-
-#define LengthRestL(stuff) \
- ((unsigned long)stuff->length - (sizeof(*stuff) >> 2))
-
-#define SwapRestS(stuff) \
- SwapShorts((short *)(stuff + 1), LengthRestS(stuff))
-
-#define SwapRestL(stuff) \
- SwapLongs((long *)(stuff + 1), LengthRestL(stuff))
-
-/* byte swap a long */
-#define swapl(x, n) n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[3];\
- ((char *) (x))[3] = n;\
- n = ((char *) (x))[1];\
- ((char *) (x))[1] = ((char *) (x))[2];\
- ((char *) (x))[2] = n;
-
-/* byte swap a short */
-#define swaps(x, n) n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[1];\
- ((char *) (x))[1] = n
-
-/* copy long from src to dst byteswapping on the way */
-#define cpswapl(src, dst) \
- ((char *)&(dst))[0] = ((char *) &(src))[3];\
- ((char *)&(dst))[1] = ((char *) &(src))[2];\
- ((char *)&(dst))[2] = ((char *) &(src))[1];\
- ((char *)&(dst))[3] = ((char *) &(src))[0];
-
-/* copy short from src to dst byteswapping on the way */
-#define cpswaps(src, dst)\
- ((char *) &(dst))[0] = ((char *) &(src))[1];\
- ((char *) &(dst))[1] = ((char *) &(src))[0];
-
-extern void SwapLongs();
-extern void SwapShorts();
-
-typedef struct _DDXPoint *DDXPointPtr;
-typedef struct _Box *BoxPtr;
-
-#endif /* MISC_H */
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: os.h /main/6 1996/05/28 15:33:04 ageorge $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-(c) Copyright 1995 FUJITSU LIMITED
-This is source code modified by FUJITSU LIMITED under the Joint
-Development Agreement for the CDEnext PST.
-This is unpublished proprietary source code of FUJITSU LIMITED
-
-******************************************************************/
-
-
-#ifndef OS_H
-#define OS_H
-#include "misc.h"
-
-#ifdef INCLUDE_ALLOCA_H
-#include <alloca.h>
-#endif
-
-#define NullFID ((FID) 0)
-
-#define SCREEN_SAVER_ON 0
-#define SCREEN_SAVER_OFF 1
-#define SCREEN_SAVER_FORCER 2
-
-#if defined(stellar)
-#define MAX_REQUEST_SIZE 65535
-#else
-#define MAX_REQUEST_SIZE 16384
-#endif
-
-typedef pointer FID;
-typedef struct _FontPathRec *FontPathPtr;
-typedef struct _NewClientRec *NewClientPtr;
-
-#ifndef NO_ALLOCA
-/*
- * os-dependent definition of local allocation and deallocation
- * If you want something other than Xalloc/Xfree for ALLOCATE/DEALLOCATE
- * LOCAL then you add that in here.
- */
-#if defined(__HIGHC__)
-
-extern char *alloca();
-
-#if HCVERSION < 21003
-#define ALLOCATE_LOCAL(size) alloca((int)(size))
-pragma on(alloca);
-#else /* HCVERSION >= 21003 */
-#define ALLOCATE_LOCAL(size) _Alloca((int)(size))
-#endif /* HCVERSION < 21003 */
-
-#define DEALLOCATE_LOCAL(ptr) /* as nothing */
-
-#endif /* defined(__HIGHC__) */
-
-
-#if defined(__GNUC__)
-#if !defined(__linux__)
-#ifdef alloca
-#undef alloca
-#endif
-#define alloca ___builtin_alloca
-#endif
-#define ALLOCATE_LOCAL(size) alloca((int)(size))
-#define DEALLOCATE_LOCAL(ptr) /* as nothing */
-#else /* ! __GNUC__ */
-/*
- * warning: mips alloca is unsuitable in the server, do not use.
- */
-#if defined(vax) || defined(sun) || defined(stellar)
-/*
- * Some System V boxes extract alloca.o from /lib/libPW.a; if you
- * decide that you don't want to use alloca, you might want to fix
- * ../os/4.2bsd/Imakefile
- */
-char *alloca();
-#define ALLOCATE_LOCAL(size) alloca((int)(size))
-#define DEALLOCATE_LOCAL(ptr) /* as nothing */
-#endif /* who does alloca */
-#endif /* __GNUC__ */
-
-#endif /* NO_ALLOCA */
-
-#ifndef ALLOCATE_LOCAL
-#define ALLOCATE_LOCAL(size) Xalloc((unsigned long)(size))
-#define DEALLOCATE_LOCAL(ptr) Xfree((pointer)(ptr))
-#endif /* ALLOCATE_LOCAL */
-
-
-#define xalloc(size) Xalloc((unsigned long)(size))
-#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size))
-#define xfree(ptr) Xfree((pointer)(ptr))
-
-int ReadRequestFromClient();
-#ifndef strcat
-char *strcat();
-#endif
-#ifndef strncat
-char *strncat();
-#endif
-#ifndef strcpy
-char *strcpy();
-#endif
-#ifndef strncpy
-char *strncpy();
-#endif
-Bool CloseDownConnection();
-FontPathPtr GetFontPath();
-FontPathPtr ExpandFontNamePattern();
-FID FiOpenForRead();
-void CreateWellKnownSockets();
-int SetDefaultFontPath();
-void FreeFontRecord();
-int SetFontPath();
-void ErrorF();
-void Error();
-void FatalError();
-void ProcessCommandLine();
-void Xfree();
-void FlushAllOutput();
-void FlushIfCriticalOutputPending();
-unsigned long *Xalloc();
-unsigned long *Xrealloc();
-long GetTimeInMillis();
-
-#endif /* OS_H */
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: pcf.h /main/2 1996/02/10 16:25:46 cde-fuj $ */
-/*
- *
- * Copyright 1990 Massachusetts Institute of Technology
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of M.I.T. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- (c) Copyright 1995 FUJITSU LIMITED
- This is source code modified by FUJITSU LIMITED under the Joint
- Development Agreement for the CDEnext PST.
- This is unpublished proprietary source code of FUJITSU LIMITED
- */
-
-#ifndef _PCF_H_
-#define _PCF_H_
-
-/*
- * Information used to read/write PCF fonts
- */
-
-typedef struct _PCFTable {
- CARD32 type;
- CARD32 format;
- CARD32 size;
- CARD32 offset;
-} PCFTableRec, *PCFTablePtr;
-
-#define PCF_FILE_VERSION (('p'<<24)|('c'<<16)|('f'<<8)|1)
-#define PCF_FORMAT_MASK 0xffffff00
-
-#define PCF_DEFAULT_FORMAT 0x00000000
-#define PCF_INKBOUNDS 0x00000200
-#define PCF_ACCEL_W_INKBOUNDS 0x00000100
-#define PCF_COMPRESSED_METRICS 0x00000100
-
-#define PCF_FORMAT_MATCH(a,b) (((a)&PCF_FORMAT_MASK) == ((b)&PCF_FORMAT_MASK))
-
-#define PCF_GLYPH_PAD_MASK (3<<0)
-#define PCF_BYTE_MASK (1<<2)
-#define PCF_BIT_MASK (1<<3)
-#define PCF_SCAN_UNIT_MASK (3<<4)
-
-#define PCF_BYTE_ORDER(f) (((f) & PCF_BYTE_MASK)?MSBFirst:LSBFirst)
-#define PCF_BIT_ORDER(f) (((f) & PCF_BIT_MASK)?MSBFirst:LSBFirst)
-#define PCF_GLYPH_PAD_INDEX(f) ((f) & PCF_GLYPH_PAD_MASK)
-#define PCF_GLYPH_PAD(f) (1<<PCF_GLYPH_PAD_INDEX(f))
-#define PCF_SCAN_UNIT_INDEX(f) (((f) & PCF_SCAN_UNIT_MASK) >> 4)
-#define PCF_SCAN_UNIT(f) (1<<PCF_SCAN_UNIT_INDEX(f))
-#define PCF_FORMAT_BITS(f) ((f) & (PCF_GLYPH_PAD_MASK|PCF_BYTE_MASK|PCF_BIT_MASK|PCF_SCAN_UNIT_MASK))
-
-#define PCF_SIZE_TO_INDEX(s) ((s) == 4 ? 2 : (s) == 2 ? 1 : 0)
-#define PCF_INDEX_TO_SIZE(b) (1<<b)
-
-#define PCF_FORMAT(bit,byte,glyph,scan) (\
- (PCF_SIZE_TO_INDEX(scan) << 4) | \
- (((bit) == MSBFirst ? 1 : 0) << 3) | \
- (((byte) == MSBFirst ? 1 : 0) << 2) | \
- (PCF_SIZE_TO_INDEX(glyph) << 0))
-
-#define PCF_PROPERTIES (1<<0)
-#define PCF_ACCELERATORS (1<<1)
-#define PCF_METRICS (1<<2)
-#define PCF_BITMAPS (1<<3)
-#define PCF_INK_METRICS (1<<4)
-#define PCF_BDF_ENCODINGS (1<<5)
-#define PCF_SWIDTHS (1<<6)
-#define PCF_GLYPH_NAMES (1<<7)
-#define PCF_BDF_ACCELERATORS (1<<8)
-
-#endif /* _PCF_H_ */
+++ /dev/null
-/*
- * CDE - Common Desktop Environment
- *
- * Copyright (c) 1993-2012, The Open Group. All rights reserved.
- *
- * These libraries and programs are free software; you can
- * redistribute them and/or modify them under the terms of the GNU
- * Lesser General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * These libraries and programs are distributed in the hope that
- * they will be useful, but WITHOUT ANY WARRANTY; without even the
- * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE. See the GNU Lesser General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with these libraries and programs; if not, write
- * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110-1301 USA
- */
-/* $XConsortium: servermd.h /main/2 1996/04/08 15:58:29 cde-fuj $ */
-/***********************************************************
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
-and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or MIT not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-(c) Copyright 1995 FUJITSU LIMITED
-This is source code modified by FUJITSU LIMITED under the Joint
-Development Agreement for the CDEnext PST.
-This is unpublished proprietary source code of FUJITSU LIMITED
-
-******************************************************************/
-#ifndef SERVERMD_H
-#define SERVERMD_H 1
-
-/*
- * The vendor string identifies the vendor responsible for the
- * server executable.
- */
-#ifndef VENDOR_STRING
-#define VENDOR_STRING "MIT X Consortium"
-#endif
-
-/*
- * The vendor release number identifies, for the purpose of submitting
- * traceable bug reports, the release number of software produced
- * by the vendor.
- */
-#ifndef VENDOR_RELEASE
-#define VENDOR_RELEASE 4
-#endif
-
-/*
- * Machine dependent values:
- * GLYPHPADBYTES should be chosen with consideration for the space-time
- * trade-off. Padding to 0 bytes means that there is no wasted space
- * in the font bitmaps (both on disk and in memory), but that access of
- * the bitmaps will cause odd-address memory references. Padding to
- * 2 bytes would ensure even address memory references and would
- * be suitable for a 68010-class machine, but at the expense of wasted
- * space in the font bitmaps. Padding to 4 bytes would be good
- * for real 32 bit machines, etc. Be sure that you tell the font
- * compiler what kind of padding you want because its defines are
- * kept separate from this. See server/include/font.h for how
- * GLYPHPADBYTES is used.
- *
- * Along with this, you should choose an appropriate value for
- * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h. This
- * constant choses what kind of memory references are guarenteed during
- * font access; either 1, 2 or 4, for byte, word or longword access,
- * respectively. For instance, if you have decided to to have
- * GLYPHPADBYTES == 4, then it is pointless for you to have a
- * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
- * guarenteed you that your fonts are longword aligned. On the other
- * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
- * also decide that the computing involved in aligning the pointer is more
- * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
- *
- * Next, choose the tuning parameters which are appropriate for your
- * hardware; these modify the behaviour of the raw frame buffer code
- * in ddx/mfb and ddx/cfb. Defining these incorrectly will not cause
- * the server to run incorrectly, but defining these correctly will
- * cause some noticeable speed improvements:
- *
- * AVOID_MEMORY_READ - (8-bit cfb only)
- * When stippling pixels on the screen (polytext and pushpixels),
- * don't read long words from the display and mask in the
- * appropriate values. Rather, perform multiple byte/short/long
- * writes as appropriate. This option uses many more instructions
- * but runs much faster when the destination is much slower than
- * the CPU and at least 1 level of write buffer is availible (2
- * is much better). Defined currently for SPARC and MIPS.
- *
- * FAST_CONSTANT_OFFSET_MODE - (cfb and mfb)
- * This define is used on machines which have no auto-increment
- * addressing mode, but do have an effectively free constant-offset
- * addressing mode. Currently defined for MIPS and SPARC, even though
- * I remember the cg6 as performing better without it (cg3 definitely
- * performs better with it).
- *
- * LARGE_INSTRUCTION_CACHE -
- * This define increases the number of times some loops are
- * unrolled. On 68020 machines (with 256 bytes of i-cache),
- * this define will slow execution down as instructions miss
- * the cache frequently. On machines with real i-caches, this
- * reduces loop overhead, causing a slight performance improvement.
- * Currently defined for MIPS and SPARC
- *
- * FAST_UNALIGNED_READS -
- * For machines with more memory bandwidth than CPU, this
- * define uses unaligned reads for 8-bit BitBLT instead of doing
- * aligned reads and combining the results with shifts and
- * logical-ors. Currently defined for 68020 and vax.
- * PLENTIFUL_REGISTERS -
- * For machines with > 20 registers. Currently used for
- * unrolling the text painting code a bit more. Currently
- * defined for MIPS.
- */
-
-#ifdef vax
-
-#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */
-#define BITMAP_BIT_ORDER LSBFirst
-#define GLYPHPADBYTES 1
-#define GETLEFTBITS_ALIGNMENT 4
-#define FAST_UNALIGNED_READS
-
-#endif /* vax */
-
-#ifdef sun
-
-#if defined(sun386) || defined(sun5)
-# define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */
-# define BITMAP_BIT_ORDER LSBFirst
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */
-# define BITMAP_BIT_ORDER MSBFirst
-#endif
-
-#ifdef sparc
-# define AVOID_MEMORY_READ
-# define LARGE_INSTRUCTION_CACHE
-# define FAST_CONSTANT_OFFSET_MODE
-#endif
-
-#ifdef mc68020
-#define FAST_UNALIGNED_READS
-#endif
-
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#endif /* sun */
-
-#if defined(ibm032) || defined (ibm)
-
-#ifdef i386
-# define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only*/
-#endif
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 1
-#define GETLEFTBITS_ALIGNMENT 4
-/* ibm pcc doesn't understand pragmas. */
-
-#endif /* ibm */
-
-#ifdef hpux
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the HP only */
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 2 /* to match product server */
-#define GETLEFTBITS_ALIGNMENT 1
-
-#endif /* hpux */
-
-#if defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for Pegasus only */
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 1
-
-#define FAST_UNALIGNED_READS
-
-#endif /* tektronix */
-
-#ifdef mips
-
-#ifdef MIPSEL
-# define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */
-# define BITMAP_BIT_ORDER LSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#else
-# define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */
-# define BITMAP_BIT_ORDER MSBFirst
-# define GLYPHPADBYTES 4
-# define GETLEFTBITS_ALIGNMENT 1
-#endif
-
-#define AVOID_MEMORY_READ
-#define FAST_CONSTANT_OFFSET_MODE
-#define LARGE_INSTRUCTION_CACHE
-#define PLENTIFUL_REGISTERS
-
-#endif /* mips */
-
-#ifdef stellar
-
-#define IMAGE_BYTE_ORDER MSBFirst /* Values for the stellar only*/
-#define BITMAP_BIT_ORDER MSBFirst
-#define GLYPHPADBYTES 4
-#define GETLEFTBITS_ALIGNMENT 4
-/*
- * Use SysV random number generator.
- */
-#define random rand
-
-#endif /* stellar */
-
-/* size of buffer to use with GetImage, measured in bytes. There's obviously
- * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
- * you) used and the number of times the ddx routine has to be called.
- *
- * for a 1024 x 864 bit monochrome screen with a 32 bit word we get
- * 8192/4 words per buffer
- * (1024/32) = 32 words per scanline
- * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer
- * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen
- */
-#if defined(stellar)
-#define IMAGE_BUFSIZE (64*1024)
-#else
-#define IMAGE_BUFSIZE 8192
-#endif
-
-/* pad scanline to a longword */
-#if defined(ibm) && defined(i386)
-#define BITMAP_SCANLINE_UNIT 8
-#else
-#define BITMAP_SCANLINE_UNIT 32
-#endif
-#define BITMAP_SCANLINE_PAD 32
-
-#define LOG2_BITMAP_PAD 5
-#define LOG2_BYTES_PER_SCANLINE_PAD 2
-
-/*
- * This returns the number of padding units, for depth d and width w.
- * For bitmaps this can be calculated with the macros above.
- * Other depths require either grovelling over the formats field of the
- * screenInfo or hardwired constants.
- */
-
-typedef struct _PaddingInfo {
- int padRoundUp; /* pixels per pad unit - 1 */
- int padPixelsLog2; /* log 2 (pixels per pad unit) */
- int padBytesLog2; /* log 2 (bytes per pad unit) */
-} PaddingInfo;
-extern PaddingInfo PixmapWidthPaddingInfo[];
-
-#define PixmapWidthInPadUnits(w, d) \
- (((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
- PixmapWidthPaddingInfo[d].padPixelsLog2)
-
-/*
- * Return the number of bytes to which a scanline of the given
- * depth and width will be padded.
- */
-#define PixmapBytePad(w, d) \
- (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
-
-#endif /* SERVERMD_H */
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
+#include <X11/Intrinsic.h>
#include "FaLib.h"
#include "falfont.h"
extern void set_errfile_str() ;
static CARD32
-getLSB32( p)
-unsigned char *p;
+getLSB32(unsigned char *p)
{
CARD32 c;
}
static int
-getINT32( p, format)
-unsigned char *p;
-CARD32 format;
+getINT32(unsigned char *p, CARD32 format)
{
CARD32 c;
}
static int
-getINT16( p, format)
-unsigned char *p;
-CARD32 format;
+getINT16(unsigned char *p, CARD32 format)
{
CARD32 c;
}
static Bool
-seekToType( tables, ntables, type, formatp, sizep, offsetp)
-PCFTablePtr tables;
-int ntables;
-CARD32 type;
-CARD32 *formatp;
-CARD32 *sizep;
-CARD32 *offsetp;
+seekToType(
+PCFTablePtr tables,
+int ntables,
+CARD32 type,
+CARD32 *formatp,
+CARD32 *sizep,
+CARD32 *offsetp)
{
int i;
static void
-getMetric( buf, format, metric)
-caddr_t buf;
-CARD32 format;
-xCharInfo *metric;
+getMetric(caddr_t buf, CARD32 format, xCharInfo *metric)
{
metric->leftSideBearing = getINT16( (unsigned char *)buf, (CARD32)format);
buf += 2;
}
static Bool
-getAccel( pFontInfo, maxink, buf_top, tables, ntables, type)
-FontInfoPtr pFontInfo;
-xCharInfo *maxink;
-caddr_t buf_top;
-PCFTablePtr tables;
-int ntables;
-CARD32 type;
+getAccel(
+FontInfoPtr pFontInfo,
+xCharInfo *maxink,
+caddr_t buf_top,
+PCFTablePtr tables,
+int ntables,
+CARD32 type)
{
CARD32 format;
CARD32 offset;
buffer +=4;
/* pFontInfo->maxOverlap = getINT32( (unsigned char *)buffer, (CARD32)format); */ buffer += 4;
- getMetric(buffer, format, &pFontInfo->minbounds.metrics);
+ getMetric(buffer, format, &pFontInfo->minbounds);
buffer += 12;
- getMetric(buffer, format, &pFontInfo->maxbounds.metrics);
+ getMetric(buffer, format, &pFontInfo->maxbounds);
buffer += 12;
if (PCF_FORMAT_MATCH(format, PCF_ACCEL_W_INKBOUNDS)) {
buffer += 12;
getMetric( buffer, format, maxink);
} else {
- *maxink = pFontInfo->maxbounds.metrics;
+ *maxink = pFontInfo->maxbounds;
}
return TRUE;
}
int
-falInitReadPcf( pcfinf, buftop)
-struct pcf_inf *pcfinf;
-caddr_t buftop;
+falInitReadPcf(struct pcf_inf *pcfinf, caddr_t buftop)
{
CARD32 format;
CARD32 offset;
caddr_t buffp;
if ( getLSB32( (unsigned char *)buftop ) != PCF_FILE_VERSION)
- goto Bail;
+ return -1;
pcfinf->ntables = getLSB32( (unsigned char *)(buftop + 4) );
(CARD32)PCF_BDF_ACCELERATORS))
if ( !getAccel( &pcfinf->info, &maxink, buftop, pcfinf->tables, pcfinf->ntables,
(CARD32)PCF_ACCELERATORS))
- goto Bail;
+ return -1;
- pcfinf->org_bounds = pcfinf->info.maxbounds.metrics;
+ pcfinf->org_bounds = pcfinf->info.maxbounds;
if ( !seekToType( pcfinf->tables, pcfinf->ntables, (CARD32)PCF_BITMAPS,
&format, (CARD32 *)NULL, &offset))
- goto Bail;
+ return -1;
buffp = buftop + offset;
format = getLSB32( (unsigned char *)buffp );
buffp += 4;
if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- goto Bail;
+ return -1;
pcfinf->nbitmaps = getINT32( (unsigned char *)buffp, (CARD32)format);
buffp += 4;
if ( !seekToType( pcfinf->tables, pcfinf->ntables, (CARD32)PCF_BDF_ENCODINGS,
&format, (CARD32 *)NULL, &offset))
- goto Bail;
+ return -1;
buffp = buftop + offset;
format = getLSB32( (unsigned char *)buffp );
buffp += 4;
if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT))
- goto Bail;
+ return -1;
pcfinf->info.firstCol = getINT16( (unsigned char *)buffp, (CARD32)format);
buffp += 2;
/*
pcfinf->info.defaultCh = getINT16( (unsigned char *)buffp, (CARD32)format); buffp += 2;
*/
- pcfinf->info.chDefault = getINT16( (unsigned char *)buffp, (CARD32)format);
+ pcfinf->info.defaultCh = getINT16( (unsigned char *)buffp, (CARD32)format);
buffp += 2;
pcfinf->info.allExist = FALSE;
pcfinf->encodingOffsets = (CARD16 *)buffp;
return 0;
-Bail:
- return -1;
}
static void
-ByteSwap( p, scan)
-char *p;
-int scan;
+ByteSwap(char *p, int scan)
{
char w;
}
}
static void
-repadBits( src, format, width, height, dest)
-char *src;
-CARD32 format;
-int width, height;
-char *dest;
+repadBits(char *src, CARD32 format, int width, int height, char *dest)
{
int bit, byte, glyph, scan;
int src_bytewidth, dest_bytewidth;
}
int
-falPcfGlyph( glyph, finf, code)
-char *glyph;
-Oak_FontInf *finf;
-int code;
+falPcfGlyph(char *glyph, Oak_FontInf *finf, int code)
{
- int encode;
- int inner_code;
- char *bitmap;
- int encodingOffset;
- int codeRow, codeCol;
- int bytewidth;
+ int encode;
+ int inner_code;
+ char *bitmap;
+ int encodingOffset;
+ int codeRow, codeCol;
+ int bytewidth;
int bmp_adj, ptn_adj;
int adj_hi;
int cpy_height;
bitmap = finf->pcfinf.bitmaps + getINT32( (unsigned char *)(finf->pcfinf.offsets + encodingOffset), finf->pcfinf.bmp_fmt);
- bmp_height = finf->pFinf->maxbounds.metrics.ascent
- + finf->pFinf->maxbounds.metrics.descent;
- if (( adj_hi = finf->pFinf->maxbounds.metrics.ascent
+ bmp_height = finf->pFinf->maxbounds.ascent
+ + finf->pFinf->maxbounds.descent;
+ if (( adj_hi = finf->pFinf->maxbounds.ascent
- finf->pcfinf.org_bounds.ascent) > 0) {
bytewidth = 8 * PCF_GLYPH_PAD( finf->pcfinf.bmp_fmt);
bytewidth = (( finf->width + bytewidth - 1)/ bytewidth ) * PCF_GLYPH_PAD( finf->pcfinf.bmp_fmt);
}
void
-falGetPcfGSize( pcfinf, widthp, heightp)
-struct pcf_inf *pcfinf;
-unsigned int *widthp, *heightp;
+falGetPcfGSize(
+struct pcf_inf *pcfinf,
+unsigned int *widthp,
+unsigned int *heightp)
{
unsigned int w, h;
*
*******************************************************/
-#include "fontstruct.h"
+#include <X11/fonts/fontstruct.h>
static char *getPcfFontProp();
static char *getSnfFontProp();
*/
int
-falReadFontProp( file, protect_key_data, databuff, islock )
-char *file ; /* name of font file */
-int protect_key_data ;
-FalFontData *databuff ;
-int islock ;
+falReadFontProp(
+char *file, /* name of font file */
+int protect_key_data,
+FalFontData *databuff,
+int islock)
{
Oak_FontInf finf;
int fd ;
* get properties of GPF format file
*/
int
-falReadGpfProp( updflg, finf, protect_key_data, databuff )
-int updflg ;
-Oak_FontInf *finf;
-int protect_key_data ;
-FalFontData *databuff ;
+falReadGpfProp(
+int updflg,
+Oak_FontInf *finf,
+int protect_key_data,
+FalFontData *databuff)
{
char *openfontfile;
int rtn ;
* get properties of PCF format file
*/
int
-falInitReadPcfProp( updflg, finf, databuff )
-int updflg ;
-Oak_FontInf *finf;
-FalFontData *databuff ;
+falInitReadPcfProp(int updflg, Oak_FontInf *finf, FalFontData *databuff)
{
struct pcf_inf *pcfinf;
caddr_t buftop;
if ( !getAccel( &pcfinf->info, &maxink, buftop, pcfinf->tables,
pcfinf->ntables, (CARD32)PCF_ACCELERATORS)) {
fal_utyerrno = FAL_ERR_FONT ;
- goto Bail;
+ return -1;
}
}
*/
if( updflg == FAL_UPDATE_FONTINFO ) {
- pcfinf->org_bounds = pcfinf->info.maxbounds.metrics;
+ pcfinf->org_bounds = pcfinf->info.maxbounds;
}
lb = pcfinf->org_bounds.leftSideBearing ;
pcfinf->ntables, "FONT" )) {
if( (databuff->xlfdname = (char *)strdup( buffp )) == (char *)NULL ){
fal_utyerrno = FAL_ERR_MALLOC ;
- goto Bail;
+ return -1;
}
}else{
set_errfile_str( fal_err_file, finf->fname ) ;
pcfinf->ntables, "FAMILY_NAME")) {
if( (databuff->style.name = (char *)strdup( buffp )) == NULL ){
fal_utyerrno = FAL_ERR_MALLOC ;
- goto Bail ;
+ return -1;
}
}else{
set_errfile_str( fal_err_file, finf->fname ) ;
}
return 0;
-Bail:
- return -1;
+
}
static char *
-getPcfFontProp( buftop, tables, ntables, propname)
-caddr_t buftop;
-PCFTablePtr tables;
-int ntables;
-char *propname;
+getPcfFontProp(caddr_t buftop, PCFTablePtr tables, int ntables, char *propname)
{
caddr_t buffer;
int name_ofs;
* get properties of SNF format file
*/
int
-falInitReadSnfProp( finf, buftop, databuff )
-Oak_FontInf *finf; /* pointer to the infomation structure */
-caddr_t buftop; /* font file */
-FalFontData *databuff ;
+falInitReadSnfProp(
+Oak_FontInf *finf, /* pointer to the infomation structure */
+caddr_t buftop, /* font file */
+FalFontData *databuff)
{
caddr_t stprop ;
int lb, rb, as, ds ;
/* initialize pointer */
- nprops = finf->pFinf->nProps ;
+ nprops = finf->pFinf->nprops ;
num_chars = ( finf->pFinf->lastRow - finf->pFinf->firstRow + 1 ) *
( finf->pFinf->lastCol - finf->pFinf->firstCol + 1 ) ;
- bitmapSize = BYTESOFGLYPHINFO(finf->pFinf) ;
stprop = buftop ;
stprop += sizeof(FontInfoRec) ;
stprop += num_chars * sizeof(CharInfoRec) ;
- stprop += bitmapSize ;
/*
* read property "FONTBOUNDINGBOX"
*/
- lb = finf->pFinf->maxbounds.metrics.leftSideBearing ;
- rb = finf->pFinf->maxbounds.metrics.rightSideBearing ;
- as = finf->pFinf->maxbounds.metrics.ascent ;
- ds = finf->pFinf->maxbounds.metrics.descent ;
+ lb = finf->pFinf->maxbounds.leftSideBearing ;
+ rb = finf->pFinf->maxbounds.rightSideBearing ;
+ as = finf->pFinf->maxbounds.ascent ;
+ ds = finf->pFinf->maxbounds.descent ;
/*
* read property "FONT"
if ( propptr = getSnfFontProp( stprop, nprops, "FONT" )) {
if( (fnt = (char *)strdup( propptr )) == NULL ){
fal_utyerrno = FAL_ERR_MALLOC ;
- goto Bail;
+ free(fnt);
+ return -1;
}
}else{
set_errfile_str( fal_err_file, finf->fname ) ;
if ( propptr = getSnfFontProp( stprop, nprops, "FAMILY_NAME")) {
if( (fam = (char *)strdup( propptr )) == NULL ){
fal_utyerrno = FAL_ERR_MALLOC ;
- goto Bail ;
+ free(fnt);
+ return -1;
}
}else{
set_errfile_str( fal_err_file, finf->fname ) ;
databuff->style.name = fam ;
return 0;
-Bail:
- free(fnt);
- return -1;
}
static char *
-getSnfFontProp( buftop, nprops, propname )
-caddr_t buftop;
-int nprops ;
-char *propname;
+getSnfFontProp(caddr_t buftop, int nprops, char *propname)
{
caddr_t buffer;
int name_ofs;
for ( i=0; i < nprops ; i++, ProcRec++ ) {
name_ofs = ProcRec->name ;
if( strcmp( propstr + name_ofs, propname ) == 0 ){
- if( ProcRec->indirect ){
- return( propstr + ProcRec->value ) ;
- }else{
return( (char *) (intptr_t) ProcRec->value ) ;
- }
}
}
#include "_falutil.h"
extern XrmQuark falrmStringToQuark(
-#if NeedFunctionPrototypes
- _Xconst char* /* string */
-#endif
+ const char* /* string */
);
extern XrmString falrmQuarkToString(
-#if NeedFunctionPrototypes
XrmQuark /* quark */
-#endif
);
extern char *falGetAtomName(
-#if NeedFunctionPrototypes
Display* /* display */,
Atom /* atom */
-#endif
);
extern char **falListFonts(
-#if NeedFunctionPrototypes
Display* /* display */,
- _Xconst char* /* pattern */,
+ const char* /* pattern */,
int /* maxnames */,
int* /* actual_count_return */
-#endif
);
extern char **falListFontsWithInfo(
-#if NeedFunctionPrototypes
Display* /* display */,
- _Xconst char* /* pattern */,
+ const char* /* pattern */,
int /* maxnames */,
int* /* count_return */,
XFontStruct** /* info_return */
-#endif
);
extern XFontStruct *falLoadQueryFont(
-#if NeedFunctionPrototypes
Display* /* display */,
- _Xconst char* /* name */
-#endif
+ const char* /* name */
);
+
#include "bdfgpf.h"
-static void ErrMsgTable_GetDefaultFile();
-static int falcom_split_data() ;
-static void dsp_font_list() ;
-static int search_Font_File_Name();
-
-extern int searchFontFileName();
-extern int falReadFontProp() ;
+static void ErrMsgTable_GetDefaultFile(char *com,
+ int ret,
+ int size,
+ char *style,
+ char *fname);
+static int falcom_split_data(char *buf,
+ int entry_num,
+ char *elm[]);
+static void dsp_font_list(FalFontDataList *flist);
+static int search_Font_File_Name(FalFontData data, char *fname);
+
+extern int searchFontFileName(FalFontData data, char *fullPathName);
+extern int falReadFontProp(char *file,
+ int protect_key_data,
+ FalFontData *databuff,
+ int islock);
/*
* get "character size" and "letter size" from a character of an interface
#define BODY_AND_LETTER 2
static int
-GetSize( size_str, body, letter )
-char *size_str; /* a character of a size */
-int *body; /* set "character size" (output) */
-int *letter; /* set "letter size" (output) */
+GetSize(
+char *size_str, /* a character of a size */
+int *body, /* set "character size" (output) */
+int *letter) /* set "letter size" (output) */
{
char *str_dot;
/* char *str_end; */
*/
int
-#if NeedFunctionPrototypes
falcom_atoi(
char *str, /* numerical character */
char ed_code,/* an end code in numerical character */
- int *val /* set numarical data */
-)
-#else
-falcom_atoi(str, ed_code, val)
-char *str; /* numerical character */
-char ed_code;/* an end code in numerical character */
-int *val; /* set numarical data */
-#endif
+ int *val) /* set numarical data */
{
char *ptr;
char *str_end;
static int
-falcom_cr_to_null(buf)
-char *buf;
+falcom_cr_to_null(char *buf)
{
buf = strchr( buf, '\n');
if (buf != NULL) {
int
-#if NeedFunctionPrototypes
GetDefaultFile(
- int size,
- char *style,
- char *fname
-)
-#else
-GetDefaultFile( size, style, fname )
-int size; /* character size */
-char *style; /* character style */
-char *fname; /* buffer */
-#endif
+ int size, /* character size */
+ char *style, /* character style */
+ char *fname) /* buffer */
{
FILE *fp;
int ret;
int
-#if NeedFunctionPrototypes
get_default_file(
FILE *fp,
- int size,
- char *style,
- char *fname
-)
-#else
-get_default_file( fp, size, style, fname )
-FILE *fp;
-int size; /* character size */
-char *style; /* character style */
-char *fname; /* buffer */
-#endif
+ int size, /* character size */
+ char *style, /* character style */
+ char *fname) /* buffer */
{
char buf[BUFSIZE]; /* buffer */
int size_tmp; /* size (read file) */
/**************************************************************/
static int
-falcom_split_data( buf, entry_num, elm )
-char *buf; /* read a font information character array from a file */
-int entry_num;
-char *elm[];
+falcom_split_data(
+char *buf, /* read a font information character array from a file */
+int entry_num,
+char *elm[])
{
int cnt; /* counter */
int strtop_flg; /* flag of a head of a character array */
char *
-#if NeedFunctionPrototypes
-falcom_get_base_name( char *str )
-#else
-falcom_get_base_name( str )
-char *str; /* a full path character of a file name */
-#endif
+falcom_get_base_name( char *str /* a full path character of a file name */ )
{
char *str_slash;
static int
-is_letter_size_not_only_one( lst )
-FalFontDataList *lst; /* a font list */
+is_letter_size_not_only_one( FalFontDataList *lst /* a font list */ )
{
int i, letter_cmp;
*
*/
int
-#if NeedFunctionPrototypes
GetFileName(
- char *com,
- char *size_str,
- char *style,
- int codeset,
- char *ofile
-)
-#else
-GetFileName(com, size_str, style, codeset, ofile)
-char *com; /* a character of a command name(case error) */
-char *size_str; /* a character of "size" */
-char *style; /* a character of "style" */
-int codeset; /* a codeset */
-char *ofile; /* set a target file name (output) */
-#endif
+ char *com, /* a character of a command name(case error) */
+ char *size_str, /* a character of "size" */
+ char *style, /* a character of "style" */
+ int codeset, /* a codeset */
+ char *ofile) /* set a target file name (output) */
{
int body, letter;
int size_sw; /* a size flag */
void
-#if NeedFunctionPrototypes
ErrMsgTable_FalGetFontList(
- char *com,
- int utyerr,
- int utyderr
-)
-#else
-ErrMsgTable_FalGetFontList( com, utyerr, utyderr )
-char *com; /* command name */
-int utyerr; /* fal_utyerror */
-int utyderr; /* fal_utyderror */
-#endif
+ char *com, /* command name */
+ int utyerr, /* fal_utyerror */
+ int utyderr) /* fal_utyderror */
{
char *fontsdir, *locale ;
}
}
-
-
/* take out an error message of "GetDefaultFile()" */
static void
-ErrMsgTable_GetDefaultFile( com, ret, size, style, fname )
-char *com; /* a command name */
-int ret; /* return code */
-int size; /* a character size */
-char *style; /* a character style */
-char *fname; /* user defined character information file name */
+ErrMsgTable_GetDefaultFile(
+char *com, /* a command name */
+int ret, /* return code */
+int size, /* a character size */
+char *style, /* a character style */
+char *fname) /* user defined character information file name */
{
switch (ret) {
case -1:
*/
void
-#if NeedFunctionPrototypes
fal_cut_tailslash( char *name )
-#else
-fal_cut_tailslash( name )
-char *name;
-#endif
{
char *p;
*/
char *
-#if NeedFunctionPrototypes
GetRealFileName( char *name )
-#else
-GetRealFileName( name )
-char *name;
-#endif
{
static char *ret_name ;
char link_name[BUFSIZE];
*/
int
-#if NeedFunctionPrototypes
IsInRegion(
int code ,
int num_gr ,
- FalGlyphRegion *gr
-)
-#else
-IsInRegion(code, num_gr, gr)
-int code ;
-int num_gr ;
-FalGlyphRegion *gr ;
-#endif
+ FalGlyphRegion *gr)
{
int i ;
if( code < MIN_CODE || code > MAX_CODE ) return -1 ;
static int
-search_Font_File_Name( data, fname )
-FalFontData data ;
-char *fname ;
+search_Font_File_Name( FalFontData data, char *fname )
{
FalFontID fid ;
FalFontDataList *flist ;
int
-#if NeedFunctionPrototypes
GetUdcFileName(
- char *com ,
- int code_no ,
- char *xlfdname ,
- char *fname
-)
-#else
-GetUdcFileName( com, code_no, xlfdname, fname )
-char *com ;
-int code_no ;
-char *xlfdname ;
-char *fname ;
-#endif
+ char *com,
+ int code_no,
+ char *xlfdname,
+ char *fname)
{
FalFontData data ;
static void
-dsp_font_list( flist )
-FalFontDataList *flist ;
+dsp_font_list( FalFontDataList *flist )
{
int i ;
int
-#if NeedFunctionPrototypes
GetUdcRegion(
- char *com ,
- int codeset ,
- char *gpf_file ,
- int *num_gr ,
- FalGlyphRegion **gr
-)
-#else
-GetUdcRegion( com, codeset, gpf_file, num_gr, gr )
-char *com ;
-int codeset ;
-char *gpf_file ;
-int *num_gr ;
-FalGlyphRegion **gr ;
-#endif
+ char *com,
+ int codeset,
+ char *gpf_file,
+ int *num_gr,
+ FalGlyphRegion **gr)
{
FalFontData fdata ;
char *locale, *char_set, *tmp_gpf ;
#define MAX_CODESET 8
int
-#if NeedFunctionPrototypes
DispUdcCpArea( FILE *fp )
-#else
-DispUdcCpArea( fp )
-FILE *fp ;
-#endif
{
int cd_set, j ;
FalFontDataList *fls ;
int
-#if NeedFunctionPrototypes
GetUdcFontName(
char *gpf_file ,
char *bdf_file ,
- char **fontname
-)
-#else
-GetUdcFontName( gpf_file, bdf_file, fontname )
-char *gpf_file ;
-char *bdf_file ;
-char **fontname ;
-#endif
+ char **fontname)
{
FILE *fp ;
pid_t chld_pid = 0;
*/
int
-#if NeedFunctionPrototypes
FileLock( int fd )
-#else
-FileLock( fd )
-int fd; /* a file descripter */
-#endif
{
struct flock flpar;
*/
int
-#if NeedFunctionPrototypes
FileUnLock( int fd )
-#else
-FileUnLock( fd )
-int fd; /* a file descripter */
-#endif
{
struct flock flpar;
*/
int
-#if NeedFunctionPrototypes
isLock( int fd )
-#else
-isLock( fd )
-int fd; /* file descripter */
-#endif
{
struct flock flpar;
#include "bdfgpf.h"
#include "udcutil.h"
-static void exline();
+static void exline(char *sp, char *dbuf, int sw, int dw);
char *oakgtobdf;
char *bdftosnf = BDFTOSNF;
#define READ_FAIL 5
int
-#if NeedFunctionPrototypes
-ReadBdfHeader(
- struct btophead *head,
- char *buf
-)
-#else
-ReadBdfHeader( head, buf )
-struct btophead *head;
-char *buf;
-#endif
+ReadBdfHeader(struct btophead *head, char *buf)
{
char *p;
unsigned int getstat = 0;
int
-#if NeedFunctionPrototypes
-ReadGpfHeader(
- struct ptobhead *head,
- char *buf
-)
-#else
-ReadGpfHeader(head, buf)
-struct ptobhead *head;
-char *buf;
-#endif
+ReadGpfHeader(struct ptobhead *head, char *buf)
{
char *p;
unsigned int getstat = 0;
int
-#if NeedFunctionPrototypes
WriteBdfHeader( struct ptobhead *head )
-#else
-WriteBdfHeader(head)
-struct ptobhead *head;
-#endif
{
FILE *fp;
int fd[2];
void
-#if NeedFunctionPrototypes
WriteGpfHeader( struct btophead *head )
-#else
-WriteGpfHeader(head)
-struct btophead *head;
-#endif
{
fprintf(head->output, "numfonts:%d\n", head->num_chars);
fprintf(head->output, "width:%d\n", head->p_width );
int
-#if NeedFunctionPrototypes
WritePtnToBdf( struct ptobhead *head )
-#else
-WritePtnToBdf(head)
-struct ptobhead *head;
-#endif
{
int msize, swidth, rtn, i, nchar;
char *zoomptn;
int
-#if NeedFunctionPrototypes
putDefaultChars( struct ptobhead *head )
-#else
-putDefaultChars(head )
-struct ptobhead *head;
-#endif
{
int swidth, bytew, i, j;
unsigned int posbit ;
int
-#if NeedFunctionPrototypes
WritePtnToGpf( struct btophead *head )
-#else
-WritePtnToGpf(head)
-struct btophead *head;
-#endif
{
int msize, rtn, i;
char *zoomptn;
int
-#if NeedFunctionPrototypes
-ReadBdfToMemory(
- struct btophead *head,
- char *buf
-)
-#else
-ReadBdfToMemory(head, buf)
-struct btophead *head;
-char *buf;
-#endif
+ReadBdfToMemory(struct btophead *head, char *buf)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;
int
-#if NeedFunctionPrototypes
ReadBdfToMemory_with_init(
struct btophead *head,
- int init_start,
- int init_end,
- char *buf
-)
-#else
-ReadBdfToMemory_with_init(head, init_start, init_end, buf)
-struct btophead *head;
-int init_start;
-int init_end;
-char *buf;
-#endif
+ int init_start,
+ int init_end,
+ char *buf)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;
int
-#if NeedFunctionPrototypes
GetBdfCode(
struct btophead *head,
char *buf,
int *code
)
-#else
-GetBdfCode(head, buf, code)
-struct btophead *head;
-char *buf;
-int *code;
-#endif
{
char *p;
return(0);
}
-
int
-#if NeedFunctionPrototypes
GetBdfPtn(
struct btophead *head,
char *buf,
char *ptn,
int mwidth,
- int bsize
-)
-#else
-GetBdfPtn(head, buf, ptn, mwidth, bsize)
-struct btophead *head;
-char *buf;
-char *ptn;
-int mwidth;
-int bsize;
-#endif
+ int bsize)
{
int skip, i, j;
char *p;
int
-#if NeedFunctionPrototypes
-ReadGpfToMemory(
- struct ptobhead *head,
- char *buf
-)
-#else
-ReadGpfToMemory(head, buf)
-struct ptobhead *head;
-char *buf;
-#endif
+ReadGpfToMemory(struct ptobhead *head, char *buf)
{
int code, mwidth, num_char, bsize, rtn;
char *ptn;
int
-#if NeedFunctionPrototypes
-GetGpfCode(
- struct ptobhead *head,
- char *buf,
- int *code
-)
-#else
-GetGpfCode(head, buf, code)
-struct ptobhead *head;
-char *buf;
-int *code;
-#endif
+GetGpfCode(struct ptobhead *head, char *buf, int *code)
{
char *p;
return(0);
}
-
int
-#if NeedFunctionPrototypes
GetGpfPtn(
struct ptobhead *head,
char *buf,
int mwidth,
int bsize
)
-#else
-GetGpfPtn(head, buf, ptn, mwidth, bsize)
-struct ptobhead *head;
-char *buf;
-char *ptn;
-int mwidth;
-int bsize;
-#endif
{
int skip, i, j;
char *p;
void
-#if NeedFunctionPrototypes
-GetBdfLinePtn(
- char *mem,
- char *buf,
- int width
-)
-#else
-GetBdfLinePtn(mem, buf, width)
-char *mem;
-char *buf;
-int width;
-#endif
+GetBdfLinePtn(char *mem, char *buf, int width)
{
int i, iend, len;
char *p, str[3];
}
void
-#if NeedFunctionPrototypes
-GetGpfLinePtn(
- char *mem,
- char *buf,
- int width
-)
-#else
-GetGpfLinePtn(mem, buf, width)
-char *mem;
-char *buf;
-int width;
-#endif
+GetGpfLinePtn(char *mem, char *buf, int width)
{
unsigned int skip, i, iend, j;
unsigned char ptn;
int
-#if NeedFunctionPrototypes
-PutBdfPtn(
- unsigned char *ptn,
- int width,
- int height,
- FILE *fp
-)
-#else
-PutBdfPtn(ptn, width, height, fp)
-unsigned char *ptn;
-int width;
-int height;
-FILE *fp;
-#endif
+PutBdfPtn(unsigned char *ptn, int width, int height, FILE *fp)
{
int i, j, nbyte ;
unsigned char *pbuf, x, c;
return(0);
}
-
-
-
int
-#if NeedFunctionPrototypes
-PutGpfPtn(
- char *ptn,
- int width,
- int height,
- FILE *fp
-)
-#else
-PutGpfPtn(ptn, width, height, fp)
-char *ptn;
-int width;
-int height;
-FILE *fp;
-#endif
+PutGpfPtn(char *ptn, int width, int height, FILE *fp)
{
int i, j, k, nbyte, tw;
unsigned char p, *pbuf;
int
-#if NeedFunctionPrototypes
-PtnZoom(
- char *dmem,
- char *smem,
- int sw,
- int sh,
- int dw,
- int dh
-)
-#else
-PtnZoom(dmem, smem, sw, sh, dw, dh)
-char *dmem;
-char *smem;
-int sw;
-int sh;
-int dw;
-int dh;
-#endif
+PtnZoom(char *dmem, char *smem, int sw, int sh, int dw, int dh)
{
int swidth;
int dwidth;
static void
-exline(sp, dbuf, sw, dw)
-char *sp;
-char *dbuf;
-int sw;
-int dw;
+exline(char *sp, char *dbuf, int sw, int dw)
{
unsigned int i, bit, sval, dval, dcnt, bcnt;
char *
-#if NeedFunctionPrototypes
GetTmpPath( char *path )
-#else
-GetTmpPath( path )
-char *path;
-#endif
{
char *p=NULL, *sp, *buf ;
int len ;
if( *sp == '/' ) *sp-- = '\0' ;
sprintf( sp+1, "/%s", TEMPFILEKEY ) ;
/* Get temporary file name */
- return mktemp( buf ) ;
+ return mkstemp( buf );
}
int
-#if NeedFunctionPrototypes
Link_NewFile( char *rd_file, char *wr_file )
-#else
-Link_NewFile( rd_file, wr_file )
-char *rd_file ;
-char *wr_file ;
-#endif
{
FILE *rfp, *wfp ;
int i, c ;
int
-#if NeedFunctionPrototypes
-ChkNumString( char *str )
-#else
-ChkNumString( str )
-char *str;
-#endif
+ChkNumString( char *str )
{
char *tmp;
int num;
void
-#if NeedFunctionPrototypes
ErrMsgTable_AndExit(
int er_no,
char *snf_in,
char *bdf_in,
char *prog_name
)
-#else
-ErrMsgTable_AndExit(er_no, snf_in, snf_out, gpf_in, gpf_out, bdf_in, prog_name)
-int er_no;
-char *snf_in;
-char *snf_out;
-char *gpf_in;
-char *gpf_out;
-char *bdf_in;
-char *prog_name ;
-#endif
{
int rtn = 0 ;
switch(er_no) {
void
-#if NeedFunctionPrototypes
-fatal_err_msg(
- int er_no,
- char *prog_name
-)
-#else
-fatal_err_msg( er_no, prog_name )
-int er_no;
-char *prog_name;
-#endif
+fatal_err_msg(int er_no, char *prog_name)
{
USAGE1("%s : The font file failed to be converted. ", prog_name);
switch( er_no ) {
#define CATCH_SIGNAL 10
void
-ChatchSig()
+ChatchSig(void)
{
sig_flg = 1;
}
void
-#if NeedFunctionPrototypes
Put_File_Create_Err_Msg(
int msg_level,
char *org_name,
char *save_name,
char *com
)
-#else
-Put_File_Create_Err_Msg( msg_level, org_name, tmp_name, save_name, com )
-int msg_level;
-char *org_name;
-char *tmp_name;
-char *save_name;
-char *com;
-#endif
{
switch( msg_level ) {
case GPF_BUCK_UP_FAIL:
}
int
-#if NeedFunctionPrototypes
Make_NewFefFile(
char *org_name,
char *tmp_name,
gid_t group,
char *com
)
-#else
-Make_NewFefFile( org_name, tmp_name, mode, owner, group, com )
-char *org_name;
-char *tmp_name;
-mode_t mode;
-uid_t owner;
-gid_t group;
-char *com;
-#endif
{
struct stat statbuf;
char *save_name = NULL;
int
-#if NeedFunctionPrototypes
-Unlink_Tmpfile(
- char *file,
- char *com
-)
-#else
-Unlink_Tmpfile( file, com )
-char *file;
-char *com;
-#endif
+Unlink_Tmpfile(char *file,char *com)
{
errno = 0;
if ( unlink( file ) != 0 ) {
int
-#if NeedFunctionPrototypes
-Chmod_File (
- char *fname,
- mode_t mode,
- char *com
-)
-#else
-Chmod_File ( fname, mode, com )
-char *fname;
-mode_t mode;
-char *com;
-#endif
+Chmod_File (char *fname, mode_t mode, char *com)
{
errno = 0;
if ( mode == 0 ) return( 0 ) ;
int
-#if NeedFunctionPrototypes
-Chown_File (
- char *fname,
- uid_t owner,
- gid_t group,
- char *com
-)
-#else
-Chown_File ( fname, owner, group, com )
-char *fname;
-uid_t owner;
-gid_t group;
-char *com;
-#endif
+Chown_File (char *fname, uid_t owner, gid_t group, char *com)
{
errno = 0;
if ( chown (fname, owner, group) != 0) {
int
-#if NeedFunctionPrototypes
-ChkPcfFontFile( char *filename )
-#else
-ChkPcfFontFile( filename )
-char *filename;
-#endif
+ChkPcfFontFile( char *filename )
{
char *suffix;
int
-#if NeedFunctionPrototypes
-ChkSnfFontFile( char *filename )
-#else
-ChkSnfFontFile( filename )
-char *filename;
-#endif
+ChkSnfFontFile( char *filename )
{
char *suffix;
char *
-#if NeedFunctionPrototypes
-get_cmd_path(
- char *path,
- char *cmd
-)
-#else
-get_cmd_path( path, cmd )
-char *path;
-char *cmd;
-#endif
+get_cmd_path(char *path, char *cmd)
{
char *cmd_path = NULL;
struct stat st;
}
int
-#if NeedFunctionPrototypes
-SetCmdPath(
- char *com ,
- char **path ,
- char *dflt_path ,
- char *cmd
-)
-#else
-SetCmdPath( com, path, dflt_path, cmd )
-char *com ;
-char **path ;
-char *dflt_path ;
-char *cmd ;
-#endif
+SetCmdPath(char *com, char **path, char *dflt_path, char *cmd)
{
struct stat statbuf ;
char *pbuf ;
#include "xoakufont.h"
#include "util.h"
-void CBeOblB_aEnd();
-void EHeStaT_list();
-void CBeScro();
-void EHeBulB_eMEv();
-void EHeBulB_eExp();
-void EHeBulB_dExp();
-static void EHStaT_disp();
+void CBeOblB_aEnd(Widget widget, caddr_t clientData, caddr_t callData);
+void EHeStaT_list(Widget widget, int select, XEvent *e);
+void CBeScro(Widget widget, caddr_t clientData, caddr_t callData);
+void EHeBulB_eMEv(Widget widget, caddr_t clientData, XEvent *e);
+void EHeBulB_eExp(Widget widget, caddr_t clientData, XEvent *e);
+void EHeBulB_dExp(Widget widget, caddr_t clientData);
+static void EHStaT_disp(Widget widget, int i);
extern Resource resource;
-extern int efctPtnNum();
-extern char *char_set();
+extern int efctPtnNum(void);
+extern char *char_set(char *str);
extern char *fullpath;
extern FalFontData fullFontData;
* contents : displays the "User Defined Charactrer editor" window
*/
-static Widget CreateEditPtn();
-void OpenCB();
-void MngPtnCB();
-void CpyPtnCB();
-void CBeRecB_color();
-void CBeRecB_obj();
-void CBeOblB_aAdd();
-void CBeOblB_rCmd();
-void CBeOblB_rCmdp();
-void CBeOblB_rCan();
+static Widget CreateEditPtn(Widget owner);
+void OpenCB(Widget w, XtPointer client_data, XtPointer call_data);
+void MngPtnCB(void);
+void CpyPtnCB(void);
+void CBeRecB_obj(Widget widget, int obj, XmToggleButtonCallbackStruct *call);
+void CBeOblB_aAdd(void);
+void CBeOblB_rCmd(Widget widget, int proc, caddr_t callData);
+void CBeOblB_rCmdp(Widget widget, int proc, caddr_t callData);
+void CBeOblB_rCan(Widget widget, caddr_t clientData, caddr_t callData);
/**
**/
static void
-XlfdCB()
+XlfdCB(void)
{
Widget dialog;
Arg args[5];
char mess[1024];
- int n;
+ int n = 0;
XmString cs, cs1, cs2;
sprintf(mess, "%s : %s", resource.file_name, fullpath);
cs = XmStringConcat(cs2, cs1);
XmStringFree(cs1);
XmStringFree(cs2);
- n = 0;
XtSetArg (args[n], XmNtitle, resource.l_xlfd_title); n++;
XtSetArg (args[n], XmNmessageString, cs); n++;
XtSetArg (args[n], XmNdialogStyle, XmDIALOG_MODELESS); n++;
}
static void
-CodeAreaCB()
+CodeAreaCB(void)
{
char mess[256];
char tmp[16];
}
void
-ListSetLabelStr(i, str)
-int i;
-String str;
+ListSetLabelStr(int i, String str)
{
SetLabelString( wgeStaT_list[i], str );
}
void
-ListSelectItem(i)
-int i;
+ListSelectItem(int i)
{
XtVaSetValues( wgeStaT_list[i],
XmNbackground, (XtArgVal) resource.foreground,
}
void
-ListUnselectItem(i)
-int i;
+ListUnselectItem(int i)
{
XtVaSetValues( wgeStaT_list[i],
XmNbackground, (XtArgVal) resource.background,
}
void
-ListSetGlyphImage( i )
-int i ;
+ListSetGlyphImage( int i )
{
int code ;
/*ARGSUSED*/
static void
-EHStaT_disp( widget, i )
-Widget widget;
-int i; /* widget that have some ivent */
+EHStaT_disp( Widget widget, int i /* widget that have some ivent */ )
{
ListSetGlyphImage( i );
}
static Exclusive DrawEX = EXCLUSIVE( draw_ex );
static void
-Unset()
+Unset(void)
{
XtSetSensitive(EditBTN.w[0], False);
XtSetSensitive(EditBTN.w[1], False);
}
void
-SelectSet()
+SelectSet(void)
{
XtSetSensitive(EditBTN.w[0], True);
XtSetSensitive(EditBTN.w[1], True);
}
void
-SelectUnset()
+SelectUnset(void)
{
XtSetSensitive(EditBTN.w[0], False);
XtSetSensitive(EditBTN.w[1], False);
}
void
-CopySet()
+CopySet(void)
{
XtSetSensitive(EditBTN.w[5], True);
}
void
-UndoSet()
+UndoSet(void)
{
XtSetSensitive(EditBTN.w[9], True);
}
void
-UndoUnset()
+UndoUnset(void)
{
XtSetSensitive(EditBTN.w[9], False);
}
**/
void
-PopupEditPtn(owner)
-Widget owner;
+PopupEditPtn(Widget owner)
{
if (! editPtnW){
editPtnW = CreateEditPtn(owner);
}
static Widget
-CreateEditPtn(owner)
-Widget owner;
+CreateEditPtn(Widget owner)
{
int slimax;
int i;
void
-SetCodeString(code)
-int code;
+SetCodeString(int code)
{
char str[8];
static void
-_create_editptn_after()
+_create_editptn_after(void)
{
int slctloc;
static char dashPtn[] = {1,1}; /* Editing pane's border pattern */
}
void
-UpdateMessage(str)
-String str;
+UpdateMessage(String str)
{
static Boolean nomsg = False;
FalFontData fullFontData;
-void PopupSelectXLFD() ;
-static Widget CreateSelectXLFD() ;
+void PopupSelectXLFD(Widget top) ;
+static Widget CreateSelectXLFD(Widget top) ;
-extern void xlfdPopupDialog() ;
-extern int GetListsOfItems() ;
+extern void xlfdPopupDialog(Widget w);
-extern void ReadCB();
+extern void ReadCB(Widget w, XtPointer client_data, XtPointer call_data);
Widget xlfdDialog;
***************************************************************/
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);
return(NULL);
}
-static void OpenWindowCB()
+static void OpenWindowCB(void)
{
char *str, *p;
XmStringTable st;
/*ARGSUSED*/
static void
-OpenCancelCB( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+OpenCancelCB(Widget widget, caddr_t clientData, caddr_t callData)
{
extern void ForcePopdownDialog();
if ( !editPtnW ){
* create selection window view
*/
void
-PopupSelectXLFD( top )
-Widget top ;
+PopupSelectXLFD(Widget top)
{
if( xlfdDialog == NULL ){
static void
-create_xlfd()
+create_xlfd(void)
{
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
FalFontData key;
}
static void
-udc_call(w)
-Widget w;
+udc_call(Widget w)
{
XmString label;
char *moji;
}
static void
-sty_call(w)
-Widget w;
+sty_call(Widget w)
{
XmString label;
char *moji;
}
static void
-wls_call(w)
-Widget w;
+wls_call(Widget w)
{
XmString label;
char *moji;
}
static void
-hls_call(w)
-Widget w;
+hls_call(Widget w)
{
XmString label;
char *moji;
}
static void
-button_set1()
+button_set1(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set2()
+button_set2(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set3()
+button_set3(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
static void
-button_set4()
+button_set4(void)
{
int i, j;
int mask = FAL_FONT_MASK_DEFINED | FAL_FONT_MASK_UNDEFINED;
}
void
-data_sort(data, count)
-int *data;
-int count;
+data_sort(int *data, int count)
{
int *p1, *p2, tmp, i;
static void
-font_init()
+font_init(void)
{
FalFontDataList *fontlist;
FalFontData *f;
static Widget
-CreateSelectXLFD( top )
-Widget top ;
+CreateSelectXLFD(Widget top)
{
int n;
#define XLFD_COLUMNS 38
#define KEY_COLUMNS 15
-#define PIXELSIZE 7
-
/*
* put data from resource database
*/
*/
-
-#define substance_source
-
#include <stdio.h>
+#include <stdlib.h>
#include <math.h>
#include <X11/Intrinsic.h>
#include "xoakufont.h"
#include "util.h"
-#ifndef NO_MESSAGE_CAT
-#ifdef __ultrix
-#define _CLIENT_CAT_NAME "dtudcfonted.cat"
-#else /* __ultrix */
#define _CLIENT_CAT_NAME "dtudcfonted"
-#endif /* __ultrix */
-#ifdef _NO_PROTO
-extern char *_DtGetMessage();
-#else /* _NO_PROTO */
-extern char *_DtGetMessage(
- char *filename,
- int set,
- int n,
- char *s );
-#endif /* _NO_PROTO */
+extern char *_DtGetMessage(char *filename, int set, int n, char *s);
#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, *ret;
tmp = _DtGetMessage(_CLIENT_CAT_NAME, set, number, string);
strcpy(ret, tmp);
return (ret);
}
-#else /* NO_MESSAGE_CAT */
-#define GETMESSAGE(set, number, string)\
- string
-#endif /* NO_MESSAGE_CAT */
/****************************************************************
* Widgets *
***************************************************************/
-/* Widget toplevel; */
+Widget toplevel;
static Widget dnPopW;
Widget wgeScro, editPopW;
static int select_x, select_y, select_w, select_h;
static int r1_x, r1_y, r2_x, r2_y, cut_w, cut_h;
-extern Widget xlfdDialog, cpyDialog ;
+extern Widget xlfdDialog, cpyDialog;
extern FalFontID font_id;
Pixmap arrow_pix=0;
-/*
- *
- */
+
static XtAppContext app; /* application context */
static int edpane_size=0;
-void CB_set_wait_msg();
-void set_wait_msg();
-
-static void OtherFontSelect();
-void drawDelCode();
-void drawDelPtn();
-static void xeg_init();
-
-
-static void dstrypaneEditPtn();
-void chgEdCode();
-void chgEdList();
-static void chgEdPtn();
-static void DrawRectEdPn();
-static void DrawBorderEdPn();
-static void DrawPointEdPn();
-static void DrawDpPn();
-static void DrawPointDpPn();
-static void musPoint();
-static void musLine();
-static void musCircle();
-static void musRect();
-static void musRegionProc();
-static void musPasteProc();
-static void rubLine();
-static void rubBand();
-static void rubCircle();
-static void resetEditMode();
-static void copyPatterns();
-extern String MngCodeTfValue();
-extern String CpySrcCodeTfValue();
-extern String CpyDestCodeTfValue();
-char *get_cmd_path() ;
+
+static void OtherFontSelect(void);
+void drawDelCode(int i);
+void drawDelPtn(int i);
+static void xeg_init(void);
+
+
+static void dstrypaneEditPtn(void);
+void chgEdCode(int code, char mode);
+void chgEdList(int statloc, int slctloc, char mode);
+static void chgEdPtn(int code);
+static void DrawRectEdPn(int x1, int y1, int x2, int y2);
+static void DrawBorderEdPn(int x1, int y1, int x2, int y2);
+static void DrawPointEdPn(int x, int y, int mode);
+static void DrawDpPn(void);
+static void DrawPointDpPn(int x, int y, int mode);
+static void musPoint(int evtype, int px, int py);
+static void musLine(int evtype, int px, int py);
+static void musCircle(int evtype, int px, int py);
+static void musRect(int proc, int evtype, int px, int py);
+static void musRegionProc(int proc, int evtype, int px, int py);
+static void musPasteProc(Widget w, XtPointer client_data, XEvent *event);
+static void rubLine(int x1, int y1, int x2, int y2);
+static void rubBand(int x1, int y1, int x2, int y2);
+static void rubCircle(int ox, int oy, int rx, int ry);
+static void resetEditMode(unsigned int flag);
+static void copyPatterns(FalFontData *fdata,
+ int s1_code,
+ int s2_code,
+ int d1_code,
+ int proc);
+extern String MngCodeTfValue(void);
+extern String CpySrcCodeTfValue(void);
+extern String CpyDestCodeTfValue(void);
+char *get_cmd_path(char *path, char *cmd);
extern FalFontData fullFontData;
extern FalFontData copyFontData;
-extern void PopupSelectXLFD();
-extern void UpdateMessage();
-extern void DispMngErrorMessage();
-extern void DispCpyErrorMessage();
-static int setRealDelArea();
+extern void PopupSelectXLFD(Widget top);
+extern void UpdateMessage(String str);
+extern void DispMngErrorMessage(String msg);
+extern void DispCpyErrorMessage(String msg);
+static int setRealDelArea(int *s_ncode,
+ int *e_ncode,
+ int *sq_start,
+ int *sq_end);
/****************************************************************
* parameters *
* callback routines *
***************************************************************/
-static void CancelCB();
+static void CancelCB(void);
static void
-ExitCB()
+ExitCB(void)
{
exit(0);
}
int
-efctPtnNum()
+efctPtnNum(void)
{
int no;
int sq;
}
void
-Error_message(widget, message)
-Widget widget;
-char *message;
+Error_message(Widget widget, char *message)
{
static NoticeButton is_lock[] = {
NBTNARGS( ExitCB, NULL, 'E', True, False ),
}
void
-Error_message2(widget, message)
-Widget widget;
-char *message;
+Error_message2(Widget widget, char *message)
{
static NoticeButton is_lock[] = {
NBTNARGS( CancelCB, NULL, 'C', True, True )
*/
/*ARGSUSED*/
static void
-CBmOblB_edit( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+CBmOblB_edit( Widget widget, caddr_t clientData, caddr_t callData )
{
int ptn_n;
int ptn_w;
if( xlfdDialog != NULL )
PopdownDialog(xlfdDialog);
- /* */
ptnGetInfo( &ptn_n, &ptn_w, &ptn_h );
for( i=0 ; i<ptn_n ; i++ ) {
code = noToCode( ptnSqToNo(i) );
-void CBeOblB_aAdd();
+void CBeOblB_aAdd(void);
static Boolean do_read = False;
static Boolean do_end = False;
-static void CancelCB() { }
+static void CancelCB(void) { }
-static void ContReadCB(w)
-Widget w;
+static void ContReadCB(Widget w)
{
FalCloseFont(font_id);
editPtnW = NULL;
PopupSelectXLFD(toplevel);
}
-static void SaveReadCB()
+static void SaveReadCB(void)
{
CBeOblB_aAdd();
do_read = True;
}
-static void ContEndCB()
+static void ContEndCB(void)
{
FalCloseFont(font_id);
exit(0);
}
-static void SaveEndCB()
+static void SaveEndCB(void)
{
CBeOblB_aAdd();
do_end = True;
/*ARGSUSED*/
static int
-QuitEditPtn( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+QuitEditPtn( Widget widget, caddr_t clientData, caddr_t callData )
{
resetEditMode( RES_MSG | RES_PROC | RES_SLCT | RES_RSV );
void
-OpenCB(w, client_data, call_data)
-Widget w;
-XtPointer client_data;
-XtPointer call_data;
+OpenCB(Widget w, XtPointer client_data, XtPointer call_data)
{
static NoticeButton is_save_read_btn1[] = {
NBTNARGS( SaveReadCB, NULL, 'S', True, False ),
void
-ReadCB(w, client_data, call_data)
-Widget w;
-XtPointer client_data;
-XtPointer call_data;
+ReadCB(Widget w, XtPointer client_data, XtPointer call_data)
{
if (fullFontData.xlfdname == NULL) {
return;
*/
static Boolean
-WPwriteSNF( restart )
-int restart;
+WPwriteSNF( int restart )
{
int rc, err;
char str[MG_MAXSIZE];
default:
sprintf(str, "%s", resource.me_write_snf);
}
- SetString( wgeStaT, str );
+ UpdateMessage( str );
return( TRUE );
case 0:
edg.flag = 0;
else
sprintf( str, "%s(%3d%%)", resource.mg_write_snf , rc-1000 );
- SetString( wgeStaT, str );
+ UpdateMessage( str );
XtAppAddWorkProc( app, (XtWorkProc)WPwriteSNF, (XtPointer)ON );
if( rc == 1101 ){
XSync( xl.display,0 );
*/
void
-CBeOblB_aAdd()
+CBeOblB_aAdd(void)
{
char str[MG_MAXSIZE];
resetEditMode( RES_MSG | RES_PROC | RES_SLCT | RES_RSV );
- SetString( wgeStaT, resource.mg_write_snf );
+ UpdateMessage( resource.mg_write_snf );
if( edg.code != 0 )
ptnAdd( edg.code, edg.ptn );
return;
}
else{
- SetString( wgeStaT, "" );
+ UpdateMessage( "" );
}
}
*/
static void
-OtherFontSelect()
+OtherFontSelect(void)
{
dstrypaneEditPtn();
xeg_init();
/*ARGSUSED*/
void
-CBeOblB_aEnd( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+CBeOblB_aEnd( Widget widget, caddr_t clientData, caddr_t callData )
{
static NoticeButton is_save_exit_btn[] = {
NBTNARGS( SaveEndCB, NULL, 'S', True, False ),
/*ARGSUSED*/
void
-CBeOblB_rCmd( widget, proc, callData )
-Widget widget;
-int proc;
-caddr_t callData;
+CBeOblB_rCmd( Widget widget, int proc, caddr_t callData )
{
extern void SelectUnset();
extern void UndoSet();
/*ARGSUSED*/
void
-CBeOblB_rCmdp( widget, proc, callData )
-Widget widget;
-int proc;
-caddr_t callData;
+CBeOblB_rCmdp( Widget widget, int proc, caddr_t callData )
{
extern Widget wgeBulB_edit;
extern void CopySet();
/*ARGSUSED*/
void
-CBeOblB_rCan( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+CBeOblB_rCan( Widget widget, caddr_t clientData, caddr_t callData )
{
extern void UndoUnset();
* contents : get a sequential number of the editor
*/
int
-RelToAbsSq( from, cnt)
-int from;
-int cnt;
+RelToAbsSq( int from, int cnt)
{
int i;
int no;
* contents : get a relative number of the system area
*/
int
-AbsSqToRel( from, to)
-int from;
-int to;
+AbsSqToRel( int from, int to)
{
int sq;
int cnt;
}
-
-
/*
* contents : be the character list selected
*/
/*ARGSUSED*/
void
-EHeStaT_list( widget, select, e )
-Widget widget;
-int select;
-XEvent *e; /* X Event */
+EHeStaT_list( Widget widget, int select, XEvent *e )
{
int sq, no;
int code;
if( edlist.slctloc == select )
return;
- /* */
sq = RelToAbsSq( edlist.sqstart + edlist.statloc, select);
if( (no = ptnSqToNo(sq)) == -1 )
/*ARGSUSED*/
void
-CBeScro( widget, clientData, callData )
-Widget widget;
-caddr_t clientData;
-caddr_t callData;
+CBeScro( Widget widget, caddr_t clientData, caddr_t callData )
{
int newl;
int new_statloc;
/*ARGSUSED*/
void
-EHeBulB_eMEv( widget, clientData, e )
-Widget widget;
-caddr_t clientData;
-XEvent *e; /* X Event */
+EHeBulB_eMEv( Widget widget, caddr_t clientData, XEvent *e )
{
int px, py;
int downbutton;
/*ARGSUSED*/
void
-EHeBulB_eExp( widget, clientData, e )
-Widget widget;
-caddr_t clientData;
-XEvent *e; /* X Event */
+EHeBulB_eExp( Widget widget, caddr_t clientData, XEvent *e )
{
int x1, y1;
int x2, y2;
/*ARGSUSED*/
void
-CBeRecB_obj( widget, obj, call)
-Widget widget;
-int obj;
-XmToggleButtonCallbackStruct *call;
+CBeRecB_obj( Widget widget, int obj, XmToggleButtonCallbackStruct *call)
{
extern void SelectUnset();
/*ARGSUSED*/
void
-EHeBulB_dExp( widget, clientData )
-Widget widget;
-caddr_t clientData;
+EHeBulB_dExp( Widget widget, caddr_t clientData )
{
if (xl.display == NULL ){
return;
*/
static int
-codeAreaSet(s_code,e_code)
-int *s_code;
-int *e_code;
+codeAreaSet(int *s_code, int *e_code)
{
char *str;
char delm;
***************************************************************/
Boolean
-BeforeMngCheck(s_code, e_code)
-int *s_code;
-int *e_code;
+BeforeMngCheck(int *s_code, int *e_code)
{
if(codeAreaSet(s_code, e_code) == -1) {
DispMngErrorMessage( resource.me_illegal_code );
}
void
-DoAddProc(s_code, e_code)
-int s_code;
-int e_code;
+DoAddProc(int s_code, int e_code)
{
int code;
resetEditMode( RES_MSG | RES_PROC | RES_SLCT | RES_RSV );
- /* */
s_ncode = codeToNo( s_code );
e_ncode = codeToNo( e_code );
mode = OFF;
continue;
if (ptnSense(code) == 0) {
if(ptnAdd(code, ptn) != 1) {
- SetString( wgeStaT, resource.me_non_memory );
+ UpdateMessage( resource.me_non_memory );
return;
}
edg.flag = ON;
}
}
- /* */
if( ptnSense( edg.code ) == 1 ) {
ptnAdd( edg.code, edg.ptn );
}
- /* */
+
if(mode == ON) {
chgEdCode( s_code, mode );
}
void
-DoDelProc( s_code, e_code )
-int s_code;
-int e_code;
+DoDelProc( int s_code, int e_code )
{
resetEditMode( RES_MSG | RES_PROC | RES_SLCT | RES_RSV );
static int
-setRealDelArea(s_ncode, e_ncode, sq_start, sq_end )
-int *s_ncode, *e_ncode;
-int *sq_start, *sq_end;
+setRealDelArea(int *s_ncode, int *e_ncode, int *sq_start, int *sq_end )
{
int ncode;
int flg;
****************************************************************/
static int
-CpySrcCodeCheck()
+CpySrcCodeCheck(void)
{
char *str;
char delm;
}
static int
-CpyDestCodeCheck()
+CpyDestCodeCheck(void)
{
char *str;
}
Boolean
-BeforeCpyCheck( proc )
-int proc;
+BeforeCpyCheck( int proc )
{
int s_ncode, e_ncode;
int r1_code, r2_code;
}
void
-DoCpyProc()
+DoCpyProc(void)
{
extern void PopdownCpyPtn();
/*ARGSUSED*/
static void
-xerror(d, ev)
-Display *d;
-register XErrorEvent *ev;
+xerror(Display *d, XErrorEvent *ev)
{
fprintf (stderr, "dtudcfonted: warning, error event receieved.\n");
exit(-1);
}
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
static char class_name[] = "Dtudcfonted";
int i;
/* initialize GUI */
- toplevel = (Widget)GuiInitialize(&app, class_name, &argc, argv);
+ toplevel = GuiInitialize(&app, class_name, &argc, argv);
/* get application's resources */
XtGetApplicationResources( toplevel, &resource,
*/
static void
-xeg_init()
+xeg_init(void)
{
int i;
*/
static void
-dstrypaneEditPtn()
+dstrypaneEditPtn(void)
{
int i ;
*/
void
-chgEdCode( code, mode )
-int code;
-char mode;
+chgEdCode( int code, char mode )
{
int ncode;
int esq;
*/
void
-chgEdList( statloc, slctloc, mode )
-int statloc;
-int slctloc;
-char mode;
+chgEdList( int statloc, int slctloc, char mode )
{
int sq;
int i;
*/
static void
-chgEdPtn( code )
-int code;
+chgEdPtn( int code )
{
extern void SetCodeString();
*/
static void
-DrawRectEdPn( x1, y1, x2, y2 )
-int x1;
-int y1;
-int x2;
-int y2;
+DrawRectEdPn( int x1, int y1, int x2, int y2 )
{
int i, j, wk;
short cx1, cy1, cx2, cy2;
if( bitRead( edg.ptn, i, j ) != 0 ) {
recOn[nron].x = cx1;
recOn[nron].y = cy1;
- recOn[nron].width = (USHORT)(cx2 - cx1);
- recOn[nron].height = (USHORT)(cy2 - cy1);
+ recOn[nron].width = (unsigned short)(cx2 - cx1);
+ recOn[nron].height = (unsigned short)(cy2 - cy1);
nron++;
}
else {
recOff[nroff].x = cx1;
recOff[nroff].y = cy1;
- recOff[nroff].width = (USHORT)(cx2 - cx1);
- recOff[nroff].height = (USHORT)(cy2 - cy1);
+ recOff[nroff].width = (unsigned short)(cx2 - cx1);
+ recOff[nroff].height = (unsigned short)(cy2 - cy1);
nroff++;
}
}
*/
static void
-DrawBorderEdPn( x1, y1, x2, y2 )
-int x1;
-int y1;
-int x2;
-int y2;
+DrawBorderEdPn( int x1, int y1, int x2, int y2 )
{
short cx1, cy1;
short cx2, cy2;
*/
static void
-DrawPointEdPn( x, y, mode )
-int x;
-int y;
-int mode;
+DrawPointEdPn( int x, int y, int mode )
{
int x1, y1;
int x2, y2;
*/
static void
-DrawDpPn()
+DrawDpPn(void)
{
if (xl.display == NULL ){
return;
*/
static void
-DrawPointDpPn( x, y, mode )
-int x;
-int y;
-int mode;
+DrawPointDpPn( int x, int y, int mode )
{
if (xl.display == NULL ){
*/
static void
-musPoint( evtype, px, py )
-int evtype;
-int px;
-int py;
+musPoint( int evtype, int px, int py )
{
switch( evtype ) {
case MotionNotify:
*/
static void
-musLine( evtype, px, py )
-int evtype;
-int px;
-int py;
+musLine( int evtype, int px, int py )
{
int r1_x, r1_y;
int r2_x, r2_y;
*/
static void
-musCircle( evtype, px, py )
-int evtype;
-int px;
-int py;
+musCircle( int evtype, int px, int py )
{
int r1_x, r1_y;
int r2_x, r2_y;
*/
static void
-musRect( proc, evtype, px, py )
-int proc;
-int evtype;
-int px;
-int py;
+musRect( int proc, int evtype, int px, int py )
{
int r1_x, r1_y;
int r2_x, r2_y;
*/
static void
-musRegionProc( proc, evtype, px, py )
-int proc;
-int evtype;
-int px;
-int py;
+musRegionProc( int proc, int evtype, int px, int py )
{
int rx, ry;
int dpx, dpy, dp;
/*ARGSUSED*/
static void
-musPasteProc(w, client_data, event)
-Widget w;
-XtPointer client_data;
-XEvent *event;
+musPasteProc(Widget w, XtPointer client_data, XEvent *event)
{
static int ox=0, oy=0;
int rc, tx, ty;
DrawDpPn();
UndoSet();
break;
- defaults:
- break;
}
}
static void
-rubLine( x1, y1, x2, y2 )
-int x1;
-int y1;
-int x2;
-int y2;
+rubLine( int x1, int y1, int x2, int y2 )
{
if( x1==x2 && y1==y2 ) return;
static void
-rubBand( x1, y1, x2, y2 )
-int x1;
-int y1;
-int x2;
-int y2;
+rubBand( int x1, int y1, int x2, int y2 )
{
if( x1==x2 && y1==y2 )
return;
static void
-rubCircle( ox, oy, rx, ry )
-int ox;
-int oy;
-int rx;
-int ry;
+rubCircle( int ox, int oy, int rx, int ry )
{
unsigned int r;
int x, y;
static void
-resetEditMode( flag )
-UINT flag;
+resetEditMode( unsigned int flag )
{
int r1_x, r1_y;
int r2_x, r2_y;
if( flag & RES_MSG )
- SetString( wgeStaT, "" );
+ UpdateMessage( "" );
if( flag & RES_PROC )
em.proc = edpane.obj;
/*ARGSUSED*/
static void
-copyPatterns( fdata, s1_code, s2_code, d1_code, proc )
-FalFontData *fdata;
-int s1_code;
-int s2_code;
-int d1_code;
-int proc;
+copyPatterns(
+ FalFontData *fdata,
+ int s1_code,
+ int s2_code,
+ int d1_code,
+ int proc)
{
int ret;
int d1_ncode, d2_ncode;
edg.flag = ON;
} else {
if( ptnAdd( code_d, ptn[i_s] ) != 1 ) {
- SetString( wgeStaT, resource.me_non_memory );
+ UpdateMessage( resource.me_non_memory );
break;
}
edlist.nptn++;
chgEdCode( code_disp, ON );
- resetEditMode( (UINT) (RES_MSG | RES_PROC | RES_SLCT | RES_RSV) );
+ resetEditMode( (unsigned int) (RES_MSG | RES_PROC | RES_SLCT | RES_RSV) );
}
#include "FaLib.h"
extern Widget toplevel;
-static void _destroy();
-void _unmap();
+static void _destroy(Widget w);
+void _unmap(void);
extern Resource resource ;
/*ARGSUSED*/
Widget
-CreateCaptionFrame(owner, name, labelstr, type, thickness)
-Widget owner;
-String name;
-String labelstr;
-int type;
-int thickness;
+CreateCaptionFrame(
+Widget owner,
+String name,
+String labelstr,
+int type,
+int thickness)
{
Widget top, label, frame;
Arg args[20];
- int n;
+ int n = 0;
XmString xmstr;
- n = 0;
top = XmCreateForm(owner, "form", args, n);
if (labelstr && *labelstr){
xmstr = XmStringCreateLocalized(labelstr);
*/
Widget
-CreatePixButton(owner, name, data)
-Widget owner;
-String name;
-RadioButt *data;
+CreatePixButton(
+Widget owner,
+String name,
+RadioButt *data)
{
Arg args[20];
- int i, n;
+ int i, n = 0;
Pixmap mask;
XpmAttributes attr;
Pixmap pix[NUMPIX];
Widget top;
Display *disp;
- Window root;
+ Window root = DefaultRootWindow(disp);
disp = XtDisplay(owner);
- root = DefaultRootWindow(disp);
- n = 0;
XtSetArg(args[n], XmNborderWidth, 1); n++;
XtSetArg(args[n], XmNradioAlwaysOne, TRUE); n++;
XtSetArg(args[n], XmNradioBehavior, TRUE); n++;
#else
XtPointer
#endif
-GetTextFieldValue(textf)
-TextField *textf;
+GetTextFieldValue(TextField *textf)
{
char *s1, *s2, *s3;
if (textf->w2 == NULL) {
/*ARGSUSED*/
static void
-arrow_change(w, data)
-TextField *data;
+arrow_change(int w, TextField *data)
{
if (XtIsSensitive(data->w2)) {
XtSetSensitive(data->w2, False);
extern FalFontData fullFontData;
static void
-focus(w)
-Widget w;
+focus(Widget w)
{
focus_widget = w;
}
static void
-code_input()
+code_input(void)
{
extern void CodeWindow();
CodeWindow(focus_widget, fullFontData.xlfdname, False);
/*ARGSUSED*/
void
-CreateTextField(owner, name, labelstr, data, maxlength)
-Widget owner;
-String name;
-String labelstr;
-TextField *data;
-int maxlength;
+CreateTextField(
+Widget owner,
+String name,
+String labelstr,
+TextField *data,
+int maxlength)
{
Widget row, label, arrow, textfield, code;
Arg args[20];
- register int n;
+ int n = 0;
Display *disp;
Window root;
Pixmap mask;
XmString xms;
extern Pixmap arrow_pix;
- n = 0;
XtSetArg(args[n], XmNorientation, (XtArgVal)XmHORIZONTAL); n++;
row = XmCreateRowColumn(owner, "row", args, n);
XtManageChild(row);
void
-#if __STDC__
CreateMenuButtons( Widget owner, Button *buttons, int buttons_cnt )
-#else
-CreateMenuButtons( owner, buttons, buttons_cnt )
-Widget owner;
-Button *buttons;
-int buttons_cnt;
-#endif
{
Arg args[4];
char buf[64];
}
static Atom
-DeleteWindowAtom()
+DeleteWindowAtom(void)
{
static Atom delatom = 0;
if (! delatom){
/*ARGSUSED*/
Widget
-#if __STDC__
-CreateDialogAndButtons( Widget owner, String name,
- void (*delcb)(), Button *btns, int btns_cnt, Widget *pop )
-#else
-CreateDialogAndButtons( owner, name, delcb, btns, btns_cnt, pop )
-Widget owner;
-String name;
-void (*delcb)();
-Button *btns;
-int btns_cnt;
-Widget *pop;
-#endif
+CreateDialogAndButtons(
+Widget owner,
+String name,
+void (*delcb)(),
+Button *btns,
+int btns_cnt,
+Widget *pop)
{
- int n;
+ int n = 0;
Arg args[32];
Arg arg[8];
Widget rowcol;
XmString cs1, cs2, cs3;
- n = 0;
XtSetArg( args[n], XmNautoUnmanage, resource. dia_tm_automng ); n++;
XtSetArg( args[n], XmNmarginWidth, resource.dia_tm_width ); n++;
XtSetArg( args[n], XmNmarginHeight, resource.dia_tm_height ); n++;
/* Initialize GUI */
Widget
-GuiInitialize(app, class_name, ac, av)
-XtAppContext *app;
-String class_name;
-int *ac;
-String av[];
+GuiInitialize(XtAppContext *app, String class_name, int *ac, String av[])
{
Widget top;
}
Widget
-CreateDrawingArea( owner, name, width, height, proc, val )
-Widget owner;
-String name;
-int width;
-int height;
-void (*proc)();
-int val;
+CreateDrawingArea(
+Widget owner,
+String name,
+int width,
+int height,
+void (*proc)(),
+int val)
{
- int n;
+ int n = 0;
Arg arg[16];
Widget drawarea;
- n = 0;
XtSetArg(arg[n], XmNwidth, width); n++;
XtSetArg(arg[n], XmNheight, height); n++;
XtSetArg(arg[n], XmNresizePolicy, XmRESIZE_NONE); n++;
#ifndef USE_MACRO
void
-AddLeftAttachWidget( w, ref, offset )
-Widget w;
-Widget ref;
-int offset;
+AddLeftAttachWidget( Widget w, Widget ref, int offset)
{
XtVaSetValues( w,
XmNleftAttachment, XmATTACH_WIDGET,
}
void
-AddLeftAttachForm( w, offset )
-Widget w;
-int offset;
+AddLeftAttachForm( Widget w, int offset )
{
XtVaSetValues( w,
XmNleftAttachment, XmATTACH_FORM,
}
void
-AddTopAttachWidget( w, ref, offset )
-Widget w;
-Widget ref;
-int offset;
+AddTopAttachWidget( Widget w, Widget ref, int offset )
{
XtVaSetValues( w,
XmNtopAttachment, XmATTACH_WIDGET,
}
void
-AddTopAttachForm( w, offset )
-Widget w;
-int offset;
+AddTopAttachForm( Widget w, int offset )
{
XtVaSetValues( w,
XmNtopAttachment, XmATTACH_FORM,
}
void
-AddRightAttachWidget( w, ref, offset )
-Widget w;
-Widget ref;
-int offset;
+AddRightAttachWidget( Widget w, Widget ref, int offset )
{
XtVaSetValues( w,
XmNrightAttachment, XmATTACH_WIDGET,
}
void
-AddRightAttachForm( w, offset )
-Widget w;
-int offset;
+AddRightAttachForm( Widget w, int offset )
{
XtVaSetValues( w,
XmNrightAttachment, XmATTACH_FORM,
}
void
-AddBottomAttachForm( w, offset )
-Widget w;
-int offset;
+AddBottomAttachForm( Widget w, int offset )
{
XtVaSetValues( w,
XmNbottomAttachment, XmATTACH_FORM,
#endif /* not USE_MACRO */
void
-PopupDialog(w)
-Widget w;
+PopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);
}
void
-PopdownDialog(w)
-Widget w;
+PopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(w);
}
void
-ForcePopdownDialog(w)
-Widget w;
+ForcePopdownDialog(Widget w)
{
if (XtIsManaged(w)){
XtUnmanageChild(w);
}
void
-SetLabelString(w, str)
-Widget w;
-String str;
+SetLabelString(Widget w, String str)
{
- XmString cs;
- cs = XmStringCreateLocalized(str);
+ XmString cs = XmStringCreateLocalized(str);
XtVaSetValues( w, XmNlabelString, cs, NULL);
XmStringFree( cs );
}
void
-SetFooterString(w, str)
-Widget w;
-String str;
+SetFooterString(Widget w, String str)
{
- XmString cs;
- cs = XmStringCreateLocalized(str);
+ XmString cs = XmStringCreateLocalized(str);
XtVaSetValues( w, XmNlabelString, cs, NULL);
XmStringFree( cs );
XmUpdateDisplay(w);
static Widget notice=NULL;
static void
-format_str(st, charcnt , str)
-Widget st;
-int charcnt ;
-char *str;
+format_str(Widget st, int charcnt , char *str)
{
int i ;
char *s, *p;
XmStringFree(cs);
}
-void _unmap()
+void _unmap(void)
{
if (notice && XtIsManaged(notice)){
XtUnmanageChild(notice);
}
}
-static void _destroy(w)
-Widget w;
+static void _destroy(Widget w)
{
if (w){
XtDestroyWidget(w);
/*ARGSUSED*/
void
-PopupNotice( owner, message, type, button, do_format, title )
-Widget owner;
-char *message;
-unsigned char type;
-NButton *button;
-Boolean do_format;
-String title;
+PopupNotice(
+Widget owner,
+char *message,
+unsigned char type,
+NButton *button,
+Boolean do_format,
+String title)
{
Widget label, help, cancel;
- int n;
+ int n = 0;
Arg args[32];
XmString cs1, cs2, cs3;
- n = 0;
XtSetArg(args[n], XmNtitle, title ); n++;
XtSetArg(args[n], XmNnoResize, resource.pop_resize ); n++;
XtSetArg(args[n], XmNminimizeButtons, resource.pop_minimize ); n++;
/*ARGSUSED*/
static void
-_layout_centerEH(w, clientdata)
-Widget w;
-XtPointer clientdata;
+_layout_centerEH(Widget w, XtPointer clientdata)
{
Widget *child;
int num;
/*ARGSUSED*/
Widget
-CreateTemplateDialog( w, message, type, button, title, pop )
-Widget w;
-char *message;
-unsigned char type;
-NButton *button;
-String title;
-Widget *pop;
+CreateTemplateDialog(
+Widget w,
+char *message,
+unsigned char type,
+NButton *button,
+String title,
+Widget *pop)
{
- int n;
+ int n = 0;
Arg args[32];
XmString cs, cs1=NULL, cs2=NULL, cs3=NULL;
Widget brtnb;
- n = 0;
cs = XmStringCreateLocalized(message);
XtSetArg(args[n], XmNnoResize, resource.temp_resize ); n++;
XtSetArg(args[n], XmNminimizeButtons, resource.temp_minimize ); n++;
void
-AddDeleteProc(w, delcb)
-Widget w;
-void (*delcb)();
+AddDeleteProc(Widget w, void (*delcb)())
{
Atom del = DeleteWindowAtom();
XmAddWMProtocols( w, &del, 1);
}
void
-AddPopupProc(w, popupcb)
-Widget w;
-void (*popupcb)();
+AddPopupProc(Widget w, void (*popupcb)())
{
XtAddCallback(XtParent(w), XmNpopupCallback, popupcb, 0);
}
void
-AddDestroyProc(w, destroycb)
-Widget w;
-void (*destroycb)();
+AddDestroyProc(Widget w, void (*destroycb)())
{
XtAddCallback(XtParent(w), XmNdestroyCallback, destroycb, 0);
}
Widget
-CreateMenuBarAndFooterMessageForm(owner, name, buttons, bcnt, pop, footer)
-Widget owner;
-String name;
-MButton *buttons;
-int bcnt;
-Widget *pop;
-Widget *footer;
+CreateMenuBarAndFooterMessageForm(
+Widget owner,
+String name,
+MButton *buttons,
+int bcnt,
+Widget *pop,
+Widget *footer)
{
Widget menuBar, form;
Widget footerFrame, footerForm, footerLabel, sep, casBtn, baseForm;
XmString cs;
char buf[64];
Arg arg[20];
- int n, i;
+ int i, n = 0;
- n = 0;
XtSetArg( arg[n], XmNiconName, name ); n++;
XtSetArg( arg[n], XmNdeleteResponse, XmUNMAP ); n++;
XtSetArg( arg[n], XmNmwmFunctions,
}
Widget
-GetMenuWidget( buttons, buttons_num )
-MButton *buttons;
-int buttons_num;
+GetMenuWidget( MButton *buttons, int buttons_num )
{
return(buttons->items[buttons_num].menu);
}
Widget
-CreateForm( owner, name )
-Widget owner;
-String name;
+CreateForm( Widget owner, String name )
{
Widget form;
- int n;
+ int n = 0;
Arg arg[8];
- n=0;
form = XmCreateForm( owner, name, arg, n );
XtManageChild(form);
return(form);
/*ARGSUSED*/
Widget
-CreateLabel( owner, name, str )
-Widget owner;
-String name;
-String str;
+CreateLabel( Widget owner, String name, String str )
{
Widget label;
Arg arg[2];
- int n=0;
+ int n = 0;
XmString cs = XmStringCreateLocalized(str);
XtSetArg( arg[n], XmNlabelString, cs); n++;
label = XmCreateLabel( owner, "label", arg, n);
/*ARGSUSED*/
Widget
-CreateFrame(owner, name, type, thickness)
-Widget owner;
-String name;
-XtPointer type;
-XtPointer thickness;
+CreateFrame(Widget owner, String name, XtPointer type, XtPointer thickness)
{
Widget frame;
Arg args[20];
- int n;
-
- n = 0;
+ int n = 0;
XtSetArg(args[n], XmNresizable, resource.frame_resize ); n++;
XtSetArg(args[n], XmNshadowType, type); n++;
XtSetArg(args[n], XmNshadowThickness , thickness); n++;
/*ARGSUSED*/
Widget
-CreateRowColumn(owner, name, layout, space, marginw, marginh)
-Widget owner;
-String name;
-int layout;
-int space;
-int marginw;
-int marginh;
+CreateRowColumn(
+Widget owner,
+String name,
+int layout,
+int space,
+int marginw,
+int marginh)
{
Widget rc;
Arg args[20];
- int n;
-
- n = 0;
+ int n = 0;
XtSetArg(args[n], XmNorientation, layout); n++;
XtSetArg(args[n], XmNspacing, space); n++;
XtSetArg(args[n], XmNmarginWidth, marginw); n++;
/*ARGSUSED*/
Widget
-CreateScrollBar( owner, name, height, val, min, max, proc )
-Widget owner;
-String name;
-int height;
-int val;
-int min;
-int max;
-void (*proc)();
+CreateScrollBar(
+Widget owner,
+String name,
+int height,
+int val,
+int min,
+int max,
+void (*proc)())
{
Widget sc;
- int n;
+ int n = 0;
Arg arg[16];
- n = 0;
XtSetArg( arg[n], XmNsliderSize, (XtArgVal)val ); n++;
XtSetArg( arg[n], XmNpageIncrement, (XtArgVal)val ); n++;
XtSetArg( arg[n], XmNmaximum, (XtArgVal)max ); n++;
/*ARGSUSED*/
static void
-_scbase_cb( w, proc, calldata )
-Widget w;
-void (*proc)();
-XmScrollBarCallbackStruct *calldata;
+_scbase_cb( Widget w, void (*proc)(), XmScrollBarCallbackStruct *calldata )
{
(*proc)(calldata->value);
}
Widget
-CreateScrollBase( owner, name, min, max, val, vcnt, sbproc )
-Widget owner;
-String name;
-int min;
-int max;
-int val;
-int vcnt;
-void (*sbproc)();
+CreateScrollBase(
+Widget owner,
+String name,
+int min,
+int max,
+int val,
+int vcnt,
+void (*sbproc)())
{
- int n;
+ int n = 0;
Arg arg[16];
Widget base, frame, rwclm, sc;
- n=0;
XtSetArg( arg[n], XmNwidth, resource.scll_fr_width ); n++;
base = XmCreateForm( owner, name, arg, n );
XtManageChild( base );
* This is unpublished proprietary source code of FUJITSU LIMITED
*/
-
-
-extern Widget GetMenuWidget();
-extern Widget CreateFrame();
-extern Widget CreateControlArea();
-extern Widget CreateScrollBar();
-extern Widget CreateDrawingArea();
-extern Widget CreateExclusive();
-extern Widget CreateLabel();
-extern Widget CreateDialogAndButtons();
-extern
-#ifdef _HPUX_SOURCE
-String
-#else
-XtPointer
-#endif
-GetTextFieldValue();
-extern Widget CreateTemplateDialog();
-extern Widget CreateScrollBase();
-extern Widget CreateForm();
-
#include <Xm/Xm.h>
#include <Xm/XmStrDefs.h>
-Widget CreateCaptionFrame();
-#ifdef _HPUX_SOURCE
-String
-#else
-XtPointer
-#endif
-GetTextFieldValue();
-void CreateTextField();
-void CreateButtons();
-void CreateMenuButtons();
-void LayoutButtonsEH();
-Widget CreateLayoutButtons();
-Widget CreateDialogAndButtons();
-Widget GuiInitialize();
-Widget CreateDrawingArea();
-void AddTopWidget();
-void AddLeftAttachWidget();
-void AddLeftAttachForm();
-void AddTopAttachWidget();
-void AddTopAttachForm();
-void AddRightAttachWidget();
-void AddRightAttachForm();
-void AddBottomAttachForm();
-void PopupDialog();
-void PopdownDialog();
-void ForcePopdownDialog();
-void SetLabelString();
-void SetFooterString();
-void PopupNotice();
-void AddDeleteProc();
-Widget CreateMenuBarAndFooterMessageForm();
-Widget GetMenuWidget();
-Widget CreateForm();
-Widget CreateLabel();
-Widget CreateFrame();
-Widget CreateRowColumn();
-Widget CreateScrollBar();
-
-
#define MarginWidth 4
#define RowMarginWidth 11
#define MarginHeight 11
XmNbottomAttachment, XmATTACH_FORM, \
XmNbottomOffset, offset, \
0)
+
+extern Widget GetMenuWidget(MButton *buttons, int buttons_num);
+extern Widget CreateFrame(Widget owner,
+ String name,
+ XtPointer type,
+ XtPointer thickness);
+extern Widget CreateScrollBar(Widget owner,
+ String name,
+ int height,
+ int val,
+ int min,
+ int max,
+ void (*proc)());
+extern Widget CreateDrawingArea(Widget owner,
+ String name,
+ int width,
+ int height,
+ void (*proc)(),
+ int val);
+extern Widget CreateLabel(Widget owner, String name, String str);
+extern Widget CreateDialogAndButtons(Widget owner,
+ String name,
+ void (*delcb)(),
+ Button *btns,
+ int btns_cnt,
+ Widget *pop);
+extern
+#ifdef _HPUX_SOURCE
+String
+#else
+XtPointer
+#endif
+GetTextFieldValue(TextField *textf);
+extern Widget CreateTemplateDialog(Widget w,
+ char *message,
+ unsigned char type,
+ NButton *button,
+ String title,
+ Widget *pop);
+extern Widget CreateScrollBase(Widget owner,
+ String name,
+ int min,
+ int max,
+ int val,
+ int vcnt,
+ void (*sbproc)());
+extern Widget CreateForm(Widget owner, String name);
+
+Widget CreateCaptionFrame(Widget owner,
+ String name,
+ String labelstr,
+ int type,
+ int thickness);
+#ifdef _HPUX_SOURCE
+String
+#else
+XtPointer
+#endif
+GetTextFieldValue(TextField *textf);
+void CreateTextField(Widget owner,
+ String name,
+ String labelstr,
+ TextField *data,
+ int maxlength);
+void CreateMenuButtons(Widget owner, Button *buttons, int buttons_cnt);
+Widget CreateDialogAndButtons(Widget owner,
+ String name,
+ void (*delcb)(),
+ Button *btns,
+ int btns_cnt,
+ Widget *pop);
+Widget GuiInitialize(XtAppContext *app,
+ String class_name,
+ int *ac,
+ String av[]);
+Widget CreateDrawingArea(Widget owner,
+ String name,
+ int width,
+ int height,
+ void (*proc)(),
+ int val);
+void AddLeftAttachWidget(Widget w, Widget ref, int offset);
+void AddLeftAttachForm(Widget w, int offset);
+void AddTopAttachWidget(Widget w, Widget ref, int offset);
+void AddTopAttachForm(Widget w, int offset);
+void AddRightAttachWidget(Widget w, Widget ref, int offset);
+void AddRightAttachForm(Widget w, int offset);
+void AddBottomAttachForm(Widget w, int offset);
+void PopupDialog(Widget w);
+void PopdownDialog(Widget w);
+void ForcePopdownDialog(Widget w);
+void SetLabelString(Widget w, String str);
+void SetFooterString(Widget w, String str);
+void PopupNotice(Widget owner,
+ char *message,
+ unsigned char type,
+ NButton *button,
+ Boolean do_format,
+ String title);
+void AddDeleteProc(Widget w, void (*delcb)());
+Widget CreateMenuBarAndFooterMessageForm(Widget owner,
+ String name,
+ MButton *buttons,
+ int bcnt,
+ Widget *pop,
+ Widget *footer);
+Widget GetMenuWidget(MButton *buttons, int buttons_num);
+Widget CreateForm(Widget owner, String name);
+Widget CreateLabel(Widget owner, String name, String str);
+Widget CreateFrame(Widget owner,
+ String name,
+ XtPointer type,
+ XtPointer thickness);
+Widget CreateRowColumn(Widget owner,
+ String name,
+ int layout,
+ int space,
+ int marginw,
+ int marginh);
+Widget CreateScrollBar(Widget owner,
+ String name,
+ int height,
+ int val,
+ int min,
+ int max,
+ void (*proc)());
+
#endif /* USE_MACRO */
*/
-
#include "fssxeg.h"
-extern Widget CreateOblB();
-extern Widget CreateOblBG();
-extern Widget CreateToglBG();
-extern Widget CreateToglB();
-extern Widget CreateRecBG();
-extern Widget CreateRecB();
-extern Widget CreateCapt();
-extern Widget CreateCaptG();
-extern Widget CreateLabelG();
-extern Widget CreateLabel();
-extern void SetString();
-
-extern int readSNF();
-extern int writeSNF();
-extern int ptnClose();
-extern int ptnAdd();
-extern int ptnGet();
-extern int ptnSense();
-extern int ptnDel();
-extern int GetInfo();
-extern int ptnSqToNo();
-extern int ptnNoToSq();
-extern int noToCode();
-extern int noToCode2();
-extern int codeToNo();
-extern int codeToNo2();
-extern int codeCheck();
-extern int codeCheck2();
-extern void bitSetInfo();
-extern void bitSet();
-extern void bitReset();
-extern int bitRead();
-extern void bitPtnClear();
-extern void bitPtnCopy();
-extern int bitDrawLine();
-extern int bitDrawRect();
-extern int bitDrawCls();
-extern int bitDrawSet();
-extern int bitDrawRev();
-extern int bitDrawCpy();
-extern int bitDrawMov();
-extern int bitDrawRoll();
-extern int bitDrawSymV();
-extern int bitDrawSymH();
+extern Widget CreateLabel(Widget owner, String name, String str);
+
+extern int readSNF(FalFontData **fdata,
+ int *width,
+ int *height,
+ char *err);
+extern int writeSNF(int restart, int *err);
+extern int ptnClose(void);
+extern int ptnAdd(int code, char *ptn);
+extern int ptnGet(int code, char *ptn);
+extern int ptnSense(int code);
+extern int ptnDel(int code);
+extern int ptnSqToNo(int num);
+extern int ptnNoToSq(int ncode);
+extern int noToCode(int sno);
+extern int codeToNo(int code);
+extern int codeCheck(int code);
+extern void bitSetInfo(int width, int height);
+extern void bitSet(char *ptn, int cx, int cy);
+extern void bitReset(char *ptn, int cx, int cy);
+extern int bitRead(char *ptn, int cx, int cy);
+extern void bitPtnClear(char *ptn);
+extern void bitPtnCopy(char *d_ptn, char *s_ptn);
+extern int bitDrawLine(char *ptn,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
+ int mode);
+extern int bitDrawRect(char *ptn,
+ int x,
+ int y,
+ int width,
+ int height,
+ int mode);
+extern int bitDrawCls(char *ptn,
+ int x,
+ int y,
+ int width,
+ int height);
+extern int bitDrawSet(char *ptn,
+ int x,
+ int y,
+ int width,
+ int height);
+extern int bitDrawRev(char *ptn,
+ int x,
+ int y,
+ int width,
+ int height);
+extern int bitDrawCpy(char *ptn,
+ int sx,
+ int sy,
+ int width,
+ int height,
+ int cut_flag);
+extern int bitDrawRoll(char *ptn, int x, int y, int width, int height);
+extern int bitDrawSymV(char *ptn, int x, int y, int width, int height);
+extern int bitDrawSymH(char *ptn, int x, int y, int width, int height);
#define D_MAX 10
-#define SetString(w,s) UpdateMessage((s))
-
#define PROC_POINT 0
#define PROC_LINE 1
#define PROC_RECT 2
#define SET_SYSTEM 5
-
#define MG_MAXSIZE 100
-
-#ifdef DEBUG
-#define Dprintf2 printf
-#define Dprintf printf
-#else
-#define Dprintf2
-#define Dprintf
-#endif
-
-
/**********************************************************************
structure
**********************************************************************/
**********************************************************************/
-#ifdef substance_source
-#define ex
-#define I(x) =(x)
-#else
-#define ex extern
-#define I(x)
-#endif /* substance_source */
-
-ex Widget toplevel I(NULL);
-
-ex Widget editPtnW I(NULL);
-ex Widget cpyPtnW I(NULL);
-ex Widget mngPtnW I(NULL);
-
-ex EditChar edg
-#ifdef substance_source
-={ 0,0,0,0,0,0,0, OFF }
-#endif /* substance_source */
-;
-ex EditList edlist
-#ifdef substance_source
- ={ EDLIST_MAX, 0,0,0,0,0,0,0,0,0 }
-#endif /* substance_source */
-;
-EditPane edpane
-#ifdef substance_source
- ={ EDPANE_SIZE, EDPANE_SIZE, 0,0,0,0,0,0 }
-#endif /* substance_source */
-;
-ex XlibInf xl;
-ex DelInf dn
-#ifdef substance_source
- ={ 0,0,0,0,0,0,0,0,0,0,0 }
-#endif /* substance_source */
-;
-ex DelPtnInf dl[D_MAX] ;
-ex DelPtnInf dl_glyph[EDLIST_MAX] ; /* add dl_disp 1995.09.20 */
-ex int sq_disp[EDLIST_MAX] ; /* add sq_disp 1995.09.20 */
-
-ex EditPtnInf em
-#ifdef substance_source
- ={ OFF,0,0,0,0,0,0,0,0,0,0,0,0,0 }
-#endif /* substance_source */
-;
-ex CopyPtnInf cpm
-#ifdef substance_source
- ={ 0,0,0,0,0 }
-#endif /* substance_source */
-;
-
-#undef ex
-#undef I
+Widget toplevel;
+
+Widget editPtnW;
+Widget cpyPtnW;
+Widget mngPtnW;
+
+EditChar edg;
+EditList edlist;
+EditPane edpane;
+XlibInf xl;
+DelInf dn;
+DelPtnInf dl[D_MAX] ;
+DelPtnInf dl_glyph[EDLIST_MAX]; /* add dl_disp 1995.09.20 */
+int sq_disp[EDLIST_MAX]; /* add sq_disp 1995.09.20 */
+
+EditPtnInf em;
+CopyPtnInf cpm;
/*
#include"ufontrsrc.h" /* 1995.06.28 H.Chiba */
-
-/*Resource resource; del 1995.05.30 H.Chiba BSC */
-
-
-#ifdef substance_source /* add 1995.06.29 H.Chiba -> */
-
-
-/* CreateCaptionFrame() */
-Boolean capt_resize = True ; /* resizable: */
-int capt_lftoff = 2 ; /* leftOffset: */
-int capt_topoff = 2 ; /* topOffset: */
-int capt_rghoff = 2 ; /* rightOffset: */
-
-Pixel pane_background;
-Pixel pane_foreground;
-
-/* CreateMenuButtons() */
-Dimension menu_margin = 0 ; /* margin: */
-
-/* CreateDialogAndButtons() */
-Boolean dia_tm_automng = False ; /* autoUnmanage: */
-Dimension dia_tm_width = 4 ; /* marginWidth: */
-Dimension dia_tm_height = 4 ; /* marginHeight: */
-Boolean dia_tm_resize = True ; /* noResize: */
-Boolean dia_tm_minimize = True ; /* minimizeButtons: */
-
-Dimension dia_rw_width = 6 ; /* marginWidth: */
-Dimension dia_rw_height = 6 ; /* marginHeight: */
-Dimension dia_rw_spacing = 4 ; /* spacing: */
-
-/* CreateDrawingArea() */
-Dimension draw_border = 1 ; /* borderWidth: */
-int draw_topoff = 2 ; /* topOffset: */
-int draw_lftoff = 2 ; /* leftOffset: */
-
-/* PopupNotice() */
-Boolean pop_resize = True ; /* noResize: */
-Boolean pop_minimize = True ; /* minimizeButtons: */
-
-/* CreateTemplateDialog() */
-Boolean temp_resize = True ; /* noResize: */
-Boolean temp_minimize = True ; /* minimizeButtons: */
-
-Dimension temp_width = 1 ; /* width: */
-Dimension temp_height = 1 ; /* height: */
-
-/* CreateMenuBarAndFooterMessageForm() */
-#if 0
-ed_functions = ( MWM_FUNC_MOVE | MWM_FUNC_MINIMIZE | MWM_FUNC_CLOSE ) ;/* mwmFunctions: */
-#endif
-
-int ed_bar_topoff = 1 ; /* topOffset: */
-int ed_bar_lftoff = 1 ; /* leftOffset: */
-int ed_bar_rghoff = 1 ; /* rightOffset: */
-
-int ed_frm_btmoff = 3 ; /* bottomOffset: */
-int ed_frm_lftoff = 3 ; /* leftOffset: */
-int ed_frm_rghoff = 3 ; /* rightOffset: */
-
-Dimension ed_msg_margintop = 3 ; /* marginTop: */
-Dimension ed_msg_marginbtm = 3 ; /* marginBottom: */
-
-Dimension ed_mesg_margintop = 3 ; /* marginTop: */
-Dimension ed_mesg_marginbtm = 3 ; /* marginBottom: */
-
-int ed_sep_btmoff = 3 ; /* bottomOffset: */
-int ed_sep_lftoff = 0 ; /* leftOffset: */
-int ed_sep_rghoff = 0 ; /* rightOffset: */
-Dimension ed_sep_margin = 0 ; /* margin: */
-
-int ed_wge_topoff = 10 ; /* topOffset: */
-int ed_wge_lftoff = 10 ; /* leftOffset: */
-int ed_wge_rghoff = 10 ; /* rightOffset: */
-int ed_wge_btmoff = 10 ; /* bottomOffset: */
-
-/* CreateFrame() */
-Boolean frame_resize = False ; /* resizable: */
-
-/* CreateScrollBase() */
-Dimension scll_fr_width = 500 ; /* width: */
-
-Dimension scll_fr_thick = 2 ; /* shadowThickness: */
-
-int scll_bar_lftoff = 4 ; /* leftOffset: */
-
-#endif /* substance_source */ /* -> add 1995.06.29 H.Chiba */
-
/**********/
/*
* parameters
*/
-void xlfdPopupDialog() ;
+void xlfdPopupDialog(Widget w);
extern int getmask ;
*/
void
-xlfdPopupDialog(w)
-Widget w;
+xlfdPopupDialog(Widget w)
{
if (! XtIsManaged(w))
XtManageChild(w);