diff options
Diffstat (limited to 'baseline/source/rijndael_dec/rijndael_dec_libc.c')
| -rw-r--r-- | baseline/source/rijndael_dec/rijndael_dec_libc.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/baseline/source/rijndael_dec/rijndael_dec_libc.c b/baseline/source/rijndael_dec/rijndael_dec_libc.c deleted file mode 100644 index 00390df..0000000 --- a/baseline/source/rijndael_dec/rijndael_dec_libc.c +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | #include "rijndael_dec_libc.h" | ||
| 2 | |||
| 3 | int rijndael_dec_toupper( int c ) | ||
| 4 | { | ||
| 5 | if ( ( c >= 'a' ) && ( c <= 'z' ) ) | ||
| 6 | return c - 'a' + 'A'; | ||
| 7 | return c; | ||
| 8 | } | ||
| 9 | |||
| 10 | unsigned long rijndael_dec_fread( void *ptr, unsigned long size, | ||
| 11 | unsigned long count, struct rijndael_dec_FILE *stream ) | ||
| 12 | { | ||
| 13 | unsigned i = stream->cur_pos, i2 = 0; | ||
| 14 | unsigned long number_of_chars_to_read = | ||
| 15 | stream->size - stream->cur_pos >= size * count ? | ||
| 16 | size * count : stream->size - stream->cur_pos; | ||
| 17 | _Pragma( "loopbound min 10 max 16" ) | ||
| 18 | while ( i < stream->cur_pos + number_of_chars_to_read ) | ||
| 19 | ( ( unsigned char * )ptr )[i2++] = stream->data[i++]; | ||
| 20 | stream->cur_pos += number_of_chars_to_read; | ||
| 21 | return number_of_chars_to_read; | ||
| 22 | } | ||
| 23 | |||
| 24 | unsigned long rijndael_dec_fwrite( const void *ptr, unsigned long size, | ||
| 25 | unsigned long count, struct rijndael_dec_FILE *stream ) | ||
| 26 | { | ||
| 27 | unsigned i = stream->cur_pos, i2 = 0; | ||
| 28 | unsigned long number_of_chars_to_write = | ||
| 29 | stream->size - stream->cur_pos >= size * count ? | ||
| 30 | size * count : stream->size - stream->cur_pos; | ||
| 31 | _Pragma( "loopbound min 0 max 0" ) | ||
| 32 | while ( i < stream->cur_pos + number_of_chars_to_write ) | ||
| 33 | stream->data[i++] = ( ( unsigned char * )ptr )[i2++]; | ||
| 34 | stream->cur_pos += number_of_chars_to_write; | ||
| 35 | return number_of_chars_to_write; | ||
| 36 | } | ||
| 37 | |||
| 38 | int rijndael_dec_fseek( struct rijndael_dec_FILE *stream, long int offset, | ||
| 39 | Origin origin ) | ||
| 40 | { | ||
| 41 | if ( origin == RIJNDAEL_DEC_SEEK_SET ) { | ||
| 42 | stream->cur_pos = offset; | ||
| 43 | return 0; | ||
| 44 | } else | ||
| 45 | if ( origin == RIJNDAEL_DEC_SEEK_CUR ) { | ||
| 46 | stream->cur_pos += offset; | ||
| 47 | return 0; | ||
| 48 | } else | ||
| 49 | if ( origin == RIJNDAEL_DEC_SEEK_END ) { | ||
| 50 | stream->cur_pos = stream->size + offset; | ||
| 51 | return 0; | ||
| 52 | } | ||
| 53 | return -1; | ||
| 54 | } | ||
| 55 | |||
| 56 | int rijndael_dec_fgetpos( struct rijndael_dec_FILE *stream, | ||
| 57 | unsigned *position ) | ||
| 58 | { | ||
| 59 | *position = stream->cur_pos; | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | int rijndael_dec_feof( struct rijndael_dec_FILE *stream ) | ||
| 64 | { | ||
| 65 | return stream->cur_pos == stream->size ? 1 : 0; | ||
| 66 | } | ||
