[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Added a module stringops that provides STREQ and STRNEQ
From: |
Kieran Colford |
Subject: |
[PATCH] Added a module stringops that provides STREQ and STRNEQ |
Date: |
Wed, 21 May 2014 23:33:59 -0400 |
---
lib/stringops.h | 31 +++++++++++++++++++++++++++++++
modules/stringops | 22 ++++++++++++++++++++++
2 files changed, 53 insertions(+)
create mode 100644 lib/stringops.h
create mode 100644 modules/stringops
diff --git a/lib/stringops.h b/lib/stringops.h
new file mode 100644
index 0000000..459889c
--- /dev/null
+++ b/lib/stringops.h
@@ -0,0 +1,31 @@
+/* Compile-time assert-like macros.
+
+ Copyright (C) 2014 Free Software Foundation, Inc.
+
+ 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Kieran Colford. */
+
+#ifndef _GL_STRINGOPS_H
+#define _GL_STRINGOPS_H
+
+#include <string.h>
+
+/* Test if the strings X and Y are equal. */
+#define STREQ(X, Y) (strcmp (X, Y) == 0)
+
+/* Test if the strings X and Y are not equal. */
+#define STRNEQ(X, Y) (strcmp (X, Y) != 0)
+
+#endif
diff --git a/modules/stringops b/modules/stringops
new file mode 100644
index 0000000..735a7be
--- /dev/null
+++ b/modules/stringops
@@ -0,0 +1,22 @@
+Description:
+Add the macros STREQ and STRNEQ. This adds the functionality that is
+looked for by sc_prohibit_strcmp from the maintainer-makefile.
+
+Files:
+lib/stringops.h
+
+Depends-on:
+string
+
+configure.ac:
+
+Makefile.am:
+
+Include:
+"stringops.h"
+
+License:
+LGPLv2+
+
+Maintainer:
+Kieran Colford
--
1.7.9.5
- [PATCH] Added a module stringops that provides STREQ and STRNEQ,
Kieran Colford <=
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Paul Eggert, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Eric Blake, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Kieran Colford, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Paul Eggert, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Kieran Colford, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Jim Meyering, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Paul Eggert, 2014/05/22
- Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Jim Meyering, 2014/05/23
Re: [PATCH] Added a module stringops that provides STREQ and STRNEQ, Eric Blake, 2014/05/22