- Timestamp:
- Mar 27, 2011, 12:11:26 AM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- 6a71113
- Parents:
- 779bd3d
- git-author:
- Jason Gross <jgross@mit.edu> (03/26/11 04:56:41)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (03/27/11 00:11:26)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
rfe3b017 rf203cad 1019 1019 { 1020 1020 #ifdef HAVE_LIBZEPHYR 1021 char *exposure, *eset;1022 Code_t ret;1023 1024 1021 ZResetAuthentication(); 1025 1022 1026 eset = EXPOSE_REALMVIS; 1027 exposure = ZGetVariable(zstr("exposure")); 1028 if (exposure) 1029 exposure = ZParseExposureLevel(exposure); 1030 if (exposure) 1031 eset = exposure; 1032 1033 ret = ZSetLocation(eset); 1034 if (ret != ZERR_NONE) 1035 owl_function_error("Error setting location: %s", error_message(ret)); 1023 /* ZSetLocation, and store the default value as the current value */ 1024 owl_global_set_exposure(&g, owl_global_get_default_exposure(&g)); 1036 1025 #endif 1037 1026 } … … 1154 1143 ZInitLocationInfo(zstr(host), zstr(val)); 1155 1144 #endif 1145 } 1146 1147 const char *owl_zephyr_normalize_exposure(const char *exposure) 1148 { 1149 if (exposure == NULL) 1150 return NULL; 1151 #ifdef HAVE_LIBZEPHYR 1152 return ZParseExposureLevel(zstr(exposure)); 1153 #else 1154 return exposure; 1155 #endif 1156 } 1157 1158 int owl_zephyr_set_default_exposure(const char *exposure) 1159 { 1160 #ifdef HAVE_LIBZEPHYR 1161 Code_t ret; 1162 if (exposure == NULL) 1163 return -1; 1164 exposure = ZParseExposureLevel(zstr(exposure)); 1165 if (exposure == NULL) 1166 return -1; 1167 ret = ZSetVariable(zstr("exposure"), zstr(exposure)); /* ZSetVariable does file I/O */ 1168 if (ret != ZERR_NONE) { 1169 owl_function_error("Unable to set default exposure location: %s", error_message(ret)); 1170 return -1; 1171 } 1172 #endif 1173 return 0; 1174 } 1175 1176 const char *owl_zephyr_get_default_exposure(void) 1177 { 1178 #ifdef HAVE_LIBZEPHYR 1179 const char *exposure = ZGetVariable(zstr("exposure")); /* ZGetVariable does file I/O */ 1180 if (exposure == NULL) 1181 return EXPOSE_REALMVIS; 1182 exposure = ZParseExposureLevel(zstr(exposure)); 1183 if (exposure == NULL) /* The user manually entered an invalid value in ~/.zephyr.vars, or something weird happened. */ 1184 return EXPOSE_REALMVIS; 1185 return exposure; 1186 #else 1187 return ""; 1188 #endif 1189 } 1190 1191 int owl_zephyr_set_exposure(const char *exposure) 1192 { 1193 #ifdef HAVE_LIBZEPHYR 1194 Code_t ret; 1195 if (exposure == NULL) 1196 return -1; 1197 exposure = ZParseExposureLevel(zstr(exposure)); 1198 if (exposure == NULL) 1199 return -1; 1200 ret = ZSetLocation(zstr(exposure)); 1201 if (ret != ZERR_NONE) { 1202 owl_function_error("Unable to set exposure level: %s.", error_message(ret)); 1203 return -1; 1204 } 1205 #endif 1206 return 0; 1156 1207 } 1157 1208
Note: See TracChangeset
for help on using the changeset viewer.