src/resource_id.h
author Krista Bennett <krista@pep-project.org>
Fri, 01 Jun 2018 10:30:19 +0200
branchENGINE-254
changeset 2723 7194b9c8599d
parent 1881 facb0b5b0bce
permissions -rw-r--r--
close branch
krista@1880
     1
// This file is under GNU General Public License 3.0
krista@1880
     2
// see LICENSE.txt
krista@1880
     3
krista@1880
     4
#pragma once
krista@1880
     5
krista@1880
     6
/* structs to contain info about parsed resource ids (filenames, uids) */
krista@1880
     7
typedef enum _resource_id_type {
krista@1880
     8
    PEP_RID_FILENAME,
krista@1880
     9
    PEP_RID_CID
krista@1880
    10
} pEp_resource_id_type;
krista@1880
    11
krista@1880
    12
typedef struct pEp_rid_list_t pEp_rid_list_t;
krista@1880
    13
krista@1880
    14
struct pEp_rid_list_t {
krista@1880
    15
    pEp_resource_id_type rid_type;
krista@1880
    16
    char* rid;
krista@1880
    17
    pEp_rid_list_t* next;    
krista@1880
    18
};
krista@1880
    19
krista@1880
    20
pEp_rid_list_t* new_rid_node(pEp_resource_id_type type, const char* resource);
krista@1880
    21
krista@1880
    22
void free_rid_list(pEp_rid_list_t* list);
krista@1880
    23
krista@1880
    24
pEp_rid_list_t* parse_uri(const char* uri);
krista@1880
    25
krista@1881
    26
char* build_uri(const char* uri_prefix, const char* resource);
krista@1881
    27
krista@1880
    28
const char* get_resource_ptr_noown(const char* uri);
krista@1880
    29
krista@1880
    30
char* get_resource(char* uri);
krista@1880
    31
krista@1880
    32
bool is_file_uri(char* str);
krista@1880
    33
krista@1880
    34
bool is_cid_uri(const char* str);