about summary refs log tree commit diff stats
path: root/BUILD/VS2008X
ModeNameSize
-rw-r--r--clean.bat624log stats plain blame
-rw-r--r--develop.bat178log stats plain blame
d---------lynx113log stats plain
d---------makeuctb83log stats plain
82942bd5b957439f18'>af9be28b ^
af9be28b ^
d70fdcf7 ^
e087f6d4
af9be28b ^


d3f9d547 ^
e087f6d4
fe769404 ^
7887ed24 ^
e087f6d4
c3ec4181 ^
d326f24d ^
327b7c16 ^
2cd8e80b ^
327b7c16 ^
327b7c16 ^
d326f24d ^
c3ec4181 ^
2cd8e80b ^

c3ec4181 ^

d326f24d ^


327b7c16 ^
d326f24d ^

327b7c16 ^
c3ec4181 ^
327b7c16 ^
2cd8e80b ^
327b7c16 ^

d326f24d ^
327b7c16 ^

95586cc2 ^
d326f24d ^
327b7c16 ^


d326f24d ^
327b7c16 ^


d326f24d ^
327b7c16 ^
c3ec4181 ^

d326f24d ^




327b7c16 ^
c3ec4181 ^
d326f24d ^
327b7c16 ^

d326f24d ^

327b7c16 ^

d326f24d ^
327b7c16 ^

e087f6d4
e087f6d4
d326f24d ^



c3ec4181 ^
d326f24d ^
c3ec4181 ^
e087f6d4
d326f24d ^
c3ec4181 ^
d326f24d ^
e4409c40 ^
a2a1ab1e ^





b6d1143c ^
e4409c40 ^
c3ec4181 ^

d326f24d ^
b6d1143c ^
e4409c40 ^
b6d1143c ^
e4409c40 ^
d326f24d ^

c3ec4181 ^
e4409c40 ^
c3ec4181 ^
e4409c40 ^
c3ec4181 ^



affaa4f7 ^
d326f24d ^
affaa4f7 ^


e087f6d4

d326f24d ^
e087f6d4
c3ec4181 ^
d70fdcf7 ^
c3ec4181 ^


e4409c40 ^
c3ec4181 ^
e4409c40 ^
c3ec4181 ^






03413d1c ^

c3ec4181 ^
bed9a2c7 ^
2b52e9e6 ^
bed9a2c7 ^
e087f6d4
03413d1c ^
d326f24d ^
03413d1c ^


fe769404 ^

e087f6d4
c3ec4181 ^

e087f6d4


d326f24d ^

b63d287c ^
c3ec4181 ^




d3f9d547 ^
c3ec4181 ^
d83d4af1 ^
741e82fc ^








c3ec4181 ^
e087f6d4

d326f24d ^

d3f9d547 ^




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
  

                                                         
                                                                     
                                                           
   
                    
                   
                    
           


                         
                       
                 
                      
                    
 
  
                                 
   
                           
 
  
                                        
   

                                            

  


                                                                 
                                                                 

                                                 
                                                              
   
 
                                     

      
                                 

                                   
                                                                         
                    


      
                             


                                     
               
 

  




                                                                   
                                                              
   
                                

      

                                                                               

                               
                                 

     
 
  



                                                                     
                                    
                    
                                                              
   
                       
 
                                                                                     
               





                                                                               
                 
      

                                
                                           
           
                
                                       
                     

                                        
                 
               
                                       
                    



                                        
          
                                    


                       

          
                                                       
           
                         
                           


                       
               
                                
                    






                                 

                                                                          
       
                            
                 
      
 
      
                                                    


                     

                        
           

                                                      


                 

                                                                                     
                   




                                                         
                      
                 
                 








                                                      
                 

 

                                




                                                                                 
/*
 * $LynxId: LYexit.c,v 1.33 2007/05/06 21:41:43 tom Exp $
 *
 *	Copyright (c) 1994, University of Kansas, All Rights Reserved
 *	(most of this file was rewritten in 1996 and 2004).
 */
#include <HTUtils.h>
#include <LYexit.h>
#include <HTAlert.h>
#ifndef VMS
#include <LYGlobalDefs.h>
#include <LYUtils.h>
#include <LYSignal.h>
#include <LYMainLoop.h>
#endif /* !VMS */
#include <LYStrings.h>
#include <LYClean.h>

/*
 * Flag for outofmem macro.  - FM
 */
BOOL LYOutOfMemory = FALSE;

/*
 * Stack of functions to call upon exit.
 */
static void (*callstack[ATEXITSIZE]) (void);
static int topOfStack = 0;

