Group_B_VirtualEscapeRoom
Functions
arghandling.h File Reference

Utility functions to manipulate objects. More...

#include <stdbool.h>
#include "object.h"

Go to the source code of this file.

Functions

bool object_has_tag (OBJECT_t *obj, const char *arg)
 A function to return whether the user's argument has a matching tag. More...
 
OBJECT_tget_object (const char *arg)
 A function to scan through the object list to find a matching object. More...
 

Detailed Description

Utility functions to manipulate objects.

This header file contains functions that define how to deal with user input arg.

Function Documentation

◆ get_object()

OBJECT_t* get_object ( const char *  arg)

A function to scan through the object list to find a matching object.

This function scans through the entire object list and returns a pointer to the object when arg matches an object’s tag

Parameters
[in]argthe argument value provided by the user
Returns
the pointer to a matching object, NULL if no match found

◆ object_has_tag()

bool object_has_tag ( OBJECT_t obj,
const char *  arg 
)

A function to return whether the user's argument has a matching tag.

This function will check whether arg matches the tag on the supplied object obj

Parameters
[in]objan stored object
[in]argthe argument value provided by the user
Returns
1 in case of a match, 0 otherwise