Blame src/symboltable.c

Packit Service 5e8d2a
/* aide, Advanced Intrusion Detection Environment
Packit Service 5e8d2a
 *
Packit Service 5e8d2a
 * Copyright (C) 1999-2002,2005,2006 Rami Lehti,Pablo Virolainen,
Packit Service 5e8d2a
 * Richard van den Berg
Packit Service 5e8d2a
 * $Header$
Packit Service 5e8d2a
 *
Packit Service 5e8d2a
 * This program is free software; you can redistribute it and/or
Packit Service 5e8d2a
 * modify it under the terms of the GNU General Public License as
Packit Service 5e8d2a
 * published by the Free Software Foundation; either version 2 of the
Packit Service 5e8d2a
 * License, or (at your option) any later version.
Packit Service 5e8d2a
 *
Packit Service 5e8d2a
 * This program is distributed in the hope that it will be useful, but
Packit Service 5e8d2a
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 5e8d2a
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Packit Service 5e8d2a
 * General Public License for more details.
Packit Service 5e8d2a
 *
Packit Service 5e8d2a
 * You should have received a copy of the GNU General Public License
Packit Service 5e8d2a
 * along with this program; if not, write to the Free Software
Packit Service 5e8d2a
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
Packit Service 5e8d2a
 */
Packit Service 5e8d2a
#include "aide.h"
Packit Service 5e8d2a
#include <stdio.h>
Packit Service 5e8d2a
#include <string.h>
Packit Service 5e8d2a
#include "symboltable.h"
Packit Service 5e8d2a
/*for locale support*/
Packit Service 5e8d2a
#include "locale-aide.h"
Packit Service 5e8d2a
/*for locale support*/
Packit Service 5e8d2a
Packit Service 5e8d2a
list* list_find(char* s,list* item){
Packit Service 5e8d2a
Packit Service 5e8d2a
  list* l;
Packit Service 5e8d2a
  list* p;
Packit Service 5e8d2a
Packit Service 5e8d2a
  if (item==NULL) {
Packit Service 5e8d2a
    return NULL;
Packit Service 5e8d2a
  }
Packit Service 5e8d2a
Packit Service 5e8d2a
  p=item;
Packit Service 5e8d2a
  while(p!=NULL){
Packit Service 5e8d2a
    if (strcmp(s,((symba*)p->data)->name)==0) return p;
Packit Service 5e8d2a
    p=p->next;
Packit Service 5e8d2a
  }
Packit Service 5e8d2a
    
Packit Service 5e8d2a
  l=item->prev;
Packit Service 5e8d2a
  while(l!=NULL){
Packit Service 5e8d2a
    /* Insert bug to here return l-> return p */
Packit Service 5e8d2a
    if (strcmp(s,((symba*)l->data)->name)==0) return l; 
Packit Service 5e8d2a
    l=l->prev;
Packit Service 5e8d2a
  }
Packit Service 5e8d2a
  return NULL;
Packit Service 5e8d2a
}