Beispiel #1
0
/** @memo   Close a file.

    @doc    Close a file that was opened with rtp_file_open() and
    update the disk by flushing the directory entry and file
    allocation table, then free all core associated with the file
    descriptor.

    @return 0 if successful, -1 otherwise.  For debugging purposes;
    if the cause of the error is obtainable at the native File System
    layer, turn on RTP_DEBUG in rtpdebug.h to display the
    native error value.
 */
int rtp_file_close (
  RTP_HANDLE fileHandle                 /** File descriptor used to close the file. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #2
0
/** @memo   Outputs a debug integer.

    @doc    Outputs a debug integer.  This is not ISR safe.
    This should not be referenced from within an interrupt.
    
    @return void
 */
void _rtp_debug_output_int (
	long val
	)
{
    rtp_not_yet_implemented ();
    return (0);
}
Beispiel #3
0
/** @memo   Get the current thread handle.

    @doc    Retrieves the handle to the current thread.

    @return 0 on success, -1 otherwise.
 */
int rtp_thread_handle (
  RTP_HANDLE * currentThread            /** Storage location for the thread handle. */
  )
{
    rtp_not_yet_implemented();
    return (-1);
}
Beispiel #4
0
/** @memo   Gets the user data associated with the current thread.

    @doc    Retrieves the user data from the current thread.

    @return 0 on success, -1 otherwise.
 */
int rtp_thread_user_data (
  void ** userData                      /** Storage location for the user data. */
  )
{
    rtp_not_yet_implemented();
    return (-1);
}
Beispiel #5
0
/** @memo   Remove a subdirectory.

    @doc    Remove a subdirectory specified by name.  Fails if
    the path is not a directory, is read only, or is not empty.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_rmdir (
  char * name                           /** Name of the new subdirectory. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #6
0
/** @memo   Wait for a semaphore to be signaled.

    @doc    Wait for a semaphore to be signaled.  If the
    semaphore has already been signaled this function returns
    immediatley, otherwise it should block indefinitely until
    the semaphore is signaled.  This calls functionality is
    identical to calling rtp_sig_semaphore_wait_timed with a
    timeout value of -1 (INFINITE).

    @return 0 if successful, -1 otherwise.  For debugging
    purposes; if the cause of the error is obtainable at the
    native Kernel layer, turn on RTP_DEBUG in
    rtpsignl.c to display the native error value.
 */
int rtp_sig_semaphore_wait (
    RTP_HANDLE semHandle                  /** Handle to the semaphore to be checked. */
)
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #7
0
/** @memo   Delete a file.

    @doc    Deletes a file.  Fails if not a simple file, if it
    is open, does not exist, or is read only.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_delete (
  char * name                           /** Name of file to be deleted. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #8
0
/** @memo   Flushes a file stream.

    @doc    Flushes the file stream of any data.  After this call
    completes, the on disk view of the file is completely consistent
    with the in memory view.  It is a good idea to call this function
    periodically if a file is being extended.  If a file is not
    flushed or closed and a power down occurs, the file size will
    be wrong on disk and the FAT chains will be lost.

    @return 0 if successful and when nothing to flush, -1 on error.
    For debugging purposes; if the cause of the error is obtainable
    at the native File System layer, turn on RTP_DEBUG in
    rtpdebug.h to display the native error value.
 */
int rtp_file_flush (
  RTP_HANDLE fd                         /** File descriptor to the file to be flushed. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #9
0
/** @memo   Opens a file using the supplied name.

    @doc    Opens a file using the flag and mode settings, and sets
    the file descriptor.  The number of files available at any one
    time is dependant on the native File System.  When use of the
    file handle is completed, rtp_file_close() should be called.
    Default mode is RTP_FILE_O_RDONLY if flag is 0.

    @return 0 if successful, -1 on failure, -2 if a non-fatal
    error occurred.  If a -1 or -2 is returned the value of *fdPtr
    is undefined.  For debugging purposes; if the cause of the
    error is obtainable at the native File System layer, turn on
    RTP_DEBUG in rtpdebug.h to display the native error
    value.
 */
int rtp_file_open (
  RTP_HANDLE * fdPtr,                   /** Pointer to an RTP_HANDLE to store the file descriptor. */
  const char * name,                    /** The name of the file to open. */
  unsigned short flag,                  /** For the flag argument:<br>
	<pre>
|		RTP_FILE_O_APPEND   All writes will be appended to the file.
|		RTP_FILE_O_RDONLY   Open a file for reading only.
|		RTP_FILE_O_WRONLY   Open a file for writing only.
|		RTP_FILE_O_RDWR     Open a file for reading and writing.
|		RTP_FILE_O_CREAT    Create a file if it does not exist.
|		RTP_FILE_O_TRUNC    Truncate a file to 0 bytes after opening.
|		RTP_FILE_O_EXCL     If creating a file, fail if it already exists
|		RTP_FILE_O_BINARY   Create the file in binary mode.
|		RTP_FILE_O_TEXT     Create the file in text mode.
|		Note:               If neither the RTP_FILE_O_BINARY, or the
|		                    RTP_FILE_O_TEXT are used, the default behavior
|		                    is to open the file in text mode.
	</pre> */
  unsigned short mode                   /** For the mode argument:<br>
	<pre>
|		RTP_FILE_S_IWRITE   Create a file with write permissions.
|		RTP_FILE_S_IREAD    Create a file with read permissions.
	</pre> */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #10
0
/** @memo   Create and itialize a semaphore.

    @doc    Create and initalize a semaphore in the non-signalled
    state.  For example a counting semaphore with an initial
    count of zero.

    @return 0 if successful, -1 otherwise.  If a -1 is returned the
    value of *newSem is undefined.  For debugging purposes;
    if the cause of the error is obtainable at the native Kernel
    layer, turn on RTP_DEBUG in rtpsignl.c to display the
    native error value.
 */
int rtp_sig_semaphore_alloc (
    RTP_HANDLE *newSem,                   /** Storage location for the handle of the newly created semaphore.  */
    const char *name                      /** The name of the semaphore. */
)
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #11
0
/** @memo   Set the current working directory.

    @doc    Sets the directory specified by name as the new current
    working directory for this task.  The name must be a valid
    directory name.  If a drive letter is used in the name parameter,
    it will change the default drive letter to this new drive letter.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpnet.c to display
    the native error value.
 */
int rtp_file_setcwd (
  char * name                           /** Name of the directory to become
                                            the current working directory. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #12
0
/** @memo   Rename a file or directory.

    @doc    Moves the file or subdirectory named name to the new
    name specified in newname.  name and newname must be on the
    same drive but they may be in different directories.  Both
    names must be fully qualified.  Fails if newname is invalid,
    already exists or name is not found.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_rename (
  char * name,                          /** File name to be changed. */
  char * newname                        /** New name to be used. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #13
0
/** @memo   Truncate the file to the desired size.

    @doc    Given a file handle and a new file size, either extend the
    file or truncate it.  If the current file pointer is still within
    the range of the file, it is unmoved, otherwise it is moved to the
    end of the file.  If the original size of the file is smaller
    than the offset, the file is padded with '\0' until the offset.
    If the original size is larger than the offset, the extra bytes
    are removed and lost.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_truncate (
  RTP_HANDLE fd,                        /** File descriptor to the file to truncate. */
  long offset                           /** The new size of the file. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #14
0
/** @memo   Gets the user data associated with the thread handle.

    @doc    Retrieves the user data from the thread with the 
    associated thread handle.

    @return 0 on success, -1 otherwise.
 */
int rtp_thread_user_data_by_handle (
  RTP_HANDLE handle,                    /** Handle to the thread to find its user data. */
  void ** userData                      /** Storage location for the user data. */
  )
{
	rtp_not_yet_implemented();
	return (-1);
}
Beispiel #15
0
/** @memo   Write to a file.

    @doc    Attempt to write a number of bytes from a buffer to the
    current location in the file referred to by fileHandle.  The file
    current location is updated accordingly.

    @return Number of bytes written, -1 on error, and -2 on a
    non-fatal error.  For debugging purposes; if the cause of the
    error is obtainable at the native File System layer, turn on
    RTP_DEBUG in rtpdebug.h to display the native error value.
 */
long rtp_file_write (
  RTP_HANDLE fileHandle,                /** File descriptor to write the file. */
  const unsigned char * buffer,         /** Buffer to write to the file. */
  long count                            /** Amount to write. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #16
0
/** @memo   Read from a file.

    @doc    Attempt to read a number of bytes from the current file
    location of the file referred to by fileHandle and place the data
    in the storage buffer.  The file location is updated accordingly.

    @return Number of bytes read, 0 if end of file, -1 on error,
    and -2 on a non-fatal error.  For debugging purposes; if the
    cause of the error is obtainable at the native File System layer,
    turn on RTP_DEBUG in rtpdebug.h to display the native
    error value.
 */
long rtp_file_read (
  RTP_HANDLE fileHandle,                /** File descriptor to read the file. */
  unsigned char * buffer,               /** Buffer to store the read bytes. */
  long count                            /** Maximum amount to read. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #17
0
/** @memo   Print the name of the current working directory to a buffer.

    @doc    Fill name with the full path name of the current working
    directory for the current task in the default drive.  name
    must point to enough space to hold the full path without
    overriding user data.  The worst case possible is native
    File System dependant.

    @return 0 if successful, -1 on error.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_pwd (
  char * name,                          /** Storage location for the name
                                            of the current working directory. */
  long size                             /** The size of the storage location. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #18
0
/** @memo   Outputs a debug string.

    @doc    Outputs a debug string.  This is not ISR safe.
    This should not be referenced from within an interrupt.
    
    @return void
 */
void _rtp_debug_output_str (
	char* msg,
	const char *file,
	long line_num
	)
{
    rtp_not_yet_implemented ();
    return (0);
}
Beispiel #19
0
/** @memo   Retrieves disk free space information.

    @doc    Given a drive name, return the number of bytes on the
    drive, the number of bytes free on the drive, the number of
    sectors per unit, and the number of bytes per sector.

    @return 0 if successful, -1 otherwise.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_get_free (
  char * name,                          /** The name of the drive to obtain information on. */
  unsigned long *total,                 /** Total number of bytes on the drive. */
  unsigned long *free,                  /** Total number of bytes the drive has free. */
  unsigned long *sectors_per_unit,      /** Number of sectors per unit (cluster). */
  unsigned short *bytes_per_sector      /** Number of bytes per sector. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #20
0
/** @memo   Changes the date of creation, access, and modification
    of a file.

    @doc    Changes the date of creation, access, and modification
    of a file using the file descriptor passed in.

    @return 0 if successful, -1 otherwise.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_set_time (
  RTP_HANDLE fd,                        /** File descriptor of file that needs its dates changed. */
  RTP_DATE * adate,                     /** Date of last access. */
  RTP_DATE * wdate,                     /** Date of last write. */
  RTP_DATE * cdate,                     /** Date of creation. */
  RTP_DATE * hdate                      /** Date of last file mode change. */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #21
0
/** @memo   Spawn a thread.

    @doc    Spawn a thread and sets its priority level.

    @return 0 on success, -1 on failure, and -2 on non-fatal
    error.  If a -1 is returned the value of *newThread is 
    undefined.  An example of a non-fatal error would be if 
    the thread was spawned but the priority level could not 
    be set.
 */
int rtp_thread_spawn (
  RTP_HANDLE  * newThread,              /** Storage location for the handle to the new thread. */
  RTP_ENTRY_POINT_FN entryPoint,        /** A function pointer to the threads entry point. */
  const char  * name,                   /** The name of the thread. */
  int           stackSizeIndex,         /** An index into the array of possible stack sizes. */
  int           priorityIndex,          /** An index into the array of possible priorities. */
  void        * userData                /** User data to be passed to the entry point function. */
  )
{
    rtp_not_yet_implemented();
    return (-1);
}
Beispiel #22
0
/** @memo   Wait for a mutex to be available.

    @doc    Wait for a mutex to be available.  If the mutex is
    already available this function returns immediatley,
    otherwise it should block until the mutex is available or
    the millisecond time value has expired. Use 0 to poll the
    mutex and return with its state immediately.  Use -1 to
    indicate that an infinite timeout value should be used,
    blocking indefinitely for the mutex to become available.

    @postconditon For every time this function is successful
    on a designated mutex handle, a respective call to
    rtp_sig_mutex_release must be made.

    @return 0 if successful, -1 on error, and 1 if the call timed
    out.  For debugging purposes; if the cause of the error is
    obtainable at the native Kernel layer, turn on
    RTP_DEBUG in rtpsignl.c to display the native error
    value.
 */
int rtp_sig_mutex_claim_timed (
    RTP_HANDLE mutexHandle,               /** Handle to the mutex to be checked. */
    long msecs                            /** Timeout value in milliseconds:<br>
	<pre>
|		 0   To poll.
|		-1   To indicate use of infinite.
	</pre> */
)
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #23
0
/*----------------------------------------------------------------------*
                          rtp_net_gethostbyname
 *----------------------------------------------------------------------*/
int rtp_net_gethostbyname (unsigned char *ipAddr, int *type, char *name)
{
#if (INCLUDE_DNS)
#ifdef RTP_DEBUG
    int result;
#endif
    PFHOSTENT hp = NULL;

#ifdef RTP_DEBUG
    /* ----------------------------------- */
    /*  Clear the error state by setting   */
    /*  to 0.                              */
    /* ----------------------------------- */
    set_errno (0);
#endif

    if (!(hp = gethostbyname(name)))
    {
#ifdef RTP_DEBUG
        result = xn_getlasterror();
        RTP_DEBUG_OUTPUT_STR("rtp_net_gethostbyname: error returned ");
        RTP_DEBUG_OUTPUT_INT(result);
        RTP_DEBUG_OUTPUT_STR(".\n");
#endif
        return (-1);
    }

    if (hp->h_addrtype != AF_INET)
    {
#ifdef RTP_DEBUG
        set_errno (EAFNOSUPPORT);
        result = xn_getlasterror();
        RTP_DEBUG_OUTPUT_STR("rtp_net_gethostbyname: error returned ");
        RTP_DEBUG_OUTPUT_INT(result);
        RTP_DEBUG_OUTPUT_STR(".\n");
#endif
        return (-1);
    }
    *type = RTP_NET_TYPE_IPV4;

    ipAddr[0] = (unsigned char) hp->h_addr_list[0][0];
    ipAddr[1] = (unsigned char) hp->h_addr_list[0][1];
    ipAddr[2] = (unsigned char) hp->h_addr_list[0][2];
    ipAddr[3] = (unsigned char) hp->h_addr_list[0][3];


    return (0);
#else

    rtp_not_yet_implemented();
    return (-1);
#endif /* INCLUDE_DNS */
}
Beispiel #24
0
/** @memo   Moves the file pointer to the offset from the
    origin passed in.

    @doc    Move the file pointer offset bytes in the file relative to the
    origin.  Attempting to seek beyond the end of the file puts the
    file pointer one byte past the end of the file.  Seeking zero bytes
    from the origin set to 2 (end of the file) returns the file length.

    @return Offset from the beginning of the file, -1 on error.  For
    debugging purposes; if the cause of the error is obtainable
    at the native File System layer, turn on RTP_DEBUG
    in rtpdebug.h to display the native error value.
 */
long rtp_file_lseek (
  RTP_HANDLE fd,                        /** File descriptor to move its pointer. */
  long offset,                          /** The offset to move the pointer. */
  int origin                            /** The location that the offset is relative to:<br>
	<pre>
|		0 to seek from the beginning of the file.
|		1 to seek from the current file pointer position.
|		2 to seek from the end of the file.
	</pre> */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #25
0
/** @memo   Change file mode.

    @doc    Change the mode of a file to the desired attributes.
    One or more of the attributes may be set by or'ing them together.

    @return 0 if successful, -1 otherwise.  For debugging purposes;
    if the cause of the error is obtainable at the native File
    System layer, turn on RTP_DEBUG in rtpdebug.h to display
    the native error value.
 */
int rtp_file_chmode (
  char * name,                          /** The name of the file that needs its mode changed. */
  unsigned char attributes              /** The new attributes to be assigned to the file:<br>
	<pre>
|		RTP_FILE_ATTRIB_RDONLY      read only
|		RTP_FILE_ATTRIB_WRONLY      write only
|		RTP_FILE_ATTRIB_RDWR        read and write permissions
|		RTP_FILE_ATTRIB_HIDDEN      hidden
|		RTP_FILE_ATTRIB_SYSTEM      system file
|		RTP_FILE_ATTRIB_ARCHIVE     archived
	</pre> */
  )
{
    rtp_not_yet_implemented ();
    return (-1);
}
Beispiel #26
0
/** @memo   Abort a process.

    @doc    Abort from the process.

    @return void
 */
void rtp_kern_abort (void)
{
    rtp_not_yet_implemented ();
}
Beispiel #27
0
/** @memo   Begin multitasking.

    @doc    Begin multitasking.

    @return void
 */
void rtp_kern_run (void)
{
    rtp_not_yet_implemented ();
}
Beispiel #28
0
/** @memo   Initialize a kernel.

    @doc    Initialize a kernel.

    @return void
 */
void rtp_kern_init (void)
{
    rtp_not_yet_implemented ();
}
Beispiel #29
0
/** @memo   Exit an application.

    @doc    Exit an application.  The exit value is 0 if successfully 
    exiting, and -1 if exiting with a failure.

    @return void
 */
void rtp_kern_exit (
  int exitvalue                         /** Exit value; 0 for success, -1 otherwise. */
  )
{
    rtp_not_yet_implemented ();
}
Beispiel #30
0
int rtp_file_set_time (RTP_HANDLE fd, RTP_DATE * adate, RTP_DATE * wdate, RTP_DATE * cdate, RTP_DATE * hdate)
{
    rtp_not_yet_implemented( );
    return (-1);
}