1 /*
2 	DSW_Api.h is part of DualSenseWindows
3 	https://github.com/Ohjurot/DualSense-Windows
4 
5 	Contributors of this file:
6 	11.2020 Ludwig Füchsl
7 
8 	Licensed under the MIT License (To be found in repository root directory)
9 */
10 module ds5w.dswapi;
11 
12 @nogc nothrow:
13 
14 bool DS5W_SUCCESS(BOOL)(BOOL expr)
15 {
16     return expr == DS5W_ReturnValue.OK;
17 }
18 
19 bool DS5W_FAILED(BOOL)(BOOL expr)
20 {
21     return expr != DS5W_ReturnValue.OK;
22 }
23 
24 enum DS5W_OK = DS5W_ReturnValue.OK;
25 enum DS5W_E_UNKNOWN = DS5W_ReturnValue.E_UNKNOWN;
26 enum DS5W_E_INSUFFICIENT_BUFFER = DS5W_ReturnValue.E_INSUFFICIENT_BUFFER;
27 enum DS5W_E_EXTERNAL_WINAPI = DS5W_ReturnValue.E_EXTERNAL_WINAPI;
28 enum DS5W_E_STACK_OVERFLOW = DS5W_ReturnValue.E_STACK_OVERFLOW;
29 enum DS5W_E_INVALID_ARGS = DS5W_ReturnValue.E_INVALID_ARGS;
30 enum DS5W_E_CURRENTLY_NOT_SUPPORTED = DS5W_ReturnValue.E_CURRENTLY_NOT_SUPPORTED;
31 enum DS5W_E_DEVICE_REMOVED = DS5W_ReturnValue.E_DEVICE_REMOVED;
32 enum DS5W_E_BT_COM = DS5W_ReturnValue.E_BT_COM;
33 
34 /// <summary>
35 /// Enum for return values
36 /// </summary>
37 enum DS5W_ReturnValue : uint
38 {
39     /// <summary>
40     /// Operation completed without an error
41     /// </summary>
42     OK = 0,
43 
44     /// <summary>
45     /// Operation encountered an unknown error
46     /// </summary>
47     E_UNKNOWN = 1,
48 
49     /// <summary>
50     /// The user supplied buffer is to small
51     /// </summary>
52     E_INSUFFICIENT_BUFFER = 2,
53 
54     /// <summary>
55     /// External unexpected winapi error (please report as issue if you get this error!)
56     /// </summary>
57     E_EXTERNAL_WINAPI = 3,
58 
59     /// <summary>
60     /// Not enought memroy on the stack
61     /// </summary>
62     E_STACK_OVERFLOW = 4,
63 
64     /// <summary>
65     /// Invalid arguments
66     /// </summary>
67     E_INVALID_ARGS = 5,
68 
69     /// <summary>
70     /// This feature is currently not supported
71     /// </summary>
72     E_CURRENTLY_NOT_SUPPORTED = 6,
73 
74     /// <summary>
75     /// Device was disconnected
76     /// </summary>
77     E_DEVICE_REMOVED = 7,
78 
79     /// <summary>
80     /// Bluetooth communication error
81     /// </summary>
82     E_BT_COM = 8,
83 
84 }
85 
86 alias DS5W_RV = DS5W_ReturnValue;