#ifndef _PROFILE_H_0f84df60_ #define _PROFILE_H_0f84df60_ struct mm_profile; typedef struct mm_profile PROFILE; /* Read in the given profile file, or the user's default profile if the argument is nil. Returns the PROFILE corresponding to it. */ extern PROFILE *profile_read(const char *); /* Read a profile from the given fd. */ extern PROFILE *profile_read_fd(int); /* Set the environment-override flag for the profile. This defaults to false on a newly read profile; use this to turn it on (or back off). When true, profile_lookup looks for $MMPROF_uppercase(tag) and if found, uses that instead of the profile value. */ extern void profile_set_envoverride(PROFILE *, int); /* Write the profile to the given fd. Syscall-style return. */ extern int profile_write_fd(PROFILE *, int); /* Given a PROFILE pointer and a tag, looks up the value. Returns it, or a nil pointer if the tag was not found. */ extern const char *profile_lookup(PROFILE *, const char *); /* profile_set(prof,tag,value) sets {tag} to "value" in prof. */ extern void profile_set(PROFILE *, const char *, const char *); /* profile_relative_to(prof,tag,def,relto) returns {tag}, default def, interpreted relative to relto, where {tag} is done with respect to prof. The return value may or may not be malloc()ed; if it is not stored in permanent storage, a memory leak may result. */ extern const char *profile_relative_to(PROFILE *, const char *, const char *, const char *); /* Free up all storage associated with the profile. */ extern void profile_free(PROFILE *); #endif