OLD | NEW |
1 /* | 1 /* |
2 This file is not licenced under the GPL like the rest of the code. | 2 This file is not licenced under the GPL like the rest of the code. |
3 Its is under the MIT license, to encourage reuse by cut-and-paste. | 3 Its is under the MIT license, to encourage reuse by cut-and-paste. |
4 | 4 |
5 Copyright (c) 2007 Red Hat, inc | 5 Copyright (c) 2007 Red Hat, inc |
6 | 6 |
7 Permission is hereby granted, free of charge, to any person | 7 Permission is hereby granted, free of charge, to any person |
8 obtaining a copy of this software and associated documentation files | 8 obtaining a copy of this software and associated documentation files |
9 (the "Software"), to deal in the Software without restriction, | 9 (the "Software"), to deal in the Software without restriction, |
10 including without limitation the rights to use, copy, modify, merge, | 10 including without limitation the rights to use, copy, modify, merge, |
11 publish, distribute, sublicense, and/or sell copies of the Software, | 11 publish, distribute, sublicense, and/or sell copies of the Software, |
12 and to permit persons to whom the Software is furnished to do so, | 12 and to permit persons to whom the Software is furnished to do so, |
13 subject to the following conditions: | 13 subject to the following conditions: |
14 | 14 |
15 The above copyright notice and this permission notice shall be | 15 The above copyright notice and this permission notice shall be |
16 included in all copies or substantial portions of the Software. | 16 included in all copies or substantial portions of the Software. |
17 | 17 |
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | 18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | 19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | 20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
21 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | 21 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
22 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | 22 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
23 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | 23 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
24 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | 24 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
25 SOFTWARE. | 25 SOFTWARE. |
26 */ | 26 */ |
27 | 27 |
| 28 #include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h" |
| 29 |
28 #include <stdio.h> | 30 #include <stdio.h> |
29 #include <stdlib.h> | 31 #include <stdlib.h> |
30 #include <string.h> | 32 #include <string.h> |
31 | 33 |
32 /** | 34 /** |
33 * xdg_user_dir_lookup_with_fallback: | 35 * xdg_user_dir_lookup_with_fallback: |
34 * @type: a string specifying the type of directory | 36 * @type: a string specifying the type of directory |
35 * @fallback: value to use if the directory isn't specified by the user | 37 * @fallback: value to use if the directory isn't specified by the user |
36 * @returns: a newly allocated absolute pathname | 38 * @returns: a newly allocated absolute pathname |
37 * | 39 * |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 if (argc != 2) | 225 if (argc != 2) |
224 { | 226 { |
225 fprintf (stderr, "Usage %s <dir-type>\n", argv[0]); | 227 fprintf (stderr, "Usage %s <dir-type>\n", argv[0]); |
226 exit (1); | 228 exit (1); |
227 } | 229 } |
228 | 230 |
229 printf ("%s\n", xdg_user_dir_lookup (argv[1])); | 231 printf ("%s\n", xdg_user_dir_lookup (argv[1])); |
230 return 0; | 232 return 0; |
231 } | 233 } |
232 #endif | 234 #endif |
OLD | NEW |