Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
merge trim.h into str.h, where it belongs to
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 16 Apr 2007 15:56:10 +0000 (15:56 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 16 Apr 2007 15:56:10 +0000 (15:56 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3424 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/str.h
include/xbt/trim.h [deleted file]
src/xbt/trim.c
tools/tesh/tesh.c

index 6a9bccf..6068247 100644 (file)
@@ -2,7 +2,7 @@
 
 /* str.h - XBT string related functions.                                    */
 
 
 /* str.h - XBT string related functions.                                    */
 
-/* Copyright (c) 2004-7, Martin Quinson and Arnaud Legrand.                 */
+/* Copyright (c) 2004-7, Martin Quinson, Arnaud Legrand and  Cherier Malek. */
 /* All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 /* All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -29,6 +29,11 @@ XBT_PUBLIC(char*) bprintf   (const char*fmt, ...) _XBT_GNUC_PRINTF(1,2);
 XBT_PUBLIC(long) getline(char **lineptr, size_t *n, FILE *stream);
 #endif
 
 XBT_PUBLIC(long) getline(char **lineptr, size_t *n, FILE *stream);
 #endif
 
+/* Trim related functions */
+XBT_PUBLIC(char*) rtrim(char* s, const char* char_list);
+XBT_PUBLIC(char*) ltrim( char* s, const char* char_list);
+XBT_PUBLIC(char*) trim(char* s, const char* char_list);
+
 SG_END_DECL()
 
 #endif /* XBT_STR_H */
 SG_END_DECL()
 
 #endif /* XBT_STR_H */
diff --git a/include/xbt/trim.h b/include/xbt/trim.h
deleted file mode 100644 (file)
index e6f4ca5..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* xbt/trim.h -- Declarations of the functions ltrim(), rtrim() and trim()     */
-
-/* Copyright (c) 2007 Cherier Malek. All rights reserved.                                      */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-
-#ifndef XBT_TRIM_H
-#define XBT_TRIM_H
-
-#include "xbt/misc.h"
-
-SG_BEGIN_DECL()
-
-/**  @brief Strip whitespace (or other characters) from the end of a string.
- *
- * The function rtrim() returns a string with whitespace stripped from the end of s. 
- * By default (without the second parameter char_list), rtrim() will strip these characters :
- *     
- *     - " "           (ASCII 32       (0x20)) space. 
- *     - "\t"          (ASCII 9        (0x09)) tab. 
- *     - "\n"          (ASCII 10       (0x0A)) line feed. 
- *     - "\r"          (ASCII 13       (0x0D)) carriage return. 
- *     - "\0"          (ASCII 0        (0x00)) NULL. 
- *     - "\x0B"        (ASCII 11       (0x0B)) vertical tab. 
- *
- * @param s The string to strip.
- * @param char_list A string which contains the characters you want to strip.
- *
- * @return If the specified is NULL the function returns NULL. Otherwise the
- * function returns the string with whitespace stripped from the end.
- */
-XBT_PUBLIC(char*)
-rtrim(char* s, const char* char_list);
-
-/**  @brief Strip whitespace (or other characters) from the beginning of a string.
- *
- * The function ltrim() returns a string with whitespace stripped from the beginning of s. 
- * By default (without the second parameter char_list), ltrim() will strip these characters :
- *     
- *     - " "           (ASCII 32       (0x20)) space. 
- *     - "\t"          (ASCII 9        (0x09)) tab. 
- *     - "\n"          (ASCII 10       (0x0A)) line feed. 
- *     - "\r"          (ASCII 13       (0x0D)) carriage return. 
- *     - "\0"          (ASCII 0        (0x00)) NULL. 
- *     - "\x0B"        (ASCII 11       (0x0B)) vertical tab. 
- *
- * @param s The string to strip.
- * @param char_list A string which contains the characters you want to strip.
- *
- * @return If the specified is NULL the function returns NULL. Otherwise the
- * function returns the string with whitespace stripped from the beginning.
- */
-XBT_PUBLIC(char*)
-ltrim( char* s, const char* char_list);
-
-
-/**  @brief Strip whitespace (or other characters) from the end and the begining of a string.
- *
- * The function trim() returns a string with whitespace stripped from the end and the begining of s. 
- * By default (without the second parameter char_list), trim() will strip these characters :
- *     
- *     - " "           (ASCII 32       (0x20)) space. 
- *     - "\t"          (ASCII 9        (0x09)) tab. 
- *     - "\n"          (ASCII 10       (0x0A)) line feed. 
- *     - "\r"          (ASCII 13       (0x0D)) carriage return. 
- *     - "\0"          (ASCII 0        (0x00)) NULL. 
- *     - "\x0B"        (ASCII 11       (0x0B)) vertical tab. 
- *
- * @param s The string to strip.
- * @param char_list A string which contains the characters you want to strip.
- *
- * @return If the specified is NULL the function returns NULL. Otherwise the
- * function returns the string with whitespace stripped from the end and the begining.
- */
-XBT_PUBLIC(char*) 
-trim(char* s, const char* char_list);
-
-SG_END_DECL()
-
-#endif /* !XBT_TRIM_H */
index 48f185c..f259b6a 100644 (file)
@@ -11,7 +11,7 @@
   
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
   
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
-#include "xbt/trim.h" /* headers of these functions */
+#include "xbt/str.h" /* headers of these functions */
 #include "portable.h"
 
 /**  @brief Strip whitespace (or other characters) from the end of a string.
 #include "portable.h"
 
 /**  @brief Strip whitespace (or other characters) from the end of a string.
index 3703b4b..abbaf22 100644 (file)
@@ -17,7 +17,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/function_types.h"
 #include "xbt/log.h"
 #include "xbt/sysdep.h"
 #include "xbt/function_types.h"
 #include "xbt/log.h"
-#include "xbt/trim.h"
+#include "xbt/str.h"
 
 #include <sys/types.h>
 #include <sys/wait.h>
 
 #include <sys/types.h>
 #include <sys/wait.h>