xref: /titanic_50/usr/src/lib/libshell/common/sh/waitevent.c (revision d2b5b2d357ee3172eacb6860be1891259902203d)
1 /***********************************************************************
2 *                                                                      *
3 *               This software is part of the ast package               *
4 *          Copyright (c) 1982-2010 AT&T Intellectual Property          *
5 *                      and is licensed under the                       *
6 *                  Common Public License, Version 1.0                  *
7 *                    by AT&T Intellectual Property                     *
8 *                                                                      *
9 *                A copy of the License is available at                 *
10 *            http://www.opensource.org/licenses/cpl1.0.txt             *
11 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12 *                                                                      *
13 *              Information and Software Systems Research               *
14 *                            AT&T Research                             *
15 *                           Florham Park NJ                            *
16 *                                                                      *
17 *                  David Korn <dgk@research.att.com>                   *
18 *                                                                      *
19 ***********************************************************************/
20 #pragma prototyped
21 
22 #include	"defs.h"
23 /*
24  *  This installs a hook to allow the processing of events when
25  *  the shell is waiting for input and when the shell is
26  *  waiting for job completion.
27  *  The previous waitevent hook function is returned
28  */
29 
30 
31 void	*sh_waitnotify(int(*newevent)(int,long,int))
32 {
33 	int (*old)(int,long,int);
34 	old = sh.waitevent;
35 	sh.waitevent = newevent;
36 	return((void*)old);
37 }
38 
39 #if __OBSOLETE__ < 20080101
40 /*
41  * this used to be a private symbol
42  * retain the old name for a bit for a smooth transition
43  */
44 
45 #if defined(__EXPORT__)
46 #define extern		__EXPORT__
47 #endif
48 
49 extern void	*_sh_waitnotify(int(*newevent)(int,long,int))
50 {
51 	return sh_waitnotify(newevent);
52 }
53 
54 #endif
55