Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/sbi/src/os/helenos.c

    rd9fae235 r38aaacc2  
    3535#include <task.h>
    3636#include <tinput.h>
    37 #include <str_error.h>
    3837
    3938#include "os.h"
     
    4847static tinput_t *tinput = NULL;
    4948
    50 /** Concatenate two strings. */
     49/** Concatenate two strings.
     50 *
     51 * @param a     First string
     52 * @param b     Second string
     53 * @return      New string, concatenation of @a a and @a b.
     54 */
    5155char *os_str_acat(const char *a, const char *b)
    5256{
     
    7074}
    7175
    72 /** Compare two strings. */
     76/** Compare two strings.
     77 *
     78 * @param a     First string
     79 * @param b     Second string
     80 * @return      Zero if equal, nonzero if not equal
     81 */
    7382int os_str_cmp(const char *a, const char *b)
    7483{
     
    7685}
    7786
    78 /** Return number of characters in string. */
     87/** Return number of characters in string.
     88 *
     89 * @param str   String
     90 * @return      Number of characters in @a str.
     91 */
    7992size_t os_str_length(const char *str)
    8093{
     
    8295}
    8396
    84 /** Duplicate string. */
     97/** Duplicate string.
     98 *
     99 * @param str   String
     100 * @return      New string, duplicate of @a str.
     101 */
    85102char *os_str_dup(const char *str)
    86103{
     
    88105}
    89106
    90 /** Get character from string at the given index. */
     107/** Get character from string at the given index.
     108 *
     109 * @param str           String
     110 * @param index         Character index (starting from zero).
     111 * @param out_char      Place to store character.
     112 * @return              EOK on success, EINVAL if index is out of bounds,
     113 *                      EIO on decoding error.
     114 */
    91115int os_str_get_char(const char *str, int index, int *out_char)
    92116{
     
    117141}
    118142
    119 /** Read one line of input from the user. */
     143/** Read one line of input from the user.
     144 *
     145 * @param ptr   Place to store pointer to new string.
     146 */
    120147int os_input_line(char **ptr)
    121148{
     
    148175}
    149176
    150 /** Simple command execution. */
     177/** Simple command execution.
     178 *
     179 * @param cmd   Command and arguments (NULL-terminated list of strings.)
     180 *              Command is present just one, not duplicated.
     181 */
    151182int os_exec(char *const cmd[])
    152183{
     
    155186        int retval;
    156187
    157         tid = task_spawn(cmd[0], (char const * const *) cmd, &retval);
     188        tid = task_spawn(cmd[0], (char const * const *) cmd);
    158189        if (tid == 0) {
    159                 printf("Error: Failed spawning '%s' (%s).\n", cmd[0],
    160                     str_error(retval));
     190                printf("Error: Failed spawning '%s'.\n", cmd[0]);
    161191                exit(1);
    162192        }
     
    168198}
    169199
    170 /** Store the executable file path via which we were executed. */
     200/** Store the executable file path via which we were executed.
     201 *
     202 * @param path  Executable path via which we were executed.
     203 */
    171204void os_store_ef_path(char *path)
    172205{
Note: See TracChangeset for help on using the changeset viewer.