summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_internal.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-22 23:38:33 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-08-22 23:38:33 +0000
commitb0c7d2e83b464bc3b620dd389de1bceba453909d (patch)
tree30bf114247b468440ddf59a026c6a205cde6b5f0 /nuttx/lib/lib_internal.h
parentab92a9dd0a6a84517ec966e5c79e4e692970ba16 (diff)
downloadpx4-nuttx-b0c7d2e83b464bc3b620dd389de1bceba453909d.tar.gz
px4-nuttx-b0c7d2e83b464bc3b620dd389de1bceba453909d.tar.bz2
px4-nuttx-b0c7d2e83b464bc3b620dd389de1bceba453909d.zip
Add chdir() and getcwd()
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@837 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/lib_internal.h')
-rw-r--r--nuttx/lib/lib_internal.h44
1 files changed, 29 insertions, 15 deletions
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 <spudmonkey@racsa.co.cr>
*
* 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 <nuttx/config.h>
#include <stdio.h>
#include <semaphore.h>
-/************************************************************
+/****************************************************************************
* 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 */