Guest User

Untitled

a guest
Jun 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. /*Restituisce il puntatore al SEMD nella ASL la cui chiave è pari a key. Se non esiste un elemento
  2. con chiave uguale a key, viene restituito NULL. */
  3.  
  4. semd_t* getSemd(int key){
  5.  
  6.     semd_t *semd;
  7.     struct list_head *i;
  8.    
  9.     if(list_empty(ASL))
  10.         return NULL;
  11.        
  12.     list_for_each(i, ASL){
  13.         semd = container_of(i, semd_t, s_next);
  14.         if (semd->s_key == key){
  15.             return (semd);
  16.         }
  17.     }
  18.    
  19.     return NULL;
  20. }
Add Comment
Please, Sign In to add comment