switch to new MPL based Fraunhofer FOKUS Public License
[senf.git] / senf / Packets / ParseHelpers.ih
index 6dc6bf5..96127c9 100644 (file)
@@ -1,26 +1,31 @@
-# // Copyright (C) 2007
-# // Fraunhofer Institute for Open Communication Systems (FOKUS)
-# // Competence Center NETwork research (NET), St. Augustin, GERMANY
-# //     Stefan Bund <g0dil@berlios.de>
-# //
-# // This program is free software; you can redistribute it and/or modify
-# // it under the terms of the GNU General Public License as published by
-# // the Free Software Foundation; either version 2 of the License, or
-# // (at your option) any later version.
-# //
-# // This program is distributed in the hope that it will be useful,
-# // but WITHOUT ANY WARRANTY; without even the implied warranty of
-# // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# // GNU General Public License for more details.
-# //
-# // You should have received a copy of the GNU General Public License
-# // along with this program; if not, write to the
-# // Free Software Foundation, Inc.,
-# // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# /** \file
-#     \brief ParseHelpers internal header */
-#
+// $Id$
+//
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+//
+// The contents of this file are subject to the Fraunhofer FOKUS Public License
+// Version 1.0 (the "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+// http://senf.berlios.de/license.html
+//
+// The Fraunhofer FOKUS Public License Version 1.0 is based on,
+// but modifies the Mozilla Public License Version 1.1.
+// See the full license text for the amendments.
+//
+// Software distributed under the License is distributed on an "AS IS" basis,
+// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+// for the specific language governing rights and limitations under the License.
+//
+// The Original Code is Fraunhofer FOKUS code.
+//
+// The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
+// (registered association), Hansastraße 27 c, 80686 Munich, Germany.
+//
+// Contributor(s):
+//   Stefan Bund <g0dil@berlios.de>
+/** \file
+     \brief ParseHelpers internal header */
+
 # if !defined(IH_ParseHelpers_)
 # define IH_ParseHelpers_ 1
 #
@@ -33,9 +38,9 @@
 # include "../Utils/preprocessor.hh"
 # include "../Utils/mpl.hh"
 #
-# ////////////////////////////////ih.p///////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_INITIALIZE
 #
 # define SENF_PARSER_INITIALIZE  BOOST_PP_CAT( SENF_PARSER_INITIALIZE_ , SENF_PARSER_TYPE )
@@ -60,7 +65,7 @@
         size_type field_offset_(senf::mpl::rv<0>*) const { return 0; }                            \
     public:
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_INHERIT_*
 #
 # define SENF_PARSER_INHERIT_var(name)                                                            \
@@ -86,7 +91,7 @@
         }                                                                                         \
     public:
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_FIELD*
 # // SENF_PARSER_P_FIELD_*
 #
             BOOST_PP_CAT(SENF_PARSER_I_ISVAR_, ofstype) (name, type),                             \
             access )
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_FIELD_INTRO
 #
 # define SENF_PARSER_I_FIELD_INTRO(name, type, access)                                            \
         SENF_MPL_SLOT_SET(index, BOOST_PP_CAT(name,_index));                                      \
     access:
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_FIELD_INIT_*
 #
 # define SENF_PARSER_I_FIELD_INIT_rw(name, type, access)                                          \
         }                                                                                         \
     access:
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_FIELD_OFS_*
 #
 # define SENF_PARSER_I_FIELD_OFS_var(name, type, access)                                          \
             SENF_MPL_SLOT_GET(offset);                                                            \
     private:
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_ADVANCE_OFS_*
 #
 # define SENF_PARSER_I_SIZE_var(name, type) senf::bytes(BOOST_PP_CAT(name, _)())
         SENF_MPL_SLOT_SET(offset, BOOST_PP_CAT(name, _next_offset));                              \
     access:
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_FIELD_VAL_*
 #
 # define SENF_PARSER_I_FIELD_VAL_rw(name, type, access)                                           \
             return BOOST_PP_CAT(name,_)();                                                        \
         }
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_CUSTOM_FIELD_*
 #
 # define SENF_PARSER_CUSTOM_FIELD_var(name, type, size, isize)                                    \
         BOOST_PP_CAT(SENF_PARSER_I_ADVANCE_OFS_, ofstype) (name, type, size, isize, 1, public)    \
         BOOST_PP_CAT(name, _t) name() const
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_BITFIELD_*
 # // SENF_PARSER_P_BITFIELD_*
 #
 # define SENF_PARSER_P_BITFIELD_fix(name, bits, type)                                             \
       SENF_PARSER_BITFIELD_I(name, bits, type, fix, rw, protected)
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_BITFIELD_I
 #
 # define SENF_PARSER_BITFIELD_TYPE_signed(start, bits)   senf::IntFieldParser<start, start+bits>
          BOOST_PP_CAT(SENF_PARSER_I_FIELD_VAL_, rwtype) (name, type, access)                      \
     public:
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_BITFIELD_OFS_*
 #
 # define SENF_PARSER_I_BITFIELD_OFS_var(name, type, access)                                       \
         static size_type const BOOST_PP_CAT(name, _offset) =                                      \
             SENF_MPL_SLOT_GET(offset) - SENF_MPL_SLOT_GET(bitfield_size);
 #
