-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistproc.h
executable file
·60 lines (38 loc) · 1.18 KB
/
listproc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
TITLE: OPERATING SYSTEMS LABS
AUTHOR 1: MARTIÑO RIVERA DOURADO
AUTHOR 2: CARMEN CORRALES CAMELLO
DATE: 13/12/2017
*/
/*
* Process list, implementation of linked list with a header node (1)
*
* */
#ifndef LISTPROC_H
#define LISTPROC_H
#define MAXLINE 1024 // Maximum number of characters a command line can be called with
#include "translations.h"
typedef struct{
pid_t pid; // PID of the process
int prio; // Priority
char cmd [MAXLINE]; // Command
char date[30]; // Time stamp of the moment of starting the process
state_t status; // State of the process, enumeration(translations.h)
int signal; // Codified exit-status/stopped/terminated signal of the process
} elemP;
struct node{
elemP * element;
struct node * next;
};
typedef struct node * posP;
typedef struct node * procList;
procList proc_createList();
void proc_insert(elemP * e, procList l);
void proc_clear(procList l);
posP proc_find_pid(procList l, pid_t reqPid);
void proc_showList(procList l);
void proc_show(elemP e);
elemP proc_getElement(posP p);
elemP * proc_createElement(pid_t pid, int prio, char * args[], char * date, int status, int signal);
void proc_updateList(procList l);
#endif