aboutsummaryrefslogtreecommitdiff
path: root/iolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'iolib.c')
-rw-r--r--iolib.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/iolib.c b/iolib.c
index 13f9a31f..35b1dea2 100644
--- a/iolib.c
+++ b/iolib.c
@@ -3,7 +3,7 @@
3** Input/output library to LUA 3** Input/output library to LUA
4*/ 4*/
5 5
6char *rcs_iolib="$Id: iolib.c,v 1.16 1994/11/16 17:38:08 roberto Stab roberto $"; 6char *rcs_iolib="$Id: iolib.c,v 1.17 1994/12/13 15:55:41 roberto Exp roberto $";
7 7
8#include <stdio.h> 8#include <stdio.h>
9#include <ctype.h> 9#include <ctype.h>
@@ -29,7 +29,7 @@ static FILE *in=stdin, *out=stdout;
29static void io_readfrom (void) 29static void io_readfrom (void)
30{ 30{
31 lua_Object o = lua_getparam (1); 31 lua_Object o = lua_getparam (1);
32 if (o == NULL) /* restore standart input */ 32 if (o == LUA_NOOBJECT) /* restore standart input */
33 { 33 {
34 if (in != stdin) 34 if (in != stdin)
35 { 35 {
@@ -74,7 +74,7 @@ static void io_readfrom (void)
74static void io_writeto (void) 74static void io_writeto (void)
75{ 75{
76 lua_Object o = lua_getparam (1); 76 lua_Object o = lua_getparam (1);
77 if (o == NULL) /* restore standart output */ 77 if (o == LUA_NOOBJECT) /* restore standart output */
78 { 78 {
79 if (out != stdout) 79 if (out != stdout)
80 { 80 {
@@ -120,7 +120,7 @@ static void io_writeto (void)
120static void io_appendto (void) 120static void io_appendto (void)
121{ 121{
122 lua_Object o = lua_getparam (1); 122 lua_Object o = lua_getparam (1);
123 if (o == NULL) /* restore standart output */ 123 if (o == LUA_NOOBJECT) /* restore standart output */
124 { 124 {
125 if (out != stdout) 125 if (out != stdout)
126 { 126 {
@@ -177,7 +177,7 @@ static void io_appendto (void)
177static void io_read (void) 177static void io_read (void)
178{ 178{
179 lua_Object o = lua_getparam (1); 179 lua_Object o = lua_getparam (1);
180 if (o == NULL || !lua_isstring(o)) /* free format */ 180 if (!lua_isstring(o)) /* free format */
181 { 181 {
182 int c; 182 int c;
183 char s[256]; 183 char s[256];
@@ -442,12 +442,12 @@ static void io_write (void)
442{ 442{
443 lua_Object o1 = lua_getparam (1); 443 lua_Object o1 = lua_getparam (1);
444 lua_Object o2 = lua_getparam (2); 444 lua_Object o2 = lua_getparam (2);
445 if (o1 == NULL) /* new line */ 445 if (o1 == LUA_NOOBJECT) /* new line */
446 { 446 {
447 fprintf (out, "\n"); 447 fprintf (out, "\n");
448 lua_pushnumber(1); 448 lua_pushnumber(1);
449 } 449 }
450 else if (o2 == NULL) /* free format */ 450 else if (o2 == LUA_NOOBJECT) /* free format */
451 { 451 {
452 int status=0; 452 int status=0;
453 if (lua_isnumber(o1)) 453 if (lua_isnumber(o1))
@@ -475,7 +475,7 @@ static void io_write (void)
475static void io_execute (void) 475static void io_execute (void)
476{ 476{
477 lua_Object o = lua_getparam (1); 477 lua_Object o = lua_getparam (1);
478 if (o == NULL || !lua_isstring (o)) 478 if (!lua_isstring (o))
479 { 479 {
480 lua_error ("incorrect argument to function 'execute`"); 480 lua_error ("incorrect argument to function 'execute`");
481 lua_pushnumber (0); 481 lua_pushnumber (0);
@@ -495,7 +495,7 @@ static void io_execute (void)
495static void io_remove (void) 495static void io_remove (void)
496{ 496{
497 lua_Object o = lua_getparam (1); 497 lua_Object o = lua_getparam (1);
498 if (o == NULL || !lua_isstring (o)) 498 if (!lua_isstring (o))
499 { 499 {
500 lua_error ("incorrect argument to function 'execute`"); 500 lua_error ("incorrect argument to function 'execute`");
501 lua_pushnumber (0); 501 lua_pushnumber (0);