-char *wxStreamBuffer::AllocSpaceWBack(size_t needed_size)
-{
- char *temp_b;
-
- m_wbacksize += needed_size;
-
- if (!m_wback)
- temp_b = (char *)malloc(m_wbacksize);
- else
- temp_b = (char *)realloc(m_wback, m_wbacksize);
-
- if (!temp_b)
- return NULL;
- m_wback = temp_b;
-
- /* printf("Buffer(0x%x)->Write: 0x%x, %d\n", this, m_wback, m_wbacksize); */
-
- return (char *)(m_wback+(m_wbacksize-needed_size));
-}
-
-size_t wxStreamBuffer::GetWBack(char *buf, size_t bsize)
-{
- size_t s_toget = m_wbacksize-m_wbackcur;
-
- /* printf("Buffer(0x%x): 0x%x, %d\n", this, m_wback, m_wbacksize); */
-
- if (bsize < s_toget)
- s_toget = bsize;
-
- memcpy(buf, (m_wback+m_wbackcur), s_toget);
-
- m_wbackcur += s_toget;
- if (m_wbackcur == m_wbacksize) {
- free(m_wback);
- m_wback = (char *)NULL;
- m_wbacksize = 0;
- m_wbackcur = 0;
- }
-
- return s_toget;
-}
-