aboutsummaryrefslogtreecommitdiff
path: root/semestr-4/sieci/pracownia3/franciszek_malinka/window.h
blob: 63e89ccb9b098fef42a3b6179717a69a98cb3965 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef WINDOW_H
#define WINDOW_H

#include <stdbool.h>
#include <stddef.h>

typedef struct {
  char **ar;
  bool *uptodate;
  int size;
  int first_pos;
} window_t;

void init_window(window_t *w, int window_size, int window_width);

void destroy_window(window_t *w);

void shift_while_uptodate(window_t *w);

void shift(window_t *w);

void update(window_t *w, int pos, char *buffer, size_t buf_size);

#endif