From: Dan A. <da...@co...> - 2005-04-29 12:46:24
|
On Fri, Apr 29, 2005 at 01:27:51PM +0100, Nuno Lucas wrote: > After some time without doing much in colinux, here are some more things > to the colinux development branch: > > * Add IOCTL to list monitors active > * Bump CO_LINUX_PERIPHERY_API_VERSION because of that > * Return to the default behavior of the FLTK console of attaching > to the first available monitor, if none given. > * Implement the "Select Monitor" menu command. > > To do was making the same with the NT console. I'll let that as an > exercise to the reader :D Thanks. I'll apply this, but see my comment below. [..] > +/** > + * Returns PID of first monitor. > + * > + * If none found, returns CO_INVALID_ID. > + * > + * TODO: Find first monitor not already attached. > + */ I'm changing the storage type of this function to 'static'. Later on we can move it to somewhere common and add a prefix to its name. > +co_id_t find_first_monitor( ) > +{ > + co_manager_handle_t handle; > + co_manager_ioctl_monitor_list_t list; > + co_rc_t rc; > + > + handle = co_os_manager_open( ); > + if ( handle == NULL ) > + return CO_INVALID_ID; > + > + rc = co_manager_monitor_list( handle, &list ); > + co_os_manager_close( handle ); > + if ( !CO_OK(rc) || list.count == 0 ) > + return CO_INVALID_ID; > + > + return list.ids[0]; > +} > + [..] -- Dan Aloni da...@co... |