Changeset 13584 in project
- Timestamp:
- 03/08/09 03:37:05 (12 years ago)
- Location:
- release/4/macosx/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
release/4/macosx/trunk/macosx-env.scm
r13578 r13584 40 40 cfsr_to_utf8str( CFStringRef cfsr, unsigned char **outstr ) 41 41 { 42 # define LONG_CHARS_PER_UTF8 6 42 # define LONG_CHARS_PER_UTF8 6 /* worst case assumption */ 43 43 44 CFIndex buflen = LONG_CHARS_PER_UTF8 * CFStringGetLength( cfsr) + 1; 45 44 46 *outstr = (unsigned char *) C_malloc( buflen ); 47 45 48 if (! CFStringGetCString( cfsr, (char *) *outstr, buflen, kCFStringEncodingUTF8 )) { 46 49 C_free( *outstr ); 47 50 *outstr = NULL; 48 51 } 52 49 53 # undef LONG_CHARS_PER_UTF8 50 54 } … … 71 75 machine_location( double *lat, double *lon, int *dls, long *gmt ) 72 76 { 73 # define ROUNDN(v,p) (round((v) * ((p) * 10.0)) / ((p) * 10.0)) 77 # define ROUNDN( v, p ) (round( (v) * ((p) * 10.0) ) / ((p) * 10.0)) 78 74 79 MachineLocation machloc; 80 75 81 ReadLocation( &machloc ); 82 76 83 *lat = ROUNDN( ((double) FractToFloat( machloc.latitude)) * 90.0, 4 ); 77 84 *lon = ROUNDN( ((double) FractToFloat( machloc.longitude)) * 90.0, 4 ); 78 85 *dls = 0 < machloc.u.dls.Delta ? 3600 : (0 > machloc.u.dls.Delta ? -3600 : 0 ); 79 86 *gmt = ((machloc.u.gmtDelta & 0x00FFFFFF) << 8) >> 8; 87 80 88 # undef ROUNDN 81 89 } … … 95 103 uid_t uid; 96 104 gid_t gid; 105 97 106 CFStringRef cfsr = SCDynamicStoreCopyConsoleUser( store, &uid, &gid ); 98 107 cfsr_to_utf8str( cfsr, outstr ); 99 108 CFRelease( cfsr ); 109 100 110 *puid = uid; 101 111 *pgid = gid; … … 126 136 CFURLRef url = CFBundleCopyExecutableURL( bundle ); 127 137 if (NULL != url) { 128 long buflen = pathconf( "/", _PC_PATH_MAX ); /* Any pathname will do */138 long buflen = pathconf( "/", _PC_PATH_MAX ); /* any pathname will do */ 129 139 *outstr = (unsigned char *) C_malloc( buflen ); 130 140 if (NULL != outstr) { … … 225 235 (define (make-exn-osstatus-condition loc msg code . args) 226 236 (make-composite-condition 227 (apply make-exn-condition loc msg .args)237 (apply make-exn-condition loc msg args) 228 238 (make-osstatus-condition code)) ) 229 239 … … 233 243 (define (make-exn-oserr-condition loc msg code . args) 234 244 (make-composite-condition 235 (apply make-exn-condition loc msg .args)245 (apply make-exn-condition loc msg args) 236 246 (make-oserr-condition code)) ) 237 247 … … 249 259 (syntax-rules () 250 260 [(_ (?c-nam ?typ0 ...) ?arg0 ...) 251 (let-location ([outstr (c-pointer unsigned-c-string)])261 (let-location ([outstr unsigned-c-string*]) 252 262 ((foreign-lambda void ?c-nam 253 (c-pointer unsigned-c-string)?typ0 ...)263 unsigned-c-string* ?typ0 ...) 254 264 (location outstr) ?arg0 ...) 255 265 outstr ) ] ) ) -
release/4/macosx/trunk/macosx-url.scm
r13578 r13584 15 15 16 16 #> 17 #i mport<ApplicationServices/ApplicationServices.h>18 #i mport<CoreFoundation/CoreFoundation.h>17 #include <ApplicationServices/ApplicationServices.h> 18 #include <CoreFoundation/CoreFoundation.h> 19 19 20 20 static int -
release/4/macosx/trunk/macosx.meta
r13578 r13584 7 7 (doc-from-wiki) 8 8 (synopsis "MacOS X Utilities") 9 (needs setup-helper dollar)9 (needs setup-helper) 10 10 (files 11 11 "tests" -
release/4/macosx/trunk/macosx.setup
r13578 r13584 7 7 (setup-shared-extension-module 'macosx-env (extension-version "2.0.0") 8 8 compile-options: '( 9 -extend dollar10 9 -framework CoreFoundation -framework CoreServices 11 10 -framework SystemConfiguration
Note: See TracChangeset
for help on using the changeset viewer.