summaryrefslogtreecommitdiffstats
path: root/baseline/source/gsm_dec
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2021-03-08 21:00:57 -0500
committerJoshua Bakita <jbakita@cs.unc.edu>2021-03-08 21:00:57 -0500
commit99eccfd1169d35fc3a2fda5b58a6f7fe3da71aa4 (patch)
treea6831517aeb4b1b29de1c059fa670b8e05fedb8d /baseline/source/gsm_dec
parent797a8e9b732cd93e907a97ab75ebbc1742031bd2 (diff)
Case Study: Add unified makefile
Diffstat (limited to 'baseline/source/gsm_dec')
0 files changed, 0 insertions, 0 deletions
n class="hl sng">'a' + 'A'; return c; } unsigned long rijndael_enc_fread( void *ptr, unsigned long size, unsigned long count, struct rijndael_enc_FILE *stream ) { unsigned i = stream->cur_pos, i2 = 0; unsigned long number_of_chars_to_read = stream->size - stream->cur_pos >= size * count ? size * count : stream->size - stream->cur_pos; _Pragma( "loopbound min 10 max 16" ) while ( i < stream->cur_pos + number_of_chars_to_read ) ( ( unsigned char * )ptr )[i2++] = stream->data[i++]; stream->cur_pos += number_of_chars_to_read; return number_of_chars_to_read; } unsigned long rijndael_enc_fwrite( const void *ptr, unsigned long size, unsigned long count, struct rijndael_enc_FILE *stream ) { unsigned i = stream->cur_pos, i2 = 0; unsigned long number_of_chars_to_write = stream->size - stream->cur_pos >= size * count ? size * count : stream->size - stream->cur_pos; _Pragma( "loopbound min 0 max 0" ) while ( i < stream->cur_pos + number_of_chars_to_write ) stream->data[i++] = ( ( unsigned char * )ptr )[i2++]; stream->cur_pos += number_of_chars_to_write; return number_of_chars_to_write; } int rijndael_enc_fseek( struct rijndael_enc_FILE *stream, long int offset, Origin origin ) { if ( origin == RIJNDAEL_ENC_SEEK_SET ) { stream->cur_pos = offset; return 0; } else if ( origin == RIJNDAEL_ENC_SEEK_CUR ) { stream->cur_pos += offset; return 0; } else if ( origin == RIJNDAEL_ENC_SEEK_END ) { stream->cur_pos = stream->size + offset; return 0; } return -1; } int rijndael_enc_fgetpos( struct rijndael_enc_FILE *stream, unsigned *position ) { *position = stream->cur_pos; return 0; } int rijndael_enc_feof( struct rijndael_enc_FILE *stream ) { return stream->cur_pos == stream->size ? 1 : 0; }