Skip to content

AFNI/NIfTI Server

Sections
Personal tools
You are here: Home » AFNI » Documentation

Doxygen Source Code Documentation


Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search  

makeopts.c

Go to the documentation of this file.
00001 /*
00002  * makeopts.c
00003  *
00004  * Create a C source file containing an initialized string with the
00005  * compiler options used to compile VolPack.
00006  *
00007  * Copyright (c) 1994 The Board of Trustees of The Leland Stanford
00008  * Junior University.  All rights reserved.
00009  *
00010  * Permission to use, copy, modify and distribute this software and its
00011  * documentation for any purpose is hereby granted without fee, provided
00012  * that the above copyright notice and this permission notice appear in
00013  * all copies of this software and that you do not sell the software.
00014  * Commercial licensing is available by contacting the author.
00015  * 
00016  * THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
00017  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
00018  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00019  *
00020  * Author:
00021  *    Phil Lacroute
00022  *    Computer Systems Laboratory
00023  *    Electrical Engineering Dept.
00024  *    Stanford University
00025  */
00026 
00027 /*
00028  * $Date: 2001/12/17 16:16:20 $
00029  * $Revision: 1.1 $
00030  */
00031 
00032 #include <stdio.h>
00033 
00034 /*
00035  * Usage: makeopts output_file [compiler_options ...]
00036  */
00037 
00038 main(argc, argv)
00039 int argc;
00040 char **argv;
00041 {
00042     FILE *fp;
00043     int c;
00044 
00045     if (argc < 2) {
00046         fprintf(stderr, "Usage: %s output_file [compiler_options ...]\n",
00047                 argv[0]);
00048         exit(1);
00049     }
00050     if ((fp = fopen(argv[1], "w")) == NULL) {
00051         fprintf(stderr, "%s: could not open %s\n", argv[0], argv[1]);
00052         exit(1);
00053     }
00054     fprintf(fp, "/*\n");
00055     fprintf(fp,
00056             " * DO NOT EDIT THIS FILE! It was created automatically by %s.\n",
00057             argv[0]);
00058     fprintf(fp, " */\n\n");
00059     fprintf(fp, "char *vpCompilerOptions = \"");
00060     for (c = 2; c < argc; c++) {
00061         if (c > 2)
00062             fprintf(fp, " ");
00063         fprintf(fp, "%s", argv[c]);
00064     }
00065     fprintf(fp, "\";\n");
00066     exit(0);
00067 }
 

Powered by Plone

This site conforms to the following standards: