Stock Control System
Loading...
Searching...
No Matches
Product.h
Go to the documentation of this file.
1/*
2 * Copyright (c) All Rights Reserved
3 * 2025 Oliver Dixon <od641@york.ac.uk>
4 */
5
14#ifndef STOCKCONTROL_PRODUCT_H
15#define STOCKCONTROL_PRODUCT_H
16
17#include <stdbool.h>
18#include <stdio.h>
19
20#define XSTR(VALUE) STR(VALUE)
21#define STR(VALUE) #VALUE
22
26#define MAX_NAME_LENGTH 63
27
33struct Product;
34
43struct Product *product_create(unsigned int id, const char *name, unsigned int quantity);
44
50void product_delete(struct Product **this);
51
59int product_report_serialise(const struct Product *this, FILE *buffer);
60
68int product_file_serialise(const struct Product *this, FILE *buffer);
69
77bool product_modify_quantity(struct Product *this, int modifier);
78
93int product_ptr_compare(const void *product_lhs, const void *product_rhs);
94
95#endif // STOCKCONTROL_PRODUCT_H
int product_report_serialise(const struct Product *const this, FILE *const buffer)
Definition Product.c:59
struct Product * product_create(const unsigned int id, const char *const name, const unsigned int quantity)
Definition Product.c:28
int product_file_serialise(const struct Product *const this, FILE *const buffer)
Definition Product.c:64
void product_delete(struct Product **this)
Definition Product.c:53
int product_ptr_compare(const void *const product_lhs, const void *const product_rhs)
Definition Product.c:78
bool product_modify_quantity(struct Product *this, const int modifier)
Definition Product.c:69
The Product represents a single product with a unique numerical identifier, human-readable name,...
Definition Product.c:22
char name[MAX_NAME_LENGTH+1]
NULL-terminated human-readable name of the Product.
Definition Product.c:25
unsigned int quantity
Non-negative number of Product items in stock.
Definition Product.c:24