ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

_slist_base.c
Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright (c) 1994
00005  * Hewlett-Packard Company
00006  *
00007  * Copyright (c) 1996,1997
00008  * Silicon Graphics Computer Systems, Inc.
00009  *
00010  * Copyright (c) 1997
00011  * Moscow Center for SPARC Technology
00012  *
00013  * Copyright (c) 1999
00014  * Boris Fomitchev
00015  *
00016  * This material is provided "as is", with absolutely no warranty expressed
00017  * or implied. Any use is at your own risk.
00018  *
00019  * Permission to use or copy this software for any purpose is hereby granted
00020  * without fee, provided the above notices are retained on all copies.
00021  * Permission to modify the code and to distribute modified code is granted,
00022  * provided the above notices are retained, and a notice that the code was
00023  * modified is included with the above copyright notice.
00024  *
00025  */
00026 #ifndef _STLP_SLIST_BASE_C
00027 #define _STLP_SLIST_BASE_C
00028 
00029 #ifndef _STLP_INTERNAL_SLIST_BASE_H
00030 #  include <stl/_slist_base.h>
00031 #endif
00032 
00033 _STLP_BEGIN_NAMESPACE
00034 
00035 _STLP_MOVE_TO_PRIV_NAMESPACE
00036 
00037 template <class _Dummy>
00038 _Slist_node_base*  _STLP_CALL
00039 _Sl_global<_Dummy>::__previous(_Slist_node_base* __head,
00040                                const _Slist_node_base* __node) {
00041   while (__head && __head->_M_next != __node)
00042     __head = __head->_M_next;
00043   return __head;
00044 }
00045 
00046 template <class _Dummy>
00047 void _STLP_CALL
00048 _Sl_global<_Dummy>::__splice_after(_Slist_node_base* __pos, _Slist_node_base* __head) {
00049   _Slist_node_base* __before_last = __previous(__head, 0);
00050   if (__before_last != __head) {
00051     _Slist_node_base* __after = __pos->_M_next;
00052     __pos->_M_next = __head->_M_next;
00053     __head->_M_next = 0;
00054     __before_last->_M_next = __after;
00055   }
00056 }
00057 
00058 template <class _Dummy>
00059 void _STLP_CALL
00060 _Sl_global<_Dummy>::__splice_after(_Slist_node_base* __pos,
00061                                    _Slist_node_base* __before_first,
00062                                    _Slist_node_base* __before_last) {
00063   if (__pos != __before_first && __pos != __before_last) {
00064     _Slist_node_base* __first = __before_first->_M_next;
00065     _Slist_node_base* __after = __pos->_M_next;
00066     __before_first->_M_next = __before_last->_M_next;
00067     __pos->_M_next = __first;
00068     __before_last->_M_next = __after;
00069   }
00070 }
00071 
00072 template <class _Dummy>
00073 _Slist_node_base* _STLP_CALL
00074 _Sl_global<_Dummy>::__reverse(_Slist_node_base* __node) {
00075   _Slist_node_base* __result = __node;
00076   __node = __node->_M_next;
00077   __result->_M_next = 0;
00078   while(__node) {
00079     _Slist_node_base* __next = __node->_M_next;
00080     __node->_M_next = __result;
00081     __result = __node;
00082     __node = __next;
00083   }
00084   return __result;
00085 }
00086 
00087 template <class _Dummy>
00088 size_t _STLP_CALL
00089 _Sl_global<_Dummy>::size(_Slist_node_base* __node) {
00090   size_t __result = 0;
00091   for ( ; __node != 0; __node = __node->_M_next)
00092     ++__result;
00093   return __result;
00094 }
00095 
00096 _STLP_MOVE_TO_STD_NAMESPACE
00097 
00098 _STLP_END_NAMESPACE
00099 
00100 #endif /*  _STLP_SLIST_BASE_C */
00101 
00102 // Local Variables:
00103 // mode:C++
00104 // End:

Generated on Thu May 24 2012 04:30:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.