Module Name: othersrc
Committed By: agc
Date: Wed Feb 22 01:20:52 UTC 2023
Modified Files:
othersrc/external/bsd/elex/dist: striter.c striter.h
Log Message:
Commit elex string iterator changes missed in previous commit:
+ move to a more extensible embedded library namespace protection
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/elex/dist/striter.c \
othersrc/external/bsd/elex/dist/striter.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/external/bsd/elex/dist/striter.c
diff -u othersrc/external/bsd/elex/dist/striter.c:1.1 othersrc/external/bsd/elex/dist/striter.c:1.2
--- othersrc/external/bsd/elex/dist/striter.c:1.1 Thu Dec 9 04:15:26 2021
+++ othersrc/external/bsd/elex/dist/striter.c Wed Feb 22 01:20:52 2023
@@ -33,6 +33,7 @@
#include <string.h>
#include <unistd.h>
+#define LIB_NAMESPACE elex_
#include "striter.h"
/* a string iterator structure */
@@ -102,14 +103,14 @@ addtext(striter_t *str, const char *s, u
/*********************************************************************/
/* make a new string */
-STRITER_EXPORT striter_t *
+striter_t *
striter_new(void)
{
return calloc(1, sizeof(striter_t));
}
/* dispose of string */
-STRITER_EXPORT int
+int
striter_dispose(striter_t **str)
{
if (str && *str) {
@@ -122,7 +123,7 @@ striter_dispose(striter_t **str)
}
/* command with integer return */
-STRITER_EXPORT int
+int
striter_exec(striter_t *str, const char *info, const char *s, uint64_t n)
{
if (str == NULL || info == NULL) {
@@ -136,7 +137,7 @@ striter_exec(striter_t *str, const char
}
/* command with char string return */
-STRITER_EXPORT char *
+char *
striter_exec_mem(striter_t *str, const char *info, size_t *size)
{
if (str == NULL || info == NULL || size == NULL) {
Index: othersrc/external/bsd/elex/dist/striter.h
diff -u othersrc/external/bsd/elex/dist/striter.h:1.1 othersrc/external/bsd/elex/dist/striter.h:1.2
--- othersrc/external/bsd/elex/dist/striter.h:1.1 Thu Dec 9 04:15:26 2021
+++ othersrc/external/bsd/elex/dist/striter.h Wed Feb 22 01:20:52 2023
@@ -23,42 +23,22 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STRITER_H_
-#define STRITER_H_ 20211121
+#define STRITER_H_ 20230222
#include <inttypes.h>
-struct striter_t;
-typedef struct striter_t striter_t;
-
-#ifndef USE_VISIBILITY
-# if defined(__GNUC__)
-# if __GNUC__ >= 4
-# define USE_VISIBILITY 1
-# else
-# define USE_VISIBILITY 0
-# endif
-# else
-# define USE_VISIBILITY 0
-# endif
-#endif
-
-#if USE_VISIBILITY
-# define DLL_PUBLIC __attribute__ ((visibility ("default")))
-# define DLL_LOCAL __attribute__ ((visibility ("hidden")))
-#else
-# define DLL_PUBLIC
-# define DLL_LOCAL
-#endif
-
-#ifndef HIDE_STRITER
-#define HIDE_STRITER 0
+#ifdef LIB_NAMESPACE
+#define SI_CONCAT(x, y) x##y
+#define SI_NAMESPACE(x, y) SI_CONCAT(x, y)
+#define striter_t SI_NAMESPACE(LIB_NAMESPACE, striter_t)
+#define striter_new SI_NAMESPACE(LIB_NAMESPACE, striter_new)
+#define striter_dispose SI_NAMESPACE(LIB_NAMESPACE, striter_dispose)
+#define striter_exec SI_NAMESPACE(LIB_NAMESPACE, striter_exec)
+#define striter_exec_mem SI_NAMESPACE(LIB_NAMESPACE, striter_exec_mem)
#endif
-#if HIDE_STRITER
-#define STRITER_EXPORT DLL_LOCAL
-#else
-#define STRITER_EXPORT DLL_PUBLIC
-#endif
+struct striter_t;
+typedef struct striter_t striter_t;
#ifndef __BEGIN_DECLS
# if defined(__cplusplus)
@@ -72,10 +52,10 @@ typedef struct striter_t striter_t;
__BEGIN_DECLS
-STRITER_EXPORT striter_t *striter_new(void);
-STRITER_EXPORT int striter_dispose(striter_t **/*str*/);
-STRITER_EXPORT int striter_exec(striter_t */*str*/, const char */*info*/, const char */*s*/, uint64_t /*n*/);
-STRITER_EXPORT char *striter_exec_mem(striter_t */*str*/, const char */*info*/, size_t */*size*/);
+striter_t *striter_new(void);
+int striter_dispose(striter_t **/*str*/);
+int striter_exec(striter_t */*str*/, const char */*info*/, const char */*s*/, uint64_t /*n*/);
+char *striter_exec_mem(striter_t */*str*/, const char */*info*/, size_t */*size*/);
__END_DECLS