diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index fad801a840..fa3dbdd071 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@
Last Updated: June 9, 2007
+Last Updated: June 30, 2007
Gregory Nutt
-Last Update: May 27, 2007 +Last Update: June 30, 2007
-Watchdog times execute in the context of the timer interrupt handler, but -with the PIC/PID address environment that was in place when wd_start() -was called. +Watchdog times execute in the context of the timer interrupt handler.
Watchdog timers execute only once.
@@ -5502,6 +5501,272 @@ interface of the same name. POSIX Compatibility: Comparable to the POSIX interface of the same name.
+Overview. + NuttX supports environment variables that can be used to control the behavior of programs. + In the spirit of NuttX the environment variable behavior attempts to emulate the behavior of + environment variables in the mulit-processing OS: +
+Programming Interfaces. + The following environment variable programming interfaces are provided by Nuttx and are + described in detail in the following paragraphs. +
+ +Disabling Environment Variable Support.
+ All support for environment variables can be disabled by setting CONFIG_DISABLE_ENVIRONMENT
+ in the board configuration file.
+
getenv
+ Function Prototype: +
++ #include++ FAR char *getenv(const char *name); +
+ Description:
+ The getenv()
function searches the environment list for a string that
+ matches the string pointed to by name
.
+
+ Input Parameters: +
++
name
.
+ The name of the variable to find.
+ + Returned Values: + The value of the valiable (read-only) or NULL on failure. +
+ +putenv
+ Function Prototype: +
++ #include++ int putenv(char *string); +
+ Description:
+ The putenv()
function adds or changes the value of environment variables.
+ The argument string is of the form name=value. If name does not already
+ exist in the environment, then string is added to the environment. If
+ name does exist, then the value of name in the environment is changed to
+ value.
+
+ Input Parameters: +
++
string
+ name=value string describing the environment setting to add/modify.
+ + Returned Values: + Zero on sucess. +
+ +clearenv
+ Function Prototype: +
++ #include++ int clearenv(void); +
+ Description:
+ The clearenv()
function clears the environment of all name-value pairs
+ and sets the value of the external variable environ to NULL.
+
+ Input Parameters: + None +
++ Returned Values: + Zero on success. +
+ +setenv
+ Function Prototype: +
++ #include++ int setenv(const char *name, const char *value, int overwrite); +
+ Description:
+ The setenv()
function adds the variable name
to the environment with the
+ specified value
if the variable name
does not exist. If the name
+ does exist in the environment, then its value is changed to value
if overwrite
+ is non-zero; if overwrite
is zero, then the value of name
is unaltered.
+
+ Input Parameters: +
++
name
+ The name of the variable to change.
+ value
+ The new value of the variable.
+ value
+ Replace any existing value if non-zero.
+ + Returned Values: + Zero on success. +
+ +unsetenv
+ Function Prototype: +
++ #include++ int unsetenv(const char *name); +
+ Description:
+ The unsetenv()
function deletes the variable name
from the environment.
+
+ Input Parameters: +
++
name
+ The name of the variable to delete.
+ + Returned Values: + Zero on success. +
+ +
+ The NuttX filesystem is very simple; it does not involve any block drivers or
+ particular filesystem (like FAT or EXT2 etc.).
+ The NuttX filesystem simply supports a set a filesystem APIs
+ (open()
, close()
, read()
, write
, etc.)
+ and a registration mechanism that allows devices drivers to a associated with nodes
+ in a file-system-like name space.
+
+ #include <fcntl.h> + int open(const char *path, int oflag, ...); ++ +
+ #include <unistd.h> + int close(int fd); + int dup(int fildes); + int dup2(int fildes1, int fildes2); + off_t lseek(int fd, off_t offset, int whence); + int read(int fd, void *buf, unsigned int nbytes); + int unlink(const char *path); + int write(int fd, const void *buf, unsigned int nbytes); ++ +
+ #include <sys/ioctl.h> + int ioctl(int fd, int req, unsigned long arg); ++ +
+ #include <dirent.h> + int closedir(DIR *dirp); + FAR DIR *opendir(const char *path); + FAR struct dirent *readdir(FAR DIR *dirp); + int readdir_r(FAR DIR *dirp, FAR struct dirent *entry, FAR struct dirent **result); + void rewinddir(FAR DIR *dirp); + void seekdir(FAR DIR *dirp, int loc); + int telldir(FAR DIR *dirp); ++ +
+ #include <stdio.h> + int fclose(FILE *stream); + int fflush(FILE *stream); + int feof(FILE *stream); /* Prototyped but not implemented */ + int ferror(FILE *stream); /* Prototyped but not implemented */ + int fgetc(FILE *stream); + char *fgets(char *s, int n, FILE *stream); + FILE *fopen(const char *path, const char *type); + int fprintf(FILE *stream, const char *format, ...); + int fputc(int c, FILE *stream); + int fputs(const char *s, FILE *stream); + size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream); + int fseek(FILE *stream, long int offset, int whence); /* Prototyped but not implemented */ + size_t fwrite(const void *ptr, size_t size, size_t n_items, FILE *stream); + char *gets(char *s); + + int printf(const char *format, ...); + int puts(const char *s); + int rename(const char *source, const char *target); + int sprintf(char *dest, const char *format, ...); + int ungetc(int c, FILE *stream); + int vprintf(const char *s, va_list ap); + int vfprintf(FILE *stream, const char *s, va_list ap); + int vsprintf(char *buf, const char *s, va_list ap); + + int chdir(const char *path); /* Prototyped but not implemented */ + FILE *fdopen(int fd, const char *type); + int fstat(int fd, FAR struct stat *buf); /* Prototyped but not implemented */ + char *getcwd(FAR char *buf, size_t size); /* Prototyped but not implemented */ + int mkdir(const char *path, mode_t mode); + int rmdir(const char *path); + int stat(const char *path, FAR struct stat *buf); + int statfs(const char *path, FAR struct statfs *buf); /* Prototyped but not implemented */ ++
- The NuttX filesystem is very simple; it does not involve any block drivers or
- particular filesystem (like FAT or EXT2 etc.).
- The NuttX filesystem simply supports a set a filesystem APIs
- (open()
, close()
, read()
, write
, etc.)
- and a registration mechanism that allows devices drivers to a associated with nodes
- in a file-system-like name space.
-
- #include <fcntl.h> - int open(const char *path, int oflag, ...); -- -
- #include <unistd.h> - int close(int fd); - int dup(int fildes); - int dup2(int fildes1, int fildes2); - off_t lseek(int fd, off_t offset, int whence); - int read(int fd, void *buf, unsigned int nbytes); - int unlink(const char *path); - int write(int fd, const void *buf, unsigned int nbytes); -- -
- #include <sys/ioctl.h> - int ioctl(int fd, int req, unsigned long arg); -- -
- #include <dirent.h> - int closedir(DIR *dirp); - FAR DIR *opendir(const char *path); - FAR struct dirent *readdir(FAR DIR *dirp); - int readdir_r(FAR DIR *dirp, FAR struct dirent *entry, FAR struct dirent **result); - void rewinddir(FAR DIR *dirp); - void seekdir(FAR DIR *dirp, int loc); - int telldir(FAR DIR *dirp); -- -
- #include <stdio.h> - int fclose(FILE *stream); - int fflush(FILE *stream); - int feof(FILE *stream); /* Prototyped but not implemented */ - int ferror(FILE *stream); /* Prototyped but not implemented */ - int fgetc(FILE *stream); - char *fgets(char *s, int n, FILE *stream); - FILE *fopen(const char *path, const char *type); - int fprintf(FILE *stream, const char *format, ...); - int fputc(int c, FILE *stream); - int fputs(const char *s, FILE *stream); - size_t fread(void *ptr, size_t size, size_t n_items, FILE *stream); - int fseek(FILE *stream, long int offset, int whence); /* Prototyped but not implemented */ - size_t fwrite(const void *ptr, size_t size, size_t n_items, FILE *stream); - char *gets(char *s); - - int printf(const char *format, ...); - int puts(const char *s); - int rename(const char *source, const char *target); - int sprintf(char *dest, const char *format, ...); - int ungetc(int c, FILE *stream); - int vprintf(const char *s, va_list ap); - int vfprintf(FILE *stream, const char *s, va_list ap); - int vsprintf(char *buf, const char *s, va_list ap); - - int chdir(const char *path); /* Prototyped but not implemented */ - FILE *fdopen(int fd, const char *type); - int fstat(int fd, FAR struct stat *buf); /* Prototyped but not implemented */ - char *getcwd(FAR char *buf, size_t size); /* Prototyped but not implemented */ - int mkdir(const char *path, mode_t mode); - int rmdir(const char *path); - int stat(const char *path, FAR struct stat *buf); - int statfs(const char *path, FAR struct statfs *buf); /* Prototyped but not implemented */ --