* Changed header file include guards to unique namespace. Updated file headers comments with SPDX [issue #55] (#666)

This commit is contained in:
Steve Karg
2024-07-19 17:16:28 -05:00
committed by GitHub
parent 1e889b633c
commit 00ab206075
355 changed files with 2597 additions and 8082 deletions
+9 -5
View File
@@ -1,8 +1,12 @@
/* Derived from "Unix Incompatibility Notes: Byte Order" by Jan Wolter */
/* http://unixpapa.com/incnote/byteorder.html */
/** @file bigend.c Determination of Endianness */
/**
* @file
* @brief Determination of host Endianness
* Derived from "Unix Incompatibility Notes: Byte Order" by Jan Wolter
* http://unixpapa.com/incnote/byteorder.html
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: MIT
*/
#include "bacnet/basic/sys/bigend.h"
#ifdef BACNET_BIG_ENDIAN
+9 -26
View File
@@ -1,29 +1,12 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef BIGEND_H
#define BIGEND_H
/**
* @file
* @brief API for determination of host Endianness
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_BIGEND_H
#define BACNET_SYS_BIGEND_H
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
+3 -5
View File
@@ -1,11 +1,9 @@
/**
* @file
* @author Steve Karg
* @date 2022
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2012
* @brief Bitwise helper macros
* @copyright 2012 Steve Karg <skarg@users.sourceforge.net>
*
* SPDX-License-Identifier: MIT
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_BITS_H
#define BACNET_SYS_BITS_H
+3 -5
View File
@@ -1,11 +1,9 @@
/**
* @file
* @author Steve Karg
* @date 2022
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2012
* @brief Defines the bit/byte/word/long conversions that are used in code
* @copyright 2012 Steve Karg <skarg@users.sourceforge.net>
*
* SPDX-License-Identifier: MIT
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_BYTES_H
#define BACNET_SYS_BYTES_H
+4 -7
View File
@@ -1,13 +1,10 @@
/**
* @file
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2022
* @brief computes sRGB to and from from CIE xy and brightness
*
* @section LICENSE
*
* Public domain algorithms from Philips and W3C
*
* @author Steve Karg <skarg@users.sourceforge.net>
* @note Public domain algorithms from Philips and W3C
* @date 2022
* @copyright SPDX-License-Identifier: CC-PDDC
*/
#include <stddef.h>
#include <stdint.h>
+4 -3
View File
@@ -1,11 +1,12 @@
/**
* @file
* @brief API Color sRGB to CIE xy and brightness
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2022
* @brief API Color sRGB to CIE xy and brightness
* @copyright SPDX-License-Identifier: CC-PDDC
*/
#ifndef COLOR_RGB_H
#define COLOR_RGB_H
#ifndef BACNET_SYS_COLOR_RGB_H
#define BACNET_SYS_COLOR_RGB_H
#include <stdint.h>
#include <stdbool.h>
/* BACnet Stack defines - first */
+4 -7
View File
@@ -1,14 +1,11 @@
/**
* @file
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 1997
* @brief computes days from date, days of the week, days in a month,
* days in a year
*
* @section LICENSE
*
* Public domain algorithms from ACM
*
* @note Public domain algorithms from ACM
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 1997
* @copyright SPDX-License-Identifier: CC-PDDC
*/
#include <stdint.h>
#include <stdbool.h>
+2 -1
View File
@@ -1,8 +1,9 @@
/**
* @file
* @brief This file contains the function prototypes for the days calculations
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 1997
* @brief This file contains the function prototypes for the days calculations
* @copyright SPDX-License-Identifier: CC-PDDC
*/
#ifndef DAYS_H
#define DAYS_H
+7 -35
View File
@@ -1,37 +1,10 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2008 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
/**
* @file
* @brief Debug print function
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2008
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
*/
#include <stdint.h> /* for standard integer types uint8_t etc. */
#include <stdbool.h> /* for the standard bool type. */
#include <stdio.h> /* Standard I/O */
@@ -45,7 +18,6 @@
#if DEBUG_PRINTF_WITH_TIMESTAMP
#include "bacnet/datetime.h"
#endif
/** @file debug.c Debug print function */
#if DEBUG_PRINTF_WITH_TIMESTAMP
/**
+9 -26
View File
@@ -1,29 +1,12 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef DEBUG_H
#define DEBUG_H
/**
* @file
* @brief API for debug print function
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2008
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_DEBUG_H
#define BACNET_SYS_DEBUG_H
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
+3 -34
View File
@@ -1,40 +1,9 @@
/**
* @file
* @author Steve Karg
* @date 2004
* @brief Generic interrupt safe FIFO library for deeply embedded system.
*
* @section LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to:
* The Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*
* As a special exception, if other files instantiate templates or
* use macros or inline functions from this file, or you compile
* this file and link it with other works to produce a work based
* on this file, this file does not by itself cause the resulting
* work to be covered by the GNU General Public License. However
* the source code for this file must still be made available in
* accordance with section (3) of the GNU General Public License.
*
* This exception does not invalidate any other reasons why a work
* based on this file might be covered by the GNU General Public
* License.
*
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
* @section DESCRIPTION
*
* Generic interrupt safe FIFO library for deeply embedded system
+7 -6
View File
@@ -1,11 +1,12 @@
/**
* @file
* @author Steve Karg
* @date 2004
* @file
* @brief Generic interrupt safe FIFO library for deeply embedded system.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef FIFO_H
#define FIFO_H
#ifndef BACNET_SYS_FIFO_H
#define BACNET_SYS_FIFO_H
#include <stdint.h>
#include <stdbool.h>
/* BACnet Stack defines - first */
+7 -35
View File
@@ -1,42 +1,14 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2006 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
/**
* @file
* @brief Function for filename manipulation
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2007
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
*/
#include <stdio.h>
#include <string.h>
#include "bacnet/basic/sys/filename.h"
/** @file filename.c Function for filename manipulation */
char *filename_remove_path(const char *filename_in)
{
char *filename_out = (char *)filename_in;
+9 -26
View File
@@ -1,29 +1,12 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef FILENAME_H
#define FILENAME_H
/**
* @file
* @brief API for functions used to manipulate filenames
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2007
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_FILENAME_H
#define BACNET_SYS_FILENAME_H
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
+11 -28
View File
@@ -1,35 +1,18 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef KEY_H
#define KEY_H
/**
* @file
* @brief This file has the macros that encode and decode the unique 32 bit
* keys for the keylist when used with BACnet object types and instances
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_KEY_H
#define BACNET_SYS_KEY_H
#include <stdint.h>
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
/* This file has the macros that encode and decode the */
/* keys for the keylist when used with BACnet Object Id's */
/* key used for BACnet object type and instance */
typedef uint32_t KEY;
/* assuming a 32 bit KEY */
+11 -42
View File
@@ -1,45 +1,14 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2003 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
/** @file keylist.c Keyed Linked List Library */
/* */
/* This is an enhanced array of pointers to data. */
/* The list is sorted, indexed, and keyed. */
/* The array is much faster than a linked list. */
/* It stores a pointer to data, which you must */
/* malloc and free on your own, or just use */
/* static data */
/**
* @file
* @brief Key List library
* @details This is an enhanced array of pointers to data.
* The list is sorted, indexed, and keyed. The array is much faster
* than a linked list. It stores a pointer to data, which you must
* malloc and free on your own, or just use static data.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2003
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
*/
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
+9 -26
View File
@@ -1,29 +1,12 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef KEYLIST_H
#define KEYLIST_H
/**
* @file
* @brief API for a Key List library
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2003
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_KEYLIST_H
#define BACNET_SYS_KEYLIST_H
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
/* BACnet Stack API */
+7 -34
View File
@@ -1,43 +1,16 @@
/**
* @file
* @author Steve Karg
* @date 2011
* @brief Performs linear interpolation using single precision floating
* point math or integer math, or a mixture of both.
*
* @section LICENSE
*
* Copyright (C) 2011 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* @section DESCRIPTION
*
* Performs linear interpolation using single precision floating
* point math or integer math, or a mixture of both.
* Linear interpolation is a method of constructing new data
* points within the range of a discrete set of known data points.
* point math or integer math, or a mixture of both. Linear interpolation
* is a method of constructing new data points within the range of a discrete
* set of known data points.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2011
* @copyright SPDX-License-Identifier: MIT
*/
#include <stdbool.h>
#include <stdint.h>
#include "linear.h"
#include "bacnet/basic/sys/linear.h"
/**
* Linearly Interpolate the values between y1 and y3 based on x.
+5 -3
View File
@@ -1,10 +1,12 @@
/**
* @file
* @author Steve Karg
* @brief API for linear interpolation library
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2011
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef LINEAR_H
#define LINEAR_H
#ifndef BACNET_SYS_LINEAR_H
#define BACNET_SYS_LINEAR_H
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
+5 -7
View File
@@ -1,12 +1,7 @@
/**
* @file
* @author Steve Karg
* @date 2009
* @brief Millisecond timer library header file.
*
* @section DESCRIPTION
*
* The mstimer library provides functions for setting, resetting and
* @details The mstimer library provides functions for setting, resetting and
* restarting timers, and for checking if a timer has expired. An
* application must "manually" check if its timers have expired; this
* is not done automatically.
@@ -14,8 +9,11 @@
* A timer is declared as a \c struct \c mstimer and all access to the
* timer is made by a pointer to the declared timer.
*
* Adapted from the Contiki operating system.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2009
* @note Adapted from the Contiki operating system.
* Original Authors: Adam Dunkels <adam@sics.se>, Nicolas Tsiftes <nvt@sics.se>
* @copyright SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include <stdbool.h>
+5 -17
View File
@@ -1,24 +1,12 @@
/**
* @file
* @author Steve Karg
* @brief API for millisecond timer library
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2009
* @brief Millisecond timer library header file.
*
* @section DESCRIPTION
*
* The mstimer library provides functions for setting, resetting and
* restarting timers, and for checking if a timer has expired. An
* application must "manually" check if its timers have expired; this
* is not done automatically.
*
* A timer is declared as a \c struct \c mstimer and all access to the
* timer is made by a pointer to the declared timer.
*
* Adapted from the Contiki operating system.
* Original Authors: Adam Dunkels <adam@sics.se>, Nicolas Tsiftes <nvt@sics.se>
* @copyright SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef MSTIMER_H_
#define MSTIMER_H_
#ifndef BACNET_SYS_MSTIMER_H_
#define BACNET_SYS_MSTIMER_H_
/* BACnet Stack defines - first */
#include "bacnet/bacdef.h"
+3 -9
View File
@@ -1,17 +1,11 @@
/**
* @file
* @author Steve Karg
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2022
* @brief Platform libc and compiler abstraction layer
*
* @section DESCRIPTION
*
* This libc and compiler abstraction layer assists with differences
* @details This libc and compiler abstraction layer assists with differences
* between compiler and libc versions, capabilities, and C standards.
*
* @copyright 2022 Steve Karg <skarg@users.sourceforge.net>
*
* SPDX-License-Identifier: MIT
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_PLATFORM_H
#define BACNET_SYS_PLATFORM_H
+8 -45
View File
@@ -1,51 +1,14 @@
/**
* @file
* @author Steve Karg
* @date 2004
* @brief Generic ring buffer library for deeply embedded system.
*
* @section LICENSE
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to:
* The Free Software Foundation, Inc.
* 59 Temple Place - Suite 330
* Boston, MA 02111-1307
* USA.
*
* As a special exception, if other files instantiate templates or
* use macros or inline functions from this file, or you compile
* this file and link it with other works to produce a work based
* on this file, this file does not by itself cause the resulting
* work to be covered by the GNU General Public License. However
* the source code for this file must still be made available in
* accordance with section (3) of the GNU General Public License.
*
* This exception does not invalidate any other reasons why a work
* based on this file might be covered by the GNU General Public
* License.
*
* @section DESCRIPTION
*
* Generic ring buffer library for deeply embedded system.
* It uses a data store whose size is a power of 2 (8, 16, 32, 64, ...)
* and doesn't waste any data bytes. It has very low overhead, and
* utilizes modulo for indexing the data in the data store.
* It uses separate variables for consumer and producer so it can
* be used in multithreaded environment.
*
* See the unit tests for usage examples.
*
* @details Generic ring buffer library that uses a data store whose size
* is a power of 2 (8, 16, 32, 64, ...) and doesn't waste any data bytes.
* It has very low overhead, and utilizes modulo for indexing the data
* in the data store. The ring buffer uses separate variables for
* consumer and producer so it can be used in multithreaded environment.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
*/
#include <stddef.h>
#include <stdbool.h>
+6 -7
View File
@@ -1,11 +1,10 @@
/**
* @file
* @author Steve Karg
* @date 2004
*
* Generic ring buffer library for deeply embedded system.
* See the unit tests for usage examples.
*/
* @file
* @brief API for a ring buffer library for deeply embedded system.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2004
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef RINGBUF_H
#define RINGBUF_H
+8 -40
View File
@@ -1,46 +1,14 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2005 by Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307
USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
/** @file sbuf.c Static buffer library for deeply embedded system. */
/* Functional Description: Static buffer library for deeply
embedded system. See the unit tests for usage examples. */
/**
* @file
* @brief Static buffer library for deeply embedded system.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2005
* @copyright SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0
*/
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "sbuf.h"
#include "bacnet/basic/sys/sbuf.h"
void sbuf_init(STATIC_BUFFER *b, /* static buffer structure */
char *data, /* data block */
+9 -29
View File
@@ -1,32 +1,12 @@
/**************************************************************************
*
* Copyright (C) 2012 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*********************************************************************/
#ifndef SBUF_H
#define SBUF_H
/* Functional Description: Static buffer library for deeply
embedded system. See the unit tests for usage examples. */
/**
* @file
* @brief API for a static buffer library for deeply embedded system.
* @author Steve Karg <skarg@users.sourceforge.net>
* @date 2005
* @copyright SPDX-License-Identifier: MIT
*/
#ifndef BACNET_SYS_SBUF_H
#define BACNET_SYS_SBUF_H
#include <stdint.h>
#include <stdbool.h>
/* BACnet Stack defines - first */