howm
howm
scratchpad.h File Reference

howm More...

#include "types.h"

Go to the source code of this file.

Data Structures

struct  stack
 Represents a stack. This stack is going to hold linked lists of clients. An example of the stack is below: More...
 

Functions

void stack_push (struct stack *s, client_t *c)
 Pushes a client onto the stack, as long as it isn't full. More...
 
client_tstack_pop (struct stack *s)
 Remove the top item from the stack and return it. More...
 
void stack_init (struct stack *s)
 Dynamically allocate space for the contents of the stack. More...
 
void stack_free (struct stack *s)
 Free the allocated contents. More...
 
void send_to_scratchpad (void)
 Send a client to the scratchpad and unmap it. More...
 
void get_from_scratchpad (void)
 Get a client from the scratchpad, attach it as the last item in the client list and set it to float. More...
 

Variables

struct stack del_reg
 

Detailed Description

howm

Author
Harvey Hunt
Date
2015

Function Documentation

void stack_free ( struct stack s)

Free the allocated contents.

Parameters
sThe stack that needs to have its contents freed.
void stack_init ( struct stack s)

Dynamically allocate space for the contents of the stack.

We don't know how big the stack will be when the struct is defined, so we need to allocate it dynamically.

Parameters
sThe stack that needs to have its contents allocated.
client_t* stack_pop ( struct stack s)

Remove the top item from the stack and return it.

Parameters
sThe stack to be popped from.
Returns
The client that was at the top of the stack. It acts as the head of the linked list of clients.
void stack_push ( struct stack s,
client_t c 
)

Pushes a client onto the stack, as long as it isn't full.

Parameters
sThe stack.
cThe client to be pushed on. This client is treated as the head of a linked list.

Variable Documentation

struct stack del_reg