Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
io_utils.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
23 #ifndef IO_UTILS_H
24 #define IO_UTILS_H
25 
26 
27 #include <stdio.h>
28 
29 
30 
31  /*
32  * grassroots includes
33  */
34 #include "typedefs.h"
36 
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
52 GRASSROOTS_UTIL_API FileLocation GetFileLocation (const char * const filename_s);
53 
54 
63 GRASSROOTS_UTIL_API char *CopyFileToLocalFilesystem (const char * const filename_s);
64 
65 
76 GRASSROOTS_UTIL_API char *CopyFileChunkToLocalFilesystem (const char * const filename_s, size_t offset, size_t chunk_size);
77 
78 
87 GRASSROOTS_UTIL_API char *GetIntAsString (int value);
88 
89 
98 GRASSROOTS_UTIL_API char *GetUnsignedIntAsString (uint32 value);
99 
100 
120 GRASSROOTS_UTIL_API void WriteToLog (const char *log_ident_s, const int log_level, const char *message_s, ...);
121 
122 
123 
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 
130 #endif /* #ifndef IO_UTILS_H */
grassroots_util_library.h
CopyFileToLocalFilesystem
char * CopyFileToLocalFilesystem(const char *const filename_s)
Copy a file to the local filesystem.
GetFileLocation
FileLocation GetFileLocation(const char *const filename_s)
Determine whether a file is on the local filesystem or not.
CopyFileChunkToLocalFilesystem
char * CopyFileChunkToLocalFilesystem(const char *const filename_s, size_t offset, size_t chunk_size)
Copy a file chunk to the local filesystem.
typedefs.h
GetUnsignedIntAsString
char * GetUnsignedIntAsString(uint32 value)
Get a newly allocated char * with the given value.
FileLocation
FileLocation
An enum specifying whether a file is located on a local or remote filesystem.
Definition: typedefs.h:165
WriteToLog
void WriteToLog(const char *log_ident_s, const int log_level, const char *message_s,...)
Write a logging message to the given logfile.
GetIntAsString
char * GetIntAsString(int value)
Get a newly allocated char * with the given value.
GRASSROOTS_UTIL_API
#define GRASSROOTS_UTIL_API
Definition: grassroots_util_library.h:47