View | Details | Raw Unified | Return to bug 69009
Collapse All | Expand All

(-)include/apr.h.in (+42 lines)
Lines 76-81 Link Here
76
#define __has_attribute(__x)    0
76
#define __has_attribute(__x)    0
77
#endif
77
#endif
78
78
79
/** Compiler __attributes__ */
80
#if __has_attribute(pure)
81
#define APR__ATTRIBUTE__PURE __attribute__((pure))
82
#else
83
#define APR__ATTRIBUTE__PURE
84
#endif
85
#if __has_attribute(weak)
86
#define APR__ATTRIBUTE__WEAK __attribute__((weak))
87
#else
88
#define APR__ATTRIBUTE__WEAK
89
#endif
90
#if __has_attribute(noreturn)
91
#define APR__ATTRIBUTE__NORETURN __attribute__((noreturn))
92
#else
93
#define APR__ATTRIBUTE__NORETURN
94
#endif
95
#if __has_attribute(sentinel)
96
#define APR__ATTRIBUTE__SENTINEL __attribute__((sentinel))
97
#else
98
#define APR__ATTRIBUTE__SENTINEL
99
#endif
100
#if __has_attribute(aligned)
101
#define APR__ATTRIBUTE__ALIGNED(_x) __attribute__((aligned(_x)))
102
#else
103
#define APR__ATTRIBUTE__ALIGNED(_x)
104
#endif
105
#if __has_attribute(nonnull)
106
#define APR__ATTRIBUTE__NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
107
#else
108
#define APR__ATTRIBUTE__NONNULL(...)
109
#endif
110
#if __has_attribute(format)
111
#define APR__ATTRIBUTE__FORMAT(...) __attribute__((format(__VA_ARGS__)))
112
#else
113
#define APR__ATTRIBUTE__FORMAT(...)
114
#endif
115
#if __has_attribute(alloc_size)
116
#define APR__ATTRIBUTE__ALLOC_SIZE(...) __attribute__((alloc_size(__VA_ARGS__)))
117
#else
118
#define APR__ATTRIBUTE__ALLOC_SIZE(...)
119
#endif
120
79
#define APR_HAVE_ARPA_INET_H     @arpa_ineth@
121
#define APR_HAVE_ARPA_INET_H     @arpa_ineth@
80
#define APR_HAVE_CONIO_H         @conioh@
122
#define APR_HAVE_CONIO_H         @conioh@
81
#define APR_HAVE_CRYPT_H         @crypth@
123
#define APR_HAVE_CRYPT_H         @crypth@
(-)include/apr_allocator.h (-9 / +9 lines)
Lines 72-78 struct apr_memnode_t { Link Here
72
 *
72
 *
73
 */
73
 */
74
APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)
74
APR_DECLARE(apr_status_t) apr_allocator_create(apr_allocator_t **allocator)
75
                          __attribute__((nonnull(1)));
75
                          APR__ATTRIBUTE__NONNULL(1);
76
76
77
/**
77
/**
78
 * Destroy an allocator
78
 * Destroy an allocator
Lines 81-87 APR_DECLARE(apr_status_t) apr_allocator_create(apr Link Here
81
 *         will _not_ be free()d.
81
 *         will _not_ be free()d.
82
 */
82
 */
83
APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
83
APR_DECLARE(void) apr_allocator_destroy(apr_allocator_t *allocator)
84
                  __attribute__((nonnull(1)));
84
                  APR__ATTRIBUTE__NONNULL(1);
85
85
86
/**
86
/**
87
 * Allocate a block of mem from the allocator
87
 * Allocate a block of mem from the allocator
Lines 91-97 APR_DECLARE(void) apr_allocator_destroy(apr_alloca Link Here
91
 */
91
 */
92
APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
92
APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(apr_allocator_t *allocator,
93
                                                 apr_size_t size)
93
                                                 apr_size_t size)
94
                             __attribute__((nonnull(1)));
94
                             APR__ATTRIBUTE__NONNULL(1);
95
95
96
/**
96
/**
97
 * Free a list of blocks of mem, giving them back to the allocator.
97
 * Free a list of blocks of mem, giving them back to the allocator.
Lines 102-108 APR_DECLARE(apr_memnode_t *) apr_allocator_alloc(a Link Here
102
 */
102
 */
103
APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
103
APR_DECLARE(void) apr_allocator_free(apr_allocator_t *allocator,
104
                                     apr_memnode_t *memnode)
104
                                     apr_memnode_t *memnode)
105
                  __attribute__((nonnull(1,2)));
105
                  APR__ATTRIBUTE__NONNULL(1,2);
106
106
107
/**
107
/**
108
 * Get the page/boundary size.
108
 * Get the page/boundary size.
Lines 144-150 APR_DECLARE(apr_size_t) apr_allocator_align(apr_al Link Here
144
 */
144
 */
145
APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
145
APR_DECLARE(void) apr_allocator_owner_set(apr_allocator_t *allocator,
146
                                          apr_pool_t *pool)
146
                                          apr_pool_t *pool)
147
                  __attribute__((nonnull(1)));
147
                  APR__ATTRIBUTE__NONNULL(1);
148
148
149
/**
149
/**
150
 * Get the current owner of the allocator
150
 * Get the current owner of the allocator
Lines 151-157 APR_DECLARE(void) apr_allocator_owner_set(apr_allo Link Here
151
 * @param allocator The allocator to get the owner from
151
 * @param allocator The allocator to get the owner from
152
 */
152
 */
153
APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
153
APR_DECLARE(apr_pool_t *) apr_allocator_owner_get(apr_allocator_t *allocator)
154
                          __attribute__((nonnull(1)));
154
                          APR__ATTRIBUTE__NONNULL(1);
155
155
156
/**
156
/**
157
 * Set the current threshold at which the allocator should start
157
 * Set the current threshold at which the allocator should start
Lines 161-167 APR_DECLARE(apr_pool_t *) apr_allocator_owner_get( Link Here
161
 */
161
 */
162
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
162
APR_DECLARE(void) apr_allocator_max_free_set(apr_allocator_t *allocator,
163
                                             apr_size_t size)
163
                                             apr_size_t size)
164
                  __attribute__((nonnull(1)));
164
                  APR__ATTRIBUTE__NONNULL(1);
165
165
166
#include "apr_thread_mutex.h"
166
#include "apr_thread_mutex.h"
167
167
Lines 173-179 APR_DECLARE(void) apr_allocator_max_free_set(apr_a Link Here
173
 */
173
 */
174
APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
174
APR_DECLARE(void) apr_allocator_mutex_set(apr_allocator_t *allocator,
175
                                          apr_thread_mutex_t *mutex)
175
                                          apr_thread_mutex_t *mutex)
176
                  __attribute__((nonnull(1)));
176
                  APR__ATTRIBUTE__NONNULL(1);
177
177
178
/**
178
/**
179
 * Get the mutex currently set for the allocator
179
 * Get the mutex currently set for the allocator
Lines 181-187 APR_DECLARE(void) apr_allocator_mutex_set(apr_allo Link Here
181
 */
181
 */
182
APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
182
APR_DECLARE(apr_thread_mutex_t *) apr_allocator_mutex_get(
183
                                          apr_allocator_t *allocator)
183
                                          apr_allocator_t *allocator)
184
                                  __attribute__((nonnull(1)));
184
                                  APR__ATTRIBUTE__NONNULL(1);
185
185
186
#endif /* APR_HAS_THREADS */
186
#endif /* APR_HAS_THREADS */
187
187
(-)include/apr_base64.h (-8 / +10 lines)
Lines 57-63 extern "C" { Link Here
57
 * @return the length of the string after it is encoded, including the
57
 * @return the length of the string after it is encoded, including the
58
 * trailing \0
58
 * trailing \0
59
 */
59
 */
60
APR_DECLARE(int) apr_base64_encode_len(int len) __attribute__((pure));
60
APR_DECLARE(int) apr_base64_encode_len(int len)
61
                 APR__ATTRIBUTE__PURE;
61
62
62
/**
63
/**
63
 * Encode a text string using base64encoding. On EBCDIC machines, the input
64
 * Encode a text string using base64encoding. On EBCDIC machines, the input
Lines 70-76 extern "C" { Link Here
70
 */
71
 */
71
APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src,
72
APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src,
72
                                   int len_plain_src)
73
                                   int len_plain_src)
73
                 __attribute__((nonnull(1,2)));
74
                 APR__ATTRIBUTE__NONNULL(1,2);
74
75
75
/**
76
/**
76
 * Encode an text string using base64encoding. This is the same as
77
 * Encode an text string using base64encoding. This is the same as
Lines 85-91 APR_DECLARE(int) apr_base64_encode(char * coded_ds Link Here
85
APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
86
APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
86
                                          const unsigned char *plain_src,
87
                                          const unsigned char *plain_src,
87
                                          int len_plain_src)
88
                                          int len_plain_src)
88
                 __attribute__((nonnull(1,2)));
89
                 APR__ATTRIBUTE__NONNULL(1,2);
89
90
90
/**
91
/**
91
 * Encode a string into memory allocated from a pool in base 64 format
92
 * Encode a string into memory allocated from a pool in base 64 format
Lines 94-100 APR_DECLARE(int) apr_base64_encode_binary(char * c Link Here
94
 * @return The encoded string
95
 * @return The encoded string
95
 */
96
 */
96
APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string)
97
APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string)
97
        __attribute__((nonnull(1,2)));
98
                    APR__ATTRIBUTE__NONNULL(1,2);
98
99
99
/**
100
/**
100
 * Determine the maximum buffer length required to decode the plain text
101
 * Determine the maximum buffer length required to decode the plain text
Lines 103-109 APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t Link Here
103
 * @return the maximum required buffer length for the plain text string
104
 * @return the maximum required buffer length for the plain text string
104
 */
105
 */
105
APR_DECLARE(int) apr_base64_decode_len(const char * coded_src)
106
APR_DECLARE(int) apr_base64_decode_len(const char * coded_src)
106
                 __attribute__((nonnull(1))) __attribute__((pure));
107
                 APR__ATTRIBUTE__NONNULL(1)
108
                 APR__ATTRIBUTE__PURE;
107
109
108
/**
110
/**
109
 * Decode a string to plain text. On EBCDIC machines, the result is then
111
 * Decode a string to plain text. On EBCDIC machines, the result is then
Lines 114-120 APR_DECLARE(int) apr_base64_decode_len(const char Link Here
114
 * @return the length of the plain text string (excluding the trailing \0)
116
 * @return the length of the plain text string (excluding the trailing \0)
115
 */
117
 */
116
APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src)
118
APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src)
117
                 __attribute__((nonnull(1,2)));
119
                 APR__ATTRIBUTE__NONNULL(1,2);
118
120
119
/**
121
/**
120
 * Decode an string to plain text. This is the same as apr_base64_decode()
122
 * Decode an string to plain text. This is the same as apr_base64_decode()
Lines 127-133 APR_DECLARE(int) apr_base64_decode(char * plain_ds Link Here
127
 */
129
 */
128
APR_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst,
130
APR_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst,
129
                                          const char *coded_src)
131
                                          const char *coded_src)
130
                 __attribute__((nonnull(1,2)));
132
                 APR__ATTRIBUTE__NONNULL(1,2);
131
133
132
/**
134
/**
133
 * Decode a base64 encoded string into memory allocated from a pool
135
 * Decode a base64 encoded string into memory allocated from a pool
Lines 136-142 APR_DECLARE(int) apr_base64_decode_binary(unsigned Link Here
136
 * @return The decoded string
138
 * @return The decoded string
137
 */
139
 */
138
APR_DECLARE(char *) apr_pbase64_decode(apr_pool_t *p, const char *bufcoded)
140
APR_DECLARE(char *) apr_pbase64_decode(apr_pool_t *p, const char *bufcoded)
139
        __attribute__((nonnull(1,2)));
141
                    APR__ATTRIBUTE__NONNULL(1,2);
140
142
141
/** @} */
143
/** @} */
142
#ifdef __cplusplus
144
#ifdef __cplusplus
(-)include/apr_buckets.h (-51 / +48 lines)
Lines 667-673 union apr_bucket_structs { Link Here
667
 */
667
 */
668
APR_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
668
APR_DECLARE(apr_bucket_brigade *) apr_brigade_create(apr_pool_t *p,
669
                                                     apr_bucket_alloc_t *list)
669
                                                     apr_bucket_alloc_t *list)
670
                                  __attribute__((nonnull(1,2)));
670
                                  APR__ATTRIBUTE__NONNULL(1,2);
671
671
672
/**
672
/**
673
 * Destroy an entire bucket brigade.  This includes destroying all of the
673
 * Destroy an entire bucket brigade.  This includes destroying all of the
Lines 675-681 APR_DECLARE(apr_bucket_brigade *) apr_brigade_crea Link Here
675
 * @param b The bucket brigade to destroy
675
 * @param b The bucket brigade to destroy
676
 */
676
 */
677
APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b)
677
APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_bucket_brigade *b)
678
                          __attribute__((nonnull(1)));
678
                          APR__ATTRIBUTE__NONNULL(1);
679
679
680
/**
680
/**
681
 * Empty out an entire bucket brigade.  This includes destroying all of the
681
 * Empty out an entire bucket brigade.  This includes destroying all of the
Lines 689-695 APR_DECLARE(apr_status_t) apr_brigade_destroy(apr_ Link Here
689
 *         the brigade and putting new buckets into it later.
689
 *         the brigade and putting new buckets into it later.
690
 */
690
 */
691
APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data)
691
APR_DECLARE(apr_status_t) apr_brigade_cleanup(void *data)
692
                          __attribute__((nonnull(1)));
692
                          APR__ATTRIBUTE__NONNULL(1);
693
693
694
/**
694
/**
695
 * Move the buckets from the tail end of the existing brigade @a b into
695
 * Move the buckets from the tail end of the existing brigade @a b into
Lines 709-715 APR_DECLARE(apr_status_t) apr_brigade_cleanup(void Link Here
709
APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b,
709
APR_DECLARE(apr_bucket_brigade *) apr_brigade_split_ex(apr_bucket_brigade *b,
710
                                                       apr_bucket *e,
710
                                                       apr_bucket *e,
711
                                                       apr_bucket_brigade *a)
711
                                                       apr_bucket_brigade *a)
712
                                  __attribute__((nonnull(1,2)));
712
                                  APR__ATTRIBUTE__NONNULL(1,2);
713
713
714
/**
714
/**
715
 * Create a new bucket brigade and move the buckets from the tail end
715
 * Create a new bucket brigade and move the buckets from the tail end
Lines 724-730 APR_DECLARE(apr_bucket_brigade *) apr_brigade_spli Link Here
724
 */
724
 */
725
APR_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b,
725
APR_DECLARE(apr_bucket_brigade *) apr_brigade_split(apr_bucket_brigade *b,
726
                                                    apr_bucket *e)
726
                                                    apr_bucket *e)
727
                                  __attribute__((nonnull(1,2)));
727
                                  APR__ATTRIBUTE__NONNULL(1,2);
