Back to index

tetex-bin  3.0
printversion.c File Reference
#include "config.h"

Go to the source code of this file.


void printversionandexit P3C (const_string, banner, const_string, copyright_holder, const_string, author)

Function Documentation

void printversionandexit P3C ( const_string  ,
banner  ,
const_string  ,
copyright_holder  ,
const_string  ,

Definition at line 19 of file printversion.c.

  extern string versionstring;           /* from web2c/lib/version.c */
  extern KPSEDLL string kpathsea_version_string;/* from kpathsea/version.c */
  string prog_name;
  unsigned len;
  const_string prog_name_end = strchr (banner, ',');
  const_string prog_version = strrchr (banner, ' ');
  assert (prog_name_end && prog_version);
  len = prog_name_end - banner - sizeof ("This is");
  prog_name = (string)xmalloc (len + 1);
  strncpy (prog_name, banner + sizeof ("This is"), len);
  prog_name[len] = 0;

  /* The Web2c version string starts with a space.  */
  printf ("%s %s%s\n", prog_name, prog_version, versionstring);
  puts (kpathsea_version_string);

  if (copyright_holder) {
    printf ("Copyright (C) 1997-2004 %s.\n", copyright_holder);
    if (!author)
      author = copyright_holder;

  puts ("Kpathsea is copyright (C) 1997-2004 Free Software Foundation, Inc.");

  puts ("There is NO warranty.  Redistribution of this software is");
  fputs ("covered by the terms of ", stdout);
  /* DVIcopy is GPL'd, so no additional words needed. */
  if (/*copyright_holder && */!STREQ (prog_name, "DVIcopy")) {
    printf ("both the %s copyright and\n", prog_name);
  puts ("the GNU General Public License.");
  puts ("For more information about these matters, see the files");
  printf ("named COPYING and the %s source.\n", prog_name);
  printf ("Primary author of %s: %s.\n", prog_name, author);
  puts ("Kpathsea written by Karl Berry and others.\n");

  uexit (0);

Here is the call graph for this function: