Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

srec.c File Reference

#include <stdio.h>
#include <ctype.h>
#include "srec.h"

Go to the source code of this file.

Defines

#define C1(l, p)   (ctab[l[p]])
#define C2(l, p)   ((C1(l,p)<<4)|C1(l,p+1))

Functions

int srec_decode (srec_t *srec, char *_line)
int srec_encode (srec_t *srec, char *line)
char * srec_strerror (int error)

Variables

signed char ctab [256]
int ltab [10] = {4,4,6,8,0,4,0,8,6,4}


Define Documentation

#define C1 l,
 )     (ctab[l[p]])
 

Definition at line 55 of file srec.c.

#define C2 l,
 )     ((C1(l,p)<<4)|C1(l,p+1))
 

Definition at line 56 of file srec.c.


Function Documentation

int srec_decode srec_t srec,
char *  _line
 

Definition at line 61 of file srec.c.

References srec_t::addr, C1, C2, srec_t::count, srec_t::data, ltab, SREC_DATA_SIZE, and srec_t::type.

Referenced by image_load(), main(), and srec_load().

int srec_encode srec_t srec,
char *  line
 

Definition at line 131 of file srec.c.

References srec_t::addr, srec_t::count, srec_t::data, ltab, and srec_t::type.

char* srec_strerror int  error  ) 
 

Definition at line 168 of file srec.c.

References SREC_INVALID_CHAR, SREC_INVALID_CKSUM, SREC_INVALID_HDR, SREC_INVALID_LEN, SREC_NULL, SREC_OK, SREC_TOO_LONG, and SREC_TOO_SHORT.

Referenced by main(), and srec_load().


Variable Documentation

signed char ctab[256] [static]
 

Initial value:

 {
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
     0, 1, 2, 3, 4, 5, 6, 7,   8, 9,-1,-1,-1,-1,-1,-1,
    -1,10,11,12,13,14,15,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,10,11,12,13,14,15,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
    -1,-1,-1,-1,-1,-1,-1,-1,  -1,-1,-1,-1,-1,-1,-1,-1,
}

Definition at line 32 of file srec.c.

int ltab[10] = {4,4,6,8,0,4,0,8,6,4} [static]
 

Definition at line 51 of file srec.c.

Referenced by srec_decode(), and srec_encode().


Generated on Fri Feb 25 08:02:47 2005 for brickos by  doxygen 1.3.9.1