728
728
729
/**
729
/**
730
 * Partition a bucket brigade at a given offset (in bytes from the start of
730
 * Partition a bucket brigade at a given offset (in bytes from the start of
Lines 741-747 APR_DECLARE(apr_bucket_brigade *) apr_brigade_spli Link Here
741
APR_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b,
741
APR_DECLARE(apr_status_t) apr_brigade_partition(apr_bucket_brigade *b,
742
                                                apr_off_t point,
742
                                                apr_off_t point,
743
                                                apr_bucket **after_point)
743
                                                apr_bucket **after_point)
744
                          __attribute__((nonnull(1,3)));
744
                          APR__ATTRIBUTE__NONNULL(1,3);
745
745
746
/**
746
/**
747
 * Return the total length of the brigade.
747
 * Return the total length of the brigade.
Lines 754-760 APR_DECLARE(apr_status_t) apr_brigade_partition(ap Link Here
754
APR_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb,
754
APR_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb,
755
                                             int read_all,
755
                                             int read_all,
756
                                             apr_off_t *length)
756
                                             apr_off_t *length)
757
                          __attribute__((nonnull(1,3)));
757
                          APR__ATTRIBUTE__NONNULL(1,3);
758
758
759
/**
759
/**
760
 * Take a bucket brigade and store the data in a flat char*
760
 * Take a bucket brigade and store the data in a flat char*
Lines 766-772 APR_DECLARE(apr_status_t) apr_brigade_length(apr_b Link Here
766
APR_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb,
766
APR_DECLARE(apr_status_t) apr_brigade_flatten(apr_bucket_brigade *bb,
767
                                              char *c,
767
                                              char *c,
768
                                              apr_size_t *len)
768
                                              apr_size_t *len)
769
                          __attribute__((nonnull(1,2,3)));
769
                          APR__ATTRIBUTE__NONNULL(1,2,3);
770
770
771
/**
771
/**
772
 * Creates a pool-allocated string representing a flat bucket brigade
772
 * Creates a pool-allocated string representing a flat bucket brigade
Lines 779-785 APR_DECLARE(apr_status_t) apr_brigade_pflatten(apr Link Here
779
                                               char **c,
779
                                               char **c,
780
                                               apr_size_t *len,
780
                                               apr_size_t *len,
781
                                               apr_pool_t *pool)
781
                                               apr_pool_t *pool)
782
                          __attribute__((nonnull(1,2,3,4)));
782
                          APR__ATTRIBUTE__NONNULL(1,2,3,4);
783
783
784
/**
784
/**
785
 * Split a brigade to represent one LF line.
785
 * Split a brigade to represent one LF line.
Lines 793-799 APR_DECLARE(apr_status_t) apr_brigade_split_line(a Link Here
793
                                                 apr_bucket_brigade *bbIn,
793
                                                 apr_bucket_brigade *bbIn,
794
                                                 apr_read_type_e block,
794
                                                 apr_read_type_e block,
795
                                                 apr_off_t maxbytes)
795
                                                 apr_off_t maxbytes)
796
                          __attribute__((nonnull(1,2)));
796
                          APR__ATTRIBUTE__NONNULL(1,2);
797
797
798
/**
798
/**
799
 * Split a brigade based on the provided boundary, or metadata buckets,
799
 * Split a brigade based on the provided boundary, or metadata buckets,
Lines 825-831 APR_DECLARE(apr_status_t) apr_brigade_split_bounda Link Here
825
                                                     const char *boundary,
825
                                                     const char *boundary,
826
                                                     apr_size_t boundary_len,
826
                                                     apr_size_t boundary_len,
827
                                                     apr_off_t maxbytes)
827
                                                     apr_off_t maxbytes)
828
                          __attribute__((nonnull(1,2)));
828
                          APR__ATTRIBUTE__NONNULL(1,2);
829
829
830
/**
830
/**
831
 * Create an iovec of the elements in a bucket_brigade... return number
831
 * Create an iovec of the elements in a bucket_brigade... return number
Lines 838-844 APR_DECLARE(apr_status_t) apr_brigade_split_bounda Link Here
838
 */
838
 */
839
APR_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b,
839
APR_DECLARE(apr_status_t) apr_brigade_to_iovec(apr_bucket_brigade *b,
840
                                               struct iovec *vec, int *nvec)
840
                                               struct iovec *vec, int *nvec)
841
                          __attribute__((nonnull(1,2,3)));
841
                          APR__ATTRIBUTE__NONNULL(1,2,3);
842
842
843
/**
843
/**
844
 * This function writes a list of strings into a bucket brigade.
844
 * This function writes a list of strings into a bucket brigade.
Lines 852-858 APR_DECLARE(apr_status_t) apr_brigade_vputstrs(apr Link Here
852
                                               apr_brigade_flush flush,
852
                                               apr_brigade_flush flush,
853
                                               void *ctx,
853
                                               void *ctx,
854
                                               va_list va)
854
                                               va_list va)
855
                          __attribute__((nonnull(1)));
855
                          APR__ATTRIBUTE__NONNULL(1);
856
856
857
/**
857
/**
858
 * This function writes a string into a bucket brigade.
858
 * This function writes a string into a bucket brigade.
Lines 880-886 APR_DECLARE(apr_status_t) apr_brigade_vputstrs(apr Link Here
880
APR_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b,
880
APR_DECLARE(apr_status_t) apr_brigade_write(apr_bucket_brigade *b,
881
                                            apr_brigade_flush flush, void *ctx,
881
                                            apr_brigade_flush flush, void *ctx,
882
                                            const char *str, apr_size_t nbyte)
882
                                            const char *str, apr_size_t nbyte)
883
                          __attribute__((nonnull(1,4)));
883
                          APR__ATTRIBUTE__NONNULL(1,4);
884
884
885
/**
885
/**
886
 * This function writes multiple strings into a bucket brigade.
886
 * This function writes multiple strings into a bucket brigade.
Lines 896-902 APR_DECLARE(apr_status_t) apr_brigade_writev(apr_b Link Here
896
                                             void *ctx,
896
                                             void *ctx,
897
                                             const struct iovec *vec,
897
                                             const struct iovec *vec,
898
                                             apr_size_t nvec)
898
                                             apr_size_t nvec)
899
                          __attribute__((nonnull(1,4)));
899
                          APR__ATTRIBUTE__NONNULL(1,4);
900
900
901
/**
901
/**
902
 * This function writes a string into a bucket brigade.
902
 * This function writes a string into a bucket brigade.
Lines 909-915 APR_DECLARE(apr_status_t) apr_brigade_writev(apr_b Link Here
909
APR_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
909
APR_DECLARE(apr_status_t) apr_brigade_puts(apr_bucket_brigade *bb,
910
                                           apr_brigade_flush flush, void *ctx,
910
                                           apr_brigade_flush flush, void *ctx,
911
                                           const char *str)
911
                                           const char *str)
912
                          __attribute__((nonnull(1,4)));
912
                          APR__ATTRIBUTE__NONNULL(1,4);
913
913
914
/**
914
/**
915
 * This function writes a character into a bucket brigade.
915
 * This function writes a character into a bucket brigade.
Lines 922-928 APR_DECLARE(apr_status_t) apr_brigade_puts(apr_buc Link Here
922
APR_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
922
APR_DECLARE(apr_status_t) apr_brigade_putc(apr_bucket_brigade *b,
923
                                           apr_brigade_flush flush, void *ctx,
923
                                           apr_brigade_flush flush, void *ctx,
924
                                           const char c)
924
                                           const char c)
925
                          __attribute__((nonnull(1)));
925
                          APR__ATTRIBUTE__NONNULL(1);
926
926
927
/**
927
/**
928
 * This function writes an unspecified number of strings into a bucket brigade.
928
 * This function writes an unspecified number of strings into a bucket brigade.
Lines 935-945 APR_DECLARE(apr_status_t) apr_brigade_putc(apr_buc Link Here
935
APR_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
935
APR_DECLARE_NONSTD(apr_status_t) apr_brigade_putstrs(apr_bucket_brigade *b,
936
                                                     apr_brigade_flush flush,
936
                                                     apr_brigade_flush flush,
937
                                                     void *ctx, ...)
937
                                                     void *ctx, ...)
938
#if defined(__GNUC__) && __GNUC__ >= 4
938
                                 APR__ATTRIBUTE__NONNULL(1)
939
    __attribute__((sentinel))
939
                                 APR__ATTRIBUTE__SENTINEL;
940
#endif
941
    __attribute__((nonnull(1)))
942
    ;
943
940
944
/**
941
/**
945
 * Evaluate a printf and put the resulting string at the end
942
 * Evaluate a printf and put the resulting string at the end
Lines 955-962 APR_DECLARE_NONSTD(apr_status_t) apr_brigade_print Link Here
955
                                                    apr_brigade_flush flush,
952
                                                    apr_brigade_flush flush,
956
                                                    void *ctx,
953
                                                    void *ctx,
957
                                                    const char *fmt, ...)
954
                                                    const char *fmt, ...)
958
                                 __attribute__((format(printf,4,5)))
955
                                 APR__ATTRIBUTE__FORMAT(printf,4,5)
959
                                 __attribute__((nonnull(1)));
956
                                 APR__ATTRIBUTE__NONNULL(1);
960
957
961
/**
958
/**
962
 * Evaluate a printf and put the resulting string at the end
959
 * Evaluate a printf and put the resulting string at the end
Lines 972-978 APR_DECLARE(apr_status_t) apr_brigade_vprintf(apr_ Link Here
972
                                              apr_brigade_flush flush,
969
                                              apr_brigade_flush flush,
973
                                              void *ctx,
970
                                              void *ctx,
974
                                              const char *fmt, va_list va)
971
                                              const char *fmt, va_list va)
975
                          __attribute__((nonnull(1,4)));
972
                          APR__ATTRIBUTE__NONNULL(1,4);
976
973
977
/**
974
/**
978
 * Utility function to insert a file (or a segment of a file) onto the
975
 * Utility function to insert a file (or a segment of a file) onto the
Lines 991-997 APR_DECLARE(apr_bucket *) apr_brigade_insert_file( Link Here
991
                                                  apr_off_t start,
988
                                                  apr_off_t start,
992
                                                  apr_off_t len,
989
                                                  apr_off_t len,
993
                                                  apr_pool_t *p)
990
                                                  apr_pool_t *p)
994
                          __attribute__((nonnull(1,2,5)));
991
                          APR__ATTRIBUTE__NONNULL(1,2,5);
995
992
996
993
997
994
Lines 1021-1027 APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucke Link Here
1021
 */
1018
 */
1022
APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(
1019
APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucket_alloc_create_ex(
1023
                                                 apr_allocator_t *allocator)
1020
                                                 apr_allocator_t *allocator)
1024
                                         __attribute__((nonnull(1)));
1021
                                         APR__ATTRIBUTE__NONNULL(1);
1025
1022
1026
/**
1023
/**
1027
 * Destroy a bucket allocator.
1024
 * Destroy a bucket allocator.
Lines 1028-1034 APR_DECLARE_NONSTD(apr_bucket_alloc_t *) apr_bucke Link Here
1028
 * @param list The allocator to be destroyed
1025
 * @param list The allocator to be destroyed
1029
 */
1026
 */
1030
APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list)
1027
APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list)
1031
                         __attribute__((nonnull(1)));
1028
                         APR__ATTRIBUTE__NONNULL(1);
1032
1029
1033
/**
1030
/**
1034
 * Get the aligned size corresponding to the requested size, but minus the
1031
 * Get the aligned size corresponding to the requested size, but minus the
Lines 1040-1046 APR_DECLARE_NONSTD(void) apr_bucket_alloc_destroy( Link Here
1040
 */
1037
 */
1041
APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list,
1038
APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_aligned_floor(apr_bucket_alloc_t *list,
1042
                                                              apr_size_t size)
1039
                                                              apr_size_t size)
1043
                         __attribute__((nonnull(1)));
1040
                               APR__ATTRIBUTE__NONNULL(1);
1044
1041
1045
/**
1042
/**
1046
 * Allocate memory for use by the buckets.
1043
 * Allocate memory for use by the buckets.
Lines 1049-1055 APR_DECLARE_NONSTD(apr_size_t) apr_bucket_alloc_al Link Here
1049
 */
1046
 */
1050
APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size,
1047
APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size,
1051
                                            apr_bucket_alloc_t *list)
1048
                                            apr_bucket_alloc_t *list)
1052
                           __attribute__((nonnull(2)));
1049
                           APR__ATTRIBUTE__NONNULL(2);
1053
1050
1054
/**
1051
/**
1055
 * Free memory previously allocated with apr_bucket_alloc().
1052
 * Free memory previously allocated with apr_bucket_alloc().
Lines 1056-1062 APR_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_si Link Here
1056
 * @param block The block of memory to be freed.
1053
 * @param block The block of memory to be freed.
1057
 */
1054
 */
1058
APR_DECLARE_NONSTD(void) apr_bucket_free(void *block)
1055
APR_DECLARE_NONSTD(void) apr_bucket_free(void *block)
1059
                         __attribute__((nonnull(1)));
1056
                         APR__ATTRIBUTE__NONNULL(1);
1060
1057
1061
1058
1062
/*  *****  Bucket Functions  *****  */
1059
/*  *****  Bucket Functions  *****  */
Lines 1420-1426 APR_DECLARE(apr_bucket *) apr_bucket_eos_create(ap Link Here
1420
 * @return The new bucket, or NULL if allocation failed
1417
 * @return The new bucket, or NULL if allocation failed
1421
 */
1418
 */
1422
APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b)
1419
APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_bucket *b)
1423
                          __attribute__((nonnull(1)));
1420
                          APR__ATTRIBUTE__NONNULL(1);
1424
1421
1425
/**
1422
/**
1426
 * Create a flush  bucket.  This indicates that filters should flush their
1423
 * Create a flush  bucket.  This indicates that filters should flush their
Lines 1430-1436 APR_DECLARE(apr_bucket *) apr_bucket_eos_make(apr_ Link Here
1430
 * @return The new bucket, or NULL if allocation failed
1427
 * @return The new bucket, or NULL if allocation failed
1431
 */
1428
 */
1432
APR_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list)
1429
APR_DECLARE(apr_bucket *) apr_bucket_flush_create(apr_bucket_alloc_t *list)
1433
                          __attribute__((nonnull(1)));
1430
                          APR__ATTRIBUTE__NONNULL(1);
1434
1431
1435
/**
1432
/**
1436
 * Make the bucket passed in a FLUSH  bucket.  This indicates that filters
1433
 * Make the bucket passed in a FLUSH  bucket.  This indicates that filters
Lines 1440-1446 APR_DECLARE(apr_bucket *) apr_bucket_flush_create( Link Here
1440
 * @return The new bucket, or NULL if allocation failed
1437
 * @return The new bucket, or NULL if allocation failed
1441
 */
1438
 */
1442
APR_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b)
1439
APR_DECLARE(apr_bucket *) apr_bucket_flush_make(apr_bucket *b)
1443
                          __attribute__((nonnull(1)));
1440
                          APR__ATTRIBUTE__NONNULL(1);
