Changes in / [a6480d5:c22531fc] in mainline


Ignore:
Location:
uspace
Files:
1 added
4 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    ra6480d5 rc22531fc  
    163163        lib/block \
    164164        lib/clui \
    165         lib/fmtutil \
    166165        lib/scsi \
    167166        lib/softint \
  • uspace/Makefile.common

    ra6480d5 rc22531fc  
    108108LIBIMGMAP_PREFIX = $(LIB_PREFIX)/imgmap
    109109LIBCLUI_PREFIX = $(LIB_PREFIX)/clui
    110 LIBFMTUTIL_PREFIX = $(LIB_PREFIX)/fmtutil
    111110
    112111LIBEXT2_PREFIX = $(LIB_PREFIX)/ext2
  • uspace/app/bdsh/Makefile

    ra6480d5 rc22531fc  
    2929
    3030USPACE_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
     31LIBS = $(LIBBLOCK_PREFIX)/libblock.a $(LIBCLUI_PREFIX)/libclui.a
     32EXTRA_CFLAGS = -I$(LIBBLOCK_PREFIX) -I$(LIBCLUI_PREFIX) -I. -Icmds/ \
     33        -Icmds/builtins -Icmds/modules
    3534BINARY = bdsh
    3635
  • uspace/app/bdsh/cmds/modules/help/help.c

    ra6480d5 rc22531fc  
    11/*
    22 * Copyright (c) 2008 Tim Post
    3  * Copyright (c) 2011 Martin Sucha
    43 * All rights reserved.
    54 *
     
    3130#include <stdlib.h>
    3231#include <str.h>
    33 #include <fmtutil.h>
    3432
    3533#include "config.h"
     
    130128static void help_survival(void)
    131129{
    132         print_wrapped_console(
    133             "Don't panic!\n\n"
     130        printf("Don't panic!\n\n");
    134131
    135             "This is Bdsh, the Brain dead shell, currently "
     132        printf("This is Bdsh, the Brain dead shell, currently "
    136133            "the primary user interface to HelenOS. Bdsh allows you to enter "
    137134            "commands and supports history (Up, Down arrow keys), "
    138135            "line editing (Left Arrow, Right Arrow, Home, End, Backspace), "
    139136            "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");
    141138
    142             "The most basic filesystem commands are Bdsh builtins. Type "
     139        printf("The most basic filesystem commands are Bdsh builtins. Type "
    143140            "'help commands' [Enter] to see the list of Bdsh builtin commands. "
    144141            "Other commands are external executables located in the /app and "
    145142            "/srv directories. Type 'ls /app' [Enter] and 'ls /srv' [Enter] "
    146143            "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");
    148145
    149             "HelenOS has virtual consoles (VCs). You can switch between "
    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");
    151148
    152             "This is but a small glimpse of what you can do with HelenOS. "
     149        printf("This is but a small glimpse of what you can do with HelenOS. "
    153150            "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");
    156152}
    157153
  • uspace/app/bdsh/compl.c

    ra6480d5 rc22531fc  
    9999        tokenizer_t tok;
    100100        token_t tokens[WORD_MAX];
    101         int current_token;
     101        unsigned int current_token;
    102102        size_t tokens_length;
    103103
     
    127127       
    128128        /* 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++) {
    131130                token_t *t = &tokens[current_token];
    132131                size_t end = t->char_start + t->char_length;
     
    138137                }
    139138        }
    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) {
    143141                *cstart = tokens[current_token].char_start;
    144142        }
     
    156154                goto error;
    157155        }
    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);
    164159
    165160        /*
     
    171166        /* Skip any whitespace before current token */
    172167        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) {
    174169                prev_token--;
    175170        }
     
    179174         * follows a pipe token.
    180175         */
    181         if (prev_token < 0 || tokens[prev_token].type == TOKTYPE_SPACE)
     176        if (prev_token == -1 || tokens[prev_token].type == TOKTYPE_SPACE)
    182177                cs->is_command = true;
    183178        else
  • uspace/app/bdsh/input.c

    ra6480d5 rc22531fc  
    6868{
    6969        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;
    7372        int rc = 0;
    7473        tokenizer_t tok;
     
    7877        char *redir_to = NULL;
    7978
    80         if (NULL == usr->line) {
    81                 free(tokens);
     79        if (NULL == usr->line)
    8280                return CL_EFAIL;
    83         }
    8481
    8582        rc = tok_init(&tok, usr->line, tokens, WORD_MAX);
     
    212209        }
    213210        tok_fini(&tok);
    214         free(tokens);
    215211
    216212        return rc;
  • uspace/app/tester/stdio/stdio1.c

    ra6480d5 rc22531fc  
    3939{
    4040        FILE *file;
    41         const char *file_name = "/textdemo";
     41        const char *file_name = "/readme";
    4242       
    4343        TPRINTF("Open file \"%s\"...", file_name);
  • uspace/dist/src/sysel/demos/htxtfile.sy

    ra6480d5 rc22531fc  
    3535                var out_file : TextFile;
    3636
    37                 name = "/textdemo";
     37                name = "/readme";
    3838
    3939                in_file = new TextFile();
  • uspace/lib/c/generic/str.c

    ra6480d5 rc22531fc  
    22 * Copyright (c) 2005 Martin Decky
    33 * Copyright (c) 2008 Jiri Svoboda
    4  * Copyright (c) 2011 Martin Sucha
    54 * All rights reserved.
    65 *
     
    719718
    720719        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;
    739720}
    740721
  • uspace/lib/c/include/str.h

    ra6480d5 rc22531fc  
    8383extern char *wstr_to_astr(const wchar_t *src);
    8484extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src);
    85 extern wchar_t *str_to_awstr(const char *src);
    8685
    8786extern char *str_chr(const char *str, wchar_t ch);
Note: See TracChangeset for help on using the changeset viewer.