Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#ifndef CRYPT _ H #define CRYPT _ H #define MAX _ BUFF 1 0 2 4 #define STDIN 0 #define STDOUT 1 #define STDERR 2
#ifndef CRYPTH
#define CRYPTH
#define MAXBUFF
#define STDIN
#define STDOUT
#define STDERR
void clientint readfd read head of channel int writefd write head of channel ;
void serverint readfd read head of channel int writefd write head of channel ;
double calculatechar buf;
#endif
#include
#include
#include
#include
#include
#include
#include
int mainint argc, char argv
write code for the main process that will establish
the communication channel between cleint and server using
pipes
pidt pid;
TODO:
int fd;
int pipeint pipefd;
ifpipefd
printfHello
;
exit;
pid fork;
ifpid
perrorFork failed
;
return ;
ifpid
TODO:
call to server here: serverint readfd, int writefd;
exit;
TODO:
call to client here clientint readfd, int writefd;
return ;
#include
#include
#include
#include
#include
#include
#include
void clientint readfd, int writefd
write client code to be used by the parent process
char bufMAXBUFF;
sizet len;
implement client functionality
#include
#include
#include
#include
#include
#include
#include
void serverint readfd, int writefd
write server code to be used by the child process
char bufMAXBUFF;
sizet len;
Implement server functionlity here
use calculate function to evaluate expression
signature: calculatechar buf
#include
#include
#include
#include
#include
#include
#include
double calculatechar buf
Implement the expression evaluation functionality which
will be invoked by the server whenever required.
double operands;
char op;
int oprnInd ;
double result ;
implement expression evaluation functionality here
returnresult;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started