Changeset 13589 in project


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

Save.

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

Legend:

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

    r13588 r13589  
    3535#include <Security/AuthSession.h>
    3636
    37 #define VECLEN( v) (sizeof( v) / sizeof( (v)(0)))
     37#define VECLEN( v ) (sizeof( v ) / sizeof( (v)[0] ))
    3838
    3939static void
     
    151151stringToOSType( char *str )
    152152{
    153   union {uint32_t v; uint8_t c(4);} ost;
     153  union {uint32_t v; uint8_t c[4];} ost;
    154154
    155155  int i;
     
    157157  /* Copy existing */
    158158  for (i = 0; i < VECLEN( ost.c ) && *str; ++i, ++str)
    159     ost.c(i) = (uint8_t) *str;
     159    ost.c[i] = (uint8_t) *str;
    160160
    161161  /* Pad remaining */
    162162  for (; i < VECLEN( ost.c ); ++i)
    163     ost.c(i) = (uint8_t) ' ';
     163    ost.c[i] = (uint8_t) ' ';
    164164
    165165  return ost.v;
     
    223223  main-bundle-path
    224224  tick-count
    225   delay
     225  delay-for-ticks
    226226  gestalt)
    227227
     
    252252;;
    253253
    254 (define (osstatus-error loc msg code args)
    255   (abort (make-exn-osstatus-condition loc msg code args)))
    256 
    257 (define (oserr-error loc msg code args)
    258   (abort (make-exn-oserr-condition loc msg code args)))
     254(define (osstatus-error loc msg code . args)
     255  (abort (apply make-exn-osstatus-condition loc msg code args)))
     256
     257(define (oserr-error loc msg code . args)
     258  (abort (apply make-exn-oserr-condition loc msg code args)))
    259259
    260260;;
     
    265265    (let (($$ (r '$))
    266266          ($void (r 'void))
    267           ($unsigned-c-string* (r 'unsigned-c-string*))
     267          ($unsigned-c-string* 'unsigned-c-string* #;(r 'unsigned-c-string*))
    268268          ($location (r 'location))
    269269          ($let-location (r 'let-location)))
     
    272272            (stroutvar (gensym)))
    273273        `(,$let-location ((,stroutvar ,$unsigned-c-string*))
    274            (,$$ ,$void ,c-nam (,$location ,stroutvar) ,@args)
     274           (,$$ void ,c-nam (location ,stroutvar) ,@args)
    275275           ,stroutvar)))))
    276276         
     
    293293              (if (not nam) (osstatus-error 'session-info "CGSessionCopyCurrentDictionary failed" 0)
    294294                  (vector sid
    295                           (bitwise-test?/foreign-mask sab sessionIsRoot)
    296                           (bitwise-test?/foreign-mask sab sessionHasGraphicAccess)
    297                           (bitwise-test?/foreign-mask sab sessionHasTTY)
    298                           (bitwise-test?/foreign-mask sab sessionIsRemote)
    299                           (bitwise-test?/foreign-mask sab sessionWasInitialized)
     295                          (bitwise-test?/foreign-mask sab "sessionIsRoot")
     296                          (bitwise-test?/foreign-mask sab "sessionHasGraphicAccess")
     297                          (bitwise-test?/foreign-mask sab "sessionHasTTY")
     298                          (bitwise-test?/foreign-mask sab "sessionIsRemote")
     299                          (bitwise-test?/foreign-mask sab "sessionWasInitialized")
    300300                          nam
    301301                          uid
    302302                          con
    303                           (bitwise-test?/foreign-mask bits session_LoginCompleted)
    304                           (bitwise-test?/foreign-mask bits session_UserIsActive)))))))))
     303                          (bitwise-test?/foreign-mask bits "session_LoginCompleted")
     304                          (bitwise-test?/foreign-mask bits "session_UserIsActive")))))))))
    305305
    306306;;
     
    321321
    322322(define (metric?)
    323         ((foreign-lambda bool "IsMetric")))
     323        ($ bool IsMetric))
    324324
    325325;;
     
    350350  ($ unsigned-integer32 TickCount))
    351351
    352 (define (delay ticks)
     352(define (delay-for-ticks ticks)
    353353        (let-location ((fticks unsigned-long))
    354354    ($ void Delay (unsigned-long ticks) #$fticks)
  • release/4/macosx/trunk/tests/run.scm

    r13578 r13589  
     1;;;; macosx-test
     2
     3(require-extension test)
     4(require-extension macosx-env)
     5(require-extension macosx-url)
     6
     7(test-group "macosx-env"
     8  (test-assert (session-info))
     9  (test-assert (machine-name))
     10  (test-assert (short-user-name))
     11  (test-assert (long-user-name))
     12  (test-assert (machine-location))
     13  #; ;works in 'csi' but as 'test-assert' causes "Illegal instruction"
     14  (test-assert (metric?))
     15  (test-assert (computer-name))
     16  (test-assert (console-user))
     17  (test-assert (local-host-name))
     18  (test-assert (location-name))
     19  (test-assert (main-bundle-path))
     20  (test-assert (tick-count))
     21  (delay-for-ticks 5)
     22  (test-assert (gestalt 'addr))
     23)
     24
     25(test-group "macosx-url - should launch default browser with \"http://www.apple.com/\""
     26  (open-url "http://www.apple.com/")
     27)
Note: See TracChangeset for help on using the changeset viewer.