EmbLogic's Blog

Replacing a Process Image

Replacing a Process Image
=========================
- The exec function replaces current process with a new process.
- The path of new process is specified as argument to exec.
- It is defined in header :
#include<unistd.h>
- Last argument of function should be NULL.
- It has 6 types of functions, whose prototype are :-
(i) Complete path is specified
int execl(const char * path, const char * arg0,const char * arg1,…,NULL);
(ii) If file is at one of default paths
int execlp(const char * file, const char * arg0,const char * arg1,…,NULL);
(iii) If arguments are given as an vector(array)
int execv(const char *path,char *const argv[]);
(iv) If arguments are given as an vector(array) and file is at one of default paths
int execvp(const char* file, char *const argv[]);
(v) int execle(const char *path, const char * arg0, const char * arg1,…,NULL, char *const envp[]);
(vi) int execve(const char *path, char *const argv[],char *const envp[] );

- The suffix p means to search PATH environmental variable.

- If the exec is executed successfully the statements after it will not be executed.
- It is because the current process is replaced.
- The arguments given to exec are used by main() function of new process as command line argument.
- If exec fails, it returns -1
- The open file descriptors remain open after the exec command.
- These file descriptors can be passed to exec as command and can be used by the replaced process to read/write from opened file.
- The argument is passed to exec as character.
- For this sprintf() is used.
- And for getting the file descriptors back , atoi() or integer typecasting can be used on the arguments of main().

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , , | Leave a comment

Orphan Process

Orphan Process
===============
If in a process, the parent process is terminated before the child process, the child process become orphan
- It takes the lowest possible process as its parent
- And its PPID is changed to the PID of its new parent process.
- Mostly the new parent process in init process (PID = 1).
- It is because init adopts the orphan process.
- The child is then terminated normally by the init process.

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , | Leave a comment

Zombie or Defunct Process

Zombie or Defunct Process
==========================
If a child proces tries to teminate,its association with parent remains until the parent terminates normally or calls wait.
- The child process entry in process table is therfore not freed up immediately.
- Althougth the process is no longer active, the child remains still in system because its exit code is needed to be stored in case of parent subsequently

calls wait.
- The process becomes defunct or zombie process.
- It is shown by ‘Z’ or ‘Z+’ in process table.

- If the parent is terminated abnormally, the zombie child process will not be terminated (which is not good).

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , | Leave a comment

waiting for a process

Waiting For a Process
=====================
- Sometime we would like to find out when a child process has finished.
- It is needed for parent process to wait until the child finishes before continuing by calling wait.
- It has prototype :
pid_t wait(int *stat_loc);
- It is declared in header :
#include<sys/wait.h>
- It has a return type pid_t which is declared in header :
#include<sys/types.h>
- The wait system call causes a parent process to pause until one of its child processes is stopped.
- The wait returns PID of child process which is terminated.
- The status information determine the exit status of child process (i.e  value returned from main or passed to exit)
- If stat_loc is not a null pointer, the status information will be written to location to which it points.
- The status information can be determined by using macros defined in header sys/wait.h

Macro                                        Defination
WIFEXITED(stat_val)          Nonzero if child terminated normally
WEXITSTATUS(stat_val)    If WIFEXITED is nonzero, this returns child exit code

WIFSIGNALED(stat_val)    Nonzero if child is terminated on an uncaught signal
WTERMSIG(stat_val)           If WIFSIGNALED is nonzero, this returns signal number

WIFSTOPPED(stat_val)       Nonzero if the child has stopped
WSTOPSIG(stat_val)            If WIFSTOPPED is nonzero, this returns signal number

- The wait() is used when a result of process done by child is used by the parent for further processing.
- For eg :-
In a program child process write to file1 and parent has to read from (the written data of)file1.
If the scheduler runs read() command of the parent process before the write() command of child process, it reads nothing.
- So, wait() is used before read() statement in parent process to avoid the unnecessory error.

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , | Leave a comment

Process Duplication using fork

Process Duplication using system call fork
==============================
- A new process is created using fork().
- fork() is a system call.
- fork duplicates the current process.
- It creates a new entry in the process table with many of same

attributes as current process.
- The new process (known as child process) is almost identical to

original process (known as parent process).
- PPID (Parent Process Identification) of new process is PID of

original process.
- PID (Process Identification) of new process is lowest PID

available after the PID of original process .Mostly it is 1 greater

than the original process(If available).
- Prototype of fork :-
pid_t fork(void);
- Function fork() is declared in header:
#include<unistd.h>
- It has a return type pid_t .
- System type pid_t is declared in header :
#include<sys/types.h>
- The Process counter of new process starts from fork() statement.
- So, fork() is executed twice.
- When fork() is executed by parent, it returns PID of child

process on success.
- When fork() is executed by child, it returns 0 for success.
- If fork fails, it returns -1.
- Falure may be due to :-
* Limit on the number of child processes that a parent may

have (CHILD_MAX), in which errno will be set to “EAGAIN”

* If process table or virtual memory is filled (not enough

space), errno variable will be set to “ENOMEM”.
- The return value of fork() can be used to determine whether child

or parent is executing.
- For eg. :-
#include<stdio.h>
#include<unistd.h>
#include<sys/types.h>
int main()
{
pid_t fret;
printf(“Only parent execute\n”);
fret = fork();//Fork statement
printf(“Both parent and child execute this statement.\n”);
switch(fork)
{
case -1 :
perror(“fork”);
exit(EXIT_FAILURE);
break;
case 0 :
printf(“Child executing\n”);
break;
default :
printf(“Parent executing\n”);
break;
}
return 0;
}

Posted in Linux Internals and System Programming, Project 03: Client Server Communication using Linux and IPC | Tagged , , , , | Leave a comment

Multiple Data Compressions And Encription Using Iterative Technique

Logfile of compleated Project

—————————————————

