* evil_string.c : add strrstr() win32 port
authorVincent Torri <vincent.torri@gmail.com>
Sun, 6 Dec 2009 19:22:20 +0000 (19:22 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Sun, 6 Dec 2009 19:22:20 +0000 (19:22 +0000)
 * include config.h where it is not included
 * various minor formatting

SVN revision: 44228

13 files changed:
legacy/evil/ChangeLog
legacy/evil/src/bin/evil_suite.c
legacy/evil/src/bin/evil_test_memcpy.c
legacy/evil/src/lib/evil_fnmatch.c
legacy/evil/src/lib/evil_fnmatch_list_of_states.c
legacy/evil/src/lib/evil_langinfo.c
legacy/evil/src/lib/evil_main.c
legacy/evil/src/lib/evil_pwd.c
legacy/evil/src/lib/evil_stdio.c
legacy/evil/src/lib/evil_stdlib.c
legacy/evil/src/lib/evil_string.c
legacy/evil/src/lib/evil_string.h
legacy/evil/src/lib/evil_unistd.c

index 710c458..6d902aa 100644 (file)
@@ -1,3 +1,13 @@
+2009-12-06  Vincent Torri  <doursse at users dot sf dot net>
+
+       * src/lib/evil_string.c:
+       add strrstr() function.
+
+       * src/bin/evil_suite.c:
+       * src/lib/evil_fnmatch.c:
+       * src/lib/evil_fnmatch_list_of_states.c:
+       include config.h
+
 2009-10-08  Vincent Torri  <doursse at users dot sf dot net>
 
        * src/lib/evil_main.c:
index f9e62e0..190362e 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <stdlib.h>
 #include <stdio.h>
 
index 9dca042..0adfe37 100644 (file)
@@ -1,3 +1,6 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -6,10 +9,6 @@
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif /* HAVE_CONFIG_H */
-
 #include "evil_suite.h"
 #include "evil_test_memcpy.h"
 
index 000b646..649cc19 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #if defined (_MSC_VER) || defined (__MINGW32__) || defined (__MINGW32CE__)
 
 #include <assert.h>
index a9e1f41..3ccf7b3 100644 (file)
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #if defined (_MSC_VER) || defined (__MINGW32__) || defined (__MINGW32CE__)
 
 #include <assert.h>
index 68cf0d6..7554b10 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
index 03059bb..77fe75e 100644 (file)
@@ -2,7 +2,6 @@
 # include <config.h>
 #endif
 
-
 # define WIN32_LEAN_AND_MEAN
 # include <winsock2.h>
 # undef WIN32_LEAN_AND_MEAN
index 56eaae9..859e1cb 100644 (file)
@@ -1,5 +1,3 @@
-
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
index 59c8752..78ddc17 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
index 06b1ecd..325763b 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
index 0b74f1c..c9b2933 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */
@@ -74,4 +73,17 @@ strcoll (const char *s1, const char *s2)
 #endif /* ! UNICODE */
 }
 
+
 #endif /* _WIN32_WCE */
+
+char *
+strrstr (const char *str, const char *substr)
+{
+  char *it;
+  char *ret = NULL;
+
+  while ((it = strstr(str, substr)))
+    ret = it;
+
+  return ret;
+}
index 806af3a..e217d02 100644 (file)
@@ -90,6 +90,23 @@ EAPI int strcoll (const char *s1, const char *s2);
 
 #endif /* _WIN32_WCE */
 
+/**
+ * @brief get the last substring occurence.
+ *
+ * @param str The string to search from.
+ * @param substr The substring to search.
+ * @return The last occurrence of the substring if found, @c NULL otherwise.
+ *
+ * This function retrieves the last occurrence of @p substring in the
+ * string @p str. If @p str or @p substr are @c NULL, of if @p substr
+ * is not found in @p str, @c NULL is returned.
+ *
+ * Conformity: Non applicable.
+ *
+ * Supported OS: Windows XP, Windows CE.
+ */
+EAPI char *strrstr (const char *str, const char *substr);
+
 
 /**
  * @}
index 6628137..e22dfab 100644 (file)
@@ -1,4 +1,3 @@
-
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif /* HAVE_CONFIG_H */