summaryrefslogtreecommitdiff
path: root/src/common/extstr.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-04-29 17:13:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-04-29 17:13:36 (GMT)
commite2f87e6e92a361cdd66b6867f51dda2abb1ed1b3 (patch)
tree2c3b5473c6042f64c145eb25cf923be8935ae793 /src/common/extstr.c
parent1e9b23fb37755fef5992f65cb9862fab271e13d9 (diff)
Saved the current work on the overjump plugin.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@61 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/common/extstr.c')
-rw-r--r--src/common/extstr.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/common/extstr.c b/src/common/extstr.c
index deffbd4..5187567 100644
--- a/src/common/extstr.c
+++ b/src/common/extstr.c
@@ -88,6 +88,38 @@ char *strprep(char *str1, const char *str2)
/******************************************************************************
* *
+* Paramètres : str1 = chaîne de caractères à analyser. *
+* str2 = chaîne de caractères à retrouver. *
+* *
+* Description : Compare deux chaînes de caractères en partant de la fin. *
+* *
+* Retour : -1, 0, ou 1 selon la comparaison. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+int strrcmp(const char *str1, const char *str2)
+{
+ int result; /* Bilan à renvoyer */
+ size_t len1; /* Longueur de la chaîne donnée*/
+ size_t len2; /* Longueur de la chaîne visée */
+
+ len1 = strlen(str1);
+ len2 = strlen(str2);
+
+ if (len1 <= len2)
+ result = strcmp(str1, str2);
+
+ else result = strcmp(&str1[len1 - len2], str2);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : input = chaîne de caractères à traiter. *
* *
* Description : S'assure qu'une chaîne de caractère tient sur une ligne. *