#!/usr/bin/perl -w
#
# Copyright (c) y2k Micha Moskal <malekith@topnet.pl>
#
# This file is part of cryptoFTP - cftp protocol implementation.
# CryptoFTP is free software. You can redistribute it and/or modify it under
# the terms of the GNU General Public License (see COPYING.GPL for details).
#
# $Id: make-cipher-list,v 1.2 2000/05/04 19:11:23 malekith Exp $
#

open(FH, "cat *.c |") or die;
@a=();
while (<FH>) {
	/^struct cipher\s*\*\s*([a-zA-Z0-9]+)_create[^;]*$/ or next;
	push @a, $1;
}
open(FH,"> cipher-list.c") or die;

$t = localtime();
chomp $t;
$h = `hostname`;
chomp $h;

print FH 
"/*
 * Copyright (c) y2k Micha Moskal <malekith\@topnet.pl>
 *
 * This file is part of libcftp - cftp protocol implementation.
 * CryptoFTP is free software. You can redistribute it and/or modify it under
 * the terms of the GNU Library General Public License (see COPYING.LGPL 
 * for details).
 *
 * \$Id\$
 */

/* automagicly generated -- do not edit by hand
 * command $0 \@ $t by $ENV{USER}\@$h
 */

#include \"config.h\"
#include \"cipher.h\"

";

for (@a) {
	print FH "struct cipher *${_}_create(void);\n";
}

print FH "\n\nstruct cipher2 ciphers[] = {\n";

for (@a) {
	print FH "\t{ ${_}_create, 0, 0, 0, 0 },\n";
}

print FH "\t{ 0, 0, 0, 0, 0 }\n};\n/* E0F */\n";
