death to trailing whitespace
[openafs.git] / src / WINNT / afsapplib / ctl_sockaddr.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  *
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef CTL_SOCKADDR_H
11 #define CTL_SOCKADDR_H
12
13 /*
14  * DEFINITIONS ________________________________________________________________
15  *
16  */
17
18 #ifndef THIS_HINST
19 #define THIS_HINST  (HINSTANCE)GetModuleHandle(NULL)
20 #endif
21
22 #ifndef EXPORTED
23 #define EXPORTED
24 #endif
25
26 #ifndef limit
27 #define limit(_a,_x,_b)  min( max( (_x), (_a) ), (_b) )
28 #endif
29
30 #ifndef inlimit
31 #define inlimit(_a,_x,_b)  ( (((_x)>=(_a)) && ((_x)<=(_b))) ? TRUE : FALSE )
32 #endif
33
34 #ifndef cxRECT
35 #define cxRECT(_r)  ((_r).right - (_r).left)
36 #endif
37
38 #ifndef cyRECT
39 #define cyRECT(_r)  ((_r).bottom - (_r).top)
40 #endif
41
42
43 /*
44  * PROTOTYPES _________________________________________________________________
45  *
46  */
47
48 EXPORTED BOOL RegisterSockAddrClass (void);
49
50 #define SAM_GETADDR    (WM_USER+301) // SOCKADDR_IN *pAddr = lp;
51 #define SAM_SETADDR    (WM_USER+302) // SOCKADDR_IN *pAddr = lp;
52
53 #define SAN_CHANGE     0x1003  // SOCKADDR_IN *pTime = lp;
54 #define SAN_UPDATE     0x1004  // SOCKADDR_IN *pAddr = lp;
55
56 /*
57  * void SA_GetAddr (HWND hSockAddr, SOCKADDR_IN *pAddr)
58  * void SA_SetAddr (HWND hSockAddr, SOCKADDR_IN *pAddr)
59  *
60  */
61 #define SA_GetAddr(_hsa,_pAddr) \
62         SendMessage(_hsa,SAM_GETADDR,(WPARAM)0,(LPARAM)_pAddr)
63 #define SA_SetAddr(_hsa,_pAddr) \
64         SendMessage(_hsa,SAM_SETADDR,(WPARAM)0,(LPARAM)_pAddr)
65
66
67 #endif
68