Blame example/mview.c

Packit Service a721b1
/* mview.c -- File viewer				-*- coding: euc-jp; -*-
Packit Service a721b1
   Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Packit Service a721b1
     National Institute of Advanced Industrial Science and Technology (AIST)
Packit Service a721b1
     Registration Number H15PRO112
Packit Service a721b1
Packit Service a721b1
   This file is part of the m17n library.
Packit Service a721b1
Packit Service a721b1
   The m17n library is free software; you can redistribute it and/or
Packit Service a721b1
   modify it under the terms of the GNU Lesser General Public License
Packit Service a721b1
   as published by the Free Software Foundation; either version 2.1 of
Packit Service a721b1
   the License, or (at your option) any later version.
Packit Service a721b1
Packit Service a721b1
   The m17n library is distributed in the hope that it will be useful,
Packit Service a721b1
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service a721b1
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service a721b1
   Lesser General Public License for more details.
Packit Service a721b1
Packit Service a721b1
   You should have received a copy of the GNU Lesser General Public
Packit Service a721b1
   License along with the m17n library; if not, write to the Free
Packit Service a721b1
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Packit Service a721b1
   Boston, MA 02110-1301 USA.  */
Packit Service a721b1
Packit Service a721b1
/***en
Packit Service a721b1
    @enpage m17n-view view file
Packit Service a721b1
Packit Service a721b1
    @section m17n-view-synopsis SYNOPSIS
Packit Service a721b1
Packit Service a721b1
    m17n-view [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
Packit Service a721b1
Packit Service a721b1
    @section m17n-view-description DESCRIPTION
Packit Service a721b1
Packit Service a721b1
    Display FILE on a window.
Packit Service a721b1
Packit Service a721b1
    If FILE is omitted, the input is taken from standard input.
Packit Service a721b1
Packit Service a721b1
    XT-OPTIONs are standard Xt arguments (e.g. -fn, -fg).
Packit Service a721b1
Packit Service a721b1
    The following OPTIONs are available.
Packit Service a721b1
Packit Service a721b1
    
    Packit Service a721b1
    Packit Service a721b1
        
  • -e ENCODING
  • Packit Service a721b1
    Packit Service a721b1
        ENCODING is the encoding of FILE (defaults to UTF-8).
    Packit Service a721b1
    Packit Service a721b1
        
  • -s FONTSIZE
  • Packit Service a721b1
    Packit Service a721b1
        FONTSIZE is the fontsize in point.  If omitted, it defaults to the
    Packit Service a721b1
        size of the default font defined in X resource.
    Packit Service a721b1
    Packit Service a721b1
        
  • --version
  • Packit Service a721b1
    Packit Service a721b1
        Print version number.
    Packit Service a721b1
    Packit Service a721b1
        
  • -h, --help
  • Packit Service a721b1
    Packit Service a721b1
        Print this message.
    Packit Service a721b1
    Packit Service a721b1
        
    Packit Service a721b1
    */
    Packit Service a721b1
    /***ja
    Packit Service a721b1
        @japage m17n-view ファイルを見る
    Packit Service a721b1
    Packit Service a721b1
        @section m17n-view-synopsis SYNOPSIS
    Packit Service a721b1
    Packit Service a721b1
        m17n-view [ XT-OPTION ...] [ OPTION ... ] [ FILE ]
    Packit Service a721b1
    Packit Service a721b1
        @section m17n-view-description DESCRIPTION
    Packit Service a721b1
    Packit Service a721b1
        FILE をウィンドウに表示する。 
    Packit Service a721b1
    Packit Service a721b1
        FILE が省略された場合は、標準入力からとる。 
    Packit Service a721b1
    Packit Service a721b1
        XT-OPTIONs は Xt の標準の引数である。 (e.g. -fn, -fg). 
    Packit Service a721b1
    Packit Service a721b1
        以下のオプションが利用できる。 
    Packit Service a721b1
    Packit Service a721b1
        
      Packit Service a721b1
      Packit Service a721b1
          
    • -e ENCODING
    • Packit Service a721b1
      Packit Service a721b1
          ENCODING は FILE のコード系である。(デフォルトは UTF-8) 
      Packit Service a721b1
      Packit Service a721b1
          
    • -s FONTSIZE
    • Packit Service a721b1
      Packit Service a721b1
          FONTSIZE はフォントの大きさをポイント単位で示したものである。省略 
      Packit Service a721b1
          された場合は、X のリソースで定義されたデフォルトフォントの大きさと 
      Packit Service a721b1
          なる。
      Packit Service a721b1
      Packit Service a721b1
          
    • --version
    • Packit Service a721b1
      Packit Service a721b1
          バージョン番号を表示する。
      Packit Service a721b1
      Packit Service a721b1
          
    • -h, --help
    • Packit Service a721b1
      Packit Service a721b1
         このメッセージを表示する。 
      Packit Service a721b1
      Packit Service a721b1
          
      Packit Service a721b1
      */
      Packit Service a721b1
      #ifndef FOR_DOXYGEN
      Packit Service a721b1
      Packit Service a721b1
      #include <stdio.h>
      Packit Service a721b1
      #include <stdlib.h>
      Packit Service a721b1
      Packit Service a721b1
      #ifdef HAVE_X11_XAW_COMMAND_H
      Packit Service a721b1
      Packit Service a721b1
      #include <X11/Intrinsic.h>
      Packit Service a721b1
      #include <X11/StringDefs.h>
      Packit Service a721b1
      #include <X11/Shell.h>
      Packit Service a721b1
      Packit Service a721b1
      #include <m17n-gui.h>
      Packit Service a721b1
      #include <m17n-misc.h>
      Packit Service a721b1
      #include <m17n-X.h>
      Packit Service a721b1
      Packit Service a721b1
      #include <X11/Xaw/Form.h>
      Packit Service a721b1
      #include <X11/Xaw/Command.h>
      Packit Service a721b1
      #include <X11/Xaw/Viewport.h>
      Packit Service a721b1
      Packit Service a721b1
      /* Global m17n variables.  */
      Packit Service a721b1
      MFrame *frame;
      Packit Service a721b1
      MText *mt;
      Packit Service a721b1
      MDrawMetric metric;
      Packit Service a721b1
      MDrawControl control;
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Callback procedure for "quit".  */
      Packit Service a721b1
      Packit Service a721b1
      void
      Packit Service a721b1
      QuitProc (Widget w, XtPointer client_data, XtPointer call_data)
      Packit Service a721b1
      {
      Packit Service a721b1
        XtAppSetExitFlag (XtWidgetToApplicationContext (w));
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Move POS to the next line head in M-text MT whose length is LEN.
      Packit Service a721b1
         If POS is already on the last line, set POS to LEN.  */
      Packit Service a721b1
      Packit Service a721b1
      #define NEXTLINE(pos, len)			\
      Packit Service a721b1
        do {						\
      Packit Service a721b1
          pos = mtext_character (mt, pos, len, '\n');	\
      Packit Service a721b1
          if (pos < 0)				\
      Packit Service a721b1
            pos = len;				\
      Packit Service a721b1
          else					\
      Packit Service a721b1
            pos++;					\
      Packit Service a721b1
        } while (0)
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Action procedure for expose event.  Redraw partial area of the
      Packit Service a721b1
         widget W.  The area is specified in EVENT.  */
      Packit Service a721b1
      Packit Service a721b1
      static void
      Packit Service a721b1
      ExposeProc (Widget w, XEvent *event, String *str, Cardinal *num)
      Packit Service a721b1
      {
      Packit Service a721b1
        XExposeEvent *expose = (XExposeEvent *) event;
      Packit Service a721b1
        int len = mtext_len (mt);
      Packit Service a721b1
        int pos, from, to;
      Packit Service a721b1
        int y = 0, yoff = 0;
      Packit Service a721b1
        MDrawMetric rect;
      Packit Service a721b1
      Packit Service a721b1
        /* We must update the area between the Y-positions expose->y and
      Packit Service a721b1
           (expose->y + expose->height).  We ignore X-positions.  */
      Packit Service a721b1
      Packit Service a721b1
        /* At first, find the line that occupies the Y-position expose->y.
      Packit Service a721b1
           That is the first line to draw.  */
      Packit Service a721b1
        to = 0;
      Packit Service a721b1
        while (1)
      Packit Service a721b1
          {
      Packit Service a721b1
            from = to;
      Packit Service a721b1
            NEXTLINE (to, len);
      Packit Service a721b1
            mdraw_text_extents (frame, mt, from, to, &control, NULL, NULL, &rect);
      Packit Service a721b1
            if (to == len || y + rect.height > expose->y)
      Packit Service a721b1
      	break;
      Packit Service a721b1
            y += rect.height;
      Packit Service a721b1
          }
      Packit Service a721b1
        /* The first character to draw is at position FROM.  Remeber the
      Packit Service a721b1
           Y-position to start drawing.  */
      Packit Service a721b1
        yoff = y - rect.y;
      Packit Service a721b1
      Packit Service a721b1
        /* Next, find the line that occupies the Y-position (expose->y +
      Packit Service a721b1
           expose->height).  That is the last line to draw.  This time, we
      Packit Service a721b1
           enable caching to utilize it in the later drawing.  */
      Packit Service a721b1
        y += rect.height;
      Packit Service a721b1
        control.disable_caching = 0;
      Packit Service a721b1
        while (to < len && y < expose->y + expose->height)
      Packit Service a721b1
          {
      Packit Service a721b1
            pos = to;
      Packit Service a721b1
            NEXTLINE (to, len);
      Packit Service a721b1
            mdraw_text_extents (frame, mt, pos, to, &control, NULL, NULL, &rect);
      Packit Service a721b1
            y += rect.height;
      Packit Service a721b1
          }
      Packit Service a721b1
      Packit Service a721b1
        /* It is decided that we must draw from FROM to the previous
      Packit Service a721b1
           character of TO.  */
      Packit Service a721b1
        mdraw_text_with_control (frame, (MDrawWindow) XtWindow (w),
      Packit Service a721b1
      			   0, yoff, mt, from, to, &control);
      Packit Service a721b1
      Packit Service a721b1
        /* Disable caching again.  */
      Packit Service a721b1
        control.disable_caching = 1;
      Packit Service a721b1
      Packit Service a721b1
        /* If the widget was vertically enlarged too much, shrink it.  */
      Packit Service a721b1
        if (metric.height < expose->y + expose->height)
      Packit Service a721b1
          {
      Packit Service a721b1
            Arg arg;
      Packit Service a721b1
      Packit Service a721b1
            XtSetArg (arg, XtNheight, metric.height);
      Packit Service a721b1
            XtSetValues (w, &arg, 0);
      Packit Service a721b1
          }
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Print the usage of this program (the name is PROG), and exit with
      Packit Service a721b1
         EXIT_CODE.  */
      Packit Service a721b1
      Packit Service a721b1
      void
      Packit Service a721b1
      help_exit (char *prog, int exit_code)
      Packit Service a721b1
      {
      Packit Service a721b1
        char *p = prog;
      Packit Service a721b1
      Packit Service a721b1
        while (*p)
      Packit Service a721b1
          if (*p++ == '/')
      Packit Service a721b1
            prog = p;
      Packit Service a721b1
      Packit Service a721b1
        printf ("Usage: %s [ XT-OPTION ...] [ OPTION ...] [ FILE ]\n", prog);
      Packit Service a721b1
        printf ("Display FILE on a window.\n");
      Packit Service a721b1
        printf ("  If FILE is omitted, the input is taken from standard input.\n");
      Packit Service a721b1
        printf ("  XT-OPTIONs are standard Xt arguments (e.g. -fn, -fg).\n");
      Packit Service a721b1
        printf ("The following OPTIONs are available.\n");
      Packit Service a721b1
        printf ("  %-13s %s", "-e ENCODING",
      Packit Service a721b1
      	  "ENCODING is the encoding of FILE (defaults to UTF-8).\n");
      Packit Service a721b1
        printf ("  %-13s %s", "-s FONTSIZE",
      Packit Service a721b1
      	  "FONTSIZE is the fontsize in point.\n");
      Packit Service a721b1
        printf ("\t\tIf omitted, it defaults to the size\n");
      Packit Service a721b1
        printf ("\t\tof the default font defined in X resource.\n");
      Packit Service a721b1
        printf ("  %-13s %s", "--version", "print version number\n");
      Packit Service a721b1
        printf ("  %-13s %s", "-h, --help", "print this message\n");
      Packit Service a721b1
        exit (exit_code);
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Format MSG by FMT and print the result to the stderr, and exit.  */
      Packit Service a721b1
      Packit Service a721b1
      #define FATAL_ERROR(fmt, arg)	\
      Packit Service a721b1
        do {				\
      Packit Service a721b1
          fprintf (stderr, fmt, arg);	\
      Packit Service a721b1
          exit (1);			\
      Packit Service a721b1
        } while (0)
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      /* Adjust FONTSIZE for the resolution of the screen of widget W.  */
      Packit Service a721b1
      Packit Service a721b1
      int
      Packit Service a721b1
      adjust_fontsize (Widget w, int fontsize)
      Packit Service a721b1
      {
      Packit Service a721b1
        Display *display = XtDisplay (w);
      Packit Service a721b1
        int screen_number = XScreenNumberOfScreen (XtScreen (w));
      Packit Service a721b1
        double pixels = DisplayHeight (display, screen_number);
      Packit Service a721b1
        double mm = DisplayHeightMM (display, screen_number);
      Packit Service a721b1
      Packit Service a721b1
        return (fontsize * pixels * 25.4 / mm / 100);
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      Packit Service a721b1
      int
      Packit Service a721b1
      main (int argc, char **argv)
      Packit Service a721b1
      {
      Packit Service a721b1
        XtAppContext context;
      Packit Service a721b1
        Widget shell, form, quit, viewport, text;
      Packit Service a721b1
        String quit_action = "<KeyPress>q: set() notify() unset()";
      Packit Service a721b1
        XtActionsRec actions[] = { {"Expose", ExposeProc} };
      Packit Service a721b1
        Arg arg[10];
      Packit Service a721b1
        int i;
      Packit Service a721b1
        int viewport_width, viewport_height;
      Packit Service a721b1
        char *coding_name = NULL;
      Packit Service a721b1
        FILE *fp = stdin;
      Packit Service a721b1
        MSymbol coding;
      Packit Service a721b1
        int fontsize = 0;
      Packit Service a721b1
      Packit Service a721b1
        /* Open an application context.  */
      Packit Service a721b1
        XtSetLanguageProc (NULL, NULL, NULL);
      Packit Service a721b1
        shell = XtOpenApplication (&context, "M17NView", NULL, 0, &argc, argv, NULL,
      Packit Service a721b1
      			     sessionShellWidgetClass, NULL, 0);
      Packit Service a721b1
        XtAppAddActions (context, actions, XtNumber (actions));
      Packit Service a721b1
      Packit Service a721b1
        /* Parse the remaining command line arguments.  */
      Packit Service a721b1
        for (i = 1; i < argc; i++)
      Packit Service a721b1
          {
      Packit Service a721b1
            if (! strcmp (argv[i], "--help")
      Packit Service a721b1
      	  || ! strcmp (argv[i], "-h"))
      Packit Service a721b1
      	help_exit (argv[0], 0);
      Packit Service a721b1
            else if (! strcmp (argv[i], "--version"))
      Packit Service a721b1
      	{
      Packit Service a721b1
      	  printf ("m17n-view (m17n library) %s\n", M17NLIB_VERSION_NAME);
      Packit Service a721b1
      	  printf ("Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 AIST, JAPAN\n");
      Packit Service a721b1
      	  exit (0);
      Packit Service a721b1
      	}
      Packit Service a721b1
            else if (! strcmp (argv[i], "-e"))
      Packit Service a721b1
      	{
      Packit Service a721b1
      	  i++;
      Packit Service a721b1
      	  coding_name = argv[i];
      Packit Service a721b1
      	}
      Packit Service a721b1
            else if (! strcmp (argv[i], "-s"))
      Packit Service a721b1
      	{
      Packit Service a721b1
      	  double n;
      Packit Service a721b1
      	  i++;
      Packit Service a721b1
      	  n = atof (argv[i]);
      Packit Service a721b1
      	  if (n <= 0)
      Packit Service a721b1
      	    FATAL_ERROR ("Invalid fontsize %s!\n", argv[i]);
      Packit Service a721b1
      	  fontsize = adjust_fontsize (shell, (int) (n * 10));
      Packit Service a721b1
      	}
      Packit Service a721b1
            else if (argv[i][0] != '-')
      Packit Service a721b1
      	{
      Packit Service a721b1
      	  fp = fopen (argv[i], "r");
      Packit Service a721b1
      	  if (! fp)
      Packit Service a721b1
      	    FATAL_ERROR ("Fail to open the file %s!\n", argv[i]);
      Packit Service a721b1
      	}
      Packit Service a721b1
            else
      Packit Service a721b1
      	{
      Packit Service a721b1
      	  printf ("Unknown option: %s", argv[i]);
      Packit Service a721b1
      	  help_exit (argv[0], 1);
      Packit Service a721b1
      	}
      Packit Service a721b1
          }
      Packit Service a721b1
      Packit Service a721b1
        /* Initialize the m17n library.  */
      Packit Service a721b1
        M17N_INIT ();
      Packit Service a721b1
        if (merror_code != MERROR_NONE)
      Packit Service a721b1
          FATAL_ERROR ("%s\n", "Fail to initialize the m17n library.");
      Packit Service a721b1
      Packit Service a721b1
        /* Decide how to decode the input stream.  */
      Packit Service a721b1
        if (coding_name)
      Packit Service a721b1
          {
      Packit Service a721b1
            coding = mconv_resolve_coding (msymbol (coding_name));
      Packit Service a721b1
            if (coding == Mnil)
      Packit Service a721b1
      	FATAL_ERROR ("Invalid coding: %s\n", coding_name);
      Packit Service a721b1
          }
      Packit Service a721b1
        else
      Packit Service a721b1
          coding = Mcoding_utf_8;
      Packit Service a721b1
      Packit Service a721b1
        mt = mconv_decode_stream (coding, fp);
      Packit Service a721b1
        fclose (fp);
      Packit Service a721b1
        if (! mt)
      Packit Service a721b1
          FATAL_ERROR ("%s\n", "Fail to decode the input file or stream!");
      Packit Service a721b1
      Packit Service a721b1
        {
      Packit Service a721b1
          MPlist *param = mplist ();
      Packit Service a721b1
          MFace *face = mface ();
      Packit Service a721b1
      Packit Service a721b1
          if (fontsize)
      Packit Service a721b1
            mface_put_prop (face, Msize, (void *) fontsize);
      Packit Service a721b1
          mplist_put (param, Mwidget, shell);
      Packit Service a721b1
          mplist_put (param, Mface, face);
      Packit Service a721b1
          frame = mframe (param);
      Packit Service a721b1
          m17n_object_unref (param);
      Packit Service a721b1
          m17n_object_unref (face);
      Packit Service a721b1
        }
      Packit Service a721b1
      Packit Service a721b1
        /* Create this widget hierarchy.
      Packit Service a721b1
           Shell - form -+- quit
      Packit Service a721b1
      		   |
      Packit Service a721b1
      		   +- viewport - text  */
      Packit Service a721b1
      Packit Service a721b1
        form = XtCreateManagedWidget ("form", formWidgetClass, shell, NULL, 0);
      Packit Service a721b1
        XtSetArg (arg[0], XtNleft, XawChainLeft);
      Packit Service a721b1
        XtSetArg (arg[1], XtNright, XawChainLeft);
      Packit Service a721b1
        XtSetArg (arg[2], XtNtop, XawChainTop);
      Packit Service a721b1
        XtSetArg (arg[3], XtNbottom, XawChainTop);
      Packit Service a721b1
        XtSetArg (arg[4], XtNaccelerators, XtParseAcceleratorTable (quit_action));
      Packit Service a721b1
        quit = XtCreateManagedWidget ("quit", commandWidgetClass, form, arg, 5);
      Packit Service a721b1
        XtAddCallback (quit, XtNcallback, QuitProc, NULL);
      Packit Service a721b1
      Packit Service a721b1
        viewport_width = (int) mframe_get_prop (frame, Mfont_width) * 80;
      Packit Service a721b1
        viewport_height
      Packit Service a721b1
          = ((int) mframe_get_prop (frame, Mfont_ascent)
      Packit Service a721b1
             + (int) mframe_get_prop (frame, Mfont_descent)) * 24;
      Packit Service a721b1
        XtSetArg (arg[0], XtNallowVert, True);
      Packit Service a721b1
        XtSetArg (arg[1], XtNforceBars, False);
      Packit Service a721b1
        XtSetArg (arg[2], XtNfromVert, quit);
      Packit Service a721b1
        XtSetArg (arg[3], XtNtop, XawChainTop);
      Packit Service a721b1
        XtSetArg (arg[4], XtNbottom, XawChainBottom);
      Packit Service a721b1
        XtSetArg (arg[5], XtNright, XawChainRight);
      Packit Service a721b1
        XtSetArg (arg[6], XtNwidth, viewport_width);
      Packit Service a721b1
        XtSetArg (arg[7], XtNheight, viewport_height);
      Packit Service a721b1
        viewport = XtCreateManagedWidget ("viewport", viewportWidgetClass, form,
      Packit Service a721b1
      				    arg, 8);
      Packit Service a721b1
      Packit Service a721b1
        /* Before creating the text widget, we must calculate the height of
      Packit Service a721b1
           the M-text to draw.  */
      Packit Service a721b1
        control.two_dimensional = 1;
      Packit Service a721b1
        control.enable_bidi = 1;
      Packit Service a721b1
        control.disable_caching = 1;
      Packit Service a721b1
        control.max_line_width = viewport_width;
      Packit Service a721b1
        mdraw_text_extents (frame, mt, 0, mtext_len (mt), &control,
      Packit Service a721b1
      		      NULL, NULL, &metric);
      Packit Service a721b1
      Packit Service a721b1
        {
      Packit Service a721b1
          /* Decide the size of the text widget.  */
      Packit Service a721b1
          XtSetArg (arg[0], XtNwidth, viewport_width);
      Packit Service a721b1
          if (viewport_height > metric.height)
      Packit Service a721b1
            /* The outer viewport is tall enough.  */
      Packit Service a721b1
            XtSetArg (arg[1], XtNheight, viewport_height);
      Packit Service a721b1
          else if (metric.height < 0x8000)
      Packit Service a721b1
            /* The M-text height is within the limit of X.  */
      Packit Service a721b1
            XtSetArg (arg[1], XtNheight, metric.height);
      Packit Service a721b1
          else
      Packit Service a721b1
            /* We can't make such a tall widget.  Truncate it.  */
      Packit Service a721b1
            XtSetArg (arg[1], XtNheight, 0x7FFF);
      Packit Service a721b1
      Packit Service a721b1
          /* We must provide our own expose event handler.  */
      Packit Service a721b1
          XtSetArg (arg[2], XtNtranslations,
      Packit Service a721b1
      	      XtParseTranslationTable ((String) "<Expose>: Expose()"));
      Packit Service a721b1
          text = XtCreateManagedWidget ("text", simpleWidgetClass, viewport, arg, 3);
      Packit Service a721b1
        }
      Packit Service a721b1
      Packit Service a721b1
        /* Realize the top widget, and dive into an even loop.  */
      Packit Service a721b1
        XtInstallAllAccelerators (form, form);
      Packit Service a721b1
        XtRealizeWidget (shell);
      Packit Service a721b1
        XtAppMainLoop (context);
      Packit Service a721b1
      Packit Service a721b1
        /* Clear away.  */
      Packit Service a721b1
        m17n_object_unref (mt);
      Packit Service a721b1
        m17n_object_unref (frame);
      Packit Service a721b1
        M17N_FINI ();
      Packit Service a721b1
      Packit Service a721b1
        exit (0);
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      #else  /* not HAVE_X11_XAW_COMMAND_H */
      Packit Service a721b1
      Packit Service a721b1
      int
      Packit Service a721b1
      main (int argc, char **argv)
      Packit Service a721b1
      {
      Packit Service a721b1
        fprintf (stderr,
      Packit Service a721b1
      	   "Building of this program failed (lack of some header files)\n");
      Packit Service a721b1
        exit (1);
      Packit Service a721b1
      }
      Packit Service a721b1
      Packit Service a721b1
      #endif /* not HAVE_X11_XAW_COMMAND_H */
      Packit Service a721b1
      Packit Service a721b1
      #endif /* not FOR_DOXYGEN */