From b0c7d2e83b464bc3b620dd389de1bceba453909d Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 22 Aug 2008 23:38:33 +0000 Subject: Add chdir() and getcwd() git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@837 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/lib/lib_internal.h | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) (limited to 'nuttx/lib/lib_internal.h') diff --git a/nuttx/lib/lib_internal.h b/nuttx/lib/lib_internal.h index 95dca3de8..067b64c24 100644 --- a/nuttx/lib/lib_internal.h +++ b/nuttx/lib/lib_internal.h @@ -1,7 +1,7 @@ -/************************************************************ - * lib_internal.h +/**************************************************************************** + * lib/lib_internal.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,22 +31,26 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ****************************************************************************/ #ifndef __LIB_INTERNAL_H #define __LIB_INTERNAL_H -/************************************************************ +/**************************************************************************** * Included Files - ************************************************************/ + ****************************************************************************/ #include #include #include -/************************************************************ +/**************************************************************************** * Definitions - ************************************************************/ + ****************************************************************************/ + +#ifndef CONFIG_LIB_HOMEDIR +# define CONFIG_LIB_HOMEDIR "/" +#endif #if CONFIG_STDIO_BUFFER_SIZE <= 0 # define lib_sem_initialize(s) @@ -56,9 +60,9 @@ #define LIB_BUFLEN_UNKNOWN (0x7fffffff) -/************************************************************ +/**************************************************************************** * Public Types - ************************************************************/ + ****************************************************************************/ /* This is the generic for of a stream used by the library * to manage variable sized output. @@ -94,13 +98,18 @@ struct lib_rawstream_s int fd; }; -/************************************************************ +/**************************************************************************** * Public Variables - ************************************************************/ + ****************************************************************************/ + +#if CONFIG_NFILE_DESCRIPTORS > 0 +extern char *g_cwd; /* Defined in lib_chdir.c */ +extern char *g_prevcwd; /* Defined in lib_chdir.c */ +#endif -/************************************************************ +/**************************************************************************** * Public Function Prototypes - ************************************************************/ + ****************************************************************************/ /* Defined in lib_streamsem.c */ @@ -184,4 +193,9 @@ extern void lib_give_semaphore(FAR struct file_struct *stream); extern int lib_getbase(const char *nptr, const char **endptr); +/* Defined in lib_cwdsem.c */ + +extern void cwd_semtake(void); +extern void cwd_semgive(void); + #endif /* __LIB_INTERNAL_H */ -- cgit v1.2.3