00001 /* 00002 * Copyright (c) 2005 Novell, Inc. 00003 * All Rights Reserved. 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of version 2 of the GNU General Public License as 00007 * published by the Free Software Foundation. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, contact Novell, Inc. 00016 * 00017 * To contact Novell about this file by physical or electronic mail, 00018 * you may find current contact information at www.novell.com 00019 * 00020 * Author : Rohit Kumar 00021 * Email ID : rokumar@novell.com 00022 * Date : 14th July 2005 00023 */ 00024 00025 00026 #ifndef FILE_LIST_INFO_H 00027 #define FILE_LIST_INFO_H 00028 00029 #include <limits.h> 00030 00031 #if !defined(NAME_MAX) 00032 #define NAME_MAX 255 00033 #endif 00034 00035 00036 #define SUCCESS 1 00037 #define FAILURE 0 00038 00039 typedef struct _FileListItemInfo { 00040 char name[NAME_MAX]; 00041 unsigned int size; 00042 unsigned int data; 00043 } FileListItemInfo, *FileListItemInfoPtr; 00044 00045 typedef struct _FileListItemSize { 00046 unsigned int size; 00047 unsigned int data; 00048 } FileListItemSize, *FileListItemSizePtr; 00049 00050 typedef struct _FileListInfo { 00051 FileListItemInfoPtr pEntries; 00052 int numEntries; 00053 } FileListInfo, *FileListInfoPtr; 00054 00055 int AddFileListItemInfo(FileListInfoPtr fileListInfoPtr, char* name, unsigned int size, unsigned int data); 00056 char* GetFileNameAt(FileListInfo fileListInfo, int number); 00057 unsigned int GetFileSizeAt(FileListInfo fileListInfo, int number); 00058 unsigned int GetFileDataAt(FileListInfo fileListInfo, int number); 00059 unsigned int GetSumOfFileNamesLength(FileListInfo fileListInfo); 00060 void FreeFileListInfo(FileListInfo fileListInfo); 00061 00062 void DisplayFileList(FileListInfo fli); 00063 00064 #endif 00065