51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

textfile.h

1 /* *********************************************************************
2  * This Source Code Form is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2019 51 Degrees Mobile Experts Limited, 5 Charlotte Close,
4  * Caversham, Reading, Berkshire, United Kingdom RG4 7BY
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0.
8  *
9  * If a copy of the MPL was not distributed with this file, You can obtain
10  * one at http://mozilla.org/MPL/2.0/.
11  *
12  * This Source Code Form is "Incompatible With Secondary Licenses", as
13  * defined by the Mozilla Public License, v. 2.0.
14  * ******************************************************************** */
15 
16 #ifndef FIFTYONE_DEGREES_TEXT_FILE_H_INCLUDED
17 #define FIFTYONE_DEGREES_TEXT_FILE_H_INCLUDED
18 
30 #include <stdio.h>
31 #include <ctype.h>
32 #include "file.h"
33 
34 #ifdef __cplusplus
35 #define EXTERNAL extern "C"
36 #else
37 #define EXTERNAL
38 #endif
39 
49 EXTERNAL void fiftyoneDegreesTextFileIterate(
50  const char *fileName,
51  const char *buffer,
52  int length,
53  void *state,
54  void(*callback)(const char*, void*));
55 
60 #endif
EXTERNAL void fiftyoneDegreesTextFileIterate(const char *fileName, const char *buffer, int length, void *state, void(*callback)(const char *, void *))
Iterates over all the lines in a text file calling the callback method with each line.
Definition: textfile.c:20