Lines Matching +full:no +full:- +full:output

9  * The canonical version of this file is maintained in the rra-c-util package,
10 * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
14 * Copyright 2010-2012, 2014
29 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
35 * SPDX-License-Identifier: MIT
51 static struct output *messages = NULL;
55 * Allocate a new, empty output struct and call bail if memory allocation
58 struct output *
61 struct output *output; in output_new() local
63 output = bmalloc(sizeof(struct output)); in output_new()
64 output->count = 0; in output_new()
65 output->allocated = 1; in output_new()
66 output->lines = bmalloc(sizeof(output->lines[0])); in output_new()
67 output->lines[0].line = NULL; in output_new()
68 return output; in output_new()
73 * Add a new output line to the output struct, resizing the array as
77 output_add(struct output *output, int priority, const char *string) in output_add() argument
79 size_t next = output->count; in output_add()
82 if (output->count == output->allocated) { in output_add()
83 n = output->allocated + 1; in output_add()
84 size = sizeof(output->lines[0]); in output_add()
85 output->lines = breallocarray(output->lines, n, size); in output_add()
86 output->allocated = n; in output_add()
88 output->lines[next].priority = priority; in output_add()
89 output->lines[next].line = bstrdup(string); in output_add()
90 output->count++; in output_add()
102 /* clang-format off */ in pam_strerror()
104 case PAM_SUCCESS: return "No error"; in pam_strerror()
112 /* clang-format on */ in pam_strerror()
135 * we have no way of reporting them, but the tests will fail due to missing
136 * output.
153 * Used by test code. Returns the accumulated messages in an output struct
157 struct output *
160 struct output *output; in pam_output() local
162 output = messages; in pam_output()
164 return output; in pam_output()
169 * Free an output struct.
172 pam_output_free(struct output *output) in pam_output_free() argument
176 if (output == NULL) in pam_output_free()
178 for (i = 0; i < output->count; i++) in pam_output_free()
179 if (output->lines[i].line != NULL) in pam_output_free()
180 free(output->lines[i].line); in pam_output_free()
181 free(output->lines); in pam_output_free()
182 free(output); in pam_output_free()