Git-Raw

 view release on metacpan or  search on metacpan

deps/libgit2/include/git2/attr.h  view on Meta::CPAN

 */
typedef int GIT_CALLBACK(git_attr_foreach_cb)(const char *name, const char *value, void *payload);

/**
 * Loop over all the git attributes for a path.
 *
 * @param repo The repository containing the path.
 * @param flags A combination of GIT_ATTR_CHECK... flags.
 * @param path Path inside the repo to check attributes.  This does not have
 *             to exist, but if it does not, then it will be treated as a
 *             plain file (i.e. not a directory).
 * @param callback Function to invoke on each attribute name and value.
 *                 See git_attr_foreach_cb.
 * @param payload Passed on as extra parameter to callback function.
 * @return 0 on success, non-zero callback return value, or error code
 */
GIT_EXTERN(int) git_attr_foreach(
	git_repository *repo,
	uint32_t flags,
	const char *path,
	git_attr_foreach_cb callback,
	void *payload);

/**
 * Loop over all the git attributes for a path with extended options.
 *
 * @param repo The repository containing the path.
 * @param opts The `git_attr_options` to use when querying these attributes.
 * @param path Path inside the repo to check attributes.  This does not have
 *             to exist, but if it does not, then it will be treated as a
 *             plain file (i.e. not a directory).
 * @param callback Function to invoke on each attribute name and value.
 *                 See git_attr_foreach_cb.
 * @param payload Passed on as extra parameter to callback function.
 * @return 0 on success, non-zero callback return value, or error code
 */
GIT_EXTERN(int) git_attr_foreach_ext(
	git_repository *repo,
	git_attr_options *opts,
	const char *path,
	git_attr_foreach_cb callback,
	void *payload);

/**
 * Flush the gitattributes cache.
 *
 * Call this if you have reason to believe that the attributes files on
 * disk no longer match the cached contents of memory.  This will cause
 * the attributes files to be reloaded the next time that an attribute
 * access function is called.
 *
 * @param repo The repository containing the gitattributes cache
 * @return 0 on success, or an error code
 */
GIT_EXTERN(int) git_attr_cache_flush(
	git_repository *repo);

/**
 * Add a macro definition.
 *
 * Macros will automatically be loaded from the top level `.gitattributes`
 * file of the repository (plus the built-in "binary" macro).  This
 * function allows you to add others.  For example, to add the default
 * macro, you would call:
 *
 *     git_attr_add_macro(repo, "binary", "-diff -crlf");
 *
 * @param repo The repository to add the macro in.
 * @param name The name of the macro.
 * @param values The value for the macro.
 * @return 0 or an error code.
 */
GIT_EXTERN(int) git_attr_add_macro(
	git_repository *repo,
	const char *name,
	const char *values);

/** @} */
GIT_END_DECL
#endif



( run in 1.179 second using v1.01-cache-2.11-cpan-5a3173703d6 )