ObjFW  Diff

Differences From Artifact [f71e91f385]:

To Artifact [453d9528f7]:


14
15
16
17
18
19
20


21
22
23
24
25
26
27
 * file.
 */

#import "OFString.h"

#import "socket.h"



/*! @file */

/*!
 * @struct of_resolver_result_t resolver.h ObjFW/resolver.h
 *
 * @brief A struct representing one result from the resolver.
 */







>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 * file.
 */

#import "OFString.h"

#import "socket.h"

OF_ASSUME_NONNULL_BEGIN

/*! @file */

/*!
 * @struct of_resolver_result_t resolver.h ObjFW/resolver.h
 *
 * @brief A struct representing one result from the resolver.
 */
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64


65
66
67
68
69
70
71

72
73
74


 *	       struct
 * @param protocol The protocol that should be inserted into the resulting
 *		   address struct
 *
 * @return An array of results. The list is terminated by NULL and should be
 *	   free'd after use.
 */
extern of_resolver_result_t** of_resolve_host(OFString *host, uint16_t port,
    int protocol);

/*!
 * @brief Converts the specified address to a string and port pair.
 *
 * @param address The address to convert to a string
 * @param addressLength The length of the address to convert to a string
 * @param host A pointer to an OFString* which should be set to the host of the
 *	       address or NULL if the host is not needed
 * @param port A pointer to an uint16_t which should be set to the port of the
 *	       address or NULL if the port is not needed
 */
extern void of_address_to_string_and_port(struct sockaddr *address,
    socklen_t addressLength, OFString *__autoreleasing *host, uint16_t *port);



/*!
 * @brief Frees the results returned by @ref of_resolve_host.
 *
 * @param results The results returned by @ref of_resolve_host
 */
extern void of_resolver_free(of_resolver_result_t **results);

#ifdef __cplusplus
}
#endif









|
|












|
>
>






|
>



>
>
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 *	       struct
 * @param protocol The protocol that should be inserted into the resulting
 *		   address struct
 *
 * @return An array of results. The list is terminated by NULL and should be
 *	   free'd after use.
 */
extern __nullable of_resolver_result_t **__nonnull
    of_resolve_host(OFString *host, uint16_t port, int protocol);

/*!
 * @brief Converts the specified address to a string and port pair.
 *
 * @param address The address to convert to a string
 * @param addressLength The length of the address to convert to a string
 * @param host A pointer to an OFString* which should be set to the host of the
 *	       address or NULL if the host is not needed
 * @param port A pointer to an uint16_t which should be set to the port of the
 *	       address or NULL if the port is not needed
 */
extern void of_address_to_string_and_port(struct sockaddr *address,
    socklen_t addressLength,
    __nonnull OFString *__autoreleasing *__nullable host,
    __nullable uint16_t *port);

/*!
 * @brief Frees the results returned by @ref of_resolve_host.
 *
 * @param results The results returned by @ref of_resolve_host
 */
extern void of_resolver_free(
    __nullable of_resolver_result_t **__nonnull results);
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END