|
From: Danny B. <dan...@us...> - 2008-10-08 18:24:03
|
Update of /cvsroot/roadmap/roadmap/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv4445 Modified Files: buildmap_messages.c Log Message: Add documentation, mostly stubs though. Get buildmap_set_source to accept a NULL parameter, the other code could cope with it already. Index: buildmap_messages.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_messages.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildmap_messages.c 3 Dec 2007 18:29:04 -0000 1.6 --- buildmap_messages.c 8 Oct 2008 18:23:57 -0000 1.7 *************** *** 1,7 **** ! /* buildmap_messages.c - a module for managing uniform error & info messages. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright (c) 2008, Danny Backx. * * This file is part of RoadMap. *************** *** 20,38 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * void buildmap_set_source (char *name); ! * void buildmap_set_line (int line); ! * void buildmap_error (int column, char *format, ...); ! * void buildmap_fatal (int column, char *format, ...); ! * void buildmap_progress (int done, int estimated); ! * void buildmap_info (char *format, ...); ! * void buildmap_summary (int verbose, char *format, ...); ! * void buildmap_verbose (char *format, ...); ! * void buildmap_is_verbose (void); ! * int buildmap_get_error_count (void); ! * int buildmap_get_error_total (void); ! * void buildmap_message_level (int); * * This module is used to control and manage the appearance of messages --- 20,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! /** ! * @file ! * @brief a module for managing uniform error & info messages. * * This module is used to control and manage the appearance of messages *************** *** 67,81 **** BuildMapMessageLevel += level; if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); } ! void buildmap_set_source (const char *name) { const char *p; /* Get the file's base name (for error display purpose). */ - p = strrchr (name, '/'); --- 56,80 ---- BuildMapMessageLevel += level; + #ifndef _WIN32 if (BuildMapMessageLevel >= BUILDMAP_MESSAGE_VERBOSE) setbuf(stdout, NULL); + #endif } ! /** ! * @brief set the name of the file we're processing, to be used in error reporting ! * @param name the file name, or NULL to erase previous setting ! */ void buildmap_set_source (const char *name) { const char *p; + if (name == NULL) { + if (SourceFile) + free(SourceFile); + SourceFile = NULL; + return; + } /* Get the file's base name (for error display purpose). */ p = strrchr (name, '/'); *************** *** 95,98 **** --- 94,101 ---- } + /** + * @brief indicate which line number we're processing + * @param line the number + */ void buildmap_set_line (int line) { *************** *** 100,104 **** } ! static void buildmap_show_source (FILE *output, const char *preamble, int column) { --- 103,112 ---- } ! /** ! * @brief ! * @param output ! * @param preamble ! * @param column ! */ static void buildmap_show_source (FILE *output, const char *preamble, int column) { *************** *** 119,123 **** } ! void buildmap_error (int column, const char *format, ...) { --- 127,135 ---- } ! /** ! * @brief print an error message ! * @param column ! * @param format ! */ void buildmap_error (int column, const char *format, ...) { *************** *** 154,158 **** } ! void buildmap_fatal (int column, const char *format, ...) { --- 166,174 ---- } ! /** ! * @brief print an error message and terminate the application ! * @param column ! * @param format ! */ void buildmap_fatal (int column, const char *format, ...) { *************** *** 186,190 **** } ! void buildmap_progress (int done, int estimated) { --- 202,210 ---- } ! /** ! * @brief ! * @param done ! * @param estimated ! */ void buildmap_progress (int done, int estimated) { *************** *** 202,206 **** } ! void buildmap_info (const char *format, ...) { --- 222,229 ---- } ! /** ! * @brief print an informational message ! * @param format ! */ void buildmap_info (const char *format, ...) { *************** *** 220,223 **** --- 243,250 ---- } + /** + * @brief + * @return + */ int buildmap_is_verbose (void) { *************** *** 225,228 **** --- 252,259 ---- } + /** + * @brief + * @param format + */ void buildmap_verbose (const char *format, ...) { *************** *** 239,243 **** } ! void buildmap_summary (int verbose, const char *format, ...) { --- 270,278 ---- } ! /** ! * @brief ! * @param verbose ! * @param format ! */ void buildmap_summary (int verbose, const char *format, ...) { *************** *** 275,289 **** } ! int buildmap_get_error_count (void) { return ErrorCount; } ! int buildmap_get_error_total (void) { return ErrorTotal; } ! void buildmap_check_allocated_with_source_line (char *source, int line, const void *allocated) { --- 310,335 ---- } ! /** ! * @brief ! * @return ! */ int buildmap_get_error_count (void) { return ErrorCount; } ! /** ! * @brief ! * @return ! */ int buildmap_get_error_total (void) { return ErrorTotal; } ! /** ! * @brief ! * @param source ! * @param line ! * @param allocated ! */ void buildmap_check_allocated_with_source_line (char *source, int line, const void *allocated) { |