#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <errno.h>
#include <netinet/in.h>
#include <string.h>
#include <lx.h>
Go to the source code of this file.
Defines | |
#define | ASSURED_WRITE(fd, buf, len) |
#define | ASSURED_READ(fd, buf, len) |
Functions | |
int | lx_write (const lx_t *lx, const unsigned char *filename) |
write a BrickOS exectutable to a file | |
int | lx_read (lx_t *lx, const unsigned char *filename) |
read a BrickOS executable from a file | |
void | lx_relocate (lx_t *lx, unsigned short base) |
relocate a BrickOS executable to a new base address (may be called repeatedly). |
Definition in file lx.c.
|
Value: if((rc=read(fd,buf,len))!=(len)) { \ close(fd); \ return rc; \ } Definition at line 44 of file lx.c. Referenced by lx_read(). |
|
Value: if((rc=write(fd,buf,len))!=(len)) { \ close(fd); \ return rc; \ } Definition at line 38 of file lx.c. Referenced by lx_write(). |
|
read a BrickOS executable from a file
Definition at line 87 of file lx.c. References ASSURED_READ, lx_t::data_size, malloc(), lx_t::num_relocs, lx_t::reloc, strcmp(), lx_t::text, and lx_t::text_size. Referenced by main(). |
|
relocate a BrickOS executable to a new base address (may be called repeatedly).
Definition at line 139 of file lx.c. References lx_t::base, lx_t::num_relocs, lx_t::reloc, and lx_t::text. Referenced by main(). |
|
write a BrickOS exectutable to a file
Definition at line 51 of file lx.c. References ASSURED_WRITE, lx_t::data_size, lx_t::num_relocs, lx_t::reloc, lx_t::text, and lx_t::text_size. Referenced by main(). |