Changeset b7fd2a0 in mainline for uspace/dist
- Timestamp:
- 2018-01-13T03:10:29Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- Location:
- uspace/dist/src/c/demos
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/dist/src/c/demos/edit/edit.c
r36f0738 rb7fd2a0 190 190 cons_event_t ev; 191 191 bool new_file; 192 int rc;192 errno_t rc; 193 193 194 194 con = console_init(stdin, stdout); … … 580 580 { 581 581 spt_t sp, ep; 582 int rc;582 errno_t rc; 583 583 584 584 status_display("Saving..."); … … 615 615 } 616 616 617 int rc = file_save(fname);617 errno_t rc = file_save(fname); 618 618 if (rc != EOK) 619 619 return; … … 1330 1330 1331 1331 match_t match; 1332 int rc = search_next_match(search, &match);1332 errno_t rc = search_next_match(search, &match); 1333 1333 if (rc != EOK) { 1334 1334 status_display("Failed searching."); … … 1448 1448 size_t off; 1449 1449 wchar_t c; 1450 int rc;1450 errno_t rc; 1451 1451 1452 1452 rc = clipboard_get_str(&str); -
uspace/dist/src/c/demos/edit/search.c
r36f0738 rb7fd2a0 104 104 } 105 105 106 int search_next_match(search_t *s, match_t *match)106 errno_t search_next_match(search_t *s, match_t *match) 107 107 { 108 108 search_equals_fn eq = s->ops.equals; 109 109 110 110 wchar_t cur_char; 111 int rc = EOK;111 errno_t rc = EOK; 112 112 while ((rc = s->ops.producer(s->client_data, &cur_char)) == EOK && cur_char > 0) { 113 113 /* Deal with mismatches */ -
uspace/dist/src/c/demos/edit/search.h
r36f0738 rb7fd2a0 42 42 typedef struct search search_t; 43 43 typedef bool (*search_equals_fn)(const wchar_t, const wchar_t); 44 typedef int (*search_producer_fn)(void *, wchar_t *);45 typedef int (*search_mark_fn)(void *, void **);44 typedef errno_t (*search_producer_fn)(void *, wchar_t *); 45 typedef errno_t (*search_mark_fn)(void *, void **); 46 46 typedef void (*search_mark_free_fn)(void *); 47 47 … … 60 60 extern bool char_exact_equals(const wchar_t, const wchar_t); 61 61 extern search_t *search_init(const char *, void *, search_ops_t, bool); 62 extern int search_next_match(search_t *, match_t *);62 extern errno_t search_next_match(search_t *, match_t *); 63 63 extern void search_fini(search_t *); 64 64 -
uspace/dist/src/c/demos/edit/sheet.c
r36f0738 rb7fd2a0 67 67 68 68 /** Initialize an empty sheet. */ 69 int sheet_create(sheet_t **rsh)69 errno_t sheet_create(sheet_t **rsh) 70 70 { 71 71 sheet_t *sh; … … 101 101 * and vice versa. 102 102 */ 103 int sheet_insert(sheet_t *sh, spt_t *pos, enum dir_spec dir, char *str)103 errno_t sheet_insert(sheet_t *sh, spt_t *pos, enum dir_spec dir, char *str) 104 104 { 105 105 char *ipp; … … 147 147 * @return EOK on success or an error code. 148 148 **/ 149 int sheet_delete(sheet_t *sh, spt_t *spos, spt_t *epos)149 errno_t sheet_delete(sheet_t *sh, spt_t *spos, spt_t *epos) 150 150 { 151 151 char *spp; -
uspace/dist/src/c/demos/edit/sheet.h
r36f0738 rb7fd2a0 90 90 } tag_t; 91 91 92 extern int sheet_create(sheet_t **);93 extern int sheet_insert(sheet_t *, spt_t *, enum dir_spec, char *);94 extern int sheet_delete(sheet_t *, spt_t *, spt_t *);92 extern errno_t sheet_create(sheet_t **); 93 extern errno_t sheet_insert(sheet_t *, spt_t *, enum dir_spec, char *); 94 extern errno_t sheet_delete(sheet_t *, spt_t *, spt_t *); 95 95 extern void sheet_copy_out(sheet_t *, spt_t const *, spt_t const *, char *, 96 96 size_t, spt_t *); -
uspace/dist/src/c/demos/hello/hello.c
r36f0738 rb7fd2a0 1 extern int putchar(char);1 extern errno_t putchar(char); 2 2 3 3 #define TERMINATOR '!' -
uspace/dist/src/c/demos/tetris/scores.c
r36f0738 rb7fd2a0 206 206 } 207 207 208 int loadscores(void)208 errno_t loadscores(void) 209 209 { 210 210 FILE *f; 211 211 size_t cnt; 212 int rc;212 errno_t rc; 213 213 214 214 f = fopen("/data/tetris.sco", "rb"); … … 229 229 FILE *f; 230 230 size_t cnt; 231 int rc;231 errno_t rc; 232 232 233 233 f = fopen("/data/tetris.sco", "wb"); -
uspace/dist/src/c/demos/tetris/scores.h
r36f0738 rb7fd2a0 72 72 extern void initscores(void); 73 73 extern void insertscore(int score, int level); 74 extern int loadscores(void);74 extern errno_t loadscores(void); 75 75 extern void savescores(void); 76 76 -
uspace/dist/src/c/demos/tetris/screen.c
r36f0738 rb7fd2a0 147 147 { 148 148 sysarg_t ccap; 149 int rc = console_get_color_cap(console, &ccap);149 errno_t rc = console_get_color_cap(console, &ccap); 150 150 151 151 if (rc != 0) … … 353 353 * 354 354 */ 355 int tgetchar(void)355 errno_t tgetchar(void) 356 356 { 357 357 /* … … 392 392 * 393 393 */ 394 int twait(void)394 errno_t twait(void) 395 395 { 396 396 wchar_t c = 0; -
uspace/dist/src/c/demos/tetris/screen.h
r36f0738 rb7fd2a0 71 71 extern void clear_screen(void); 72 72 73 extern int put(int);73 extern errno_t put(int); 74 74 extern void scr_clear(void); 75 75 extern void scr_end(void); … … 80 80 81 81 extern void tsleep(void); 82 extern int tgetchar(void);83 extern int twait(void);82 extern errno_t tgetchar(void); 83 extern errno_t twait(void); 84 84 85 85 /** @} -
uspace/dist/src/c/demos/tetris/shapes.c
r36f0738 rb7fd2a0 93 93 * taking the current board into account. 94 94 */ 95 int fits_in(const struct shape *shape, int pos)95 errno_t fits_in(const struct shape *shape, int pos) 96 96 { 97 97 const int *o = shape->off; -
uspace/dist/src/c/demos/tetris/tetris.h
r36f0738 rb7fd2a0 194 194 extern int classic; 195 195 196 extern int fits_in(const struct shape *, int);196 extern errno_t fits_in(const struct shape *, int); 197 197 extern void place(const struct shape *, int, int); 198 198 extern void stop(const char *); -
uspace/dist/src/c/demos/top/screen.c
r36f0738 rb7fd2a0 537 537 * 538 538 */ 539 int tgetchar(unsigned int sec)539 errno_t tgetchar(unsigned int sec) 540 540 { 541 541 /* -
uspace/dist/src/c/demos/top/screen.h
r36f0738 rb7fd2a0 47 47 PRINTF_ATTRIBUTE(1, 2); 48 48 49 extern int tgetchar(unsigned int);49 extern errno_t tgetchar(unsigned int); 50 50 51 51 #endif
Note:
See TracChangeset
for help on using the changeset viewer.