Lines Matching refs:buffer

58 #define FILEBUFFERSIZE 4096     /* 4k for each file buffer entry */
62 unsigned char *buffer; /* do not use pointer here and set it the first */
64 size_t index; /* nth buffer, from 0, 1, ... */
67 BOOL bMalloc; /* flag, if the buffer malloced here ? */
106 size: size of buffer.
107 buffer: is NULL, allocate here and set bMalloc as TRUE; otherwise use the external buffer
109 FileBufferFrame* CreateFileBufferFrame(size_t size, unsigned char *buffer)
123 if (buffer)
124 fb->buffer = buffer;
127 /* create one buffer frame */
128 if ((fb->buffer = (unsigned char *)MALLOC(size, "FileBufferFrame Buffer")) == NULL)
153 FREE(curr->buffer);
305 PortFile->curPos = PortFile->curFrame->buffer;
322 PortFile->endPos = curFrame->buffer + end;
384 size_t PortFread(void *buffer, size_t size, size_t count, PORT_FILE PortFile)
386 unsigned char *bufferPtr = (unsigned char *)buffer;
391 passert(buffer);
404 if (PortFile->curPos == curFrame->buffer + curFrame->size) /* end of this frame */
408 PortFile->curPos = curFrame->buffer;
414 cbAvail = curFrame->size - (PortFile->curPos - curFrame->buffer);
432 swap_byte_order((char *)buffer, count, size);
446 unsigned char *buffer = (unsigned char *)data;
454 /* write data until the end of the internal buffer */
464 if (PortFile->curPos == curFrame->buffer + curFrame->size) /* end of this frame */
478 PortFile->curPos = PortFile->endPos = nextFrame->buffer;
492 cbAvail = curFrame->size - (PortFile->curPos - curFrame->buffer);
495 memcpy((char *)PortFile->curPos, buffer, minSize);
496 buffer += minSize;
531 PortFile->curPos = PortFile->startFrame->buffer;
547 if (PortFile->curPos == curFrame->buffer + curFrame->size) /* end of this frame */
554 PortFile->curPos = curFrame->buffer;
559 cbAvail = curFrame->size - (PortFile->curPos - curFrame->buffer);
568 if (PortFile->startFrame->buffer == PortFile->curPos) /* start of file */
571 if (PortFile->curPos <= curFrame->buffer) /* start of this frame */
578 PortFile->curPos = curFrame->buffer + curFrame->size;
580 cbAvail = PortFile->curPos - curFrame->buffer;
602 size = PortFile->curPos - curFrame->buffer;
615 /* Print formatted message to buffer */
646 /* Print formatted message to buffer */
735 (PortFile->endPos - PortFile->endFrame->buffer);
815 PortFile->curPos = PortFile->startFrame->buffer;
834 char* PortGetcwd(char *buffer, int maxlen)
837 buffer[0] = '\0';
841 return buffer;