Commit 78572b5d authored by Edward Vigmond's avatar Edward Vigmond
Browse files

Added sources to make igbhead in the utils subdir

parent 3c6a0f61
......@@ -82,3 +82,6 @@ TBmeshWin.o: TBmeshWin.cc $(READER_OBJS)
%.o : %.C
c++ -c $(CFLAGS) $(INCLUDES) $<
utils:
(cd utils; make )
../IGBheader.cc
\ No newline at end of file
../IGBheader.h
\ No newline at end of file
####################################################
#
# Makefile for igbutils
#
# All rights , etc., blah, blah, blah Edward Vigmond
#
####################################################
OBJS = igbhead.o \
IGBheader.o \
cmdline.o \
getopt.o \
getopt1.o
all: $(OBJS)
g++ $(CFLAGS) -I.. -g -static $(LDFLAGS) -o igbhead $(OBJS) -lz
install: igbhead
$(INSTALL) igbhead $(bindir)
%.o : %.cc
$(CXX) -c -g $(CPPFLAGS) -I../src $(CFLAGS) $(INCLUDES) -o $@ $<
%.o : %.c
$(CC) -c -g $(CPPFLAGS) $(CFLAGS) $(INCLUDES) -o $@ $<
cmdline.c: igbhead.ggo
gengetopt -u < igbhead.ggo
clean:
rm *.o
/*
File autogenerated by gengetopt version 2.21
generated with the following command:
gengetopt -u
The developers of gengetopt consider the fixed text that goes in all
gengetopt output files to be in the public domain:
we make no copyright claims on it.
*/
/* If we use autoconf. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt.h"
#include "cmdline.h"
const char *gengetopt_args_info_purpose = "";
const char *gengetopt_args_info_usage = "Usage: igbhead [OPTIONS]... [FILES]...";
const char *gengetopt_args_info_description = "";
const char *gengetopt_args_info_help[] = {
" -h, --help Print help and exit",
" -V, --version Print version and exit",
" -x, --x=INT number of x pixels",
" -y, --y=INT number of y pixels",
" -z, --z=INT number of z pixels",
" -t, --t=INT number of time slices",
" -d, --data-type=STRING char byte int uint float long double vec3f vec4f \n vec3d vec4d OR rgba",
" -s, --system=STRING big_||little_endian",
" -X, --dim-x=FLOAT Size in x",
" -Y, --dim-y=FLOAT Size in y",
" -Z, --dim-z=FLOAT Size in z",
" -T, --dim-t=FLOAT Duration",
" -5, --fac-x=FLOAT Scaling factor in x",
" -6, --fac-y=FLOAT Scaling factor in y",
" -7, --fac-z=FLOAT Scaling factor in z",
" -8, --fac-t=FLOAT Scaling factor in t",
" -o, --org-x=FLOAT Origin for x",
" -p, --org-y=FLOAT Origin for y",
" -q, --org-z=FLOAT Origin for z",
" -r, --org-t=FLOAT Origin for t",
" -I, --inc-x=FLOAT Increment in x",
" -J, --inc-y=FLOAT Increment in y",
" -K, --inc-z=FLOAT Increment in z",
" -L, --inc-t=FLOAT Increment in t",
" -S, --data-factor=FLOAT Scaling factor for data",
" -0, --data-zero=FLOAT Origin for data scaling",
" -A, --author=STRING Author name with no spaces",
" -1, --x-units=STRING Units for x",
" -2, --y-units=STRING Units for y",
" -3, --z-units=STRING Units for z",
" -4, --t-units=STRING Units for t",
" -j, --jive-time Make no. time slices jive with data size",
" -e, --transparent=STRING Transparent pixel value in hex",
" -E, --no-transparent Turn transparency off",
" -D, --decapitate Remove header",
" -c, --comment=STRING Add a line of comment",
" -C, --clear-comment Clear all comments",
" -f, --output-file=STRING output file",
" -F, --frankenstein=STRING attach header to this file",
" -l, --explode explode file into igb time slices",
" -m, --memfeminize convert igb to memfem format",
0
};
static
void clear_given (struct gengetopt_args_info *args_info);
static
void clear_args (struct gengetopt_args_info *args_info);
static int
cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_info *args_info,
struct cmdline_parser_params *params, const char *additional_error);
static char *
gengetopt_strdup (const char *s);
static
void clear_given (struct gengetopt_args_info *args_info)
{
args_info->help_given = 0 ;
args_info->version_given = 0 ;
args_info->x_given = 0 ;
args_info->y_given = 0 ;
args_info->z_given = 0 ;
args_info->t_given = 0 ;
args_info->data_type_given = 0 ;
args_info->system_given = 0 ;
args_info->dim_x_given = 0 ;
args_info->dim_y_given = 0 ;
args_info->dim_z_given = 0 ;
args_info->dim_t_given = 0 ;
args_info->fac_x_given = 0 ;
args_info->fac_y_given = 0 ;
args_info->fac_z_given = 0 ;
args_info->fac_t_given = 0 ;
args_info->org_x_given = 0 ;
args_info->org_y_given = 0 ;
args_info->org_z_given = 0 ;
args_info->org_t_given = 0 ;
args_info->inc_x_given = 0 ;
args_info->inc_y_given = 0 ;
args_info->inc_z_given = 0 ;
args_info->inc_t_given = 0 ;
args_info->data_factor_given = 0 ;
args_info->data_zero_given = 0 ;
args_info->author_given = 0 ;
args_info->x_units_given = 0 ;
args_info->y_units_given = 0 ;
args_info->z_units_given = 0 ;
args_info->t_units_given = 0 ;
args_info->jive_time_given = 0 ;
args_info->transparent_given = 0 ;
args_info->no_transparent_given = 0 ;
args_info->decapitate_given = 0 ;
args_info->comment_given = 0 ;
args_info->clear_comment_given = 0 ;
args_info->output_file_given = 0 ;
args_info->frankenstein_given = 0 ;
args_info->explode_given = 0 ;
args_info->memfeminize_given = 0 ;
}
static
void clear_args (struct gengetopt_args_info *args_info)
{
args_info->x_orig = NULL;
args_info->y_orig = NULL;
args_info->z_orig = NULL;
args_info->t_orig = NULL;
args_info->data_type_arg = NULL;
args_info->data_type_orig = NULL;
args_info->system_arg = NULL;
args_info->system_orig = NULL;
args_info->dim_x_orig = NULL;
args_info->dim_y_orig = NULL;
args_info->dim_z_orig = NULL;
args_info->dim_t_orig = NULL;
args_info->fac_x_orig = NULL;
args_info->fac_y_orig = NULL;
args_info->fac_z_orig = NULL;
args_info->fac_t_orig = NULL;
args_info->org_x_orig = NULL;
args_info->org_y_orig = NULL;
args_info->org_z_orig = NULL;
args_info->org_t_orig = NULL;
args_info->inc_x_orig = NULL;
args_info->inc_y_orig = NULL;
args_info->inc_z_orig = NULL;
args_info->inc_t_orig = NULL;
args_info->data_factor_orig = NULL;
args_info->data_zero_orig = NULL;
args_info->author_arg = NULL;
args_info->author_orig = NULL;
args_info->x_units_arg = NULL;
args_info->x_units_orig = NULL;
args_info->y_units_arg = NULL;
args_info->y_units_orig = NULL;
args_info->z_units_arg = NULL;
args_info->z_units_orig = NULL;
args_info->t_units_arg = NULL;
args_info->t_units_orig = NULL;
args_info->transparent_arg = NULL;
args_info->transparent_orig = NULL;
args_info->comment_arg = NULL;
args_info->comment_orig = NULL;
args_info->output_file_arg = NULL;
args_info->output_file_orig = NULL;
args_info->frankenstein_arg = NULL;
args_info->frankenstein_orig = NULL;
}
static
void init_args_info(struct gengetopt_args_info *args_info)
{
args_info->help_help = gengetopt_args_info_help[0] ;
args_info->version_help = gengetopt_args_info_help[1] ;
args_info->x_help = gengetopt_args_info_help[2] ;
args_info->y_help = gengetopt_args_info_help[3] ;
args_info->z_help = gengetopt_args_info_help[4] ;
args_info->t_help = gengetopt_args_info_help[5] ;
args_info->data_type_help = gengetopt_args_info_help[6] ;
args_info->system_help = gengetopt_args_info_help[7] ;
args_info->dim_x_help = gengetopt_args_info_help[8] ;
args_info->dim_y_help = gengetopt_args_info_help[9] ;
args_info->dim_z_help = gengetopt_args_info_help[10] ;
args_info->dim_t_help = gengetopt_args_info_help[11] ;
args_info->fac_x_help = gengetopt_args_info_help[12] ;
args_info->fac_y_help = gengetopt_args_info_help[13] ;
args_info->fac_z_help = gengetopt_args_info_help[14] ;
args_info->fac_t_help = gengetopt_args_info_help[15] ;
args_info->org_x_help = gengetopt_args_info_help[16] ;
args_info->org_y_help = gengetopt_args_info_help[17] ;
args_info->org_z_help = gengetopt_args_info_help[18] ;
args_info->org_t_help = gengetopt_args_info_help[19] ;
args_info->inc_x_help = gengetopt_args_info_help[20] ;
args_info->inc_y_help = gengetopt_args_info_help[21] ;
args_info->inc_z_help = gengetopt_args_info_help[22] ;
args_info->inc_t_help = gengetopt_args_info_help[23] ;
args_info->data_factor_help = gengetopt_args_info_help[24] ;
args_info->data_zero_help = gengetopt_args_info_help[25] ;
args_info->author_help = gengetopt_args_info_help[26] ;
args_info->x_units_help = gengetopt_args_info_help[27] ;
args_info->y_units_help = gengetopt_args_info_help[28] ;
args_info->z_units_help = gengetopt_args_info_help[29] ;
args_info->t_units_help = gengetopt_args_info_help[30] ;
args_info->jive_time_help = gengetopt_args_info_help[31] ;
args_info->transparent_help = gengetopt_args_info_help[32] ;
args_info->no_transparent_help = gengetopt_args_info_help[33] ;
args_info->decapitate_help = gengetopt_args_info_help[34] ;
args_info->comment_help = gengetopt_args_info_help[35] ;
args_info->clear_comment_help = gengetopt_args_info_help[36] ;
args_info->output_file_help = gengetopt_args_info_help[37] ;
args_info->frankenstein_help = gengetopt_args_info_help[38] ;
args_info->explode_help = gengetopt_args_info_help[39] ;
args_info->memfeminize_help = gengetopt_args_info_help[40] ;
}
void
cmdline_parser_print_version (void)
{
printf ("%s %s\n", CMDLINE_PARSER_PACKAGE, CMDLINE_PARSER_VERSION);
}
void
cmdline_parser_print_help (void)
{
int i = 0;
cmdline_parser_print_version ();
if (strlen(gengetopt_args_info_purpose) > 0)
printf("\n%s\n", gengetopt_args_info_purpose);
printf("\n%s\n\n", gengetopt_args_info_usage);
if (strlen(gengetopt_args_info_description) > 0)
printf("%s\n", gengetopt_args_info_description);
while (gengetopt_args_info_help[i])
printf("%s\n", gengetopt_args_info_help[i++]);
}
void
cmdline_parser_init (struct gengetopt_args_info *args_info)
{
clear_given (args_info);
clear_args (args_info);
init_args_info (args_info);
args_info->inputs = NULL;
args_info->inputs_num = 0;
}
struct cmdline_parser_params *
cmdline_parser_params_init()
{
struct cmdline_parser_params *params =
(struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
if (params)
{
params->override = 0;
params->initialize = 0;
params->check_required = 0;
params->check_ambiguity = 0;
}
return params;
}
static void
cmdline_parser_release (struct gengetopt_args_info *args_info)
{
unsigned int i;
if (args_info->x_orig)
{
free (args_info->x_orig); /* free previous argument */
args_info->x_orig = 0;
}
if (args_info->y_orig)
{
free (args_info->y_orig); /* free previous argument */
args_info->y_orig = 0;
}
if (args_info->z_orig)
{
free (args_info->z_orig); /* free previous argument */
args_info->z_orig = 0;
}
if (args_info->t_orig)
{
free (args_info->t_orig); /* free previous argument */
args_info->t_orig = 0;
}
if (args_info->data_type_arg)
{
free (args_info->data_type_arg); /* free previous argument */
args_info->data_type_arg = 0;
}
if (args_info->data_type_orig)
{
free (args_info->data_type_orig); /* free previous argument */
args_info->data_type_orig = 0;
}
if (args_info->system_arg)
{
free (args_info->system_arg); /* free previous argument */
args_info->system_arg = 0;
}
if (args_info->system_orig)
{
free (args_info->system_orig); /* free previous argument */
args_info->system_orig = 0;
}
if (args_info->dim_x_orig)
{
free (args_info->dim_x_orig); /* free previous argument */
args_info->dim_x_orig = 0;
}
if (args_info->dim_y_orig)
{
free (args_info->dim_y_orig); /* free previous argument */
args_info->dim_y_orig = 0;
}
if (args_info->dim_z_orig)
{
free (args_info->dim_z_orig); /* free previous argument */
args_info->dim_z_orig = 0;
}
if (args_info->dim_t_orig)
{
free (args_info->dim_t_orig); /* free previous argument */
args_info->dim_t_orig = 0;
}
if (args_info->fac_x_orig)
{
free (args_info->fac_x_orig); /* free previous argument */
args_info->fac_x_orig = 0;
}
if (args_info->fac_y_orig)
{
free (args_info->fac_y_orig); /* free previous argument */
args_info->fac_y_orig = 0;
}
if (args_info->fac_z_orig)
{
free (args_info->fac_z_orig); /* free previous argument */
args_info->fac_z_orig = 0;
}
if (args_info->fac_t_orig)
{
free (args_info->fac_t_orig); /* free previous argument */
args_info->fac_t_orig = 0;
}
if (args_info->org_x_orig)
{
free (args_info->org_x_orig); /* free previous argument */
args_info->org_x_orig = 0;
}
if (args_info->org_y_orig)
{
free (args_info->org_y_orig); /* free previous argument */
args_info->org_y_orig = 0;
}
if (args_info->org_z_orig)
{
free (args_info->org_z_orig); /* free previous argument */
args_info->org_z_orig = 0;
}
if (args_info->org_t_orig)
{
free (args_info->org_t_orig); /* free previous argument */
args_info->org_t_orig = 0;
}
if (args_info->inc_x_orig)
{
free (args_info->inc_x_orig); /* free previous argument */
args_info->inc_x_orig = 0;
}
if (args_info->inc_y_orig)
{
free (args_info->inc_y_orig); /* free previous argument */
args_info->inc_y_orig = 0;
}
if (args_info->inc_z_orig)
{
free (args_info->inc_z_orig); /* free previous argument */
args_info->inc_z_orig = 0;
}
if (args_info->inc_t_orig)
{
free (args_info->inc_t_orig); /* free previous argument */
args_info->inc_t_orig = 0;
}
if (args_info->data_factor_orig)
{
free (args_info->data_factor_orig); /* free previous argument */
args_info->data_factor_orig = 0;
}
if (args_info->data_zero_orig)
{
free (args_info->data_zero_orig); /* free previous argument */
args_info->data_zero_orig = 0;
}
if (args_info->author_arg)
{
free (args_info->author_arg); /* free previous argument */
args_info->author_arg = 0;
}
if (args_info->author_orig)
{
free (args_info->author_orig); /* free previous argument */
args_info->author_orig = 0;
}
if (args_info->x_units_arg)
{
free (args_info->x_units_arg); /* free previous argument */
args_info->x_units_arg = 0;
}
if (args_info->x_units_orig)
{
free (args_info->x_units_orig); /* free previous argument */
args_info->x_units_orig = 0;
}
if (args_info->y_units_arg)
{
free (args_info->y_units_arg); /* free previous argument */
args_info->y_units_arg = 0;
}
if (args_info->y_units_orig)
{
free (args_info->y_units_orig); /* free previous argument */
args_info->y_units_orig = 0;
}
if (args_info->z_units_arg)
{
free (args_info->z_units_arg); /* free previous argument */
args_info->z_units_arg = 0;
}
if (args_info->z_units_orig)
{
free (args_info->z_units_orig); /* free previous argument */
args_info->z_units_orig = 0;
}
if (args_info->t_units_arg)
{
free (args_info->t_units_arg); /* free previous argument */
args_info->t_units_arg = 0;
}
if (args_info->t_units_orig)
{
free (args_info->t_units_orig); /* free previous argument */
args_info->t_units_orig = 0;
}
if (args_info->transparent_arg)
{
free (args_info->transparent_arg); /* free previous argument */
args_info->transparent_arg = 0;
}
if (args_info->transparent_orig)
{
free (args_info->transparent_orig); /* free previous argument */
args_info->transparent_orig = 0;
}
if (args_info->comment_arg)
{
free (args_info->comment_arg); /* free previous argument */
args_info->comment_arg = 0;
}
if (args_info->comment_orig)
{
free (args_info->comment_orig); /* free previous argument */
args_info->comment_orig = 0;
}
if (args_info->output_file_arg)
{
free (args_info->output_file_arg); /* free previous argument */
args_info->output_file_arg = 0;
}
if (args_info->output_file_orig)
{
free (args_info->output_file_orig); /* free previous argument */
args_info->output_file_orig = 0;
}
if (args_info->frankenstein_arg)
{
free (args_info->frankenstein_arg); /* free previous argument */
args_info->frankenstein_arg = 0;
}
if (args_info->frankenstein_orig)
{
free (args_info->frankenstein_orig); /* free previous argument */
args_info->frankenstein_orig = 0;
}
for (i = 0; i < args_info->inputs_num; ++i)
free (args_info->inputs [i]);
if (args_info->inputs_num)
free (args_info->inputs);
clear_given (args_info);
}
int
cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
{
FILE *outfile;
int i = 0;
outfile = fopen(filename, "w");
if (!outfile)
{
fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
return EXIT_FAILURE;
}
if (args_info->help_given) {
fprintf(outfile, "%s\n", "help");
}
if (args_info->version_given) {
fprintf(outfile, "%s\n", "version");
}
if (args_info->x_given) {
if (args_info->x_orig) {
fprintf(outfile, "%s=\"%s\"\n", "x", args_info->x_orig);
} else {
fprintf(outfile, "%s\n", "x");
}
}
if (args_info->y_given) {
if (args_info->y_orig) {
fprintf(outfile, "%s=\"%s\"\n", "y", args_info->y_orig);
} else {
fprintf(outfile, "%s\n", "y");
}
}
if (args_info->z_given) {
if (args_info->z_orig) {
fprintf(outfile, "%s=\"%s\"\n", "z", args_info->z_orig);
} else {
fprintf(outfile, "%s\n", "z");
}
}
if (args_info->t_given) {
if (args_info->t_orig) {
fprintf(outfile, "%s=\"%s\"\n", "t", args_info->t_orig);
} else {
fprintf(outfile, "%s\n", "t");
}
}
if (args_info->data_type_given) {
if (args_info->data_type_orig) {
fprintf(outfile, "%s=\"%s\"\n", "data-type", args_info->data_type_orig);
} else {
fprintf(outfile, "%s\n", "data-type");
}
}
if (args_info->system_given) {
if (args_info->system_orig) {
fprintf(outfile, "%s=\"%s\"\n", "system", args_info->system_orig);
} else