Changeset 13584 in project


Ignore:
Timestamp:
03/08/09 03:37:05 (11 years ago)
Author:
Kon Lovett
Message:

Save.

Location:
release/4/macosx/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • release/4/macosx/trunk/macosx-env.scm

    r13578 r13584  
    4040cfsr_to_utf8str( CFStringRef cfsr, unsigned char **outstr )
    4141{
    42 #       define LONG_CHARS_PER_UTF8 6
     42#       define LONG_CHARS_PER_UTF8 6 /* worst case assumption */
     43
    4344        CFIndex buflen = LONG_CHARS_PER_UTF8 * CFStringGetLength( cfsr) + 1;
     45
    4446        *outstr = (unsigned char *) C_malloc( buflen );
     47
    4548        if (! CFStringGetCString( cfsr, (char *) *outstr, buflen, kCFStringEncodingUTF8 )) {
    4649                C_free( *outstr );
    4750                *outstr = NULL;
    4851        }
     52
    4953#       undef LONG_CHARS_PER_UTF8
    5054}
     
    7175machine_location( double *lat, double *lon, int *dls, long *gmt )
    7276{
    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
    7479        MachineLocation machloc;
     80
    7581        ReadLocation( &machloc );
     82
    7683        *lat = ROUNDN( ((double) FractToFloat( machloc.latitude)) * 90.0, 4 );
    7784        *lon = ROUNDN( ((double) FractToFloat( machloc.longitude)) * 90.0, 4 );
    7885        *dls = 0 < machloc.u.dls.Delta ? 3600 : (0 > machloc.u.dls.Delta ? -3600 : 0 );
    7986        *gmt = ((machloc.u.gmtDelta & 0x00FFFFFF) << 8) >> 8;
     87
    8088#       undef ROUNDN
    8189}
     
    95103        uid_t uid;
    96104        gid_t gid;
     105
    97106        CFStringRef cfsr = SCDynamicStoreCopyConsoleUser( store, &uid, &gid );
    98107        cfsr_to_utf8str( cfsr, outstr );
    99108        CFRelease( cfsr );
     109
    100110        *puid = uid;
    101111        *pgid = gid;
     
    126136    CFURLRef url = CFBundleCopyExecutableURL( bundle );
    127137    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 */
    129139      *outstr = (unsigned char *) C_malloc( buflen );
    130140      if (NULL != outstr) {
     
    225235(define (make-exn-osstatus-condition loc msg code . args)
    226236  (make-composite-condition
    227    (apply make-exn-condition loc msg . args)
     237   (apply make-exn-condition loc msg args)
    228238   (make-osstatus-condition code)) )
    229239
     
    233243(define (make-exn-oserr-condition loc msg code . args)
    234244  (make-composite-condition
    235    (apply make-exn-condition loc msg . args)
     245   (apply make-exn-condition loc msg args)
    236246   (make-oserr-condition code)) )
    237247
     
    249259  (syntax-rules ()
    250260    [(_ (?c-nam ?typ0 ...) ?arg0 ...)
    251            (let-location ([outstr (c-pointer unsigned-c-string)])
     261           (let-location ([outstr unsigned-c-string*])
    252262             ((foreign-lambda void ?c-nam
    253                                    (c-pointer unsigned-c-string) ?typ0 ...)
     263                                   unsigned-c-string* ?typ0 ...)
    254264              (location outstr) ?arg0 ...)
    255265                   outstr ) ] ) )
  • release/4/macosx/trunk/macosx-url.scm

    r13578 r13584  
    1515
    1616#>
    17 #import <ApplicationServices/ApplicationServices.h>
    18 #import <CoreFoundation/CoreFoundation.h>
     17#include <ApplicationServices/ApplicationServices.h>
     18#include <CoreFoundation/CoreFoundation.h>
    1919
    2020static int
  • release/4/macosx/trunk/macosx.meta

    r13578 r13584  
    77 (doc-from-wiki)
    88 (synopsis "MacOS X Utilities")
    9  (needs setup-helper dollar)
     9 (needs setup-helper)
    1010 (files
    1111  "tests"
  • release/4/macosx/trunk/macosx.setup

    r13578 r13584  
    77(setup-shared-extension-module 'macosx-env (extension-version "2.0.0")
    88  compile-options: '(
    9     -extend dollar
    109    -framework CoreFoundation -framework CoreServices
    1110    -framework SystemConfiguration
Note: See TracChangeset for help on using the changeset viewer.