~ubuntu-branches/ubuntu/saucy/argyll/saucy

« back to all changes in this revision

Viewing changes to spectro/xdg_bds.h

  • Committer: Package Import Robot
  • Author(s): Christian Marillat
  • Date: 2012-04-25 07:46:07 UTC
  • mfrom: (1.2.2) (13.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20120425074607-yjqadetw8kum9skc
Tags: 1.4.0-4
Should Build-Depends on libusb-dev (Closes: #670329).

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
 /* XDG Base Directory Specifications support library */
5
5
 
6
 
/* 
7
 
 * Argyll Color Correction System
8
 
 *
9
 
 * Author: Graeme W. Gill
10
 
 * Date:   28/7/2010
11
 
 *
12
 
 * Copyright 2010 Graeme W. Gill
13
 
 * All rights reserved.
14
 
 *
15
 
 * This material is licenced under the GNU GENERAL PUBLIC LICENSE Version 2 or later :-
16
 
 * see the License2.txt file for licencing details.
17
 
 */
 
6
/*************************************************************************
 
7
 Copyright 2011 Graeme W. Gill
 
8
 
 
9
 Permission is hereby granted, free of charge, to any person obtaining a copy
 
10
 of this software and associated documentation files (the "Software"), to deal
 
11
 in the Software without restriction, including without limitation the rights
 
12
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
13
 copies of the Software, and to permit persons to whom the Software is
 
14
 furnished to do so, subject to the following conditions:
 
15
 
 
16
 The above copyright notice and this permission notice shall be included in
 
17
 all copies or substantial portions of the Software.
 
18
 
 
19
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
20
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
21
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 
22
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 
23
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
24
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 
25
 THE SOFTWARE.
 
26
 
 
27
 *************************************************************************/
18
28
 
19
29
#ifdef __cplusplus
20
30
        extern "C" {
51
61
        xdg_mallformed  /* Malfomed path */
52
62
} xdg_error;
53
63
 
54
 
/* Return the full path to the given subpath for the type of storage */
55
 
/* and access required. Return NULL if there is an error. */
56
 
/* The string should be free()'s after use. */
 
64
/* Return the number of matching full paths to the given subpath for the */
 
65
/* type of storage and access required. Return 0 if there is an error. */
 
66
/* The files are always unique (ie. the first match to a given filename */
 
67
/* in the possible XDG list of directories is returned, and files with */
 
68
/* the same name in other XDG directories are ignored) */
 
69
/* Wildcards should only be for the filename portion, and not be used for xdg_write. */
 
70
/* The list should be free'd using xdg_free() after use. */
57
71
/* XDG environment variables and the subpath are assumed to be using */
58
72
/* the '/' path separator. */
59
73
/* When "xdg_write", the necessary path to the file will be created. */
61
75
/* we drop to using the underlying SUDO_UID/GID. If we are creating a */
62
76
/* local system dir/file as sudo and have dropped to the SUDO_UID/GID, */
63
77
/* then revert back to root uid/gid. */
64
 
char *xdg_bds(
 
78
int xdg_bds(
65
79
        xdg_error *er,                  /* Return an error code */
 
80
        char ***paths,                  /* Return array of pointers to paths */
66
81
        xdg_storage_type st,    /* Specify the storage type */
67
82
        xdg_op_type op,                 /* Operation type */
68
83
        xdg_scope sc,                   /* Scope if write */
69
 
        char *spath                             /* Sub-path and file name */
 
84
        char *spath                             /* Sub-path and file name or file pattern */
70
85
);
71
86
 
 
87
/* Free the list */
 
88
void xdg_free(char **paths, int nopaths);
 
89
 
72
90
/* Return a string corresponding to the error value */
73
91
char *xdg_errstr(xdg_error er);
74
92
 
 
93
 
75
94
#define XDG_BDS_H
76
95
#endif /* XDG_BDS_H */
77
96