cctools
batch_file.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2024 The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef BATCH_FILE_H
8 #define BATCH_FILE_H
9 
10 #include <errno.h>
11 #include <sys/types.h>
12 #include <dirent.h>
13 
14 #include "sha1.h"
15 #include "list.h"
16 #include "debug.h"
17 #include "path.h"
18 
28 struct batch_file {
29  char *outer_name;
30  char *inner_name;
31  char *hash;
32 };
33 
39 struct batch_file *batch_file_create(const char *outer_name, const char *inner_name );
40 
45 void batch_file_delete(struct batch_file *f);
46 
54 char * batch_file_to_string( struct batch_file *f );
55 
61 char * batch_file_list_to_string( struct list *file_list );
62 
68 int batch_file_outer_compare( struct batch_file *f1, struct batch_file *f2 );
69 
74 char * batch_file_generate_id(struct batch_file *f);
75 
80 char * batch_file_generate_id_dir(char *file_name);
81 
82 #endif
Internal description of a single file used by a batch job.
Definition: batch_file.h:28
General purpose debugging routines.
struct batch_file * batch_file_create(const char *outer_name, const char *inner_name)
Create batch_file struct.
void batch_file_delete(struct batch_file *f)
Delete batch_file struct.
char * hash
The hierarchical checksum of this file/directory, when content based names are used.
Definition: batch_file.h:31
char * batch_file_generate_id_dir(char *file_name)
Generates a sha1 hash based on the directory&#39;s contents.
Robust, reentrant linked list structure.
int batch_file_outer_compare(struct batch_file *f1, struct batch_file *f2)
Compare function for comparing batch_files based on outer_name.
char * batch_file_list_to_string(struct list *file_list)
Output list of batch_files as a string.
char * outer_name
The name of the file in the submitters filesystem namespace.
Definition: batch_file.h:29
Routines for computing SHA1 checksums.
char * batch_file_generate_id(struct batch_file *f)
Generate a sha1 hash based on the file contents.
char * inner_name
The name of the file as it should appear to the running job.
Definition: batch_file.h:30
char * batch_file_to_string(struct batch_file *f)
Output batch_file as a string.