Changes in / [a6480d5:c22531fc] in mainline
- Location:
- uspace
- Files:
-
- 1 added
- 4 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile
ra6480d5 rc22531fc 163 163 lib/block \ 164 164 lib/clui \ 165 lib/fmtutil \166 165 lib/scsi \ 167 166 lib/softint \ -
uspace/Makefile.common
ra6480d5 rc22531fc 108 108 LIBIMGMAP_PREFIX = $(LIB_PREFIX)/imgmap 109 109 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 110 LIBFMTUTIL_PREFIX = $(LIB_PREFIX)/fmtutil111 110 112 111 LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2 -
uspace/app/bdsh/Makefile
ra6480d5 rc22531fc 29 29 30 30 USPACE_PREFIX = ../.. 31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCLUI_PREFIX)/libclui.a \ 32 $(LIBFMTUTIL_PREFIX)/libfmtutil.a 33 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCLUI_PREFIX) -I$(LIBFMTUTIL_PREFIX)\ 34 -I. -Icmds/ -Icmds/builtins -Icmds/modules 31 LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCLUI_PREFIX)/libclui.a 32 EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCLUI_PREFIX) -I. -Icmds/ \ 33 -Icmds/builtins -Icmds/modules 35 34 BINARY = bdsh 36 35 -
uspace/app/bdsh/cmds/modules/help/help.c
ra6480d5 rc22531fc 1 1 /* 2 2 * Copyright (c) 2008 Tim Post 3 * Copyright (c) 2011 Martin Sucha4 3 * All rights reserved. 5 4 * … … 31 30 #include <stdlib.h> 32 31 #include <str.h> 33 #include <fmtutil.h>34 32 35 33 #include "config.h" … … 130 128 static void help_survival(void) 131 129 { 132 print_wrapped_console( 133 "Don't panic!\n\n" 130 printf("Don't panic!\n\n"); 134 131 135 132 printf("This is Bdsh, the Brain dead shell, currently " 136 133 "the primary user interface to HelenOS. Bdsh allows you to enter " 137 134 "commands and supports history (Up, Down arrow keys), " 138 135 "line editing (Left Arrow, Right Arrow, Home, End, Backspace), " 139 136 "selection (Shift + movement keys), copy and paste (Ctrl-C, " 140 "Ctrl-V), similar to common desktop environments.\n\n" 137 "Ctrl-V), similar to common desktop environments.\n\n"); 141 138 142 139 printf("The most basic filesystem commands are Bdsh builtins. Type " 143 140 "'help commands' [Enter] to see the list of Bdsh builtin commands. " 144 141 "Other commands are external executables located in the /app and " 145 142 "/srv directories. Type 'ls /app' [Enter] and 'ls /srv' [Enter] " 146 143 "to see their list. You can execute an external command simply " 147 "by entering its name (e.g. type 'tetris' [Enter]).\n\n" 144 "by entering its name (e.g. type 'tetris' [Enter]).\n\n"); 148 145 149 150 "these using the F1-F11 keys.\n\n" 146 printf("HelenOS has virtual consoles (VCs). You can switch between " 147 "these using the F1-F11 keys.\n\n"); 151 148 152 149 printf("This is but a small glimpse of what you can do with HelenOS. " 153 150 "To learn more please point your browser to the HelenOS User's " 154 "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n", 155 ALIGN_LEFT); 151 "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n"); 156 152 } 157 153 -
uspace/app/bdsh/compl.c
ra6480d5 rc22531fc 99 99 tokenizer_t tok; 100 100 token_t tokens[WORD_MAX]; 101 int current_token;101 unsigned int current_token; 102 102 size_t tokens_length; 103 103 … … 127 127 128 128 /* Find the current token */ 129 for (current_token = 0; current_token < (int) tokens_length; 130 current_token++) { 129 for (current_token = 0; current_token < tokens_length; current_token++) { 131 130 token_t *t = &tokens[current_token]; 132 131 size_t end = t->char_start + t->char_length; … … 138 137 } 139 138 } 140 if (tokens_length == 0) current_token = -1; 141 142 if (current_token >= 0 && tokens[current_token].type != TOKTYPE_SPACE) { 139 140 if (tokens[current_token].type != TOKTYPE_SPACE) { 143 141 *cstart = tokens[current_token].char_start; 144 142 } … … 156 154 goto error; 157 155 } 158 prefix[pref_size] = 0; 159 160 if (current_token >= 0) { 161 str_ncpy(prefix, pref_size + 1, stext + 162 tokens[current_token].byte_start, pref_size); 163 } 156 157 str_ncpy(prefix, pref_size + 1, stext + 158 tokens[current_token].byte_start, pref_size); 164 159 165 160 /* … … 171 166 /* Skip any whitespace before current token */ 172 167 int prev_token = current_token - 1; 173 if (prev_token >= 0&& tokens[prev_token].type == TOKTYPE_SPACE) {168 if (prev_token != -1 && tokens[prev_token].type == TOKTYPE_SPACE) { 174 169 prev_token--; 175 170 } … … 179 174 * follows a pipe token. 180 175 */ 181 if (prev_token < 0|| tokens[prev_token].type == TOKTYPE_SPACE)176 if (prev_token == -1 || tokens[prev_token].type == TOKTYPE_SPACE) 182 177 cs->is_command = true; 183 178 else -
uspace/app/bdsh/input.c
ra6480d5 rc22531fc 68 68 { 69 69 char *cmd[WORD_MAX]; 70 token_t *tokens = calloc(WORD_MAX, sizeof(token_t)); 71 if (tokens == NULL) 72 return ENOMEM; 70 token_t tokens_space[WORD_MAX]; 71 token_t *tokens = tokens_space; 73 72 int rc = 0; 74 73 tokenizer_t tok; … … 78 77 char *redir_to = NULL; 79 78 80 if (NULL == usr->line) { 81 free(tokens); 79 if (NULL == usr->line) 82 80 return CL_EFAIL; 83 }84 81 85 82 rc = tok_init(&tok, usr->line, tokens, WORD_MAX); … … 212 209 } 213 210 tok_fini(&tok); 214 free(tokens);215 211 216 212 return rc; -
uspace/app/tester/stdio/stdio1.c
ra6480d5 rc22531fc 39 39 { 40 40 FILE *file; 41 const char *file_name = "/ textdemo";41 const char *file_name = "/readme"; 42 42 43 43 TPRINTF("Open file \"%s\"...", file_name); -
uspace/dist/src/sysel/demos/htxtfile.sy
ra6480d5 rc22531fc 35 35 var out_file : TextFile; 36 36 37 name = "/ textdemo";37 name = "/readme"; 38 38 39 39 in_file = new TextFile(); -
uspace/lib/c/generic/str.c
ra6480d5 rc22531fc 2 2 * Copyright (c) 2005 Martin Decky 3 3 * Copyright (c) 2008 Jiri Svoboda 4 * Copyright (c) 2011 Martin Sucha5 4 * All rights reserved. 6 5 * … … 719 718 720 719 dest[dlen - 1] = '\0'; 721 }722 723 /** Convert string to wide string.724 *725 * Convert string @a src to wide string. A new wide NULL-terminated726 * string will be allocated on the heap.727 *728 * @param src Source string.729 */730 wchar_t *str_to_awstr(const char *str)731 {732 size_t len = str_length(str);733 wchar_t *wstr = calloc(len+1, sizeof(wchar_t));734 if (wstr == NULL) {735 return NULL;736 }737 str_to_wstr(wstr, len+1, str);738 return wstr;739 720 } 740 721 -
uspace/lib/c/include/str.h
ra6480d5 rc22531fc 83 83 extern char *wstr_to_astr(const wchar_t *src); 84 84 extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src); 85 extern wchar_t *str_to_awstr(const char *src);86 85 87 86 extern char *str_chr(const char *str, wchar_t ch);
Note:
See TracChangeset
for help on using the changeset viewer.