Changeset 1559 for branches/stable


Ignore:
Timestamp:
Jul 25, 2007, 12:36:06 AM (12 years ago)
Author:
bruno
Message:

Improve mr_conf error messages

Location:
branches/stable/mondo/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/src/include/my-stuff.h

    r1529 r1559  
    259259 * Log file, function, line, and @p x.
    260260 */
    261 #define iamhere(x) {log_it("%s, %s, %ld: %s", __FILE__, __FUNCTION__, __LINE__, x);}
     261#define iamhere(x) {mr_msg(2, x);}
    262262
    263263/**
  • branches/stable/mondo/src/lib/mr_conf.c

    r1545 r1559  
    5454
    5555/*warnings*/
    56 #define MRCONF_STR_SET_TO_ZERO    _("variable will be set to 0")
     56#define MRCONF_STR_SET_TO_ZERO    _("variable will be set to 0:")
    5757#define MRCONF_STR_IGNORE    _("has no value, ignoring it")
    5858#define MRCONF_STR_CLOSE_BUT_NOT_OPEN _("attempt to close mr_conf but it has not been opened yet")
     
    231231
    232232    if (*p != '"') {
    233         mr_conf_error_msg(MRCONF_STRING_QUOTE, "");
     233        mr_conf_error_msg(MRCONF_STRING_QUOTE, field_name);
    234234        return (NULL);
    235235    }
     
    240240    r--;
    241241    if (*r != '"') {
    242         mr_conf_error_msg(MRCONF_STRING_QUOTE, "");
     242        mr_conf_error_msg(MRCONF_STRING_QUOTE, field_name);
    243243        return (NULL);
    244244    }
     
    321321            }
    322322            if (buffer[i] == (char) 0) {
    323                 mr_conf_error_msg(MRCONF_STRING_ENDQUOTE, "");
     323                mr_conf_error_msg(MRCONF_STRING_ENDQUOTE, buffer);
    324324            }
    325325        }
     
    389389        switch (error_code) {
    390390        case MRCONF_BAD_FILE:
    391             mr_msg_int(1,line,file,"%s %s %s\n", MRCONF_STR_ERROR, MRCONF_STR_BAD_FILE,
     391            mr_msg_int(1,line,file,"%s %s %s", MRCONF_STR_ERROR, MRCONF_STR_BAD_FILE,
    392392                   add_line);
    393393            break;
    394394
    395395        case MRCONF_READING_FAILED:
    396             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
     396            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_READING_FAILED);
    397397            break;
    398398
    399399        case MRCONF_FIELD_NOT_FOUND:
    400             mr_msg_int(1,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NOT_FOUND, add_line);
    401             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_SET_TO_ZERO);
     400            mr_msg_int(1,line,file,"%s %s \"%s\"", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NOT_FOUND, add_line);
     401            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_SET_TO_ZERO);
    402402            break;
    403403
    404404        case MRCONF_FIELD_NO_VALUE:
    405             mr_msg_int(1,line,file,"%s %s \"%s\"\n", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NO_VALUE, add_line);
    406             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_IGNORE);
     405            mr_msg_int(1,line,file,"%s %s \"%s\"", MRCONF_STR_ERROR, MRCONF_STR_FIELD_NO_VALUE, add_line);
     406            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_IGNORE);
    407407            break;
    408408
    409409        case MRCONF_CLOSE_BUT_NOT_OPEN:
    410             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
     410            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_CLOSE_BUT_NOT_OPEN);
    411411            break;
    412412
    413413        case MRCONF_CALL_BUT_NOT_OPEN:
    414             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_WARNING, MRCONF_STR_CALL_BUT_NOT_OPEN);
     414            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_WARNING, MRCONF_STR_CALL_BUT_NOT_OPEN);
    415415            break;
    416416
    417417        case MRCONF_OPEN_OPENED:
    418             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_OPEN_OPENED);
     418            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_OPEN_OPENED);
    419419            break;
    420420
    421421        case MRCONF_STRING_QUOTE:
    422             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_STRING_QUOTE);
     422            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_STRING_QUOTE);
    423423            break;
    424424
    425425        case MRCONF_STRING_ENDQUOTE:
    426             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_STRING_ENDQUOTE);
     426            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_STRING_ENDQUOTE);
    427427            break;
    428428
    429429        default:
    430             mr_msg_int(1,line,file,"%s %s\n", MRCONF_STR_ERROR, MRCONF_STR_DEFAULT_ERROR);
    431             break;
    432         }
    433     }
    434 }
     430            mr_msg_int(1,line,file,"%s %s", MRCONF_STR_ERROR, MRCONF_STR_DEFAULT_ERROR);
     431            break;
     432        }
     433    }
     434}
Note: See TracChangeset for help on using the changeset viewer.