summaryrefslogtreecommitdiff
path: root/src/base/my_path.c
diff options
context:
space:
mode:
authorTomas Chvatal <scarabeus@gentoo.org>2009-04-16 01:04:20 +0200
committerTomas Chvatal <scarabeus@gentoo.org>2009-04-16 01:04:20 +0200
commitd902c78327acdc5ec4a35119be2eb92399fdb43d (patch)
treebeb666312726f0d3762e5b6aea2d1022265f040e /src/base/my_path.c
parent75e3e2c04b1d2b324dc8d2314e570bcba215c93f (diff)
Revert "new path API ( need old path.h )"
This reverts commit 75e3e2c04b1d2b324dc8d2314e570bcba215c93f. -- CZECH SECTION -- Dusane kdyz rikam ze to ma podporovat PREDEFINOVANI pomoci cmake promennejch jako to delalo tak to neznamena ze danou cast kodu proste odstranis a cmake si to bude generovat do /dev/null Tim commitem si rozbil vsechny architektury ktery nepouzivaj strukturu v jednom hlavnim adresari. Gentoo, Slackware pro zacatek dalsi nevim. Fakt to vubec nedelej takhle, je to zbytecna prace.
Diffstat (limited to 'src/base/my_path.c')
-rw-r--r--src/base/my_path.c110
1 files changed, 0 insertions, 110 deletions
diff --git a/src/base/my_path.c b/src/base/my_path.c
deleted file mode 100644
index 2cf25f8..0000000
--- a/src/base/my_path.c
+++ /dev/null
@@ -1,110 +0,0 @@
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "main.h"
-#include "homeDirector.h"
-#include "textFile.h"
-#include "path.h"
-#include "my_path.h"
-
-static char *path_prefix;
-
-int path_init()
-{
-#if 0
- char str[STR_PATH_SIZE];
- textFile_t *text_file;
-
- sprintf(str, "%s/path", home_director_get());
-
- text_file = text_file_load(str);
-
- if( text_file == NULL )
- {
- fprintf(stderr, "I dont load path\n");
- exit(-1);
- }
-
- if( text_file->text->count == 0 )
- {
- fprintf(stderr, "%s is empty\n", str);
- exit(-1);
- }
-
- path_prefix = strdup(text_file->text->list[0]);
-
- text_file_destroy(text_file);
-
-#endif
-
- path_prefix = malloc((strlen(PREFIX)+1)* sizeof(char));
- strcpy(path_prefix, PREFIX);
- strcat(path_prefix, "/");
-
- printf("use prefix:%s\n", path_prefix);
-
- return 0;
-}
-
-char* path_get_prefix()
-{
- return path_prefix;
-}
-
-int path_set_prefix(char *path, int size, const char *subpath, const char *name)
-{
- char *prefix;
- char *slash;
- int len;
-
- prefix = path_prefix;
-
-/*
- printf("subpath = %s\n", subpath);
- printf("name = %s\n", name);
-*/
- if( isFillPath(name) )
- {
- snprintf(path, size, "%s", name);
- //printf("%s\n", path);
- return 1;
- }
-
- if( isFillPath(subpath) )
- {
- snprintf(path, size, "%s", subpath);
- //printf("%s\n", path);
- return 1;
- }
-
- len = strlen(subpath);
-
- slash = "/";
-
- if( subpath[len-1] == '/' )
- {
- slash = "";
- }
-
-/*
- printf("slash = %s\n", slash);
- printf("prefix = %s\n", prefix);
-*/
- snprintf(path, size, "%s%s%s%s", prefix, subpath, slash, name);
- //printf("file %s\n", path);
-
- return 1;
-}
-
-int path_quit()
-{
- if( path_prefix != NULL )
- {
- free(path_prefix);
- }
-
- return 0;
-}