Commit of 3.99.3 version
This commit is contained in:
@@ -30,6 +30,7 @@ Other extensions are more "useful":
|
||||
- socket.c: simple support (and hence limited) for sockets. It allows you
|
||||
to make simple clients and servers program using TCP/IP
|
||||
- sregexp.c Regular expressions
|
||||
- base64. c provide base64 file endoding and decoding.
|
||||
|
||||
|
||||
For more informations on extension building, read the document
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#
|
||||
# Author: Erick Gallesio [eg@kaolin.unice.fr]
|
||||
# Creation date: 6-Mar-1994 15:49
|
||||
# Last file update: 2-Jun-1998 17:44
|
||||
# Last file update: 20-Jul-1998 19:37
|
||||
|
||||
include ../config.make
|
||||
|
||||
@@ -34,7 +34,8 @@ CFLAGS= $(SH_CCFLAGS) $(STKCFLAGS) $(DFLGS) -DUSE_TK @DEFS@ \
|
||||
all: $(EXTRA_OBJ)
|
||||
chmod 0755 stk-genmake
|
||||
|
||||
# Following lines are needed for weird make commands. Use Gnu make....
|
||||
# Following lines are needed for weird make commands.
|
||||
# You really should use Gnu make....
|
||||
hash.$(SH_SUFFIX): hash.o
|
||||
sregexp.$(SH_SUFFIX): sregexp.o
|
||||
process.$(SH_SUFFIX): process.o
|
||||
@@ -43,6 +44,7 @@ posix.$(SH_SUFFIX): posix.o
|
||||
html.$(SH_SUFFIX): html.o
|
||||
pixmap.$(SH_SUFFIX): pixmap.o
|
||||
jpeg.$(SH_SUFFIX): jpeg.o
|
||||
base64.$(SH_SUFFIX): base64.o
|
||||
examples: $(EXAMPLES)
|
||||
|
||||
install:
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
*
|
||||
* b a s e 6 4 . c -- Base64 support for STk
|
||||
*
|
||||
* Copyright © 1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, and/or distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that both the above copyright notice and this permission notice appear in
|
||||
* all copies and derived works. Fees for distribution or use of this
|
||||
* software or derived works may only be charged with express written
|
||||
* permission of the copyright holder.
|
||||
* This software is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* Author: Erick Gallesio [eg@unice.fr]
|
||||
* Creation date: 20-Jul-1998 12:19
|
||||
* Last file update: 20-Jul-1998 19:40
|
||||
*/
|
||||
|
||||
#include <stk.h>
|
||||
#include <ctype.h>
|
||||
|
||||
static char table[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
static char rev_table[128];
|
||||
|
||||
#define OutChar(c, f) {Putc((c), (f)); if (++count>=72) {Putc('\n', (f)); count=0;}}
|
||||
|
||||
static void initialize_rev_table(void)
|
||||
{
|
||||
char *p;
|
||||
int count = 0;
|
||||
|
||||
for (p = table; *p; p++) rev_table[*p] = count++;
|
||||
}
|
||||
|
||||
static void encode(FILE *f, FILE *g)
|
||||
{
|
||||
int c, state, count, old;
|
||||
|
||||
state = old = count = 0;
|
||||
while ((c = Getc(f)) != EOF) {
|
||||
switch (++state) {
|
||||
case 1: OutChar(table[(c>>2) & 0x3f], g);
|
||||
break;
|
||||
case 2: OutChar(table[((old<<4) & 0x30) | ((c>>4) & 0x0f)], g);
|
||||
break;
|
||||
case 3: OutChar(table[((old<<2) & 0x3c) | ((c>>6) & 0x03)], g);
|
||||
OutChar(table[c & 0x3f], g);
|
||||
state = 0;
|
||||
break;
|
||||
}
|
||||
old = c;
|
||||
}
|
||||
switch (state) {
|
||||
case 0: /* nothing */;
|
||||
case 1: OutChar(table[(old<<4) & 0x30], g);
|
||||
OutChar('=', g);
|
||||
OutChar('=', g);
|
||||
break;
|
||||
case 2: OutChar(table[(old<<2) & 0x3c], g);
|
||||
OutChar('=', g);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void decode(FILE *f, FILE *g)
|
||||
{
|
||||
static int initialized = 0;
|
||||
int c, bits, group, j;
|
||||
|
||||
if (!initialized) {
|
||||
initialize_rev_table();
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
group = 0; j = 18;
|
||||
while ((c = Getc(f)) != EOF) {
|
||||
if (c != '\n') {
|
||||
if (c != '=') {
|
||||
bits = rev_table[c];
|
||||
group |= bits << j;
|
||||
}
|
||||
|
||||
j -= 6;
|
||||
|
||||
if (j < 0) {
|
||||
c = (group&0xff0000) >> 16; if (c) Putc(c, g);
|
||||
c = (group&0x00ff00) >> 8; if (c) Putc(c, g);
|
||||
c = (group&0x0000ff); if (c) Putc(c, g);
|
||||
group = 0;
|
||||
j = 18;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static PRIMITIVE base64_encode(SCM f, SCM g)
|
||||
{
|
||||
ENTER_PRIMITIVE("base64-encode");
|
||||
|
||||
if (!INP(f)) Serror("bad input port", f);
|
||||
if (g == UNBOUND)
|
||||
g = STk_curr_oport;
|
||||
else
|
||||
if (!OUTP(g)) Serror("bad output port", g);
|
||||
|
||||
encode(PORT_FILE(f), PORT_FILE(g));
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
static PRIMITIVE base64_decode(SCM f, SCM g)
|
||||
{
|
||||
ENTER_PRIMITIVE("base64-decode");
|
||||
|
||||
if (!INP(f)) Serror("bad input port", f);
|
||||
if (g == UNBOUND)
|
||||
g = STk_curr_oport;
|
||||
else
|
||||
if (!OUTP(g)) Serror("bad output port", g);
|
||||
|
||||
decode(PORT_FILE(f), PORT_FILE(g));
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
PRIMITIVE STk_init_base64(void)
|
||||
{
|
||||
STk_add_new_primitive("base64-decode", tc_subr_1_or_2, base64_decode);
|
||||
STk_add_new_primitive("base64-encode", tc_subr_1_or_2, base64_encode);
|
||||
return UNDEFINED;
|
||||
}
|
||||
+11
-11
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* h a s h . c -- Hash Tables
|
||||
*
|
||||
* Copyright © 1993-1997 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
* Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, and/or distribute this software and its
|
||||
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* Author: Erick Gallesio [eg@kaolin.unice.fr]
|
||||
* Creation date: 17-Jan-1994 17:49
|
||||
* Last file update: 31-Dec-1997 15:36
|
||||
* Last file update: 15-Jul-1998 17:34
|
||||
*/
|
||||
|
||||
#include <stk.h>
|
||||
@@ -263,22 +263,22 @@ static PRIMITIVE hash_table_put(SCM ht, SCM key, SCM val)
|
||||
break;
|
||||
case hash_comp:
|
||||
index = Apply(HASH_SXHASH(ht), LIST1(key));
|
||||
entry = Tcl_CreateHashEntry(HASH_H(ht), (char *) index, &new);
|
||||
Tcl_SetHashValue(entry, NIL); /* To avoid GC problems in further allocations
|
||||
* Thanks to S. Calvo <sarah@grammatech.com> */
|
||||
if (new)
|
||||
Tcl_SetHashValue(entry, LIST1(Cons(key, val)));
|
||||
else {
|
||||
SCM old = (SCM) Tcl_GetHashValue(entry);
|
||||
if ((entry=Tcl_FindHashEntry(HASH_H(ht), (char *) index)) != NULL) {
|
||||
SCM old = (SCM) Tcl_GetHashValue(entry); /* waz here */
|
||||
SCM tmp = find_key(key, old, HASH_COMP(ht));
|
||||
|
||||
if (tmp) {
|
||||
CAR(tmp) = key;
|
||||
CDR(tmp) = val;
|
||||
CAR(tmp) = key; /* Generally useless. But we don't master the hash fct */
|
||||
CDR(tmp) = val; /* (i.e. it can have side-effects) */
|
||||
}
|
||||
else
|
||||
Tcl_SetHashValue(entry, Cons(Cons(key, val), old));
|
||||
}
|
||||
else { /* new bucket */
|
||||
SCM tmp = LIST1(Cons(key, val)); /* place it in tmp to avoid GC problems */
|
||||
entry = Tcl_CreateHashEntry(HASH_H(ht), (char *) index, &new);
|
||||
Tcl_SetHashValue(entry, tmp);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return UNDEFINED;
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
* Department of Computer Science,
|
||||
* University of California, Berkeley
|
||||
*
|
||||
* $Id: jpeg.c 1.1 Sat, 03 Jan 1998 12:46:25 +0000 eg $
|
||||
* $Id: jpeg.c 1.1 Sat, 03 Jan 1998 13:46:25 +0100 eg $
|
||||
*
|
||||
* Parts of this file are based on code under the following
|
||||
* copyrights. Include these copyrights if you do anything
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
*
|
||||
* l o c a l e . c -- Locale management
|
||||
*
|
||||
*
|
||||
* Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, and/or distribute this software and its
|
||||
* documentation for any purpose and without fee is hereby granted, provided
|
||||
* that both the above copyright notice and this permission notice appear in
|
||||
* all copies and derived works. Fees for distribution or use of this
|
||||
* software or derived works may only be charged with express written
|
||||
* permission of the copyright holder.
|
||||
* This software is provided ``as is'' without express or implied warranty.
|
||||
*
|
||||
* This software is a derivative work of other copyrighted softwares; the
|
||||
* copyright notices of these softwares are placed in the file COPYRIGHTS
|
||||
*
|
||||
*
|
||||
* Author: Erick Gallesio [eg@kaolin.unice.fr]
|
||||
* Creation date: 19-Sep-1998 12:01
|
||||
* Last file update: 19-Sep-1998 15:02
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <locale.h>
|
||||
#include <stdlib.h>
|
||||
#include "stk.h"
|
||||
|
||||
static char bad_string_message[] = "comparing strings: bad string";
|
||||
static char bad_char_message[] = "comparing chars: bad char";
|
||||
|
||||
static char *locale_name = "";
|
||||
|
||||
|
||||
/*==== Utilities ====*/
|
||||
|
||||
static int compare(unsigned char c1, unsigned char c2)
|
||||
{
|
||||
unsigned char s1[2] = " ";
|
||||
unsigned char s2[2] = " ";
|
||||
|
||||
/* This is really UGLY but can we write it in a cleaner way using
|
||||
* only pure ANSI-C primitives? */
|
||||
*s1 = c1; *s2 = c2;
|
||||
return strcoll((char *)s1, (char *)s2);
|
||||
}
|
||||
|
||||
|
||||
static int stringcomp(SCM s1, SCM s2)
|
||||
{
|
||||
register int l1, l2;
|
||||
register char *str1, *str2;
|
||||
|
||||
if (NSTRINGP(s1)) Err(bad_string_message, s1);
|
||||
if (NSTRINGP(s2)) Err(bad_string_message, s2);
|
||||
|
||||
for (l1=STRSIZE(s1), str1=CHARS(s1), l2=STRSIZE(s2), str2=CHARS(s2);
|
||||
l1 && l2;
|
||||
l1--, str1++, l2--, str2++)
|
||||
if (*str1 != *str2)
|
||||
return compare((unsigned char) *str1,
|
||||
(unsigned char) *str2);
|
||||
|
||||
/* l1 == 0 || l2 == 0 */
|
||||
return l1 ? +1 : (l2 ? -1 : 0);
|
||||
}
|
||||
|
||||
static int stringcompci(SCM s1, SCM s2)
|
||||
{
|
||||
register int l1, l2;
|
||||
register char *str1, *str2;
|
||||
|
||||
if (NSTRINGP(s1)) Err(bad_string_message, s1);
|
||||
if (NSTRINGP(s2)) Err(bad_string_message, s2);
|
||||
|
||||
for (l1=STRSIZE(s1), str1=CHARS(s1), l2=STRSIZE(s2), str2=CHARS(s2);
|
||||
l1 && l2;
|
||||
l1--, str1++, l2--, str2++)
|
||||
if (tolower(*str1) != tolower(*str2))
|
||||
return compare((unsigned char) tolower(*str1),
|
||||
(unsigned char) tolower(*str2));
|
||||
|
||||
/* l1 == 0 || l2 == 0 */
|
||||
return l1 ? +1 : (l2 ? -1 : 0);
|
||||
}
|
||||
|
||||
static int charcomp(SCM c1, SCM c2)
|
||||
{
|
||||
if (NCHARP(c1)) Err(bad_char_message, c1);
|
||||
if (NCHARP(c2)) Err(bad_char_message, c2);
|
||||
|
||||
return compare(CHAR(c1), CHAR(c2));
|
||||
}
|
||||
|
||||
static int charcompci(SCM c1, SCM c2)
|
||||
{
|
||||
if (NCHARP(c1)) Err(bad_char_message, c1);
|
||||
if (NCHARP(c2)) Err(bad_char_message, c2);
|
||||
|
||||
return compare((unsigned char) tolower(CHAR(c1)),
|
||||
(unsigned char) tolower(CHAR(c2)));
|
||||
}
|
||||
|
||||
/*==== Primitives ====*/
|
||||
|
||||
static PRIMITIVE set_locale(SCM locale)
|
||||
{
|
||||
char *res;
|
||||
|
||||
ENTER_PRIMITIVE("set-locale!");
|
||||
|
||||
if (!STRINGP(locale)) Serror("bad string", locale);
|
||||
|
||||
if ((res=setlocale(LC_ALL, CHARS(locale))) == NULL)
|
||||
Serror("bad locale", locale);
|
||||
locale_name = res;
|
||||
return STk_makestring(res);
|
||||
}
|
||||
|
||||
static PRIMITIVE get_locale(void)
|
||||
{
|
||||
return STk_makestring(locale_name);
|
||||
}
|
||||
|
||||
static PRIMITIVE eq (SCM s1,SCM s2){return (stringcomp(s1,s2)==0)? Truth: Ntruth;}
|
||||
static PRIMITIVE lt (SCM s1,SCM s2){return (stringcomp(s1,s2)<0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE gt (SCM s1,SCM s2){return (stringcomp(s1,s2)>0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE le (SCM s1,SCM s2){return (stringcomp(s1,s2)<=0)? Truth: Ntruth;}
|
||||
static PRIMITIVE ge (SCM s1,SCM s2){return (stringcomp(s1,s2)>=0)? Truth: Ntruth;}
|
||||
|
||||
static PRIMITIVE eqci(SCM s1,SCM s2){return (stringcompci(s1,s2)==0)? Truth:Ntruth;}
|
||||
static PRIMITIVE ltci(SCM s1,SCM s2){return (stringcompci(s1,s2)<0) ? Truth:Ntruth;}
|
||||
static PRIMITIVE gtci(SCM s1,SCM s2){return (stringcompci(s1,s2)>0) ? Truth:Ntruth;}
|
||||
static PRIMITIVE leci(SCM s1,SCM s2){return (stringcompci(s1,s2)<=0)? Truth:Ntruth;}
|
||||
static PRIMITIVE geci(SCM s1,SCM s2){return (stringcompci(s1,s2)>=0)? Truth:Ntruth;}
|
||||
|
||||
static PRIMITIVE Ceq (SCM c1, SCM c2){return (charcomp(c1,c2)==0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE Clt (SCM c1, SCM c2){return (charcomp(c1,c2)<0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE Cgt (SCM c1, SCM c2){return (charcomp(c1,c2)>0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE Cle (SCM c1, SCM c2){return (charcomp(c1,c2)<=0) ? Truth: Ntruth;}
|
||||
static PRIMITIVE Cge (SCM c1, SCM c2){return (charcomp(c1,c2)>=0) ? Truth: Ntruth;}
|
||||
|
||||
static PRIMITIVE Ceqci(SCM c1, SCM c2){return (charcompci(c1,c2)==0)? Truth:Ntruth;}
|
||||
static PRIMITIVE Cltci(SCM c1, SCM c2){return (charcompci(c1,c2)<0) ? Truth:Ntruth;}
|
||||
static PRIMITIVE Cgtci(SCM c1, SCM c2){return (charcompci(c1,c2)>0) ? Truth:Ntruth;}
|
||||
static PRIMITIVE Cleci(SCM c1, SCM c2){return (charcompci(c1,c2)<=0)? Truth:Ntruth;}
|
||||
static PRIMITIVE Cgeci(SCM c1, SCM c2){return (charcompci(c1,c2)>=0)? Truth:Ntruth;}
|
||||
|
||||
|
||||
PRIMITIVE STk_init_locale(void)
|
||||
{
|
||||
char *lang = getenv("LANG");
|
||||
|
||||
STk_add_new_primitive("set-locale!", tc_subr_1, set_locale);
|
||||
STk_add_new_primitive("get-locale", tc_subr_0, get_locale);
|
||||
|
||||
STk_add_new_primitive("string-lo=?", tc_subr_2, eq);
|
||||
STk_add_new_primitive("string-lo<?", tc_subr_2, lt);
|
||||
STk_add_new_primitive("string-lo>?", tc_subr_2, gt);
|
||||
STk_add_new_primitive("string-lo<=?", tc_subr_2, le);
|
||||
STk_add_new_primitive("string-lo>=?", tc_subr_2, ge);
|
||||
|
||||
STk_add_new_primitive("string-lo-ci=?", tc_subr_2, eqci);
|
||||
STk_add_new_primitive("string-lo-ci<?", tc_subr_2, ltci);
|
||||
STk_add_new_primitive("string-lo-ci>?", tc_subr_2, gtci);
|
||||
STk_add_new_primitive("string-lo-ci<=?", tc_subr_2, leci);
|
||||
STk_add_new_primitive("string-lo-ci>=?", tc_subr_2, geci);
|
||||
|
||||
STk_add_new_primitive("char-lo=?", tc_subr_2, Ceq);
|
||||
STk_add_new_primitive("char-lo<?", tc_subr_2, Clt);
|
||||
STk_add_new_primitive("char-lo>?", tc_subr_2, Cgt);
|
||||
STk_add_new_primitive("char-lo<=?", tc_subr_2, Cle);
|
||||
STk_add_new_primitive("char-lo>=?", tc_subr_2, Cge);
|
||||
|
||||
STk_add_new_primitive("char-lo-ci=?", tc_subr_2, Ceqci);
|
||||
STk_add_new_primitive("char-lo-ci<?", tc_subr_2, Cltci);
|
||||
STk_add_new_primitive("char-lo-ci>?", tc_subr_2, Cgtci);
|
||||
STk_add_new_primitive("char-lo-ci<=?", tc_subr_2, Cleci);
|
||||
STk_add_new_primitive("char-lo-ci>=?", tc_subr_2, Cgeci);
|
||||
|
||||
locale_name = setlocale(LC_ALL, lang ? lang : "");
|
||||
if(!locale_name)
|
||||
/* LANG variable is erroneous, set locale to "C" */
|
||||
locale_name = setlocale(LC_ALL, "C");
|
||||
|
||||
return UNDEFINED;
|
||||
}
|
||||
+16
-16
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* p o s i x . c -- Provide some POSIX.1 functions
|
||||
*
|
||||
* Copyright © 1993-1997 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
* Copyright © 1993-1998 Erick Gallesio - I3S-CNRS/ESSI <eg@unice.fr>
|
||||
*
|
||||
*
|
||||
* Permission to use, copy, and/or distribute this software and its
|
||||
@@ -16,11 +16,11 @@
|
||||
* This software is a derivative work of other copyrighted softwares; the
|
||||
* copyright notices of these softwares are placed in the file COPYRIGHTS
|
||||
*
|
||||
* $Id: posix.c 1.1 Sat, 03 Jan 1998 12:46:25 +0000 eg $
|
||||
* $Id: posix.c 1.2 Thu, 10 Sep 1998 23:44:28 +0200 eg $
|
||||
*
|
||||
* Author: Erick Gallesio [eg@kaolin.unice.fr]
|
||||
* Creation date: 14-Mar-1995 20:14
|
||||
* Last file update: 30-Dec-1997 23:31
|
||||
* Last file update: 10-Sep-1998 15:06
|
||||
*
|
||||
* This file contains also contains code additions from Shiro Kawai
|
||||
* <shiro@sqush.squareusa.com>
|
||||
@@ -92,16 +92,16 @@ static PRIMITIVE posix_stat2vector(SCM descr)
|
||||
info = (struct stat *) EXTDATA(descr);
|
||||
|
||||
z = STk_makevect(10, NIL); /* NIL because some integers are bignums */
|
||||
VECT(z)[0] = STk_makeinteger(info->st_dev);
|
||||
VECT(z)[1] = STk_makeinteger(info->st_ino);
|
||||
VECT(z)[2] = STk_makeinteger(info->st_mode);
|
||||
VECT(z)[3] = STk_makeinteger(info->st_nlink);
|
||||
VECT(z)[4] = STk_makeinteger(info->st_uid);
|
||||
VECT(z)[5] = STk_makeinteger(info->st_gid);
|
||||
VECT(z)[6] = STk_makeinteger(info->st_size);
|
||||
VECT(z)[7] = STk_makeinteger(info->st_atime);
|
||||
VECT(z)[8] = STk_makeinteger(info->st_mtime);
|
||||
VECT(z)[9] = STk_makeinteger(info->st_ctime);
|
||||
VECT(z)[0] = STk_makeinteger((long)info->st_dev);
|
||||
VECT(z)[1] = STk_makeinteger((long)info->st_ino);
|
||||
VECT(z)[2] = STk_makeinteger((long)info->st_mode);
|
||||
VECT(z)[3] = STk_makeinteger((long)info->st_nlink);
|
||||
VECT(z)[4] = STk_makeinteger((long)info->st_uid);
|
||||
VECT(z)[5] = STk_makeinteger((long)info->st_gid);
|
||||
VECT(z)[6] = STk_makeinteger((long)info->st_size);
|
||||
VECT(z)[7] = STk_makeinteger((long)info->st_atime);
|
||||
VECT(z)[8] = STk_makeinteger((long)info->st_mtime);
|
||||
VECT(z)[9] = STk_makeinteger((long)info->st_ctime);
|
||||
|
||||
return z;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ static PRIMITIVE posix_mkdir(SCM path, SCM mode)
|
||||
|
||||
if (NSTRINGP(path)) Err("posix-mkdir: bad path", path);
|
||||
if (NINTEGERP(mode)) Err("posix-mkdir: bad mode", mode);
|
||||
r = mkdir(CHARS(path), INTEGER(mode));
|
||||
r = mkdir(CHARS(path), (mode_t) INTEGER(mode));
|
||||
return (r < 0)? Ntruth : Truth;
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ static PRIMITIVE posix_mktime(SCM t)
|
||||
Err("posix-mktime: bad time structure", t);
|
||||
|
||||
sec = (time_t) mktime(EXTDATA(t));
|
||||
return STk_makeinteger((double) sec);
|
||||
return STk_makeinteger((long) sec);
|
||||
}
|
||||
|
||||
static PRIMITIVE posix_tm2vector(SCM t)
|
||||
@@ -338,7 +338,7 @@ static PRIMITIVE posix_strftime(SCM format, SCM t)
|
||||
return STk_makestring(buffer);
|
||||
else
|
||||
Err("posix-strftime: buffer too short", NIL);
|
||||
/*NOTREACHED*/
|
||||
return UNDEFINED; /* never reached */
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
||||
+6
-10
@@ -9,7 +9,7 @@
|
||||
*
|
||||
* Win32 support by Caleb Deupree <cdeupree@erinet.com>
|
||||
*
|
||||
* Last file update: 31-Jan-1998 10:29
|
||||
* Last file update: 10-Sep-1998 15:17
|
||||
*/
|
||||
|
||||
|
||||
@@ -75,7 +75,8 @@ static void socket_error(char *who, char *message, SCM object)
|
||||
|
||||
static void set_socket_io_ports(int s, SCM sock, char *who)
|
||||
{
|
||||
int t, len, port;
|
||||
int t, port;
|
||||
size_t len;
|
||||
char *hostname, *fname;
|
||||
FILE *fs, *ft;
|
||||
char buffer[200];
|
||||
@@ -138,9 +139,8 @@ static PRIMITIVE make_client_socket(SCM hostname, SCM port)
|
||||
char str[] = "make-client-socket";
|
||||
struct hostent *hp;
|
||||
struct sockaddr_in server;
|
||||
struct in_addr local_ip;
|
||||
SCM z, local_host;
|
||||
int s;
|
||||
SCM z;
|
||||
|
||||
/* Verify arguments */
|
||||
if(NSTRINGP(hostname))
|
||||
@@ -196,8 +196,6 @@ static PRIMITIVE make_server_socket(SCM port)
|
||||
char msg[] = "make-server-socket";
|
||||
struct sockaddr_in sin;
|
||||
int s, portnum, len;
|
||||
SCM local_host;
|
||||
struct in_addr local_ip;
|
||||
SCM z;
|
||||
|
||||
/* Determine port to use */
|
||||
@@ -254,7 +252,7 @@ static PRIMITIVE make_server_socket(SCM port)
|
||||
|
||||
static PRIMITIVE socket_accept_connection(SCM sock)
|
||||
{
|
||||
char buff[50], *s;
|
||||
char *s;
|
||||
char str[]= "socket-accept-connection";
|
||||
struct sockaddr_in sin;
|
||||
struct hostent *host;
|
||||
@@ -290,7 +288,6 @@ static void apply_socket_closure(SCM closure)
|
||||
|
||||
static PRIMITIVE when_socket_ready(SCM s, SCM closure)
|
||||
{
|
||||
char str[50];
|
||||
int fd;
|
||||
|
||||
if (NSOCKETP(s))
|
||||
@@ -321,6 +318,7 @@ static PRIMITIVE when_socket_ready(SCM s, SCM closure)
|
||||
static PRIMITIVE buggy_handler(SCM s, SCM closure)
|
||||
{
|
||||
Err("when-socket-ready: cannot be used with snow", NIL);
|
||||
return UNDEFINED;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -331,8 +329,6 @@ static PRIMITIVE buggy_handler(SCM s, SCM closure)
|
||||
|
||||
static PRIMITIVE socket_shutdown(SCM sock, SCM close_socket)
|
||||
{
|
||||
SCM tmp1, tmp2;
|
||||
|
||||
if (close_socket == UNBOUND) close_socket = Truth;
|
||||
|
||||
if (NSOCKETP(sock)) Err("socket-shutdown: bad socket", sock);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
;;;; permission of the copyright holder.
|
||||
;;;; This software is provided ``as is'' without express or implied warranty.
|
||||
;;;;
|
||||
;;;; $Id: stk-genmake.in 1.1 Sat, 06 Jun 1998 12:19:03 +0000 eg $
|
||||
;;;; $Id: stk-genmake.in 1.1 Sat, 06 Jun 1998 14:19:03 +0200 eg $
|
||||
;;;;
|
||||
;;;; Author: Erick Gallesio [eg@unice.fr]
|
||||
;;;; Creation date: 1-Jun-1998 18:44
|
||||
|
||||
Reference in New Issue
Block a user