1 /* 2 * $Id: canaccess.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $ 3 * 4 * ======================================================================== 5 * Copyright 2013-2021 Eduardo Chappa 6 * Copyright 2006 University of Washington 7 * 8 * Licensed under the Apache License, Version 2.0 (the "License"); 9 * you may not use this file except in compliance with the License. 10 * You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * ======================================================================== 15 */ 16 17 #ifndef PITH_OSDEP_CANACCESS_INCLUDED 18 #define PITH_OSDEP_CANACCESS_INCLUDED 19 20 21 #define EXECUTE_ACCESS 0x01 /* These five are */ 22 #define WRITE_ACCESS 0x02 /* for the calls */ 23 #define READ_ACCESS 0x04 /* to access() */ 24 #define ACCESS_EXISTS 0x00 /* <etc> */ 25 #define EDIT_ACCESS (WRITE_ACCESS + READ_ACCESS) 26 27 /* 28 * These flags are used in calls to so_get. 29 * They're OR'd together with the ACCESS flags above but 30 * are otherwise unrelated. 31 */ 32 #define OWNER_ONLY 0x08 /* open with mode 0600 */ 33 /* 34 * If the storage object being written to needs to be converted to 35 * the character set of the user's locale, then use this flag. For 36 * example, when exporting to a file. Do not use this if the data 37 * will eventually go to the display because the data is expected 38 * to remain as UTF-8 until it gets to Writechar where it will be 39 * converted. 40 */ 41 #define WRITE_TO_LOCALE 0x10 /* convert to locale-specific charset */ 42 #define READ_FROM_LOCALE 0x20 /* convert from locale-specific charset */ 43 44 45 /* 46 * Exported Prototypes 47 */ 48 int can_access(char *, int); 49 int can_access_in_path(char *, char *, int); 50 51 52 #endif /* PITH_OSDEP_CANACCESS_INCLUDED */ 53