"Fossies" - the Fresh Open Source Software Archive

Member "FunctionCheck-3.2.0/src/fcdump/fc_graph.h" (26 May 2012, 2995 Bytes) of package /linux/privat/old/FunctionCheck-3.2.0.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.

    1 /*
    2  * FunctionCheck profiler
    3  * (C) Copyright 2000-2012 Yannick Perret
    4  * 
    5  *  This program is free software; you can redistribute it and/or
    6  *  modify it under the terms of the GNU General Public License as
    7  *  published by the Free Software Foundation; either version 2 of the
    8  *  License, or (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 GNU
   13  *  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, write to the Free Software
   17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   18  */
   19 /** fc_graph.h:  **/
   20 
   21 #ifndef __fc_graph_h_
   22 #define __fc_graph_h_
   23 
   24 #include <stdio.h>
   25 #include <stdlib.h>
   26 
   27 #include "fc_dump.h"
   28 
   29 /* structure of a node (for the call-graph) */
   30 typedef struct _FC_Node FC_Node;
   31 struct _FC_Node
   32 {
   33   FC_Function *function;/* corresponding function */
   34   FC_Node **nexts;      /* list of childs (ended by NULL) */
   35   FC_Node **prevs;      /* list of callers (ended by NULL) */
   36   int *nnexts;          /* number values */
   37   int *nprevs;          /* number values */
   38   int keep;             /* bool: if true, the function is keeped */
   39   int treated;          /* bool+: used to propagate "keep" */
   40   int tag;              /* tag for cycle detection */
   41 };
   42 
   43 /** functions **/
   44 
   45 /* perform all treatments to generate the call-graph */
   46 int fc_graph_create(int *_nb_arcs, FC_Arc *arcs,
   47                     int nb_fncs, FC_Function *fncs,
   48                     FC_NSym *only, int nb_only,
   49                     FC_NSym *not,  int nb_not,
   50                     int propagate, int rpropagate);
   51 
   52 /* remove all nodes created */
   53 int fc_graph_delete(int nb_arcs, FC_Arc *arcs,
   54                     int nb_fncs, FC_Function *fncs);
   55 
   56 /* create a new node for a given function */
   57 FC_Node *fc_create_node(FC_Function *function);
   58 
   59 /* delete a node */
   60 FC_Node *fc_delete_node(FC_Node *node);
   61 
   62 /* add a child to a node */
   63 int fc_add_child(FC_Node *node, FC_Node *child, int nb);
   64 
   65 /* add a parent to a node */
   66 int fc_add_prev(FC_Node *node, FC_Node *prev, int nb);
   67 
   68 /* propagate given value (0/1) from the given node */ 
   69 void fc_propagate_to_child(FC_Node*node, int val);
   70 
   71 /* retro-propagate given value (0/1) from the given node */ 
   72 void fc_propagate_to_caller(FC_Node*node, int val);
   73 
   74 /* propagate given value (0/1) from the given node */ 
   75 void fc_propagate_to_child_p(FC_Node*node);
   76 
   77 /* retro-propagate given value (0/1) from the given node */ 
   78 void fc_propagate_to_caller_p(FC_Node*node);
   79 
   80 /* propagate tags to nodes */
   81 void fc_tag_nodes(FC_Node *node, int tag);
   82 void fc_display_recurs(int options, FC_Node *node, unsigned int nc);
   83 void fc_display_cycle(int options, FC_Node *end, FC_Node *start, unsigned int nc);
   84 
   85 /* compute list of cycles */
   86 int fc_compute_cycles(int options);
   87 
   88 #endif /* __fc_graph_h_ */