1 /* C++ modules.  Experimental!	-*- c++ -*-
2    Copyright (C) 2020-2021 Free Software Foundation, Inc.
3    Written by Nathan Sidwell <nathan@acm.org> while at FaceBook
4 
5    This file is part of GCC.
6 
7    GCC is free software; you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11 
12    GCC is distributed in the hope that it will be useful, but
13    WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3.  If not see
19 <http://www.gnu.org/licenses/>.  */
20 
21 /* Forward to the header in c++tools.  */
22 
23 #ifndef MAPPER_CLIENT_H
24 #define MAPPER_CLIENT_H 1
25 
26 #include "cody.hh"
27 
28 #ifndef HAVE_SIGHANDLER_T
29 typedef void (*sighandler_t) (int);
30 #endif
31 
32 class module_client : public Cody::Client
33 {
34   pex_obj *pex = nullptr;
35   sighandler_t sigpipe = SIG_IGN;
36   Cody::Flags flags = Cody::Flags::None;
37 
38 public:
module_client(Cody::Server * s)39   module_client (Cody::Server *s)
40     : Client (s)
41   {
42   }
43   module_client (pex_obj *pex, int fd_from, int fd_to);
44 
module_client(int fd_from,int fd_to)45   module_client (int fd_from, int fd_to)
46     : Client (fd_from, fd_to)
47   {
48   }
49 
50 public:
get_flags()51   Cody::Flags get_flags () const
52   {
53     return flags;
54   }
55 
56 public:
57   static module_client *open_module_client (location_t loc, const char *option,
58 					    void (*set_repo) (const char *),
59 					    char const *);
60   static void close_module_client (location_t loc, module_client *);
61 };
62 
63 #endif
64