Stock Control System
Loading...
Searching...
No Matches
Product.c File Reference

Product class implementation. More...

#include "Product.h"
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for Product.c:

Go to the source code of this file.

Data Structures

struct  Product
 The Product represents a single product with a unique numerical identifier, human-readable name, and integral non-negative quantity. More...
 

Functions

struct Productproduct_create (const unsigned int id, const char *const name, const unsigned int quantity)
 
void product_delete (struct Product **this)
 
int product_report_serialise (const struct Product *const this, FILE *const buffer)
 
int product_file_serialise (const struct Product *const this, FILE *const buffer)
 
bool product_modify_quantity (struct Product *this, const int modifier)
 
int product_ptr_compare (const void *const product_lhs, const void *const product_rhs)
 

Detailed Description

Product class implementation.

Author
Oliver Dixon
Date
2025-09-06
Version
Development

Definition in file Product.c.

Function Documentation

◆ product_create()

struct Product * product_create ( const unsigned int  id,
const char *const  name,
const unsigned int  quantity 
)

Definition at line 28 of file Product.c.

◆ product_delete()

void product_delete ( struct Product **  this)

Definition at line 53 of file Product.c.

◆ product_file_serialise()

int product_file_serialise ( const struct Product *const  this,
FILE *const  buffer 
)

Definition at line 64 of file Product.c.

◆ product_modify_quantity()

bool product_modify_quantity ( struct Product this,
const int  modifier 
)

Definition at line 69 of file Product.c.

◆ product_ptr_compare()

int product_ptr_compare ( const void *const  product_lhs,
const void *const  product_rhs 
)

Definition at line 78 of file Product.c.

◆ product_report_serialise()

int product_report_serialise ( const struct Product *const  this,
FILE *const  buffer 
)

Definition at line 59 of file Product.c.