- GNUNET_asprintf (dest, "%s", src);
- GNUNET_free (src);
-}
-
-
-/**
- * Extracts the plugin anme from an absolute file name and the test name
- * @param file absolute file name
- * @param test test name
- * @param dest where to store result
- */
-void
-GNUNET_TRANSPORT_TESTING_get_test_plugin_name (const char *file,
- const char *test, char **dest)
-{
- char *e = extract_filename (file);
- char *t = extract_filename (test);
-
- char *filename = NULL;
- char *dotexe;
-
- if (e == NULL)
- goto fail;
-
- /* remove "lt-" */
- filename = strstr (e, "tes");
- if (filename == NULL)
- goto fail;
-
- /* remove ".exe" */
- if (NULL != (dotexe = strstr (filename, ".exe")))
- dotexe[0] = '\0';
-
- /* find last _ */
- filename = strstr (filename, t);
- if (filename == NULL)
- goto fail;
-
- /* copy plugin */
- filename += strlen (t);
- filename++;
- GNUNET_asprintf (dest, "%s", filename);
- goto suc;
-
-fail:
- (*dest) = NULL;
-suc:
- GNUNET_free (t);
- GNUNET_free (e);
-
-}
-
-/**
- * This function takes the filename (e.g. argv[0), removes a "lt-"-prefix and
- * if existing ".exe"-prefix and adds the peer-number
- * @param file filename of the test, e.g. argv[0]
- * @param cfgname where to write the result
- * @param count peer number
- */
-void
-GNUNET_TRANSPORT_TESTING_get_config_name (const char *file, char **dest,
- int count)
-{
- char *filename = extract_filename (file);
- char *backup = filename;
- char *dotexe;
-
- if (filename == NULL)
- goto fail;
-
- /* remove "lt-" */
- filename = strstr (filename, "tes");
- if (filename == NULL)
- goto fail;
-
- /* remove ".exe" */
- if (NULL != (dotexe = strstr (filename, ".exe")))
- dotexe[0] = '\0';
-
- goto suc;
-
-fail:
- (*dest) = NULL;
- return;
-
-suc:
- /* create cfg filename */
- GNUNET_asprintf (dest, "%s_peer%u.conf", filename, count);
- GNUNET_free (backup);