1444
1441
1445
/**
1442
/**
1446
 * Create a bucket referring to long-lived data.
1443
 * Create a bucket referring to long-lived data.
Lines 1452-1458 APR_DECLARE(apr_bucket *) apr_bucket_flush_make(ap Link Here
1452
APR_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
1449
APR_DECLARE(apr_bucket *) apr_bucket_immortal_create(const char *buf,
1453
                                                     apr_size_t nbyte,
1450
                                                     apr_size_t nbyte,
1454
                                                     apr_bucket_alloc_t *list)
1451
                                                     apr_bucket_alloc_t *list)
1455
                          __attribute__((nonnull(1,3)));
1452
                          APR__ATTRIBUTE__NONNULL(1,3);
1456
1453
1457
/**
1454
/**
1458
 * Make the bucket passed in a bucket refer to long-lived data
1455
 * Make the bucket passed in a bucket refer to long-lived data
Lines 1464-1470 APR_DECLARE(apr_bucket *) apr_bucket_immortal_crea Link Here
1464
APR_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b,
1461
APR_DECLARE(apr_bucket *) apr_bucket_immortal_make(apr_bucket *b,
1465
                                                   const char *buf,
1462
                                                   const char *buf,
1466
                                                   apr_size_t nbyte)
1463
                                                   apr_size_t nbyte)
1467
                          __attribute__((nonnull(1,2)));
1464
                          APR__ATTRIBUTE__NONNULL(1,2);
1468
1465
1469
/**
1466
/**
1470
 * Create a bucket referring to data on the stack.
1467
 * Create a bucket referring to data on the stack.
Lines 1476-1482 APR_DECLARE(apr_bucket *) apr_bucket_immortal_make Link Here
1476
APR_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
1473
APR_DECLARE(apr_bucket *) apr_bucket_transient_create(const char *buf,
1477
                                                      apr_size_t nbyte,
1474
                                                      apr_size_t nbyte,
1478
                                                      apr_bucket_alloc_t *list)
1475
                                                      apr_bucket_alloc_t *list)
1479
                          __attribute__((nonnull(1,3)));
1476
                          APR__ATTRIBUTE__NONNULL(1,3);
1480
1477
1481
/**
1478
/**
1482
 * Make the bucket passed in a bucket refer to stack data
1479
 * Make the bucket passed in a bucket refer to stack data
Lines 1488-1494 APR_DECLARE(apr_bucket *) apr_bucket_transient_cre Link Here
1488
APR_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b,
1485
APR_DECLARE(apr_bucket *) apr_bucket_transient_make(apr_bucket *b,
1489
                                                    const char *buf,
1486
                                                    const char *buf,
1490
                                                    apr_size_t nbyte)
1487
                                                    apr_size_t nbyte)
1491
                          __attribute__((nonnull(1,2)));
1488
                          APR__ATTRIBUTE__NONNULL(1,2);
1492
1489
1493
/**
1490
/**
1494
 * Create a bucket referring to memory on the heap. If the caller asks
1491
 * Create a bucket referring to memory on the heap. If the caller asks
Lines 1508-1514 APR_DECLARE(apr_bucket *) apr_bucket_heap_create(c Link Here
1508
                                                 apr_size_t nbyte,
1505
                                                 apr_size_t nbyte,
1509
                                                 void (*free_func)(void *data),
1506
                                                 void (*free_func)(void *data),
1510
                                                 apr_bucket_alloc_t *list)
1507
                                                 apr_bucket_alloc_t *list)
1511
                          __attribute__((nonnull(1,4)));
1508
                          APR__ATTRIBUTE__NONNULL(1,4);
1512
/**
1509
/**
1513
 * Make the bucket passed in a bucket refer to heap data
1510
 * Make the bucket passed in a bucket refer to heap data
1514
 * @param b The bucket to make into a HEAP bucket
1511
 * @param b The bucket to make into a HEAP bucket
Lines 1521-1527 APR_DECLARE(apr_bucket *) apr_bucket_heap_create(c Link Here
1521
APR_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf,
1518
APR_DECLARE(apr_bucket *) apr_bucket_heap_make(apr_bucket *b, const char *buf,
1522
                                               apr_size_t nbyte,
1519
                                               apr_size_t nbyte,
1523
                                               void (*free_func)(void *data))
1520
                                               void (*free_func)(void *data))
1524
                          __attribute__((nonnull(1,2)));
1521
                          APR__ATTRIBUTE__NONNULL(1,2);
1525
1522
1526
/**
1523
/**
1527
 * Create a bucket referring to memory allocated from a pool.
1524
 * Create a bucket referring to memory allocated from a pool.
Lines 1536-1542 APR_DECLARE(apr_bucket *) apr_bucket_pool_create(c Link Here
1536
                                                 apr_size_t length,
1533
                                                 apr_size_t length,
1537
                                                 apr_pool_t *pool,
1534
                                                 apr_pool_t *pool,
1538
                                                 apr_bucket_alloc_t *list)
1535
                                                 apr_bucket_alloc_t *list)
1539
                          __attribute__((nonnull(1,3,4)));
1536
                          APR__ATTRIBUTE__NONNULL(1,3,4);
1540
1537
1541
/**
1538
/**
1542
 * Make the bucket passed in a bucket refer to pool data
1539
 * Make the bucket passed in a bucket refer to pool data
Lines 1549-1555 APR_DECLARE(apr_bucket *) apr_bucket_pool_create(c Link Here
1549
APR_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf,
1546
APR_DECLARE(apr_bucket *) apr_bucket_pool_make(apr_bucket *b, const char *buf,
1550
                                               apr_size_t length,
1547
                                               apr_size_t length,
1551
                                               apr_pool_t *pool)
1548
                                               apr_pool_t *pool)
1552
                          __attribute__((nonnull(1,2,4)));
1549
                          APR__ATTRIBUTE__NONNULL(1,2,4);
1553
1550
1554
#if APR_HAS_MMAP
1551
#if APR_HAS_MMAP
1555
/**
1552
/**
Lines 1565-1571 APR_DECLARE(apr_bucket *) apr_bucket_mmap_create(a Link Here
1565
                                                 apr_off_t start,
1562
                                                 apr_off_t start,
1566
                                                 apr_size_t length,
1563
                                                 apr_size_t length,
1567
                                                 apr_bucket_alloc_t *list)
1564
                                                 apr_bucket_alloc_t *list)
1568
                          __attribute__((nonnull(1,4)));
1565
                          APR__ATTRIBUTE__NONNULL(1,4);
1569
1566
1570
/**
1567
/**
1571
 * Make the bucket passed in a bucket refer to an MMAP'ed file
1568
 * Make the bucket passed in a bucket refer to an MMAP'ed file
Lines 1579-1585 APR_DECLARE(apr_bucket *) apr_bucket_mmap_create(a Link Here
1579
APR_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm,
1576
APR_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr_bucket *b, apr_mmap_t *mm,
1580
                                               apr_off_t start,
1577
                                               apr_off_t start,
1581
                                               apr_size_t length)
1578
                                               apr_size_t length)
1582
                          __attribute__((nonnull(1,2)));
1579
                          APR__ATTRIBUTE__NONNULL(1,2);
1583
#endif
1580
#endif
1584
1581
1585
/**
1582
/**
Lines 1590-1596 APR_DECLARE(apr_bucket *) apr_bucket_mmap_make(apr Link Here
1590
 */
1587
 */
1591
APR_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock,
1588
APR_DECLARE(apr_bucket *) apr_bucket_socket_create(apr_socket_t *thissock,
1592
                                                   apr_bucket_alloc_t *list)
1589
                                                   apr_bucket_alloc_t *list)
1593
                          __attribute__((nonnull(1,2)));
1590
                          APR__ATTRIBUTE__NONNULL(1,2);
1594
/**
1591
/**
1595
 * Make the bucket passed in a bucket refer to a socket
1592
 * Make the bucket passed in a bucket refer to a socket
1596
 * @param b The bucket to make into a SOCKET bucket
1593
 * @param b The bucket to make into a SOCKET bucket
Lines 1599-1605 APR_DECLARE(apr_bucket *) apr_bucket_socket_create Link Here
1599
 */
1596
 */
1600
APR_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b,
1597
APR_DECLARE(apr_bucket *) apr_bucket_socket_make(apr_bucket *b,
1601
                                                 apr_socket_t *thissock)
1598
                                                 apr_socket_t *thissock)
1602
                          __attribute__((nonnull(1,2)));
1599
                          APR__ATTRIBUTE__NONNULL(1,2);
1603
1600
1604
/**
1601
/**
1605
 * Create a bucket referring to a pipe.
1602
 * Create a bucket referring to a pipe.
Lines 1609-1615 APR_DECLARE(apr_bucket *) apr_bucket_socket_make(a Link Here
1609
 */
1606
 */
1610
APR_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe,
1607
APR_DECLARE(apr_bucket *) apr_bucket_pipe_create(apr_file_t *thispipe,
1611
                                                 apr_bucket_alloc_t *list)
1608
                                                 apr_bucket_alloc_t *list)
1612
                          __attribute__((nonnull(1,2)));
1609
                          APR__ATTRIBUTE__NONNULL(1,2);
1613
1610
1614
/**
1611
/**
1615
 * Make the bucket passed in a bucket refer to a pipe
1612
 * Make the bucket passed in a bucket refer to a pipe
Lines 1619-1625 APR_DECLARE(apr_bucket *) apr_bucket_pipe_create(a Link Here
1619
 */
1616
 */
1620
APR_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b,
1617
APR_DECLARE(apr_bucket *) apr_bucket_pipe_make(apr_bucket *b,
1621
                                               apr_file_t *thispipe)
1618
                                               apr_file_t *thispipe)
1622
                          __attribute__((nonnull(1,2)));
1619
                          APR__ATTRIBUTE__NONNULL(1,2);
1623
1620
1624
/**
1621
/**
1625
 * Create a bucket referring to a file.
1622
 * Create a bucket referring to a file.
Lines 1642-1648 APR_DECLARE(apr_bucket *) apr_bucket_file_create(a Link Here
1642
                                                 apr_size_t len,
1639
                                                 apr_size_t len,
1643
                                                 apr_pool_t *p,
1640
                                                 apr_pool_t *p,
1644
                                                 apr_bucket_alloc_t *list)
1641
                                                 apr_bucket_alloc_t *list)
1645
                          __attribute__((nonnull(1,4,5)));
1642
                          APR__ATTRIBUTE__NONNULL(1,4,5);
1646
1643
1647
/**
1644
/**
1648
 * Make the bucket passed in a bucket refer to a file
1645
 * Make the bucket passed in a bucket refer to a file
Lines 1657-1663 APR_DECLARE(apr_bucket *) apr_bucket_file_create(a Link Here
1657
APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd,
1654
APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr_bucket *b, apr_file_t *fd,
1658
                                               apr_off_t offset,
1655
                                               apr_off_t offset,
1659
                                               apr_size_t len, apr_pool_t *p)
1656
                                               apr_size_t len, apr_pool_t *p)
1660
                          __attribute__((nonnull(1,2,5)));
1657
                          APR__ATTRIBUTE__NONNULL(1,2,5);
1661
1658
1662
/**
1659
/**
1663
 * Enable or disable memory-mapping for a FILE bucket (default is enabled)
1660
 * Enable or disable memory-mapping for a FILE bucket (default is enabled)
Lines 1667-1673 APR_DECLARE(apr_bucket *) apr_bucket_file_make(apr Link Here
1667
 */
1664
 */
1668
APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b,
1665
APR_DECLARE(apr_status_t) apr_bucket_file_enable_mmap(apr_bucket *b,
1669
                                                      int enabled)
1666
                                                      int enabled)
1670
                          __attribute__((nonnull(1)));
1667
                          APR__ATTRIBUTE__NONNULL(1);
1671
1668
1672
/**
1669
/**
1673
 * Set the size of the read buffer allocated by a FILE bucket (default
1670
 * Set the size of the read buffer allocated by a FILE bucket (default
(-)include/apr_buffer.h (-16 / +16 lines)
Lines 98-104 typedef struct Link Here
98
 */
98
 */
99
APR_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
99
APR_DECLARE(apr_status_t) apr_buffer_mem_set(apr_buffer_t *buf,
100
                                             void *mem, apr_size_t len)
100
                                             void *mem, apr_size_t len)
101
                                             __attribute__((nonnull(1)));
101
                          APR__ATTRIBUTE__NONNULL(1);
102
102
103
103
104
/**
104
/**
Lines 117-123 APR_DECLARE(apr_status_t) apr_buffer_mem_set(apr_b Link Here
117
APR_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
117
APR_DECLARE(apr_status_t) apr_buffer_mem_create(apr_buffer_t **mb,
118
                                                apr_pool_t *pool,
118
                                                apr_pool_t *pool,
119
                                                void *mem, apr_size_t len)
119
                                                void *mem, apr_size_t len)
120
                                                __attribute__((nonnull(1,2)));
120
                          APR__ATTRIBUTE__NONNULL(1,2);
121
121
122
/**
122
/**
123
 * Set a apr_buffer_t with a zero terminated string.
123
 * Set a apr_buffer_t with a zero terminated string.
Lines 130-136 APR_DECLARE(apr_status_t) apr_buffer_mem_create(ap Link Here
130
 */
130
 */
131
APR_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
131
APR_DECLARE(apr_status_t) apr_buffer_str_set(apr_buffer_t *buf,
132
                                             char *str, apr_ssize_t len)
132
                                             char *str, apr_ssize_t len)
133
                                             __attribute__((nonnull(1)));
133
                          APR__ATTRIBUTE__NONNULL(1);
134
134
135
/**
135
/**
136
 * Create a apr_buffer_t containing a zero terminated string.
136
 * Create a apr_buffer_t containing a zero terminated string.
Lines 149-155 APR_DECLARE(apr_status_t) apr_buffer_str_set(apr_b Link Here
149
APR_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
149
APR_DECLARE(apr_status_t) apr_buffer_str_create(apr_buffer_t **sb,
150
                                                apr_pool_t *pool,
150
                                                apr_pool_t *pool,
151
                                                char *str, apr_ssize_t len)
151
                                                char *str, apr_ssize_t len)
152
                                                __attribute__((nonnull(1)));
152
                          APR__ATTRIBUTE__NONNULL(1);
153
153
154
/**
154
/**
155
 * Create a apr_buffer_t containing a NULL payload.
155
 * Create a apr_buffer_t containing a NULL payload.
Lines 162-168 APR_DECLARE(apr_status_t) apr_buffer_str_create(ap Link Here
162
 */
162
 */
163
APR_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
163
APR_DECLARE(apr_status_t) apr_buffer_null_create(apr_buffer_t **nb,
164
                                                 apr_pool_t *pool)
164
                                                 apr_pool_t *pool)
165
                                                 __attribute__((nonnull(1)));
165
                          APR__ATTRIBUTE__NONNULL(1);
166
166
167
167
168
/**
168
/**
Lines 174-180 APR_DECLARE(apr_status_t) apr_buffer_null_create(a Link Here
174
 * @return Returns 1 if buffer is null, otherwise 0.
174
 * @return Returns 1 if buffer is null, otherwise 0.
175
 */
175
 */
176
APR_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
176
APR_DECLARE(int) apr_buffer_is_null(const apr_buffer_t *buf)
177
                                    __attribute__((nonnull(1)));
177
                 APR__ATTRIBUTE__NONNULL(1);
178
178
179
179
180
/** 
180
/** 
Lines 186-192 APR_DECLARE(int) apr_buffer_is_null(const apr_buff Link Here
186
 * @return Returns 1 if zero terminated, otherwise 0.
186
 * @return Returns 1 if zero terminated, otherwise 0.
187
 */
187
 */
