cctools
batch_file.h
Go to the documentation of this file.
1/*
2Copyright (C) 2024 The University of Notre Dame
3This software is distributed under the GNU General Public License.
4See 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
28struct batch_file {
29 char *outer_name;
30 char *inner_name;
31 char *hash;
32};
33
39struct batch_file *batch_file_create(const char *outer_name, const char *inner_name );
40
46
54char * batch_file_to_string( struct batch_file *f );
55
61char * batch_file_list_to_string( struct list *file_list );
62
68int batch_file_outer_compare( struct batch_file *f1, struct batch_file *f2 );
69
75
80char * batch_file_generate_id_dir(char *file_name);
81
82#endif
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_generate_id(struct batch_file *f)
Generate a sha1 hash based on the file contents.
char * batch_file_list_to_string(struct list *file_list)
Output list of batch_files as a string.
char * batch_file_generate_id_dir(char *file_name)
Generates a sha1 hash based on the directory's contents.
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 * batch_file_to_string(struct batch_file *f)
Output batch_file as a string.
General purpose debugging routines.
Robust, reentrant linked list structure.
Routines for computing SHA1 checksums.
Internal description of a single file used by a batch job.
Definition batch_file.h:28
char * outer_name
The name of the file in the submitters filesystem namespace.
Definition batch_file.h:29
char * inner_name
The name of the file as it should appear to the running job.
Definition batch_file.h:30
char * hash
The hierarchical checksum of this file/directory, when content based names are used.
Definition batch_file.h:31