source: XIOS/dev/dev_olga/extern/src_netcdf4/nc_uri.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.6 KB
Line 
1/* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc.
2   See the COPYRIGHT file for more information. */
3
4#ifndef NC_URI_H
5#define NC_URI_H
6
7/*! This is an open structure meaning
8        it is ok to directly access its fields*/
9typedef struct NC_URI {
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} NC_URI;
23
24extern int nc_uriparse(const char* s, NC_URI** nc_uri);
25extern void nc_urifree(NC_URI* nc_uri);
26
27/* Replace the constraints */
28extern void nc_urisetconstraints(NC_URI*,const char* constraints);
29
30/* Construct a complete NC_ URI; caller frees returned string */
31
32/* Define flags to control what is included */
33#define NC_URICONSTRAINTS       1
34#define NC_URIUSERPWD           2
35#define NC_URIPARAMS            4
36#define NC_URIALL               (NC_URICONSTRAINTS|NC_URIUSERPWD|NC_URIPARAMS)
37
38extern char* nc_uribuild(NC_URI*,const char* prefix, const char* suffix, int flags);
39
40
41/* Param Management */
42extern int nc_uridecodeparams(NC_URI* nc_uri);
43extern int nc_urisetparams(NC_URI* nc_uri,const char*);
44
45/*! 0 result => entry not found; 1=>found; result holds value (may be null).
46    In any case, the result is imutable and should not be free'd.
47*/
48extern int nc_urilookup(NC_URI*, const char* param, const char** result);
49
50#endif /*NC_URI_H*/
Note: See TracBrowser for help on using the repository browser.