Changeset 22063 in project


Ignore:
Timestamp:
12/18/10 00:09:53 (9 years ago)
Author:
Moritz Heidkamp
Message:

pulseaudio: add error enum and error->string; use those to handle no-entity errors

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

Legend:

Unmodified
Added
Removed
  • release/4/pulseaudio/trunk/pulseaudio-lolevel.scm

    r22062 r22063  
    8181(define (handle-eol callback context info eol)
    8282  (cond ((> eol 0) #t)
    83         ((< eol 0) (error (format "eol error on callback for ~A" (context-pointer context))))
     83        ((< eol 0)
     84         (if (eq? 'no-entity (int->error eol))
     85             (callback context #f)
     86             (error (format "eol error on callback for ~A: ~A"
     87                            (context-pointer context)
     88                            (error->string eol)))))
    8489        (else (callback context info) #f)))
    8590
     
    104109     ;; additional finalizers are prepended, see ticket #446
    105110     (set-finalizer! c free-context-state-callback)
     111     (set-finalizer! c free-context-subscribe-callback)
    106112     (set-finalizer! c free-context-subscribe-callback))
    107113   make-context))
  • release/4/pulseaudio/trunk/types.scm

    r22017 r22063  
    237237  (int->subscription-event (bitwise-and se se/type-mask)))
    238238
     239(define-foreign-enum-type (error int)
     240  (error->int int->error)
     241  ((ok) PA_OK)
     242  ((access) PA_ERR_ACCESS)
     243  ((command) PA_ERR_COMMAND)
     244  ((invalid) PA_ERR_INVALID)
     245  ((exist) PA_ERR_EXIST)
     246  ((no-entity) PA_ERR_NOENTITY)
     247  ((connection-refused) PA_ERR_CONNECTIONREFUSED)
     248  ((protocol) PA_ERR_PROTOCOL)
     249  ((timeout) PA_ERR_TIMEOUT)
     250  ((authkey) PA_ERR_AUTHKEY)
     251  ((internal) PA_ERR_INTERNAL)
     252  ((connection-terminated) PA_ERR_CONNECTIONTERMINATED)
     253  ((killed) PA_ERR_KILLED)
     254  ((invalid-server) PA_ERR_INVALIDSERVER)
     255  ((mod-init-failed) PA_ERR_MODINITFAILED)
     256  ((bad-state) PA_ERR_BADSTATE)
     257  ((no-data) PA_ERR_NODATA)
     258  ((version) PA_ERR_VERSION)
     259  ((too-large) PA_ERR_TOOLARGE)
     260  ((not-supported) PA_ERR_NOTSUPPORTED)
     261  ((unknown) PA_ERR_UNKNOWN)
     262  ((no-extension) PA_ERR_NOEXTENSION)
     263  ((obsolete) PA_ERR_OBSOLETE)
     264  ((not-implemented) PA_ERR_NOTIMPLEMENTED)
     265  ((forked) PA_ERR_FORKED)
     266  ((io) PA_ERR_IO)
     267  ((busy) PA_ERR_BUSY)
     268  ((max) PA_ERR_MAX))
     269
     270(define (error->string error)
     271  ((foreign-lambda c-string pa_strerror int) error))
     272
    239273(define properties
    240274  (let-syntax ((p (syntax-rules () ((_ n) (foreign-value n c-string)))))
Note: See TracChangeset for help on using the changeset viewer.