188
APR_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
188
APR_DECLARE(int) apr_buffer_is_str(const apr_buffer_t *buf)
189
                                   __attribute__((nonnull(1)));
189
                 APR__ATTRIBUTE__NONNULL(1);
190
190
191
191
192
/**
192
/**
Lines 206-212 APR_DECLARE(int) apr_buffer_is_str(const apr_buffe Link Here
206
 * contains memory.
206
 * contains memory.
207
 */
207
 */
208
APR_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
208
APR_DECLARE(char *) apr_buffer_str(const apr_buffer_t *buf)
209
                                   __attribute__((nonnull(1)));
209
                    APR__ATTRIBUTE__NONNULL(1);
210
210
211
211
212
/**
212
/**
Lines 223-229 APR_DECLARE(char *) apr_buffer_str(const apr_buffe Link Here
223
 *         allocate memory.
223
 *         allocate memory.
224
 */
224
 */
225
APR_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
225
APR_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t *pool, const apr_buffer_t *buf)
226
                                       __attribute__((nonnull(1,2)));
226
                    APR__ATTRIBUTE__NONNULL(1,2);
227
227
228
228
229
/**
229
/**
Lines 239-245 APR_DECLARE(char *) apr_buffer_pstrdup(apr_pool_t Link Here
239
 * @return The memory buffer.
239
 * @return The memory buffer.
240
 */
240
 */
241
APR_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
241
APR_DECLARE(void *) apr_buffer_mem(const apr_buffer_t *buf, apr_size_t *size)
242
                                   __attribute__((nonnull(1)));
242
                    APR__ATTRIBUTE__NONNULL(1);
243
243
244
244
245
/**
245
/**
Lines 253-259 APR_DECLARE(void *) apr_buffer_mem(const apr_buffe Link Here
253
 * @return The zero memory buffer.
253
 * @return The zero memory buffer.
254
 */
254
 */
255
APR_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
255
APR_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t *pool, const apr_buffer_t *buf, apr_size_t *size)
256
                                             __attribute__((nonnull(1,2)));
256
                    APR__ATTRIBUTE__NONNULL(1,2);
257
257
258
258
259
/**
259
/**
Lines 267-273 APR_DECLARE(void *) apr_buffer_pmemdup(apr_pool_t Link Here
267
 * @return The size of the buffer, excluding terminating zero if present.
267
 * @return The size of the buffer, excluding terminating zero if present.
268
 */
268
 */
269
APR_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
269
APR_DECLARE(apr_size_t) apr_buffer_len(const apr_buffer_t *buf)
270
                                       __attribute__((nonnull(1)));
270
                        APR__ATTRIBUTE__NONNULL(1);
271
271
272
272
273
/**
273
/**
Lines 282-288 APR_DECLARE(apr_size_t) apr_buffer_len(const apr_b Link Here
282
 * @return The size of the buffer, including terminating zero if present.
282
 * @return The size of the buffer, including terminating zero if present.
283
 */
283
 */
284
APR_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
284
APR_DECLARE(apr_size_t) apr_buffer_allocated(const apr_buffer_t *buf)
285
                                             __attribute__((nonnull(1)));
285
                        APR__ATTRIBUTE__NONNULL(1);
286
286
287
287
288
/**
288
/**
Lines 314-320 APR_DECLARE(apr_status_t) apr_buffer_arraydup(apr_ Link Here
314
                                              const apr_buffer_t *in,
314
                                              const apr_buffer_t *in,
315
                                              apr_buffer_alloc alloc, void *ctx,
315
                                              apr_buffer_alloc alloc, void *ctx,
316
                                              int nelts)
316
                                              int nelts)
317
                                              __attribute__((nonnull(1,2)));
317
                          APR__ATTRIBUTE__NONNULL(1,2);
318
318
319
/**
319
/**
320
 * Return a copy of a string/memory buffer.
320
 * Return a copy of a string/memory buffer.
Lines 336-342 APR_DECLARE(apr_status_t) apr_buffer_arraydup(apr_ Link Here
336
APR_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
336
APR_DECLARE(apr_status_t) apr_buffer_dup(apr_buffer_t **out,
337
                                         const apr_buffer_t *in,
337
                                         const apr_buffer_t *in,
338
                                         apr_buffer_alloc alloc, void *ctx)
338
                                         apr_buffer_alloc alloc, void *ctx)
339
                                         __attribute__((nonnull(1,2)));
339
                          APR__ATTRIBUTE__NONNULL(1,2);
340
340
341
/**
341
/**
342
 * Copy the contents a buffer into another buffer.
342
 * Copy the contents a buffer into another buffer.
Lines 359-365 APR_DECLARE(apr_status_t) apr_buffer_dup(apr_buffe Link Here
359
APR_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
359
APR_DECLARE(apr_buffer_t *) apr_buffer_cpy(apr_buffer_t *dst,
360
                                           const apr_buffer_t *src,
360
                                           const apr_buffer_t *src,
361
                                           apr_buffer_alloc alloc, void *ctx)
361
                                           apr_buffer_alloc alloc, void *ctx)
362
                                           __attribute__((nonnull(1)));
362
                            APR__ATTRIBUTE__NONNULL(1);
363
363
364
/**
364
/**
365
 * Compare two possibly NULL buffers for equality.
365
 * Compare two possibly NULL buffers for equality.
(-)include/apr_encode.h (-12 / +14 lines)
Lines 205-211 APR_DECLARE(apr_status_t) apr_encode_base64_binary Link Here
205
 *  possible (see apr_encode_base64 errors).
205
 *  possible (see apr_encode_base64 errors).
206
 */
206
 */
207
APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src,
207
APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src,
208
        apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
208
        apr_ssize_t slen, int flags, apr_size_t * len)
209
        APR__ATTRIBUTE__NONNULL(1);
209
210
210
/**
211
/**
211
 * Convert binary data to base64, and return the results from a pool.
212
 * Convert binary data to base64, and return the results from a pool.
Lines 223-229 APR_DECLARE(const char *)apr_pencode_base64(apr_po Link Here
223
 *  possible (see apr_encode_base64_binary errors).
224
 *  possible (see apr_encode_base64_binary errors).
224
 */
225
 */
225
APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src,
226
APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src,
226
        apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
227
        apr_ssize_t slen, int flags, apr_size_t * len)
228
        APR__ATTRIBUTE__NONNULL(1);
227
229
228
/**
230
/**
229
 * Convert base64 or base64url with or without padding to text data.
231
 * Convert base64 or base64url with or without padding to text data.
Lines 293-299 APR_DECLARE(apr_status_t) apr_decode_base64_binary Link Here
293
 */
295
 */
294
APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src,
296
APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src,
295
        apr_ssize_t slen, int flags, apr_size_t * len)
297
        apr_ssize_t slen, int flags, apr_size_t * len)
296
        __attribute__((nonnull(1)));
298
        APR__ATTRIBUTE__NONNULL(1);
297
299
298
/**
300
/**
299
 * Convert base64 or base64url with or without padding to binary data, and
301
 * Convert base64 or base64url with or without padding to binary data, and
Lines 313-319 APR_DECLARE(const char *)apr_pdecode_base64(apr_po Link Here
313
 */
315
 */
314
APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p,
316
APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p,
315
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
317
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
316
        __attribute__((nonnull(1)));
318
        APR__ATTRIBUTE__NONNULL(1);
317
319
318
/**
320
/**
319
 * Convert text data to base32.
321
 * Convert text data to base32.
Lines 374-380 APR_DECLARE(apr_status_t) apr_encode_base32_binary Link Here
374
 */
376
 */
375
APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src,
377
APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src,
376
        apr_ssize_t slen, int flags, apr_size_t * len)
378
        apr_ssize_t slen, int flags, apr_size_t * len)
377
        __attribute__((nonnull(1)));
379
        APR__ATTRIBUTE__NONNULL(1);
378
380
379
/**
381
/**
380
 * Convert binary data to base32, and return the results from a pool.
382
 * Convert binary data to base32, and return the results from a pool.
Lines 392-398 APR_DECLARE(const char *)apr_pencode_base32(apr_po Link Here
392
 */
394
 */
393
APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src,
395
APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src,
394
        apr_ssize_t slen, int flags, apr_size_t * len)
396
        apr_ssize_t slen, int flags, apr_size_t * len)
395
        __attribute__((nonnull(1)));
397
        APR__ATTRIBUTE__NONNULL(1);
396
398
397
/**
399
/**
398
 * Convert base32 or base32hex with or without padding to text data.
400
 * Convert base32 or base32hex with or without padding to text data.
Lines 459-465 APR_DECLARE(apr_status_t) apr_decode_base32_binary Link Here
459
 */
461
 */
460
APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src,
462
APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src,
461
        apr_ssize_t slen, int flags, apr_size_t * len)
463
        apr_ssize_t slen, int flags, apr_size_t * len)
462
        __attribute__((nonnull(1)));
464
        APR__ATTRIBUTE__NONNULL(1);
463
465
464
/**
466
/**
465
 * Convert base32 or base32hex with or without padding to binary data, and
467
 * Convert base32 or base32hex with or without padding to binary data, and
Lines 478-484 APR_DECLARE(const char *)apr_pdecode_base32(apr_po Link Here
478
 */
480
 */
479
APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p,
481
APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p,
480
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
482
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
481
        __attribute__((nonnull(1)));
483
        APR__ATTRIBUTE__NONNULL(1);
482
484
483
/**
485
/**
484
 * Convert text data to base16 (hex).
486
 * Convert text data to base16 (hex).
Lines 538-544 APR_DECLARE(apr_status_t) apr_encode_base16_binary Link Here
538
 */
540
 */
539
APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src,
541
APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src,
540
        apr_ssize_t slen, int flags, apr_size_t * len)
542
        apr_ssize_t slen, int flags, apr_size_t * len)
541
        __attribute__((nonnull(1)));
543
        APR__ATTRIBUTE__NONNULL(1);
542
544
543
/**
545
/**
544
 * Convert binary data to base16 (hex), and return the results from a
546
 * Convert binary data to base16 (hex), and return the results from a
Lines 556-562 APR_DECLARE(const char *)apr_pencode_base16(apr_po Link Here
556
 */
558
 */
557
APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p,
559
APR_DECLARE(const char *)apr_pencode_base16_binary(apr_pool_t * p,
558
        const unsigned char *src, apr_ssize_t slen,
560
        const unsigned char *src, apr_ssize_t slen,
559
        int flags, apr_size_t * len)__attribute__((nonnull(1)));
561
        int flags, apr_size_t * len)APR__ATTRIBUTE__NONNULL(1);
560
562
561
/**
563
/**
562
 * Convert base16 (hex) to text data.
564
 * Convert base16 (hex) to text data.
Lines 622-628 APR_DECLARE(apr_status_t) apr_decode_base16_binary Link Here
622
 */
624
 */
623
APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src,
625
APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src,
624
        apr_ssize_t slen, int flags, apr_size_t * len)
626
        apr_ssize_t slen, int flags, apr_size_t * len)
625
        __attribute__((nonnull(1)));
627
        APR__ATTRIBUTE__NONNULL(1);
626
628
627
/**
629
/**
628
 * Convert base16 (hex) to binary data, and return the results from a pool.
630
 * Convert base16 (hex) to binary data, and return the results from a pool.
Lines 640-646 APR_DECLARE(const char *)apr_pdecode_base16(apr_po Link Here
640
 */
642
 */
641
APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p,
643
APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p,
642
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
644
        const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
643
        __attribute__((nonnull(1)));
645
        APR__ATTRIBUTE__NONNULL(1);
644
646
645
/** @} */
647
/** @} */
646
#ifdef __cplusplus
648
#ifdef __cplusplus
(-)include/apr_escape.h (-9 / +9 lines)
Lines 98-104 APR_DECLARE(apr_status_t) apr_escape_shell(char *e Link Here
98
 * string if no escaping took place or the string was NULL.
98
 * string if no escaping took place or the string was NULL.
99
 */
99
 */
100
APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str)
100
APR_DECLARE(const char *) apr_pescape_shell(apr_pool_t *p, const char *str)
101
        __attribute__((nonnull(1)));
101
        APR__ATTRIBUTE__NONNULL(1);
102
102
103
/**
103
/**
104
 * Unescapes a URL, leaving reserved characters intact.
104
 * Unescapes a URL, leaving reserved characters intact.
Lines 139-145 APR_DECLARE(apr_status_t) apr_unescape_url(char *e Link Here
139
 */
139
 */
140
APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url,
140
APR_DECLARE(const char *) apr_punescape_url(apr_pool_t *p, const char *url,
141
        const char *forbid, const char *reserved, int plus)
141
        const char *forbid, const char *reserved, int plus)
142
        __attribute__((nonnull(1)));
142
        APR__ATTRIBUTE__NONNULL(1);
143
143
144
/**
144
/**
145
 * Escape a path segment, as defined in RFC1808.
145
 * Escape a path segment, as defined in RFC1808.
Lines 163-169 APR_DECLARE(apr_status_t) apr_escape_path_segment( Link Here
163
 * if no characters are encoded or the string is NULL.
163
 * if no characters are encoded or the string is NULL.
164
 */
164
 */
165
APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p,
165
APR_DECLARE(const char *) apr_pescape_path_segment(apr_pool_t *p,
166
        const char *str) __attribute__((nonnull(1)));
166
        const char *str) APR__ATTRIBUTE__NONNULL(1);
167
167
168
/**
168
/**
169
 * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808.
169
 * Converts an OS path to a URL, in an OS dependent way, as defined in RFC1808.
Lines 206-212 APR_DECLARE(apr_status_t) apr_escape_path(char *es Link Here
206
 * if no characters are encoded or if the string was NULL.
206
 * if no characters are encoded or if the string was NULL.
207
 */
207
 */
208
APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str,
208
APR_DECLARE(const char *) apr_pescape_path(apr_pool_t *p, const char *str,
209
        int partial) __attribute__((nonnull(1)));
209
        int partial) APR__ATTRIBUTE__NONNULL(1);
210
210
211
/**
211
/**
212
 * Urlencode a string, as defined in
212
 * Urlencode a string, as defined in
Lines 232-238 APR_DECLARE(apr_status_t) apr_escape_urlencoded(ch Link Here
232
 * if no characters are encoded or if the string was NULL.
232
 * if no characters are encoded or if the string was NULL.
233
 */
233
 */
234
APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p,
234
APR_DECLARE(const char *) apr_pescape_urlencoded(apr_pool_t *p,
235
        const char *str) __attribute__((nonnull(1)));
235
        const char *str) APR__ATTRIBUTE__NONNULL(1);
236
236
237
/**
237
/**
238
 * Apply entity encoding to a string. Characters are replaced as follows:
238
 * Apply entity encoding to a string. Characters are replaced as follows:
Lines 265-271 APR_DECLARE(apr_status_t) apr_escape_entity(char * Link Here
265
 * if no characters are encoded or the string is NULL.
265
 * if no characters are encoded or the string is NULL.
266
 */
266
 */
267
APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str,
267
APR_DECLARE(const char *) apr_pescape_entity(apr_pool_t *p, const char *str,
268
        int toasc) __attribute__((nonnull(1)));
268
        int toasc) APR__ATTRIBUTE__NONNULL(1);
