Changeset 5e718d9 in mainline for uspace/app/edit/sheet.c


Ignore:
Timestamp:
2012-08-21T10:04:16Z (12 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67edca6
Parents:
0da6c04 (diff), 6a97f2e (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 with upstream (lp:~wtachi/helenos/bithenge)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/edit/sheet.c

    r0da6c04 r5e718d9  
    5757
    5858#include "sheet.h"
     59#include "sheet_impl.h"
    5960
    6061enum {
     
    6667
    6768/** Initialize an empty sheet. */
    68 int sheet_init(sheet_t *sh)
    69 {
     69int sheet_create(sheet_t **rsh)
     70{
     71        sheet_t *sh;
     72
     73        sh = calloc(1, sizeof(sheet_t));
     74        if (sh == NULL)
     75                return ENOMEM;
     76
    7077        sh->dbuf_size = INITIAL_SIZE;
    7178        sh->text_size = 0;
     
    7784        list_initialize(&sh->tags);
    7885
     86        *rsh = sh;
    7987        return EOK;
    8088}
     
    315323}
    316324
     325/** Get a character at spt and return next spt */
     326wchar_t spt_next_char(spt_t spt, spt_t *next)
     327{
     328        wchar_t ch = str_decode(spt.sh->data, &spt.b_off, spt.sh->text_size);
     329        if (next)
     330                *next = spt;
     331        return ch;
     332}
     333
     334wchar_t spt_prev_char(spt_t spt, spt_t *prev)
     335{
     336        wchar_t ch = str_decode_reverse(spt.sh->data, &spt.b_off, spt.sh->text_size);
     337        if (prev)
     338                *prev = spt;
     339        return ch;
     340}
     341
    317342/** Place a tag on the specified s-point. */
    318343void sheet_place_tag(sheet_t *sh, spt_t const *pt, tag_t *tag)
Note: See TracChangeset for help on using the changeset viewer.