Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Feb 17, 2012
H.Merijn Brand syntax highlight changes afe4ba1
H.Merijn Brand Resolve XFT naming conflict ba2f739
H.Merijn Brand Resolve stdio getline naming conflict 076cf4a
Showing with 61 additions and 59 deletions.
  1. +5 −3 data/elvis.syn
  2. +44 −44 guix11/xdialog.c
  3. +7 −7 guix11/xdialog.h
  4. +5 −5 ref.c
View
8 data/elvis.syn
@@ -1098,9 +1098,11 @@ keyword KEY KEYS
keyword LABEL LAST_RECORD LEFT LIKE LIST LIST_INDEX LIST_LOWER_BOUNDS
keyword LIST_UPPER_BOUNDS LOCAL LOCATION LOCKED_IN_CACHE LOWER LOW_INTENSITY
keyword MATRIX MENU_LABEL MULTI_VALUED
-keyword NEXT NEXT_FIELD NEXT_FORM NEXT_RECORD NO_CONSISTENCY NONE NOT NULL NUMBER_OF_ARRAYS NUMERIC
+keyword NEXT NEXT_FIELD NEXT_FORM NEXT_RECORD NEXT_SET NO_CONSISTENCY NONE NOT
+keyword NULL NUMBER_OF_ARRAYS NUMERIC
keyword OCCURRENCES ON OPERATION OR ORDER ORDERED_BY OUTPUT
-keyword PAGE PIPELINE PREV_FIELD PREVIOUS_FIELD PREV_FORM PREVIOUS_FORM PREVIOUS_RECORD PREVIOUS
+keyword PAGE PIPELINE PREV_FIELD PREVIOUS_FIELD PREV_FORM PREVIOUS_FORM
+keyword PREVIOUS_RECORD PREV_SET PREVIOUS_SET PREVIOUS
keyword QUEUE
keyword RECORD RECORD_CONSISTENCY REF REFERENCE REFRESH REJECT REPAINT REPEAT
keyword REPEATED REQUIRED RESTART RESULT RETRIEVE RETRIEVE_VALUE RETURN REVERSE
@@ -1332,7 +1334,7 @@ comment !!
comment =
# RPT
-# Contributed by H.Merijn Brand <merijn@hempseed.com>
+# Contributed by H.Merijn Brand <h.m.brand@hccnet.nl>
language RPT
extension .rpt
keyword after amount and avg before begin binary bootm centered col column comb
View
88 guix11/xdialog.c
@@ -149,7 +149,7 @@ static void drawtext(dia, row)
cursor = dia->cursor, shift = dia->shift;
else
cursor = CHARlen(dia->field[row].value), shift = 0;
- if (dia->field[row].ft == FT_NUMBER)
+ if (dia->field[row].ft == EFT_NUMBER)
length = NUMBER_LENGTH;
else
length = STRING_LENGTH;
@@ -168,7 +168,7 @@ static void drawtext(dia, row)
/* all fields except locked ones are drawn in a recessed bevel */
x = dia->x0 + dia->rowh + 2;
y = dia->y0 + row * dia->rowh;
- if (dia->field[row].ft != FT_LOCKED)
+ if (dia->field[row].ft != EFT_LOCKED)
{
/* Make a dummy X11WIN structure. I wish now that I hadn't
* made it an argument to the x_drawbevel() function. Sigh.
@@ -193,7 +193,7 @@ static void drawtext(dia, row)
XSetBackground(x_display, dia->gc,
colorinfo[x_toolcolors].bg);
XSetFont(x_display, dia->gc, x_defaultnormal->fontinfo->fid);
- if (dia->field[row].ft == FT_LOCKED)
+ if (dia->field[row].ft == EFT_LOCKED)
{
XSetForeground(x_display, dia->gc, colorinfo[x_toolbarcolors].fg);
x_drawstring(x_display, dia->win, dia->gc,
@@ -210,7 +210,7 @@ static void drawtext(dia, row)
}
/* if this is the current row, then draw the cursor too. */
- if (row == dia->current && dia->field[row].ft != FT_LOCKED)
+ if (row == dia->current && dia->field[row].ft != EFT_LOCKED)
{
XSetForeground(x_display, dia->gc, colorinfo[x_cursorcolors].fg);
XFillRectangle(x_display, dia->win, dia->gc,
@@ -229,7 +229,7 @@ static void parsespec(dia)
char *label; /* label of next field */
char *name; /* name of next field's option */
X_FIELDTYPE ft; /* type of next field */
- char *limit; /* list for FT_ONEOF, or min:max for FT_NUMBER */
+ char *limit; /* list for EFT_ONEOF, or min:max for EFT_NUMBER */
char *expr; /* default value -- an expression */
char *value; /* the actual value, as a string */
char *end; /* end of the spec string */
@@ -250,7 +250,7 @@ static void parsespec(dia)
* original string, we can insert '\0' characters where convenient.
*/
label = name = limit = expr = NULL;
- ft = FT_DEFAULT;
+ ft = EFT_DEFAULT;
skipto = '\0';
for (scan = dia->spec, end = &scan[strlen(scan) + 1]; scan < end; scan++)
{
@@ -280,17 +280,17 @@ static void parsespec(dia)
if (name && (value = tochar8(optgetstr(toCHAR(name), &desc))) != NULL)
{
/* if no explicit type, then guess */
- if (ft == FT_DEFAULT)
+ if (ft == EFT_DEFAULT)
{
limit = desc->limit;
if (optval(name)->flags & OPT_LOCK)
- ft = FT_LOCKED;
+ ft = EFT_LOCKED;
else if (desc->asstring == optnstring)
- ft = FT_NUMBER;
+ ft = EFT_NUMBER;
else if (desc->asstring == optsstring)
- ft = FT_STRING;
+ ft = EFT_STRING;
else if (desc->asstring == opt1string)
- ft = FT_ONEOF;
+ ft = EFT_ONEOF;
else if (desc->asstring == opttstring)
{
/* tab list: default is to
@@ -299,14 +299,14 @@ static void parsespec(dia)
*/
if (CHARchr(value, ',')
|| atoi(tochar8(value)) == 0)
- ft = FT_STRING;
+ ft = EFT_STRING;
else
- ft = FT_NUMBER;
+ ft = EFT_NUMBER;
limit = "1:400";
}
else
{
- ft = FT_ONEOF;
+ ft = EFT_ONEOF;
limit = truefalse;
}
}
@@ -318,7 +318,7 @@ static void parsespec(dia)
value = expr;
/* for boolean, force value to "true"/"false" */
- if (ft == FT_ONEOF && limit == truefalse)
+ if (ft == EFT_ONEOF && limit == truefalse)
{
value = tochar8(calctrue(toCHAR(value)) ? o_true : o_false);
}
@@ -369,26 +369,26 @@ static void parsespec(dia)
dia->field[dia->nfields].name = " ";
dia->field[dia->nfields].value = CHARdup(toCHAR(value));
dia->field[dia->nfields].limit = limit;
- dia->field[dia->nfields].ft = FT_LOCKED;
+ dia->field[dia->nfields].ft = EFT_LOCKED;
dia->nfields++;
}
}
/* prepare for next field */
label = name = limit = expr = NULL;
- ft = FT_DEFAULT;
+ ft = EFT_DEFAULT;
break;
case '(':
/* the following character indicates the type */
switch (scan[1])
{
- case 'b': ft = FT_ONEOF, limit = truefalse; break;
- case 'o': ft = FT_ONEOF, limit = scan; break;
- case 'n': ft = FT_NUMBER, limit = scan; break;
- case 's': ft = FT_STRING; break;
- case 'f': ft = FT_FILE; break;
- case 'l': ft = FT_LOCKED; break;
+ case 'b': ft = EFT_ONEOF, limit = truefalse; break;
+ case 'o': ft = EFT_ONEOF, limit = scan; break;
+ case 'n': ft = EFT_NUMBER, limit = scan; break;
+ case 's': ft = EFT_STRING; break;
+ case 'f': ft = EFT_FILE; break;
+ case 'l': ft = EFT_LOCKED; break;
}
/* trim leading spaces from the limit string */
@@ -543,7 +543,7 @@ void x_dl_add(xw, name, desc, vicmd, excmd, spec)
x = dia->x0 + dia->rowh + 2;
switch (dia->field[i].ft)
{
- case FT_ONEOF:
+ case EFT_ONEOF:
for (s = dia->field[i].limit; *s; s++)
{
if (s == dia->field[i].limit
@@ -557,8 +557,8 @@ void x_dl_add(xw, name, desc, vicmd, excmd, spec)
}
break;
- case FT_STRING:
- case FT_FILE:
+ case EFT_STRING:
+ case EFT_FILE:
button = addbutton(dia, "<", 'l', ELVCTRL('L'));
button->y = dia->y0 + dia->rowh * i;
button->x = dia->x0 + 3;
@@ -572,12 +572,12 @@ void x_dl_add(xw, name, desc, vicmd, excmd, spec)
x += dia->rowh;
break;
- case FT_LOCKED:
+ case EFT_LOCKED:
dia->field[i].twidth = CHARlen(dia->field[i].value) * dia->cellw + 4;
x += dia->field[i].twidth + 2 + dia->rowh;
break;
- case FT_NUMBER:
+ case EFT_NUMBER:
dia->field[i].twidth = NUMBER_LENGTH * dia->cellw + 4;
x += dia->field[i].twidth + 2;
@@ -1018,7 +1018,7 @@ static void keystroke(dia, key)
/* store the values of all options */
eventfocus((GUIWIN *)dia->xw, ElvFalse);
for (i = 0; i < dia->nfields; i++)
- if (dia->field[i].ft != FT_LOCKED)
+ if (dia->field[i].ft != EFT_LOCKED)
optputstr(toCHAR(dia->field[i].name),
dia->field[i].value, ElvFalse);
@@ -1075,11 +1075,11 @@ static void keystroke(dia, key)
newvalue = dia->field[dia->current].value;
switch (dia->field[dia->current].ft)
{
- case FT_ONEOF:
+ case EFT_ONEOF:
newvalue = keyoneof(dia, key);
break;
- case FT_NUMBER:
+ case EFT_NUMBER:
l = atol(tochar8(newvalue));
switch (key)
{
@@ -1120,11 +1120,11 @@ static void keystroke(dia, key)
dia->cursor = CHARlen(newvalue);
break;
- case FT_STRING:
+ case EFT_STRING:
newvalue = keystring(dia, key);
break;
- case FT_FILE:
+ case EFT_FILE:
#ifdef FEATURE_COMPLETE
if (key == '\t')
{
@@ -1146,8 +1146,8 @@ static void keystroke(dia, key)
}
break;
- case FT_DEFAULT:
- case FT_LOCKED:
+ case EFT_DEFAULT:
+ case EFT_LOCKED:
break;
}
@@ -1191,10 +1191,10 @@ static void exposerow(dia, row, fromscratch)
/* draw the text field, if there is one */
switch (dia->field[row].ft)
{
- case FT_STRING:
- case FT_FILE:
- case FT_NUMBER:
- case FT_LOCKED:
+ case EFT_STRING:
+ case EFT_FILE:
+ case EFT_NUMBER:
+ case EFT_LOCKED:
drawtext(dia, row);
break;
@@ -1212,15 +1212,15 @@ static void exposerow(dia, row, fromscratch)
/* choose a button state -- method varies with data type */
switch (dia->field[row].ft)
{
- case FT_ONEOF:
+ case EFT_ONEOF:
if (*dia->field[row].value == *button->label)
newstate = -2;
else
newstate = 2;
break;
- case FT_STRING:
- case FT_FILE:
+ case EFT_STRING:
+ case EFT_FILE:
if (button->shape == 'l')
if (row == dia->current
? dia->shift > 0
@@ -1235,7 +1235,7 @@ static void exposerow(dia, row, fromscratch)
newstate = 0;
break;
- case FT_NUMBER:
+ case EFT_NUMBER:
newstate = 2;
break;
@@ -1456,7 +1456,7 @@ void x_dl_event(w, event)
*/
if (event->xbutton.button == 4 || event->xbutton.button == 5)
{
- if (dia->field[dia->current].ft == FT_NUMBER)
+ if (dia->field[dia->current].ft == EFT_NUMBER)
if (event->xbutton.button == 4)
key = '+';
else
View
14 guix11/xdialog.h
@@ -1,19 +1,19 @@
/* xdialog.h */
typedef enum {
- FT_DEFAULT, /* dummy value, for fields with no explicit type */
- FT_ONEOF, /* one of a preset list; includes boolean */
- FT_NUMBER, /* numeric field */
- FT_STRING, /* string field */
- FT_FILE, /* string field where <Tab> does filename completion */
- FT_LOCKED /* non-editable field */
+ EFT_DEFAULT, /* dummy value, for fields with no explicit type */
+ EFT_ONEOF, /* one of a preset list; includes boolean */
+ EFT_NUMBER, /* numeric field */
+ EFT_STRING, /* string field */
+ EFT_FILE, /* string field where <Tab> does filename completion */
+ EFT_LOCKED /* non-editable field */
} X_FIELDTYPE;
typedef struct
{
CHAR *label; /* displayed name of the option */
char *name; /* actual name of the option */
CHAR *value; /* option's current value */
- char *limit; /* legal values, for FT_ONEOF or FT_NUMBER */
+ char *limit; /* legal values, for EFT_ONEOF or EFT_NUMBER */
X_FIELDTYPE ft; /* input type */
unsigned lwidth;/* width of the label */
unsigned twidth;/* width of the text field, if there is one */
View
10 ref.c
@@ -42,7 +42,7 @@ typedef enum
#if USE_PROTOTYPES
static void usage(char *argv0);
-static char *getline(FILE *fp);
+static char *elv_getline(FILE *fp);
static void store(char *line, char **list);
static LINECLS classify(char *line, LINECLS prev);
static void lookup(TAG *tag);
@@ -171,7 +171,7 @@ ELVBOOL ioclose()
/* This function reads a single line, and replaces the terminating newline with
* a '\0' byte. The string will be in a static buffer. Returns NULL at EOF.
*/
-static char *getline(fp)
+static char *elv_getline(fp)
FILE *fp;
{
int ch;
@@ -348,7 +348,7 @@ static void lookup(tag)
}
/* for each line... */
- for (lnum = 1, lc = LC_COMPLETE; (line = getline(fp)) != NULL; lnum++)
+ for (lnum = 1, lc = LC_COMPLETE; (line = elv_getline(fp)) != NULL; lnum++)
{
/* is this the tag definition? */
if (taglnum > 0 ? taglnum == lnum : !strncmp(tagline, line, len))
@@ -377,7 +377,7 @@ static void lookup(tag)
{
if (strchr(line, '(') != NULL)
{
- while ((line = getline(fp)) != NULL
+ while ((line = elv_getline(fp)) != NULL
&& *line
&& ((*line != '#' && *line != '{')
|| line[strlen(line) - 1] == '\\'))
@@ -387,7 +387,7 @@ static void lookup(tag)
}
else if ((lc = classify(line, lc)) == LC_PARTIAL)
{
- while ((line = getline(fp)) != NULL
+ while ((line = elv_getline(fp)) != NULL
&& (lc = classify(line, lc)) == LC_PARTIAL)
{
puts(line);

No commit comments for this range

Something went wrong with that request. Please try again.