Debian Codegraph @

docs/api_changes/v1_10.md

raw
1 # API changes after 1.10
2
3 This is a list of API changes after libUPnP version 1.10. This page
4 contains explanation of these changes and what users need to do to migrate.
5
6 ## Version 1.12
7
8 ### list.h header changed
9
10 The `list.h` header was replace by a different version, now all symbols
11 are properly namespaced with a Upnp prefix. This header was never intended
12 to be used directly by libUPnP users, so not many should be affected.
13
14 As a side-effect of the header change, libUPnP no longer defines the
15 `true` and `bool` macros. Users that need those should define their
16 own or use `<stdbool.h>`. Additionally the following macros are no
17 longer defined:
18
19 - `prefetch`
20 - `container_of`
21 - `READ_ONCE`
22 - `WRITE_ONCE`
23
24 And various list-specific macros are gone.
25 For details see the discussion at the Github PRs [#128][gh-pr128] and [#129][gh-pr129].
26
27 [gh-pr128]: https://github.com/mrjimenez/pupnp/pull/128
28 [gh-pr129]: https://github.com/mrjimenez/pupnp/pull/129
29
30 ### Removal of TRUE, FALSE macros and BOOL type
31
32 Previously `ixml.h` used to define `TRUE` and `FALSE` and declared a `BOOL` typedef.
33 Those macros and the typedef were removed in 10.12 in favor of just using `int` and
34 `1` and `0` for true and false.
35
36 If your code relied on these being available, the cleanets fix would be to use `<stdbool.h>`
37 instead. Alternatively if you can't use that or it would require too many changes to your
38 existing source code, you can define the macros and typedef in your headers:
39
40 ```c
41 #ifndef __OBJC__
42 typedef int BOOL;
43 #else
44 /* When using Objective-C, include objc.h which defines BOOL */
45 #include <objc/objc.h>
46 #endif
47
48 #define TRUE 1
49 #define FALSE 0
50 ```
51
52 ## Version 1.14
53
54 ### UpnpInit() has been dropped
55
56 UpnpInit() has long been deprecated and has now been dropped. Please use UpnpInit2().
57
58 ### Some include files have been renamed
59
60 When the template code was removed, a few files were renamed for consistency. The function calls remain the same, so the only necessary changes are in the include file names. The affected files are:
61
62 Original Name | New Name
63 --------------|---------
64 upnp/inc/ActionComplete.h | upnp/inc/UpnpActionComplete.h
65 upnp/inc/ActionRequest.h | upnp/inc/UpnpActionRequest.h
66 upnp/inc/Discovery.h | upnp/inc/UpnpDiscovery.h
67 upnp/inc/Event.h | upnp/inc/UpnpEvent.h
68 upnp/inc/EventSubscribe.h | upnp/inc/UpnpEventSubscribe.h
69 upnp/inc/ExtraHeaders.h | upnp/inc/UpnpExtraHeaders.h
70 upnp/inc/FileInfo.h | upnp/inc/UpnpFileInfo.h
71 upnp/inc/StateVarComplete.h | upnp/inc/UpnpStateVarComplete.h
72 upnp/inc/StateVarRequest.h | upnp/inc/UpnpStateVarRequest.h
73 upnp/inc/SubscriptionRequest.h | upnp/inc/UpnpSubscriptionRequest.h