summaryrefslogtreecommitdiff
path: root/progress.h
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-04-18 18:27:45 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-04-23 05:18:05 (GMT)
commit96a02f8f6d2192d3686cd1c719044082c89e8391 (patch)
tree773d4edb5a05f860ed36d6e0d9f2562fb9b19c74 /progress.h
parentf1af60bdba465779df92090ed370988f202ff043 (diff)
downloadgit-96a02f8f6d2192d3686cd1c719044082c89e8391.zip
git-96a02f8f6d2192d3686cd1c719044082c89e8391.tar.gz
git-96a02f8f6d2192d3686cd1c719044082c89e8391.tar.bz2
common progress display support
Instead of having this code duplicated in multiple places, let's have a common interface for progress display. If someday someone wishes to display a cheezy progress bar instead then only one file will have to be changed. Note: I left merge-recursive.c out since it has a strange notion of progress as it apparently increase the expected total number as it goes. Someone with more intimate knowledge of what that is supposed to mean might look at converting it to the common progress interface. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'progress.h')
-rw-r--r--progress.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/progress.h b/progress.h
new file mode 100644
index 0000000..5fa4948
--- /dev/null
+++ b/progress.h
@@ -0,0 +1,14 @@
+#ifndef __progress_h__
+#define __progress_h__
+
+struct progress {
+ const char *msg;
+ unsigned total;
+ unsigned last_percent;
+};
+
+int display_progress(struct progress *progress, unsigned n);
+void start_progress(struct progress *progress, const char *msg, unsigned total);
+void stop_progress(struct progress *progress);
+
+#endif