diff options
| -rw-r--r-- | inout.c | 20 | ||||
| -rw-r--r-- | opcode.h | 8 |
2 files changed, 4 insertions, 24 deletions
| @@ -4,7 +4,7 @@ | |||
| 4 | ** facilities. | 4 | ** facilities. |
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | char *rcs_inout="$Id: $"; | 7 | char *rcs_inout="$Id: inout.c,v 1.1 1993/12/17 18:41:19 celes Exp roberto $"; |
| 8 | 8 | ||
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| 10 | #include <string.h> | 10 | #include <string.h> |
| @@ -48,14 +48,6 @@ static int fileinput (void) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | /* | 50 | /* |
| 51 | ** Function to unget the next character from to input file | ||
| 52 | */ | ||
| 53 | static void fileunput (int c) | ||
| 54 | { | ||
| 55 | ungetc (c, fp); | ||
| 56 | } | ||
| 57 | |||
| 58 | /* | ||
| 59 | ** Function to get the next character from the input string | 51 | ** Function to get the next character from the input string |
| 60 | */ | 52 | */ |
| 61 | static int stringinput (void) | 53 | static int stringinput (void) |
| @@ -65,14 +57,6 @@ static int stringinput (void) | |||
| 65 | } | 57 | } |
| 66 | 58 | ||
| 67 | /* | 59 | /* |
| 68 | ** Function to unget the next character from to input string | ||
| 69 | */ | ||
| 70 | static void stringunput (int c) | ||
| 71 | { | ||
| 72 | st--; | ||
| 73 | } | ||
| 74 | |||
| 75 | /* | ||
| 76 | ** Function to open a file to be input unit. | 60 | ** Function to open a file to be input unit. |
| 77 | ** Return 0 on success or 1 on error. | 61 | ** Return 0 on success or 1 on error. |
| 78 | */ | 62 | */ |
| @@ -80,7 +64,6 @@ int lua_openfile (char *fn) | |||
| 80 | { | 64 | { |
| 81 | lua_linenumber = 1; | 65 | lua_linenumber = 1; |
| 82 | lua_setinput (fileinput); | 66 | lua_setinput (fileinput); |
| 83 | lua_setunput (fileunput); | ||
| 84 | fp = fopen (fn, "r"); | 67 | fp = fopen (fn, "r"); |
| 85 | if (fp == NULL) return 1; | 68 | if (fp == NULL) return 1; |
| 86 | if (lua_addfile (fn)) return 1; | 69 | if (lua_addfile (fn)) return 1; |
| @@ -107,7 +90,6 @@ int lua_openstring (char *s) | |||
| 107 | { | 90 | { |
| 108 | lua_linenumber = 1; | 91 | lua_linenumber = 1; |
| 109 | lua_setinput (stringinput); | 92 | lua_setinput (stringinput); |
| 110 | lua_setunput (stringunput); | ||
| 111 | st = s; | 93 | st = s; |
| 112 | { | 94 | { |
| 113 | char sn[64]; | 95 | char sn[64]; |
| @@ -1,6 +1,6 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** TeCGraf - PUC-Rio | 2 | ** TeCGraf - PUC-Rio |
| 3 | ** $Id: $ | 3 | ** $Id: opcode.h,v 1.1 1993/12/17 18:41:19 celes Exp roberto $ |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | #ifndef opcode_h | 6 | #ifndef opcode_h |
| @@ -82,7 +82,6 @@ typedef enum | |||
| 82 | 82 | ||
| 83 | typedef void (*Cfunction) (void); | 83 | typedef void (*Cfunction) (void); |
| 84 | typedef int (*Input) (void); | 84 | typedef int (*Input) (void); |
| 85 | typedef void (*Unput) (int ); | ||
| 86 | 85 | ||
| 87 | typedef union | 86 | typedef union |
| 88 | { | 87 | { |
| @@ -132,9 +131,8 @@ int lua_execute (Byte *pc); | |||
| 132 | void lua_markstack (void); | 131 | void lua_markstack (void); |
| 133 | char *lua_strdup (char *l); | 132 | char *lua_strdup (char *l); |
| 134 | 133 | ||
| 135 | void lua_setinput (Input fn); /* from "lua.lex" module */ | 134 | void lua_setinput (Input fn); /* from "lex.c" module */ |
| 136 | void lua_setunput (Unput fn); /* from "lua.lex" module */ | 135 | char *lua_lasttext (void); /* from "lex.c" module */ |
| 137 | char *lua_lasttext (void); /* from "lua.lex" module */ | ||
| 138 | int lua_parse (void); /* from "lua.stx" module */ | 136 | int lua_parse (void); /* from "lua.stx" module */ |
| 139 | void lua_type (void); | 137 | void lua_type (void); |
| 140 | void lua_obj2number (void); | 138 | void lua_obj2number (void); |
