file.h (728B)
1 #ifndef GOUT_GIT_FILE_H_ 2 #define GOUT_GIT_FILE_H_ 3 4 #include <sys/types.h> 5 6 typedef enum { 7 kFileTypeFile, 8 kFileTypeSubmodule, 9 } FileType; 10 11 typedef struct GitFile GitFile; 12 13 FileType gitfile_type(const GitFile* file); 14 const char* gitfile_mode(const GitFile* file); 15 const char* gitfile_display_path(const GitFile* file); 16 const char* gitfile_repo_path(const GitFile* file); 17 // Submodule commit OID. Empty string for files. 18 const char* gitfile_commit_oid(const GitFile* file); 19 ssize_t gitfile_size_bytes(const GitFile* file); 20 21 // Returns file size in lines, or -1 if binary file, -2 if file too large. 22 ssize_t gitfile_size_lines(const GitFile* file); 23 const char* gitfile_content(const GitFile* file); 24 25 #endif // GOUT_GIT_FILE_H_