summaryrefslogtreecommitdiff
path: root/fitz/stm_read.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2011-04-04 23:35:45 +0200
committerTor Andersson <tor.andersson@artifex.com>2011-04-04 23:35:45 +0200
commit7cf6ccee8c6b59d8aac17ab6e4673bcb69f5e8d2 (patch)
treeb329db03bae14fca178add9909b78b050345c140 /fitz/stm_read.c
parentefc46353676c27b24f2933dce78305796951a01e (diff)
downloadmupdf-7cf6ccee8c6b59d8aac17ab6e4673bcb69f5e8d2.tar.xz
Le Roi est mort, vive le Roi!
The run-together words are dead! Long live the underscores! The postscript inspired naming convention of using all run-together words has served us well, but it is now time for more readable code. In this commit I have also added the sed script, rename.sed, that I used to convert the source. Use it on your patches and application code.
Diffstat (limited to 'fitz/stm_read.c')
-rw-r--r--fitz/stm_read.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fitz/stm_read.c b/fitz/stm_read.c
index 10626e5d..4a81b9cd 100644
--- a/fitz/stm_read.c
+++ b/fitz/stm_read.c
@@ -67,7 +67,7 @@ fz_read(fz_stream *stm, unsigned char *buf, int len)
}
void
-fz_fillbuffer(fz_stream *stm)
+fz_fill_buffer(fz_stream *stm)
{
int n;
@@ -95,7 +95,7 @@ fz_fillbuffer(fz_stream *stm)
}
fz_error
-fz_readall(fz_buffer **bufp, fz_stream *stm, int initial)
+fz_read_all(fz_buffer **bufp, fz_stream *stm, int initial)
{
fz_buffer *buf;
int n;
@@ -103,23 +103,23 @@ fz_readall(fz_buffer **bufp, fz_stream *stm, int initial)
if (initial < 1024)
initial = 1024;
- buf = fz_newbuffer(initial);
+ buf = fz_new_buffer(initial);
while (1)
{
if (buf->len == buf->cap)
- fz_growbuffer(buf);
+ fz_grow_buffer(buf);
if (buf->len / 200 > initial)
{
- fz_dropbuffer(buf);
+ fz_drop_buffer(buf);
return fz_throw("compression bomb detected");
}
n = fz_read(stm, buf->data + buf->len, buf->cap - buf->len);
if (n < 0)
{
- fz_dropbuffer(buf);
+ fz_drop_buffer(buf);
return fz_rethrow(n, "read error");
}
if (n == 0)
@@ -133,19 +133,19 @@ fz_readall(fz_buffer **bufp, fz_stream *stm, int initial)
}
void
-fz_readline(fz_stream *stm, char *mem, int n)
+fz_read_line(fz_stream *stm, char *mem, int n)
{
char *s = mem;
int c = EOF;
while (n > 1)
{
- c = fz_readbyte(stm);
+ c = fz_read_byte(stm);
if (c == EOF)
break;
if (c == '\r') {
- c = fz_peekbyte(stm);
+ c = fz_peek_byte(stm);
if (c == '\n')
- fz_readbyte(stm);
+ fz_read_byte(stm);
break;
}
if (c == '\n')
@@ -184,7 +184,7 @@ fz_seek(fz_stream *stm, int offset, int whence)
fz_warn("cannot seek backwards");
/* dog slow, but rare enough */
while (offset-- > 0)
- fz_readbyte(stm);
+ fz_read_byte(stm);
}
else
fz_warn("cannot seek");