default: ldc
+CFLAGS=-Wall
+
%.o: %.c *.h
@echo -n Baue: $@
@echo
- @gcc -c -Wunknown-pragmas -o$@ $<
+ @gcc ${CFLAGS} -c -Wunknown-pragmas -o$@ $<
ldc: ldc.o process.o hw_helpers.o tape.o split.o
};
struct hw16_bytes {
- unsigned char low __attribute__ ((packed));
- unsigned char high __attribute__ ((packed));
-};
+ unsigned char low;
+ unsigned char high;
+} __attribute__((packed)) w;
struct hw16_otype {
unsigned int space1:6 __attribute__ ((packed));
typedef union {
- struct hw16_bits bits __attribute__ ((packed));
- struct hw16_bytes bytes __attribute__ ((packed));
- struct hw16_tape tape __attribute__ ((packed));
- struct hw16_otype blocktype __attribute__ ((packed));
- unsigned short value __attribute__ ((packed));
-} hw16;
+ struct hw16_bits bits;
+ struct hw16_bytes bytes;
+ struct hw16_tape tape;
+ struct hw16_otype blocktype;
+ unsigned short value;
+} __attribute__ ((packed)) hw16;
enum {BT_DATA,BT_STOP};
#include <sys/select.h>
#include "hw_types.h"
#include "hw_helpers.h"
+#include "tape.h"
+#include "process.h"
+#include "split.h"
+
#define XON 0x11
#define XOFF 0x13
#define CHAR_START 0x81
--- /dev/null
+#ifndef LDC_H
+#define LDC_H
+
+void errf (char *format, ...);
+
+#endif
#include "hw_helpers.h"
#include "process.h"
-
+#include "ldc.h"
//#define DEBUG_DATA
/**********************************************************************/
char ** extract_labels0(datablock * blockp){
char ** result=(char **) malloc (sizeof(char **));
- result[0]==NULL;
+ result[0] = NULL;
if (get_blocktype(blockp)!=0) return NULL;
datablock block;
strncpy (aktres,akt+dd,strlen(akt+dd));
result=(char **)realloc(result, (c+1)* sizeof(char**));
result[c]=aktres;
-// printf("akt: %s\n",result[c]);
}
result=(char **)realloc(result, (c+1)* sizeof(char**));
result[c]=NULL;
}
void dispose_labels(char ** labels){
- char * akt;
if (labels==NULL) return;
int c=0;
do {
void process_block (datablock * block);
int get_blocktype (datablock * block);
-int get_subblocktype (datablock * block);
+int get_blocksubtype(datablock * block);
void block_copy(datablock * dest, datablock* src);
datablock * block_clone(datablock * original);
void block_dispose(datablock * victim);
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <unistd.h>
#include "hw_types.h"
#include "hw_helpers.h"
#include <sys/stat.h>
#include <fcntl.h>
#include <signal.h>
+#include <unistd.h>
#include "tape.h"
void tapeinit(int fg);
-void tapeclose();
-void tapestart();
-void tapestop();
+void tapeclose(void);
+void tapestart(void);
+void tapestop(void);