XBT
- Replay: New function xbt_replay_action_get():
Retrieve the function previously associated to an event type.
- - Drop unused functions: xbt_str_varsubst(), xbt_strbuff_varsubst()
+ - DROPPED FUNCTION: xbt_str_varsubst()
+ - DROPPED MODULE: strbuff. We don't need it anymore.
-- Release target: June 21 2017 -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
--- a/tools/cmake/UnitTesting.cmake
+++ b/tools/cmake/UnitTesting.cmake
@@ -11,6 +11,7 @@ set(FILES_CONTAINING_UNITTESTS
- src/xbt/xbt_strbuff.c
src/xbt/xbt_sha.c
src/xbt/config.c
+ src/xbt/plouf.c
- \ref XBT_dict
- \ref XBT_swag
- \ref XBT_heap
- - @ref xbt_strbuff
- \ref XBT_misc
- \ref XBT_graph
#include <xbt/log.h>
#include <xbt/module.h>
-#include <xbt/strbuff.h>
#include <xbt/dynar.h>
#include <xbt/dict.h>
+++ /dev/null
-/* strbuff -- string buffers */
-
-/* Copyright (c) 2007-2011, 2013-2014. The SimGrid Team.
- * 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_STRBUFF_H
-#define XBT_STRBUFF_H
-
-#include "xbt/sysdep.h"
-#include "xbt/function_types.h"
-#include "xbt/log.h"
-#include "xbt/str.h"
-#include "xbt/dict.h"
-
-SG_BEGIN_DECL()
-
-/** @defgroup xbt_strbuff String buffers
- * @ingroup XBT_adt
- *
- * This data container is very similar to the Java StringBuffer:
- * that's a string to which you can add content with a lesser performance
- * penalty than if you recreate a new string from scratch. Once done building
- * your string, you must retrieve the content and free its container.
- *
- * @{
- */
-
-/** @brief Buffer data container **/
-typedef struct xbt_strbuff {
- char *data;
- int used;
- int size;
-} s_xbt_strbuff_t;
-typedef s_xbt_strbuff_t* xbt_strbuff_t;
-
-XBT_PUBLIC(void) xbt_strbuff_clear(xbt_strbuff_t b);
-XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new(void);
-XBT_PUBLIC(xbt_strbuff_t) xbt_strbuff_new_from(const char *s);
-XBT_PUBLIC(void) xbt_strbuff_free(xbt_strbuff_t b);
-XBT_PUBLIC(void) xbt_strbuff_free_container(xbt_strbuff_t b);
-XBT_PUBLIC(void) xbt_strbuff_append(xbt_strbuff_t b, const char *toadd);
-XBT_PUBLIC(void) xbt_strbuff_printf(xbt_strbuff_t b, const char *fmt, ...);
-XBT_PUBLIC(void) xbt_strbuff_chomp(xbt_strbuff_t b);
-XBT_PUBLIC(void) xbt_strbuff_trim(xbt_strbuff_t b);
-
-/** @} */
-SG_END_DECL()
-#endif
#include "xbt/sysdep.h"
#include "xbt/log.h"
-#include "xbt/strbuff.h"
#include "xbt/mallocator.h"
#include "maxmin_private.hpp"
#include <stdlib.h>
XBT_LOG_CONNECT(log);
XBT_LOG_CONNECT(module);
XBT_LOG_CONNECT(replay);
- XBT_LOG_CONNECT(strbuff);
XBT_LOG_CONNECT(xbt_cfg);
XBT_LOG_CONNECT(xbt_dict);
XBT_LOG_CONNECT(xbt_dict_cursor);
#include "src/internal_config.h" /* execinfo when available */
#include "xbt/sysdep.h"
-#include "xbt/strbuff.h"
#include "src/xbt/log_private.h"
#include "simgrid/simix.h" /* SIMIX_host_self_get_name */
#include "surf/surf.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
-#include "xbt/strbuff.h" /* For dynamic version when the static one fails */
#include "src/xbt/log_private.h"
#include "simgrid/simix.h" /* SIMIX_host_self_get_name */
#include "xbt/misc.h"
#include "xbt/sysdep.h"
#include "xbt/str.h" /* headers of these functions */
-#include "xbt/strbuff.h"
/** @brief Strip whitespace (or other characters) from the end of a string.
*
+++ /dev/null
-/* strbuff -- string buffers */
-
-/* Copyright (c) 2007-2015. The SimGrid Team.
- * 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. */
-
-#include "xbt/strbuff.h"
-#include <stdarg.h>
-
-#define minimal_increment 512
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(strbuff, xbt, "String buffers");
-
-/** @brief Remove any content from the buffer */
-inline void xbt_strbuff_clear(xbt_strbuff_t b)
-{
- b->used = 0;
- b->data[0] = '\0';
-}
-
-/** @brief Constructor */
-xbt_strbuff_t xbt_strbuff_new(void)
-{
- xbt_strbuff_t res = xbt_malloc(sizeof(s_xbt_strbuff_t));
- res->data = xbt_malloc(512);
- res->size = 512;
- xbt_strbuff_clear(res);
- return res;
-}
-
-/** @brief creates a new string buffer containing the provided string
- *
- * Beware, the ctn is copied, you want to free it afterward, anyhow
- */
-inline xbt_strbuff_t xbt_strbuff_new_from(const char *ctn)
-{
- xbt_strbuff_t res = xbt_malloc(sizeof(s_xbt_strbuff_t));
- res->data = xbt_strdup(ctn);
- res->size = strlen(ctn);
- res->used = res->size;
- return res;
-}
-
-/** @brief frees only the container without touching to the contained string */
-inline void xbt_strbuff_free_container(xbt_strbuff_t b)
-{
- free(b);
-}
-
-/** @brief frees the buffer and its content */
-inline void xbt_strbuff_free(xbt_strbuff_t b)
-{
- if (b) {
- free(b->data);
- free(b);
- }
-}
-
-/** @brief Adds some content at the end of the buffer */
-void xbt_strbuff_append(xbt_strbuff_t b, const char *toadd)
-{
- int addlen;
- int needed_space;
-
- xbt_assert(b, "Asked to append stuff to NULL buffer");
-
- addlen = strlen(toadd);
- needed_space = b->used + addlen + 1;
-
- if (needed_space > b->size) {
- b->size = MAX(minimal_increment + b->used, needed_space);
- b->data = xbt_realloc(b->data, b->size);
- }
- strncpy(b->data + b->used, toadd, b->size-b->used);
- b->used += addlen;
-}
-
-/** @brief format some content and push it at the end of the buffer */
-void xbt_strbuff_printf(xbt_strbuff_t b, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- char *data = bvprintf(fmt, ap);
- xbt_strbuff_append(b, data);
- xbt_free(data);
- va_end(ap);
-}
src/xbt/xbt_os_time.c
src/xbt/xbt_replay.cpp
src/xbt/xbt_str.cpp
- src/xbt/xbt_strbuff.c
src/xbt/xbt_virtu.c
src/xbt_modinter.h
)
include/xbt/range.hpp
include/xbt/replay.hpp
include/xbt/str.h
- include/xbt/strbuff.h
include/xbt/swag.h
include/xbt/synchro.h
include/xbt/sysdep.h
COMMAND ${CMAKE_COMMAND} -E remove -f src/simgrid_units_main.c
COMMAND ${CMAKE_COMMAND} -E remove -f src/swag_unit.c
COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_str_unit.c
- COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_strbuff_unit.c
COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_synchro_unit.c
WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}")
src/xbt/xbt_log_layout_format.c src/xbt/xbt_log_layout_simple.c
src/xbt/dict.cpp src/xbt/dict_elm.c src/xbt/dict_cursor.c
src/xbt/dynar.cpp src/xbt/heap.c src/xbt/swag.c
- src/xbt/str.c src/xbt/strbuff.c src/xbt/snprintf.c
+ src/xbt/str.c src src/xbt/snprintf.c
src/xbt/queue.c
src/xbt/xbt_os_time.c src/xbt/xbt_os_thread.c
src/xbt/backtrace_linux.c
smx
src
std
-strbuff
strerror
strlen
struct