Changes in uspace/app/sbi/src/os/helenos.c [d9fae235:38aaacc2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/os/helenos.c
rd9fae235 r38aaacc2 35 35 #include <task.h> 36 36 #include <tinput.h> 37 #include <str_error.h>38 37 39 38 #include "os.h" … … 48 47 static tinput_t *tinput = NULL; 49 48 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 */ 51 55 char *os_str_acat(const char *a, const char *b) 52 56 { … … 70 74 } 71 75 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 */ 73 82 int os_str_cmp(const char *a, const char *b) 74 83 { … … 76 85 } 77 86 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 */ 79 92 size_t os_str_length(const char *str) 80 93 { … … 82 95 } 83 96 84 /** Duplicate string. */ 97 /** Duplicate string. 98 * 99 * @param str String 100 * @return New string, duplicate of @a str. 101 */ 85 102 char *os_str_dup(const char *str) 86 103 { … … 88 105 } 89 106 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 */ 91 115 int os_str_get_char(const char *str, int index, int *out_char) 92 116 { … … 117 141 } 118 142 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 */ 120 147 int os_input_line(char **ptr) 121 148 { … … 148 175 } 149 176 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 */ 151 182 int os_exec(char *const cmd[]) 152 183 { … … 155 186 int retval; 156 187 157 tid = task_spawn(cmd[0], (char const * const *) cmd , &retval);188 tid = task_spawn(cmd[0], (char const * const *) cmd); 158 189 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]); 161 191 exit(1); 162 192 } … … 168 198 } 169 199 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 */ 171 204 void os_store_ef_path(char *path) 172 205 {
Note:
See TracChangeset
for help on using the changeset viewer.