#!/usr/bin/perl my @names; while() { chomp; next if /^\s*(?:#.*)?$/; push @names, $_ } my $n = @names; my $n2 = $n*2; print "static char * const my_constant_names[] = {\n"; for (@names) { print qq( "$_",\n) } print qq( 0,\n); print "};\n"; print "static const unsigned int my_constant_values[] = {\n"; for (@names) { print qq( $_,\n) } print "};\n"; __DATA__ # enum fann_train_enum: FANN_TRAIN_INCREMENTAL FANN_TRAIN_BATCH FANN_TRAIN_RPROP FANN_TRAIN_QUICKPROP # enum fann_activationfunc_enum: FANN_LINEAR FANN_THRESHOLD FANN_THRESHOLD_SYMMETRIC FANN_SIGMOID FANN_SIGMOID_STEPWISE FANN_SIGMOID_SYMMETRIC FANN_SIGMOID_SYMMETRIC_STEPWISE FANN_GAUSSIAN FANN_GAUSSIAN_SYMMETRIC FANN_GAUSSIAN_STEPWISE FANN_ELLIOT FANN_ELLIOT_SYMMETRIC FANN_LINEAR_PIECE FANN_LINEAR_PIECE_SYMMETRIC FANN_SIN_SYMMETRIC FANN_COS_SYMMETRIC FANN_SIN FANN_COS # enum fann_errorfunc_enum: FANN_ERRORFUNC_LINEAR FANN_ERRORFUNC_TANH # enum fann_stopfunc_enum: FANN_STOPFUNC_MSE FANN_STOPFUNC_BIT