/*
 * Purpose:		Registers termination function.
 * Arguments:		function	The function to register.
 * Return Value:	int	0	registered
 *				!0	no more space to register
 * Remarks/Portability/Dependencies/Restrictions:
 * Revision History:
 *	06-15-94	created Lynx 2-3-1 Garrett Arch Blythe
 */

int LYatexit(void (*function) (void))
{
    /*
     * Check for available space.
     */
    if (topOfStack == ATEXITSIZE) {
	CTRACE((tfp, "(LY)atexit: Too many functions, ignoring one!\n"));
	return (-1);
    }

    /*
     * Register the function.
     */
    callstack[topOfStack] = function;
    topOfStack++;
    return (0);
}

/*
 * Purpose:		Call the functions registered with LYatexit
 * Arguments:		void
 * Return Value:	void
 * Remarks/Portability/Dependencies/Restrictions:
 * Revision History:
 *	06-15-94	created Lynx 2-3-1 Garrett Arch Blythe
 */
static void LYCompleteExit(void)
{
    /*
     * Just loop through registered functions.  This is reentrant if more exits
     * occur in the registered functions.
     */
    while (--topOfStack >= 0) {
	callstack[topOfStack] ();
    }
}

/*
 * Purpose:		Terminates program, reports memory not freed.
 * Arguments:		status	Exit code.
 * Return Value:	void
 * Remarks/Portability/Dependencies/Restrictions:
 *	Function calls stdlib.h exit
 * Revision History:
 *	06-15-94	created Lynx 2-3-1 Garrett Arch Blythe
 */
void LYexit(int status)
{
#ifndef VMS			/*  On VMS, the VMSexit() handler does these. - FM */
#ifdef _WINDOWS
    extern CRITICAL_SECTION critSec_DNS;	/* 1998/09/03 (Thu) 22:01:56 */
    extern CRITICAL_SECTION critSec_READ;	/* 1998/09/03 (Thu) 22:01:56 */

    DeleteCriticalSection(&critSec_DNS);
    DeleteCriticalSection(&critSec_READ);

    WSACleanup();
#endif
    if (LYOutOfMemory == TRUE) {
	/*
	 * Ignore further interrupts.  - FM
	 */
#ifndef NOSIGHUP
	(void) signal(SIGHUP, SIG_IGN);
#endif /* NOSIGHUP */
	(void) signal(SIGTERM, SIG_IGN);
	(void) signal(SIGINT, SIG_IGN);
#ifndef __linux__
#ifndef DOSPATH
	(void) signal(SIGBUS, SIG_IGN);
#endif /* DOSPATH */
#endif /* !__linux__ */
	(void) signal(SIGSEGV, SIG_IGN);
	(void) signal(SIGILL, SIG_IGN);

	/*
	 * Flush all messages.  - FM
	 */
	fflush(stderr);
	fflush(stdout);

	/*
	 * Deal with curses, if on, and clean up.  - FM
	 */
	if (LYCursesON) {
	    LYSleepAlert();
	}
	cleanup_sig(0);
#ifndef __linux__
#ifndef DOSPATH
	signal(SIGBUS, SIG_DFL);
#endif /* DOSPATH */
#endif /* !__linux__ */
	signal(SIGSEGV, SIG_DFL);
	signal(SIGILL, SIG_DFL);
    }
#endif /* !VMS */

    /*
     * Close syslog before doing atexit-cleanup, since it may use a string
     * that would be freed there.
     */
#ifdef SYSLOG_REQUESTED_URLS
    LYCloselog();
#endif

    /*
     * Do functions registered with LYatexit.  - GAB
     */
    LYCompleteExit();

    LYCloseCmdLogfile();

#ifdef exit
/*  Make sure we use stdlib exit and not LYexit. - GAB
*/
#undef exit
#endif /* exit */

    cleanup_files();		/* if someone starts with LYNXfoo: page */
#ifndef VMS			/*  On VMS, the VMSexit() handler does these. - FM */
    fflush(stderr);
    if (LYOutOfMemory == TRUE) {
	LYOutOfMemory = FALSE;
	printf("\r\n%s\r\n\r\n", MEMORY_EXHAUSTED_ABORT);
	fflush(stdout);
    }
    LYCloseTracelog();
#endif /* !VMS */
    show_alloc();

#if defined(NCURSES_VERSION) && defined(LY_FIND_LEAKS)
#if defined(HAVE__NC_FREE_AND_EXIT)
    _nc_free_and_exit(status);
#elif defined(HAVE__NC_FREEALL)
    _nc_freeall();
#endif
#endif /* NCURSES_VERSION */

    exit(status);
}

void outofmem(const char *fname,
	      const char *func)
{
    fprintf(stderr, "\n\n\n%s %s: %s\n", fname, func, MEMORY_EXHAUSTED_ABORTING);
    LYOutOfMemory = TRUE;
    LYexit(-1);
}