Changeset 3487:be2ecd9ae926 in roaraudio for libroar/roarx11.c


Ignore:
Timestamp:
02/14/10 17:48:01 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated x11 interface a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/roarx11.c

    r3474 r3487  
    5151 } 
    5252 
     53 con->close = 1; 
     54 
     55 return con; 
     56#else 
     57 return NULL; 
     58#endif 
     59} 
     60 
     61struct roar_x11_connection * roar_x11_connect_display(_ROAR_X11_DISPLAY * display) { 
     62#ifdef ROAR_HAVE_LIBX11 
     63 struct roar_x11_connection * con; 
     64 
     65 if ( display == NULL ) 
     66  return NULL; 
     67 
     68 if ( (con = roar_mm_malloc(sizeof(struct roar_x11_connection))) == NULL ) 
     69  return NULL; 
     70 
     71 con->close   = 0; 
     72 con->display = display; 
     73 
    5374 return con; 
    5475#else 
     
    5980int roar_x11_disconnect(struct roar_x11_connection * con) { 
    6081#ifdef ROAR_HAVE_LIBX11 
    61  int ret; 
     82 int ret = 0; 
    6283 
    6384 if ( con == NULL ) 
    6485  return -1; 
    6586 
    66  ret = XCloseDisplay(con->display); 
     87 if ( con->close ) 
     88  ret = XCloseDisplay(con->display); 
    6789 
    6890 roar_mm_free(con); 
Note: See TracChangeset for help on using the changeset viewer.