Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill several unused functions in xbt
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 24 Feb 2016 07:13:02 +0000 (08:13 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 24 Feb 2016 07:13:02 +0000 (08:13 +0100)
include/xbt/str.h
include/xbt/virtu.h
src/xbt/xbt_sha.c
src/xbt/xbt_str.c
src/xbt/xbt_virtu.c

index b90f86b..8ba1010 100644 (file)
@@ -50,13 +50,10 @@ XBT_PUBLIC(void) xbt_str_subst(char *str, char from, char to, int amount);
 XBT_PUBLIC(char *) xbt_str_varsubst(const char *str, xbt_dict_t patterns);
 
 /* */
-XBT_PUBLIC(void) xbt_str_strip_spaces(char *);
 XBT_PUBLIC(char *) xbt_str_diff(const char *a, const char *b);
 
 XBT_PUBLIC(char *) xbt_str_from_file(FILE * file);
 
-XBT_PUBLIC(int) xbt_str_start_with(const char* str, const char* start);
-
 XBT_PUBLIC(long int) xbt_str_parse_int(const char* str, const char* error_msg);
 XBT_PUBLIC(double) xbt_str_parse_double(const char* str, const char* error_msg);
 
index 3b0a63e..2f140fe 100644 (file)
@@ -25,13 +25,5 @@ XBT_PUBLIC_DATA(char*) xbt_binary_name;
 /** Contains all the parameters we got from the command line (including argv[0]) */
 XBT_PUBLIC_DATA(xbt_dynar_t) xbt_cmdline;
 
-/**
- *
- * Time management functions, returns the system time or sleeps a process.
- */
-XBT_PUBLIC(double) xbt_time(void);
-XBT_PUBLIC(void) xbt_sleep(double sec);
-
-
 SG_END_DECL()
 #endif                          /* __XBT_VIRTU_H__ */
index baa24c3..aa3dd12 100644 (file)
@@ -32,11 +32,8 @@ static void sha_calculate(xbt_sha_t sha);
 /** @brief constructor */
 xbt_sha_t xbt_sha_new(void)
 {
-  xbt_sha_t sha;
-
-  sha = xbt_new(s_xbt_sha_t, 1);
+  xbt_sha_t sha = xbt_new(s_xbt_sha_t, 1);
   xbt_sha_reset(sha);
-
   return sha;
 }
 
index cee4235..fb1a0af 100644 (file)
@@ -124,50 +124,6 @@ void xbt_str_trim(char *s, const char *char_list)
   xbt_str_ltrim(s, char_list);
 }
 
-/**  @brief Replace double whitespaces (but no other characters) from the string.
- *
- * The function modifies the string so that each time that several spaces appear,
- * they are replaced by a single space. It will only do so for spaces (ASCII 32, 0x20).
- *
- * @param s The string to strip. Modified in place.
- *
- */
-void xbt_str_strip_spaces(char *s)
-{
-  char *p = s;
-  int e = 0;
-
-  if (!s)
-    return;
-
-  while (1) {
-    if (!*p)
-      goto end;
-
-    if (*p != ' ')
-      break;
-
-    p++;
-  }
-
-  e = 1;
-
-  do {
-    if (e)
-      *s++ = *p;
-
-    if (!*++p)
-      goto end;
-
-    if (e ^ (*p != ' '))
-      if ((e = !e))
-        *s++ = ' ';
-  } while (1);
-
-end:
-  *s = '\0';
-}
-
 /** @brief Substitutes a char for another in a string
  *
  * @param str the string to modify
@@ -852,28 +808,6 @@ char *xbt_str_from_file(FILE * file)
   return res;
 }
 
-/* @brief Retrun 1 if string 'str' starts with string 'start'
- *
- * \param str a string
- * \param start the string to search in str
- *
- * \return 1 if 'str' starts with 'start'
- */
-int xbt_str_start_with(const char* str, const char* start)
-{
-  unsigned int i;
-  size_t l_str = strlen(str);
-  size_t l_start = strlen(start);
-
-  if(l_start > l_str) return 0;
-
-  for(i = 0; i< l_start; i++){
-    if(str[i] != start[i]) return 0;
-  }
-
-  return 1;
-}
-
 /** @brief Parse an integer out of a string, or raise an error
  *
  * The #str is passed as argument to your #error_msg, as follows:
index a046cfa..2d44621 100644 (file)
@@ -18,23 +18,6 @@ static int xbt_fake_pid(void)
 
 int_f_void_t xbt_getpid = xbt_fake_pid;
 
-/*
- * Time elapsed since the beginning of the simulation.
- */
-double xbt_time()
-{
-  /* FIXME: check if we should use the request mechanism or not */
-  return SIMIX_get_clock();
-}
-
-/*
- * Freeze the process for the specified amount of time
- */
-void xbt_sleep(double sec)
-{
-  simcall_process_sleep(sec);
-}
-
 const char *xbt_procname(void)
 {
   return SIMIX_process_self_get_name();