Relational Algebra Engine
Loading...
Searching...
No Matches
Functions
attribute.c File Reference

Attribute implementation for the Relational Algebra Engine. More...

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

Functions

Attribute * attribute_create (const char *name, AttributeType type, void *value)
 Create a new Attribute.
 
void attribute_destroy (Attribute *attr)
 Destroy an Attribute and free its memory.
 
void attribute_print (const Attribute *attr)
 Print an Attribute to stdout.
 

Detailed Description

Attribute implementation for the Relational Algebra Engine.

Handles creation, destruction, and printing of attributes, which are name-value pairs used as the basic building blocks of tuples in the relational model.

Function Documentation

◆ attribute_create()

Attribute * attribute_create ( const char *  name,
AttributeType  type,
void *  value 
)

Create a new Attribute.

Parameters
nameName of the attribute (copied).
typeType of the attribute (see AttributeType).
valuePointer to the value (ownership is taken).
Returns
Pointer to the new Attribute, or NULL on failure.

◆ attribute_destroy()

void attribute_destroy ( Attribute *  attr)

Destroy an Attribute and free its memory.

Parameters
attrPointer to the Attribute to destroy. Safe to pass NULL.

◆ attribute_print()

void attribute_print ( const Attribute *  attr)

Print an Attribute to stdout.

Parameters
attrPointer to the Attribute to print.