Changeset a6480d5 in mainline
- Timestamp:
- 2011-08-21T11:44:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 25c1b2c, bd5f3b7, d1e196f7
- Parents:
- c22531fc (diff), 1877128 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Martin Sucha <> (2011-08-21 11:44:59)
- git-committer:
- Martin Decky <martin@…> (2011-08-21 11:44:59)
- Location:
- uspace
- Files:
-
- 3 added
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/Makefile
rc22531fc ra6480d5 163 163 lib/block \ 164 164 lib/clui \ 165 lib/fmtutil \ 165 166 lib/scsi \ 166 167 lib/softint \ -
uspace/Makefile.common
rc22531fc ra6480d5 108 108 LIBIMGMAP_PREFIX = $(LIB_PREFIX)/imgmap 109 109 LIBCLUI_PREFIX = $(LIB_PREFIX)/clui 110 LIBFMTUTIL_PREFIX = $(LIB_PREFIX)/fmtutil 110 111 111 112 LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2 -
uspace/app/bdsh/Makefile
rc22531fc ra6480d5 29 29 30 30 USPACE_PREFIX = ../.. 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 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 34 35 BINARY = bdsh 35 36 -
uspace/app/bdsh/cmds/modules/help/help.c
rc22531fc ra6480d5 1 1 /* 2 2 * Copyright (c) 2008 Tim Post 3 * Copyright (c) 2011 Martin Sucha 3 4 * All rights reserved. 4 5 * … … 30 31 #include <stdlib.h> 31 32 #include <str.h> 33 #include <fmtutil.h> 32 34 33 35 #include "config.h" … … 128 130 static void help_survival(void) 129 131 { 130 printf("Don't panic!\n\n"); 131 132 printf("This is Bdsh, the Brain dead shell, currently " 132 print_wrapped_console( 133 "Don't panic!\n\n" 134 135 "This is Bdsh, the Brain dead shell, currently " 133 136 "the primary user interface to HelenOS. Bdsh allows you to enter " 134 137 "commands and supports history (Up, Down arrow keys), " 135 138 "line editing (Left Arrow, Right Arrow, Home, End, Backspace), " 136 139 "selection (Shift + movement keys), copy and paste (Ctrl-C, " 137 "Ctrl-V), similar to common desktop environments.\n\n" );138 139 printf("The most basic filesystem commands are Bdsh builtins. Type "140 "Ctrl-V), similar to common desktop environments.\n\n" 141 142 "The most basic filesystem commands are Bdsh builtins. Type " 140 143 "'help commands' [Enter] to see the list of Bdsh builtin commands. " 141 144 "Other commands are external executables located in the /app and " 142 145 "/srv directories. Type 'ls /app' [Enter] and 'ls /srv' [Enter] " 143 146 "to see their list. You can execute an external command simply " 144 "by entering its name (e.g. type 'tetris' [Enter]).\n\n" );145 146 printf("HelenOS has virtual consoles (VCs). You can switch between "147 "these using the F1-F11 keys.\n\n" );148 149 printf("This is but a small glimpse of what you can do with HelenOS. "147 "by entering its name (e.g. type 'tetris' [Enter]).\n\n" 148 149 "HelenOS has virtual consoles (VCs). You can switch between " 150 "these using the F1-F11 keys.\n\n" 151 152 "This is but a small glimpse of what you can do with HelenOS. " 150 153 "To learn more please point your browser to the HelenOS User's " 151 "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n"); 154 "Guide: http://trac.helenos.org/trac.fcgi/wiki/UsersGuide\n\n", 155 ALIGN_LEFT); 152 156 } 153 157 -
uspace/app/bdsh/compl.c
rc22531fc ra6480d5 99 99 tokenizer_t tok; 100 100 token_t tokens[WORD_MAX]; 101 unsignedint current_token;101 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 < tokens_length; current_token++) { 129 for (current_token = 0; current_token < (int) tokens_length; 130 current_token++) { 130 131 token_t *t = &tokens[current_token]; 131 132 size_t end = t->char_start + t->char_length; … … 137 138 } 138 139 } 139 140 if (tokens[current_token].type != TOKTYPE_SPACE) { 140 if (tokens_length == 0) current_token = -1; 141 142 if (current_token >= 0 && tokens[current_token].type != TOKTYPE_SPACE) { 141 143 *cstart = tokens[current_token].char_start; 142 144 } … … 154 156 goto error; 155 157 } 156 157 str_ncpy(prefix, pref_size + 1, stext + 158 tokens[current_token].byte_start, pref_size); 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 } 159 164 160 165 /* … … 166 171 /* Skip any whitespace before current token */ 167 172 int prev_token = current_token - 1; 168 if (prev_token != -1&& tokens[prev_token].type == TOKTYPE_SPACE) {173 if (prev_token >= 0 && tokens[prev_token].type == TOKTYPE_SPACE) { 169 174 prev_token--; 170 175 } … … 174 179 * follows a pipe token. 175 180 */ 176 if (prev_token == -1|| tokens[prev_token].type == TOKTYPE_SPACE)181 if (prev_token < 0 || tokens[prev_token].type == TOKTYPE_SPACE) 177 182 cs->is_command = true; 178 183 else -
uspace/app/bdsh/input.c
rc22531fc ra6480d5 68 68 { 69 69 char *cmd[WORD_MAX]; 70 token_t tokens_space[WORD_MAX]; 71 token_t *tokens = tokens_space; 70 token_t *tokens = calloc(WORD_MAX, sizeof(token_t)); 71 if (tokens == NULL) 72 return ENOMEM; 72 73 int rc = 0; 73 74 tokenizer_t tok; … … 77 78 char *redir_to = NULL; 78 79 79 if (NULL == usr->line) 80 if (NULL == usr->line) { 81 free(tokens); 80 82 return CL_EFAIL; 83 } 81 84 82 85 rc = tok_init(&tok, usr->line, tokens, WORD_MAX); … … 209 212 } 210 213 tok_fini(&tok); 214 free(tokens); 211 215 212 216 return rc; -
uspace/app/tester/stdio/stdio1.c
rc22531fc ra6480d5 39 39 { 40 40 FILE *file; 41 const char *file_name = "/ readme";41 const char *file_name = "/textdemo"; 42 42 43 43 TPRINTF("Open file \"%s\"...", file_name); -
uspace/dist/src/sysel/demos/htxtfile.sy
rc22531fc ra6480d5 35 35 var out_file : TextFile; 36 36 37 name = "/ readme";37 name = "/textdemo"; 38 38 39 39 in_file = new TextFile(); -
uspace/lib/c/generic/str.c
rc22531fc ra6480d5 2 2 * Copyright (c) 2005 Martin Decky 3 3 * Copyright (c) 2008 Jiri Svoboda 4 * Copyright (c) 2011 Martin Sucha 4 5 * All rights reserved. 5 6 * … … 718 719 719 720 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-terminated 726 * 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; 720 739 } 721 740 -
uspace/lib/c/include/str.h
rc22531fc ra6480d5 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); 85 86 86 87 extern char *str_chr(const char *str, wchar_t ch);
Note:
See TracChangeset
for help on using the changeset viewer.