allow to change local files

- fuse/filecache:
     * add filecache_upload_patch
     * allow opening files in modes other than RDONLY
 - fuse/hashtbl:
     * add folder_tree_upload_patch
 - fuse/operations:
     * allow opening files in modes other than RDONLY
     * add members to private context which allow tracking of
       not-yet-uploaded files and files opened for writing and
       files opened in read-only mode
 - mfapi/apicalls/upload_patch:
     * supply x-filename and x-filesize headers
 - mfapi/apicalls/upload_simple:
     * do not supply the x-filehash header as it is not used by the
       server
 - utils/hash:
     * hex characters must be lower case for the server
 - utils/strings:
     * clean up unused functions strdup_join, strdup_substr,
       string_chomp
 - utils/stringv:
     * complete rewrite with different string vector implementation
This commit is contained in:
josch
2014-12-08 14:12:17 +01:00
parent 5bd9e418c4
commit 171fd815f2
16 changed files with 521 additions and 439 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2013 Bryan Christ <bryan.christ@mediafire.com>
* Copyright (C) 2014 Johannes Schauer <j.schauer@email.de>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2, as published by
@@ -19,23 +19,18 @@
#ifndef _STRING_V_H_
#define _STRING_V_H_
#include <stddef.h>
#include <stdbool.h>
#define STRINGV_FREE_ALL 1
typedef struct stringv stringv;
// count number of strings in a NULL in a string vector
size_t stringv_len(char **array);
stringv *stringv_alloc(void);
// free all of the strings in a vector and optionally the vector pointer
void stringv_free(char **array, int b_free);
void stringv_free(stringv * sv);
// deep copy of string vector. returns a new vector pointer
char **stringv_copy(char **array);
bool stringv_mem(stringv * sv, const char *e);
// returns a NULL terminated vector array to every location 'token' is found
char **stringv_find(char *string, char *token, int limit);
int stringv_add(stringv * sv, const char *e);
// returns a NULL terminated vector array of items delimited by 'token'
char **stringv_split(char *string, char *token, int limit);
int stringv_del(stringv * sv, const char *e);
#endif