summaryrefslogtreecommitdiffstats
path: root/util/parsevar.pl
blob: d532c786fbcf78d7d8a57f828421c01eb279a51d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl
# $Id: parsevar.pl,v 1.2 2003/06/20 22:06:30 in2 Exp $
print << '.';
/*
 * This header file is auto-generated from pttbbs/mbbsd/var.c .
 * Please do NOT edit this file directly.
 */

#ifndef INCLUDE_VAR_H
#define INCLUDE_VAR_H
#include "bbs.h"
.
while( <> ){
    if( /^\w/ ){
    chomp;
    $_ = substr($_, 0, index($_, '=') - 1) if( index($_, '=') != -1 );
    $_ .= ';' if( index($_, ';') == -1 );
    print "extern $_\n";
    } elsif( /^\#/ && !/include/ ){
    print;
    }
}
print "#endif /* INCLUDE_VAR_H */\n";