The dirfile error may be retrieved by calling gd_error(3). The protection level of the specified fragment prohibits metadata changes. GD_E_DUPLICATEĪttempting to change the root namespace resulted in a duplicated field definition. This error will also be returned if an attempt is made to change the root namespace of the root format file ( fragment_index zero).
The supplied new_fragment was not a valid namespace. GD_E_ALLOCĪ memory allocation error occurred. Possible dirfile error values are: GD_E_ACCMODE On error, this function returns NULL and sets the dirfile error to a non-zero error value. If the fragment's root namespace is empty, a pointer to the empty string ( "") will be returned. This will be a copy of the string new_namespace, if that parameter was non-NULL. Upon successful completion, gd_fragment_namespace() returns a non-NULL pointer to a read-only string containing the current root namespace of the fragment specified.
The dirfile argument must point to a valid DIRFILE object previously created by a call to gd_open(3). The root namespace of the root format file (the one indexed by fragment_index=0) may not be changed. To remove an existing root namespace, pass a pointer to the empty string ( "") as new_namespace.
The new namespace may optionally contain a single, trailing dot (. If new_namespace is non-NULL, then the root namespace is first changed to the string provided before being reported. If new_namespace is NULL, then the current root namespace of the fragment indexed by fragment_index is returned.
The gd_fragment_namespace() function can be used to update and/or query the root namespace of a fragment in the dirfile(5) database specified by dirfile. Report or change the root namespace of a fragment of a dirfile database SynopsisĬonst char *gd_fragment_namespace(DIRFILE * dirfile, int fragment_index, char * new_namespace ) Description