Azure IoT common library

Dependents:   STM32F746_iothub_client_sample_mqtt f767zi_mqtt iothub_client_sample_amqp iothub_client_sample_http ... more

Committer:
AzureIoTClient
Date:
Fri Feb 10 17:01:36 2017 -0800
Revision:
20:95abdea56064
Parent:
0:fa2de1b79154
Child:
48:81866008bba4
1.1.7

Who changed what in which revision?

UserRevisionLine numberNew 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
Azure.IoT Build 0:fa2de1b79154 9 static const int avoid_a_warning_C4206 = 0; /* warning C4206: nonstandard extension used: translation unit is empty*/
AzureIoTClient 20:95abdea56064 10 #endif
Azure.IoT Build 0:fa2de1b79154 11 #ifdef GB_STDIO_INTERCEPT
Azure.IoT Build 0:fa2de1b79154 12
Azure.IoT Build 0:fa2de1b79154 13 #ifdef __cplusplus
Azure.IoT Build 0:fa2de1b79154 14 #include <cstdio>
Azure.IoT Build 0:fa2de1b79154 15 #include <cstdarg>
Azure.IoT Build 0:fa2de1b79154 16 #else
Azure.IoT Build 0:fa2de1b79154 17 #include <stdio.h>
Azure.IoT Build 0:fa2de1b79154 18 #include <stdarg.h>
Azure.IoT Build 0:fa2de1b79154 19 #endif
Azure.IoT Build 0:fa2de1b79154 20
Azure.IoT Build 0:fa2de1b79154 21 #include "azure_c_shared_utility/gb_stdio.h"
Azure.IoT Build 0:fa2de1b79154 22
Azure.IoT Build 0:fa2de1b79154 23 /*this is fopen*/
Azure.IoT Build 0:fa2de1b79154 24 FILE *gb_fopen(const char * filename, const char * mode)
Azure.IoT Build 0:fa2de1b79154 25 {
Azure.IoT Build 0:fa2de1b79154 26 return fopen(filename, mode);
Azure.IoT Build 0:fa2de1b79154 27 }
Azure.IoT Build 0:fa2de1b79154 28
Azure.IoT Build 0:fa2de1b79154 29 int gb_fclose(FILE *stream)
Azure.IoT Build 0:fa2de1b79154 30 {
Azure.IoT Build 0:fa2de1b79154 31 return fclose(stream);
Azure.IoT Build 0:fa2de1b79154 32 }
Azure.IoT Build 0:fa2de1b79154 33
Azure.IoT Build 0:fa2de1b79154 34 int gb_fseek(FILE *stream, long int offset, int whence)
Azure.IoT Build 0:fa2de1b79154 35 {
Azure.IoT Build 0:fa2de1b79154 36 return fseek(stream, offset, whence);
Azure.IoT Build 0:fa2de1b79154 37 }
Azure.IoT Build 0:fa2de1b79154 38
Azure.IoT Build 0:fa2de1b79154 39 long int gb_ftell(FILE *stream)
Azure.IoT Build 0:fa2de1b79154 40 {
Azure.IoT Build 0:fa2de1b79154 41 return ftell(stream);
Azure.IoT Build 0:fa2de1b79154 42 }
Azure.IoT Build 0:fa2de1b79154 43
Azure.IoT Build 0:fa2de1b79154 44 int fprintf(FILE * stream, const char * format, ...)
Azure.IoT Build 0:fa2de1b79154 45 {
Azure.IoT Build 0:fa2de1b79154 46 va_list args;
Azure.IoT Build 0:fa2de1b79154 47 va_start(args, format);
Azure.IoT Build 0:fa2de1b79154 48 vfprintf(stream, format, args);
Azure.IoT Build 0:fa2de1b79154 49 va_end(args);
Azure.IoT Build 0:fa2de1b79154 50 }
Azure.IoT Build 0:fa2de1b79154 51
Azure.IoT Build 0:fa2de1b79154 52 #endif