summaryrefslogtreecommitdiff
path: root/src/lbuffer.c
diff options
context:
space:
mode:
authorLua Team <team@lua.org>2000-11-06 12:00:00 +0000
committerrepogen <>2000-11-06 12:00:00 +0000
commit8cb71cb5548e3138e5d4e4744f52c79d9fafb116 (patch)
tree25859eb162c67eafc46866e0ec3a9a7ebf93157a /src/lbuffer.c
parentb7610da5fed99f59ac73ae452da8839a0f2c1bda (diff)
downloadlua-github-4.0.tar.gz
Lua 4.04.0
Diffstat (limited to 'src/lbuffer.c')
-rw-r--r--src/lbuffer.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/src/lbuffer.c b/src/lbuffer.c
deleted file mode 100644
index 81ff16ca..00000000
--- a/src/lbuffer.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-** $Id: lbuffer.c,v 1.9 1999/02/26 15:48:55 roberto Exp $
-** Auxiliary functions for building Lua libraries
-** See Copyright Notice in lua.h
-*/
-
-
-#include <stdio.h>
-
-#include "lauxlib.h"
-#include "lmem.h"
-#include "lstate.h"
-
-
-/*-------------------------------------------------------
-** Auxiliary buffer
--------------------------------------------------------*/
-
-
-#define EXTRABUFF 32
-
-
-#define openspace(size) if (L->Mbuffnext+(size) > L->Mbuffsize) Openspace(size)
-
-static void Openspace (int size) {
- lua_State *l = L; /* to optimize */
- size += EXTRABUFF;
- l->Mbuffsize = l->Mbuffnext+size;
- luaM_growvector(l->Mbuffer, l->Mbuffnext, size, char, arrEM, MAX_INT);
-}
-
-
-char *luaL_openspace (int size) {
- openspace(size);
- return L->Mbuffer+L->Mbuffnext;
-}
-
-
-void luaL_addchar (int c) {
- openspace(1);
- L->Mbuffer[L->Mbuffnext++] = (char)c;
-}
-
-
-void luaL_resetbuffer (void) {
- L->Mbuffnext = L->Mbuffbase;
-}
-
-
-void luaL_addsize (int n) {
- L->Mbuffnext += n;
-}
-
-int luaL_getsize (void) {
- return L->Mbuffnext-L->Mbuffbase;
-}
-
-int luaL_newbuffer (int size) {
- int old = L->Mbuffbase;
- openspace(size);
- L->Mbuffbase = L->Mbuffnext;
- return old;
-}
-
-
-void luaL_oldbuffer (int old) {
- L->Mbuffnext = L->Mbuffbase;
- L->Mbuffbase = old;
-}
-
-
-char *luaL_buffer (void) {
- return L->Mbuffer+L->Mbuffbase;
-}
-