-# ////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_I_BITFIELD_RESET
 #
 # define SENF_PARSER_I_BITFIELD_RESET()                                                           \
         SENF_MPL_SLOT_SET(bit, 0);                                                                \
         SENF_MPL_SLOT_SET(bitfield_size, 0);
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_SKIP_*
 #
 # define SENF_PARSER_SKIP_var(bytes, ibytes)                                                      \
                                                              private)                             \
     public:
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_SKIP_BITS_*
 #
 # define SENF_PARSER_SKIP_BITS_var(bits) SENF_PARSER_I_SKIP_BITS(bits, var)
           SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits);                                  \
       public:
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_GOTO_*
 #
 # define SENF_PARSER_GOTO_var(name)                                                               \
 # define SENF_PARSER_I_GOTO_SET_OFS_fix(name, offs, initsize)                                     \
           SENF_MPL_SLOT_SET(offset, offs);
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_LABEL_*
 #
 # define SENF_PARSER_LABEL_var(name) SENF_PARSER_I_LABEL( name, var, public )
           BOOST_PP_CAT(SENF_PARSER_I_ADVANCE_OFS_, ofstype) (name, void, 0, 0, 0, access)         \
       public:
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_OFFSET_*
 #
 # define SENF_PARSER_OFFSET_fix(name) BOOST_PP_CAT(name, _offset)
 # define SENF_PARSER_OFFSET_var(name) BOOST_PP_CAT(name, _offset)()
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_FIXED_OFFSET_*
 #
 # define SENF_PARSER_FIXED_OFFSET_fix(name) BOOST_PP_CAT(name, _offset)
 # define SENF_PARSER_FIXED_OFFSET_var(name) BOOST_PP_CAT(name, _init_bytes)
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_CURRENT_FIXED_OFFSET_*
 #
 # define SENF_PARSER_CURRENT_FIXED_OFFSET_fix() SENF_MPL_SLOT_GET(offset)
 # define SENF_PARSER_CURRENT_FIXED_OFFSET_var() SENF_MPL_SLOT_GET(init_bytes)
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_FINALIZE_*
 #
 # define SENF_PARSER_FINALIZE_var(name)                                                           \
     public:                                                                                       \
          void init() const { init(0); }
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_REQUIRE_VAR
 #
 # define SENF_PARSER_REQUIRE_VAR(description) \
                             BOOST_PP_CAT(description, _not_allowed_in_fixed_parser) )             \
           BOOST_PP_CAT(errsym_, __LINE__);
 #
-# ///////////////////////////////////////////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # // SENF_PARSER_COLLECTION_I
 #
 # ifndef DOXYGEN
           BOOST_PP_CAT(name, _t) name() const                                                     \
           { return BOOST_PP_CAT(name, _)(); }
 #
-# ////////////////////////////////ih.e///////////////////////////////////////
+# //-///////////////////////////////////////////////////////////////////////////////////////////////
 # endif
 #
 #