summaryrefslogtreecommitdiffstats
path: root/util/parsevar.pl
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-04 21:08:35 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2002-06-04 21:08:35 +0800
commit9e81baf8352b3d525c9a1459f28dae6b540988e3 (patch)
treea558e73187b9d45b59280a79c927e7f8bb315623 /util/parsevar.pl
parente42291049072cfee02408394850b33b3580dbd83 (diff)
downloadpttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar.gz
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar.bz2
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar.lz
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar.xz
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.tar.zst
pttbbs-9e81baf8352b3d525c9a1459f28dae6b540988e3.zip
global variable move to var.c
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@280 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util/parsevar.pl')
-rw-r--r--util/parsevar.pl23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/parsevar.pl b/util/parsevar.pl
new file mode 100644
index 00000000..60063608
--- /dev/null
+++ b/util/parsevar.pl
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+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";
+