—————————————————
RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It includes basic headers which are used in project.
It includes stdio.h, fcntl.h, unistd.h, string.h, stdlib.h
—————————-
revision 1.1    locked by: root;
date: 2016/01/03 12:49:49;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: prototypes.h,v
Working file: prototypes.h
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10;    selected revisions: 10
description:
It contains the prototypes of functions which are defined and used in project.
It include prototype of openfile(), creatmasterarray(), findcodelength(), writema() functions.
—————————-
revision 1.10    locked by: root;
date: 2016/01/03 20:47:30;  author: root;  state: Exp;  lines: +0 -1
The prototype of findchar() is moved to compression.h
—————————-
revision 1.9
date: 2016/01/03 18:55:55;  author: root;  state: Exp;  lines: +0 -7
The prototypes of functions which are used oly in compression are removed.
They are added in a seperate file compression.h
—————————-
revision 1.8
date: 2016/01/03 17:35:16;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/03 15:59:03;  author: root;  state: Exp;  lines: +1 -1
Name of function changes from index to findindex()
—————————-
revision 1.6
date: 2016/01/03 15:57:23;  author: root;  state: Exp;  lines: +2 -0
The prototype of findindex() is added.
—————————-
revision 1.5
date: 2016/01/03 14:52:44;  author: root;  state: Exp;  lines: +2 -2
the Prototype of compression() and compress4() is changed.
The return type changes from char to unsigned char.
—————————-
revision 1.4
date: 2016/01/03 14:11:16;  author: root;  state: Exp;  lines: +7 -7
Prototype of compression() and compress4() has been changed.
There 1st argument changes from char * to int .
—————————-
revision 1.3
date: 2016/01/03 14:00:58;  author: root;  state: Exp;  lines: +7 -0
Prototype of compresss4() has been included.
—————————-
revision 1.2
date: 2016/01/03 13:39:18;  author: root;  state: Exp;  lines: +1 -0
The prototype of function compression has been included.
—————————-
revision 1.1
date: 2016/01/03 12:51:08;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress2.c,v
Working file: compress2.c
head: 1.7
branch:
locks: strict
root: 1.7
access list:
symbolic names:
keyword substitution: kv
total revisions: 7;    selected revisions: 7
description:
compress2() function is created.
1 byte has 4 characters.
4 characters are read in one loop.
Loop breaking statement is added.
—————————-
revision 1.7    locked by: root;
date: 2016/01/04 08:27:15;  author: root;  state: Exp;  lines: +1 -1
loop is running from 0 to 3 instead of 1 to 4.
—————————-
revision 1.6
date: 2016/01/04 08:20:22;  author: root;  state: Exp;  lines: +3 -2
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/04 08:16:10;  author: root;  state: Exp;  lines: +2 -2
Change in finding byte
—————————-
revision 1.4
date: 2016/01/04 08:05:17;  author: root;  state: Exp;  lines: +1 -0
Print statement for writing byte is added.
—————————-
revision 1.3
date: 2016/01/04 08:03:18;  author: root;  state: Exp;  lines: +1 -1
2nd argument of write instruction is corrected.
—————————-
revision 1.2
date: 2016/01/04 08:02:43;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.1
date: 2016/01/04 07:59:09;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress3.c,v
Working file: compress3.c
head: 1.18
branch:
locks: strict
root: 1.18
access list:
symbolic names:
keyword substitution: kv
total revisions: 18;    selected revisions: 18
description:
compress3() function is defined here.
It writes 8 characters in 3 bytes.
—————————-
revision 1.18    locked by: root;
date: 2016/01/04 07:26:53;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.17
date: 2016/01/04 07:25:15;  author: root;  state: Exp;  lines: +3 -3
compilation errors removed.
—————————-
revision 1.16
date: 2016/01/04 07:24:08;  author: root;  state: Exp;  lines: +7 -8
Few useless statements were removed.
—————————-
revision 1.15
date: 2016/01/04 07:04:27;  author: root;  state: Exp;  lines: +1 -1
Problem of a character is solved.
—————————-
revision 1.14
date: 2016/01/04 07:00:38;  author: root;  state: Exp;  lines: +3 -3
Finding problem in byte 2
—————————-
revision 1.13
date: 2016/01/04 06:54:02;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/04 06:47:36;  author: root;  state: Exp;  lines: +3 -1
Condition for EOF is correcting.
—————————-
revision 1.11
date: 2016/01/04 06:08:48;  author: root;  state: Exp;  lines: +3 -3
Eof
—————————-
revision 1.10
date: 2016/01/04 05:54:52;  author: root;  state: Exp;  lines: +3 -3
The EOF is changed.
—————————-
revision 1.9
date: 2016/01/04 05:52:12;  author: root;  state: Exp;  lines: +3 -3
Solving problem in 3rd byte.
—————————-
revision 1.8
date: 2016/01/04 05:50:02;  author: root;  state: Exp;  lines: +3 -1
Finding problem in compress3()
—————————-
revision 1.7
date: 2016/01/04 05:02:45;  author: root;  state: Exp;  lines: +1 -1
No. of characters written is callculated.
—————————-
revision 1.6
date: 2016/01/04 04:56:27;  author: root;  state: Exp;  lines: +1 -1
Break condition changed.
—————————-
revision 1.5
date: 2016/01/04 04:53:28;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/04 04:52:19;  author: root;  state: Exp;  lines: +1 -1
The print statement is changed.
—————————-
revision 1.3
date: 2016/01/04 04:40:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/01/04 04:37:37;  author: root;  state: Exp;  lines: +5 -7
compilation error removed.
No. of characters written at a time corrected.
—————————-
revision 1.1
date: 2016/01/04 04:32:23;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress4.c,v
Working file: compress4.c
head: 1.45
branch:
locks: strict
root: 1.45
access list:
symbolic names:
keyword substitution: kv
total revisions: 45;    selected revisions: 45
description:
Only Prototype of compress4() is written
And file name is printed.
—————————-
revision 1.45    locked by: root;
date: 2016/01/03 21:09:17;  author: root;  state: Exp;  lines: +3 -2
It changes return type from char * to int
—————————-
revision 1.44
date: 2016/01/03 20:54:52;  author: root;  state: Exp;  lines: +3 -5
Useless variable is removed.
—————————-
revision 1.43
date: 2016/01/03 20:48:37;  author: root;  state: Exp;  lines: +4 -4
The data type of index is changed.
—————————-
revision 1.42
date: 2016/01/03 20:40:30;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.41
date: 2016/01/03 20:39:53;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.40
date: 2016/01/03 20:38:12;  author: root;  state: Exp;  lines: +3 -2
Problem of EOF is solved.
—————————-
revision 1.39
date: 2016/01/03 20:36:04;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.38
date: 2016/01/03 20:17:44;  author: root;  state: Exp;  lines: +4 -0
Condition for writing End Of File Character.
—————————-
revision 1.37
date: 2016/01/03 18:51:56;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.36
date: 2016/01/03 17:43:49;  author: root;  state: Exp;  lines: +1 -1
compilation error
—————————-
revision 1.35
date: 2016/01/03 17:41:03;  author: root;  state: Exp;  lines: +2 -2
Compressed array is written to compressed file.
—————————-
revision 1.34
date: 2016/01/03 17:37:35;  author: root;  state: Exp;  lines: +1 -1
Print statement removed.
—————————-
revision 1.33
date: 2016/01/03 17:02:42;  author: root;  state: Exp;  lines: +1 -1
One more argument for writing file descriptor is added.
It is of type int.
—————————-
revision 1.32
date: 2016/01/03 16:56:23;  author: root;  state: Exp;  lines: +2 -2
Print statements chanded.
—————————-
revision 1.31
date: 2016/01/03 16:55:26;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
—————————-
revision 1.30
date: 2016/01/03 16:52:37;  author: root;  state: Exp;  lines: +0 -2
*** empty log message ***
—————————-
revision 1.29
date: 2016/01/03 16:49:42;  author: root;  state: Exp;  lines: +1 -1
hexa code of compressed charater is printed.
—————————-
revision 1.28
date: 2016/01/03 16:47:12;  author: root;  state: Exp;  lines: +4 -3
ANDing is used in place of ORing
—————————-
revision 1.27
date: 2016/01/03 16:43:28;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.26
date: 2016/01/03 16:40:19;  author: root;  state: Exp;  lines: +1 -1
print statement removed.
—————————-
revision 1.25
date: 2016/01/03 16:37:45;  author: root;  state: Exp;  lines: +1 -1
unsigned char is used instead of char
—————————-
revision 1.24
date: 2016/01/03 16:36:26;  author: root;  state: Exp;  lines: +5 -5
Typecasting is used instead of sprints.
—————————-
revision 1.23
date: 2016/01/03 16:19:41;  author: root;  state: Exp;  lines: +1 -1
Printing statement change
—————————-
revision 1.22
date: 2016/01/03 16:18:17;  author: root;  state: Exp;  lines: +1 -1
argument of sprintf() is corrected.
—————————-
revision 1.21
date: 2016/01/03 16:17:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2016/01/03 16:16:27;  author: root;  state: Exp;  lines: +2 -2
character array is used as argument for sprintf instead of char.
—————————-
revision 1.19
date: 2016/01/03 16:13:24;  author: root;  state: Exp;  lines: +1 -1
argument of sprintf() is corrected.
—————————-
revision 1.18
date: 2016/01/03 16:12:35;  author: root;  state: Exp;  lines: +2 -2
sprintf() is used instead of typecasting.
—————————-
revision 1.17
date: 2016/01/03 16:10:56;  author: root;  state: Exp;  lines: +5 -3
typecasting
—————————-
revision 1.16
date: 2016/01/03 16:07:46;  author: root;  state: Exp;  lines: +1 -1
typecasting is done.
—————————-
revision 1.15
date: 2016/01/03 16:06:16;  author: root;  state: Exp;  lines: +3 -2
index are printed.
—————————-
revision 1.14
date: 2016/01/03 15:59:51;  author: root;  state: Exp;  lines: +1 -1
Compilation error resolved.
—————————-
revision 1.13
date: 2016/01/03 15:55:02;  author: root;  state: Exp;  lines: +7 -4
Index of character is used instead of character to be written in file.
findindex() function is used for finding index of a character.
—————————-
revision 1.12
date: 2016/01/03 15:39:08;  author: root;  state: Exp;  lines: +2 -1
Testing the result
—————————-
revision 1.11
date: 2016/01/03 15:34:30;  author: root;  state: Exp;  lines: +1 -1
test statement removed.
—————————-
revision 1.10
date: 2016/01/03 15:33:47;  author: root;  state: Exp;  lines: +6 -5
The compressed characters are printed.
—————————-
revision 1.9
date: 2016/01/03 15:28:09;  author: root;  state: Exp;  lines: +1 -1
compilation error resolved.
—————————-
revision 1.8
date: 2016/01/03 15:24:23;  author: root;  state: Exp;  lines: +5 -2
lseek is used to change the ointer from end to starting.
—————————-
revision 1.7
date: 2016/01/03 15:21:52;  author: root;  state: Exp;  lines: +3 -0
Finding the problem
—————————-
revision 1.6
date: 2016/01/03 15:17:54;  author: root;  state: Exp;  lines: +1 -0
Read character is printed.
—————————-
revision 1.5
date: 2016/01/03 14:59:05;  author: root;  state: Exp;  lines: +2 -2
Compilation Errors.
—————————-
revision 1.4
date: 2016/01/03 14:55:14;  author: root;  state: Exp;  lines: +2 -2
Compilation error due to ; has been resolved.
—————————-
revision 1.3
date: 2016/01/03 14:50:11;  author: root;  state: Exp;  lines: +60 -2
Compression is done using bitshift operators -left shift and right shift.
2 characters are ORing into 1 and written to compressed array.
—————————-
revision 1.2
date: 2016/01/03 14:08:20;  author: root;  state: Exp;  lines: +3 -1
1st argument of compress4() has been change from char * to int type.
Now it will accept the fd of opened file i.i textfile.
—————————-
revision 1.1
date: 2016/01/03 14:00:13;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress5.c,v
Working file: compress5.c
head: 1.20
branch:
locks: strict
root: 1.20
access list:
symbolic names:
keyword substitution: kv
total revisions: 20;    selected revisions: 20
description:
compress5() dunction is defined.
—————————-
revision 1.20    locked by: root;
date: 2016/01/04 00:09:36;  author: root;  state: Exp;  lines: +1 -1
Printing changes
—————————-
revision 1.19
date: 2016/01/04 00:08:26;  author: root;  state: Exp;  lines: +7 -5
test is removed.
—————————-
revision 1.18
date: 2016/01/04 00:06:28;  author: root;  state: Exp;  lines: +1 -1
Unneccesort print statement removed.
—————————-
revision 1.17
date: 2016/01/04 00:04:31;  author: root;  state: Exp;  lines: +1 -2
No. of written character sis counted.
—————————-
revision 1.16
date: 2016/01/04 00:00:02;  author: root;  state: Exp;  lines: +31 -11
All the characters are written in file.
The ch=255 is written as EOF character.
—————————-
revision 1.15
date: 2016/01/03 23:47:52;  author: root;  state: Exp;  lines: +3 -3
ce
—————————-
revision 1.14
date: 2016/01/03 23:45:12;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.13
date: 2016/01/03 23:42:38;  author: root;  state: Exp;  lines: +35 -2
5 bytes are written for 8 characters.
1 byte is written for 1 character.
—————————-
revision 1.12
date: 2016/01/03 22:54:23;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/03 22:53:10;  author: root;  state: Exp;  lines: +3 -0
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/03 22:51:42;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/03 22:50:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/01/03 22:48:58;  author: root;  state: Exp;  lines: +2 -0
break statement added.
—————————-
revision 1.7
date: 2016/01/03 22:47:34;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/03 22:45:51;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/03 22:45:01;  author: root;  state: Exp;  lines: +1 -1
compilation error resolved.
—————————-
revision 1.4
date: 2016/01/03 22:43:56;  author: root;  state: Exp;  lines: +1 -0
Read character is printed.
—————————-
revision 1.3
date: 2016/01/03 22:42:57;  author: root;  state: Exp;  lines: +65 -66
Formatting of program is done
—————————-
revision 1.2
date: 2016/01/03 22:38:18;  author: root;  state: Exp;  lines: +45 -56
characters of textfile are read 1 by 1
—————————-
revision 1.1
date: 2016/01/03 22:18:57;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress6.c,v
Working file: compress6.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;    selected revisions: 6
description:
compress6() is defined here.
3 bytes contain 4 characters.
—————————-
revision 1.6    locked by: root;
date: 2016/01/04 09:56:51;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/04 09:52:59;  author: root;  state: Exp;  lines: +1 -1
Print statements modified.
—————————-
revision 1.4
date: 2016/01/04 09:51:46;  author: root;  state: Exp;  lines: +2 -2
Change in print statements.
—————————-
revision 1.3
date: 2016/01/04 09:47:19;  author: root;  state: Exp;  lines: +1 -1
No. of times characters read at a time dec.
for this no. of times loop run dec.
—————————-
revision 1.2
date: 2016/01/04 09:44:50;  author: root;  state: Exp;  lines: +1 -1
ce in printf resolved.
—————————-
revision 1.1
date: 2016/01/04 09:43:08;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress7.c,v
Working file: compress7.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
compress7() is defined.
7bytes written for 8 characcters read.
—————————-
revision 1.3    locked by: root;
date: 2016/01/06 07:42:20;  author: root;  state: Exp;  lines: +1 -1
Terminating condition changed.
—————————-
revision 1.2
date: 2016/01/06 06:36:23;  author: root;  state: Exp;  lines: +28 -11
Bytes written are printed
Error conditions are added.
Comments are added of the process of Program.
—————————-
revision 1.1
date: 2016/01/06 06:22:08;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compress.c,v
Working file: compress.c
head: 1.13
branch:
locks: strict
root: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13;    selected revisions: 13
description:
Writing a common function which can replace all the compress2() to compress7() using single function.
—————————-
revision 1.13    locked by: root;
date: 2016/01/06 13:46:41;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/06 13:41:46;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/06 13:30:15;  author: root;  state: Exp;  lines: +4 -4
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/06 13:24:41;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/06 13:24:16;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.8
date: 2016/01/06 13:22:18;  author: root;  state: Exp;  lines: +3 -1
Breaking condition added.
—————————-
revision 1.7
date: 2016/01/06 13:20:18;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/06 13:18:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/06 13:17:59;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/06 13:14:55;  author: root;  state: Exp;  lines: +6 -4
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/06 13:05:55;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.2
date: 2016/01/06 13:05:29;  author: root;  state: Exp;  lines: +5 -4
ce
—————————-
revision 1.1
date: 2016/01/06 13:01:17;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: compression.c,v
Working file: compression.c
head: 1.18
branch:
locks: strict
root: 1.18
access list:
symbolic names:
keyword substitution: kv
total revisions: 18;    selected revisions: 18
description:
Defination of compression() has been started.
Only Prototype is written.
—————————-
revision 1.18    locked by: root;
date: 2016/01/06 13:02:05;  author: root;  state: Exp;  lines: +5 -4
compress() is called in place of compress2() and compress4().
—————————-
revision 1.17
date: 2016/01/06 06:22:40;  author: root;  state: Exp;  lines: +1 -1
compress7() is called.
—————————-
revision 1.16
date: 2016/01/04 09:43:37;  author: root;  state: Exp;  lines: +1 -1
compress6() is included.
—————————-
revision 1.15
date: 2016/01/04 08:00:43;  author: root;  state: Exp;  lines: +7 -10
compress2() is called.
—————————-
revision 1.14
date: 2016/01/04 04:34:13;  author: root;  state: Exp;  lines: +1 -1
compress3() is called.
—————————-
revision 1.13
date: 2016/01/03 22:19:12;  author: root;  state: Exp;  lines: +1 -1
compress5() function is called for code length 5.
—————————-
revision 1.12
date: 2016/01/03 22:10:52;  author: root;  state: Exp;  lines: +1 -1
A variable is initialized by 1
—————————-
revision 1.11
date: 2016/01/03 21:09:57;  author: root;  state: Exp;  lines: +2 -2
It returns no. of integers written in compressed file.
—————————-
revision 1.10
date: 2016/01/03 18:52:09;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/03 17:42:11;  author: root;  state: Exp;  lines: +2 -1
fd and wfd are closed.
—————————-
revision 1.8
date: 2016/01/03 17:03:20;  author: root;  state: Exp;  lines: +2 -2
One more argument of type int is added.
It is wfd in which write file descriptor in which compressed file has to be written.
—————————-
revision 1.7
date: 2016/01/03 14:51:23;  author: root;  state: Exp;  lines: +2 -2
return type changes from char to extern unsigned char.
—————————-
revision 1.6
date: 2016/01/03 14:09:27;  author: root;  state: Exp;  lines: +7 -7
1st argument of compress4() has been change from char * to int type.
>> Now it will accept the fd of opened file i.i textfile.
—————————-
revision 1.5
date: 2016/01/03 14:03:13;  author: root;  state: Exp;  lines: +1 -1
The arguments of function call compress4() has been corrected.
—————————-
revision 1.4
date: 2016/01/03 14:00:45;  author: root;  state: Exp;  lines: +6 -1
compress4() has been called.
—————————-
revision 1.3
date: 2016/01/03 13:52:20;  author: root;  state: Exp;  lines: +5 -5
print statement has been added in corresponding cases of different code lenght just to chech the proper functioning.
—————————-
revision 1.2
date: 2016/01/03 13:49:28;  author: root;  state: Exp;  lines: +46 -2
codelenght is find out usinf findcodelength() function.
Then the corresponding copress function will be called like compress2(), compress4() etc. using switch statement.
It returns 0 on failure.
—————————-
revision 1.1
date: 2016/01/03 13:36:50;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: creatma.c,v
Working file: creatma.c
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10;    selected revisions: 10
description:
it defines the function creatmasterarray()
It has only one argument int fd which is file descriptor of open file which is to be compressed.
—————————-
revision 1.10    locked by: root;
date: 2016/01/04 08:10:54;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/04 08:08:10;  author: root;  state: Exp;  lines: +2 -1
Textfile buffer is printed.
—————————-
revision 1.8
date: 2016/01/03 21:16:12;  author: root;  state: Exp;  lines: +1 -1
free() is used to free the memory allocated to buffer.
—————————-
revision 1.7
date: 2016/01/03 18:37:45;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/03 18:36:49;  author: root;  state: Exp;  lines: +1 -1
Master array is created.
—————————-
revision 1.5
date: 2016/01/03 18:35:00;  author: root;  state: Exp;  lines: +1 -1
print statements added.
—————————-
revision 1.4
date: 2016/01/03 13:37:46;  author: root;  state: Exp;  lines: +0 -2
The file descriptor of opensed file (textfile) is not closed .
i.e close() statement is removed.
As it will be used by the compression function.
—————————-
revision 1.3
date: 2016/01/03 13:17:31;  author: root;  state: Exp;  lines: +20 -0
Error conditions for malloc and realloc are added.
exit() function is used for sending failure condition instead of using return 0.
—————————-
revision 1.2
date: 2016/01/03 13:08:27;  author: root;  state: Exp;  lines: +24 -4
It includes function creatmasterarray().
It has prototype extern char * creatmasterarray(int)
It has only one argument which is the file descriptor of file which is already opened in read only mode.
It returns pointer to master array on success.
It returns 0 on failure.
—————————-
revision 1.1
date: 2016/01/03 12:19:48;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress2.c,v
Working file: decompress2.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5;    selected revisions: 5
description:
decompress2() is defined
1 byteread has 4 characters in it.
—————————-
revision 1.5    locked by: root;
date: 2016/01/04 09:04:47;  author: root;  state: Exp;  lines: +1 -0
Characters are printed.
—————————-
revision 1.4
date: 2016/01/04 09:02:43;  author: root;  state: Exp;  lines: +1 -0
i is declared.
—————————-
revision 1.3
date: 2016/01/04 09:02:03;  author: root;  state: Exp;  lines: +2 -2
compilation error resolving.
—————————-
revision 1.2
date: 2016/01/04 09:00:17;  author: root;  state: Exp;  lines: +15 -30
EOF character is finded.
Breaking condition is applied.
—————————-
revision 1.1
date: 2016/01/04 08:35:57;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress3.c,v
Working file: decompress3.c
head: 1.13
branch:
locks: strict
root: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13;    selected revisions: 13
description:
decompress3() function is defined here.
It writes 8 characters from 3 bytes read.
—————————-
revision 1.13    locked by: root;
date: 2016/01/04 07:13:55;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/04 07:12:46;  author: root;  state: Exp;  lines: +1 -1
EOF character is written to decompressed file
—————————-
revision 1.11
date: 2016/01/04 07:12:11;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/04 06:41:28;  author: root;  state: Exp;  lines: +2 -2
5th and 6th characters are corrrected.
—————————-
revision 1.9
date: 2016/01/04 06:31:15;  author: root;  state: Exp;  lines: +1 -1
Prnting the index.
—————————-
revision 1.8
date: 2016/01/04 06:29:05;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/04 06:28:15;  author: root;  state: Exp;  lines: +1 -0
Problem inbyte 2 is resolving.
—————————-
revision 1.6
date: 2016/01/04 06:20:35;  author: root;  state: Exp;  lines: +3 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/04 06:10:56;  author: root;  state: Exp;  lines: +1 -1
Passing argument to findindex() is changed.
—————————-
revision 1.4
date: 2016/01/04 05:34:42;  author: root;  state: Exp;  lines: +3 -1
Terminating condition is changed.
—————————-
revision 1.3
date: 2016/01/04 05:31:18;  author: root;  state: Exp;  lines: +20 -24
*** empty log message ***
—————————-
revision 1.2
date: 2016/01/04 05:28:28;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/01/04 05:26:06;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress4.c,v
Working file: decompress4.c
head: 1.25
branch:
locks: strict
root: 1.25
access list:
symbolic names:
keyword substitution: kv
total revisions: 25;    selected revisions: 25
description:
Character corresponding to index is findout using findchar().
One byte has 2 characters.
—————————-
revision 1.25    locked by: root;
date: 2016/01/04 08:40:40;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.24
date: 2016/01/04 08:36:26;  author: root;  state: Exp;  lines: +7 -5
*** empty log message ***
—————————-
revision 1.23
date: 2016/01/04 01:38:09;  author: root;  state: Exp;  lines: +2 -2
argument of findchar() changed
—————————-
revision 1.22
date: 2016/01/04 01:31:40;  author: root;  state: Exp;  lines: +2 -2
One more argument is added to findchar() which is type of decompression i.e.5
—————————-
revision 1.21
date: 2016/01/03 21:21:16;  author: root;  state: Exp;  lines: +3 -2
Print staements removed(which are unnneccesary).
—————————-
revision 1.20
date: 2016/01/03 21:19:02;  author: root;  state: Exp;  lines: +4 -3
Print statements are removed.
The decompressed characters are printed.
—————————-
revision 1.19
date: 2016/01/03 21:02:00;  author: root;  state: Exp;  lines: +1 -1
Last digit problem is resolved.
—————————-
revision 1.18
date: 2016/01/03 20:14:12;  author: root;  state: Exp;  lines: +2 -1
The problem of last byte is to be solved.
—————————-
revision 1.17
date: 2016/01/03 20:10:38;  author: root;  state: Exp;  lines: +1 -1
finding Problem.
—————————-
revision 1.16
date: 2016/01/03 20:01:47;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.15
date: 2016/01/03 20:00:55;  author: root;  state: Exp;  lines: +1 -0
Detecting Problem.
—————————-
revision 1.14
date: 2016/01/03 19:59:45;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.13
date: 2016/01/03 19:58:48;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/03 19:57:06;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/03 19:55:55;  author: root;  state: Exp;  lines: +2 -1
Detecting error.
—————————-
revision 1.10
date: 2016/01/03 19:53:04;  author: root;  state: Exp;  lines: +8 -2
Error check statements added.
—————————-
revision 1.9
date: 2016/01/03 19:50:56;  author: root;  state: Exp;  lines: +4 -0
break condition added.
—————————-
revision 1.8
date: 2016/01/03 19:49:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/03 19:43:00;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/03 19:40:45;  author: root;  state: Exp;  lines: +2 -0
Print statements added for troubleshooting.
—————————-
revision 1.5
date: 2016/01/03 19:37:27;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/03 19:36:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/03 19:35:30;  author: root;  state: Exp;  lines: +1 -1
defination of index  is removed.
—————————-
revision 1.2
date: 2016/01/03 19:33:44;  author: root;  state: Exp;  lines: +3 -3
Compilation error resolved.
—————————-
revision 1.1
date: 2016/01/03 19:30:37;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress5.c,v
Working file: decompress5.c
head: 1.27
branch:
locks: strict
root: 1.27
access list:
symbolic names:
keyword substitution: kv
total revisions: 27;    selected revisions: 27
description:
decompress5() function is written.
% bytes are read at ones.
5 bytes are read at ones and it breaks at ch=255.
5 bytes means 8 characters.
—————————-
revision 1.27    locked by: root;
date: 2016/01/04 09:11:50;  author: root;  state: Exp;  lines: +3 -2
Print statement modified.
EOF is corrected.
—————————-
revision 1.26
date: 2016/01/04 09:10:03;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.25
date: 2016/01/04 07:13:56;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2016/01/04 07:13:08;  author: root;  state: Exp;  lines: +1 -1
EOF character is written to decompressed file.
—————————-
revision 1.23
date: 2016/01/04 07:12:14;  author: root;  state: Exp;  lines: +8 -10
*** empty log message ***
—————————-
revision 1.22
date: 2016/01/04 05:31:21;  author: root;  state: Exp;  lines: +25 -21
*** empty log message ***
—————————-
revision 1.21
date: 2016/01/04 05:26:55;  author: root;  state: Exp;  lines: +21 -25
*** empty log message ***
—————————-
revision 1.20
date: 2016/01/04 02:17:12;  author: root;  state: Exp;  lines: +1 -1
Breaking condition changed.
—————————-
revision 1.19
date: 2016/01/04 02:16:12;  author: root;  state: Exp;  lines: +1 -2
ce
—————————-
revision 1.18
date: 2016/01/04 02:14:58;  author: root;  state: Exp;  lines: +3 -47
Unneccesory code is deleted.
—————————-
revision 1.17
date: 2016/01/04 02:10:06;  author: root;  state: Exp;  lines: +11 -7
*** empty log message ***
—————————-
revision 1.16
date: 2016/01/04 02:04:53;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.15
date: 2016/01/04 02:02:00;  author: root;  state: Exp;  lines: +3 -1
EOF problem resolving.
—————————-
revision 1.14
date: 2016/01/04 01:55:46;  author: root;  state: Exp;  lines: +1 -4
*** empty log message ***
—————————-
revision 1.13
date: 2016/01/04 01:55:09;  author: root;  state: Exp;  lines: +9 -2
Eof condition checked.
—————————-
revision 1.12
date: 2016/01/04 01:50:09;  author: root;  state: Exp;  lines: +9 -6
a variable is added.
—————————-
revision 1.11
date: 2016/01/04 01:38:33;  author: root;  state: Exp;  lines: +1 -1
argument of findchar() changed
—————————-
revision 1.10
date: 2016/01/04 01:32:16;  author: root;  state: Exp;  lines: +1 -1
ne more argument is added to findchar() which is type of decompression i
—————————-
revision 1.9
date: 2016/01/04 01:23:13;  author: root;  state: Exp;  lines: +0 -5
*** empty log message ***
—————————-
revision 1.8
date: 2016/01/04 01:22:01;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/04 01:20:46;  author: root;  state: Exp;  lines: +5 -0
Eof condition testing.
—————————-
revision 1.6
date: 2016/01/04 01:17:13;  author: root;  state: Exp;  lines: +7 -7
ce
—————————-
revision 1.5
date: 2016/01/04 01:15:45;  author: root;  state: Exp;  lines: +17 -0
Condition for EOF is finding.
—————————-
revision 1.4
date: 2016/01/04 01:06:21;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.3
date: 2016/01/04 01:05:37;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
—————————-
revision 1.2
date: 2016/01/04 01:02:42;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.1
date: 2016/01/04 00:59:24;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress6.c,v
Working file: decompress6.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;    selected revisions: 6
description:
decompress6() is defined .
It writes 4 characters for 3 bytes read.
EOF condition is also checked.
—————————-
revision 1.6    locked by: root;
date: 2016/01/04 10:31:58;  author: root;  state: Exp;  lines: +2 -1
Print statement changed.
—————————-
revision 1.5
date: 2016/01/04 10:30:46;  author: root;  state: Exp;  lines: +1 -1
The no. of characters read at once changed from 5 to 3.
—————————-
revision 1.4
date: 2016/01/04 10:23:59;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/04 10:23:08;  author: root;  state: Exp;  lines: +1 -1
Finding problem in decompression..
—————————-
revision 1.2
date: 2016/01/04 10:14:50;  author: root;  state: Exp;  lines: +1 -1
name of function is corrected.
—————————-
revision 1.1
date: 2016/01/04 10:13:10;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompress7.c,v
Working file: decompress7.c
head: 1.14
branch:
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
decompress7() is defined.
—————————-
revision 1.14    locked by: root;
date: 2016/01/06 08:22:34;  author: root;  state: Exp;  lines: +6 -0
Correcting problem of last character in 7th byte.
—————————-
revision 1.13
date: 2016/01/06 08:14:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/06 08:08:02;  author: root;  state: Exp;  lines: +4 -0
Initializing index with 0.
—————————-
revision 1.11
date: 2016/01/06 08:00:01;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/06 07:58:16;  author: root;  state: Exp;  lines: +1 -1
There are 8 index at a time than 7
—————————-
revision 1.9
date: 2016/01/06 07:49:16;  author: root;  state: Exp;  lines: +4 -1
EOF condition finding.
—————————-
revision 1.8
date: 2016/01/06 07:44:08;  author: root;  state: Exp;  lines: +1 -1
Print statement for printing index is removed.
—————————-
revision 1.7
date: 2016/01/06 07:43:15;  author: root;  state: Exp;  lines: +1 -1
Reading one byte at ones.
The read character is assigned to bytes[i]
—————————-
revision 1.6
date: 2016/01/06 07:42:51;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/06 07:08:35;  author: root;  state: Exp;  lines: +1 -1
Printing the index and character.
—————————-
revision 1.4
date: 2016/01/06 07:06:09;  author: root;  state: Exp;  lines: +6 -7
Testing break of loop.
—————————-
revision 1.3
date: 2016/01/06 07:00:34;  author: root;  state: Exp;  lines: +2 -2
compilation error resolved.
—————————-
revision 1.2
date: 2016/01/06 06:57:07;  author: root;  state: Exp;  lines: +22 -34
8 characters are written for 7 bytes read.
Terminating condition is written.
EOF character is written.
—————————-
revision 1.1
date: 2016/01/06 06:41:01;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: decompression.c,v
Working file: decompression.c
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12;    selected revisions: 12
description:
It finds codelength using findcodelength() function.
switch case is used for various decompress functions of diferrent code lengths.
—————————-
revision 1.12    locked by: root;
date: 2016/01/06 06:41:12;  author: root;  state: Exp;  lines: +27 -2
decompress7() is called
return value of decompress2() ,decompress3() ,decompress4(),decompress5(),decompress6() and decompress7() are checked.
They show error when the return value less than 0.
—————————-
revision 1.11
date: 2016/01/04 10:18:31;  author: root;  state: Exp;  lines: +1 -2
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/04 10:17:26;  author: root;  state: Exp;  lines: +1 -1
Prototype of function call decompress6() is corrected.
—————————-
revision 1.9
date: 2016/01/04 10:16:04;  author: root;  state: Exp;  lines: +1 -1
decompress6() is called for code length =6.
—————————-
revision 1.8
date: 2016/01/04 08:36:30;  author: root;  state: Exp;  lines: +3 -3
decompress2() has been called.
—————————-
revision 1.7
date: 2016/01/04 05:27:04;  author: root;  state: Exp;  lines: +2 -2
decompress3() is called.
—————————-
revision 1.6
date: 2016/01/04 01:00:28;  author: root;  state: Exp;  lines: +1 -1
decompress5() is called.
—————————-
revision 1.5
date: 2016/01/03 21:23:35;  author: root;  state: Exp;  lines: +1 -1
Unnecessory Print statements removed.
—————————-
revision 1.4
date: 2016/01/03 19:31:21;  author: root;  state: Exp;  lines: +7 -1
decompress4() is called.
—————————-
revision 1.3
date: 2016/01/03 19:04:00;  author: root;  state: Exp;  lines: +2 -2
conflicting data types.
—————————-
revision 1.2
date: 2016/01/03 18:59:42;  author: root;  state: Exp;  lines: +1 -1
ce
—————————-
revision 1.1
date: 2016/01/03 18:52:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: findchar.c,v
Working file: findchar.c
head: 1.13
branch:
locks: strict
root: 1.13
access list:
symbolic names:
keyword substitution: kv
total revisions: 13;    selected revisions: 13
description:
findchar() is defined.
It will return the character corresponding to index in master array.
—————————-
revision 1.13    locked by: root;
date: 2016/01/04 09:00:43;  author: root;  state: Exp;  lines: +3 -1
condition for code length 2 is added.
—————————-
revision 1.12
date: 2016/01/04 01:36:29;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/04 01:32:49;  author: root;  state: Exp;  lines: +11 -3
Prototype includes one more integer typeargument which is type of argument.
—————————-
revision 1.10
date: 2016/01/03 21:19:31;  author: root;  state: Exp;  lines: +1 -1
The print statement is removed.
—————————-
revision 1.9
date: 2016/01/03 20:08:58;  author: root;  state: Exp;  lines: +2 -2
Detecting errors.
—————————-
revision 1.8
date: 2016/01/03 20:06:43;  author: root;  state: Exp;  lines: +2 -2
Detecting problem
—————————-
revision 1.7
date: 2016/01/03 20:03:55;  author: root;  state: Exp;  lines: +1 -0
Finding Problem
—————————-
revision 1.6
date: 2016/01/03 19:58:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/03 19:49:42;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/03 19:45:09;  author: root;  state: Exp;  lines: +2 -0
atoi is used.
—————————-
revision 1.3
date: 2016/01/03 19:41:01;  author: root;  state: Exp;  lines: +1 -1
Print statements added to find error.
—————————-
revision 1.2
date: 2016/01/03 19:35:42;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/01/03 19:32:01;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: findcl.c,v
Working file: findcl.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
it defines function findcodelength()
It has one argument of char * type.
This argument is for string whose codelenghth is to be found.
Codelength is no. of minimum bits required to represent all the characters in a different way.
it has return type integer which returns the code lenghth on success and returns -1 for failure.
—————————-
revision 1.2    locked by: root;
date: 2016/01/04 04:46:58;  author: root;  state: Exp;  lines: +9 -9
Code length fn. is changed.
Now code length =2^n has codelength n.
—————————-
revision 1.1
date: 2016/01/03 12:22:02;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: findindex.c,v
Working file: findindex.c
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12;    selected revisions: 12
description:
This function is used to find the index of Any character in the master array.
It has 2 arguments
1st is tthe character
2nd argument is pointer to master array.
—————————-
revision 1.12    locked by: root;
date: 2016/01/04 09:55:59;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/04 08:17:00;  author: root;  state: Exp;  lines: +1 -1
Print statement added for resolving compress2() function.
—————————-
revision 1.10
date: 2016/01/04 07:16:54;  author: root;  state: Exp;  lines: +1 -1
print statement removed.
—————————-
revision 1.9
date: 2016/01/04 06:54:06;  author: root;  state: Exp;  lines: +2 -2
Prototype changed from char to unsigned char for 1st argument.
—————————-
revision 1.8
date: 2016/01/04 06:06:51;  author: root;  state: Exp;  lines: +1 -1
data type of index changed.
—————————-
revision 1.7
date: 2016/01/04 00:06:45;  author: root;  state: Exp;  lines: +1 -1
nneccesort print statement removed.
—————————-
revision 1.6
date: 2016/01/03 20:56:08;  author: root;  state: Exp;  lines: +1 -1
function is corrected.
—————————-
revision 1.5
date: 2016/01/03 20:49:43;  author: root;  state: Exp;  lines: +1 -1
Typecasting is used.
—————————-
revision 1.4
date: 2016/01/03 20:46:03;  author: root;  state: Exp;  lines: +6 -4
The return type of findindex() changed from unsigned int to unsigned char.
—————————-
revision 1.3
date: 2016/01/03 16:02:28;  author: root;  state: Exp;  lines: +5 -2
if-else condition is added.
—————————-
revision 1.2
date: 2016/01/03 15:58:47;  author: root;  state: Exp;  lines: +1 -1
name of function changes from index to findindex.
—————————-
revision 1.1
date: 2016/01/03 15:55:52;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: mdc.c,v
Working file: mdc.c
head: 1.14
branch:
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
It is the main file in which all the prossesing takes place.
It has the function main()
It contains all the function calls.
A file “textfile” is open.
Unique/Master array of this file is created by using function creatmasterarray() and return the starting address of the unique array.
Before this a file textfile is open in read-only mode using function openfile()
which return the fd of opened file.
codelength of the master array is find out using function findcodelength().
The unique array is written to a file “keyfile” using function writema().
—————————-
revision 1.14    locked by: root;
date: 2016/01/04 07:15:45;  author: root;  state: Exp;  lines: +3 -1
findcodelength() function removed.
—————————-
revision 1.13
date: 2016/01/03 22:11:18;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/03 21:40:55;  author: root;  state: Exp;  lines: +3 -6
Terminal arguments are given in main() function as argv for name of files to open,read, write.
—————————-
revision 1.11
date: 2016/01/03 21:16:35;  author: root;  state: Exp;  lines: +1 -0
The no. of bytes written to decompressed file is printed.
—————————-
revision 1.10
date: 2016/01/03 21:10:24;  author: root;  state: Exp;  lines: +2 -2
Data type of ca changes from char* to int
In function compression()
It takes no. of integers written to compressedfile.
—————————-
revision 1.9
date: 2016/01/03 18:54:05;  author: root;  state: Exp;  lines: +2 -2
compressioon.h is included.
—————————-
revision 1.8
date: 2016/01/03 17:36:33;  author: root;  state: Exp;  lines: +2 -1
wfd is passes to compression(0
—————————-
revision 1.7
date: 2016/01/03 17:35:13;  author: root;  state: Exp;  lines: +7 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/03 14:51:53;  author: root;  state: Exp;  lines: +1 -1
the data type of compressed array i.e. ca is changed from char to unsigned char.
—————————-
revision 1.5
date: 2016/01/03 14:09:37;  author: root;  state: Exp;  lines: +1 -1
In function call compression() 1st expression changes from “textfile” (name of file to be compressed.) to fd (which is file descriptor of file already opened).
—————————-
revision 1.4
date: 2016/01/03 13:41:41;  author: root;  state: Exp;  lines: +5 -0
Error condition of compression function added.
—————————-
revision 1.3
date: 2016/01/03 13:40:03;  author: root;  state: Exp;  lines: +1 -1
There is a compilation error due to non placing ;
It is put there.
—————————-
revision 1.2
date: 2016/01/03 13:39:02;  author: root;  state: Exp;  lines: +3 -1
The function compression() has been called.
—————————-
revision 1.1
date: 2016/01/03 12:37:58;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: mddc.c,v
Working file: mddc.c
head: 1.14
branch:
locks: strict
root: 1.14
access list:
symbolic names:
keyword substitution: kv
total revisions: 14;    selected revisions: 14
description:
It is The main file for decompression.
It opens the compressedfile and keyfile in Read Only mode
And decompressed file in Write Only Mode.
The unique array is retrieved.
—————————-
revision 1.14    locked by: root;
date: 2016/01/04 05:39:39;  author: root;  state: Exp;  lines: +2 -0
Master array is printed
—————————-
revision 1.13
date: 2016/01/03 21:45:42;  author: root;  state: Exp;  lines: +1 -1
Compilation error resolved.
—————————-
revision 1.12
date: 2016/01/03 21:44:54;  author: root;  state: Exp;  lines: +3 -3
Command line arguments are used for file names.
—————————-
revision 1.11
date: 2016/01/03 21:21:55;  author: root;  state: Exp;  lines: +0 -7
findcodelength() function is removed.
—————————-
revision 1.10
date: 2016/01/03 18:54:23;  author: root;  state: Exp;  lines: +3 -2
decompression.h is included.
Decompression function is called.
—————————-
revision 1.9
date: 2016/01/03 18:40:16;  author: root;  state: Exp;  lines: +1 -1
Compilation errors resolved.
—————————-
revision 1.8
date: 2016/01/03 18:39:32;  author: root;  state: Exp;  lines: +12 -7
Error statements are added (if any arise
)
—————————-
revision 1.7
date: 2016/01/03 18:31:57;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/03 18:30:48;  author: root;  state: Exp;  lines: +6 -0
Print statements added
—————————-
revision 1.5
date: 2016/01/03 18:26:30;  author: root;  state: Exp;  lines: +1 -1
Print statement corrected.
—————————-
revision 1.4
date: 2016/01/03 18:25:40;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/03 18:23:20;  author: root;  state: Exp;  lines: +1 -1
Print statement added.
—————————-
revision 1.2
date: 2016/01/03 18:16:21;  author: root;  state: Exp;  lines: +2 -2
Compilation error corrected.
—————————-
revision 1.1
date: 2016/01/03 18:13:28;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: readfile.c,v
Working file: readfile.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It has function openfile().
Its prototype is extern int openfile(char *)
It opens a file in read only mode and return the file descriptor of opened file.
It returns -1 on failure.
—————————-
revision 1.1    locked by: root;
date: 2016/01/03 12:44:11;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: writema.c,v
Working file: writema.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It defines function writema().
This function has prototype : extern int writema(char *,char *)
It has 2 arguments,1st is address of unique array to be written and other is name of file in which it s to be written.
It open the file in write only mode and write master array to it.
It returns 0 on success and -1 on failure.
—————————-
revision 1.1    locked by: root;
date: 2016/01/03 12:46:33;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Data Structures with C, Project 2: Multiple Data Compression and Encryption | Tagged , , , , , , , , , , | Leave a comment

Types of Interprocess Communications in Linux

Types of Inter-process Communications (IPCs) in Linux :

1. Pipes

2. Named Pipes/FIFO

3. Signals

4. Semaphores

5. Message Queue

6. Shared Memory

 

Posted in Project 03: Client Server Communication using Linux and IPC | Tagged , , | Leave a comment

Project_01:Multiple_Data_compression_and_encryption_Using_Iterative_Technique

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
Header file include stio.h,fcntl.h,string.h
all header file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:31:07;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main1.c,v
Working file: main1.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
it includes read of file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:32:19;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main2.c,v
Working file: main2.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
it includes read text file
count the total character in file
list the distinct character in the file
find the length of distinct character in file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:33:30;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:36:22;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: prototype.c,v
Working file: prototype.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
/
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:37:23;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
Header file include stio.h,fcntl.h,string.h
all header file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:31:07;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main1.c,v
Working file: main1.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
it includes read of file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:32:19;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main2.c,v
Working file: main2.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
it includes read text file
count the total character in file
list the distinct character in the file
find the length of distinct character in file
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:33:30;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:36:22;  author: reena;  state: Exp;
Initial revision
=============================================================================

RCS file: prototype.c,v
Working file: prototype.c
head: 1.1
branch:
locks: strict
reena: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
/
—————————-
revision 1.1    locked by: reena;
date: 2016/01/14 09:37:23;  author: reena;  state: Exp;
Initial revision
=============================================================================

Posted in Data Structures with C | Leave a comment

Selection Sorting in C

#include<stdio.h>
//Program for Selection Sorting
int main()
{
int i,j,a[100],N,temp;

printf(“Enter no.of elements you want to sort:\t”);
scanf(“%d”,&N);//max no. of elements
printf(“Enter %d elements you want to sort:\n”,N);
for(i=0;i<N;i++)
scanf(“%d”,(a+i));
printf(“\nBefore sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
//Sorting Starts
for(i=0;i<N-1;i++)
for(j=i+1;j<N;j++)
if(a[i]>a[j])
{
temp = a[j];
a[j]=a[i];
a[i]=temp;
}
//Sorting Ends
printf(“\nAfter sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
}

Posted in Data Structures with C | Tagged , , , , , | Leave a comment

Bubble Sorting in C

#include<stdio.h>
//Program for Bubble Sorting
int main()
{
int i,j,a[100],N,temp;

printf(“Enter no.of elements you want to sort:\t”);
scanf(“%d”,&N);//Max. no. of elements
printf(“Enter %d elements you want to sort:\n”,N);
for(i=0;i<N;i++)
scanf(“%d”,(a+i));
printf(“\nBefore sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
//Sorting Starts
for(i=0;i<N-1;i++)
for(j=0;j<N-i-1;j++)
if(a[j]>a[j+1])
{
temp = a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
//Sorting Ends
printf(“\nAfter sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
}

Posted in Data Structures with C | Tagged , , , , | Leave a comment

Insertion Sorting

#include<stdio.h>
//Program for Insertion Sorting
int main()
{
int i,j,k,N,a[100],temp;
printf(“Enter no. of elements you want to sort :\t”);
scanf(“%d”,&N);//Max. no. of elements
printf(“Enter %d elements you want to sort :\t”,N);
for(i=0;i<N;i++)
scanf(“%d”,(a+i));
printf(“\nBefore Sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
//Sorting Process Start
for(i=1;i<N;i++)
for(j=0;j<i;j++)
if(a[i]<a[j])
{
temp = a[i];
for(k=i;k>j;k–)
{
a[k]=a[k-1];
}
a[j]=temp;
}

//Sorting Ends
printf(“\nAfter Sorting:\t”);
for(i=0;i<N;i++)
printf(“%d\t”,*(a+i));
return 0;
}

Posted in Data Structures with C | Tagged , , , | Leave a comment

Implementation of Message queue

RCS file: reciever.c,v
Working file: reciever.c
head: 1.24
branch:
locks: strict
root: 1.24
access list:
symbolic names:
keyword substitution: kv
total revisions: 24; selected revisions: 24
description:
this is a reciever end .
it will recieve the data.
which will be send by the reciever.
—————————-
revision 1.24 locked by: root;
date: 2016/01/07 07:54:39; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.23
date: 2016/01/07 07:51:21; author: root; state: Exp; lines: +5 -7
*** empty log message ***
—————————-
revision 1.22
date: 2016/01/07 07:49:03; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.21
date: 2016/01/07 07:47:47; author: root; state: Exp; lines: +5 -12
*** empty log message ***
—————————-
revision 1.20
date: 2016/01/07 07:36:30; author: root; state: Exp; lines: +0 -4
*** empty log message ***
—————————-
revision 1.19
date: 2016/01/07 07:35:34; author: root; state: Exp; lines: +0 -9
*** empty log message ***
—————————-
revision 1.18
date: 2016/01/07 07:32:04; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.17
date: 2016/01/07 07:25:42; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.16
date: 2016/01/07 07:23:45; author: root; state: Exp; lines: +1 -0
include break;.
—————————-
revision 1.15
date: 2016/01/07 07:19:03; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2016/01/07 07:10:33; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.13
date: 2016/01/07 07:05:10; author: root; state: Exp; lines: +16 -5
recieve also sender side.
which will be sended by reciever.
—————————-
revision 1.12
date: 2016/01/07 06:38:07; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.11
date: 2016/01/07 06:35:43; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/07 06:32:15; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2016/01/07 06:21:43; author: root; state: Exp; lines: +2 -1
replace the scanf by fgets.
—————————-
revision 1.8
date: 2016/01/07 06:10:02; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/07 06:04:56; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/01/07 05:38:18; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/07 05:34:57; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/07 04:19:44; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/07 04:15:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/01/07 04:08:40; author: root; state: Exp; lines: +1 -0
int main is declared.
—————————-
revision 1.1
date: 2016/01/07 04:05:19; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: sender.c,v
Working file: sender.c
head: 1.17
branch:
locks: strict
root: 1.17
access list:
symbolic names:
keyword substitution: kv
total revisions: 17; selected revisions: 17
description:
this is a snder end.
it will send the data to reciever end.
—————————-
revision 1.17 locked by: root;
date: 2016/01/07 07:54:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2016/01/07 07:47:47; author: root; state: Exp; lines: +3 -8
*** empty log message ***
—————————-
revision 1.15
date: 2016/01/07 07:35:34; author: root; state: Exp; lines: +0 -8
*** empty log message ***
—————————-
revision 1.14
date: 2016/01/07 07:32:04; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/01/07 07:27:08; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.12
date: 2016/01/07 07:23:45; author: root; state: Exp; lines: +1 -0
include break;.
—————————-
revision 1.11
date: 2016/01/07 07:13:48; author: root; state: Exp; lines: +3 -0
data wil be recieved also sender side.
it will work like chating.
—————————-
revision 1.10
date: 2016/01/07 07:05:10; author: root; state: Exp; lines: +12 -1
recieve also sender side.
which will be sended by reciever.
—————————-
revision 1.9
date: 2016/01/07 06:25:10; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/01/07 06:24:10; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/01/07 06:21:43; author: root; state: Exp; lines: +4 -2
replace the scanf by fgets.
—————————-
revision 1.6
date: 2016/01/07 06:10:02; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/07 04:24:04; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/01/07 04:15:02; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/01/07 04:13:04; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/01/07 04:08:40; author: root; state: Exp; lines: +1 -0
int main is declared.
—————————-
revision 1.1
date: 2016/01/07 04:05:19; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
all requres header file are included here.
—————————-
revision 1.1 locked by: root;
date: 2016/01/07 04:06:44; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: message.h,v
Working file: message.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
declare the message structure here.
—————————-
revision 1.2 locked by: root;
date: 2016/01/07 05:56:50; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/01/07 04:06:44; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

project_03_Single_Client_Single_Server_Using_Ipc_And_Threads

RCS file: client1.c,v
Working file: client1.c
head: 1.18
branch:
locks: strict
root: 1.18
access list:
symbolic names:
keyword substitution: kv
total revisions: 18; selected revisions: 18
description:
this is aclient progran which will genrate arequest.
rfd and wfd file is found throw cmmand line argument usin pipe system call.
creating requuest using struct request.
—————————-
revision 1.18 locked by: root;
date: 2015/12/24 17:45:29; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.17
date: 2015/12/24 16:17:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2015/12/24 16:15:33; author: root; state: Exp; lines: +2 -1
sum declaed amd prin the result.
—————————-
revision 1.15
date: 2015/12/24 16:12:41; author: root; state: Exp; lines: +2 -0
read the result which is calculated in servr program
—————————-
revision 1.14
date: 2015/12/23 18:19:10; author: root; state: Exp; lines: +1 -0
write character in wfd.
—————————-
revision 1.13
date: 2015/12/23 17:53:11; author: root; state: Exp; lines: +4 -2
write something on wfd.
—————————-
revision 1.12
date: 2015/12/23 17:45:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/12/23 17:40:46; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2015/12/23 17:36:12; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.9
date: 2015/12/23 17:33:39; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2015/12/23 17:30:07; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.7
date: 2015/12/23 17:27:12; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.6
date: 2015/12/23 17:25:36; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2015/12/23 16:57:35; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2015/12/23 16:46:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/23 16:43:38; author: root; state: Exp; lines: +2 -2
include ;
—————————-
revision 1.2
date: 2015/12/23 16:27:27; author: root; state: Exp; lines: +1 -1
command line argument is changed.
—————————-
revision 1.1
date: 2015/12/23 16:12:32; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.23
branch:
locks: strict
root: 1.23
access list:
symbolic names:
keyword substitution: kv
total revisions: 23; selected revisions: 23
description:
this is a server program that accept request and process .
return also request specified client.
a child process is started using fork(),which further starts another client process using ececl().
—————————-
revision 1.23 locked by: root;
date: 2015/12/24 16:12:41; author: root; state: Exp; lines: +4 -1
result is calculated and write on wfd of server program.
—————————-
revision 1.22
date: 2015/12/24 16:01:44; author: root; state: Exp; lines: +5 -6
*** empty log message ***
—————————-
revision 1.21
date: 2015/12/24 11:36:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2015/12/24 11:36:12; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2015/12/24 11:20:48; author: root; state: Exp; lines: +3 -8
change the data type of oper.
—————————-
revision 1.18
date: 2015/12/24 09:21:25; author: root; state: Exp; lines: +7 -8
*** empty log message ***
—————————-
revision 1.17
date: 2015/12/24 09:19:32; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2015/12/24 09:18:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.15
date: 2015/12/24 09:15:15; author: root; state: Exp; lines: +1 -3
*** empty log message ***
—————————-
revision 1.14
date: 2015/12/24 09:13:12; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2015/12/24 09:12:40; author: root; state: Exp; lines: +9 -1
*** empty log message ***
—————————-
revision 1.12
date: 2015/12/24 08:58:32; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2015/12/24 08:56:50; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2015/12/24 08:54:58; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.9
date: 2015/12/24 08:53:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2015/12/24 08:51:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2015/12/24 08:48:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2015/12/24 08:47:21; author: root; state: Exp; lines: +1 -0
print the data which is available in buff.
—————————-
revision 1.5
date: 2015/12/23 18:19:10; author: root; state: Exp; lines: +6 -2
read character in rfd.
—————————-
revision 1.4
date: 2015/12/23 17:27:12; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/23 16:41:27; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:27:27; author: root; state: Exp; lines: +1 -1
here,also changed.
—————————-
revision 1.1
date: 2015/12/23 16:12:32; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
include stdio.h
—————————-
revision 1.3 locked by: root;
date: 2015/12/23 17:25:37; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:28:04; author: root; state: Exp; lines: +1 -0
include unistd.h
—————————-
revision 1.1
date: 2015/12/23 16:18:23; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
it defines the structure of the request.
—————————-
revision 1.6 locked by: root;
date: 2015/12/24 11:21:15; author: root; state: Exp; lines: +1 -1
type casting.
—————————-
revision 1.5
date: 2015/12/24 09:12:41; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2015/12/23 17:35:20; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/23 17:25:37; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:43:49; author: root; state: Exp; lines: +1 -1
include ; before int main
it meand include ; in request.h
—————————-
revision 1.1
date: 2015/12/23 16:18:23; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Client Server Using IPC by using message queues and pipes for single user

logfile of project

=============

=============
RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
It includes basic headers for implementation
It includes stdio.h, fcntl.h etc.
—————————-
revision 1.2    locked by: root;
date: 2016/01/06 18:46:13;  author: root;  state: Exp;  lines: +2 -0
sys/ipc.h , sys/msg.h is included.
—————————-
revision 1.1
date: 2016/01/06 18:38:00;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: adder.c,v
Working file: adder.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;    selected revisions: 3
description:
It is processing client which gives result of addition of two objects.
It communicate via fifo.
—————————-
revision 1.3    locked by: root;
date: 2016/01/06 18:50:27;  author: root;  state: Exp;  lines: +2 -2
my_message is defined.
—————————-
revision 1.2
date: 2016/01/06 18:43:53;  author: root;  state: Exp;  lines: +1 -1
The header message.h is included.
—————————-
revision 1.1
date: 2016/01/06 18:33:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client1.c,v
Working file: client1.c
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12;    selected revisions: 12
description:
It request server for adding through Message Queue
It reads result from server through Message Queue
—————————-
revision 1.12    locked by: root;
date: 2016/01/07 14:11:54;  author: root;  state: Exp;  lines: +2 -0
message queue terminated in client
—————————-
revision 1.11
date: 2016/01/07 13:37:54;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/07 13:32:19;  author: root;  state: Exp;  lines: +2 -2
message type is specified
—————————-
revision 1.9
date: 2016/01/07 13:25:39;  author: root;  state: Exp;  lines: +2 -2
different key is used for server and client.
—————————-
revision 1.8
date: 2016/01/07 13:21:47;  author: root;  state: Exp;  lines: +1 -1
values of objects changed.
—————————-
revision 1.7
date: 2016/01/07 13:10:40;  author: root;  state: Exp;  lines: +1 -1
id is changed
—————————-
revision 1.6
date: 2016/01/06 19:06:15;  author: root;  state: Exp;  lines: +1 -1
Message id sent to server is used for the sent message.
—————————-
revision 1.5
date: 2016/01/06 19:00:36;  author: root;  state: Exp;  lines: +1 -1
obj1 is used.
—————————-
revision 1.4
date: 2016/01/06 18:53:47;  author: root;  state: Exp;  lines: +1 -0
msqid id declared.
—————————-
revision 1.3
date: 2016/01/06 18:52:17;  author: root;  state: Exp;  lines: +1 -2
compilation errors resolving.
—————————-
revision 1.2
date: 2016/01/06 18:44:11;  author: root;  state: Exp;  lines: +1 -1
Message.h is included.
—————————-
revision 1.1
date: 2016/01/06 18:34:29;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client2.c,v
Working file: client2.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It reads result from server through Message Queue
—————————-
revision 1.1    locked by: root;
date: 2016/01/06 18:35:43;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client3.c,v
Working file: client3.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
It reads result from server through Message Queue
—————————-
revision 1.1    locked by: root;
date: 2016/01/06 18:36:09;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: multiplier.c,v
Working file: multiplier.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
It gives result the multiplication of 2 objects.
It communicate through pipes.
—————————-
revision 1.2    locked by: root;
date: 2016/01/06 18:44:23;  author: root;  state: Exp;  lines: +1 -1
message.h is included.
—————————-
revision 1.1
date: 2016/01/06 18:36:13;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.16
branch:
locks: strict
root: 1.16
access list:
symbolic names:
keyword substitution: kv
total revisions: 16;    selected revisions: 16
description:
It takes request from client throughr Message Queue
It takes result via Pipe from Processing Client.
It writes result to client through Message Queue.
—————————-
revision 1.16    locked by: root;
date: 2016/01/07 14:25:42;  author: root;  state: Exp;  lines: +1 -1
mode change from 777 to 666.
—————————-
revision 1.15
date: 2016/01/07 14:13:12;  author: root;  state: Exp;  lines: +0 -1
message queue not deleted here.
—————————-
revision 1.14
date: 2016/01/07 14:06:25;  author: root;  state: Exp;  lines: +2 -0
Message Queue is destroyed.
—————————-
revision 1.13
date: 2016/01/07 13:51:40;  author: root;  state: Exp;  lines: +2 -0
2 message queues are used.
—————————-
revision 1.12
date: 2016/01/07 13:43:31;  author: root;  state: Exp;  lines: +1 -1
Flag is set to IPC_NOWAIT
—————————-
revision 1.11
date: 2016/01/07 13:37:58;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/01/07 13:32:33;  author: root;  state: Exp;  lines: +1 -1
message type is specified.
—————————-
revision 1.9
date: 2016/01/07 13:14:45;  author: root;  state: Exp;  lines: +5 -5
A new struct my_message type variable result is declared.
—————————-
revision 1.8
date: 2016/01/07 13:10:48;  author: root;  state: Exp;  lines: +1 -1
id is changed.
—————————-
revision 1.7
date: 2016/01/07 13:03:20;  author: root;  state: Exp;  lines: +3 -2
Error condition of message send is checked.
—————————-
revision 1.6
date: 2016/01/07 12:55:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/01/06 19:06:34;  author: root;  state: Exp;  lines: +1 -1
Message id is used.
—————————-
revision 1.4
date: 2016/01/06 18:59:02;  author: root;  state: Exp;  lines: +2 -2
ce
—————————-
revision 1.3
date: 2016/01/06 18:57:45;  author: root;  state: Exp;  lines: +1 -1
req is defined.
—————————-
revision 1.2
date: 2016/01/06 18:56:41;  author: root;  state: Exp;  lines: +1 -2
Compilation errors resolving.
—————————-
revision 1.1
date: 2016/01/06 18:36:43;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Project 03: Client Server Communication using Linux and IPC | Tagged , , , , , , | Leave a comment

3_Requesting_Client_3_Processing_Client_And_1Server using only pipe

RCS file: header.h,v
Working file: header.h
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
include stdio.h
—————————-
revision 1.3 locked by: root;
date: 2015/12/23 17:25:37; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:28:04; author: root; state: Exp; lines: +1 -0
include unistd.h
—————————-
revision 1.1
date: 2015/12/23 16:18:23; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
it defines the structure of the request.
—————————-
revision 1.4 locked by: root;
date: 2015/12/23 17:35:20; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/23 17:25:37; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:43:49; author: root; state: Exp; lines: +1 -1
include ; before int main
it meand include ; in request.h
—————————-
revision 1.1
date: 2015/12/23 16:18:23; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
this is a server program that accept request and process .
return also request specified client.
a child process is started using fork(),which further starts another client process using ececl().
—————————-
revision 1.5 locked by: root;
date: 2015/12/23 18:19:10; author: root; state: Exp; lines: +6 -2
read character in rfd.
—————————-
revision 1.4
date: 2015/12/23 17:27:12; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.3
date: 2015/12/23 16:41:27; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.2
date: 2015/12/23 16:27:27; author: root; state: Exp; lines: +1 -1
here,also changed.
—————————-
revision 1.1
date: 2015/12/23 16:12:32; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment