/* Update the color information based on the current filename. */
void color_update(void)
{
- syntaxtype *tmpsyntax;
+ syntaxtype *sint;
colortype *tmpcolor;
assert(openfile != NULL);
if (strcmp(syntaxstr, "none") == 0)
return;
- for (tmpsyntax = syntaxes; tmpsyntax != NULL;
- tmpsyntax = tmpsyntax->next) {
- if (strcmp(tmpsyntax->desc, syntaxstr) == 0) {
- openfile->syntax = tmpsyntax;
- openfile->colorstrings = tmpsyntax->color;
+ for (sint = syntaxes; sint != NULL; sint = sint->next) {
+ if (strcmp(sint->desc, syntaxstr) == 0) {
+ openfile->syntax = sint;
+ openfile->colorstrings = sint->color;
}
if (openfile->colorstrings != NULL)
if (fullname == NULL)
fullname = mallocstrcpy(fullname, openfile->filename);
- for (tmpsyntax = syntaxes; tmpsyntax != NULL;
- tmpsyntax = tmpsyntax->next) {
-
- if (found_in_list(tmpsyntax->extensions, fullname)) {
- openfile->syntax = tmpsyntax;
- openfile->colorstrings = tmpsyntax->color;
+ for (sint = syntaxes; sint != NULL; sint = sint->next) {
+ if (found_in_list(sint->extensions, fullname)) {
+ openfile->syntax = sint;
+ openfile->colorstrings = sint->color;
}
}
#ifdef DEBUG
fprintf(stderr, "No result from file extension, trying headerline...\n");
#endif
- for (tmpsyntax = syntaxes; tmpsyntax != NULL;
- tmpsyntax = tmpsyntax->next) {
-
- if (found_in_list(tmpsyntax->headers, openfile->fileage->data)) {
- openfile->syntax = tmpsyntax;
- openfile->colorstrings = tmpsyntax->color;
+ for (sint = syntaxes; sint != NULL; sint = sint->next) {
+ if (found_in_list(sint->headers, openfile->fileage->data)) {
+ openfile->syntax = sint;
+ openfile->colorstrings = sint->color;
}
}
}
/* Now try and find a syntax that matches the magicstring. */
if (magicstring != NULL) {
- for (tmpsyntax = syntaxes; tmpsyntax != NULL;
- tmpsyntax = tmpsyntax->next) {
- if (found_in_list(tmpsyntax->magics, magicstring)) {
- openfile->syntax = tmpsyntax;
- openfile->colorstrings = tmpsyntax->color;
+ for (sint = syntaxes; sint != NULL; sint = sint->next) {
+ if (found_in_list(sint->magics, magicstring)) {
+ openfile->syntax = sint;
+ openfile->colorstrings = sint->color;
break;
}
}
/* If we didn't find any syntax yet, see if there is a default one. */
if (openfile->colorstrings == NULL) {
- for (tmpsyntax = syntaxes; tmpsyntax != NULL;
- tmpsyntax = tmpsyntax->next) {
- if (strcmp(tmpsyntax->desc, "default") == 0) {
- openfile->syntax = tmpsyntax;
- openfile->colorstrings = tmpsyntax->color;
+ for (sint = syntaxes; sint != NULL; sint = sint->next) {
+ if (strcmp(sint->desc, "default") == 0) {
+ openfile->syntax = sint;
+ openfile->colorstrings = sint->color;
break;
}
}