diff --git a/Makefile b/Makefile index c202201..16cdd7d 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,11 @@ PKGS = fuse libxml-2.0 libcurl libapp libjson FLAGS = $(shell pkg-config ${PKGS} --cflags) -g ${CFLAGS} LIBS = $(shell pkg-config ${PKGS} --libs) -lpthread OBJS = boxfs.o boxapi.o boxpath.o boxhttp.o boxopts.o boxjson.o boxcache.o boxutils.o -PREFIX = /usr/local +PREFIX ?= /usr/local BINDIR = $(PREFIX)/bin +.PHONY: clean install check_pkg + # Targets boxfs: check_pkg $(OBJS) @echo "Building $@" @@ -16,8 +18,6 @@ boxfs: check_pkg $(OBJS) @echo Compiling $< $(CC) $(FLAGS) -c $< -o $@ -.PHONY: clean install check_pkg - clean: rm -f $(OBJS) *~ boxfs diff --git a/boxapi.c b/boxapi.c index 9f2d68d..8842baf 100644 --- a/boxapi.c +++ b/boxapi.c @@ -500,11 +500,16 @@ int api_removefile(const char * path) } boxpath_free(bpath); - //get_account_info(); return res; } -//Move and rename funcs, new version +/* + * Move and rename funcs, new version + */ + +//predeclaration +int do_api_move_id(int is_dir, const char * id, const char * dest, int is_rename); + int do_api_move(boxpath * bsrc, boxpath * bdst) { int res = 0; diff --git a/boxcache.c b/boxcache.c index 3beca67..00ae369 100644 --- a/boxcache.c +++ b/boxcache.c @@ -4,6 +4,8 @@ #include #include #include +#include +#include static char *cache_dir = NULL; static time_t expire = 0; diff --git a/boxcache.h b/boxcache.h index bf6ec17..b7e9ba0 100644 --- a/boxcache.h +++ b/boxcache.h @@ -8,4 +8,4 @@ void cache_put(const char * key, const char * val); void cache_rm(const char * key); #endif -//BOXCACHE_H \ No newline at end of file +//BOXCACHE_H diff --git a/boxjson.c b/boxjson.c index 828f200..a687186 100644 --- a/boxjson.c +++ b/boxjson.c @@ -127,7 +127,7 @@ void jobj_free(jobj * obj) { list_iter it; - if(obj->type = T_VAL) { + if(obj->type == T_VAL) { free(obj->value); return; } diff --git a/boxopts.c b/boxopts.c index 69a3983..1f7189c 100644 --- a/boxopts.c +++ b/boxopts.c @@ -9,6 +9,7 @@ #include #include #include +#include char* args[] = { "boxfs", "-h" }; /* diff --git a/boxutils.h b/boxutils.h index e89f3e5..bfc8669 100644 --- a/boxutils.h +++ b/boxutils.h @@ -17,4 +17,4 @@ off_t filesize(const char * localpath); char * pathappend(const char * one, const char * two); #endif -//BOXUTILS_H \ No newline at end of file +//BOXUTILS_H