hostapd/src/utils/config.h
Patrick Steinhardt e9f449ba59 wpa_supplicant: Move wpa_config_get_line() into utils
The function wpa_config_get_line() is used by the wpa_supplicant config
file parser to retrieve the next non-comment non-blank line. We'll need
the same kind of functionality to implement the file-based external
password backend, so as a preparatory step this commit extracts the
function into its own standalone file in the utils package.

No functional changes are expected from this commit.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2021-02-16 00:47:43 +02:00

29 lines
985 B
C

/*
* Configuration parsing
* Copyright (c) 2003-2019, Jouni Malinen <j@w1.fi>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#ifndef UTILS_CONFIG_H
#define UTILS_CONFIG_H
/**
* wpa_config_get_line - Read the next configuration file line
* @s: Buffer for the line
* @size: The buffer length
* @stream: File stream to read from
* @line: Pointer to a variable storing the file line number
* @_pos: Buffer for the pointer to the beginning of data on the text line or
* %NULL if not needed (returned value used instead)
* Returns: Pointer to the beginning of data on the text line or %NULL if no
* more text lines are available.
*
* This function reads the next non-empty line from the configuration file and
* removes comments. The returned string is guaranteed to be null-terminated.
*/
char * wpa_config_get_line(char *s, int size, FILE *stream, int *line,
char **_pos);
#endif /* UTILS_CONFIG_H */