l_stream->m_current_data = l_stream->m_stored_data;
if (l_is_input) {
- l_stream->m_status |= opj_stream_e_input;
+ l_stream->m_status |= OPJ_STREAM_STATUS_INPUT;
l_stream->m_opj_skip = opj_stream_read_skip;
l_stream->m_opj_seek = opj_stream_read_seek;
}
else {
- l_stream->m_status |= opj_stream_e_output;
+ l_stream->m_status |= OPJ_STREAM_STATUS_OUTPUT;
l_stream->m_opj_skip = opj_stream_write_skip;
l_stream->m_opj_seek = opj_stream_write_seek;
}
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
- if ((!l_stream) || (! (l_stream->m_status & opj_stream_e_input))) {
+ if ((!l_stream) || (! (l_stream->m_status & OPJ_STREAM_STATUS_INPUT))) {
return;
}
{
opj_stream_private_t* l_stream = (opj_stream_private_t*) p_stream;
- if ((!l_stream )|| (! (l_stream->m_status & opj_stream_e_output))) {
+ if ((!l_stream )|| (! (l_stream->m_status & OPJ_STREAM_STATUS_OUTPUT))) {
return;
}
}
/* we are now in the case when the remaining data if not sufficient */
- if (p_stream->m_status & opj_stream_e_end) {
+ if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
l_read_nb_bytes += p_stream->m_bytes_in_buffer;
memcpy(p_buffer,p_stream->m_current_data,p_stream->m_bytes_in_buffer);
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
p_stream->m_bytes_in_buffer = 0;
- p_stream->m_status |= opj_stream_e_end;
+ p_stream->m_status |= OPJ_STREAM_STATUS_END;
/* end of stream */
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;
}
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
p_stream->m_bytes_in_buffer = 0;
- p_stream->m_status |= opj_stream_e_end;
+ p_stream->m_status |= OPJ_STREAM_STATUS_END;
/* end of stream */
return l_read_nb_bytes ? l_read_nb_bytes : (OPJ_SIZE_T)-1;
}
OPJ_SIZE_T l_remaining_bytes = 0;
OPJ_SIZE_T l_write_nb_bytes = 0;
- if (p_stream->m_status & opj_stream_e_error) {
+ if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
return (OPJ_SIZE_T)-1;
}
p_stream->m_user_data);
if (l_current_write_nb_bytes == (OPJ_SIZE_T)-1) {
- p_stream->m_status |= opj_stream_e_error;
+ p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
opj_event_msg(p_event_mgr, EVT_INFO, "Error on writing stream!\n");
return OPJ_FALSE;
}
/* we are now in the case when the remaining data if not sufficient */
- if (p_stream->m_status & opj_stream_e_end) {
+ if (p_stream->m_status & OPJ_STREAM_STATUS_END) {
l_skip_nb_bytes += (OPJ_OFF_T)p_stream->m_bytes_in_buffer;
p_stream->m_current_data += p_stream->m_bytes_in_buffer;
p_stream->m_bytes_in_buffer = 0;
if (l_current_skip_nb_bytes == (OPJ_OFF_T) -1) {
opj_event_msg(p_event_mgr, EVT_INFO, "Stream reached its end !\n");
- p_stream->m_status |= opj_stream_e_end;
+ p_stream->m_status |= OPJ_STREAM_STATUS_END;
p_stream->m_byte_offset += l_skip_nb_bytes;
/* end if stream */
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T) -1;
OPJ_OFF_T l_current_skip_nb_bytes = 0;
OPJ_OFF_T l_skip_nb_bytes = 0;
- if (p_stream->m_status & opj_stream_e_error) {
+ if (p_stream->m_status & OPJ_STREAM_STATUS_ERROR) {
return (OPJ_OFF_T) -1;
}
/* we should flush data */
l_is_written = opj_stream_flush (p_stream, p_event_mgr);
if (! l_is_written) {
- p_stream->m_status |= opj_stream_e_error;
+ p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
p_stream->m_bytes_in_buffer = 0;
return (OPJ_OFF_T) -1;
}
if (l_current_skip_nb_bytes == (OPJ_OFF_T)-1) {
opj_event_msg(p_event_mgr, EVT_INFO, "Stream error!\n");
- p_stream->m_status |= opj_stream_e_error;
+ p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
p_stream->m_byte_offset += l_skip_nb_bytes;
/* end if stream */
return l_skip_nb_bytes ? l_skip_nb_bytes : (OPJ_OFF_T)-1;
p_stream->m_bytes_in_buffer = 0;
if( !(p_stream->m_seek_fn(p_size,p_stream->m_user_data)) ) {
- p_stream->m_status |= opj_stream_e_end;
+ p_stream->m_status |= OPJ_STREAM_STATUS_END;
return OPJ_FALSE;
}
else {
/* reset stream status */
- p_stream->m_status &= (~opj_stream_e_end);
+ p_stream->m_status &= (~OPJ_STREAM_STATUS_END);
p_stream->m_byte_offset = p_size;
}
OPJ_BOOL opj_stream_write_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr)
{
if (! opj_stream_flush(p_stream,p_event_mgr)) {
- p_stream->m_status |= opj_stream_e_error;
+ p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
return OPJ_FALSE;
}
p_stream->m_bytes_in_buffer = 0;
if (! p_stream->m_seek_fn(p_size,p_stream->m_user_data)) {
- p_stream->m_status |= opj_stream_e_error;
+ p_stream->m_status |= OPJ_STREAM_STATUS_ERROR;
return OPJ_FALSE;
}
else {