source: XIOS/dev/dev_olga/extern/src_netcdf4/ocuri.h @ 1620

Last change on this file since 1620 was 409, checked in by ymipsl, 11 years ago

Add improved nectdf internal library src

YM

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
2   See the COPYRIGHT file for more information. */
3
4#ifndef OCURI_H
5#define OCURI_H
6
7/*! This is an open structure meaning
8        it is ok to directly access its fields*/
9typedef struct OCURI {
10    char* uri;        /* as passed by the caller */
11    char* protocol;
12    char* user; /* from user:password@ */
13    char* password; /* from user:password@ */
14    char* host;       /*!< host*/
15    char* port;       /*!< host */
16    char* file;       /*!< file */
17    char* constraint; /*!< projection+selection */
18    char* projection; /*!< without leading '?'*/
19    char* selection;  /*!< with leading '&'*/
20    char* params;     /* all params */
21    char** paramlist;    /*!<null terminated list */
22} OCURI;
23
24extern int ocuriparse(const char* s, OCURI** ocuri);
25extern void ocurifree(OCURI* ocuri);
26
27/* Replace the constraints */
28extern void ocurisetconstraints(OCURI*,const char* constraints);
29
30/* Construct a complete OC URI; caller frees returned string */
31
32/* Define flags to control what is included */
33#define OCURICONSTRAINTS 1
34#define OCURIUSERPWD     2
35#define OCURIPARAMS      4
36#define OCURIENCODE      8 /* If output should be encoded */
37
38extern char* ocuribuild(OCURI*,const char* prefix, const char* suffix, int flags);
39
40/* Param Management */
41extern int ocuridecodeparams(OCURI* ocuri);
42extern int ocurisetparams(OCURI* ocuri,const char*);
43
44/*! NULL result => entry not found.
45    Empty value should be represented as a zero length string */
46extern const char* ocurilookup(OCURI*, const char* param);
47
48extern char* ocuriencode(char* s, char* allowable);
49extern char* ocuridecode(char* s);
50extern char* ocuridecodeonly(char* s, char*);
51
52#endif /*OCURI_H*/
Note: See TracBrowser for help on using the repository browser.