From: Junio C Hamano Date: Fri, 11 Aug 2017 20:27:05 +0000 (-0700) Subject: Merge branch 'jt/subprocess-handshake' X-Git-Tag: v2.15.0-rc0~191 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a8ff899cea20d88f6e1e7282b1ea64d964fc2e5;p=thirdparty%2Fgit.git Merge branch 'jt/subprocess-handshake' Code cleanup. * jt/subprocess-handshake: sub-process: refactor handshake to common function Documentation: migrate sub-process docs to header --- 9a8ff899cea20d88f6e1e7282b1ea64d964fc2e5 diff --cc sub-process.h index 8cd07a59ab,caa91a9b92..49701998c9 --- a/sub-process.h +++ b/sub-process.h @@@ -18,14 -29,31 +29,31 @@@ struct subprocess_entry struct child_process process; }; + struct subprocess_capability { + const char *name; + + /* + * subprocess_handshake will "|=" this value to supported_capabilities + * if the server reports that it supports this capability. + */ + unsigned int flag; + }; + /* subprocess functions */ + /* Function to test two subprocess hashmap entries for equality. */ extern int cmd2process_cmp(const void *unused_cmp_data, - const struct subprocess_entry *e1, - const struct subprocess_entry *e2, + const void *e1, + const void *e2, const void *unused_keydata); + /* + * User-supplied function to initialize the sub-process. This is + * typically used to negotiate the interface version and capabilities. + */ typedef int(*subprocess_start_fn)(struct subprocess_entry *entry); + + /* Start a subprocess and add it to the subprocess hashmap. */ int subprocess_start(struct hashmap *hashmap, struct subprocess_entry *entry, const char *cmd, subprocess_start_fn startfn);