tkernel_2/lib/libsys/src/quesearch.c | bare source | permlink (0.02 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * quesearch.c (libsys) 17: */ 18: 19: #include "quetemplate.h" 20: 21: /*EXPORT QUESEARCH(, W, ==)*/ 22: QUEUE* QueSearch( QUEUE *start, QUEUE *end, W val, W offset ) 23: { 24: QUEUE *que; 25: for ( que = start->next; que != end; que = que->next ) { 26: if ( *(W*)((VB*)que + offset) == val ) { 27: break; 28: } 29: } 30: return que; 31: }