OpenScop  0.9.0
symbols.h
Go to the documentation of this file.
00001 
00002     /*+-----------------------------------------------------------------**
00003      **                       OpenScop Library                          **
00004      **-----------------------------------------------------------------**
00005      **                     extensions/symbols.h                        **
00006      **-----------------------------------------------------------------**
00007      **                   First version: 07/03/2012                     **
00008      **-----------------------------------------------------------------**
00009 
00010  
00011  *****************************************************************************
00012  * OpenScop: Structures and formats for polyhedral tools to talk together    *
00013  *****************************************************************************
00014  *    ,___,,_,__,,__,,__,,__,,_,__,,_,__,,__,,___,_,__,,_,__,                *
00015  *    /   / /  //  //  //  // /   / /  //  //   / /  // /  /|,_,             *
00016  *   /   / /  //  //  //  // /   / /  //  //   / /  // /  / / /\             *
00017  *  |~~~|~|~~~|~~~|~~~|~~~|~|~~~|~|~~~|~~~|~~~|~|~~~|~|~~~|/_/  \            *
00018  *  | G |C| P | = | L | P |=| = |C| = | = | = |=| = |=| C |\  \ /\           *
00019  *  | R |l| o | = | e | l |=| = |a| = | = | = |=| = |=| L | \# \ /\          *
00020  *  | A |a| l | = | t | u |=| = |n| = | = | = |=| = |=| o | |\# \  \         *
00021  *  | P |n| l | = | s | t |=| = |d| = | = | = | |   |=| o | | \# \  \        *
00022  *  | H | | y |   | e | o | | = |l|   |   | = | |   | | G | |  \  \  \       *
00023  *  | I | |   |   | e |   | |   | |   |   |   | |   | |   | |   \  \  \      *
00024  *  | T | |   |   |   |   | |   | |   |   |   | |   | |   | |    \  \  \     *
00025  *  | E | |   |   |   |   | |   | |   |   |   | |   | |   | |     \  \  \    *
00026  *  | * |*| * | * | * | * |*| * |*| * | * | * |*| * |*| * | /      \* \  \   *
00027  *  | O |p| e | n | S | c |o| p |-| L | i | b |r| a |r| y |/        \  \ /   *
00028  *  '---'-'---'---'---'---'-'---'-'---'---'---'-'---'-'---'          '--'    *
00029  *                                                                           *
00030  * Copyright (C) 2008 University Paris-Sud 11 and INRIA                      *
00031  *                                                                           *
00032  * (3-clause BSD license)                                                    *
00033  * Redistribution and use in source  and binary forms, with or without       *
00034  * modification, are permitted provided that the following conditions        *
00035  * are met:                                                                  *
00036  *                                                                           *
00037  * 1. Redistributions of source code must retain the above copyright notice, *
00038  *    this list of conditions and the following disclaimer.                  *
00039  * 2. Redistributions in binary form must reproduce the above copyright      *
00040  *    notice, this list of conditions and the following disclaimer in the    *
00041  *    documentation and/or other materials provided with the distribution.   *
00042  * 3. The name of the author may not be used to endorse or promote products  *
00043  *    derived from this software without specific prior written permission.  *
00044  *                                                                           *
00045  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR      *
00046  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES *
00047  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.   *
00048  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,          *
00049  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT  *
00050  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
00051  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     *
00052  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       *
00053  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF  *
00054  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.         *
00055  *                                                                           *
00056  * OpenScop Library, a library to manipulate OpenScop formats and data       *
00057  * structures. Written by:                                                   *
00058  * Cedric Bastoul     <Cedric.Bastoul@u-psud.fr> and                         *
00059  * Louis-Noel Pouchet <Louis-Noel.pouchet@inria.fr>                          *
00060  * Prasanth Chatharasi <prasanth@iith.ac.in>                                 *
00061  *                                                                           *
00062  *****************************************************************************/
00063 
00064 
00065 #ifndef OSL_SYMBOLS_H
00066 # define OSL_SYMBOLS_H
00067 
00068 # include <stdio.h>
00069 # include <osl/interface.h>
00070 # include <osl/relation.h>
00071 # include <osl/generic.h>
00072 
00073 # if defined(__cplusplus)
00074 extern "C"
00075   {
00076 # endif
00077 
00078 # define OSL_URI_SYMBOLS        "symbols"
00079 
00083 struct osl_symbols {
00084   int           type;        
00085   int           generated;   
00086   int           nb_dims;     
00087   osl_generic_p identifier;  
00088   osl_generic_p datatype;    
00089   osl_generic_p scope;       
00090   osl_generic_p extent;      
00092   void*         usr;         
00093   struct osl_symbols* next;
00094 };
00095 typedef struct osl_symbols  osl_symbols_t;
00096 typedef struct osl_symbols* osl_symbols_p;
00097 
00098 
00099 /*+***************************************************************************
00100  *                          Structure display function                       *
00101  *****************************************************************************/
00102 void            osl_symbols_idump(FILE *, osl_symbols_p, int);
00103 void            osl_symbols_dump(FILE *, osl_symbols_p);
00104 char *          osl_symbols_sprint(osl_symbols_p);
00105 
00106 
00107 /*****************************************************************************
00108  *                               Reading function                            *
00109  *****************************************************************************/
00110 osl_symbols_p   osl_symbols_sread(char **);
00111 
00112 
00113 /*+***************************************************************************
00114  *                    Memory allocation/deallocation function                *
00115  *****************************************************************************/
00116 osl_symbols_p   osl_symbols_malloc();
00117 void            osl_symbols_free(osl_symbols_p);
00118 
00119 
00120 /*+***************************************************************************
00121  *                            Processing functions                           *
00122  *****************************************************************************/
00123 void            osl_symbols_add(osl_symbols_p*, osl_symbols_p);
00124 osl_symbols_p   osl_symbols_nclone(osl_symbols_p, int);
00125 osl_symbols_p   osl_symbols_clone(osl_symbols_p);
00126 int             osl_symbols_equal(osl_symbols_p, osl_symbols_p);
00127 osl_symbols_p   osl_symbols_lookup(osl_symbols_p, osl_generic_p);
00128 osl_symbols_p   osl_symbols_remove(osl_symbols_p*, osl_symbols_p);
00129 int             osl_symbols_get_nb_symbols(osl_symbols_p);
00130 osl_interface_p osl_symbols_interface();
00131 
00132 
00133 # if defined(__cplusplus)
00134   }
00135 # endif
00136 
00137 #endif /* define OSL_SYMBOLS_H */