Module Name: src Committed By: rillig Date: Fri Oct 8 19:27:20 UTC 2021
Modified Files: src/usr.bin/indent: args.c Log Message: indent: unexport add_typedefs_from_file No functional change. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/usr.bin/indent/args.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/indent/args.c diff -u src/usr.bin/indent/args.c:1.52 src/usr.bin/indent/args.c:1.53 --- src/usr.bin/indent/args.c:1.52 Fri Oct 8 19:03:34 2021 +++ src/usr.bin/indent/args.c Fri Oct 8 19:27:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: args.c,v 1.52 2021/10/08 19:03:34 rillig Exp $ */ +/* $NetBSD: args.c,v 1.53 2021/10/08 19:27:20 rillig Exp $ */ /*- * SPDX-License-Identifier: BSD-4-Clause @@ -43,7 +43,7 @@ static char sccsid[] = "@(#)args.c 8.1 ( #include <sys/cdefs.h> #if defined(__NetBSD__) -__RCSID("$NetBSD: args.c,v 1.52 2021/10/08 19:03:34 rillig Exp $"); +__RCSID("$NetBSD: args.c,v 1.53 2021/10/08 19:27:20 rillig Exp $"); #elif defined(__FreeBSD__) __FBSDID("$FreeBSD: head/usr.bin/indent/args.c 336318 2018-07-15 21:04:21Z pstef $"); #endif @@ -61,8 +61,6 @@ __FBSDID("$FreeBSD: head/usr.bin/indent/ #define INDENT_VERSION "2.0" -void add_typedefs_from_file(const char *); - #if __STDC_VERSION__ >= 201112L #define assert_type(expr, type) _Generic((expr), type : (expr)) #else @@ -203,6 +201,24 @@ skip_over(const char *s, bool may_negate return s; } +static void +add_typedefs_from_file(const char *fname) +{ + FILE *file; + char line[BUFSIZ]; + + if ((file = fopen(fname, "r")) == NULL) { + fprintf(stderr, "indent: cannot open file %s\n", fname); + exit(1); + } + while ((fgets(line, BUFSIZ, file)) != NULL) { + /* Remove trailing whitespace */ + line[strcspn(line, " \t\n\r")] = '\0'; + add_typename(line); + } + (void)fclose(file); +} + static bool set_special_option(const char *arg, const char *option_source) { @@ -285,21 +301,3 @@ found: *(int *)p->p_var = atoi(param_start); } } - -void -add_typedefs_from_file(const char *fname) -{ - FILE *file; - char line[BUFSIZ]; - - if ((file = fopen(fname, "r")) == NULL) { - fprintf(stderr, "indent: cannot open file %s\n", fname); - exit(1); - } - while ((fgets(line, BUFSIZ, file)) != NULL) { - /* Remove trailing whitespace */ - line[strcspn(line, " \t\n\r")] = '\0'; - add_typename(line); - } - fclose(file); -}