mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
Merge branch 'master' of github.com:brmlab/brmbar
This commit is contained in:
commit
521af62b24
3 changed files with 16 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
CC=bcc
|
||||
CFLAGS=-Md -W
|
||||
|
||||
brmbar.com: brmbar.c
|
||||
brmbar.com: brmbar.c defines.h
|
||||
$(CC) $(CFLAGS) brmbar.c -o brmbar.com
|
||||
|
||||
clean:
|
||||
|
|
10
brmbar.c
10
brmbar.c
|
@ -1,10 +1,11 @@
|
|||
#include <stdio.h>
|
||||
#include "defines.h"
|
||||
|
||||
struct item {
|
||||
char *ean;
|
||||
char *name;
|
||||
char ean[EAN_MAXLEN];
|
||||
char name[NAME_MAXLEN];
|
||||
int price;
|
||||
} items[100];
|
||||
} items[ITEM_MAXNUM];
|
||||
|
||||
int items_count;
|
||||
|
||||
|
@ -14,7 +15,7 @@ void fill_items()
|
|||
FILE *f = fopen("items.txt", "r");
|
||||
while (fgets(buf, 128, f)) {
|
||||
printf("%s\n", buf);
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
@ -48,3 +49,4 @@ int main()
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
9
defines.h
Normal file
9
defines.h
Normal file
|
@ -0,0 +1,9 @@
|
|||
#ifndef _BRMBAR_DEFINES_H_
|
||||
#define _BRMBAR_DEFINES_H_
|
||||
|
||||
#define EAN_MAXLEN 32
|
||||
#define NAME_MAXLEN 128
|
||||
#define ITEM_MAXNUM 128
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue