31 #include <sys/types.h>
38 #define LINE_SIZE 1024
116 qDebug() <<
": mmap'ing history failed. errno = " << errno;
123 assert( result == 0 );
142 rc = lseek(
ion,
length,
SEEK_SET);
if (rc < 0) { perror(
"HistoryFile::add.seek");
return; }
143 rc = write(
ion,bytes,len);
if (rc < 0) { perror(
"HistoryFile::add.write");
return; }
159 for (
int i=0;i<
len;i++)
166 if (loc < 0 || len < 0 || loc + len >
length)
167 fprintf(stderr,
"getHist(...,%d,%d): invalid args.\n",len,loc);
168 rc = lseek(
ion,loc,
SEEK_SET);
if (rc < 0) { perror(
"HistoryFile::get.seek");
return; }
169 rc = read(
ion,bytes,len);
if (rc < 0) { perror(
"HistoryFile::get.read");
return; }
212 m_logFileName(logFileName)
232 if (lineno>=0 && lineno <=
getLines()) {
234 lineflags.
get((
unsigned char*)&flag,
sizeof(
unsigned char),(lineno)*
sizeof(
unsigned char));
242 if (lineno <= 0)
return 0;
250 index.
get((
unsigned char*)&res,
sizeof(
int),(lineno-1)*
sizeof(
int));
272 index.
add((
unsigned char*)&locn,
sizeof(
int));
273 unsigned char flags = previousWrapped ? 0x01 : 0x00;
274 lineflags.
add((
unsigned char*)&flags,
sizeof(
unsigned char));
311 qCopy(a,a+count,newLine.begin());
355 if ( count == 0 )
return;
361 memset(buffer, 0, count *
sizeof(
Character));
371 Q_ASSERT( startColumn <= line.size() - count );
373 memcpy(buffer, line.constData() + startColumn , count *
sizeof(
Character));
381 for (
int i = 0 ; i < qMin(
_usedLines,(
int)lineCount) ; i++ )
398 Q_ASSERT( lineNumber >= 0 );
494 memset(res, 0, count *
sizeof(
Character));
620 for(
int i = startLine; i < lines; i++)
626 old->
getCells(i, 0, size, tmp_line);
627 newScroll->
addCells(tmp_line, size);
647 : m_fileName(fileName)
663 if (dynamic_cast<HistoryFile *>(old))
669 int lines = (old != 0) ? old->
getLines() : 0;
670 for(
int i = 0; i < lines; i++)
676 old->
getCells(i, 0, size, tmp_line);
677 newScroll->
addCells(tmp_line, size);