Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

display.c File Reference

#include <sysdep.h>
#include "new_memory.h"
#include "new_string.h"
#include "variables.h"
#include "display.h"

Go to the source code of this file.

Data Structures

struct  driver_info

Functions

void tty_driver ()
void plain_driver ()
void raw_driver ()
int tty_driver_init ()
driver_info * get_driver_info (string driver_name)
void display_init (int *pargc, char **argv)
void display_reset ()


Function Documentation

void display_init int *  pargc,
char **  argv
 

Definition at line 76 of file display.c.

References get_driver_info(), string, string_Eq, usage(), and var_set_variable().

00079 {
00080         char **new, **current;
00081         struct driver_info *d;
00082         string first_working_driver = "";
00083         string default_driver = "";
00084 
00085         /*
00086          * Process argument list handling "-disable <driver>" and
00087          * "-default <driver>" arguments:
00088          */
00089         for (new = current = argv + 1; *current; current++) {
00090                 if (string_Eq(*current, "-disable")) {
00091                         current++;
00092                         *pargc -= 2;
00093                         if (!*current)
00094                                 usage();
00095                         if (d = get_driver_info(*current))
00096                                 d->driver = NULL;
00097                 }
00098                 else if (string_Eq(*current, "-default")) {
00099                         current++;
00100                         *pargc -= 2;
00101                         if (!*current)
00102                                 usage();
00103                         default_driver = *current;
00104                 }
00105                 else
00106                         *(new++) = *current;
00107         }
00108         *new = *current;
00109 
00110         /*
00111          * Initialize all non-disabled drivers.  If a driver reports an error,
00112          * disable that driver.  Set default_driver if not already set
00113          * by the -default argument to the first non-disabled driver.
00114          */
00115         for (d = driver_table; d->driver_name; d++) {
00116                 if (!d->driver)
00117                         continue;
00118 
00119                 if (d->driver_init && d->driver_init(pargc, argv)) {
00120                         d->driver = NULL;
00121                         continue;
00122                 }
00123 
00124                 if (!*first_working_driver)
00125                         first_working_driver = d->driver_name;
00126         }
00127 
00128         if (!get_driver_info(default_driver))
00129                 default_driver = first_working_driver;
00130 
00131         var_set_variable("output_driver", default_driver);
00132 }

void display_reset  ) 
 

Definition at line 135 of file display.c.

00136 {
00137         for (d = driver_table; d->driver_name; d++)
00138                 if (d->driver)
00139                         d->driver_reset();
00140 }

struct driver_info* get_driver_info string  driver_name  ) 
 

Definition at line 58 of file display.c.

References string_Eq.

Referenced by display_init().

00060 {
00061         struct driver_info *d;
00062 
00063         for (d = driver_table; d->driver_name; d++)
00064                 if (string_Eq(d->driver_name, driver_name) && d->driver)
00065                         return (d);
00066 
00067         return (NULL);
00068 }

void plain_driver  ) 
 

void raw_driver  ) 
 

void tty_driver  ) 
 

int tty_driver_init  ) 
 



Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo

Source Perspective by Fisheye