summaryrefslogtreecommitdiff
path: root/lib/libFS/src
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-05-24 09:02:50 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-05-24 09:02:50 +0000
commit71afd3aab24f28d51ec9bc7db22a801b32b3d8a3 (patch)
tree20ff025536d218f481cd1cdc68739a111026feda /lib/libFS/src
parent57e69cbd0d214f1301c60b654457e1679e4e976e (diff)
update to libFS 1.0.1
Diffstat (limited to 'lib/libFS/src')
-rw-r--r--lib/libFS/src/FSClServ.c3
-rw-r--r--lib/libFS/src/FSCloseFt.c6
-rw-r--r--lib/libFS/src/FSConnServ.c18
-rw-r--r--lib/libFS/src/FSErrDis.c26
-rw-r--r--lib/libFS/src/FSFlush.c3
-rw-r--r--lib/libFS/src/FSFontInfo.c18
-rw-r--r--lib/libFS/src/FSFtNames.c13
-rw-r--r--lib/libFS/src/FSGetCats.c6
-rw-r--r--lib/libFS/src/FSListCats.c13
-rw-r--r--lib/libFS/src/FSListExt.c9
-rw-r--r--lib/libFS/src/FSMisc.c3
-rw-r--r--lib/libFS/src/FSNextEv.c6
-rw-r--r--lib/libFS/src/FSOpenFont.c12
-rw-r--r--lib/libFS/src/FSOpenServ.c12
-rw-r--r--lib/libFS/src/FSQGlyphs.c37
-rw-r--r--lib/libFS/src/FSQXExt.c28
-rw-r--r--lib/libFS/src/FSQXInfo.c14
-rw-r--r--lib/libFS/src/FSQuExt.c12
-rw-r--r--lib/libFS/src/FSServName.c4
-rw-r--r--lib/libFS/src/FSSetCats.c8
-rw-r--r--lib/libFS/src/FSSync.c6
-rw-r--r--lib/libFS/src/FSSynchro.c6
-rw-r--r--lib/libFS/src/FSlibInt.c240
-rw-r--r--lib/libFS/src/Makefile.am19
-rw-r--r--lib/libFS/src/Makefile.in73
-rw-r--r--lib/libFS/src/fs_transport.c2
26 files changed, 320 insertions, 277 deletions
diff --git a/lib/libFS/src/FSClServ.c b/lib/libFS/src/FSClServ.c
index 1866cfcd5..3751c28cf 100644
--- a/lib/libFS/src/FSClServ.c
+++ b/lib/libFS/src/FSClServ.c
@@ -61,8 +61,7 @@ in this Software without prior written authorization from The Open Group.
extern FSServer *_FSHeadOfServerList;
int
-FSCloseServer(svr)
- FSServer *svr;
+FSCloseServer(FSServer *svr)
{
_FSExtension *ext;
FSServer **sv = &_FSHeadOfServerList;
diff --git a/lib/libFS/src/FSCloseFt.c b/lib/libFS/src/FSCloseFt.c
index 38ce7e6b8..9b0dce86e 100644
--- a/lib/libFS/src/FSCloseFt.c
+++ b/lib/libFS/src/FSCloseFt.c
@@ -58,9 +58,9 @@ in this Software without prior written authorization from The Open Group.
int
-FSCloseFont(svr, fid)
- FSServer *svr;
- Font fid;
+FSCloseFont(
+ FSServer *svr,
+ Font fid)
{
fsResourceReq *req;
diff --git a/lib/libFS/src/FSConnServ.c b/lib/libFS/src/FSConnServ.c
index 6a66d87a5..d4d147229 100644
--- a/lib/libFS/src/FSConnServ.c
+++ b/lib/libFS/src/FSConnServ.c
@@ -79,8 +79,7 @@ in this Software without prior written authorization from The Open Group.
#define FS_CONNECTION_RETRIES 5
XtransConnInfo
-_FSConnectServer(server_name)
- char *server_name;
+_FSConnectServer(char *server_name)
{
XtransConnInfo trans_conn = NULL; /* transport connection object */
int retry, connect_stat;
@@ -135,8 +134,7 @@ _FSConnectServer(server_name)
*/
void
-_FSDisconnectServer(trans_conn)
- XtransConnInfo trans_conn;
+_FSDisconnectServer(XtransConnInfo trans_conn)
{
(void) _FSTransClose(trans_conn);
@@ -149,8 +147,7 @@ _FSDisconnectServer(trans_conn)
* 2) if the connection can be read, must enqueue events and handle errors,
* until the connection is writable.
*/
-void _FSWaitForWritable(svr)
- FSServer *svr;
+void _FSWaitForWritable(FSServer *svr)
{
fd_set r_mask;
fd_set w_mask;
@@ -212,8 +209,7 @@ void _FSWaitForWritable(svr)
}
-void _FSWaitForReadable(svr)
- FSServer *svr;
+void _FSWaitForReadable(FSServer *svr)
{
fd_set r_mask;
int result;
@@ -227,9 +223,9 @@ void _FSWaitForReadable(svr)
} while (result <= 0);
}
-void _FSSendClientPrefix(svr, client)
- FSServer *svr;
- fsConnClientPrefix *client;
+void _FSSendClientPrefix(
+ FSServer *svr,
+ fsConnClientPrefix *client)
{
struct iovec iovarray[5],
*iov = iovarray;
diff --git a/lib/libFS/src/FSErrDis.c b/lib/libFS/src/FSErrDis.c
index cc4abf4b0..244e0a4d7 100644
--- a/lib/libFS/src/FSErrDis.c
+++ b/lib/libFS/src/FSErrDis.c
@@ -76,13 +76,13 @@ int FSErrorListSize = sizeof(FSErrorList);
/* ARGSUSED */
-int FSGetErrorDatabaseText(svr, name, type, defaultp, buffer, nbytes)
- register char *name,
- *type;
- char *defaultp;
- FSServer *svr;
- char *buffer;
- int nbytes;
+int FSGetErrorDatabaseText(
+ FSServer *svr,
+ register char *name,
+ register char *type,
+ char *defaultp,
+ char *buffer,
+ int nbytes)
{
if (nbytes == 0)
return 0;
@@ -92,11 +92,11 @@ int FSGetErrorDatabaseText(svr, name, type, defaultp, buffer, nbytes)
return 1;
}
-int FSGetErrorText(svr, code, buffer, nbytes)
- register int code;
- register FSServer *svr;
- char *buffer;
- int nbytes;
+int FSGetErrorText(
+ register FSServer *svr,
+ register int code,
+ char *buffer,
+ int nbytes)
{
char *defaultp = NULL;
@@ -105,7 +105,7 @@ int FSGetErrorText(svr, code, buffer, nbytes)
if (nbytes == 0)
return 0;
- sprintf(buf, "%d", code);
+ snprintf(buf, sizeof(buf), "%d", code);
if (code <= (FSErrorListSize / sizeof(char *)) && code > 0) {
defaultp = FSErrorList[code];
FSGetErrorDatabaseText(svr, "FSProtoError", buf, defaultp, buffer, nbytes);
diff --git a/lib/libFS/src/FSFlush.c b/lib/libFS/src/FSFlush.c
index e4b14390b..924a0bb54 100644
--- a/lib/libFS/src/FSFlush.c
+++ b/lib/libFS/src/FSFlush.c
@@ -55,8 +55,7 @@ in this Software without prior written authorization from The Open Group.
#endif
#include "FSlibint.h"
-int FSFlush(svr)
- FSServer *svr;
+int FSFlush(FSServer *svr)
{
_FSFlush(svr);
return 1;
diff --git a/lib/libFS/src/FSFontInfo.c b/lib/libFS/src/FSFontInfo.c
index d79ad9e26..0b796133f 100644
--- a/lib/libFS/src/FSFontInfo.c
+++ b/lib/libFS/src/FSFontInfo.c
@@ -56,15 +56,15 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
char **
-FSListFontsWithXInfo(svr, pattern, maxNames, count, info, pprops, offsets, prop_data)
- FSServer *svr;
- char *pattern;
- int maxNames;
- int *count;
- FSXFontInfoHeader ***info;
- FSPropInfo ***pprops;
- FSPropOffset ***offsets;
- unsigned char ***prop_data;
+FSListFontsWithXInfo(
+ FSServer *svr,
+ char *pattern,
+ int maxNames,
+ int *count,
+ FSXFontInfoHeader ***info,
+ FSPropInfo ***pprops,
+ FSPropOffset ***offsets,
+ unsigned char ***prop_data)
{
long nbytes;
int i,
diff --git a/lib/libFS/src/FSFtNames.c b/lib/libFS/src/FSFtNames.c
index 2d512e41c..733da3500 100644
--- a/lib/libFS/src/FSFtNames.c
+++ b/lib/libFS/src/FSFtNames.c
@@ -57,11 +57,11 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
char **
-FSListFonts(svr, pattern, maxNames, actualCount)
- FSServer *svr;
- char *pattern;
- int maxNames;
- int *actualCount;
+FSListFonts(
+ FSServer *svr,
+ char *pattern,
+ int maxNames,
+ int *actualCount)
{
long nbytes;
int i,
@@ -120,8 +120,7 @@ FSListFonts(svr, pattern, maxNames, actualCount)
}
-int FSFreeFontNames(list)
- char **list;
+int FSFreeFontNames(char **list)
{
if (list) {
FSfree(list[0] - 1);
diff --git a/lib/libFS/src/FSGetCats.c b/lib/libFS/src/FSGetCats.c
index 39792f696..36a134b91 100644
--- a/lib/libFS/src/FSGetCats.c
+++ b/lib/libFS/src/FSGetCats.c
@@ -57,9 +57,9 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
char **
-FSGetCatalogues(svr, num)
- FSServer *svr;
- int *num;
+FSGetCatalogues(
+ FSServer *svr,
+ int *num)
{
fsGetCataloguesReply rep;
char **list;
diff --git a/lib/libFS/src/FSListCats.c b/lib/libFS/src/FSListCats.c
index 99b540014..36c53266b 100644
--- a/lib/libFS/src/FSListCats.c
+++ b/lib/libFS/src/FSListCats.c
@@ -57,11 +57,11 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
char **
-FSListCatalogues(svr, pattern, maxNames, actualCount)
- FSServer *svr;
- char *pattern;
- int maxNames;
- int *actualCount;
+FSListCatalogues(
+ FSServer *svr,
+ char *pattern,
+ int maxNames,
+ int *actualCount)
{
long nbytes;
int i,
@@ -121,8 +121,7 @@ FSListCatalogues(svr, pattern, maxNames, actualCount)
}
-int FSFreeCatalogues(list)
- char **list;
+int FSFreeCatalogues(char **list)
{
if (list) {
FSfree(list[0] - 1);
diff --git a/lib/libFS/src/FSListExt.c b/lib/libFS/src/FSListExt.c
index 0f42f5968..4eab13d1f 100644
--- a/lib/libFS/src/FSListExt.c
+++ b/lib/libFS/src/FSListExt.c
@@ -58,9 +58,9 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
char **
-FSListExtensions(svr, next)
- FSServer *svr;
- int *next;
+FSListExtensions(
+ FSServer *svr,
+ int *next)
{
fsListExtensionsReply rep;
char **list;
@@ -114,8 +114,7 @@ FSListExtensions(svr, next)
}
-int FSFreeExtensionList(list)
- char **list;
+int FSFreeExtensionList(char **list)
{
if (list != NULL) {
FSfree(list[0] - 1);
diff --git a/lib/libFS/src/FSMisc.c b/lib/libFS/src/FSMisc.c
index af0e78ce1..fd17440d5 100644
--- a/lib/libFS/src/FSMisc.c
+++ b/lib/libFS/src/FSMisc.c
@@ -57,8 +57,7 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
long
-FSMaxRequestSize(svr)
- FSServer *svr;
+FSMaxRequestSize(FSServer *svr)
{
return svr->max_request_size;
}
diff --git a/lib/libFS/src/FSNextEv.c b/lib/libFS/src/FSNextEv.c
index 69e009db3..8a80fd91d 100644
--- a/lib/libFS/src/FSNextEv.c
+++ b/lib/libFS/src/FSNextEv.c
@@ -58,9 +58,9 @@ in this Software without prior written authorization from The Open Group.
extern _FSQEvent *_FSqfree;
-int FSNextEvent(svr, event)
- FSServer *svr;
- FSEvent *event;
+int FSNextEvent(
+ FSServer *svr,
+ FSEvent *event)
{
_FSQEvent *qelt;
diff --git a/lib/libFS/src/FSOpenFont.c b/lib/libFS/src/FSOpenFont.c
index da6889a53..b2097faf6 100644
--- a/lib/libFS/src/FSOpenFont.c
+++ b/lib/libFS/src/FSOpenFont.c
@@ -58,12 +58,12 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
Font
-FSOpenBitmapFont(svr, hint, fmask, name, otherid)
- FSServer *svr;
- FSBitmapFormat hint;
- FSBitmapFormatMask fmask;
- char *name;
- Font *otherid;
+FSOpenBitmapFont(
+ FSServer *svr,
+ FSBitmapFormat hint,
+ FSBitmapFormatMask fmask,
+ char *name,
+ Font *otherid)
{
unsigned int nbytes;
fsOpenBitmapFontReq *req;
diff --git a/lib/libFS/src/FSOpenServ.c b/lib/libFS/src/FSOpenServ.c
index 662577945..d547fa441 100644
--- a/lib/libFS/src/FSOpenServ.c
+++ b/lib/libFS/src/FSOpenServ.c
@@ -73,8 +73,7 @@ static void OutOfMemory ( FSServer *svr, char *setup );
FSServer *_FSHeadOfServerList = NULL;
-void _FSFreeServerStructure(svr)
- FSServer *svr;
+void _FSFreeServerStructure(FSServer *svr)
{
if (svr->server_name)
FSfree(svr->server_name);
@@ -88,9 +87,9 @@ void _FSFreeServerStructure(svr)
}
static
-void OutOfMemory(svr, setup)
- FSServer *svr;
- char *setup;
+void OutOfMemory(
+ FSServer *svr,
+ char *setup)
{
_FSDisconnectServer(svr->trans_conn);
@@ -105,8 +104,7 @@ void OutOfMemory(svr, setup)
*/
FSServer *
-FSOpenServer(server)
- char *server;
+FSOpenServer(char *server)
{
FSServer *svr;
int i;
diff --git a/lib/libFS/src/FSQGlyphs.c b/lib/libFS/src/FSQGlyphs.c
index 5ba2eb0f7..0b3b5bd95 100644
--- a/lib/libFS/src/FSQGlyphs.c
+++ b/lib/libFS/src/FSQGlyphs.c
@@ -57,15 +57,15 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
int
-FSQueryXBitmaps8(svr, fid, format, range_type, str, str_len, offsets, glyphdata)
- FSServer *svr;
- Font fid;
- FSBitmapFormat format;
- Bool range_type;
- unsigned char *str;
- unsigned long str_len;
- FSOffset **offsets;
- unsigned char **glyphdata;
+FSQueryXBitmaps8(
+ FSServer *svr,
+ Font fid,
+ FSBitmapFormat format,
+ Bool range_type,
+ unsigned char *str,
+ unsigned long str_len,
+ FSOffset **offsets,
+ unsigned char **glyphdata)
{
fsQueryXBitmaps8Req *req;
fsQueryXBitmaps8Reply reply;
@@ -126,16 +126,15 @@ FSQueryXBitmaps8(svr, fid, format, range_type, str, str_len, offsets, glyphdata)
}
int
-FSQueryXBitmaps16(svr, fid, format, range_type, str, str_len,
- offsets, glyphdata)
- FSServer *svr;
- Font fid;
- FSBitmapFormat format;
- Bool range_type;
- FSChar2b *str;
- unsigned long str_len;
- FSOffset **offsets;
- unsigned char **glyphdata;
+FSQueryXBitmaps16(
+ FSServer *svr,
+ Font fid,
+ FSBitmapFormat format,
+ Bool range_type,
+ FSChar2b *str,
+ unsigned long str_len,
+ FSOffset **offsets,
+ unsigned char **glyphdata)
{
fsQueryXBitmaps16Req *req;
fsQueryXBitmaps16Reply reply;
diff --git a/lib/libFS/src/FSQXExt.c b/lib/libFS/src/FSQXExt.c
index e240d3aeb..fd182d31e 100644
--- a/lib/libFS/src/FSQXExt.c
+++ b/lib/libFS/src/FSQXExt.c
@@ -69,13 +69,13 @@ _FS_convert_char_info(fsXCharInfo *src, FSXCharInfo *dst)
}
int
-FSQueryXExtents8(svr, fid, range_type, str, str_len, extents)
- FSServer *svr;
- Font fid;
- Bool range_type;
- unsigned char *str;
- unsigned long str_len;
- FSXCharInfo **extents;
+FSQueryXExtents8(
+ FSServer *svr,
+ Font fid,
+ Bool range_type,
+ unsigned char *str,
+ unsigned long str_len,
+ FSXCharInfo **extents)
{
fsQueryXExtents8Req *req;
fsQueryXExtents8Reply reply;
@@ -115,13 +115,13 @@ FSQueryXExtents8(svr, fid, range_type, str, str_len, extents)
}
int
-FSQueryXExtents16(svr, fid, range_type, str, str_len, extents)
- FSServer *svr;
- Font fid;
- Bool range_type;
- FSChar2b *str;
- unsigned long str_len;
- FSXCharInfo **extents;
+FSQueryXExtents16(
+ FSServer *svr,
+ Font fid,
+ Bool range_type,
+ FSChar2b *str,
+ unsigned long str_len,
+ FSXCharInfo **extents)
{
fsQueryXExtents16Req *req;
fsQueryXExtents16Reply reply;
diff --git a/lib/libFS/src/FSQXInfo.c b/lib/libFS/src/FSQXInfo.c
index 083f95dce..d3dabf496 100644
--- a/lib/libFS/src/FSQXInfo.c
+++ b/lib/libFS/src/FSQXInfo.c
@@ -62,13 +62,13 @@ in this Software without prior written authorization from The Open Group.
*/
int
-FSQueryXInfo(svr, fid, info, props, offsets, prop_data)
- FSServer *svr;
- Font fid;
- FSXFontInfoHeader *info;
- FSPropInfo *props;
- FSPropOffset **offsets;
- unsigned char **prop_data;
+FSQueryXInfo(
+ FSServer *svr,
+ Font fid,
+ FSXFontInfoHeader *info,
+ FSPropInfo *props,
+ FSPropOffset **offsets,
+ unsigned char **prop_data)
{
fsQueryXInfoReq *req;
fsQueryXInfoReply reply;
diff --git a/lib/libFS/src/FSQuExt.c b/lib/libFS/src/FSQuExt.c
index 198bcee9f..8ba808015 100644
--- a/lib/libFS/src/FSQuExt.c
+++ b/lib/libFS/src/FSQuExt.c
@@ -57,12 +57,12 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
Bool
-FSQueryExtension(svr, name, major_opcode, first_event, first_error)
- FSServer *svr;
- char *name;
- int *major_opcode;
- int *first_event;
- int *first_error;
+FSQueryExtension(
+ FSServer *svr,
+ char *name,
+ int *major_opcode,
+ int *first_event,
+ int *first_error)
{
fsQueryExtensionReply rep;
fsQueryExtensionReq *req;
diff --git a/lib/libFS/src/FSServName.c b/lib/libFS/src/FSServName.c
index 886ffa589..7fadd9c4d 100644
--- a/lib/libFS/src/FSServName.c
+++ b/lib/libFS/src/FSServName.c
@@ -58,10 +58,10 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
#include <X11/Xosdefs.h>
#include <stdlib.h>
+#include "FSlib.h"
char *
-FSServerName(server)
- char *server;
+FSServerName(char *server)
{
char *s;
diff --git a/lib/libFS/src/FSSetCats.c b/lib/libFS/src/FSSetCats.c
index 194ce457b..a2c014268 100644
--- a/lib/libFS/src/FSSetCats.c
+++ b/lib/libFS/src/FSSetCats.c
@@ -58,10 +58,10 @@ in this Software without prior written authorization from The Open Group.
#include "FSlibint.h"
int
-FSSetCatalogues(svr, num, cats)
- FSServer *svr;
- int num;
- char **cats;
+FSSetCatalogues(
+ FSServer *svr,
+ int num,
+ char **cats)
{
int nbytes;
fsSetCataloguesReq *req;
diff --git a/lib/libFS/src/FSSync.c b/lib/libFS/src/FSSync.c
index eefd0318c..4991bd36c 100644
--- a/lib/libFS/src/FSSync.c
+++ b/lib/libFS/src/FSSync.c
@@ -60,9 +60,9 @@ extern _FSQEvent *_FSqfree;
/* synchronize with errors and events */
-int FSSync(svr, discard)
- FSServer *svr;
- Bool discard;
+int FSSync(
+ FSServer *svr,
+ Bool discard)
{
fsListExtensionsReply rep;
fsReq *req;
diff --git a/lib/libFS/src/FSSynchro.c b/lib/libFS/src/FSSynchro.c
index c1c2d31a4..79c0f4041 100644
--- a/lib/libFS/src/FSSynchro.c
+++ b/lib/libFS/src/FSSynchro.c
@@ -79,9 +79,9 @@ FSSynchronize(FSServer *svr, int onoff)
}
FSSyncHandler
-FSSetAfterFunction(svr, func)
- FSServer *svr;
- FSSyncHandler func;
+FSSetAfterFunction(
+ FSServer *svr,
+ FSSyncHandler func)
{
FSSyncHandler temp;
diff --git a/lib/libFS/src/FSlibInt.c b/lib/libFS/src/FSlibInt.c
index 3e1ac54d0..ac0b26c49 100644
--- a/lib/libFS/src/FSlibInt.c
+++ b/lib/libFS/src/FSlibInt.c
@@ -131,8 +131,7 @@ static fsReq _dummy_request = {
* This routine may have to be reworked if int < long.
*/
void
-_FSFlush(svr)
- register FSServer *svr;
+_FSFlush(register FSServer *svr)
{
register long size,
todo;
@@ -177,9 +176,9 @@ _FSFlush(svr)
}
int
-_FSEventsQueued(svr, mode)
- register FSServer *svr;
- int mode;
+_FSEventsQueued(
+ register FSServer *svr,
+ int mode)
{
register BytesReadable_t len;
BytesReadable_t pend;
@@ -216,8 +215,7 @@ _FSEventsQueued(svr, mode)
* then read as many events as possible (but at least 1) and enqueue them
*/
void
-_FSReadEvents(svr)
- register FSServer *svr;
+_FSReadEvents(register FSServer *svr)
{
char buf[BUFSIZE];
BytesReadable_t pend_not_register; /* because can't "&" a register
@@ -274,10 +272,10 @@ _FSReadEvents(svr)
* reads. This routine may have to be reworked if int < long.
*/
void
-_FSRead(svr, data, size)
- register FSServer *svr;
- register char *data;
- register long size;
+_FSRead(
+ register FSServer *svr,
+ register char *data,
+ register long size)
{
register long bytes_read;
#if defined(SVR4) && defined(i386)
@@ -349,11 +347,11 @@ _FSRead(svr, data, size)
*
*/
static void
-_doFSRead32(svr, data, size, packbuffer)
- register FSServer *svr;
- register long *data;
- register long size;
- register char *packbuffer;
+_doFSRead32(
+ register FSServer *svr,
+ register long *data,
+ register long size,
+ register char *packbuffer)
{
long *lpack,
*lp;
@@ -381,10 +379,10 @@ _doFSRead32(svr, data, size, packbuffer)
}
void
-_FSRead32(svr, data, len)
- FSServer *svr;
- long *data;
- long len;
+_FSRead32(
+ FSServer *svr,
+ long *data,
+ long len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nwords = (PACKBUFFERSIZE >> 2); /* bytes to CARD32 */
@@ -403,11 +401,11 @@ _FSRead32(svr, data, len)
*
*/
static void
-_doFSRead16(svr, data, size, packbuffer)
- register FSServer *svr;
- register short *data;
- register long size;
- char *packbuffer;
+_doFSRead16(
+ register FSServer *svr,
+ register short *data,
+ register long size,
+ char *packbuffer)
{
long *lpack,
*lp;
@@ -435,10 +433,10 @@ _doFSRead16(svr, data, size, packbuffer)
}
void
-_FSRead16(svr, data, len)
- FSServer *svr;
- short *data;
- long len;
+_FSRead16(
+ FSServer *svr,
+ short *data,
+ long len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nwords = (PACKBUFFERSIZE >> 1); /* bytes to CARD16 */
@@ -450,10 +448,10 @@ _FSRead16(svr, data, len)
}
void
-_FSRead16Pad(svr, data, size)
- FSServer *svr;
- short *data;
- long size;
+_FSRead16Pad(
+ FSServer *svr,
+ short *data,
+ long size)
{
int slop = (size & 3);
short slopbuf[3];
@@ -473,10 +471,10 @@ _FSRead16Pad(svr, data, size)
* bytes. This routine may have to be reworked if int < long.
*/
void
-_FSReadPad(svr, data, size)
- register FSServer *svr;
- register char *data;
- register long size;
+_FSReadPad(
+ register FSServer *svr,
+ register char *data,
+ register long size)
{
register long bytes_read;
struct iovec iov[2];
@@ -539,10 +537,10 @@ _FSReadPad(svr, data, size)
* This routine may have to be reworked if int < long;
*/
void
-_FSSend(svr, data, size)
- register FSServer *svr;
- char *data;
- register long size;
+_FSSend(
+ register FSServer *svr,
+ char *data,
+ register long size)
{
struct iovec iov[3];
static char pad[3] = {0, 0, 0};
@@ -634,8 +632,7 @@ _FSSend(svr, data, size)
* follow the rules.
*/
FSID
-_FSAllocID(svr)
- register FSServer *svr;
+_FSAllocID(register FSServer *svr)
{
return (svr->resource_base + (svr->resource_id++ << svr->resource_shift));
}
@@ -652,9 +649,9 @@ _FSAllocID(svr)
*/
unsigned long
-_FSSetLastRequestRead(svr, rep)
- register FSServer *svr;
- register fsGenericReply *rep;
+_FSSetLastRequestRead(
+ register FSServer *svr,
+ register fsGenericReply *rep)
{
register unsigned long newseq,
lastseq;
@@ -684,13 +681,13 @@ _FSSetLastRequestRead(svr, rep)
* we may encounter.
*/
Status
-_FSReply(svr, rep, extra, discard)
- register FSServer *svr;
- register fsReply *rep;
- int extra; /* number of 32-bit words expected after the
- * reply */
- Bool discard; /* should I discard data followind "extra"
- * words? */
+_FSReply(
+ register FSServer *svr,
+ register fsReply *rep,
+ int extra, /* number of 32-bit words expected after the
+ * reply */
+ Bool discard)/* should I discard data followind "extra"
+ * words? */
{
/*
* Pull out the serial number now, so that (currently illegal) requests
@@ -808,9 +805,9 @@ _FSReply(svr, rep, extra, discard)
/* Read and discard "n" 8-bit bytes of data */
void
-_FSEatData(svr, n)
- FSServer *svr;
- register unsigned long n;
+_FSEatData(
+ FSServer *svr,
+ register unsigned long n)
{
#define SCRATCHSIZE 2048
char buf[SCRATCHSIZE];
@@ -828,9 +825,9 @@ _FSEatData(svr, n)
/* Read and discard "n" 32-bit words. */
static void
-_EatData32(svr, n)
- FSServer *svr;
- unsigned long n;
+_EatData32(
+ FSServer *svr,
+ unsigned long n)
{
_FSEatData(svr, n << 2);
}
@@ -842,9 +839,9 @@ _EatData32(svr, n)
* is pointer motion hints....
*/
void
-_FSEnq(svr, event)
- register FSServer *svr;
- register fsEvent *event;
+_FSEnq(
+ register FSServer *svr,
+ register fsEvent *event)
{
register _FSQEvent *qelt;
@@ -881,11 +878,11 @@ _FSEnq(svr, event)
/*ARGSUSED*/
Bool
-_FSUnknownWireEvent(svr, re, event)
- register FSServer *svr; /* pointer to display structure */
- register FSEvent *re; /* pointer to where event should be
+_FSUnknownWireEvent(
+ register FSServer *svr, /* pointer to display structure */
+ register FSEvent *re, /* pointer to where event should be
* reformatted */
- register fsEvent *event; /* wire protocol event */
+ register fsEvent *event) /* wire protocol event */
{
#ifdef notdef
@@ -899,11 +896,11 @@ _FSUnknownWireEvent(svr, re, event)
/*ARGSUSED*/
Status
-_FSUnknownNativeEvent(svr, re, event)
- register FSServer *svr; /* pointer to display structure */
- register FSEvent *re; /* pointer to where event should be
+_FSUnknownNativeEvent(
+ register FSServer *svr, /* pointer to display structure */
+ register FSEvent *re, /* pointer to where event should be
* reformatted */
- register fsEvent *event; /* wire protocol event */
+ register fsEvent *event) /* wire protocol event */
{
#ifdef notdef
@@ -919,11 +916,11 @@ _FSUnknownNativeEvent(svr, re, event)
* reformat a wire event into an FSEvent structure of the right type.
*/
Bool
-_FSWireToEvent(svr, re, event)
- register FSServer *svr; /* pointer to display structure */
- register FSEvent *re; /* pointer to where event should be
+_FSWireToEvent(
+ register FSServer *svr, /* pointer to display structure */
+ register FSEvent *re, /* pointer to where event should be
* reformatted */
- register fsEvent *event; /* wire protocol event */
+ register fsEvent *event) /* wire protocol event */
{
re->type = event->type & 0x7f;
@@ -945,8 +942,7 @@ _FSWireToEvent(svr, re, event)
static char *
-_SysErrorMsg(n)
- int n;
+_SysErrorMsg(int n)
{
char *s = strerror(n);
@@ -958,8 +954,7 @@ _SysErrorMsg(n)
* when an X internal system error is encountered.
*/
int
-_FSDefaultIOError(svr)
- FSServer *svr;
+_FSDefaultIOError(FSServer *svr)
{
(void) fprintf(stderr,
"FSIO: fatal IO error %d (%s) on font server \"%s\"\r\n",
@@ -988,9 +983,9 @@ _FSDefaultIOError(svr)
* FS_Error packet is encountered in the input stream.
*/
int
-_FSError(svr, rep)
- FSServer *svr;
- fsError *rep;
+_FSError(
+ FSServer *svr,
+ fsError *rep)
{
FSErrorEvent event;
@@ -1013,10 +1008,10 @@ _FSError(svr, rep)
}
int
-_FSPrintDefaultError(svr, event, fp)
- FSServer *svr;
- FSErrorEvent *event;
- FILE *fp;
+_FSPrintDefaultError(
+ FSServer *svr,
+ FSErrorEvent *event,
+ FILE *fp)
{
char buffer[BUFSIZ];
char mesg[BUFSIZ];
@@ -1032,7 +1027,7 @@ _FSPrintDefaultError(svr, event, fp)
"Request Major code %d", mesg, BUFSIZ);
(void) fprintf(fp, mesg, event->request_code);
if (event->request_code < 128) {
- sprintf(number, "%d", event->request_code);
+ snprintf(number, sizeof(number), "%d", event->request_code);
(void) FSGetErrorDatabaseText(svr, "FSRequest", number, "", buffer,
BUFSIZ);
} else {
@@ -1049,7 +1044,7 @@ _FSPrintDefaultError(svr, event, fp)
"Request Minor code %d", mesg, BUFSIZ);
(void) fprintf(fp, mesg, event->minor_code);
if (ext) {
- sprintf(mesg, "%s.%d", ext->name, event->minor_code);
+ snprintf(mesg, sizeof(mesg), "%s.%d", ext->name, event->minor_code);
(void) FSGetErrorDatabaseText(svr, "FSRequest", mesg, "", buffer,
BUFSIZ);
(void) fprintf(fp, " (%s)", buffer);
@@ -1071,9 +1066,9 @@ _FSPrintDefaultError(svr, event, fp)
}
int
-_FSDefaultError(svr, event)
- FSServer *svr;
- FSErrorEvent *event;
+_FSDefaultError(
+ FSServer *svr,
+ FSErrorEvent *event)
{
if (_FSPrintDefaultError(svr, event, stderr) == 0)
return 0;
@@ -1091,9 +1086,9 @@ FSErrorHandler _FSErrorFunction = _FSDefaultError;
* each time, unless the library needs a large scratch space.
*/
char *
-_FSAllocScratch(svr, nbytes)
- register FSServer *svr;
- unsigned long nbytes;
+_FSAllocScratch(
+ register FSServer *svr,
+ unsigned long nbytes)
{
if (nbytes > svr->scratch_length) {
if (svr->scratch_buffer != NULL)
@@ -1105,26 +1100,24 @@ _FSAllocScratch(svr, nbytes)
}
int
-FSFree(data)
- char *data;
+FSFree(char *data)
{
FSfree(data);
return 1;
}
unsigned char *
-FSMalloc(size)
- unsigned size;
+FSMalloc(unsigned size)
{
return (unsigned char *) FSmalloc(size);
}
#ifdef DataRoutineIsProcedure
void
-Data(svr, data, len)
- FSServer *svr;
- char *data;
- long len;
+Data(
+ FSServer *svr,
+ char *data,
+ long len)
{
if (svr->bufptr + (len) <= svr->bufmax) {
bcopy(data, svr->bufptr, (int) len);
@@ -1152,11 +1145,11 @@ Data(svr, data, len)
*/
static void
-doData16(svr, data, len, packbuffer)
- register FSServer *svr;
- short *data;
- unsigned len;
- char *packbuffer;
+doData16(
+ register FSServer *svr,
+ short *data,
+ unsigned len,
+ char *packbuffer)
{
long *lp,
*lpack;
@@ -1191,9 +1184,9 @@ doData16(svr, data, len, packbuffer)
void
Data16(svr, data, len)
- FSServer *svr;
- short *data;
- unsigned len;
+ FSServer *svr,
+ short *data,
+ unsigned len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nwords = (PACKBUFFERSIZE >> 1); /* bytes to CARD16 */
@@ -1213,11 +1206,11 @@ Data16(svr, data, len)
*/
static
-doData32(svr, data, len, packbuffer)
- register FSServer *svr;
- long *data;
- unsigned len;
- char *packbuffer;
+doData32(
+ register FSServer *svr,
+ long *data,
+ unsigned len,
+ char *packbuffer)
{
long *lp,
*lpack;
@@ -1251,10 +1244,10 @@ doData32(svr, data, len, packbuffer)
}
void
-Data32(svr, data, len)
- FSServer *svr;
- short *data;
- unsigned len;
+Data32(
+ FSServer *svr,
+ short *data,
+ unsigned len)
{
char packbuffer[PACKBUFFERSIZE];
unsigned nwords = (PACKBUFFERSIZE >> 2); /* bytes to CARD32 */
@@ -1275,7 +1268,7 @@ Data32(svr, data, len)
*/
void
-_FSFreeQ()
+_FSFreeQ(void)
{
register _FSQEvent *qelt = _FSqfree;
@@ -1315,9 +1308,9 @@ _FSFreeQ()
* _FSGetHostname - similar to gethostname but allows special processing.
*/
int
-_FSGetHostname(buf, maxlen)
- char *buf;
- int maxlen;
+_FSGetHostname(
+ char *buf,
+ int maxlen)
{
int len;
@@ -1347,8 +1340,7 @@ _FSGetHostname(buf, maxlen)
/*
* This is not always a macro.
*/
-_FSANYSET(src)
- long *src;
+_FSANYSET(long *src)
{
int i;
diff --git a/lib/libFS/src/Makefile.am b/lib/libFS/src/Makefile.am
index 50b70b0d6..a9a347b0c 100644
--- a/lib/libFS/src/Makefile.am
+++ b/lib/libFS/src/Makefile.am
@@ -40,3 +40,22 @@ libFS_la_LDFLAGS = -version-number 6:0:0 -no-undefined
libFSincludedir = $(includedir)/X11/fonts
libFSinclude_HEADERS = \
$(top_srcdir)/include/X11/fonts/FSlib.h
+
+if LINT
+ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+
+lint:
+ $(LINT) $(ALL_LINT_FLAGS) $(libFS_la_SOURCES) \
+ $(libFS_la_LIBADD) $(LIBS)
+endif LINT
+
+if MAKE_LINT_LIB
+lintlibdir = $(libdir)
+
+lintlib_DATA = $(LINTLIB)
+
+$(LINTLIB): $(libFS_la_SOURCES)
+ $(LINT) -y -oFS -x $(ALL_LINT_FLAGS) $(libFS_la_SOURCES) \
+ $(libFS_la_LIBADD) $(LIBS)
+endif MAKE_LINT_LIB
diff --git a/lib/libFS/src/Makefile.in b/lib/libFS/src/Makefile.in
index 399700f67..7847c3b3a 100644
--- a/lib/libFS/src/Makefile.in
+++ b/lib/libFS/src/Makefile.in
@@ -15,6 +15,7 @@
@SET_MAKE@
+
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@@ -53,7 +54,8 @@ am__vpath_adj = case $$p in \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libFSincludedir)"
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(lintlibdir)" \
+ "$(DESTDIR)$(libFSincludedir)"
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES)
am__DEPENDENCIES_1 =
@@ -78,6 +80,8 @@ LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libFS_la_SOURCES)
DIST_SOURCES = $(libFS_la_SOURCES)
+lintlibDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(lintlib_DATA)
libFSincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(libFSinclude_HEADERS)
ETAGS = etags
@@ -104,6 +108,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -122,13 +127,21 @@ LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
+LINT = @LINT@
+LINTLIB = @LINTLIB@
+LINT_FALSE = @LINT_FALSE@
+LINT_FLAGS = @LINT_FLAGS@
+LINT_TRUE = @LINT_TRUE@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
+MAKE_LINT_LIB_FALSE = @MAKE_LINT_LIB_FALSE@
+MAKE_LINT_LIB_TRUE = @MAKE_LINT_LIB_TRUE@
MALLOC_ZERO_CFLAGS = @MALLOC_ZERO_CFLAGS@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -139,6 +152,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@@ -150,7 +164,9 @@ XTRANS_LIBS = @XTRANS_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@@ -231,6 +247,11 @@ libFSincludedir = $(includedir)/X11/fonts
libFSinclude_HEADERS = \
$(top_srcdir)/include/X11/fonts/FSlib.h
+@LINT_TRUE@ALL_LINT_FLAGS = $(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+@LINT_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+
+@MAKE_LINT_LIB_TRUE@lintlibdir = $(libdir)
+@MAKE_LINT_LIB_TRUE@lintlib_DATA = $(LINTLIB)
all: all-am
.SUFFIXES:
@@ -356,6 +377,23 @@ clean-libtool:
distclean-libtool:
-rm -f libtool
uninstall-info-am:
+install-lintlibDATA: $(lintlib_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(lintlibdir)" || $(mkdir_p) "$(DESTDIR)$(lintlibdir)"
+ @list='$(lintlib_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(lintlibDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(lintlibdir)/$$f'"; \
+ $(lintlibDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(lintlibdir)/$$f"; \
+ done
+
+uninstall-lintlibDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lintlib_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(lintlibdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(lintlibdir)/$$f"; \
+ done
install-libFSincludeHEADERS: $(libFSinclude_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(libFSincludedir)" || $(mkdir_p) "$(DESTDIR)$(libFSincludedir)"
@@ -452,9 +490,9 @@ distdir: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS)
installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libFSincludedir)"; do \
+ for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(lintlibdir)" "$(DESTDIR)$(libFSincludedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
@@ -502,7 +540,7 @@ info: info-am
info-am:
-install-data-am: install-libFSincludeHEADERS
+install-data-am: install-libFSincludeHEADERS install-lintlibDATA
install-exec-am: install-libLTLIBRARIES
@@ -531,7 +569,7 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-libFSincludeHEADERS \
- uninstall-libLTLIBRARIES
+ uninstall-libLTLIBRARIES uninstall-lintlibDATA
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
clean-libLTLIBRARIES clean-libtool ctags distclean \
@@ -539,14 +577,23 @@ uninstall-am: uninstall-info-am uninstall-libFSincludeHEADERS \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-exec \
install-exec-am install-info install-info-am \
- install-libFSincludeHEADERS install-libLTLIBRARIES install-man \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-info-am uninstall-libFSincludeHEADERS \
- uninstall-libLTLIBRARIES
-
+ install-libFSincludeHEADERS install-libLTLIBRARIES \
+ install-lintlibDATA install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+ uninstall-libFSincludeHEADERS uninstall-libLTLIBRARIES \
+ uninstall-lintlibDATA
+
+
+@LINT_TRUE@lint:
+@LINT_TRUE@ $(LINT) $(ALL_LINT_FLAGS) $(libFS_la_SOURCES) \
+@LINT_TRUE@ $(libFS_la_LIBADD) $(LIBS)
+
+@MAKE_LINT_LIB_TRUE@$(LINTLIB): $(libFS_la_SOURCES)
+@MAKE_LINT_LIB_TRUE@ $(LINT) -y -oFS -x $(ALL_LINT_FLAGS) $(libFS_la_SOURCES) \
+@MAKE_LINT_LIB_TRUE@ $(libFS_la_LIBADD) $(LIBS)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lib/libFS/src/fs_transport.c b/lib/libFS/src/fs_transport.c
index 4114631d9..a924f916c 100644
--- a/lib/libFS/src/fs_transport.c
+++ b/lib/libFS/src/fs_transport.c
@@ -1,6 +1,4 @@
/*
- * $Id: fs_transport.c,v 1.1 2006/11/25 16:35:09 matthieu Exp $
- *
* Copyright © 2005 Red Hat, Inc
*
* Permission to use, copy, modify, distribute, and sell this software and its