megatron_SOURCES = asingle.c hqx.c macbin.c megatron.c nad.c updcrc.c
megatron_LDADD = $(top_builddir)/libatalk/libatalk.la
-noinst_HEADERS = megatron.h
+noinst_HEADERS = asingle.h megatron.h hqx.h macbin.h nad.h
LINKS = unbin unhex unsingle hqx2bin single2bin macbinary binheader nadheader
#include <unistd.h>
#include <atalk/adouble.h>
#include <netatalk/endian.h>
+#include "asingle.h"
#include "megatron.h"
-int single_header_read(struct FHeader *fh, int version);
-int single_close(int readflag);
-int single_header_test(void);
-
/* String used to indicate standard input instead of a disk
file. Should be a string not normally used for a file
*/
--- /dev/null
+/* Forward Declarations */
+struct FHeader;
+
+int single_open(char *singlefile, int flags, struct FHeader *fh, int options);
+int single_close(int readflag);
+int single_header_read(struct FHeader *fh, int version);
+int single_header_test(void);
+int single_read(int fork, char *buffer, int length);
/*
- * $Id: hqx.c,v 1.6 2001-05-01 13:58:43 srittau Exp $
+ * $Id: hqx.c,v 1.7 2001-06-10 20:12:29 srittau Exp $
*/
#ifdef HAVE_CONFIG_H
#include <atalk/adouble.h>
#include <netatalk/endian.h>
#include "megatron.h"
+#include "hqx.h"
#define HEXOUTPUT 0
--- /dev/null
+/* Forward Declarations */
+struct FHeader;
+
+int skip_junk(int line);
+int hqx_open(char *hqxfile, int flags, struct FHeader *fh, int options);
+int hqx_close(int keepflag);
+int hqx_read(int fork, char *buffer, int length);
+int hqx_header_read(struct FHeader *fh);
+int hqx_header_write(struct FHeader *fh);
+int hqx_7tobin(char *outbuf, int datalen);
+int hqx7_fill(u_char *hqx7_ptr);
#include <atalk/adouble.h>
#include <netatalk/endian.h>
#include "megatron.h"
+#include "macbin.h"
/* This allows megatron to generate .bin files that won't choke other
well-known converter apps. It also makes sure that checksums
*/
#define HEADBUFSIZ 128
-/* Forward Declarations
- */
-int bin_open(char *binfile, int flags, struct FHeader *fh, int options);
-int bin_close(int keepflag);
-int bin_read(int fork, char *buffer, int length);
-int bin_write(int fork, char *buffer, int length);
-int bin_header_read(struct FHeader *fh, int revision);
-int bin_header_write(struct FHeader *fh);
-int test_header(void);
-u_short updcrc();
-
/* Both input and output routines use this struct and the
following globals; therefore this module can only be used
for one of the two functions at a time.
--- /dev/null
+/* Forward Declarations */
+struct FHeader;
+
+int bin_open(char *binfile, int flags, struct FHeader *fh, int options);
+int bin_close(int keepflag);
+int bin_read(int fork, char *buffer, int length);
+int bin_write(int fork, char *buffer, int length);
+int bin_header_read(struct FHeader *fh, int revision);
+int bin_header_write(struct FHeader *fh);
+int test_header(void);
+u_short updcrc();
#include <string.h>
#include <syslog.h>
#include <netatalk/endian.h>
+#include "asingle.h"
#include "megatron.h"
+#include "hqx.h"
+#include "macbin.h"
+#include "nad.h"
char forkbuf[8192];
char *forkname[] = { "data", "resource" };
#include <atalk/adouble.h>
#include <netatalk/endian.h>
#include "megatron.h"
+#include "nad.h"
static char hexdig[] = "0123456789abcdef";
-/* Forward Declarations */
-int nad_open(char *path, int openflags, struct FHeader *fh, int options);
-int nad_header_read(struct FHeader *fh);
-int nad_header_write(struct FHeader *fh);
-int nad_read(int fork, char *forkbuf, int bufc);
-int nad_write(int fork, char *forkbuf, int bufc);
-int nad_close(int status);
-
char *mtoupath( mpath )
char *mpath;
{
--- /dev/null
+/* Forward Declarations */
+struct FHeader;
+
+int nad_open(char *path, int openflags, struct FHeader *fh, int options);
+int nad_header_read(struct FHeader *fh);
+int nad_header_write(struct FHeader *fh);
+int nad_read(int fork, char *forkbuf, int bufc);
+int nad_write(int fork, char *forkbuf, int bufc);
+int nad_close(int status);
memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9,
((char *)rniov[ 0 ].iov_base)[ 8 ] );
- st_buf[ ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
+ st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
if ( strstr( st_buf, "idle" ) != NULL ) {
waitforidle = 0;
} else {
memcpy( st_buf, (char *) rniov[ 0 ].iov_base + 9,
((char *)rniov[ 0 ].iov_base)[ 8 ] );
- st_buf[ ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
+ st_buf[ (int) ((char *)rniov[ 0 ].iov_base)[ 8 ]] = '\0';
if ( strstr( st_buf, "waiting" ) != NULL ) {
waitforprinter = 0;
}
/*
- * $Id: parse_mtab.c,v 1.1 2001-05-25 16:18:09 rufustfirefly Exp $
+ * $Id: parse_mtab.c,v 1.2 2001-06-10 20:15:00 srittau Exp $
*
* afpd_mtab_parse & support. -- rgr, 9-Apr-01.
*/
#endif /* HAVE_CONFIG_H */
#include <stdio.h>
+#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
}
} /* next line */
- close(f);
+ fclose(f);
if (n_errors) {
fprintf(stderr, "Got %d errors while reading %s; exiting.\n",
n_errors, file_name);
/*
- * $Id: test_parse_mtab.c,v 1.1 2001-05-25 16:18:09 rufustfirefly Exp $
+ * $Id: test_parse_mtab.c,v 1.2 2001-06-10 20:15:00 srittau Exp $
* test driver for the afpd_mtab_parse fn. -- rgr, 9-Apr-01.
*/
argv[arg], errno);
}
else {
- fprintf(stderr, "File %s, device (%d,%d), inode %d, CNID 0x%08x.\n",
+ fprintf(stderr, "File %s, device (%d,%d), inode %ld, CNID 0x%08x.\n",
argv[arg], major(st.st_dev), minor(st.st_dev), st.st_ino,
CNID(&st, S_ISDIR(st.st_mode) ? 1 : 0));
}
#include "main.h"
/* Forward Declarations */
-int ifconfig(char *iname, unsigned long cmd, struct sockaddr_at *sa);
+int ifconfig(const char *iname, unsigned long cmd, struct sockaddr_at *sa);
/* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */
#ifndef SOCKLEN_T
}
int ifconfig( iname, cmd, sa )
- char *iname;
+ const char *iname;
unsigned long cmd;
struct sockaddr_at *sa;
{
#include <sys/cdefs.h>
-int ifconfig __P(( char *, unsigned long, struct sockaddr_at * ));
+int ifconfig __P(( const char *, unsigned long, struct sockaddr_at * ));
void setaddr __P(( struct interface *, u_int8_t, u_int16_t,
u_int8_t, u_int16_t, u_int16_t ));
void bootaddr __P(( struct interface * ));
sa.sdl_alen = sizeof(ethermulti);
sa.sdl_len = sizeof(sa);
#else
- memcpy(sa.sa_data, data ? data : ethermulti, sizeof( ethermulti ));
+ memcpy(sa.sa_data, data ? data : ethermulti, sizeof(ethermulti));
#endif
- if (ifconfig(name, SIOCADDMULTI, &sa))
+ if (ifconfig(name, SIOCADDMULTI, (struct sockaddr_at *)&sa))
return -1;
return 0;
loop.sat_addr.s_net = htons( ATADDR_ANYNET );
loop.sat_addr.s_node = ATADDR_ANYNODE;
- if ( route( cmd, &dst, &loop, RTF_UP | RTF_HOST )) {
+ if ( route( cmd,
+ (struct sockaddr *) &dst,
+ (struct sockaddr *) &loop,
+ RTF_UP | RTF_HOST ) ) {
return( 1 );
}
if ( cmd == RTMP_ADD ) {
do {
dst.sat_addr.s_net = htons( net );
- if ( route( command, &dst, &gate, RTF_UP | RTF_GATEWAY )) {
+ if ( route( command,
+ (struct sockaddr *) &dst,
+ (struct sockaddr *) &gate,
+ RTF_UP | RTF_GATEWAY )) {
syslog( LOG_ERR, "route: %u -> %u.%u: %m", net,
ntohs( gate.sat_addr.s_net ), gate.sat_addr.s_node );
continue;
char *end, zname[ 32 ], packet[ ATP_BUFSIZ ], *nzones, *lastflag;
char *reply, *rend, *ziphdr;
int zlen, n, zipop, rcnt, qcnt, zcnt, zsz;
- extern int debug, stabletimer;
+ extern int stabletimer;
end = data + len;
void morespace( pf, data, len )
struct papfile *pf;
- char *data;
+ const char *data;
int len;
{
char *nbuf;
#define PF_MORESPACE 1024
int markline __P(( struct papfile *, char **, int *, int * ));
-void morespace __P(( struct papfile *, char *, int ));
+void morespace __P(( struct papfile *, const char *, int ));
void append __P(( struct papfile *, const char *, int ));
void spoolerror __P(( struct papfile *, char * ));
{
char *start, *stop, *p, *q, c;
int linelength, crlflength;
- struct papd_comment *comment = compeek();
switch ( markline( in, &start, &linelength, &crlflength )) {
case 0 :
#include "lp.h"
#include "session.h"
+int ps(struct papfile *infile, struct papfile *outfile, struct sockaddr_at *sat);
+
extern unsigned char connid, quantum, oquantum;
char buf[ PAP_MAXQUANTUM ][ 4 + PAP_MAXDATA ];
#include "config.h"
#endif
+#include <unistd.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
-main( ac, av )
+int main( ac, av )
int ac;
char **av;
{
}
}
if ( cc != 0 && write( 2, buf, cc ) != cc ) {
- fprintf( stderr, "write 1: 2 %X %d\n", buf, cc );
+ fprintf( stderr, "write 1: 2 %p %d\n", buf, cc );
perror( "write" );
exit( 2 );
}
#define FUCKED
+#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/syslog.h>
#include <atalk/paths.h>
#include <stdio.h>
-#include <strings.h>
+#include <stdlib.h>
+#include <string.h>
#include <ctype.h>
#include <signal.h>
+/* Forward Declarations */
+int pexecv(char *path, char *argv[]);
+int copyio();
+int textps();
+
char psapath[] = _PATH_PSA;
char *psaargv[] = { "psa", 0, 0, 0, 0 };
{ 80, 70, 8.27, 11.69 }, /* A4 */
};
-main( ac, av )
+int main( ac, av )
int ac;
char **av;
{
exit( rc );
}
-copyio()
+int copyio()
{
/* implement the FSM needed to do the suspend. Note that
* the last characters will be \031\001 so don't worry
*/
struct timeval tv;
fd_set fdset;
- int ctl = 0, i;
+ int ctl = 0;
notdone:
do {
/EP { SV restore showpage } bind def\n\
%%EndProlog\n";
-textps()
+int textps()
{
struct papersize papersize;
int state = 0, line = 0, col = 0, npages = 0, rc, i;
* Manipulates file descriptors 0, 1, and 2, such that the new child
* is reading from the parent's output.
*/
-pexecv( path, argv )
+int pexecv( path, argv )
char *path, *argv[];
{
int fd[ 2 ], c;