13namespace L4 {
namespace Ipc {
15template<
typename CHAR =
char const,
typename LEN =
unsigned long>
16struct String :
Array<CHAR, LEN>
18 static LEN strlength(CHAR *d) { LEN l = 0;
while (d[l]) ++l;
return l; }
20 String(CHAR *d) :
Array<CHAR, LEN>(strlength(d) + 1, d) {}
21 String(LEN len, CHAR *d) :
Array<CHAR, LEN>(len, d) {}
22 void copy_in(CHAR
const *s)
28 for (i = 0; i < this->length - 1 && s[i]; ++i)
31 this->data[i] = CHAR();
35#if __cplusplus >= 201103L
36template<
typename CHAR = char,
typename LEN_TYPE =
unsigned long,
43template<
typename A,
typename LEN>
44struct Clnt_xmit< String<A, LEN> > : Clnt_xmit< Array<A, LEN> > {};
46template<
typename A,
typename LEN,
typename CLASS>
50 typedef Svr_val_ops< Array_ref<A, LEN>, Dir_in, CLASS > Base;
51 typedef typename Base::svr_type svr_type;
53 static int to_svr(
char *msg,
unsigned offset,
unsigned limit,
54 svr_type &a, Dir_in dir, Cls_data cls)
56 int r = Base::to_svr(msg, offset, limit, a, dir, cls);
64 typedef typename L4::Types::Remove_const<A>::type elem_type;
65 const_cast<elem_type*
>(a.data)[a.length - 1] = A();
70template<
typename A,
typename LEN>
71struct Clnt_xmit<String<A, LEN> &> : Clnt_xmit<Array<A, LEN> &>
73 typedef Array<A, LEN> &type;
75 using Clnt_xmit<type>::from_msg;
76 static int from_msg(
char *msg,
unsigned offset,
unsigned limit,
long ret,
79 int r = Clnt_xmit<type>::from_msg(msg, offset, limit, ret, a, dir, cls);
87 a.data[a.length - 1] = A();
92template<
typename A,
typename LEN>
93struct Clnt_xmit<String<A, LEN> *> : Clnt_xmit<String<A, LEN> &> {};
95template<
typename A,
typename LEN,
typename CLASS>
100template<
typename A,
typename LEN>
102template<
typename A,
typename LEN>
unsigned long l4_umword_t
Unsigned machine word.
@ L4_EMSGTOOSHORT
Message too short.
@ L4_UTCB_GENERIC_DATA_SIZE
Total number of message register (MRs) available.
IPC Message related functionality.
IPC related functionality.
L4 low-level kernel interface.
Server-side copy in buffer for Array.
Array data type for dynamically sized arrays in RPCs.
Marker type for data values.
Marker type for input values.
Marker type for output values.
Type trait defining a valid RPC parameter type.
Defines client-side handling of `MTYPE' as RPC argument.