typedef struct {
int num; /* A unique identifier for the mode (num > 0) */
- char *name; /* name of mode given in the XF86Config */
+ const char *name; /* name of mode given in the XF86Config */
int VSync_num;
int VSync_den;
int flags; /* DGA_CONCURRENT_ACCESS, etc... */
extern _X_EXPORT void
xf86SetSilkenMouse(ScreenPtr pScreen);
extern _X_EXPORT pointer
-xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name,
+xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name,
char **adaptor_name, pointer *adaptor_options);
extern _X_EXPORT void
xf86GetOS(const char **name, int *major, int *minor, int *teeny);
int chipset)
{
int ret, i, j;
+ char *lower_driver;
if (!xf86DoConfigure || !xf86DoConfigurePass1)
return NULL;
DevToConfig[i].iDriver = CurrentDriver;
/* Fill in what we know, converting the driver name to lower case */
- DevToConfig[i].GDev.driver = xnfalloc(strlen(driver) + 1);
- for (j = 0; (DevToConfig[i].GDev.driver[j] = tolower(driver[j])); j++);
+ lower_driver = xnfalloc(strlen(driver) + 1);
+ for (j = 0; (lower_driver[j] = tolower(driver[j])); j++);
+ DevToConfig[i].GDev.driver = lower_driver;
switch (bus) {
#ifdef XSERVER_LIBPCIACCESS
typedef union {
unsigned long num;
- char *str;
+ const char *str;
double realnum;
Bool bool;
OptFrequency freq;
*/
typedef struct _XF86OptionRec {
GenericListRec list;
- char *opt_name;
- char *opt_val;
+ const char *opt_name;
+ const char *opt_val;
int opt_used;
- char *opt_comment;
+ const char *opt_comment;
} XF86OptionRec;
typedef struct _InputOption *XF86OptionPtr;
/* Information for root window properties. */
typedef struct _RootWinProp {
struct _RootWinProp *next;
- char *name;
+ const char *name;
Atom type;
short format;
long size;
typedef struct _InputInfoRec {
struct _InputInfoRec *next;
- char *name;
- char *driver;
+ const char *name;
+ const char *driver;
int flags;
int fd;
int width, height;
sbusPromNode node;
- char *descr;
- char *device;
+ const char *descr;
+ const char *device;
} sbusDevice, *sbusDevicePtr;
struct sbus_devtable {
int devId;
int fbType;
- char *promName;
- char *driverName;
- char *descr;
+ const char *promName;
+ const char *driverName;
+ const char *descr;
};
extern _X_EXPORT void xf86SbusProbe(void);
typedef struct _DisplayModeRec {
struct _DisplayModeRec *prev;
struct _DisplayModeRec *next;
- char *name; /* identifier for the mode */
+ const char *name; /* identifier for the mode */
ModeStatus status;
int type;
#define GAMMA_ZERO (GAMMA_MIN / 100.0)
typedef struct {
- char *id;
- char *vendor;
- char *model;
+ const char *id;
+ const char *vendor;
+ const char *model;
int nHsync;
range hsync[MAX_HSYNC];
int nVrefresh;
} DacSpeedIndex;
typedef struct {
- char *identifier;
- char *vendor;
- char *board;
- char *chipset;
- char *ramdac;
- char *driver;
+ const char *identifier;
+ const char *vendor;
+ const char *board;
+ const char *chipset;
+ const char *ramdac;
+ const char *driver;
struct _confscreenrec *myScreenSection;
Bool claimed;
int dacSpeeds[MAXDACSPEEDS];
int numclocks;
int clock[MAXCLOCKS];
- char *clockchip;
- char *busID;
+ const char *clockchip;
+ const char *busID;
Bool active;
Bool inUse;
int videoRam;
} DispRec, *DispPtr;
typedef struct _confxvportrec {
- char *identifier;
+ const char *identifier;
pointer options;
} confXvPortRec, *confXvPortPtr;
typedef struct _confxvadaptrec {
- char *identifier;
+ const char *identifier;
int numports;
confXvPortPtr ports;
pointer options;
} confXvAdaptorRec, *confXvAdaptorPtr;
typedef struct _confscreenrec {
- char *id;
+ const char *id;
int screennum;
int defaultdepth;
int defaultbpp;
typedef struct _screenlayoutrec {
confScreenPtr screen;
- char *topname;
+ const char *topname;
confScreenPtr top;
- char *bottomname;
+ const char *bottomname;
confScreenPtr bottom;
- char *leftname;
+ const char *leftname;
confScreenPtr left;
- char *rightname;
+ const char *rightname;
confScreenPtr right;
PositionType where;
int x;
int y;
- char *refname;
+ const char *refname;
confScreenPtr refscreen;
} screenLayoutRec, *screenLayoutPtr;
typedef struct _InputInfoRec InputInfoRec;
typedef struct _serverlayoutrec {
- char *id;
+ const char *id;
screenLayoutPtr screens;
GDevPtr inactives;
InputInfoRec **inputs; /* NULL terminated */
typedef struct {
int id;
- char *name;
+ const char *name;
unsigned short width, height;
XvRationalRec rate;
} XF86VideoEncodingRec, *XF86VideoEncodingPtr;
int flags;
int min_value;
int max_value;
- char *name;
+ const char *name;
} XF86AttributeRec, *XF86AttributePtr;
typedef struct {
unsigned int type;
int flags;
- char *name;
+ const char *name;
int nEncodings;
XF86VideoEncodingPtr pEncodings;
int nFormats;
XvMCSubpicturePtr subpicture);
typedef struct {
- char *name;
+ const char *name;
int num_surfaces;
XF86MCSurfaceInfoPtr *surfaces;
int num_subpictures;
#include "configProcs.h"
#include <stdlib.h>
-#define TestFree(a) if (a) { free (a); a = NULL; }
+#define TestFree(a) if (a) { free ((void *) a); a = NULL; }
#define parsePrologue(typeptr,typerec) typeptr ptr; \
if( (ptr=calloc(1,sizeof(typerec))) == NULL ) { return NULL; }
j = FALSE;
str = val.str;
if (ptr->file_fontpath == NULL) {
- ptr->file_fontpath = malloc(1);
- ptr->file_fontpath[0] = '\0';
+ ptr->file_fontpath = calloc(1, 1);
i = strlen(str) + 1;
}
else {
}
static XF86OptionPtr
-addNewOption2(XF86OptionPtr head, char *name, char *val, int used)
+addNewOption2(XF86OptionPtr head, char *name, char *_val, int used)
{
XF86OptionPtr new, old = NULL;
else
new = calloc(1, sizeof(*new));
new->opt_name = name;
- new->opt_val = val;
+ new->opt_val = _val;
new->opt_used = used;
if (old)
}
XF86OptionPtr
-xf86addNewOption(XF86OptionPtr head, char *name, char *val)
+xf86addNewOption(XF86OptionPtr head, char *name, char *_val)
{
- return addNewOption2(head, name, val, 0);
+ return addNewOption2(head, name, _val, 0);
}
void
xf86optionListDup(XF86OptionPtr opt)
{
XF86OptionPtr newopt = NULL;
- char *val;
+ char *_val;
while (opt) {
- val = opt->opt_val ? strdup(opt->opt_val) : NULL;
- newopt = xf86addNewOption(newopt, strdup(opt->opt_name), val);
+ _val = opt->opt_val ? strdup(opt->opt_val) : NULL;
+ newopt = xf86addNewOption(newopt, strdup(opt->opt_name), _val);
newopt->opt_used = opt->opt_used;
if (opt->opt_comment)
newopt->opt_comment = strdup(opt->opt_comment);
#include <xorg-config.h>
#endif
-#ifndef IN_XSERVER
+#ifndef HAVE_XORG_CONFIG_H
/* Externally provided functions */
void
ErrorF(const char *f, ...);
OpenConfigDir(const char *path, const char *cmdline, const char *projroot,
const char *confname)
{
- char *dirpath, *pathcopy;
+ char *dirpath = NULL, *pathcopy;
const char *template;
Bool found = FALSE;
int cmdlineUsed = 0;
}
char *
-xf86addComment(char *cur, char *add)
+xf86addComment(char *cur, const char *add)
{
char *str;
+ const char *cstr;
int len, curlen, iscomment, hasnewline = 0, insnewline, endnewline;
if (add == NULL || add[0] == '\0')
else
curlen = 0;
- str = add;
+ cstr = add;
iscomment = 0;
- while (*str) {
- if (*str != ' ' && *str != '\t')
+ while (*cstr) {
+ if (*cstr != ' ' && *cstr != '\t')
break;
- ++str;
+ ++cstr;
}
- iscomment = (*str == '#');
+ iscomment = (*cstr == '#');
len = strlen(add);
endnewline = add[len - 1] == '\n';
typedef struct {
GenericListRec list;
int load_type;
- char *load_name;
+ const char *load_name;
XF86OptionPtr load_opt;
char *load_comment;
int ignore;
typedef struct {
GenericListRec list;
- char *ml_identifier;
+ const char *ml_identifier;
int ml_clock;
int ml_hdisplay;
int ml_hsyncstart;
typedef struct {
GenericListRec list;
- char *vp_identifier;
+ const char *vp_identifier;
XF86OptionPtr vp_option_lst;
char *vp_comment;
} XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
typedef struct {
GenericListRec list;
- char *va_identifier;
- char *va_vendor;
- char *va_board;
- char *va_busid;
- char *va_driver;
+ const char *va_identifier;
+ const char *va_vendor;
+ const char *va_board;
+ const char *va_busid;
+ const char *va_driver;
XF86OptionPtr va_option_lst;
XF86ConfVideoPortPtr va_port_lst;
- char *va_fwdref;
+ const char *va_fwdref;
char *va_comment;
} XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
typedef struct {
GenericListRec list;
- char *modes_identifier;
+ const char *modes_identifier;
XF86ConfModeLinePtr mon_modeline_lst;
char *modes_comment;
} XF86ConfModesRec, *XF86ConfModesPtr;
typedef struct {
GenericListRec list;
- char *ml_modes_str;
+ const char *ml_modes_str;
XF86ConfModesPtr ml_modes;
} XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
typedef struct {
GenericListRec list;
- char *mon_identifier;
- char *mon_vendor;
- char *mon_modelname;
+ const char *mon_identifier;
+ const char *mon_vendor;
+ const char *mon_modelname;
int mon_width; /* in mm */
int mon_height; /* in mm */
XF86ConfModeLinePtr mon_modeline_lst;
typedef struct {
GenericListRec list;
- char *dev_identifier;
- char *dev_vendor;
- char *dev_board;
- char *dev_chipset;
- char *dev_busid;
- char *dev_card;
- char *dev_driver;
- char *dev_ramdac;
+ const char *dev_identifier;
+ const char *dev_vendor;
+ const char *dev_board;
+ const char *dev_chipset;
+ const char *dev_busid;
+ const char *dev_card;
+ const char *dev_driver;
+ const char *dev_ramdac;
int dev_dacSpeeds[CONF_MAXDACSPEEDS];
int dev_videoram;
int dev_textclockfreq;
unsigned long dev_bios_base;
unsigned long dev_mem_base;
unsigned long dev_io_base;
- char *dev_clockchip;
+ const char *dev_clockchip;
int dev_clocks;
int dev_clock[CONF_MAXCLOCKS];
int dev_chipid;
typedef struct {
GenericListRec list;
- char *mode_name;
+ const char *mode_name;
} XF86ModeRec, *XF86ModePtr;
typedef struct {
int disp_virtualY;
int disp_depth;
int disp_bpp;
- char *disp_visual;
+ const char *disp_visual;
parser_rgb disp_weight;
parser_rgb disp_black;
parser_rgb disp_white;
typedef struct {
GenericListRec list;
- char *al_adaptor_str;
+ const char *al_adaptor_str;
XF86ConfVideoAdaptorPtr al_adaptor;
} XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
typedef struct {
GenericListRec list;
- char *scrn_identifier;
- char *scrn_obso_driver;
+ const char *scrn_identifier;
+ const char *scrn_obso_driver;
int scrn_defaultdepth;
int scrn_defaultbpp;
int scrn_defaultfbbpp;
- char *scrn_monitor_str;
+ const char *scrn_monitor_str;
XF86ConfMonitorPtr scrn_monitor;
- char *scrn_device_str;
+ const char *scrn_device_str;
XF86ConfDevicePtr scrn_device;
XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
XF86ConfDisplayPtr scrn_display_lst;
typedef struct {
GenericListRec list;
- char *inp_identifier;
- char *inp_driver;
+ const char *inp_identifier;
+ const char *inp_driver;
XF86OptionPtr inp_option_lst;
char *inp_comment;
} XF86ConfInputRec, *XF86ConfInputPtr;
typedef struct {
GenericListRec list;
XF86ConfInputPtr iref_inputdev;
- char *iref_inputdev_str;
+ const char *iref_inputdev_str;
XF86OptionPtr iref_option_lst;
} XF86ConfInputrefRec, *XF86ConfInputrefPtr;
typedef struct {
GenericListRec list;
- char *identifier;
- char *driver;
+ const char *identifier;
+ const char *driver;
struct xorg_list match_product;
struct xorg_list match_vendor;
struct xorg_list match_device;
GenericListRec list;
int adj_scrnum;
XF86ConfScreenPtr adj_screen;
- char *adj_screen_str;
+ const char *adj_screen_str;
XF86ConfScreenPtr adj_top;
- char *adj_top_str;
+ const char *adj_top_str;
XF86ConfScreenPtr adj_bottom;
- char *adj_bottom_str;
+ const char *adj_bottom_str;
XF86ConfScreenPtr adj_left;
- char *adj_left_str;
+ const char *adj_left_str;
XF86ConfScreenPtr adj_right;
- char *adj_right_str;
+ const char *adj_right_str;
int adj_where;
int adj_x;
int adj_y;
- char *adj_refscreen;
+ const char *adj_refscreen;
} XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
typedef struct {
GenericListRec list;
- char *inactive_device_str;
+ const char *inactive_device_str;
XF86ConfDevicePtr inactive_device;
} XF86ConfInactiveRec, *XF86ConfInactivePtr;
typedef struct {
GenericListRec list;
- char *lay_identifier;
+ const char *lay_identifier;
XF86ConfAdjacencyPtr lay_adjacency_lst;
XF86ConfInactivePtr lay_inactive_lst;
XF86ConfInputrefPtr lay_input_lst;
typedef struct {
GenericListRec list;
- char *vs_name;
- char *vs_identifier;
+ const char *vs_name;
+ const char *vs_identifier;
XF86OptionPtr vs_option_lst;
char *vs_comment;
} XF86ConfVendSubRec, *XF86ConfVendSubPtr;
typedef struct {
GenericListRec list;
- char *vnd_identifier;
+ const char *vnd_identifier;
XF86OptionPtr vnd_option_lst;
XF86ConfVendSubPtr vnd_sub_lst;
char *vnd_comment;
} XF86ConfVendorRec, *XF86ConfVendorPtr;
typedef struct {
- char *dri_group_name;
+ const char *dri_group_name;
int dri_group;
int dri_mode;
char *dri_comment;
extern _X_EXPORT int xf86pathIsAbsolute(const char *path);
extern _X_EXPORT int xf86pathIsSafe(const char *path);
-extern _X_EXPORT char *xf86addComment(char *cur, char *add);
+extern _X_EXPORT char *xf86addComment(char *cur, const char *add);
extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str);
#endif /* _xf86Parser_h_ */