PK :c[IDA A lib_logging/README.rstDebug printing library
======================
Overview
--------
This library provides a lightweight printf function that can be enabled
or disabled via configuration defines. Code can be declared to be
within a "debug unit" (usually a library or application source base)
and prints can be enabled/disabled per debug unit.
Features
........
* Low memory usage
* Ability to enable or disable printing via compile options
* Ability to enable or disable printing for sets of source files
Software version and dependencies
.................................
.. libdeps::
PK :c[IN N lib_logging/CHANGELOG.rstLogging change log
==================
2.1.0
-----
* ADDED: Now supports the %p format specifier
* CHANGE: Ignore the case of the format specifiers
* CHANGE: Ignore padding and alignment characters
2.0.1
-----
* CHANGE: Update to source code license and copyright
2.0.0
-----
* CHANGE: Restructured library
PK :c[I
I* I* lib_logging/LICENSE.txtSoftware Release License Agreement
Copyright (c) 2016, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS Debug printing library software
PK :c[I{]{ ! lib_logging/lib_logging/.cproject
PK :c[I@W W ) lib_logging/lib_logging/module_build_infoOPTIONAL_HEADERS += debug_conf.h
MODULE_XCC_FLAGS = $(XCC_FLAGS) -Os
VERSION = 2.1.0
PK :c[I(z z ! lib_logging/lib_logging/.xproject
lib_logging
2.1.0
PK :c[I
~ ! lib_logging/lib_logging/.makefileall:
@echo "** Module only - only builds as part of application **"
clean:
@echo "** Module only - only builds as part of application **"
PK :c[Ik* lib_logging/lib_logging/.project
lib_logging
com.xmos.cdt.core.LegacyProjectCheckerBuilder
com.xmos.cdt.core.BuildMarkersBuilder
com.xmos.cdt.core.ProjectCheckerBuilder
com.xmos.cdt.core.ProjectInfoSyncBuilder
com.xmos.cdt.core.IncludePathBuilder
com.xmos.cdt.core.ModulePathBuilder
org.eclipse.cdt.managedbuilder.core.genmakebuilder
clean,full,incremental,
?children?
?name?=outputEntries\|?children?=?name?=entry\\\\\\\|\\\|\||
?name?
org.eclipse.cdt.make.core.append_environment
true
org.eclipse.cdt.make.core.buildArguments
-f .makefile
org.eclipse.cdt.make.core.buildCommand
xmake
org.eclipse.cdt.make.core.cleanBuildTarget
clean
org.eclipse.cdt.make.core.contents
org.eclipse.cdt.make.core.activeConfigSettings
org.eclipse.cdt.make.core.enableAutoBuild
false
org.eclipse.cdt.make.core.enableCleanBuild
true
org.eclipse.cdt.make.core.enableFullBuild
true
org.eclipse.cdt.make.core.stopOnError
true
org.eclipse.cdt.make.core.useDefaultBuildCmd
false
org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
full,incremental,
org.eclipse.cdt.core.cnature
org.eclipse.cdt.managedbuilder.core.managedBuildNature
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
com.xmos.cdt.core.XdeProjectNature
PK :c[I
I* I* # lib_logging/lib_logging/LICENSE.txtSoftware Release License Agreement
Copyright (c) 2016, XMOS, All rights reserved.
BY ACCESSING, USING, INSTALLING OR DOWNLOADING THE XMOS SOFTWARE, YOU AGREE TO BE BOUND BY THE FOLLOWING TERMS. IF YOU DO NOT AGREE TO THESE, DO NOT ATTEMPT TO DOWNLOAD, ACCESS OR USE THE XMOS Software.
Parties:
(1) XMOS Limited, incorporated and registered in England and Wales with company number 5494985 whose registered office is 107 Cheapside, London, EC2V 6DN (XMOS).
(2) An individual or legal entity exercising permissions granted by this License (Customer).
If you are entering into this Agreement on behalf of another legal entity such as a company, partnership, university, college etc. (for example, as an employee, student or consultant), you warrant that you have authority to bind that entity.
1. Definitions
"License" means this Software License and any schedules or annexes to it.
"License Fee" means the fee for the XMOS Software as detailed in any schedules or annexes to this Software License
"Licensee Modifications" means all developments and modifications of the XMOS Software developed independently by the Customer.
"XMOS Modifications" means all developments and modifications of the XMOS Software developed or co-developed by XMOS.
"XMOS Hardware" means any XMOS hardware devices supplied by XMOS from time to time and/or the particular XMOS devices detailed in any schedules or annexes to this Software License.
"XMOS Software" comprises the XMOS owned circuit designs, schematics, source code, object code, reference designs, (including related programmer comments and documentation, if any), error corrections, improvements, modifications (including XMOS Modifications) and updates.
The headings in this License do not affect its interpretation. Save where the context otherwise requires, references to clauses and schedules are to clauses and schedules of this License.
Unless the context otherwise requires:
- references to XMOS and the Customer include their permitted successors and assigns;
- references to statutory provisions include those statutory provisions as amended or re-enacted; and
- references to any gender include all genders.
Words in the singular include the plural and in the plural include the singular.
2. License
XMOS grants the Customer a non-exclusive license to use, develop, modify and distribute the XMOS Software with, or for the purpose of being used with, XMOS Hardware.
Open Source Software (OSS) must be used and dealt with in accordance with any license terms under which OSS is distributed.
3. Consideration
In consideration of the mutual obligations contained in this License, the parties agree to its terms.
4. Term
Subject to clause 12 below, this License shall be perpetual.
5. Restrictions on Use
The Customer will adhere to all applicable import and export laws and regulations of the country in which it resides and of the United States and United Kingdom, without limitation. The Customer agrees that it is its responsibility to obtain copies of and to familiarise itself fully with these laws and regulations to avoid violation.
6. Modifications
The Customer will own all intellectual property rights in the Licensee Modifications but will undertake to provide XMOS with any fixes made to correct any bugs found in the XMOS Software on a non-exclusive, perpetual and royalty free license basis.
XMOS will own all intellectual property rights in the XMOS Modifications.
The Customer may only use the Licensee Modifications and XMOS Modifications on, or in relation to, XMOS Hardware.
7. Support
Support of the XMOS Software may be provided by XMOS pursuant to a separate support agreement.
8. Warranty and Disclaimer
The XMOS Software is provided "AS IS" without a warranty of any kind. XMOS and its licensors' entire liability and Customer's exclusive remedy under this warranty to be determined in XMOS's sole and absolute discretion, will be either (a) the corrections of defects in media or replacement of the media, or (b) the refund of the license fee paid (if any).
Whilst XMOS gives the Customer the ability to load their own software and applications onto XMOS devices, the security of such software and applications when on the XMOS devices is the Customer's own responsibility and any breach of security shall not be deemed a defect or failure of the hardware. XMOS shall have no liability whatsoever in relation to any costs, damages or other losses Customer may incur as a result of any breaches of security in relation to your software or applications.
XMOS AND ITS LICENSORS DISCLAIM ALL OTHER WARRANTIES, EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY/ SATISFACTORY QUALITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID UNDER APPLICABLE LAW.
9. High Risk Activities
The XMOS Software is not designed or intended for use in conjunction with on-line control equipment in hazardous environments requiring fail-safe performance, including without limitation the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, life support machines, or weapons systems (collectively "High Risk Activities") in which the failure of the XMOS Software could lead directly to death, personal injury, or severe physical or environmental damage. XMOS and its licensors specifically disclaim any express or implied warranties relating to use of the XMOS Software in connection with High Risk Activities.
10. Liability
TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW, NEITHER XMOS NOR ITS LICENSORS SHALL BE LIABLE FOR ANY LOST REVENUE, BUSINESS, PROFIT, CONTRACTS OR DATA, ADMINISTRATIVE OR OVERHEAD EXPENSES, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES HOWEVER CAUSED AND REGARDLESS OF THEORY OF LIABILITY ARISING OUT OF THIS LICENSE, EVEN IF XMOS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event shall XMOS's liability to the Customer whether in contract, tort (including negligence), or otherwise exceed the License Fee.
Customer agrees to indemnify, hold harmless, and defend XMOS and its licensors from and against any claims or lawsuits, including attorneys' fees and any other liabilities, demands, proceedings, damages, losses, costs, expenses fines and charges which are made or brought against or incurred by XMOS as a result of your use or distribution of the Licensee Modifications or your use or distribution of XMOS Software, or any development of it, other than in accordance with the terms of this License.
11. Ownership
The copyrights and all other intellectual and industrial property rights for the protection of information with respect to the XMOS Software (including the methods and techniques on which they are based) are retained by XMOS and/or its licensors. Nothing in this Agreement serves to transfer such rights. Customer may not sell, mortgage, underlet, sublease, sublicense, lend or transfer possession of the XMOS Software in any way whatsoever to any third party who is not bound by this Agreement.
12. Termination
Either party may terminate this License at any time on written notice to the other if the other:
- is in material or persistent breach of any of the terms of this License and either that breach is incapable of remedy, or the other party fails to remedy that breach within 30 days after receiving written notice requiring it to remedy that breach; or
- is unable to pay its debts (within the meaning of section 123 of the Insolvency Act 1986), or becomes insolvent, or is subject to an order or a resolution for its liquidation, administration, winding-up or dissolution (otherwise than for the purposes of a solvent amalgamation or reconstruction), or has an administrative or other receiver, manager, trustee, liquidator, administrator or similar officer appointed over all or any substantial part of its assets, or enters into or proposes any composition or arrangement with its creditors generally, or is subject to any analogous event or proceeding in any applicable jurisdiction.
Termination by either party in accordance with the rights contained in clause 12 shall be without prejudice to any other rights or remedies of that party accrued prior to termination.
On termination for any reason:
- all rights granted to the Customer under this License shall cease;
- the Customer shall cease all activities authorised by this License;
- the Customer shall immediately pay any sums due to XMOS under this License; and
- the Customer shall immediately destroy or return to the XMOS (at the XMOS's option) all copies of the XMOS Software then in its possession, custody or control and, in the case of destruction, certify to XMOS that it has done so.
Clauses 5, 8, 9, 10 and 11 shall survive any effective termination of this Agreement.
13. Third party rights
No term of this License is intended to confer a benefit on, or to be enforceable by, any person who is not a party to this license.
14. Confidentiality and publicity
Each party shall, during the term of this License and thereafter, keep confidential all, and shall not use for its own purposes nor without the prior written consent of the other disclose to any third party any, information of a confidential nature (including, without limitation, trade secrets and information of commercial value) which may become known to such party from the other party and which relates to the other party, unless such information is public knowledge or already known to such party at the time of disclosure, or subsequently becomes public knowledge other than by breach of this license, or subsequently comes lawfully into the possession of such party from a third party.
The terms of this license are confidential and may not be disclosed by the Customer without the prior written consent of XMOS.
The provisions of clause 14 shall remain in full force and effect notwithstanding termination of this license for any reason.
15. Entire agreement
This License and the documents annexed as appendices to this License or otherwise referred to herein contain the whole agreement between the parties relating to the subject matter hereof and supersede all prior agreements, arrangements and understandings between the parties relating to that subject matter.
16. Assignment
The Customer shall not assign this License or any of the rights granted under it without XMOS's prior written consent.
17. Governing law and jurisdiction
This License shall be governed by and construed in accordance with English law and each party hereby submits to the non-exclusive jurisdiction of the English courts.
This License has been entered into on the date stated at the beginning of it.
Schedule
XMOS Debug printing library software
PK :c[I9k k ) lib_logging/lib_logging/api/debug_print.h// Copyright (c) 2014-2016, XMOS Ltd, All rights reserved
#ifndef _debug_printf_h_
#define _debug_printf_h_
/**
Debug Printing Module
=====================
This module provides a lightweight printf function that can be enabled
or disabled via configuration macros. Code can be declared to be
within a "debug unit" (usually a module) and prints can be
enabled/disabled per debug unit.
**/
#ifdef __debug_conf_h_exists__
#include "debug_conf.h"
#endif
#ifndef DEBUG_UNIT
#define DEBUG_UNIT APPLICATION
#endif
#ifndef DEBUG_PRINT_ENABLE_ALL
#define DEBUG_PRINT_ENABLE_ALL 0
#endif
#ifndef DEBUG_PRINT_ENABLE
#define DEBUG_PRINT_ENABLE 0
#endif
#if !defined(DEBUG_PRINT_ENABLE_APPLICATION) && !defined(DEBUG_PRINT_DISABLE_APPLICATION)
#define DEBUG_PRINT_ENABLE_APPLICATION DEBUG_PRINT_ENABLE
#endif
#define DEBUG_UTILS_JOIN0(x,y) x ## y
#define DEBUG_UTILS_JOIN(x,y) DEBUG_UTILS_JOIN0(x,y)
#if DEBUG_UTILS_JOIN(DEBUG_PRINT_ENABLE_,DEBUG_UNIT)
#define DEBUG_PRINT_ENABLE0 1
#endif
#if DEBUG_UTILS_JOIN(DEBUG_PRINT_DISABLE_,DEBUG_UNIT)
#define DEBUG_PRINT_ENABLE0 0
#endif
#if !defined(DEBUG_PRINT_ENABLE0)
#define DEBUG_PRINT_ENABLE0 DEBUG_PRINT_ENABLE_ALL
#endif
/** A limited functionality version of printf that is low memory.
*
* This function works like C-standard printf except that it only accepts
* %d, %x, %s, %u and %c format specifiers with no conversions.
*
* The %p format specifier is treated the same as a %x.
*
* The capital version of each format specifier performs the same as the lower
* case equivalent.
*
* Any alignment or padding characters are simply ignored.
*
* The function uses the functions from ``print.h`` to do the
* underlying printing.
*
* Unlike printf this function has no return value.
*
* Whether the function does any output can be controlled via
* defines such as ``DEBUG_PRINT_ENABLE`` or
* ``DEBUG_PRINT_ENABLE_[debug unit name]``
* in the application's ``debug_conf.h``
*/
void debug_printf(char fmt[], ...);
#if DEBUG_PRINT_ENABLE0
#define debug_printf(...) debug_printf(__VA_ARGS__)
#else
#define debug_printf(...)
#endif
#endif // _debug_printf_h_
PK :c[IN=
* lib_logging/lib_logging/src/debug_printf.c// Copyright (c) 2014-2016, XMOS Ltd, All rights reserved
#include
#include
#include
#include
#include
#include
#include
#include
#undef debug_printf
static void reverse_array(char buf[], unsigned size)
{
int begin = 0;
int end = size - 1;
int tmp;
for (;begin < end; begin++,end--) {
tmp = buf[begin];
buf[begin] = buf[end];
buf[end] = tmp;
}
}
static int itoa(unsigned n, char *buf, unsigned base, int fill)
{
static const char digits[] = "0123456789ABCDEF";
unsigned i = 0;
if (n == 0)
fill += 1;
while (n > 0) {
unsigned next = n / base;
unsigned cur = n % base;
buf[i] = digits[cur];
i += 1;
fill--;
n = next;
}
for (;fill > 0; fill--) {
buf[i] = '0';
i++;
}
reverse_array(buf, i);
return i;
}
#define MAX_INT_STRING_SIZE 10
#ifndef DEBUG_PRINTF_BUFSIZE
#define DEBUG_PRINTF_BUFSIZE 130
#endif
void debug_printf(char * fmt, ...)
{
char * marker;
int intArg;
unsigned int uintArg;
char * strArg;
char buf[DEBUG_PRINTF_BUFSIZE];
char *end = &buf[DEBUG_PRINTF_BUFSIZE - 1 - MAX_INT_STRING_SIZE];
va_list args;
va_start(args,fmt);
marker = fmt;
char *p = buf;
while (*fmt) {
if (p > end) {
// flush
_write(FD_STDOUT, buf, p - buf);
p = buf;
}
switch (*fmt) {
case '%':
fmt++;
if (*(fmt) == '-' || *(fmt) == '+' || *(fmt) == '#' || *(fmt) == ' ') {
// Ignore flags
fmt++;
}
while (*(fmt) && *(fmt) >= '0' && *(fmt) <= '9') {
// Ignore width
fmt++;
}
// Use 'tolower' to ensure both %x/%X do something sensible
switch (tolower(*(fmt))) {
case 'd':
intArg = va_arg(args, int);
if (intArg < 0) {
*p++ = '-';
intArg = -intArg;
}
p += itoa(intArg, p, 10, 0);
break;
case 'u':
uintArg = va_arg(args, int);
p += itoa(uintArg, p, 10, 0);
break;
case 'p':
case 'x':
uintArg = va_arg(args, int);
p += itoa(uintArg, p, 16, 0);
break;
case 'c':
intArg = va_arg(args, int);
*p++ = intArg;
break;
case 's':
strArg = va_arg(args, char *);
int len = strlen(strArg);
if (len > (end - buf)) {
// flush
_write(FD_STDOUT, buf, p - buf);
p = buf;
}
if (len > (end - buf))
len = end - buf;
memcpy(p, strArg, len);
p += len;
break;
default:
break;
}
break;
default:
*p++ = *fmt;
}
fmt++;
}
_write(FD_STDOUT, buf, p - buf);
va_end(args);
return;
}
PK :c[IcSIe + lib_logging/lib_logging/doc/pdf/logging.pdf%PDF-1.5
%
1 0 obj
<< /S /GoTo /D (section*.1) >>
endobj
4 0 obj
(Debug printing library)
endobj
5 0 obj
<< /S /GoTo /D (section.1) >>
endobj
8 0 obj
(API)
endobj
9 0 obj
<< /S /GoTo /D (subsection.1.1) >>
endobj
12 0 obj
(Debug printf)
endobj
13 0 obj
<< /S /GoTo /D (subsection.1.2) >>
endobj
16 0 obj
(Debug Units)
endobj
17 0 obj
<< /S /GoTo /D (subsection.1.3) >>
endobj
20 0 obj
(Enabling Printing)
endobj
21 0 obj
<< /S /GoTo /D (section.A) >>
endobj
24 0 obj
(Known Issues)
endobj
25 0 obj
<< /S /GoTo /D (section.B) >>
endobj
28 0 obj
(Logging change log)
endobj
29 0 obj
<< /S /GoTo /D (subsection.B.1) >>
endobj
32 0 obj
(2.1.0)
endobj
33 0 obj
<< /S /GoTo /D (subsection.B.2) >>
endobj
36 0 obj
(2.0.1)
endobj
37 0 obj
<< /S /GoTo /D (subsection.B.3) >>
endobj
40 0 obj
(2.0.0)
endobj
41 0 obj
<< /S /GoTo /D [42 0 R /Fit] >>
endobj
45 0 obj <<
/Length 914
/Filter /FlateDecode
>>
stream
xUKo8W 5CR6hXԇ=mIWPCf,!viĢ$%iGYI:,-(.{ÁE7f'h
fޭw<
"RDm$@|r??qY|
{aqEM'9q|3#Q+-vA8Ktb",P_pbi9)38LFnX[Ql_\gъ@%'p̳lno?ܢp*QbE~UzF)uidR"VJdWF?Qw}[Ų+˄1R$ f.jّ? b}5'^y'W>{,l/DG9OɎFU!`to+ySvr^,ǒwX1v8}igQHt9_hssNoFS "uPcB *a0Ezɲ3;8f`Ɗr'_sB+F5zw# mBٱ1M=]+&ţHOoÝNDX{!p
)`>q=˶ia8#QˣԵԕp ٘?HmÖJ{;'c|t&k~ad9_>xAUAL$p{t[c߆WVAZY?61v˯NOG&)8ѷns1һڗfíyǦV Ջ>yZ+Ӏ'1&V(9K+.'g .9N$M<ߛKPS"g>ىLdt9~0݁g@'Hiy '/e
endstream
endobj
42 0 obj <<
/Type /Page
/Contents 45 0 R
/Resources 44 0 R
/MediaBox [0 0 595.276 841.89]
/Parent 51 0 R
>> endobj
43 0 obj <<
/Type /XObject
/Subtype /Form
/FormType 1
/PTEX.FileName (/buildslave/swnb/apps/NightlyUSBAudio_centos_5_64bit_nightly/build/sb/Installs/Linux/External/xdoc/xdoc/texinputs/xmoslogo18pt.pdf)
/PTEX.PageNumber 1
/PTEX.InfoDict 52 0 R
/BBox [0 0 53.8584 15.0234]
/LastModified (D:20120829081646+01'00')
/PieceInfo <<
/Illustrator 53 0 R
>>
/Resources <<
/ColorSpace <<
/CS0 54 0 R
/CS1 55 0 R
/CS2 56 0 R
>>/ExtGState <<
/GS0 57 0 R
>>/Properties <<
/MC0 <<
/Color [ 20224 32768 65535]
/Dimmed false
/Editable true
/Preview true
/Printed true
/Title (Layer 1)
/Visible true
>>
>>>>
/Length 1293
/Filter /FlateDecode
>>
stream
HlWˎ6+el>#OW5)ͬ
;,쮮.9oOxeߎ}۾كhdOƲ琵ǯۭ.1BcSЫd]èX(7g'42]d>oloX4disj'ikzWd7{*2"ð)v ?WNpl=$]$kD6n+"L3-QDGqΎ X~!J7j4#hrD?2T&-Amb{밬ΐ>>6hKHޅS2"^bPCVŲB:3V9EB.,frSFfUԬꡘfApT©㔲r)S}*8tB2RL[k 8vL6v6t]_TZGsei!#Y)MjbNfFⱫ4lLؙQ*Xi;3qMXST`2nM+Isx MۄIƋűfyy)ShX͵u1]0
ĉ)ZY0-PR(+͆ՐO f䫂Laq¦X9(cNpU0I` 5.29)kQox壌->闞mkf 41O<
$21˲K&Щwm D&