Low level MQTTSN packet library, part of the Eclipse Paho project: http://eclipse.org/paho

Dependents:   MQTTSN sara-n200-hello-mqtt-sn MQTTSN_2

The master source for this project is held at: https://github.com/eclipse/paho.mqtt-sn.embedded-c

Committer:
icraggs
Date:
Wed Jan 06 14:19:27 2016 +0000
Revision:
1:7fa362fa563f
Parent:
0:c524a894b5e8
Internal function name changes to avoid name clashes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
icraggs 0:c524a894b5e8 1 /*******************************************************************************
icraggs 0:c524a894b5e8 2 * Copyright (c) 2014 IBM Corp.
icraggs 0:c524a894b5e8 3 *
icraggs 0:c524a894b5e8 4 * All rights reserved. This program and the accompanying materials
icraggs 0:c524a894b5e8 5 * are made available under the terms of the Eclipse Public License v1.0
icraggs 0:c524a894b5e8 6 * and Eclipse Distribution License v1.0 which accompany this distribution.
icraggs 0:c524a894b5e8 7 *
icraggs 0:c524a894b5e8 8 * The Eclipse Public License is available at
icraggs 0:c524a894b5e8 9 * http://www.eclipse.org/legal/epl-v10.html
icraggs 0:c524a894b5e8 10 * and the Eclipse Distribution License is available at
icraggs 0:c524a894b5e8 11 * http://www.eclipse.org/org/documents/edl-v10.php.
icraggs 0:c524a894b5e8 12 *
icraggs 0:c524a894b5e8 13 * Contributors:
icraggs 0:c524a894b5e8 14 * Ian Craggs - initial API and implementation and/or initial documentation
icraggs 0:c524a894b5e8 15 *******************************************************************************/
icraggs 0:c524a894b5e8 16
icraggs 0:c524a894b5e8 17 #ifndef STACKTRACE_H_
icraggs 0:c524a894b5e8 18 #define STACKTRACE_H_
icraggs 0:c524a894b5e8 19
icraggs 0:c524a894b5e8 20 #include <stdio.h>
icraggs 0:c524a894b5e8 21 #define NOSTACKTRACE 1
icraggs 0:c524a894b5e8 22
icraggs 0:c524a894b5e8 23 #if defined(NOSTACKTRACE)
icraggs 0:c524a894b5e8 24 #define FUNC_ENTRY
icraggs 0:c524a894b5e8 25 #define FUNC_ENTRY_NOLOG
icraggs 0:c524a894b5e8 26 #define FUNC_ENTRY_MED
icraggs 0:c524a894b5e8 27 #define FUNC_ENTRY_MAX
icraggs 0:c524a894b5e8 28 #define FUNC_EXIT
icraggs 0:c524a894b5e8 29 #define FUNC_EXIT_NOLOG
icraggs 0:c524a894b5e8 30 #define FUNC_EXIT_MED
icraggs 0:c524a894b5e8 31 #define FUNC_EXIT_MAX
icraggs 0:c524a894b5e8 32 #define FUNC_EXIT_RC(x)
icraggs 0:c524a894b5e8 33 #define FUNC_EXIT_MED_RC(x)
icraggs 0:c524a894b5e8 34 #define FUNC_EXIT_MAX_RC(x)
icraggs 0:c524a894b5e8 35 #else
icraggs 0:c524a894b5e8 36 #if defined(WIN32)
icraggs 0:c524a894b5e8 37 #define inline __inline
icraggs 0:c524a894b5e8 38 #define FUNC_ENTRY StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 39 #define FUNC_ENTRY_NOLOG StackTrace_entry(__FUNCTION__, __LINE__, -1)
icraggs 0:c524a894b5e8 40 #define FUNC_ENTRY_MED StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 41 #define FUNC_ENTRY_MAX StackTrace_entry(__FUNCTION__, __LINE__, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 42 #define FUNC_EXIT StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 43 #define FUNC_EXIT_NOLOG StackTrace_exit(__FUNCTION__, __LINE__, -1)
icraggs 0:c524a894b5e8 44 #define FUNC_EXIT_MED StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 45 #define FUNC_EXIT_MAX StackTrace_exit(__FUNCTION__, __LINE__, NULL, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 46 #define FUNC_EXIT_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 47 #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 48 #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__FUNCTION__, __LINE__, &x, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 49 #else
icraggs 0:c524a894b5e8 50 #define FUNC_ENTRY StackTrace_entry(__func__, __LINE__, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 51 #define FUNC_ENTRY_NOLOG StackTrace_entry(__func__, __LINE__, -1)
icraggs 0:c524a894b5e8 52 #define FUNC_ENTRY_MED StackTrace_entry(__func__, __LINE__, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 53 #define FUNC_ENTRY_MAX StackTrace_entry(__func__, __LINE__, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 54 #define FUNC_EXIT StackTrace_exit(__func__, __LINE__, NULL, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 55 #define FUNC_EXIT_NOLOG StackTrace_exit(__func__, __LINE__, NULL, -1)
icraggs 0:c524a894b5e8 56 #define FUNC_EXIT_MED StackTrace_exit(__func__, __LINE__, NULL, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 57 #define FUNC_EXIT_MAX StackTrace_exit(__func__, __LINE__, NULL, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 58 #define FUNC_EXIT_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MINIMUM)
icraggs 0:c524a894b5e8 59 #define FUNC_EXIT_MED_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MEDIUM)
icraggs 0:c524a894b5e8 60 #define FUNC_EXIT_MAX_RC(x) StackTrace_exit(__func__, __LINE__, &x, TRACE_MAXIMUM)
icraggs 0:c524a894b5e8 61 #endif
icraggs 0:c524a894b5e8 62 #endif
icraggs 0:c524a894b5e8 63
icraggs 0:c524a894b5e8 64 void StackTrace_entry(const char* name, int line, int trace);
icraggs 0:c524a894b5e8 65 void StackTrace_exit(const char* name, int line, void* return_value, int trace);
icraggs 0:c524a894b5e8 66
icraggs 0:c524a894b5e8 67 void StackTrace_printStack(FILE* dest);
icraggs 0:c524a894b5e8 68 char* StackTrace_get(unsigned long);
icraggs 0:c524a894b5e8 69
icraggs 0:c524a894b5e8 70
icraggs 0:c524a894b5e8 71 #endif /* STACKTRACE_H_ */
icraggs 0:c524a894b5e8 72