269
269
270
/**
270
/**
271
 * Decodes html entities or numeric character references in a string. If
271
 * Decodes html entities or numeric character references in a string. If
Lines 298-304 APR_DECLARE(apr_status_t) apr_unescape_entity(char Link Here
298
 * if no characters are encoded or the string is NULL.
298
 * if no characters are encoded or the string is NULL.
299
 */
299
 */
300
APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str)
300
APR_DECLARE(const char *) apr_punescape_entity(apr_pool_t *p, const char *str)
301
        __attribute__((nonnull(1)));
301
                          APR__ATTRIBUTE__NONNULL(1);
302
302
303
/**
303
/**
304
 * Escape control characters in a string, as performed by the shell's
304
 * Escape control characters in a string, as performed by the shell's
Lines 365-371 APR_DECLARE(apr_status_t) apr_escape_hex(char *des Link Here
365
 * NULL if src was NULL.
365
 * NULL if src was NULL.
366
 */
366
 */
367
APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src,
367
APR_DECLARE(const char *) apr_pescape_hex(apr_pool_t *p, const void *src,
368
        apr_size_t slen, int colon) __attribute__((nonnull(1)));
368
        apr_size_t slen, int colon) APR__ATTRIBUTE__NONNULL(1);
369
369
370
/**
370
/**
371
 * Convert hex encoded string to binary data.
371
 * Convert hex encoded string to binary data.
Lines 421-427 APR_DECLARE(apr_status_t) apr_escape_ldap(char *de Link Here
421
 * NULL if src was NULL.
421
 * NULL if src was NULL.
422
 */
422
 */
423
APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src,
423
APR_DECLARE(const char *) apr_pescape_ldap(apr_pool_t *p, const void *src,
424
        apr_ssize_t slen, int flags) __attribute__((nonnull(1)));
424
        apr_ssize_t slen, int flags) APR__ATTRIBUTE__NONNULL(1);
425
425
426
/**
426
/**
427
 * Apply JSON escaping to a UTF string. Invalid UTF8 character sequences
427
 * Apply JSON escaping to a UTF string. Invalid UTF8 character sequences
(-)include/apr_file_io.h (-1 / +1 lines)
Lines 861-867 APR_DECLARE(apr_status_t) apr_file_data_set(apr_fi Link Here
861
 */
861
 */
862
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
862
APR_DECLARE_NONSTD(int) apr_file_printf(apr_file_t *fptr,
863
                                        const char *format, ...)
863
                                        const char *format, ...)
864
        __attribute__((format(printf,2,3)));
864
                        APR__ATTRIBUTE__FORMAT(printf,2,3);
865
865
866
/**
866
/**
867
 * set the specified file's permission bits.
867
 * set the specified file's permission bits.
(-)include/apr_jose.h (-17 / +17 lines)
Lines 919-925 typedef struct apr_jose_cb_t { Link Here
919
 * @return The apu_err_t is returned.
919
 * @return The apu_err_t is returned.
920
 */
920
 */
921
APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose)
921
APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t *jose)
922
        __attribute__((nonnull(1)));
922
        APR__ATTRIBUTE__NONNULL(1);
923
923
924
/**
924
/**
925
 * Make a generic JOSE structure.
925
 * Make a generic JOSE structure.
Lines 932-938 APR_DECLARE(apu_err_t *) apr_jose_error(apr_jose_t Link Here
932
 */
932
 */
933
APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type,
933
APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t *jose, apr_jose_type_e type,
934
        apr_pool_t *pool)
934
        apr_pool_t *pool)
935
        __attribute__((nonnull(3)));
935
        APR__ATTRIBUTE__NONNULL(3);
936
936
937
/**
937
/**
938
 * Make a JSON Web Key for encoding or decoding.
938
 * Make a JSON Web Key for encoding or decoding.
Lines 945-951 APR_DECLARE(apr_jose_t *) apr_jose_make(apr_jose_t Link Here
945
 */
945
 */
946
APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose,
946
APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jose_t *jose,
947
        apr_json_value_t *key, apr_pool_t *pool)
947
        apr_json_value_t *key, apr_pool_t *pool)
948
        __attribute__((nonnull(3)));
948
        APR__ATTRIBUTE__NONNULL(3);
949
949
950
/**
950
/**
951
 * Make a JSON Web Key Set.
951
 * Make a JSON Web Key Set.
Lines 958-964 APR_DECLARE(apr_jose_t *) apr_jose_jwk_make(apr_jo Link Here
958
 */
958
 */
959
APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose,
959
APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_jose_t *jose,
960
        apr_json_value_t *keys, apr_pool_t *pool)
960
        apr_json_value_t *keys, apr_pool_t *pool)
961
        __attribute__((nonnull(3)));
961
        APR__ATTRIBUTE__NONNULL(3);
962
962
963
/**
963
/**
964
 * Make a signature structure for JWS.
964
 * Make a signature structure for JWS.
Lines 973-979 APR_DECLARE(apr_jose_t *) apr_jose_jwks_make(apr_j Link Here
973
APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make(
973
APR_DECLARE(apr_jose_signature_t *) apr_jose_signature_make(
974
        apr_jose_signature_t *signature, apr_json_value_t *header,
974
        apr_jose_signature_t *signature, apr_json_value_t *header,
975
        apr_json_value_t *protected, void *ctx, apr_pool_t *pool)
975
        apr_json_value_t *protected, void *ctx, apr_pool_t *pool)
976
        __attribute__((nonnull(5)));
976
        APR__ATTRIBUTE__NONNULL(5);
977
977
978
/**
978
/**
979
 * Make a recipient structure for JWE.
979
 * Make a recipient structure for JWE.
Lines 986-992 APR_DECLARE(apr_jose_signature_t *) apr_jose_signa Link Here
986
 */
986
 */
987
APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make(apr_jose_recipient_t *recipient,
987
APR_DECLARE(apr_jose_recipient_t *) apr_jose_recipient_make(apr_jose_recipient_t *recipient,
988
        apr_json_value_t *unprotected, void *ctx, apr_pool_t *pool)
988
        apr_json_value_t *unprotected, void *ctx, apr_pool_t *pool)
989
        __attribute__((nonnull(4)));
989
        APR__ATTRIBUTE__NONNULL(4);
990
990
991
/**
991
/**
992
 * Make an encryption structure for JWE.
992
 * Make an encryption structure for JWE.
Lines 1000-1006 APR_DECLARE(apr_jose_recipient_t *) apr_jose_recip Link Here
1000
APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make(apr_jose_encryption_t *encryption,
1000
APR_DECLARE(apr_jose_encryption_t *) apr_jose_encryption_make(apr_jose_encryption_t *encryption,
1001
        apr_json_value_t *unprotected, apr_json_value_t *protected,
1001
        apr_json_value_t *unprotected, apr_json_value_t *protected,
1002
        apr_pool_t *pool)
1002
        apr_pool_t *pool)
1003
        __attribute__((nonnull(4)));
1003
        APR__ATTRIBUTE__NONNULL(4);
1004
1004
1005
/**
1005
/**
1006
 * Make a compact encoded JWE.
1006
 * Make a compact encoded JWE.
Lines 1018-1024 APR_DECLARE(apr_jose_t *) apr_jose_jwe_make(apr_jo Link Here
1018
        apr_jose_recipient_t *recipient, apr_array_header_t *recipients,
1018
        apr_jose_recipient_t *recipient, apr_array_header_t *recipients,
1019
        apr_jose_encryption_t *encryption, apr_jose_t *payload,
1019
        apr_jose_encryption_t *encryption, apr_jose_t *payload,
1020
        apr_pool_t *pool)
1020
        apr_pool_t *pool)
1021
        __attribute__((nonnull(6)));
1021
        APR__ATTRIBUTE__NONNULL(6);
1022
1022
1023
/**
1023
/**
1024
 * Make a JSON encoded JWE.
1024
 * Make a JSON encoded JWE.
Lines 1036-1042 APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(a Link Here
1036
        apr_jose_recipient_t *recipient,
1036
        apr_jose_recipient_t *recipient,
1037
        apr_array_header_t *recipients, apr_jose_encryption_t *encryption,
1037
        apr_array_header_t *recipients, apr_jose_encryption_t *encryption,
1038
        apr_jose_t *payload, apr_pool_t *pool)
1038
        apr_jose_t *payload, apr_pool_t *pool)
1039
        __attribute__((nonnull(6)));
1039
        APR__ATTRIBUTE__NONNULL(6);
1040
1040
1041
/**
1041
/**
1042
 * Make a compact encoded JWS.
1042
 * Make a compact encoded JWS.
Lines 1052-1058 APR_DECLARE(apr_jose_t *) apr_jose_jwe_json_make(a Link Here
1052
APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose,
1052
APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jose_t *jose,
1053
        apr_jose_signature_t *signature, apr_array_header_t *signatures,
1053
        apr_jose_signature_t *signature, apr_array_header_t *signatures,
1054
        apr_jose_t *payload, apr_pool_t *pool)
1054
        apr_jose_t *payload, apr_pool_t *pool)
1055
        __attribute__((nonnull(5)));
1055
        APR__ATTRIBUTE__NONNULL(5);
1056
1056
1057
/**
1057
/**
1058
 * Make a JSON encoded JWS.
1058
 * Make a JSON encoded JWS.
Lines 1068-1074 APR_DECLARE(apr_jose_t *) apr_jose_jws_make(apr_jo Link Here
1068
APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose,
1068
APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(apr_jose_t *jose,
1069
        apr_jose_signature_t *signature, apr_array_header_t *signatures,
1069
        apr_jose_signature_t *signature, apr_array_header_t *signatures,
1070
        apr_jose_t *payload, apr_pool_t *pool)
1070
        apr_jose_t *payload, apr_pool_t *pool)
1071
        __attribute__((nonnull(5)));
1071
        APR__ATTRIBUTE__NONNULL(5);
1072
1072
1073
/**
1073
/**
1074
 * Make a JWT claims payload.
1074
 * Make a JWT claims payload.
Lines 1084-1090 APR_DECLARE(apr_jose_t *) apr_jose_jws_json_make(a Link Here
1084
 */
1084
 */
1085
APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose,
1085
APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jose_t *jose,
1086
        apr_json_value_t *claims, apr_pool_t *pool)
1086
        apr_json_value_t *claims, apr_pool_t *pool)
1087
        __attribute__((nonnull(3)));
1087
        APR__ATTRIBUTE__NONNULL(3);
1088
1088
1089
/**
1089
/**
1090
 * Make a data buffer for encoding from the given data and length.
1090
 * Make a data buffer for encoding from the given data and length.
Lines 1099-1105 APR_DECLARE(apr_jose_t *) apr_jose_jwt_make(apr_jo Link Here
1099
 */
1099
 */
1100
APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ,
1100
APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_jose_t *jose, const char *typ,
1101
        const unsigned char *in, apr_size_t inlen, apr_pool_t *pool)
1101
        const unsigned char *in, apr_size_t inlen, apr_pool_t *pool)
1102
        __attribute__((nonnull(5)));
1102
        APR__ATTRIBUTE__NONNULL(5);
1103
1103
1104
/**
1104
/**
1105
 * Make a UTF-8 text buffer for encoding from the given string
1105
 * Make a UTF-8 text buffer for encoding from the given string
Lines 1115-1121 APR_DECLARE(apr_jose_t *) apr_jose_data_make(apr_j Link Here
1115
 */
1115
 */
1116
APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty,
1116
APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_jose_t *jose, const char *cty,
1117
        const char *in, apr_size_t inlen, apr_pool_t *pool)
1117
        const char *in, apr_size_t inlen, apr_pool_t *pool)
1118
        __attribute__((nonnull(5)));
1118
        APR__ATTRIBUTE__NONNULL(5);
1119
1119
1120
/**
1120
/**
1121
 * Make a json structure for encoding.
1121
 * Make a json structure for encoding.
Lines 1129-1135 APR_DECLARE(apr_jose_t *) apr_jose_text_make(apr_j Link Here
1129
 */
1129
 */
1130
APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty,
1130
APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_jose_t *jose, const char *cty,
1131
        apr_json_value_t *json, apr_pool_t *pool)
1131
        apr_json_value_t *json, apr_pool_t *pool)
1132
        __attribute__((nonnull(4)));
1132
        APR__ATTRIBUTE__NONNULL(4);
1133
1133
1134
/**
1134
/**
1135
 * Sign or encrypt the apr_jose_t, and write it to the brigade.
1135
 * Sign or encrypt the apr_jose_t, and write it to the brigade.
Lines 1146-1152 APR_DECLARE(apr_jose_t *) apr_jose_json_make(apr_j Link Here
1146
APR_DECLARE(apr_status_t) apr_jose_encode(apr_bucket_brigade *brigade,
1146
APR_DECLARE(apr_status_t) apr_jose_encode(apr_bucket_brigade *brigade,
1147
        apr_brigade_flush flush, void *ctx, apr_jose_t *jose,
1147
        apr_brigade_flush flush, void *ctx, apr_jose_t *jose,
1148
        apr_jose_cb_t *cb, apr_pool_t *pool)
1148
        apr_jose_cb_t *cb, apr_pool_t *pool)
1149
		__attribute__((nonnull(1, 4, 6)));
1149
		APR__ATTRIBUTE__NONNULL(1, 4, 6);
1150
1150
1151
/**
1151
/**
1152
 * Decode, decrypt and verify the utf8-encoded JOSE string into apr_jose_t.
1152
 * Decode, decrypt and verify the utf8-encoded JOSE string into apr_jose_t.
Lines 1166-1172 APR_DECLARE(apr_status_t) apr_jose_encode(apr_buck Link Here
1166
APR_DECLARE(apr_status_t) apr_jose_decode(apr_jose_t **jose, const char *typ,
1166
APR_DECLARE(apr_status_t) apr_jose_decode(apr_jose_t **jose, const char *typ,
1167
        apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags,
1167
        apr_bucket_brigade *brigade, apr_jose_cb_t *cb, int level, int flags,
1168
        apr_pool_t *pool)
1168
        apr_pool_t *pool)
1169
        __attribute__((nonnull(1, 3, 7)));
1169
        APR__ATTRIBUTE__NONNULL(1, 3, 7);
1170
1170
1171
1171
1172
#ifdef __cplusplus
1172
#ifdef __cplusplus
(-)include/apr_json.h (-20 / +20 lines)
Lines 191-197 struct apr_json_array_t { Link Here
191
 * @return The apr_json_value_t structure.
191
 * @return The apr_json_value_t structure.
192
 */
192
 */
193
APR_DECLARE(apr_json_value_t *) apr_json_value_create(apr_pool_t *pool)
193
APR_DECLARE(apr_json_value_t *) apr_json_value_create(apr_pool_t *pool)
194
        __attribute__((nonnull(1)));
194
        APR__ATTRIBUTE__NONNULL(1);
195
195
196
/**
196
/**
197
 * Allocate and return a JSON string with the given value.
197
 * Allocate and return a JSON string with the given value.
Lines 203-209 APR_DECLARE(apr_json_value_t *) apr_json_value_cre Link Here
203
 */
203
 */
204
APR_DECLARE(apr_json_value_t *)
204
APR_DECLARE(apr_json_value_t *)
205
        apr_json_string_create(apr_pool_t *pool, const char *val,
205
        apr_json_string_create(apr_pool_t *pool, const char *val,
206
                apr_ssize_t len) __attribute__((nonnull(1)));
206
                apr_ssize_t len) APR__ATTRIBUTE__NONNULL(1);
