Commit 9adf9f43 authored by Erick's avatar Erick

Prefix md5 and getopt function with "STk_" to avoid name space pollution.

parent 520141c0
;;;;
;;;; d e s c r i b e . s t k -- The DESCRIBE method (partly stolen fom Elk lib)
;;;;
;;;; Copyright © 1993-2006 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
;;;; Copyright © 1993-2011 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
;;;;
;;;; This program is free software; you can redistribute it and/or modify
;;;; it under the terms of the GNU General Public License as published by
......@@ -20,7 +20,7 @@
;;;;
;;;; Author: Erick Gallesio [[email protected]]
;;;; Creation date: 21-Mar-1993 14:33
;;;; Last file update: 18-Dec-2006 08:59 (eg)
;;;; Last file update: 3-Dec-2011 13:45 (eg)
;;;;
......@@ -56,6 +56,7 @@
((eof-object? x) (format port "the end-of-file object"))
((struct-type? x) (format port "the type structure named ~A"
(struct-type-name x)))
((module? x) (format port "a module named ~A" (module-name x)))
(else (format port "an an instance of class ~A"
(class-name (class-of x)))))
(format port ".~%")
......
/*
* gnu-getopt.h -- Adaptation of the GNU getopt function for STklos
*
* Copyright © 2001-2003 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
* Copyright © 2001-2011 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
*
* Author: Erick Gallesio [[email protected]]
* Creation date: 1-Nov-2001 23:40 (eg)
* Last file update: 10-Feb-2003 10:46 (eg)
* Last file update: 3-Dec-2011 15:56 (eg)
*
* The following code is constituted of the GNU getopt, getopt_long
* and getopt_long_only implementation. Code is slightly modified (all
......@@ -22,15 +22,11 @@ void STk_start_getopt_from_scheme(void);
#define optind STk_optind
#define opterr STk_opterr
#define optopt STk_optopt
#ifdef WIN32
/* getopt is always defined under WIN32 (since it is included in
* unistd.h, leading to a double definition of 'struct option'
*/
# define option STk_option
# define getopt STk_getopt
# define getopt_long STk_getopt_long
#endif
#define option STk_option
#define getopt STk_getopt
#define getopt_long STk_getopt_long
#define getopt_long_only STk_getopt_long_only
#define _getopt_internal STk_getopt_internal
/* Original file starts here */
......
/*
* md5.c -- MD5 algorithm
*
* Copyright © 2007 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
* Copyright © 2007-2011 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
*
*
* This program is free software; you can redistribute it and/or modify
......@@ -21,7 +21,7 @@
*
* Author: Erick Gallesio [[email protected]]
* Creation date: 13-May-2007 22:21 (eg)
* Last file update: 14-May-2007 10:35 (eg)
* Last file update: 3-Dec-2011 15:11 (eg)
*/
/*
......@@ -31,7 +31,18 @@
*/
#include <string.h>
#include "md5.h"
typedef unsigned char uint8;
typedef unsigned int uint32;
struct md5_context
{
uint32 total[2];
uint32 state[4];
uint8 buffer[64];
};
#define GET_UINT32(n,b,i) \
......@@ -50,7 +61,7 @@
(((uint8 *) b)[(i)+3]) = (uint8) (((n) >> 24) & 0xFF); \
}
void md5_starts( struct md5_context *ctx )
static void md5_starts( struct md5_context *ctx )
{
ctx->total[0] = 0;
ctx->total[1] = 0;
......@@ -60,7 +71,7 @@ void md5_starts( struct md5_context *ctx )
ctx->state[3] = 0x10325476;
}
void md5_process( struct md5_context *ctx, uint8 data[64] )
static void md5_process( struct md5_context *ctx, uint8 data[64] )
{
uint32 A, B, C, D, X[16];
......@@ -183,7 +194,7 @@ void md5_process( struct md5_context *ctx, uint8 data[64] )
ctx->state[3] += D;
}
void md5_update( struct md5_context *ctx, uint8 *input, uint32 length )
static void md5_update( struct md5_context *ctx, uint8 *input, uint32 length )
{
uint32 left, fill;
......@@ -228,7 +239,7 @@ static uint8 md5_padding[64] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
void md5_finish( struct md5_context *ctx, uint8 digest[16] )
static void md5_finish( struct md5_context *ctx, uint8 digest[16] )
{
uint32 last, padn;
uint8 msglen[8];
......
/*
* md5.c -- md5
*
* Copyright © 2007 Erick Gallesio - I3S-CNRS/ESSI <[email protected]>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
* USA.
*
* Author: Erick Gallesio [[email protected]]
* Creation date: 13-May-2007 22:21 (eg)
* Last file update: 13-May-2007 22:51 (eg)
*/
/*
* RFC 1321 compliant MD5 implementation,
* by Christophe Devine <[email protected]>
* this program is licensed under the GPL.
*/
#ifndef _MD5_H
#define _MD5_H
typedef unsigned char uint8;
typedef unsigned int uint32;
struct md5_context
{
uint32 total[2];
uint32 state[4];
uint8 buffer[64];
};
void md5_starts( struct md5_context *ctx );
void md5_update( struct md5_context *ctx, uint8 *input, uint32 length );
void md5_finish( struct md5_context *ctx, uint8 digest[16] );
void md5_hash(uint8 digest[16], uint8 *input, uint32 length);
#endif /* md5.h */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment