mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-21 19:35:28 -05:00
libiberty: add ldirname function
This patch adds a function ldirname to libiberty. It is implemented in terms of lbasename. Basically, given a given pathname, the dirname part is what is not the basename minus the last directory separator separating the dirname with the basename. include/ChangeLog * libiberty.h (ldirname): New function declaration. (dos_ldirname): Likewise. (unix_ldirname): Likewise. libiberty/ChangeLog * ldirname.c: New file. * Makefile.in (CFILES): Add ldirname.c. (REQUIRED_OFILES): Add ldirname.$(objext). (./ldirname.$(objext)): New rule. * makefile.vms (OBJS): Add ldirname.obj. * configure.com (FILES): Add ldirname.
This commit is contained in:
@@ -133,6 +133,18 @@ extern const char *dos_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIB
|
||||
|
||||
extern const char *unix_lbasename (const char *) ATTRIBUTE_RETURNS_NONNULL ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* A dirname () that is always compiled in. */
|
||||
|
||||
extern char *ldirname (const char *) ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* Same, but assumes DOS semantics regardless of host. */
|
||||
|
||||
extern char *dos_ldirname (const char *) ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* Same, but assumes Unix semantics regardless of host. */
|
||||
|
||||
extern char *unix_ldirname (const char *) ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* A well-defined realpath () that is always compiled in. */
|
||||
|
||||
extern char *lrealpath (const char *);
|
||||
|
||||
Reference in New Issue
Block a user