207
207
208
/**
208
/**
209
 * Allocate and return a JSON array.
209
 * Allocate and return a JSON array.
Lines 214-220 APR_DECLARE(apr_json_value_t *) Link Here
214
 */
214
 */
215
APR_DECLARE(apr_json_value_t *)
215
APR_DECLARE(apr_json_value_t *)
216
        apr_json_array_create(apr_pool_t *pool, int nelts)
216
        apr_json_array_create(apr_pool_t *pool, int nelts)
217
        __attribute__((nonnull(1)));
217
        APR__ATTRIBUTE__NONNULL(1);
218
218
219
/**
219
/**
220
 * Allocate and return a JSON object.
220
 * Allocate and return a JSON object.
Lines 223-229 APR_DECLARE(apr_json_value_t *) Link Here
223
 * @return The apr_json_value_t structure.
223
 * @return The apr_json_value_t structure.
224
 */
224
 */
225
APR_DECLARE(apr_json_value_t *) apr_json_object_create(apr_pool_t *pool)
225
APR_DECLARE(apr_json_value_t *) apr_json_object_create(apr_pool_t *pool)
226
        __attribute__((nonnull(1)));
226
        APR__ATTRIBUTE__NONNULL(1);
227
227
228
/**
228
/**
229
 * Allocate and return a JSON long.
229
 * Allocate and return a JSON long.
Lines 234-240 APR_DECLARE(apr_json_value_t *) apr_json_object_cr Link Here
234
 */
234
 */
235
APR_DECLARE(apr_json_value_t *)
235
APR_DECLARE(apr_json_value_t *)
236
        apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber)
236
        apr_json_long_create(apr_pool_t *pool, apr_int64_t lnumber)
237
        __attribute__((nonnull(1)));
237
        APR__ATTRIBUTE__NONNULL(1);
238
238
239
/**
239
/**
240
 * Allocate and return a JSON double.
240
 * Allocate and return a JSON double.
Lines 245-251 APR_DECLARE(apr_json_value_t *) Link Here
245
 */
245
 */
246
APR_DECLARE(apr_json_value_t *)
246
APR_DECLARE(apr_json_value_t *)
247
        apr_json_double_create(apr_pool_t *pool, double dnumber)
247
        apr_json_double_create(apr_pool_t *pool, double dnumber)
248
        __attribute__((nonnull(1)));
248
        APR__ATTRIBUTE__NONNULL(1);
249
249
250
/**
250
/**
251
 * Allocate and return a JSON boolean.
251
 * Allocate and return a JSON boolean.
Lines 256-262 APR_DECLARE(apr_json_value_t *) Link Here
256
 */
256
 */
257
APR_DECLARE(apr_json_value_t *)
257
APR_DECLARE(apr_json_value_t *)
258
        apr_json_boolean_create(apr_pool_t *pool, int boolean)
258
        apr_json_boolean_create(apr_pool_t *pool, int boolean)
259
        __attribute__((nonnull(1)));
259
        APR__ATTRIBUTE__NONNULL(1);
260
260
261
/**
261
/**
262
 * Allocate and return a JSON null.
262
 * Allocate and return a JSON null.
Lines 266-272 APR_DECLARE(apr_json_value_t *) Link Here
266
 */
266
 */
267
APR_DECLARE(apr_json_value_t *)
267
APR_DECLARE(apr_json_value_t *)
268
        apr_json_null_create(apr_pool_t *pool)
268
        apr_json_null_create(apr_pool_t *pool)
269
        __attribute__((nonnull(1)));
269
        APR__ATTRIBUTE__NONNULL(1);
270
270
271
/**
271
/**
272
 * Associate a value with a key in a JSON object.
272
 * Associate a value with a key in a JSON object.
Lines 282-288 APR_DECLARE(apr_json_value_t *) Link Here
282
 */
282
 */
283
APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj,
283
APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj,
284
        const char *key, apr_ssize_t klen, apr_json_value_t *val,
284
        const char *key, apr_ssize_t klen, apr_json_value_t *val,
285
        apr_pool_t *pool) __attribute__((nonnull(1, 2, 5)));
285
        apr_pool_t *pool) APR__ATTRIBUTE__NONNULL(1, 2, 5);
286
286
287
/**
287
/**
288
 * Associate a value with a key in a JSON object, preserving whitespace.
288
 * Associate a value with a key in a JSON object, preserving whitespace.
Lines 297-303 APR_DECLARE(apr_status_t) apr_json_object_set(apr_ Link Here
297
 */
297
 */
298
APR_DECLARE(apr_status_t) apr_json_object_set_ex(apr_json_value_t *obj,
298
APR_DECLARE(apr_status_t) apr_json_object_set_ex(apr_json_value_t *obj,
299
        apr_json_value_t *key, apr_json_value_t *val,
299
        apr_json_value_t *key, apr_json_value_t *val,
300
        apr_pool_t *pool) __attribute__((nonnull(1, 2, 4)));
300
        apr_pool_t *pool) APR__ATTRIBUTE__NONNULL(1, 2, 4);
301
301
302
/**
302
/**
303
 * Look up the value associated with a key in a JSON object.
303
 * Look up the value associated with a key in a JSON object.
Lines 310-316 APR_DECLARE(apr_status_t) apr_json_object_set_ex(a Link Here
310
APR_DECLARE(apr_json_kv_t *)
310
APR_DECLARE(apr_json_kv_t *)
311
        apr_json_object_get(apr_json_value_t *obj, const char *key,
311
        apr_json_object_get(apr_json_value_t *obj, const char *key,
312
                apr_ssize_t klen)
312
                apr_ssize_t klen)
313
        __attribute__((nonnull(1, 2)));
313
        APR__ATTRIBUTE__NONNULL(1, 2);
314
314
315
/**
315
/**
316
 * Get the first value associated with an object.
316
 * Get the first value associated with an object.
Lines 321-327 APR_DECLARE(apr_json_kv_t *) Link Here
321
 *   empty.
321
 *   empty.
322
 */
322
 */
323
APR_DECLARE(apr_json_kv_t *) apr_json_object_first(apr_json_value_t *obj)
323
APR_DECLARE(apr_json_kv_t *) apr_json_object_first(apr_json_value_t *obj)
324
        __attribute__((nonnull(1)));;
324
        APR__ATTRIBUTE__NONNULL(1);;
325
325
326
/**
326
/**
327
 * Get the next value associated with an object.
327
 * Get the next value associated with an object.
Lines 335-341 APR_DECLARE(apr_json_kv_t *) apr_json_object_first Link Here
335
 */
335
 */
336
APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj,
336
APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj,
337
        apr_json_kv_t *kv)
337
        apr_json_kv_t *kv)
338
        __attribute__((nonnull(1, 2)));;
338
        APR__ATTRIBUTE__NONNULL(1, 2);;
339
339
340
/**
340
/**
341
 * Add the value to the end of this array.
341
 * Add the value to the end of this array.
Lines 346-352 APR_DECLARE(apr_json_kv_t *) apr_json_object_next( Link Here
346
 */
346
 */
347
APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr,
347
APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr,
348
        apr_json_value_t *val)
348
        apr_json_value_t *val)
349
        __attribute__((nonnull(1, 2)));
349
        APR__ATTRIBUTE__NONNULL(1, 2);
350
350
351
/**
351
/**
352
 * Look up the value associated with a key in a JSON object.
352
 * Look up the value associated with a key in a JSON object.
Lines 356-362 APR_DECLARE(apr_status_t) apr_json_array_add(apr_j Link Here
356
 */
356
 */
357
APR_DECLARE(apr_json_value_t *)
357
APR_DECLARE(apr_json_value_t *)
358
        apr_json_array_get(apr_json_value_t *arr, int index)
358
        apr_json_array_get(apr_json_value_t *arr, int index)
359
        __attribute__((nonnull(1)));
359
        APR__ATTRIBUTE__NONNULL(1);
360
360
361
/**
361
/**
362
 * Get the first value associated with an array.
362
 * Get the first value associated with an array.
Lines 367-373 APR_DECLARE(apr_json_value_t *) Link Here
367
 *   empty.
367
 *   empty.
368
 */
368
 */
369
APR_DECLARE(apr_json_value_t *) apr_json_array_first(const apr_json_value_t *arr)
369
APR_DECLARE(apr_json_value_t *) apr_json_array_first(const apr_json_value_t *arr)
370
        __attribute__((nonnull(1)));;
370
        APR__ATTRIBUTE__NONNULL(1);;
371
371
372
/**
372
/**
373
 * Get the next value associated with an array.
373
 * Get the next value associated with an array.
Lines 381-387 APR_DECLARE(apr_json_value_t *) apr_json_array_fir Link Here
381
 */
381
 */
382
APR_DECLARE(apr_json_value_t *) apr_json_array_next(const apr_json_value_t *arr,
382
APR_DECLARE(apr_json_value_t *) apr_json_array_next(const apr_json_value_t *arr,
383
        const apr_json_value_t *val)
383
        const apr_json_value_t *val)
384
        __attribute__((nonnull(1, 2)));;
384
        APR__ATTRIBUTE__NONNULL(1, 2);;
385
385
386
/**
386
/**
387
 * Decode utf8-encoded JSON string into apr_json_value_t.
387
 * Decode utf8-encoded JSON string into apr_json_value_t.
Lines 401-407 APR_DECLARE(apr_json_value_t *) apr_json_array_nex Link Here
401
APR_DECLARE(apr_status_t) apr_json_decode(apr_json_value_t ** retval,
401
APR_DECLARE(apr_status_t) apr_json_decode(apr_json_value_t ** retval,
402
        const char *injson, apr_ssize_t size, apr_off_t * offset,
402
        const char *injson, apr_ssize_t size, apr_off_t * offset,
403
        int flags, int level, apr_pool_t * pool)
403
        int flags, int level, apr_pool_t * pool)
404
        __attribute__((nonnull(1, 2, 7)));
404
        APR__ATTRIBUTE__NONNULL(1, 2, 7);
405
405
406
/**
406
/**
407
 * Encode data represented as apr_json_value_t to utf8-encoded JSON string
407
 * Encode data represented as apr_json_value_t to utf8-encoded JSON string
Lines 423-429 APR_DECLARE(apr_status_t) apr_json_decode(apr_json Link Here
423
 */
423
 */
424
APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade,
424
APR_DECLARE(apr_status_t) apr_json_encode(apr_bucket_brigade * brigade,
425
        apr_brigade_flush flush, void *ctx, const apr_json_value_t * json,
425
        apr_brigade_flush flush, void *ctx, const apr_json_value_t * json,
426
        int flags, apr_pool_t * pool) __attribute__((nonnull(1, 4, 6)));
426
        int flags, apr_pool_t * pool) APR__ATTRIBUTE__NONNULL(1, 4, 6);
427
427
428
/**
428
/**
429
 * Overlay one JSON value over a second JSON value.
429
 * Overlay one JSON value over a second JSON value.
Lines 448-454 APR_DECLARE(apr_status_t) apr_json_encode(apr_buck Link Here
448
 */
448
 */
449
APR_DECLARE(apr_json_value_t *) apr_json_overlay(apr_pool_t *p,
449
APR_DECLARE(apr_json_value_t *) apr_json_overlay(apr_pool_t *p,
450
        apr_json_value_t *overlay, apr_json_value_t *base,
450
        apr_json_value_t *overlay, apr_json_value_t *base,
451
        int flags) __attribute__((nonnull(1)));;
451
        int flags) APR__ATTRIBUTE__NONNULL(1);;
452
452
453
#ifdef __cplusplus
453
#ifdef __cplusplus
454
}
454
}
(-)include/apr_ldap.h (-15 / +15 lines)
Lines 291-297 typedef struct apr_ldap_driver_t apr_ldap_driver_t Link Here
291
APR_DECLARE(apr_status_t) apr_ldap_get_driver(apr_pool_t *pool,
291
APR_DECLARE(apr_status_t) apr_ldap_get_driver(apr_pool_t *pool,
292
                                              const apr_ldap_driver_t **driver,
292
                                              const apr_ldap_driver_t **driver,
293
                                              apu_err_t *err)
293
                                              apu_err_t *err)
294
                                              __attribute__((nonnull(1,3)));
294
                          APR__ATTRIBUTE__NONNULL(1,3);
295
295
296
296
297
297
Lines 313-319 typedef struct apr_ldap_t apr_ldap_t; Link Here
313
 */
313
 */
314
APU_DECLARE_LDAP(apr_status_t) apr_ldap_info(apr_pool_t *pool,
314
APU_DECLARE_LDAP(apr_status_t) apr_ldap_info(apr_pool_t *pool,
315
                                             apu_err_t **result_err)
315
                                             apu_err_t **result_err)
316
                                             __attribute__((nonnull(1,2)));
316
                               APR__ATTRIBUTE__NONNULL(1,2);
