/*- * Copyright (c) 1999-2000 Robin Ericsson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $Id: gsfv.h,v 1.6 2000/03/25 10:36:06 lobbin Exp $ */ #ifndef __GSFV_H__ #define __GSFV_H__ #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* * Defines */ #define CRC32_POLYNOMIAL 0xEDB88320L typedef struct file_data FILE_DATA; struct file_data { gchar *filename; gchar *crc; gboolean exists; gboolean selected; long filesize; time_t ctime; }; typedef enum { GSFV_CREATE, GSFV_VERIFY } GSFV_Type; /* * Functions */ /* backbone.c */ void popup_window (gchar *string ); void gsfv_create_sfvfile (void ); void gsfv_verify_files (void ); void gsfv_do (GSFV_Type type, gpointer addc_log, gpointer addf_del, GList *list_sfv ); /* crc-32.c */ void init_crc32 (void ); #include unsigned long generate_file_crc32 (FILE *fp, long size); unsigned long generate_buffer_crc32 (unsigned int count, unsigned long crc, void *buffer); GList * parse_sfvfile (gchar *filename ); void write_sfvfile (GList *files ); /* version.c */ char * get_version_info (char *buf ); /* * Variables */ unsigned long CRC_Table[256]; extern GtkWidget *tree; extern GtkWidget *crc_entry; extern GtkWidget *check_button_log; extern GtkWidget *check_button_delete; extern GtkWidget *progress_file; extern GtkWidget *button_comment; extern GtkWidget *entry_commentfile; extern GtkWidget *check_addcomment; extern GtkWidget *check_addfileinfos; extern GtkWidget *create_label_comment; extern GtkWidget *entry2; extern gboolean skip_file; extern gboolean aborted; extern gboolean add_fileinfos; extern gboolean add_comment; extern gboolean status_done; extern GList *create_files; #ifdef __cplusplus } #endif /* __cplusplus */ #endif