~jakub/helenos/ia64-revival

« back to all changes in this revision

Viewing changes to uspace/app/netecho/print_error.h

  • Committer: Jakub Jermar
  • Date: 2011-04-13 14:45:41 UTC
  • mfrom: (527.1.397 main-clone)
  • Revision ID: jakub@jermar.eu-20110413144541-x0j3r1zxqhsljx1o
MergeĀ mainlineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 */
28
28
 
29
29
/** @addtogroup net_app
30
 
 *  @{
 
30
 * @{
31
31
 */
32
32
 
33
33
/** @file
34
 
 *  Generic application error printing functions.
 
34
 * Generic application error printing functions.
35
35
 */
36
36
 
37
 
#ifndef __NET_APP_PRINT__
38
 
#define __NET_APP_PRINT__
 
37
#ifndef NET_APP_PRINT_
 
38
#define NET_APP_PRINT_
 
39
 
 
40
#include <stdio.h>
39
41
 
40
42
/** Returns whether the error code may be an ICMP error code.
41
 
 *  @param[in] error_code The error code.
42
 
 *  @returns A value indicating whether the error code may be an ICMP error code.
 
43
 *
 
44
 * @param[in] error_code The error code.
 
45
 * @return A value indicating whether the error code may be an ICMP error code.
43
46
 */
44
 
#define IS_ICMP_ERROR(error_code)               ((error_code) > 0)
 
47
#define IS_ICMP_ERROR(error_code)       ((error_code) > 0)
45
48
 
46
49
/** Returns whether the error code may be socket error code.
47
 
 *  @param[in] error_code The error code.
48
 
 *  @returns A value indicating whether the error code may be a socket error code.
 
50
 *
 
51
 * @param[in] error_code The error code.
 
52
 * @return A value indicating whether the error code may be a socket error code.
49
53
 */
50
54
#define IS_SOCKET_ERROR(error_code)     ((error_code) < 0)
51
55
 
52
 
/** Prints the specific ICMP error description.
53
 
 *  @param[in] output The description output stream. May be NULL.
54
 
 *  @param[in] error_code The ICMP error code.
55
 
 *  @param[in] prefix The error description prefix. May be NULL.
56
 
 *  @param[in] suffix The error description suffix. May be NULL.
57
 
 */
58
 
extern void icmp_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
59
 
 
60
 
/** Prints the error description.
61
 
 *  Supports ICMP and socket error codes.
62
 
 *  @param[in] output The description output stream. May be NULL.
63
 
 *  @param[in] error_code The error code.
64
 
 *  @param[in] prefix The error description prefix. May be NULL.
65
 
 *  @param[in] suffix The error description suffix. May be NULL.
66
 
 */
67
 
extern void print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
68
 
 
69
 
/** Prints the specific socket error description.
70
 
 *  @param[in] output The description output stream. May be NULL.
71
 
 *  @param[in] error_code The socket error code.
72
 
 *  @param[in] prefix The error description prefix. May be NULL.
73
 
 *  @param[in] suffix The error description suffix. May be NULL.
74
 
 */
75
 
extern void socket_print_error(FILE * output, int error_code, const char * prefix, const char * suffix);
 
56
extern void icmp_print_error(FILE *, int, const char *, const char *);
 
57
extern void print_error(FILE *, int, const char *, const char *);
 
58
extern void socket_print_error(FILE *, int, const char *, const char *);
76
59
 
77
60
#endif
78
61