317
317
318
318
319
319
Lines 350-356 APU_DECLARE_LDAP(apr_status_t) apr_ldap_info(apr_p Link Here
350
APU_DECLARE_LDAP(apr_status_t) apr_ldap_initialise(apr_pool_t *pool,
350
APU_DECLARE_LDAP(apr_status_t) apr_ldap_initialise(apr_pool_t *pool,
351
                                                   apr_ldap_t **ldap,
351
                                                   apr_ldap_t **ldap,
352
                                                   apu_err_t *err)
352
                                                   apu_err_t *err)
353
                                                   __attribute__((nonnull(1,2,3)));
353
                               APR__ATTRIBUTE__NONNULL(1,2,3);
354
354
355
355
356
/*
356
/*
Lines 824-830 APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_get Link Here
824
                                                   int option,
824
                                                   int option,
825
                                                   apr_ldap_opt_t *outvalue,
825
                                                   apr_ldap_opt_t *outvalue,
826
                                                   apu_err_t *result_err)
826
                                                   apu_err_t *result_err)
827
                                                   __attribute__((nonnull(1,4,5)));
827
                               APR__ATTRIBUTE__NONNULL(1,4,5);
828
828
829
/**
829
/**
830
 * APR LDAP set option function
830
 * APR LDAP set option function
Lines 857-863 APU_DECLARE_LDAP(apr_status_t) apr_ldap_option_set Link Here
857
                                                   int option,
857
                                                   int option,
858
                                                   const apr_ldap_opt_t *invalue,
858
                                                   const apr_ldap_opt_t *invalue,
859
                                                   apu_err_t *result_err)
859
                                                   apu_err_t *result_err)
860
                                                   __attribute__((nonnull(1,5)));
860
                               APR__ATTRIBUTE__NONNULL(1,5);
861
861
862
/**
862
/**
863
 * LDAP interaction identifiers during LDAP binding
863
 * LDAP interaction identifiers during LDAP binding
Lines 967-973 APU_DECLARE_LDAP(apr_status_t) apr_ldap_connect(ap Link Here
967
                                                apr_ldap_t *ldap,
967
                                                apr_ldap_t *ldap,
968
                                                apr_interval_time_t timeout,
968
                                                apr_interval_time_t timeout,
969
                                                apu_err_t *result_err)
969
                                                apu_err_t *result_err)
970
                                                __attribute__((nonnull(1,2,4)));
970
                               APR__ATTRIBUTE__NONNULL(1,2,4);
971
971
972
/**
972
/**
973
 * Callback to prepare an LDAP request.
973
 * Callback to prepare an LDAP request.
Lines 1012-1018 APU_DECLARE_LDAP(apr_status_t) apr_ldap_prepare(ap Link Here
1012
                                                apr_ldap_t *ldap,
1012
                                                apr_ldap_t *ldap,
1013
                                                apr_ldap_prepare_cb prepare_cb,
1013
                                                apr_ldap_prepare_cb prepare_cb,
1014
                                                void *prepare_ctx)
1014
                                                void *prepare_ctx)
1015
                                                __attribute__((nonnull(1,2,3)));
1015
                               APR__ATTRIBUTE__NONNULL(1,2,3);
1016
1016
1017
1017
1018
/**
1018
/**
Lines 1042-1048 APU_DECLARE_LDAP(apr_status_t) apr_ldap_process(ap Link Here
1042
                                                apr_ldap_t *ldap,
1042
                                                apr_ldap_t *ldap,
1043
                                                apr_interval_time_t timeout,
1043
                                                apr_interval_time_t timeout,
1044
                                                apu_err_t *err)
1044
                                                apu_err_t *err)
1045
                                                __attribute__((nonnull(1,2,4)));
1045
                               APR__ATTRIBUTE__NONNULL(1,2,4);
1046
1046
1047
1047
1048
/**
1048
/**
Lines 1066-1072 APU_DECLARE_LDAP(apr_status_t) apr_ldap_result(apr Link Here
1066
                                               apr_ldap_t *ldap,
1066
                                               apr_ldap_t *ldap,
1067
                                               apr_interval_time_t timeout,
1067
                                               apr_interval_time_t timeout,
1068
                                               apu_err_t *err)
1068
                                               apu_err_t *err)
1069
                                               __attribute__((nonnull(1,2,4)));
1069
                               APR__ATTRIBUTE__NONNULL(1,2,4);
1070
1070
1071
1071
1072
/**
1072
/**
Lines 1090-1096 APU_DECLARE_LDAP(apr_status_t) apr_ldap_poll(apr_p Link Here
1090
                                             apr_pollcb_t *poll,
1090
                                             apr_pollcb_t *poll,
1091
                                             apr_interval_time_t timeout,
1091
                                             apr_interval_time_t timeout,
1092
                                             apu_err_t *err)
1092
                                             apu_err_t *err)
1093
                                             __attribute__((nonnull(1,2,3,5)));
1093
                               APR__ATTRIBUTE__NONNULL(1,2,3,5);
1094
1094
1095
1095
1096
/** 
1096
/** 
Lines 1153-1159 APU_DECLARE_LDAP(apr_status_t) apr_ldap_cancel(apr Link Here
1153
                                               apr_interval_time_t timeout,
1153
                                               apr_interval_time_t timeout,
1154
                                               apr_ldap_cancel_cb cancel_cb, void *cancel_ctx,
1154
                                               apr_ldap_cancel_cb cancel_cb, void *cancel_ctx,
1155
                                               apu_err_t *err)
1155
                                               apu_err_t *err)
1156
                                               __attribute__((nonnull(1,2,6,8)));
1156
                               APR__ATTRIBUTE__NONNULL(1,2,6,8);
1157
#endif
1157
#endif
1158
1158
1159
/**
1159
/**
Lines 1215-1221 APU_DECLARE_LDAP(apr_status_t) apr_ldap_bind(apr_p Link Here
1215
                                             apr_interval_time_t timeout,
1215
                                             apr_interval_time_t timeout,
1216
                                             apr_ldap_bind_cb bind_cb, void *bind_ctx,
1216
                                             apr_ldap_bind_cb bind_cb, void *bind_ctx,
1217
                                             apu_err_t *err)
1217
                                             apu_err_t *err)
1218
                                             __attribute__((nonnull(1,2,4,9)));
1218
                               APR__ATTRIBUTE__NONNULL(1,2,4,9);
1219
1219
1220
1220
1221
/**
1221
/**
Lines 1303-1309 APU_DECLARE_LDAP(apr_status_t) apr_ldap_compare(ap Link Here
1303
                                                apr_interval_time_t timeout,
1303
                                                apr_interval_time_t timeout,
1304
                                                apr_ldap_compare_cb compare_cb, void *ctx,
1304
                                                apr_ldap_compare_cb compare_cb, void *ctx,
1305
                                                apu_err_t *err)
1305
                                                apu_err_t *err)
1306
                                               __attribute__((nonnull(1,2,3,4,5,11)));
1306
                               APR__ATTRIBUTE__NONNULL(1,2,3,4,5,11);
1307
1307
1308
1308
1309
/**
1309
/**
Lines 1447-1453 APU_DECLARE_LDAP(apr_status_t) apr_ldap_search(apr Link Here
1447
                                               apr_ldap_search_entry_cb search_entry_cb,
1447
                                               apr_ldap_search_entry_cb search_entry_cb,
1448
                                               void *ctx,
1448
                                               void *ctx,
1449
                                               apu_err_t *err)
1449
                                               apu_err_t *err)
1450
                                               __attribute__((nonnull(1,2,3,15)));
1450
                                APR__ATTRIBUTE__NONNULL(1,2,3,15);
1451
1451
1452
/**
1452
/**
1453
 * APR LDAP unbind function
1453
 * APR LDAP unbind function
Lines 1463-1469 APU_DECLARE_LDAP(apr_status_t) apr_ldap_unbind(apr Link Here
1463
                                               apr_ldap_control_t **serverctrls,
1463
                                               apr_ldap_control_t **serverctrls,
1464
                                               apr_ldap_control_t **clientctrls,
1464
                                               apr_ldap_control_t **clientctrls,
1465
                                               apu_err_t *err)
1465
                                               apu_err_t *err)
1466
                                               __attribute__((nonnull(1,4)));
1466
                               APR__ATTRIBUTE__NONNULL(1,4);
1467
1467
1468
1468
1469
#endif /* APU_HAS_LDAP */
1469
#endif /* APU_HAS_LDAP */
(-)include/apr_pools.h (-33 / +31 lines)
Lines 196-202 APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_p Link Here
196
                                             apr_pool_t *parent,
196
                                             apr_pool_t *parent,
197
                                             apr_abortfunc_t abort_fn,
197
                                             apr_abortfunc_t abort_fn,
198
                                             apr_allocator_t *allocator)
198
                                             apr_allocator_t *allocator)
199
                          __attribute__((nonnull(1)));
199
                          APR__ATTRIBUTE__NONNULL(1);
200
200
201
/**
201
/**
202
 * Create a new unmanaged pool.
202
 * Create a new unmanaged pool.
Lines 217-223 APR_DECLARE(apr_status_t) apr_pool_create_ex(apr_p Link Here
217
APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
217
APR_DECLARE(apr_status_t) apr_pool_create_unmanaged_ex(apr_pool_t **newpool,
218
                                                   apr_abortfunc_t abort_fn,
218
                                                   apr_abortfunc_t abort_fn,
219
                                                   apr_allocator_t *allocator)
219
                                                   apr_allocator_t *allocator)
220
                          __attribute__((nonnull(1)));
220
                          APR__ATTRIBUTE__NONNULL(1);
221
221
222
/**
222
/**
223
 * Debug version of apr_pool_create_ex.
223
 * Debug version of apr_pool_create_ex.
Lines 240-246 APR_DECLARE(apr_status_t) apr_pool_create_ex_debug Link Here
240
                                                   apr_abortfunc_t abort_fn,
240
                                                   apr_abortfunc_t abort_fn,
241
                                                   apr_allocator_t *allocator,
241
                                                   apr_allocator_t *allocator,
242
                                                   const char *file_line)
242
                                                   const char *file_line)
243
                          __attribute__((nonnull(1)));
243
                          APR__ATTRIBUTE__NONNULL(1);
244
244
245
#if APR_POOL_DEBUG
245
#if APR_POOL_DEBUG
246
#define apr_pool_create_ex(newpool, parent, abort_fn, allocator)  \
246
#define apr_pool_create_ex(newpool, parent, abort_fn, allocator)  \
Lines 267-273 APR_DECLARE(apr_status_t) apr_pool_create_unmanage Link Here
267
                                                   apr_abortfunc_t abort_fn,
267
                                                   apr_abortfunc_t abort_fn,
268
                                                   apr_allocator_t *allocator,
268
                                                   apr_allocator_t *allocator,
269
                                                   const char *file_line)
269
                                                   const char *file_line)
270
                          __attribute__((nonnull(1)));
270
                          APR__ATTRIBUTE__NONNULL(1);
271
271
272
#if APR_POOL_DEBUG
272
#if APR_POOL_DEBUG
273
#define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator)  \
273
#define apr_pool_create_unmanaged_ex(newpool, abort_fn, allocator)  \
Lines 324-330 APR_DECLARE(apr_status_t) apr_pool_create_unmanage Link Here
324
 * @param pool The pool to get the allocator from.
324
 * @param pool The pool to get the allocator from.
325
 */
325
 */
326
APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool)
326
APR_DECLARE(apr_allocator_t *) apr_pool_allocator_get(apr_pool_t *pool)
327
                               __attribute__((nonnull(1)));
327
                               APR__ATTRIBUTE__NONNULL(1);
328
328
329
/**
329
/**
330
 * Clear all memory in the pool and run all the cleanups. This also destroys all
330
 * Clear all memory in the pool and run all the cleanups. This also destroys all
Lines 334-340 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_ Link Here
334
 *         to re-use this memory for the next allocation.
334
 *         to re-use this memory for the next allocation.
335
 * @see apr_pool_destroy()
335
 * @see apr_pool_destroy()
336
 */
336
 */
337
APR_DECLARE(void) apr_pool_clear(apr_pool_t *p) __attribute__((nonnull(1)));
337
APR_DECLARE(void) apr_pool_clear(apr_pool_t *p)
338
                  APR__ATTRIBUTE__NONNULL(1);
338
339
339
/**
340
/**
340
 * Debug version of apr_pool_clear.
341
 * Debug version of apr_pool_clear.
Lines 351-357 APR_DECLARE(apr_allocator_t *) apr_pool_allocator_ Link Here
351
 */
352
 */
352
APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
353
APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t *p,
353
                                       const char *file_line)
354
                                       const char *file_line)
354
                  __attribute__((nonnull(1)));
355
                  APR__ATTRIBUTE__NONNULL(1);
355
356
356
#if APR_POOL_DEBUG
357
#if APR_POOL_DEBUG
357
#define apr_pool_clear(p) \
358
#define apr_pool_clear(p) \
Lines 364-370 APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t Link Here
364
 * @param p The pool to destroy
365
 * @param p The pool to destroy
365
 * @remark This will actually free the memory
366
 * @remark This will actually free the memory
366
 */
367
 */
367
APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p) __attribute__((nonnull(1)));
368
APR_DECLARE(void) apr_pool_destroy(apr_pool_t *p)
369
                  APR__ATTRIBUTE__NONNULL(1);
368
370
369
/**
371
/**
370
 * Debug version of apr_pool_destroy.
372
 * Debug version of apr_pool_destroy.
Lines 381-387 APR_DECLARE(void) apr_pool_clear_debug(apr_pool_t Link Here
381
 */
383
 */
382
APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
384
APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_t *p,
383
                                         const char *file_line)
385
                                         const char *file_line)
384
                  __attribute__((nonnull(1)));
386
                  APR__ATTRIBUTE__NONNULL(1);
385
387
386
#if APR_POOL_DEBUG
388
#if APR_POOL_DEBUG
387
#define apr_pool_destroy(p) \
389
#define apr_pool_destroy(p) \
Lines 400-409 APR_DECLARE(void) apr_pool_destroy_debug(apr_pool_ Link Here
400
 * @return The allocated memory
402
 * @return The allocated memory
401
 */
403
 */
402
APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size)
404
APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_size_t size)
403
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
405
                    APR__ATTRIBUTE__ALLOC_SIZE(2)
404
                    __attribute__((alloc_size(2)))
406
                    APR__ATTRIBUTE__NONNULL(1);
405
#endif
406
                    __attribute__((nonnull(1)));
407
407
408
/**
408
/**
409
 * Debug version of apr_palloc
409
 * Debug version of apr_palloc
Lines 415-424 APR_DECLARE(void *) apr_palloc(apr_pool_t *p, apr_ Link Here
415
 */
415
 */
416
APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
416
APR_DECLARE(void *) apr_palloc_debug(apr_pool_t *p, apr_size_t size,
417
                                     const char *file_line)
417
                                     const char *file_line)
418
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
418
                    APR__ATTRIBUTE__ALLOC_SIZE(2)
419
                    __attribute__((alloc_size(2)))
419
                    APR__ATTRIBUTE__NONNULL(1);
420
#endif
421
                    __attribute__((nonnull(1)));
422
420
423
#if APR_POOL_DEBUG
421
#if APR_POOL_DEBUG
424
#define apr_palloc(p, size) \
422
#define apr_palloc(p, size) \
Lines 447-453 APR_DECLARE(void *) apr_pcalloc(apr_pool_t *p, apr Link Here
447
 */
445
 */
448
APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
446
APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t *p, apr_size_t size,
449
                                      const char *file_line)
447
                                      const char *file_line)
450
                    __attribute__((nonnull(1)));
448
                    APR__ATTRIBUTE__NONNULL(1);
451
449
452
#if APR_POOL_DEBUG
450
#if APR_POOL_DEBUG
453
#define apr_pcalloc(p, size) \
451
#define apr_pcalloc(p, size) \
Lines 469-475 APR_DECLARE(void *) apr_pcalloc_debug(apr_pool_t * Link Here
469
 */
467
 */
470
APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc,
468
APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc_t abortfunc,
471
                                     apr_pool_t *pool)
469
                                     apr_pool_t *pool)
472
                  __attribute__((nonnull(2)));
470
                  APR__ATTRIBUTE__NONNULL(2);
473
471
474
/**
472
/**
475
 * Get the abort function associated with the specified pool.
473
 * Get the abort function associated with the specified pool.
Lines 477-483 APR_DECLARE(void) apr_pool_abort_set(apr_abortfunc Link Here
477
 * @return The abort function for the given pool.
475
 * @return The abort function for the given pool.
478
 */
476
 */
479
APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool)
477
APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(apr_pool_t *pool)
480
                             __attribute__((nonnull(1)));
478
                             APR__ATTRIBUTE__NONNULL(1);
481
479
482
/**
480
/**
483
 * Get the parent pool of the specified pool.
481
 * Get the parent pool of the specified pool.
Lines 485-491 APR_DECLARE(apr_abortfunc_t) apr_pool_abort_get(ap Link Here
485
 * @return The parent of the given pool.
483
 * @return The parent of the given pool.
486
 */
484
 */
487
APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool)
485
APR_DECLARE(apr_pool_t *) apr_pool_parent_get(apr_pool_t *pool)
488
                          __attribute__((nonnull(1)));
486
                          APR__ATTRIBUTE__NONNULL(1);
489
487
490
/**
488
/**
491
 * Determine if pool a is an ancestor of pool b.
489
 * Determine if pool a is an ancestor of pool b.
Lines 506-512 APR_DECLARE(int) apr_pool_is_ancestor(apr_pool_t * Link Here
506
 * @param tag  The tag
504
 * @param tag  The tag
507
 */
