Merge branch 'master' of github.com:brmlab/brmbar

This commit is contained in:
Pavol Rusnak 2011-04-22 02:26:58 +02:00
commit 521af62b24
3 changed files with 16 additions and 5 deletions

View file

@ -1,7 +1,7 @@
CC=bcc CC=bcc
CFLAGS=-Md -W CFLAGS=-Md -W
brmbar.com: brmbar.c brmbar.com: brmbar.c defines.h
$(CC) $(CFLAGS) brmbar.c -o brmbar.com $(CC) $(CFLAGS) brmbar.c -o brmbar.com
clean: clean:

View file

@ -1,10 +1,11 @@
#include <stdio.h> #include <stdio.h>
#include "defines.h"
struct item { struct item {
char *ean; char ean[EAN_MAXLEN];
char *name; char name[NAME_MAXLEN];
int price; int price;
} items[100]; } items[ITEM_MAXNUM];
int items_count; int items_count;
@ -14,7 +15,7 @@ void fill_items()
FILE *f = fopen("items.txt", "r"); FILE *f = fopen("items.txt", "r");
while (fgets(buf, 128, f)) { while (fgets(buf, 128, f)) {
printf("%s\n", buf); printf("%s\n", buf);
} }
fclose(f); fclose(f);
} }
@ -48,3 +49,4 @@ int main()
} }
return 0; return 0;
} }

9
defines.h Normal file
View 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