/* kpsexpand -- do Kpathsea variable expansion, pretending to be a given
   program.  For example,
     prompt$ kpsexpand latex2e '$TEXINPUTS'
   expands $TEXINPUTS for latex2e.

   Based on code from te@informatik.uni-hannover.de.  */

/* Not worth chance of collisions to #include anything but this.  */
#include <stdio.h> /* for stderr */

extern char *kpse_var_expand ();
extern void kpse_set_progname ();

int
main (argc, argv)
    int argc;
    char *argv[];
{
  if (argc != 3)
    {
      fprintf (stderr, "Usage: %s progname string\n", argv[0]);
      exit (1);
    }
  kpse_set_progname (argv[1]);
  printf ("%s\n", kpse_var_expand (argv[2]));
  return 0;
}