505
 */
508
APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag)
506
APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, const char *tag)
509
                  __attribute__((nonnull(1)));
507
                  APR__ATTRIBUTE__NONNULL(1);
510
508
511
/**
509
/**
512
 * Retrieve the tag name.
510
 * Retrieve the tag name.
Lines 514-520 APR_DECLARE(void) apr_pool_tag(apr_pool_t *pool, c Link Here
514
 * @return Tag name, or NULL if no name is set.
512
 * @return Tag name, or NULL if no name is set.
515
 */
513
 */
516
APR_DECLARE(const char *) apr_pool_get_tag(apr_pool_t *pool)
514
APR_DECLARE(const char *) apr_pool_get_tag(apr_pool_t *pool)
517
                  __attribute__((nonnull(1)));
515
                  APR__ATTRIBUTE__NONNULL(1);
518
516
519
/*
517
/*
520
 * User data management
518
 * User data management
Lines 543-549 APR_DECLARE(apr_status_t) apr_pool_userdata_set(co Link Here
543
                                                const char *key,
541
                                                const char *key,
544
                                                apr_status_t (*cleanup)(void *),
542
                                                apr_status_t (*cleanup)(void *),
545
                                                apr_pool_t *pool)
543
                                                apr_pool_t *pool)
546
                          __attribute__((nonnull(2,4)));
544
                          APR__ATTRIBUTE__NONNULL(2,4);
547
545
548
/**
546
/**
549
 * Set the data associated with the current pool
547
 * Set the data associated with the current pool
Lines 568-574 APR_DECLARE(apr_status_t) apr_pool_userdata_setn( Link Here
568
                                const void *data, const char *key,
566
                                const void *data, const char *key,
569
                                apr_status_t (*cleanup)(void *),
567
                                apr_status_t (*cleanup)(void *),
570
                                apr_pool_t *pool)
568
                                apr_pool_t *pool)
571
                          __attribute__((nonnull(2,4)));
569
                          APR__ATTRIBUTE__NONNULL(2,4);
572
570
573
/**
571
/**
574
 * Return the data associated with the current pool.
572
 * Return the data associated with the current pool.
Lines 578-584 APR_DECLARE(apr_status_t) apr_pool_userdata_setn( Link Here
578
 */
576
 */
579
APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
577
APR_DECLARE(apr_status_t) apr_pool_userdata_get(void **data, const char *key,
580
                                                apr_pool_t *pool)
578
                                                apr_pool_t *pool)
581
                          __attribute__((nonnull(1,2,3)));
579
                          APR__ATTRIBUTE__NONNULL(1,2,3);
582
580
583
581
584
/**
582
/**
Lines 608-614 APR_DECLARE(void) apr_pool_cleanup_register( Link Here
608
                            apr_pool_t *p, const void *data,
606
                            apr_pool_t *p, const void *data,
609
                            apr_status_t (*plain_cleanup)(void *),
607
                            apr_status_t (*plain_cleanup)(void *),
610
                            apr_status_t (*child_cleanup)(void *))
608
                            apr_status_t (*child_cleanup)(void *))
611
                  __attribute__((nonnull(3,4)));
609
                  APR__ATTRIBUTE__NONNULL(3,4);
612
610
613
/**
611
/**
614
 * Register a function to be called when a pool is cleared or destroyed.
612
 * Register a function to be called when a pool is cleared or destroyed.
Lines 625-631 APR_DECLARE(void) apr_pool_cleanup_register( Link Here
625
APR_DECLARE(void) apr_pool_pre_cleanup_register(
623
APR_DECLARE(void) apr_pool_pre_cleanup_register(
626
                            apr_pool_t *p, const void *data,
624
                            apr_pool_t *p, const void *data,
627
                            apr_status_t (*plain_cleanup)(void *))
625
                            apr_status_t (*plain_cleanup)(void *))
628
                  __attribute__((nonnull(3)));
626
                  APR__ATTRIBUTE__NONNULL(3);
629
627
630
/**
628
/**
631
 * Remove a previously registered cleanup function.
629
 * Remove a previously registered cleanup function.
Lines 641-647 APR_DECLARE(void) apr_pool_pre_cleanup_register( Link Here
641
 */
639
 */
642
APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
640
APR_DECLARE(void) apr_pool_cleanup_kill(apr_pool_t *p, const void *data,
643
                                        apr_status_t (*cleanup)(void *))
641
                                        apr_status_t (*cleanup)(void *))
644
                  __attribute__((nonnull(3)));
642
                  APR__ATTRIBUTE__NONNULL(3);
645
643
646
/**
644
/**
647
 * Replace the child cleanup function of a previously registered cleanup.
645
 * Replace the child cleanup function of a previously registered cleanup.
Lines 659-665 APR_DECLARE(void) apr_pool_child_cleanup_set( Link Here
659
                        apr_pool_t *p, const void *data,
657
                        apr_pool_t *p, const void *data,
660
                        apr_status_t (*plain_cleanup)(void *),
658
                        apr_status_t (*plain_cleanup)(void *),
661
                        apr_status_t (*child_cleanup)(void *))
659
                        apr_status_t (*child_cleanup)(void *))
662
                  __attribute__((nonnull(3,4)));
660
                  APR__ATTRIBUTE__NONNULL(3,4);
663
661
664
/**
662
/**
665
 * Run the specified cleanup function immediately and unregister it.
663
 * Run the specified cleanup function immediately and unregister it.
Lines 674-680 APR_DECLARE(void) apr_pool_child_cleanup_set( Link Here
674
 */
672
 */
675
APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data,
673
APR_DECLARE(apr_status_t) apr_pool_cleanup_run(apr_pool_t *p, void *data,
676
                                               apr_status_t (*cleanup)(void *))
674
                                               apr_status_t (*cleanup)(void *))
677
                          __attribute__((nonnull(3)));
675
                          APR__ATTRIBUTE__NONNULL(3);
678
676
679
/**
677
/**
680
 * An empty cleanup function.
678
 * An empty cleanup function.
Lines 756-762 APR_DECLARE(void) apr_pool_owner_set(apr_pool_t *p Link Here
756
 * @param sub The subpool
754
 * @param sub The subpool
757
 */
755
 */
758
APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
756
APR_DECLARE(void) apr_pool_join(apr_pool_t *p, apr_pool_t *sub)
759
                  __attribute__((nonnull(2)));
757
                  APR__ATTRIBUTE__NONNULL(2);
760
758
761
/**
759
/**
762
 * Find a pool from something allocated in it.
760
 * Find a pool from something allocated in it.
Lines 772-778 APR_DECLARE(apr_pool_t *) apr_pool_find(const void Link Here
772
 * @return The number of bytes
770
 * @return The number of bytes
773
 */
771
 */
774
APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse)
772
APR_DECLARE(apr_size_t) apr_pool_num_bytes(apr_pool_t *p, int recurse)
775
                        __attribute__((nonnull(1)));
773
                        APR__ATTRIBUTE__NONNULL(1);
776
774
777
/**
775
/**
778
 * Lock a pool
776
 * Lock a pool
(-)include/apr_strings.h (-14 / +5 lines)
Lines 107-116 APR_DECLARE(char *) apr_pstrdup(apr_pool_t *p, con Link Here
107
 *         fewer characters, use apr_pstrndup().
107
 *         fewer characters, use apr_pstrndup().
108
 */
108
 */
109
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
109
APR_DECLARE(char *) apr_pstrmemdup(apr_pool_t *p, const char *s, apr_size_t n)
110
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
110
                    APR__ATTRIBUTE__ALLOC_SIZE(3);
111
    __attribute__((alloc_size(3)))
112
#endif
113
    ;
114
111
115
/**
112
/**
116
 * Duplicate at most n characters of a string into memory allocated
113
 * Duplicate at most n characters of a string into memory allocated
Lines 133-142 APR_DECLARE(char *) apr_pstrndup(apr_pool_t *p, co Link Here
133
 * @return The new block of memory or NULL if m == NULL
130
 * @return The new block of memory or NULL if m == NULL
134
 */
131
 */
135
APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
132
APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
136
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
133
                    APR__ATTRIBUTE__ALLOC_SIZE(3);
137
    __attribute__((alloc_size(3)))
138
#endif
139
    ;
140
134
141
/**
135
/**
142
 * Concatenate multiple strings, allocating memory out a pool
136
 * Concatenate multiple strings, allocating memory out a pool
Lines 145-154 APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, con Link Here
145
 * @return The new string
139
 * @return The new string
146
 */
140
 */
147
APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...)
141
APR_DECLARE_NONSTD(char *) apr_pstrcat(apr_pool_t *p, ...)
148
#if defined(__GNUC__) && __GNUC__ >= 4
142
                           APR__ATTRIBUTE__SENTINEL;
149
    __attribute__((sentinel))
150
#endif
151
    ;
152
143
153
/**
144
/**
154
 * Concatenate multiple strings specified in a writev-style vector
145
 * Concatenate multiple strings specified in a writev-style vector
Lines 180-186 APR_DECLARE(char *) apr_pvsprintf(apr_pool_t *p, c Link Here
180
 * @return The new string
171
 * @return The new string
181
 */
172
 */
182
APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
173
APR_DECLARE_NONSTD(char *) apr_psprintf(apr_pool_t *p, const char *fmt, ...)
183
        __attribute__((format(printf,2,3)));
174
                           APR__ATTRIBUTE__FORMAT(printf,2,3);
184
175
185
/**
176
/**
186
 * zero out the buffer provided, without being optimized out by
177
 * zero out the buffer provided, without being optimized out by
Lines 288-294 APR_DECLARE(char *) apr_strtok(char *str, const ch Link Here
288
 */
279
 */
289
APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
280
APR_DECLARE_NONSTD(int) apr_snprintf(char *buf, apr_size_t len,
290
                                     const char *format, ...)
281
                                     const char *format, ...)
291
        __attribute__((format(printf,3,4)));
282
                        APR__ATTRIBUTE__FORMAT(printf,3,4);
292
283
293
/**
284
/**
294
 * vsnprintf routine based on apr_vformatter.  This means it understands the
285
 * vsnprintf routine based on apr_vformatter.  This means it understands the
(-)include/apr_tables.h (-4 / +1 lines)
Lines 406-415 typedef int (apr_table_do_callback_fn_t)(void *rec Link Here
406
 */
406
 */
407
APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp,
407
APR_DECLARE_NONSTD(int) apr_table_do(apr_table_do_callback_fn_t *comp,
408
                                     void *rec, const apr_table_t *t, ...)
408
                                     void *rec, const apr_table_t *t, ...)
409
#if defined(__GNUC__) && __GNUC__ >= 4
409
                        APR__ATTRIBUTE__SENTINEL;
410
    __attribute__((sentinel))
411
#endif
412
    ;
413
410
414
/**
411
/**
415
 * Iterate over a table running the provided function once for every
412
 * Iterate over a table running the provided function once for every
(-)include/apr_thread_proc.h (-1 / +1 lines)
Lines 329-335 APR_DECLARE(apr_thread_t *) apr_thread_current(voi Link Here
329
 * @param retval The return value to pass back to any thread that cares
329
 * @param retval The return value to pass back to any thread that cares
330
 */
330
 */
331
APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
331
APR_DECLARE(void) apr_thread_exit(apr_thread_t *thd, apr_status_t retval)
332
    __attribute__((noreturn));
332
                  APR__ATTRIBUTE__NORETURN;
333
333
334
/**
334
/**
335
 * block until the desired thread stops executing.
335
 * block until the desired thread stops executing.
(-)include/apu_errno.h (-3 / +4 lines)
Lines 312-320 typedef struct apu_err_t { Link Here
312
 * @return The apu_err_t structure on success, NULL if out of memory.
312
 * @return The apu_err_t structure on success, NULL if out of memory.
313
 */
313
 */
314
APR_DECLARE_NONSTD(apu_err_t *) apr_errprintf(apu_err_t *result,
314
APR_DECLARE_NONSTD(apu_err_t *) apr_errprintf(apu_err_t *result,
315
        apr_pool_t *p, const char *reason, int rc, const char *fmt, ...)
315
                                              apr_pool_t *p, const char *reason,
316
        __attribute__((format(printf,5,6)))
316
                                              int rc, const char *fmt, ...)
317
        __attribute__((nonnull(2)));
317
                                APR__ATTRIBUTE__FORMAT(printf,5,6)
318
                                APR__ATTRIBUTE__NONNULL(2);
318
319
319
/** @} */
320
/** @} */
320
321
(-)include/private/apr_ldap_internal.h (-1 / +1 lines)
Lines 174-180 APU_DECLARE_LDAP(void) apr_ldap_result_add(apr_poo Link Here
174
                                           apr_ldap_t *ldap,
174
                                           apr_ldap_t *ldap,
175
                                           apr_ldap_result_t *res,
175
                                           apr_ldap_result_t *res,
176
                                           int msgid)
176
                                           int msgid)
177
                                           __attribute__((nonnull(1,2,3)));
177
                       APR__ATTRIBUTE__NONNULL(1,2,3);
178
178
179
179
180
180
(-)strings/apr_strings.c (-1 / +1 lines)
Lines 215-221 APR_DECLARE(char *) apr_pstrcatv(apr_pool_t *a, co Link Here
215
#if defined(HAVE_WEAK_SYMBOLS)
215
#if defined(HAVE_WEAK_SYMBOLS)
216
void apr__memzero_explicit(void *buffer, apr_size_t size);
216
void apr__memzero_explicit(void *buffer, apr_size_t size);
217
217
218
__attribute__ ((weak))
218
APR__ATTRIBUTE__WEAK
219
void apr__memzero_explicit(void *buffer, apr_size_t size)
219
void apr__memzero_explicit(void *buffer, apr_size_t size)
220
{
220
{
221
    memset(buffer, 0, size);
221
    memset(buffer, 0, size);
(-)strings/apr_strnatcmp.c (-6 lines)
Lines 25-36 Link Here
25
#include "apr_strings.h"
25
#include "apr_strings.h"
26
#include "apr_lib.h"            /* for apr_is*() */
26
#include "apr_lib.h"            /* for apr_is*() */
27
27
28
#if defined(__GNUC__)
29
#  define UNUSED __attribute__((__unused__))
30
#else
31
#  define UNUSED
32
#endif
33
34
/* based on "strnatcmp.c,v 1.6 2000/04/20 07:30:11 mbp Exp $" */
28
/* based on "strnatcmp.c,v 1.6 2000/04/20 07:30:11 mbp Exp $" */
35
29
36
static int
30
static int
(-)test/testatomic.c (-1 / +1 lines)
Lines 366-372 apr_uint64_t atomic_ops64 = 0; Link Here
366
struct {
366
struct {
367
    char pad[CACHELINE_SIZE - 5];
367
    char pad[CACHELINE_SIZE - 5];
368
    apr_uint64_t ops64;
368
    apr_uint64_t ops64;
369
} atomic_pad __attribute__((aligned(CACHELINE_SIZE)));
369
} atomic_pad APR__ATTRIBUTE__ALIGNED(cacheline_size);
370
370
371
apr_status_t exit_ret_val = 123; /* just some made up number to check on later */
371
apr_status_t exit_ret_val = 123; /* just some made up number to check on later */
372
372

Return to bug 69009