#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <j2k/Fred/JFile.cpp>
Go to the source code of this file.
Defines | |
#define | MAX 80 |
#define | UCHAR unsigned char |
#define | USHORT unsigned short |
Functions | |
void | save () |
void | load () |
void | toDisk () |
void | fromDisk () |
void | test () |
Variables | |
short | table [80] |
char | buffer [80 *2] |
size_t | length = 0 |
|
Definition at line 48 of file FileNb255.cpp. |
|
Definition at line 49 of file FileNb255.cpp. |
|
Definition at line 50 of file FileNb255.cpp. |
|
Definition at line 118 of file FileNb255.cpp. Referenced by test().
|
|
Definition at line 81 of file FileNb255.cpp. Referenced by test().
00082 { 00083 register unsigned short i = 0; 00084 register unsigned char c = NULL; 00085 register unsigned short pos = 0; 00086 memset( buffer, 0, MAX ); 00087 for( i = 0; i < MAX; i++ ) 00088 { 00089 c = (UCHAR)buffer[ pos ]; 00090 pos++; 00091 if ( c < 255 ) { 00092 table[ i ] = (USHORT)c; 00093 } else if ( c == 255 ) { 00094 c = (UCHAR)buffer[ pos ]; 00095 pos++; 00096 table[ i ] = (USHORT)c; 00097 } else { 00098 printf( "Error: Number too big." ); 00099 } 00100 } 00101 length = pos; 00102 } |
|
Definition at line 56 of file FileNb255.cpp. Referenced by test().
00057 { 00058 register unsigned short i = 0; 00059 register unsigned char c = NULL; 00060 register unsigned short pos = 0; 00061 memset( buffer, 0, MAX ); 00062 for( i = 0; i < MAX; i++ ) 00063 { 00064 if ( table[ i ] < 255 ) { 00065 c = (UCHAR)table[ i ]; 00066 buffer[ pos ] = c; 00067 pos++; 00068 } else if ( table[ i ] < 510 ) { 00069 c = (UCHAR)(table[ i ] - 255); 00070 buffer[ pos ] = 255; 00071 pos++; 00072 buffer[ pos ] = c; 00073 pos++; 00074 } else { 00075 printf( "Error: Number too big." ); 00076 } 00077 } 00078 length = pos; 00079 } |
|
Definition at line 124 of file FileNb255.cpp. |
|
Definition at line 112 of file FileNb255.cpp. Referenced by test().
|
|
Definition at line 53 of file FileNb255.cpp. |
|
Definition at line 54 of file FileNb255.cpp. |
|
Definition at line 52 of file FileNb255.cpp. |