Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 5fb32c5 in mainline for uspace/app/bdsh/tok.h


Ignore:
Timestamp:
2011-08-20T09:05:14Z (10 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master
Children:
c916dfc
Parents:
921b84f (diff), a0fc4be (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/tok.h

    r921b84f r5fb32c5  
    3030#define TOK_H
    3131
     32typedef enum {
     33        TOKTYPE_TEXT,
     34        TOKTYPE_PIPE,
     35        TOKTYPE_SPACE
     36} token_type_t;
     37
     38typedef struct {
     39        char *text;
     40        unsigned int byte_start;
     41        unsigned int char_start;
     42        size_t byte_length;
     43        size_t char_length;
     44        token_type_t type;
     45} token_t;
     46
    3247typedef struct {
    3348        char *in;
    34         size_t in_offset;
     49        unsigned int in_offset;
     50        unsigned int last_in_offset;
     51        unsigned int in_char_offset;
     52        unsigned int last_in_char_offset;
    3553       
    3654        char *outbuf;
     
    3957        size_t outbuf_last_start;
    4058       
    41         char **outtok;
     59        token_t *outtok;
     60        token_type_t current_type;
    4261        size_t outtok_offset;
    4362        size_t outtok_size;
    4463} tokenizer_t;
    4564
    46 extern int tok_init(tokenizer_t *, char *, char **, size_t);
     65extern int tok_init(tokenizer_t *, char *, token_t *, size_t);
    4766extern void tok_fini(tokenizer_t *);
    48 extern int tok_tokenize(tokenizer_t *);
     67extern int tok_tokenize(tokenizer_t *, size_t *);
    4968
    5069#endif
Note: See TracChangeset for help on using the changeset viewer.