"Fossies" - the Fresh Open Source Software Archive

Member "cook-2.34/common/timing.h" (25 Sep 2010, 1460 Bytes) of package /linux/misc/old/cook-2.34.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "timing.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  *      cook - file construction tool
    3  *      Copyright (C) 1997, 2006-2008 Peter Miller
    4  *
    5  *      This program is free software; you can redistribute it and/or modify
    6  *      it under the terms of the GNU General Public License as published by
    7  *      the Free Software Foundation; either version 3 of the License, or
    8  *      (at your option) any later version.
    9  *
   10  *      This program is distributed in the hope that it will be useful,
   11  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
   12  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13  *      GNU General Public License for more details.
   14  *
   15  *      You should have received a copy of the GNU General Public License
   16  *      along with this program. If not, see
   17  *      <http://www.gnu.org/licenses/>.
   18  */
   19 
   20 #ifndef COMMON_TIMING_H
   21 #define COMMON_TIMING_H
   22 
   23 #include <common/main.h>
   24 
   25 #ifdef __GNUC__
   26 
   27 void timing_register(char *, void **);
   28 void timing_push(void *);
   29 void timing_pop(void *);
   30 
   31 #define timing_entry() do { static void *__timing_p; if (!__timing_p) \
   32 timing_register( __FILE__ ":" __FUNCTION__, &__timing_p); \
   33 timing_push(__timing_p); } while (0)
   34 
   35 #define timing_exit() do { static void *__timing_p; if (!__timing_p) \
   36 timing_register( __FILE__ ":" __FUNCTION__, &__timing_p); \
   37 timing_pop(__timing_p); } while (0)
   38 
   39 #else
   40 
   41 #define timing_entry() ((void)0)
   42 #define timing_exit() ((void)0)
   43 
   44 #endif
   45 
   46 void timing_print(void);
   47 
   48 #endif /* COMMON_TIMING_H */