1 /* Marshalling and unmarshalling of C-specific types.
2    Copyright (C) 2014-2018 Free Software Foundation, Inc.
3 
4 This file is part of GCC.
5 
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10 
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3.  If not see
18 <http://www.gnu.org/licenses/>.  */
19 
20 #ifndef CC1_PLUGIN_MARSHALL_C_HH
21 #define CC1_PLUGIN_MARSHALL_C_HH
22 
23 #include "marshall.hh"
24 #include "gcc-c-interface.h"
25 
26 namespace cc1_plugin
27 {
28   status
unmarshall(connection * conn,enum gcc_c_symbol_kind * result)29   unmarshall (connection *conn, enum gcc_c_symbol_kind *result)
30   {
31     protocol_int p;
32     if (!unmarshall_intlike (conn, &p))
33       return FAIL;
34     *result = (enum gcc_c_symbol_kind) p;
35     return OK;
36   }
37 
38   status
unmarshall(connection * conn,enum gcc_c_oracle_request * result)39   unmarshall (connection *conn, enum gcc_c_oracle_request *result)
40   {
41     protocol_int p;
42     if (!unmarshall_intlike (conn, &p))
43       return FAIL;
44     *result = (enum gcc_c_oracle_request) p;
45     return OK;
46   }
47 
48   status
unmarshall(connection * conn,enum gcc_qualifiers * result)49   unmarshall (connection *conn, enum gcc_qualifiers *result)
50   {
51     protocol_int p;
52     if (!unmarshall_intlike (conn, &p))
53       return FAIL;
54     *result = (enum gcc_qualifiers) p;
55     return OK;
56   }
57 }
58 
59 #endif // CC1_PLUGIN_MARSHALL_C_HH
60