FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
xy.h
Go to the documentation of this file.
1 /* (X,Y) coordinates. */
2 
3 /*
4  Copyright (c) 2008 Eliot Dresselhaus
5 
6  Permission is hereby granted, free of charge, to any person obtaining
7  a copy of this software and associated documentation files (the
8  "Software"), to deal in the Software without restriction, including
9  without limitation the rights to use, copy, modify, merge, publish,
10  distribute, sublicense, and/or sell copies of the Software, and to
11  permit persons to whom the Software is furnished to do so, subject to
12  the following conditions:
13 
14  The above copyright notice and this permission notice shall be
15  included in all copies or substantial portions of the Software.
16 
17  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25 
26 #ifndef included_clib_xy_h
27 #define included_clib_xy_h
28 
29 #include <vppinfra/types.h>
30 
31 /* Basic definitions: coordinates and points. */
32 typedef double xy_float_t;
33 typedef __complex__ double xy_t;
34 typedef __complex__ int ixy_t;
35 
36 typedef __complex__ char i8xy_t;
37 typedef __complex__ short i16xy_t;
38 typedef __complex__ int i32xy_t;
39 
40 /* X/Y components of a point: can be used as either rvalue/lvalue. */
41 #define xy_x(x) __real__ (x)
42 #define xy_y(x) __imag__ (x)
43 
44 /* Unit vectors in x/y directions. */
45 #define xy_x_unit_vector (1)
46 #define xy_y_unit_vector (1I)
47 
48 #endif /* included_clib_xy_h */
49 
50 /*
51  * fd.io coding-style-patch-verification: ON
52  *
53  * Local Variables:
54  * eval: (c-set-style "gnu")
55  * End:
56  */
__complex__ short i16xy_t
Definition: xy.h:37
__complex__ int i32xy_t
Definition: xy.h:38
double xy_float_t
Definition: xy.h:32
__complex__ int ixy_t
Definition: xy.h:34
__complex__ char i8xy_t
Definition: xy.h:36
__complex__ double xy_t
Definition: xy.h:33