Azure IoT common library
Dependents: STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more
gb_stdio.c@48:81866008bba4, 2018-09-11 (annotated)
- Committer:
- AzureIoTClient
- Date:
- Tue Sep 11 11:15:08 2018 -0700
- Revision:
- 48:81866008bba4
- Parent:
- 20:95abdea56064
1.2.9
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Azure.IoT Build | 0:fa2de1b79154 | 1 | // Copyright (c) Microsoft. All rights reserved. |
Azure.IoT Build | 0:fa2de1b79154 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for full license information. |
Azure.IoT Build | 0:fa2de1b79154 | 3 | |
Azure.IoT Build | 0:fa2de1b79154 | 4 | /*depending if the symbol GB_STDIO_INTERCEPT is defined, this file does the following |
Azure.IoT Build | 0:fa2de1b79154 | 5 | |
Azure.IoT Build | 0:fa2de1b79154 | 6 | a) if GB_STDIO_INTERCEPT is NOT defined, then the file shall be empty (almost:) |
Azure.IoT Build | 0:fa2de1b79154 | 7 | b) if GB_STDIO_INTERCEPT is defined, then the file shall call to the 'real' stdio.h functions from their gb_* synonyms*/ |
AzureIoTClient | 20:95abdea56064 | 8 | #ifdef _MSC_VER |
AzureIoTClient | 48:81866008bba4 | 9 | /* compiler warning C4206: nonstandard extension used: translation unit is empty */ |
AzureIoTClient | 48:81866008bba4 | 10 | /* linker warning 4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library */ |
AzureIoTClient | 48:81866008bba4 | 11 | const int avoid_warnings_B9EB480E_6AE7_43B3_9249_47993776BA7B = 0; |
AzureIoTClient | 20:95abdea56064 | 12 | #endif |
Azure.IoT Build | 0:fa2de1b79154 | 13 | #ifdef GB_STDIO_INTERCEPT |
Azure.IoT Build | 0:fa2de1b79154 | 14 | |
Azure.IoT Build | 0:fa2de1b79154 | 15 | #ifdef __cplusplus |
Azure.IoT Build | 0:fa2de1b79154 | 16 | #include <cstdio> |
Azure.IoT Build | 0:fa2de1b79154 | 17 | #include <cstdarg> |
Azure.IoT Build | 0:fa2de1b79154 | 18 | #else |
Azure.IoT Build | 0:fa2de1b79154 | 19 | #include <stdio.h> |
Azure.IoT Build | 0:fa2de1b79154 | 20 | #include <stdarg.h> |
Azure.IoT Build | 0:fa2de1b79154 | 21 | #endif |
Azure.IoT Build | 0:fa2de1b79154 | 22 | |
Azure.IoT Build | 0:fa2de1b79154 | 23 | #include "azure_c_shared_utility/gb_stdio.h" |
Azure.IoT Build | 0:fa2de1b79154 | 24 | |
Azure.IoT Build | 0:fa2de1b79154 | 25 | /*this is fopen*/ |
Azure.IoT Build | 0:fa2de1b79154 | 26 | FILE *gb_fopen(const char * filename, const char * mode) |
Azure.IoT Build | 0:fa2de1b79154 | 27 | { |
Azure.IoT Build | 0:fa2de1b79154 | 28 | return fopen(filename, mode); |
Azure.IoT Build | 0:fa2de1b79154 | 29 | } |
Azure.IoT Build | 0:fa2de1b79154 | 30 | |
Azure.IoT Build | 0:fa2de1b79154 | 31 | int gb_fclose(FILE *stream) |
Azure.IoT Build | 0:fa2de1b79154 | 32 | { |
Azure.IoT Build | 0:fa2de1b79154 | 33 | return fclose(stream); |
Azure.IoT Build | 0:fa2de1b79154 | 34 | } |
Azure.IoT Build | 0:fa2de1b79154 | 35 | |
Azure.IoT Build | 0:fa2de1b79154 | 36 | int gb_fseek(FILE *stream, long int offset, int whence) |
Azure.IoT Build | 0:fa2de1b79154 | 37 | { |
Azure.IoT Build | 0:fa2de1b79154 | 38 | return fseek(stream, offset, whence); |
Azure.IoT Build | 0:fa2de1b79154 | 39 | } |
Azure.IoT Build | 0:fa2de1b79154 | 40 | |
Azure.IoT Build | 0:fa2de1b79154 | 41 | long int gb_ftell(FILE *stream) |
Azure.IoT Build | 0:fa2de1b79154 | 42 | { |
Azure.IoT Build | 0:fa2de1b79154 | 43 | return ftell(stream); |
Azure.IoT Build | 0:fa2de1b79154 | 44 | } |
Azure.IoT Build | 0:fa2de1b79154 | 45 | |
Azure.IoT Build | 0:fa2de1b79154 | 46 | int fprintf(FILE * stream, const char * format, ...) |
Azure.IoT Build | 0:fa2de1b79154 | 47 | { |
Azure.IoT Build | 0:fa2de1b79154 | 48 | va_list args; |
Azure.IoT Build | 0:fa2de1b79154 | 49 | va_start(args, format); |
Azure.IoT Build | 0:fa2de1b79154 | 50 | vfprintf(stream, format, args); |
Azure.IoT Build | 0:fa2de1b79154 | 51 | va_end(args); |
Azure.IoT Build | 0:fa2de1b79154 | 52 | } |
Azure.IoT Build | 0:fa2de1b79154 | 53 | |
Azure.IoT Build | 0:fa2de1b79154 | 54 | #endif |