Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / lib / tt / slib / mp_s_msg_context.C
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 //%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                  
24 //%%  (c) Copyright 1993, 1994 International Business Machines Corp.    
25 //%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                   
26 //%%  (c) Copyright 1993, 1994 Novell, Inc.                             
27 //%%  $XConsortium: mp_s_msg_context.C /main/3 1995/10/23 11:56:51 rswiston $                                                   
28 /*
29  *
30  * @(#)mp_s_msg_context.C       1.4 29 Jul 1993
31  *
32  * Tool Talk Message Passer (MP) - mp_s_msg_context.cc
33  *
34  * Copyright (c) 1992 by Sun Microsystems, Inc.
35  *
36  * _Tt_s_msg_context knows the server side of the context RPC interface.
37  */
38
39 #include <mp/mp_arg.h>
40 #include <mp/mp_procid.h>
41 #include "mp_s_pattern.h"
42 #include "mp_s_msg_context.h"
43
44 _Tt_s_msg_context::_Tt_s_msg_context()
45 {
46 }
47
48 _Tt_s_msg_context::~_Tt_s_msg_context()
49 {
50 }
51
52 Tt_status
53 _Tt_s_msg_context::s_join(
54         _Tt_procid_ptr &procID
55 ) const
56 {
57         _Tt_pattern_list_cursor patC( procID->patterns() );
58         Tt_status               status;
59         Tt_status               worstStatus = TT_OK;
60
61         while (patC.next()) {
62                 status = ((_Tt_s_pattern &)**patC).join_context( *this );
63                 switch (status) {
64                     case TT_OK:
65                     case TT_WRN_NOTFOUND:
66                         break;
67                     default:
68                         worstStatus = status;
69                 }
70         }
71         return worstStatus;
72 }
73
74 Tt_status
75 _Tt_s_msg_context::s_quit(
76         _Tt_procid_ptr &procID
77 ) const
78 {
79         _Tt_pattern_list_cursor patC( procID->patterns() );
80         Tt_status               status;
81         Tt_status               worstStatus = TT_OK;
82
83         while (patC.next()) {
84                 status = ((_Tt_s_pattern &)**patC).quit_context( *this );
85                 switch (status) {
86                     case TT_OK:
87                     case TT_WRN_NOTFOUND:
88                         break;
89                     default:
90                         worstStatus = status;
91                 }
92         }
93         return worstStatus;
94 }