2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: Main.C /main/5 1996/10/17 17:00:51 drk $ */
27 * $XConsortium: Main.C /main/5 1996/10/17 17:00:51 drk $
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special
32 * restrictions in a confidential disclosure agreement bertween
33 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
34 * document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
35 * Sun's specific written approval. This documment and all copies
36 * and derivative works thereof must be returned or destroyed at
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
43 ///////////////////////////////////////////////////////////////////////////////
44 //////////////////////////////////////////////////////////////////////////////
45 // This example code is from the book:
47 // Object-Oriented Programming with C++ and OSF/Motif
50 // Prentice Hall, 1992
53 // Copyright 1991 by Prentice Hall
54 // All Rights Reserved
56 // Permission to use, copy, modify, and distribute this software for
57 // any purpose except publication and without fee is hereby granted, provided
58 // that the above copyright notice appear in all copies of the software.
59 ///////////////////////////////////////////////////////////////////////////////
60 //////////////////////////////////////////////////////////////////////////////
63 //////////////////////////////////////////////////////////
64 // Main.C: Generic main program used by all applications
65 //////////////////////////////////////////////////////////
66 #include "Application.h"
69 // We can implement main() in the library because the
70 // framework completely encapsulates all Xt boilerplate
71 // and all central flow of control.
78 static struct sigaction action;
80 void _signal( int Sig )
82 if ( getenv( "_ILS_DEBUG_" ) ) {
83 printf( "Got signal[%d]. Generate full core...\n", Sig );
84 sigaction( SIGIOT, NULL, &action );
85 action.sa_flags |= SA_FULLDUMP;
86 action.sa_flags &= ~SA_PARTDUMP;
87 sigaction( SIGIOT, &action, NULL );
94 int main ( int argc, char **argv )
99 // With Defect 174851, a lot of codes are changed to make dtmail i18n'ze.
100 // Especially, dtmail allocates the memory dynamically to convert the mail
101 // body. Therefore, I believe no defects there, but it will cause the
102 // potential coredump. If coredump will happen, to get the FULLCORE image,
103 // please set // _ILS_DEBUG_ environment variable on, like
104 // export _ILS_DEBUG_=:
106 // and do the same operation as that of when coredump will have occurred.
107 // If the signal will be received, dtmail generates full core dump image.
108 // Note: This core file size will be big. So be aware of "ulimit" of sh.
110 if ( getenv( "_ILS_DEBUG_" ) )
111 (void)signal( SIGILL|SIGIOT|SIGKILL|SIGBUS|SIGSEGV, _signal );
114 // Make sure the programmer has remembered to
115 // instantiate an Application object
117 assert ( theApplication != NULL );
119 // Init Intrinsics, build all windows, and enter event loop
121 theApplication->initialize ( &argc, argv );
123 theApplication->handleEvents();