/* InitActiveEdit() * ===================================================================== * Initializes the Active Device display to preset initial values. * the device to display is in xdevice. */ void InitActiveEdit( void ) { /* Set a global index number for the device editor so that we * know which one is currently being displayed. Note that this is * for the active drivers. */ CurHotDriver = DNAME( xdevice ); NoExit( EDELETE ); Disable( EDELETE ); /* Display the device number in text form. */ sprintf( DeviceText, "%d", DDEV( xdevice ) ); TedText( CURNUM ) = &DeviceText[0]; /* Display the driver name in text form ( includes the .SYS ) */ strcpy( DriverText, drivers[ DNAME( xdevice )] ); TedText( CURNAME ) = &DriverText[0]; /* Set the ROM/RES flags */ Deselect( CURROM ); Deselect( CURRES ); if( DTYPE( xdevice ) == 'P' ) /* ROM driver - SCREEN.SYS */ Select( CURROM ); if( DTYPE( xdevice ) == 'R' ) /* Resident Driver */ Select( CURRES ); }
static int can_print_rcvlist(char *page, int len, struct hlist_head *rx_list, struct net_device *dev) { struct receiver *r; struct hlist_node *n; rcu_read_lock(); hlist_for_each_entry_rcu(r, n, rx_list, list) { char *fmt = (r->can_id & CAN_EFF_FLAG)? " %-5s %08X %08x %08x %08x %8ld %s\n" : " %-5s %03X %08x %08lx %08lx %8ld %s\n"; len += snprintf(page + len, PAGE_SIZE - len, fmt, DNAME(dev), r->can_id, r->mask, (unsigned long)r->func, (unsigned long)r->data, r->matches, r->ident); /* does a typical line fit into the current buffer? */ /* 100 Bytes before end of buffer */ if (len > PAGE_SIZE - 100) { /* mark output cut off */ len += snprintf(page + len, PAGE_SIZE - len, " (..)\n"); break; } }
/* DoCurDrivers() * ======================================================================= * Display in a popup the current drivers available. */ void DoCurDrivers( void ) { int i; int Item; int temp; /* if there are no drivers, don't use the popup menu */ if( !driver_count ) return; for( i = 0; i < driver_count; i++ ) CurNames[i] = &drivers[i][0]; temp = CurHotDriver; Item = Pop_Handle( tree, CURNAME, CurNames, driver_count, &CurHotDriver, IBM, 15 ); if( Item != -1 ) { CurHotDriver = Item; strcpy( DriverText, drivers[ Item ] ); TedText( CURNAME ) = &DriverText[0]; Objc_draw( tree, CURNAME, MAX_DEPTH, NULL ); DNAME( xdevice ) = Item; } if( CurHotDriver != temp ) SetChangeFlag(); }
/* Do_InActiveFonts() * ======================================================================== */ void Do_InActiveFonts( void ) { PrevTree = ad_menu; Reset_Tree( ad_inactive ); NoExit( XTRANSFR ); Disable( XTRANSFR ); /* Let's display the current device displayed...*/ cur_device = current_device; ClearListFlags(); SetListFlags(); mover_setup( bit_list, bit_count - DFCOUNT( cur_device ), OBASE, OSLIDE, OUP, ODOWN, OLINE0, OLINE5, OLBASE, 0 ); sprintf( Device_Text, "%d", DDEV( cur_device ) ); TedText( OXDEVICE ) = &Device_Text[0]; strcpy( Driver_Text, drivers[ DNAME( cur_device )] ); strip_period( &Driver_Text[0] ); TedText( OXDRIVER ) = &Driver_Text[0]; if( IsChanged( bit_list ) ) { MakeExit( XTRANSFR ); Enable( XTRANSFR ); } Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); }
static void can_print_rcvlist(struct seq_file *m, struct hlist_head *rx_list, struct net_device *dev) { struct receiver *r; hlist_for_each_entry_rcu(r, rx_list, list) { char *fmt = (r->can_id & CAN_EFF_FLAG)? " %-5s %08x %08x %pK %pK %8ld %s\n" : " %-5s %03x %08x %pK %pK %8ld %s\n"; seq_printf(m, fmt, DNAME(dev), r->can_id, r->mask, r->func, r->data, r->matches, r->ident); }
/* Device_Assign_Slit() *========================================================================== * Assigns the 6 slits visible an FNODE, where possible. * IN: FNODE *ptr: Start assigning with this node * FNODE *array[]: A 5 slit pointer array. */ void Device_Assign_Slit( DEV_PTR ptr, DEV_PTR array[] ) { int i; DEV_PTR curptr; curptr = ptr; for( i = 0; i < MAX_SLITS; i++ ) { array[ i ] = NULL; Deselect( First_Obj + ( i * 6 ) + 5 ); strcpy( Device_Array[i], fblank4 ); TedText( First_Obj + ( i * 6 ) + 1 ) = Device_Array[i]; TedText( First_Obj + ( i * 6 ) + 2 ) = fblank3; HideObj( First_Obj + ( i * 6 ) + 3 ); HideObj( First_Obj + ( i * 6 ) + 4 ); if( curptr ) { array[i] = curptr; sprintf( Device_Array[i], "%d", DDEV( curptr ) ); TedText( First_Obj + ( i * 6 ) + 1 ) = Device_Array[i]; TedText( First_Obj + ( i * 6 ) + 2 ) = drivers[ DNAME( curptr )]; if( ( DTYPE( curptr ) == 'p' ) || ( DTYPE( curptr ) == 'P' )) ShowObj( First_Obj + ( i * 6 ) + 3 ); if( ( DTYPE( curptr ) == 'r' ) || ( DTYPE( curptr ) == 'R' )) ShowObj( First_Obj + ( i * 6 ) + 4 ); curptr = DNEXT( curptr ); } } }
/* AddDevice() * ======================================================================= * Add a new device. * int adevice - > devnum to add. * int AHotDriver-> Index into driver list of driver for the device. * */ void AddDevice( void ) { GRECT rect; DEV_PTR temp_device; wait_up(); if( form_alert( 1, alert2 ) == 2 ) { deselect( tree, EADD ); return; } SetChangeFlag(); temp_device = AddNewDevice( adevice ); if( temp_device ) { /* found a slot and added it to the device linked list array. */ DNAME( temp_device ) = AHotDriver; if( IsSelected( AROM ) ) DTYPE( temp_device ) = 'P'; if( IsSelected( ARES ) ) DTYPE( temp_device ) = 'R'; xdevice = temp_device; InitActiveEdit(); /* re-init the inactive devices. * we only need to check for the device, not everything else. */ adevice = MIN_DEV; /* Set the initial device - unless its a device...*/ /* Check to see if the device exists. If it does, increment and check again * until we don't have an active device. */ while( find_device( adevice ) ) adevice++; /* Set a global index number for the device editor so that we * know which one is currently being displayed. Note that this is * for the active drivers. */ /* Display the device number in text form. */ sprintf( ADeviceText, "%d", adevice ); TedText( ANUM ) = &ADeviceText[0]; Objc_draw( tree, CURNUM, MAX_DEPTH, NULL ); Objc_draw( tree, CURNAME, MAX_DEPTH, NULL ); Objc_draw( tree, CURROM, MAX_DEPTH, NULL ); Objc_draw( tree, CURRES, MAX_DEPTH, NULL ); Objc_draw( tree, ANUM, MAX_DEPTH, NULL ); /* turn on/off the EDELETE button here too */ rect = ObRect( EDELETE ); objc_offset( tree, EDELETE, &rect.g_x, &rect.g_y ); rect.g_x -= 3; rect.g_y -= 3; rect.g_w += 6; rect.g_h += 6; if( DDEV( temp_device ) > 9 ) { MakeExit( EDELETE ); Enable( EDELETE ); } else { NoExit( EDELETE ); Disable( EDELETE ); } Deselect( EDELETE ); Objc_draw( tree, ROOT, MAX_DEPTH, &rect ); device_count++; } /* Reset the driver name to NONE */ strcpy( ADriverText, driver_null ); TedText( ANAME ) = &ADriverText[0]; Objc_draw( tree, ANAME, MAX_DEPTH, NULL ); /* Set the ROM/RES flags */ deselect( tree, AROM ); deselect( tree, ARES ); AHotDriver = -1; /* turn off the EADD button here too */ rect = ObRect( EADD ); objc_offset( tree, EADD, &rect.g_x, &rect.g_y ); rect.g_x -= 3; rect.g_y -= 3; rect.g_w += 6; rect.g_h += 6; NoExit( EADD ); Disable( EADD ); Deselect( EADD ); Objc_draw( tree, ROOT, MAX_DEPTH, &rect ); }
/* DeleteDevice() * ======================================================================= * Delete the Active Device in the Edit Device tree. */ void DeleteDevice( void ) { GRECT rect; DEV_PTR temp_device; wait_up(); if( form_alert( 1, alert1 ) == 2 ) { deselect( tree, EDELETE ); return; } if( device_count == 0 ) return; SetChangeFlag(); temp_device = xdevice; if( DNEXT( xdevice ) ) DPREV( DNEXT( xdevice ) ) = DPREV( xdevice ); if( DPREV( xdevice ) ) DNEXT( DPREV( xdevice ) ) = DNEXT( xdevice ); ClearDeviceFont( xdevice ); /* Fix up device count */ device_count--; /* Change display since we're looking at deleted a device * We shall use xdevice - 1 if there is no device. */ if( DNEXT( xdevice ) ) xdevice = DNEXT( xdevice ); else xdevice = DPREV( xdevice ); DNEXT( temp_device ) = DPREV( temp_device ) = ( DEV_PTR )NULL; DDEV( temp_device ) = 0; CurHotDriver = DNAME( xdevice ); NoExit( EDELETE ); Disable( EDELETE ); /* Display the device number in text form. */ sprintf( DeviceText, "%d", DDEV( xdevice ) ); TedText( CURNUM ) = &DeviceText[0]; /* Display the driver name in text form ( includes the .SYS ) */ strcpy( DriverText, drivers[ DNAME( xdevice )] ); TedText( CURNAME ) = &DriverText[0]; /* Set the ROM/RES flags */ Deselect( CURROM ); Deselect( CURRES ); if( DTYPE( xdevice ) == 'P' ) /* ROM driver - SCREEN.SYS */ Select( CURROM ); if( DTYPE( xdevice ) == 'R' ) /* Resident Driver */ Select( CURRES ); Objc_draw( tree, CURNUM, MAX_DEPTH, NULL ); Objc_draw( tree, CURNAME, MAX_DEPTH, NULL ); Objc_draw( tree, CURROM, MAX_DEPTH, NULL ); Objc_draw( tree, CURRES, MAX_DEPTH, NULL ); /* turn on/off the EDELETE button here too */ rect = ObRect( EDELETE ); objc_offset( tree, EDELETE, &rect.g_x, &rect.g_y ); rect.g_x -= 3; rect.g_y -= 3; rect.g_w += 6; rect.g_h += 6; if( DDEV( xdevice ) > 9 ) { MakeExit( EDELETE ); Enable( EDELETE ); } else { NoExit( EDELETE ); Disable( EDELETE ); } Deselect( EDELETE ); Objc_draw( tree, ROOT, MAX_DEPTH, &rect ); /* Check if the device deleted is the current_device. * if so, we have to update the current_device to a new device. */ if( temp_device == current_device ) current_device = xdevice; if( temp_device == device_head ) device_head = xdevice; }
/* CurDeviceUpDown() * ======================================================================= * Handles the up/down buttons on displaying an active driver and device. * so that we can decide which driver to transfer fonts to. */ void CurDeviceUpDown( int button ) { MRETS mk; DEV_PTR olddev; GRECT rect; select( tree, button ); do { olddev = xdevice; if( button == CURUP ) { if( DNEXT( xdevice ) ) xdevice = DNEXT( xdevice ); } else { if( DPREV( xdevice ) ) xdevice = DPREV( xdevice ); } if( olddev != xdevice ) { sprintf( DeviceText, "%d", DDEV( xdevice ) ); TedText( CURNUM ) = &DeviceText[0]; CurHotDriver = DNAME( xdevice ); strcpy( DriverText, drivers[ DNAME( xdevice )] ); TedText( CURNAME ) = &DriverText[0]; /* Take care of the ROM/RES flags */ Deselect( CURROM ); Deselect( CURRES ); if( DTYPE( xdevice ) == 'P' ) /* ROM driver */ Select( CURROM ); if( DTYPE( xdevice ) == 'R' ) /* Resident Driver */ Select( CURRES ); Objc_draw( tree, CURNUM, MAX_DEPTH, NULL ); Objc_draw( tree, CURNAME, MAX_DEPTH, NULL ); Objc_draw( tree, CURROM, MAX_DEPTH, NULL ); Objc_draw( tree, CURRES, MAX_DEPTH, NULL ); /* Let's check and redraw the DELETE driver key only * when the device # is >= 9 so that it won't blink. */ if( DDEV( xdevice ) >= 9 ) { /* turn on/off the EDELETE button here too */ rect = ObRect( EDELETE ); objc_offset( tree, EDELETE, &rect.g_x, &rect.g_y ); rect.g_x -= 3; rect.g_y -= 3; rect.g_w += 6; rect.g_h += 6; if( DDEV( xdevice ) > 9 ) { MakeExit( EDELETE ); Enable( EDELETE ); } else { NoExit( EDELETE ); Disable( EDELETE ); } Objc_draw( tree, ROOT, MAX_DEPTH, &rect ); } } Evnt_timer( 100L ); Graf_mkstate( &mk ); }while( mk.buttons ); deselect( tree, button ); }
/* mover_button() *========================================================================== * Handles the button events for the CPX Mover/Rename Function * IN: int obj: The RCS Object clicked on. * OUT: BOOLEAN: TRUE - Exit the CPX Mover Config * FALSE - Remain in the CPX Mover Config * */ void mover_button( int obj ) { MRETS mk; int ox,oy; HDEVICE_PTR curptr; DEV_PTR temp_device; Old_Slit = Cur_Slit; if( obj == Mup ) { sl_arrow( tree, Mbase, Mslider, Mup, -1, max( Total - MAX_SLITS, 0 ), 0, &Cur_Slit, VERTICAL, Draw_Slit ); return; } if( obj == Mdown ) { sl_arrow( tree, Mbase, Mslider, Mdown, 1, max( Total - MAX_SLITS, 0 ), 0, &Cur_Slit, VERTICAL, Draw_Slit ); return; } if( obj == Mslider ) { MF_Save(); if( AES_Version >= 0x0320 ) graf_mouse( FLAT_HAND, 0L ); if(( AES_Version >= 0x0330 ) && ( gl_ncolors > LWHITE ) ) XSelect( tree, Mslider ); graf_mkstate( ( int *)&mk.x, &oy, (int *)&mk.buttons, ( int *)&mk.kstate ); do { graf_mkstate( (int *)&mk.x, (int *)&mk.y, (int *)&mk.buttons, ( int *)&mk.kstate ); }while( mk.buttons && ( mk.y == oy )); if( mk.buttons && ( mk.y != oy )) { sl_dragy( tree, Mbase, Mslider, max( Total - MAX_SLITS, 0 ), 0, &Cur_Slit, Draw_Slit ); } if(( AES_Version >= 0x0330 ) && ( gl_ncolors > LWHITE ) ) XDeselect( tree, Mslider ); MF_Restore(); return; } if( obj == Mbase ) { Graf_mkstate( &mk ); objc_offset( tree, Mslider, &ox, &oy ); ox = (( mk.y < oy ) ? ( -MAX_SLITS ) : ( MAX_SLITS ) ); sl_arrow( tree, Mbase, Mslider, -1, ox, max( Total - MAX_SLITS, 0 ), 0, &Cur_Slit, VERTICAL, Draw_Slit ); return; } if(( obj >= Obj_Beg ) && ( obj <= Obj_End )) { if( !IsSelected( obj ) ) { curptr = Active_Slit[ obj - First_Obj ]; if( !curptr ) return; /* SetChangeFlag();*/ Undo_Fnodes( hdriver_head ); HFLAG( curptr ) = TRUE; XSelect( tree, obj ); cur_cdriver = HNAME( curptr ); strcpy( driver_text, cdrivers[ HNAME( curptr )] ); TedText( FPRINTER ) = &driver_text[0]; Objc_draw( tree, FPRINTER, MAX_DEPTH, NULL ); temp_device = find_device( 21 ); /* find the printer device */ if( !temp_device ) { /* Add the Device if necessary */ temp_device = AddNewDevice( 21 ); if( temp_device ) { /* found a slot and added it to the device linked list array. */ DNAME( temp_device ) = cdriver_array[ cur_cdriver ]; } } else /* Else, just change the device name */ DNAME( temp_device ) = cdriver_array[ cur_cdriver ]; if( IsDisabled( FREMOVE ) ) ChangeButton( tree, FREMOVE, TRUE ); if( strstr( cdrivers[ cur_cdriver ], NonSpeedo ) ) { if( !IsDisabled( FCONFIG ) ) ChangeButton( tree, FCONFIG, FALSE ); } else { if( IsDisabled( FCONFIG ) ) ChangeButton( tree, FCONFIG, TRUE ); } /* WRITE THE ASSIGN.SYS IMMEDIATELY */ write_assign(); } } }
/* XDeviceUpDown() * ======================================================================= * Handles the up/down buttons on displaying an active driver and device. * so that we can decide which driver to transfer fonts to. */ void XDeviceUpDown( int button ) { MRETS mk; DEV_PTR olddev; GRECT rect; select( tree, button ); do { olddev = cur_device; if( button == OXUP ) { if( DNEXT( cur_device ) ) cur_device = DNEXT( cur_device ); } else { if( DPREV( cur_device ) ) cur_device = DPREV( cur_device ); } if( olddev != cur_device ) { sprintf( Device_Text, "%d", DDEV( cur_device ) ); TedText( OXDEVICE ) = &Device_Text[0]; strcpy( Driver_Text, drivers[ DNAME( cur_device )] ); strip_period( &Driver_Text[0] ); TedText( OXDRIVER ) = &Driver_Text[0]; ClearListFlags(); SetListFlags(); mover_setup( bit_list, bit_count - DFCOUNT( cur_device ), OBASE, OSLIDE, OUP, ODOWN, OLINE0, OLINE5, OLBASE, Cur_Slit ); Objc_draw( tree, OXDEVICE, MAX_DEPTH, NULL ); Objc_draw( tree, OXDRIVER, MAX_DEPTH, NULL ); Objc_draw( tree, OLBASE, MAX_DEPTH, NULL ); Objc_draw( tree, OBASE, MAX_DEPTH, NULL ); /* turn on/off the XTRANSFR button here too */ rect = ObRect( XTRANSFR ); objc_offset( tree, XTRANSFR, &rect.g_x, &rect.g_y ); rect.g_x -= 3; rect.g_y -= 3; rect.g_w += 6; rect.g_h += 6; if( IsChanged( bit_list ) ) { MakeExit( XTRANSFR ); Enable( XTRANSFR ); } else { NoExit( XTRANSFR ); Disable( XTRANSFR ); } Objc_draw( tree, ROOT, MAX_DEPTH, &rect ); } Evnt_timer( 100L ); current_device = cur_device; /* let's make them equal */ Graf_mkstate( &mk ); }while( mk.buttons ); deselect( tree, button ); }