Página principal | Lista de componentes | Directories | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

lista.h

Ir a la documentación de este archivo.
00001 /* 
00002  * LabSession - login application and administration tools 
00003  * Copyright (C) 2005 - 2006 - Hugo Ruscitti (see AUTHORS file)
00004  * 
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or
00008  * (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00018  */
00019 
00020 #ifndef _LISTA_H
00021 #define _LISTA_H
00022 
00028 #include "socket.h"
00029 
00033 typedef struct nodo
00034 {
00035         GTcpSocket * socket;    
00036         GIOChannel * io;        
00038         char equipo [256];      
00039         char usuario [256];     
00040         int en_sesion;          
00041         int sesion_numero;              
00042         char sesion_inicio [256];       
00044         int super_sesion;               
00046         struct nodo * siguiente;        
00047 } Nodo;
00048 
00049 
00050 
00051 /* quitar nodos */
00052 void lista_quitar_nodo (Nodo ** lista, Nodo * nodo);
00053 void lista_quitar_por_io (Nodo ** lista, GIOChannel * io);
00054 void lista_quitar_por_equipo (Nodo ** lista, char * equipo);
00055 
00056 /* otros */
00057 int lista_contar_nodos (Nodo * leer);
00058 int lista_asignar_sesion (Nodo * lista, char * equipo, char * usuario, 
00059                 int super_sesion);
00060 char * lista_obtener_equipo_por_io (Nodo * lista, GIOChannel * io);
00061 void lista_agregar (Nodo **lista, GIOChannel * io, GTcpSocket * socket, \
00062                 const char * equipo);
00063 /* buscadores */
00064 Nodo * lista_buscar_por_equipo (Nodo * lista, char * equipo);
00065 Nodo * lista_buscar_por_io (Nodo * lista, GIOChannel * io);
00066 Nodo * lista_buscar_por_usuario (Nodo * lista, char * usuario);
00067 
00068 int lista_esta_en_sesion (Nodo * lista, char * equipo);
00069 void lista_liberar (Nodo ** lista);
00070 
00071 
00072 #endif




Generado con Doxygen, versión 1.4.2