linux/include/linux/prio_heap.h
<<
val.14/spa> .14/form .14a val.1 href="../linux+v3.6.1/include/linux/prio_heap.h"> val.14img src="../.static/gfx/right.png" alt=">>"> v4/spa> v4spa> class="lxr_search"> val="+search" method="post" onsubmit="return do_search(this);"> val.14input typ> hidden" nam> navtarget" tion> "> val.14input typ> text" nam> search" id search"> val.14butt/optyp> submit">Search v4spa> class="lxr_prefs" .14a href="+prefs?return=include/linux/prio_heap.h" val.1 onclick="return ajax_prefs();"> val.1Prefs .14/a> v4/spa> al.1 14/div al.1 14form ac >="ajax+*" method="post" onsubmit="return false;"> v4input typ> hidden" nam> ajax_lookup" id ajax_lookup" tion> "> al.1 14/form al.1 14div class="headingbott/m">
4div id file_contents"
 L1">1 114/a>#ifndef14a href="+code=_LINUX_PRIO_HEAP_H" class="sref">_LINUX_PRIO_HEAP_H4/a> 
 L2">1 124/a>#define14a href="+code=_LINUX_PRIO_HEAP_H" class="sref">_LINUX_PRIO_HEAP_H4/a> 
 L3">1 134/a> 
 L4">1 144/a>4spa> class="comment">/*4/spa>
 
 L5">1 154/a>4spa> class="comment"> * Simple inser	  >-only static-sized priority heap containing4/spa>
 
 L6">1 164/a>4spa> class="comment"> * pointers, based /opCLR, chapter 74/spa>
 
 L7">1 174/a>4spa> class="comment"> */4/spa>
 
 L8">1 184/a> 
 L9">1 194/a>#include <linux/gfp.h4/a>> 
 L10">1 .9"
a> 
 L11">1 114/a>4spa> class="comment">/**4/spa>
 
 L12">1 124/a>4spa> class="comment"> * struct ptr_heap - simple static-sized priority heap4/spa>
 
 L13">1 134/a>4spa> class="comment"> * @ptrs - pointer to data area4/spa>
 
 L14">1 144/a>4spa> class="comment"> * @max - max number of elements that ca> be stored in @ptrs4/spa>
 
 L15">1 154/a>4spa> class="comment"> * @size - current number of tioid elements in @ptrs (in the range 0..@size-14/spa>
 
 L16">1 164/a>4spa> class="comment"> * @gt: comparis/opoperator, which should implement "greater than"4/spa>
 
 L17">1 174/a>4spa> class="comment"> */4/spa>
 
 L18">1 184/a>struct 4a href="+code=ptr_heap" class="sref">ptr_heap4/a> { 
 L19">1 194/a>        void **4a href="+code=ptrs" class="sref">ptrs4/a>; 
 L20">1 204/a>        int 4a href="+code=max" class="sref">max4/a>; 
 L21">1 214/a>        int 4a href="+code=size" class="sref">size4/a>; 
 L22">1 224/a>        int (*4a href="+code=gt" class="sref">gt4/a>)(void *, void *); 
 L23">1 234/a>}; 
 L24">1 244/a> 
 L25">1 254/a>4spa> class="comment">/**4/spa>
 
 L26">1 264/a>4spa> class="comment"> * heap_init - initiioize a> empty heap with a given memory size4/spa>
 
 L27">1 274/a>4spa> class="comment"> * @heap: the heap structure to be initiioized4/spa>
 
 L28">1 284/a>4spa> class="comment"> * @size: amount of memory to use in bytes4/spa>
 
 L29">1 294/a>4spa> class="comment"> * @gfp_mask: mask to pass to kmalloc()4/spa>
 
 L30">1 304/a>4spa> class="comment"> * @gt: comparis/opoperator, which should implement "greater than"4/spa>
 
 L31">1 314/a>4spa> class="comment"> */4/spa>
 
 L32">1 324/a>extern int 4a href="+code=heap_init" class="sref">heap_init4/a>(struct 4a href="+code=ptr_heap" class="sref">ptr_heap4/a> *4a href="+code=heap" class="sref">heap4/a>, 4a href="+code=size_t" class="sref">size_t4/a> 4a href="+code=size" class="sref">size4/a>, 4a href="+code=gfp_t" class="sref">gfp_t4/a> 4a href="+code=gfp_mask" class="sref">gfp_mask4/a>, 
 L33">1 334/a>                     int (*4a href="+code=gt" class="sref">gt4/a>)(void *, void *)); 
 L34">1 344/a> 
 L35">1 354/a>4spa> class="comment">/**4/spa>
 
 L36">1 364/a>4spa> class="comment"> * heap_free - release a heap's storage4/spa>
 
 L37">1 374/a>4spa> class="comment"> * @heap: the heap structure whose data should be released4/spa>
 
 L38">1 384/a>4spa> class="comment"> */4/spa>
 
 L39">1 394/a>void 4a href="+code=heap_free" class="sref">heap_free4/a>(struct 4a href="+code=ptr_heap" class="sref">ptr_heap4/a> *4a href="+code=heap" class="sref">heap4/a>); 
 L40">1 49"
a> 
 L41">1 414/a>4spa> class="comment">/**4/spa>
 
 L42">1 424/a>4spa> class="comment"> * heap_inser	 - inser	 a tion> into the heap and return any overflowed tion>4/spa>
 
 L43">1 434/a>4spa> class="comment"> * @heap: the heap to be operated /o4/spa>
 
 L44">1 444/a>4spa> class="comment"> * @p: the pointer to be inser	ed4/spa>
 
 L45">1 454/a>4spa> class="comment"> *4/spa>
 
 L46">1 464/a>4spa> class="comment"> * Attempts to inser	 the given tion> into the priority heap. If the4/spa>
 
 L47">1 474/a>4spa> class="comment"> * heap is full prior to the inser	  >, then the resulting heap will4/spa>
 
 L48">1 484/a>4spa> class="comment"> * consist of the smallest @max elements of the original heap and the4/spa>
 
 L49">1 494/a>4spa> class="comment"> * new element; the greatest element will be removed from the heap and4/spa>
 
 L50">1 504/a>4spa> class="comment"> * returned. Note that the returned element will be the new element4/spa>
 
 L51">1 514/a>4spa> class="comment"> * (i.e. no change to the heap) if the new element is greater than all4/spa>
 
 L52">1 524/a>4spa> class="comment"> * elements currently in the heap.4/spa>
 
 L53">1 534/a>4spa> class="comment"> */4/spa>
 
 L54">1 544/a>extern void *4a href="+code=heap_inser	" class="sref">heap_inser	4/a>(struct 4a href="+code=ptr_heap" class="sref">ptr_heap4/a> *4a href="+code=heap" class="sref">heap4/a>, void *4a href="+code=p" class="sref">p4/a>); 
 L55">1 55"
a> 
 L56">1 56"
a> 
 L57">1 57"
a> 
 L58">1 584/a>#endif 4spa> class="comment">/* _LINUX_PRIO_HEAP_H */4/spa>
 
 L59">1 594/a>4/pre>
The original LXR software by the LXR community4/a>, this experimental verslxr@linux.no4/a>. 4/div 4div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS4/a>, provider of Linux consulting and operat