<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; Paras Kumar</title>
	<atom:link href="https://www.emblogic.com/blog/author/parask-2092/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>Character Device Driver : RCS [init, open, write, read, seek ,clean]</title>
		<link>https://www.emblogic.com/blog/11/character-device-driver-rcs-init-open-write-read-seek-clean/</link>
		<comments>https://www.emblogic.com/blog/11/character-device-driver-rcs-init-open-write-read-seek-clean/#comments</comments>
		<pubDate>Thu, 13 Nov 2014 17:10:18 +0000</pubDate>
		<dc:creator><![CDATA[Paras Kumar]]></dc:creator>
				<category><![CDATA[Character Driver]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11789</guid>
		<description><![CDATA[RCS FOR INITILIZATION RCS file: ./initialization.c,v Working file: ./initialization.c head: 1.8 branch: locks: strict root: 1.8 access list: symbolic names: keyword substitution: kv total revisions: 8;    selected revisions: 8 description: initialization function registering char driver. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- revision 1.8    locked by: &#8230; <a href="https://www.emblogic.com/blog/11/character-device-driver-rcs-init-open-write-read-seek-clean/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS FOR INITILIZATION</p>
<p>RCS file: ./initialization.c,v<br />
Working file: ./initialization.c<br />
head: 1.8<br />
branch:<br />
locks: strict<br />
root: 1.8<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 8;    selected revisions: 8<br />
description:<br />
initialization function registering char driver.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8    locked by: root;<br />
date: 2014/09/17 17:36:43;  author: root;  state: Exp;  lines: +1 -0<br />
initialize the semapahore .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/17 16:16:42;  author: root;  state: Exp;  lines: +10 -1<br />
declared quantum_size,qset-size and device_size of sculldev.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/04 08:12:28;  author: root;  state: Exp;  lines: +3 -3<br />
replaced the priority in printk.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/04 07:58:12;  author: root;  state: Exp;  lines: +6 -3<br />
fixed some errors.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/03 15:52:43;  author: root;  state: Exp;  lines: +21 -4<br />
initialized the device with cdev_init.<br />
added device using cdev_add.<br />
only one device is mapped by scull.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/03 05:23:55;  author: root;  state: Exp;  lines: +1 -0<br />
gave moduleparam for nod.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/03 05:14:50;  author: root;  state: Exp;  lines: +1 -0<br />
gave decalartrions.h header<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/03 05:14:06;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS FOR DEV_OPEN</p>
<p>RCS file: ./dev_open.c,v<br />
Working file: ./dev_open.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
root: 1.2<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2;    selected revisions: 2<br />
description:<br />
device open open call routine written.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2    locked by: root;<br />
date: 2014/09/04 08:03:16;  author: root;  state: Exp;  lines: +1 -1<br />
fixed some errors .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/03 16:13:34;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS FOR DEV_WRITE</p>
<p>RCS file: ./dev_write.c,v<br />
Working file: ./dev_write.c<br />
head: 1.14<br />
branch:<br />
locks: strict<br />
root: 1.14<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 14;    selected revisions: 14<br />
description:<br />
device wurite operation .<br />
memory allocated to sculldev-&gt;scullqset.<br />
noqsets depend on the sizeof block.<br />
64 bytes block created.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.14    locked by: root;<br />
date: 2014/09/22 15:39:51;  author: root;  state: Exp;  lines: +9 -5<br />
test for the dev trim condition .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.13<br />
date: 2014/09/22 12:09:54;  author: root;  state: Exp;  lines: +50 -38<br />
included down semaphore.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.12<br />
date: 2014/09/18 18:25:12;  author: root;  state: Exp;  lines: +38 -35<br />
modified code for dev_trim call.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.11<br />
date: 2014/09/17 17:37:47;  author: root;  state: Exp;  lines: +2 -1<br />
applied semaphore as down interruptoble and up<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/09/17 16:17:59;  author: root;  state: Exp;  lines: +46 -47<br />
removed the initialiaztion of variables qset_size,device_size and quantum_size<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/09/10 18:57:45;  author: root;  state: Exp;  lines: +1 -1<br />
gave return corrected value<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/09/10 16:22:44;  author: root;  state: Exp;  lines: +2 -1<br />
gave device_size.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/10 11:24:56;  author: root;  state: Exp;  lines: +1 -1<br />
declared device_size variable.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/09 18:28:14;  author: root;  state: Exp;  lines: +4 -3<br />
returned value of filep-&gt;f_pos .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/09 18:21:50;  author: root;  state: Exp;  lines: +32 -15<br />
copy from user with no of bytes less than quantum to increase accuracy of device.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/09 17:42:03;  author: root;  state: Exp;  lines: +135 -6<br />
changed quantum bytes allocation for last quantum .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/04 08:03:48;  author: root;  state: Exp;  lines: +9 -7<br />
fixed errors alot.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/03 17:43:04;  author: root;  state: Exp;  lines: +1 -1<br />
commented line to find user buff length.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/03 17:34:23;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS FOR DEV_SEEK</p>
<p>RCS file: ./dev_seek.c,v<br />
Working file: ./dev_seek.c<br />
head: 1.6<br />
branch:<br />
locks: strict<br />
root: 1.6<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 6;    selected revisions: 6<br />
description:<br />
lseek routine.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6    locked by: root;<br />
date: 2014/09/22 12:10:25;  author: root;  state: Exp;  lines: +12 -5<br />
modified according to new device_size.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/17 16:18:44;  author: root;  state: Exp;  lines: +38 -20<br />
implemneted seek end properly with right notations<br />
now the offset in the app will be positive for seek_end case.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/12 16:04:23;  author: root;  state: Exp;  lines: +8 -2<br />
modified cases for SEEK_CUR.<br />
modified case for SEEK_END.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/12 15:21:31;  author: root;  state: Exp;  lines: +9 -1<br />
include case for seek end/.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/12 08:48:53;  author: root;  state: Exp;  lines: +4 -1<br />
gave  case for seek current.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/10 11:26:10;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS FOR DEV_READ</p>
<p>RCS file: ./dev_read.c,v<br />
Working file: ./dev_read.c<br />
head: 1.13<br />
branch:<br />
locks: strict<br />
root: 1.13<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 13;    selected revisions: 13<br />
description:<br />
dev_read operartion.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.13    locked by: root;<br />
date: 2014/09/22 12:10:13;  author: root;  state: Exp;  lines: +19 -4<br />
included down and up semaphore .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.12<br />
date: 2014/09/18 18:25:26;  author: root;  state: Exp;  lines: +5 -3<br />
detected and corrected a loophole.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.11<br />
date: 2014/09/17 17:38:12;  author: root;  state: Exp;  lines: +2 -0<br />
applied semaphore as down interruptible and up/<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/09/17 16:18:32;  author: root;  state: Exp;  lines: +34 -21<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/09/12 15:48:16;  author: root;  state: Exp;  lines: +2 -3<br />
removed increment arrqset from one condition.<br />
redundant code removed.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/09/12 15:24:18;  author: root;  state: Exp;  lines: +0 -1<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/09/12 15:20:23;  author: root;  state: Exp;  lines: +27 -11<br />
include case for noctr &lt; quatnum_size.<br />
BUT greater than temp..<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/09/12 10:21:00;  author: root;  state: Exp;  lines: +4 -4<br />
changed the file_&gt;f_pos values for different clauses.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/09/12 10:15:43;  author: root;  state: Exp;  lines: +30 -26<br />
modified the code for complete seek_set process.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/12 08:47:33;  author: root;  state: Exp;  lines: +78 -67<br />
modified code for reading pupose.<br />
modified if the offset is zero.<br />
if start == offset case completely correct.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/11 16:04:24;  author: root;  state: Exp;  lines: +6 -3<br />
passed the file pointer to function copy to user to update the f_pos value.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/10 18:58:21;  author: root;  state: Exp;  lines: +48 -34<br />
completed function copy to user<br />
copy to user can now read from a given offset and can read any no of charcacters from the any position even no of charcters to be read can be 1 byte</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/10 16:24:31;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================<br />
RCS FOR CLEANUP</p>
<p>RCS file: ./cleanup.c,v<br />
Working file: ./cleanup.c<br />
head: 1.4<br />
branch:<br />
locks: strict<br />
root: 1.4<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 4;    selected revisions: 4<br />
description:<br />
unregistering the character driver.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4    locked by: root;<br />
date: 2014/09/04 07:59:01;  author: root;  state: Exp;  lines: +2 -6<br />
removed return from unregistering character device<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/03 18:08:55;  author: root;  state: Exp;  lines: +2 -1<br />
gave prototypes for different functions.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/03 15:56:52;  author: root;  state: Exp;  lines: +2 -1<br />
deleted device using cdev_del.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/03 05:24:18;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/11/character-device-driver-rcs-init-open-write-read-seek-clean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCS for FTP based Client Server project using sockets and threads</title>
		<link>https://www.emblogic.com/blog/10/rcs-for-ftp-based-client-server-project-using-sockets-and-threads/</link>
		<comments>https://www.emblogic.com/blog/10/rcs-for-ftp-based-client-server-project-using-sockets-and-threads/#comments</comments>
		<pubDate>Fri, 31 Oct 2014 17:06:06 +0000</pubDate>
		<dc:creator><![CDATA[Paras Kumar]]></dc:creator>
				<category><![CDATA[Project 04: FTP based Client Server using Threads and Sockets]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11636</guid>
		<description><![CDATA[This  code works for multiple clients trying to download any file at same time using AF_INET. For every  client server creates a new thread and that thread responds to the client. rcs for server. RCS file: ./server.c,v Working file: ./server.c &#8230; <a href="https://www.emblogic.com/blog/10/rcs-for-ftp-based-client-server-project-using-sockets-and-threads/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This  code works for multiple clients trying to download any file at same time using AF_INET. For every  client server creates a new thread and that thread responds to the client.</p>
<p>rcs for server.</p>
<p>RCS file: ./server.c,v<br />
Working file: ./server.c<br />
head: 1.10<br />
branch:<br />
locks: strict<br />
root: 1.10<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 10;    selected revisions: 10<br />
description:<br />
ftp server<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10    locked by: root;<br />
date: 2014/10/06 16:04:13;  author: root;  state: Exp;  lines: +4 -2<br />
now server is printing .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/10/01 13:47:44;  author: root;  state: Exp;  lines: +13 -16<br />
while loop added .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/10/01 13:19:07;  author: root;  state: Exp;  lines: +12 -2<br />
now the size of file is transfered first .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/10/01 12:02:49;  author: root;  state: Exp;  lines: +39 -6<br />
server sends the file contents in small packets to the client.<br />
af-inet implemented successdully for one client as multithread application.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/10/01 07:03:02;  author: root;  state: Exp;  lines: +1 -1<br />
successfully sent the list of files to the client.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/10/01 05:59:58;  author: root;  state: Exp;  lines: +24 -22<br />
removed silly errors .<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/09/30 16:20:38;  author: root;  state: Exp;  lines: +24 -23<br />
sent the list of files to client.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/30 13:31:05;  author: root;  state: Exp;  lines: +12 -4<br />
done with get and put commaands to client.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/30 12:11:37;  author: root;  state: Exp;  lines: +45 -5<br />
created threads to get the list of files in the specified directory.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/30 11:32:01;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>rcs for client..</p>
<p>RCS file: ./client1.c,v<br />
Working file: ./client1.c<br />
head: 1.9<br />
branch:<br />
locks: strict<br />
root: 1.9<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 9;    selected revisions: 9<br />
description:<br />
this is the client1<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9    locked by: root;<br />
date: 2014/10/06 16:52:56;  author: root;  state: Exp;  lines: +8 -3<br />
client recieving the file in new folder.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/10/06 16:35:22;  author: root;  state: Exp;  lines: +5 -4<br />
file will be downloaded in another folder<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/10/01 13:19:29;  author: root;  state: Exp;  lines: +6 -6<br />
file size is recieved as well<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
revision 1.6<br />
date: 2014/10/01 12:04:42;  author: root;  state: Exp;  lines: +36 -4<br />
client recieved the file from the server.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/10/01 07:03:23;  author: root;  state: Exp;  lines: +22 -17<br />
sucessfully read list of files to be downloaded from server.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/10/01 06:00:18;  author: root;  state: Exp;  lines: +20 -11<br />
modified code a bit.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/09/30 16:20:52;  author: root;  state: Exp;  lines: +13 -8<br />
recieved the list of files from the server.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/09/30 13:31:40;  author: root;  state: Exp;  lines: +15 -1<br />
read the put and get commands from user.<br />
send user the response get/put.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/09/30 11:32:01;  author: root;  state: Exp;<br />
Initial revision<br />
=============================================================================</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/10/rcs-for-ftp-based-client-server-project-using-sockets-and-threads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Circular  queue using Link list</title>
		<link>https://www.emblogic.com/blog/07/circular-queue-using-link-list/</link>
		<comments>https://www.emblogic.com/blog/07/circular-queue-using-link-list/#comments</comments>
		<pubDate>Thu, 24 Jul 2014 05:18:50 +0000</pubDate>
		<dc:creator><![CDATA[Paras Kumar]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11277</guid>
		<description><![CDATA[MAIN.. #include&#8221;header.h&#8221; int main() { int choice,n=0; struct node *start; start=NULL; printf(&#8220;\n ENTER THE SIZE OF CIRCULAR QUEUE\n&#8221;); scanf(&#8220;%d&#8221;,&#38;n); while(1) { choice=getchoice(); operation(choice,&#38;start,n); } return 0; } FUNCTION DEFINITIONS.. #include&#8221;header.h&#8221; struct node *front,*rear=NULL; struct node *temp =NULL; int count=-1,flag=0,num=0; int &#8230; <a href="https://www.emblogic.com/blog/07/circular-queue-using-link-list/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>MAIN..</p>
<p>#include&#8221;header.h&#8221;</p>
<p>int main()<br />
{<br />
int choice,n=0;<br />
struct node *start;<br />
start=NULL;<br />
printf(&#8220;\n ENTER THE SIZE OF CIRCULAR QUEUE\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;n);<br />
while(1)<br />
{<br />
choice=getchoice();<br />
operation(choice,&amp;start,n);</p>
<p>}<br />
return 0;<br />
}</p>
<p>FUNCTION DEFINITIONS..</p>
<p>#include&#8221;header.h&#8221;<br />
struct node *front,*rear=NULL;<br />
struct node *temp =NULL;<br />
int count=-1,flag=0,num=0;</p>
<p>int getchoice()<br />
{<br />
int choice;<br />
printf(&#8220;\n1. CREATE &#8220;);<br />
printf(&#8220;\n2. ENQUEUE&#8221;);<br />
printf(&#8220;\n3. DEQUEUE &#8220;);<br />
printf(&#8220;\n4. DISPLAY&#8221;);<br />
printf(&#8220;\n0. EXIT\n&#8221;);<br />
printf(&#8220;\n\n Enter your choice\n&#8221;);<br />
scanf(&#8221; %d&#8221;,&amp;choice);<br />
return choice;<br />
}<br />
int operation(int choice ,struct node **start,int n)<br />
{<br />
switch(choice)<br />
{<br />
case 1 :  create(start);<br />
break;<br />
case 2 :  enqueue(start,n,choice);<br />
break;<br />
case 3 :  dequeue(start);<br />
break;<br />
case 4 :  display(start);<br />
break;<br />
case 0 : exit(0);<br />
break;<br />
default : printf(&#8220;\ninvalid operation&#8221;);<br />
}<br />
}</p>
<p>int create(struct node **start)<br />
{<br />
if(flag)<br />
{<br />
printf(&#8220;\n THE CIRCULAR QUEUE IS ALREADY CREATED!!&#8221;);<br />
return -1;<br />
}<br />
if(!flag)<br />
{<br />
(*start)=NULL;<br />
printf(&#8220;\n THE QUEUE CREATED SUCESSFULLY&#8221;);<br />
flag=1;<br />
}<br />
}<br />
int enqueue(struct node **start,int n,int choice)<br />
{<br />
if(flag)<br />
{<br />
if(num==0)<br />
{<br />
(*start)=(struct node *)malloc(sizeof(struct node));<br />
printf(&#8220;\n ENTER THE VERY FIRST ELEMENT\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;((*start)-&gt;info));<br />
(*start)-&gt;next=NULL;<br />
rear=(*start);<br />
front=(*start);<br />
count++;<br />
num=1;<br />
return 0;<br />
}<br />
if(count==(n-1))<br />
{<br />
printf(&#8220;\n THE QUEUE IS FULL\n&#8221;);<br />
return 0;<br />
}<br />
else<br />
{<br />
rear-&gt;next=malloc(sizeof(struct node));<br />
rear=rear-&gt;next;<br />
printf(&#8220;\n ENTER THE INFO : \n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(rear-&gt;info));<br />
count++;<br />
}<br />
}<br />
}</p>
<p>int dequeue(struct node **start)<br />
{<br />
if(flag)<br />
{<br />
if(front==rear)<br />
{<br />
if(count==(-1))<br />
{<br />
printf(&#8220;\n THE QUEUE IS EMPTY&#8221;);<br />
return 0;<br />
}<br />
printf(&#8220;\n THE ELEMENT REMOVED IS %d&#8221;,front-&gt;info);<br />
front=NULL;<br />
rear=NULL;<br />
num=0;<br />
//    flag=0;<br />
count&#8211;;</p>
<p>}</p>
<p>else if(front!=rear)<br />
{<br />
printf(&#8220;\n THE ELEMENT REMOVED IS %d&#8221;,front-&gt;info);<br />
front = front-&gt;next;<br />
count&#8211;;<br />
}<br />
}<br />
if(!flag)<br />
printf(&#8220;\nTHE QUEUE IS EMPTY&#8230;.!!&#8221;);<br />
}<br />
int display(struct node **start)<br />
{<br />
if(flag)<br />
{<br />
if(front==NULL)<br />
{<br />
printf(&#8220;\n THE QUEUE IS EMPTY&#8221;);<br />
return 0;<br />
}<br />
temp=front;<br />
printf(&#8220;THE ELEMENTS ARE&#8221;);<br />
while(temp!=rear)<br />
{<br />
printf(&#8220;&#8211;&gt;  %d&#8221;,temp-&gt;info);<br />
temp = temp-&gt;next;<br />
}<br />
if(temp==rear)<br />
printf(&#8220;&#8211;&gt; %d&#8221;,temp-&gt;info);<br />
return 0;<br />
}<br />
if(!flag)<br />
{    printf(&#8220;\n THE QUEUE IS EMPTY&#8230;!! NOTHING TO SHOW&#8221;);<br />
}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/circular-queue-using-link-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>stack operations using link list (pass by reference)</title>
		<link>https://www.emblogic.com/blog/07/stack-operations-using-link-list-pass-by-reference/</link>
		<comments>https://www.emblogic.com/blog/07/stack-operations-using-link-list-pass-by-reference/#comments</comments>
		<pubDate>Fri, 18 Jul 2014 07:22:53 +0000</pubDate>
		<dc:creator><![CDATA[Paras Kumar]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11103</guid>
		<description><![CDATA[main #include&#8221;header.h&#8221; int main() { int choice; struct node *start; start = (struct node *)malloc(sizeof(struct node)); start-&#62;next = NULL; start-&#62;prev = NULL; while(1) {    choice = get_choice(); operation(choice,&#38;start); } return 0; } &#160; FUNCTIONS DEFINITIONS #include&#8221;header.h&#8221; struct node *top=NULL; int &#8230; <a href="https://www.emblogic.com/blog/07/stack-operations-using-link-list-pass-by-reference/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>main</p>
<p>#include&#8221;header.h&#8221;<br />
int main()<br />
{<br />
int choice;<br />
struct node *start;<br />
start = (struct node *)malloc(sizeof(struct node));<br />
start-&gt;next = NULL;<br />
start-&gt;prev = NULL;<br />
while(1)<br />
{    choice = get_choice();<br />
operation(choice,&amp;start);<br />
}<br />
return 0;</p>
<p>}</p>
<p>&nbsp;</p>
<p>FUNCTIONS DEFINITIONS</p>
<p>#include&#8221;header.h&#8221;<br />
struct node *top=NULL;</p>
<p>int flag=0,count=0;<br />
int get_choice()                                            //getchoice from user<br />
{<br />
int choice;<br />
printf(&#8220;\n&#8212;&#8212;&#8212;&#8212;STACK MENU&#8212;&#8212;&#8212;&#8212;&#8221;);<br />
printf(&#8220;\n 1. CREATE NODE&#8221;);<br />
printf(&#8220;\n 2. PUSH&#8221;);<br />
printf(&#8220;\n 3. POP&#8221;);<br />
printf(&#8220;\n 4. DISPLAY&#8221;);<br />
printf(&#8220;\n 0. EXIT&#8221;);<br />
printf(&#8220;\n\n ENTER TOUR CHOICE\n&#8221;);<br />
scanf(&#8221; %d&#8221;,&amp;choice);<br />
return choice;<br />
}</p>
<p>int operation(int choice, struct node **start)                                //operations<br />
{<br />
switch(choice)<br />
{    case 1 : create_node(start);<br />
break;<br />
case 2 : push(start);<br />
break;<br />
case 3 : pop(start);<br />
break;<br />
case 4 : display(start);<br />
break;<br />
case 0 : exit(0);<br />
break;<br />
default : printf(&#8220;\nENTER VALID OPTION&#8221;);<br />
}</p>
<p>}</p>
<p>int create_node(struct node **start)                                    //create first node(first PUSH)<br />
{</p>
<p>if(flag)<br />
{    printf(&#8220;\n The Stack is already created.&#8221;);<br />
}<br />
if(flag==0)<br />
{<br />
struct node * new;<br />
new=(struct node*)malloc(sizeof(struct node));<br />
new-&gt;next=NULL;<br />
new-&gt;prev = (*start);<br />
(*start)-&gt;next = new;<br />
top = new;<br />
printf(&#8220;\nEnter the element in the node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(new-&gt; info));<br />
flag=1;<br />
printf(&#8220;\nFirst element is pushed sucessfully&#8221;);<br />
count=1;</p>
<p>}</p>
<p>}</p>
<p>int push(struct node **start)                                        //PUSH<br />
{<br />
if(count&lt;10)<br />
{    struct node *new;<br />
new=(struct node *)malloc(sizeof(struct node));<br />
new-&gt;next=NULL;<br />
new-&gt;prev=top;<br />
top-&gt;next=new;<br />
top=top-&gt;next;<br />
printf(&#8220;\nEnter the value of node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(top-&gt;info));<br />
count++;<br />
printf(&#8220;\n\nElement pushed successfully&#8221;);<br />
}<br />
else<br />
{printf(&#8220;\nThe Stack is FULL..&#8221;);}</p>
<p>}</p>
<p>int pop(struct node **start)                                        //POP<br />
{<br />
int num;<br />
if(top==(*start))<br />
printf(&#8220;The Stack is Empty!!!&#8221;);<br />
else<br />
{<br />
num=top-&gt;info;<br />
top=top-&gt;prev;<br />
top-&gt;next-&gt;prev=NULL;<br />
top-&gt;next=NULL;<br />
count&#8211;;<br />
printf(&#8220;\nThe element popped is %d&#8221;,num);<br />
}</p>
<p>}</p>
<p>int display(struct node **start)                                    //display<br />
{<br />
if(count==0)<br />
printf(&#8220;\nThe Stack is empty&#8221;);<br />
else<br />
{    struct node *temp;<br />
temp=top;<br />
printf(&#8220;\nThe stack is &#8211;&gt;&#8221;);<br />
while(temp!=(*start))<br />
{<br />
printf(&#8220;-&gt;  %d&#8221;,temp-&gt;info);<br />
temp=temp-&gt;prev;<br />
}</p>
<p>}<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/stack-operations-using-link-list-pass-by-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C assignment link list operations Q1(pass by value method)</title>
		<link>https://www.emblogic.com/blog/07/c-assignment-link-list-operations-q1pass-by-value-method/</link>
		<comments>https://www.emblogic.com/blog/07/c-assignment-link-list-operations-q1pass-by-value-method/#comments</comments>
		<pubDate>Wed, 16 Jul 2014 14:29:51 +0000</pubDate>
		<dc:creator><![CDATA[Paras Kumar]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=11041</guid>
		<description><![CDATA[HEADER.h #include&#60;stdio.h&#62; #include&#60;stdlib.h&#62; struct node { int info; struct node * next; }; int get_choice(); struct node * operation(int, struct node *); struct node * create_node(struct node *); struct node * insert_node(struct node*); struct node * insert_beg(struct node*); struct node &#8230; <a href="https://www.emblogic.com/blog/07/c-assignment-link-list-operations-q1pass-by-value-method/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>HEADER.h</p>
<p>#include&lt;stdio.h&gt;<br />
#include&lt;stdlib.h&gt;<br />
struct node<br />
{<br />
int info;<br />
struct node * next;</p>
<p>};<br />
int get_choice();<br />
struct node * operation(int, struct node *);<br />
struct node * create_node(struct node *);<br />
struct node * insert_node(struct node*);<br />
struct node * insert_beg(struct node*);<br />
struct node * insert_end(struct node*);<br />
struct node * insert_nth(struct node*);<br />
struct node * insert_key(struct node*);<br />
struct node * delete_node(struct node*);<br />
struct node * del_beg(struct node *);<br />
struct node * del_end(struct node *);<br />
struct node * del_nth(struct node *);<br />
struct node * del_key(struct node *);<br />
struct node * display(struct node*);<br />
struct node * sorting(struct node *);<br />
struct node * sort_ascend(struct node *);<br />
struct node * sort_descend(struct node *);<br />
struct node * destroy(struct node *);</p>
<p>MAIN</p>
<p>#include&#8221;header.h&#8221;<br />
int main()<br />
{<br />
struct node  * start;<br />
start =  NULL;<br />
int choice;<br />
while(1)<br />
{        choice = get_choice();<br />
start=operation(choice,start);<br />
}</p>
<p>}</p>
<p>FUNCTON DEFINITIONS</p>
<p>#include&#8221;header.h&#8221;<br />
int flag=0;<br />
int get_choice()                                        //getchoice from user<br />
{<br />
int choice;<br />
printf(&#8220;\n&#8212;&#8212;&#8212;&#8212;&#8212;_MENU&#8212;&#8212;&#8212;&#8212;&#8211;\n&#8221;);<br />
printf(&#8221;  1. CREATE LINK LIST\n&#8221;);<br />
printf(&#8221;  2. INSERT\n&#8221;);<br />
printf(&#8221;  3. DELETE\n&#8221;);<br />
printf(&#8221;  4. SORT\n&#8221;);<br />
printf(&#8221;  5. DISPLAY\n&#8221;);<br />
printf(&#8221;  6. DESTROY\n&#8221;);<br />
printf(&#8221;  0. Exit\n&#8221;);<br />
printf(&#8220;\n\n  Enter your choice&#8230;\n&#8221;);</p>
<p>scanf(&#8220;%d&#8221;,&amp;choice);<br />
return choice;<br />
}</p>
<p>struct node * operation(int choice,struct node *start )                    //operations<br />
{</p>
<p>struct node * temp;<br />
switch(choice)<br />
{<br />
case 1: temp=create_node(start);<br />
break;<br />
case 2: temp=insert_node(start);<br />
break;<br />
case 3: temp=delete_node(start);<br />
break;<br />
case 4: temp = sorting(start);<br />
break;<br />
case 5: temp=display(start);<br />
break;<br />
case 6: temp = destroy(start);<br />
free(temp);<br />
break;<br />
case 0: exit(0);<br />
default:printf(&#8220;\nINVALID OPTION&#8221;);</p>
<p>}return temp;</p>
<p>}</p>
<p>struct node * create_node(struct node *start)                            //create first node<br />
{</p>
<p>if(flag)<br />
{ printf(&#8220;link list is already created\n&#8221;);<br />
}<br />
if(flag==0)<br />
{<br />
start=(struct node*)malloc (sizeof(struct node));<br />
printf(&#8220;enter the info of link list \n&#8221;);<br />
scanf(&#8220;%d&#8221;, &amp;(start-&gt;info));<br />
start-&gt;next = NULL;<br />
flag = 1;<br />
printf(&#8220;link list created successfully\n&#8221;);<br />
printf(&#8220;first element is %d\n&#8221;, start-&gt;info);<br />
return start;</p>
<p>}<br />
}</p>
<p>struct node * insert_node(struct node *start)                            //insert node menu<br />
{<br />
struct node *temp1;</p>
<p>if(flag==0)<br />
printf(&#8220;linked list not created!\n&#8221;);<br />
else<br />
{<br />
int choice;<br />
printf(&#8220;___________INSERT MENU_______________\n&#8221;);<br />
printf(&#8220;1. INSERT AT BEGGINING\n&#8221;);<br />
printf(&#8220;2. INSERT AT END\n&#8221;);<br />
printf(&#8220;3. INSERT AT NTH\n&#8221;);<br />
printf(&#8220;4. INSERT AFTER KEY VALUE\n&#8221;);<br />
printf(&#8220;\n\nEnter your choice&#8230;\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;choice);<br />
switch(choice)<br />
{<br />
case 1:temp1 = insert_beg(start);<br />
break;</p>
<p>case 2:temp1 = insert_end(start);<br />
break;</p>
<p>case 3:temp1 = insert_nth(start);<br />
break;</p>
<p>case 4:temp1 = insert_key(start);<br />
break;<br />
default : printf(&#8220;\nINVALID&#8221;);<br />
}<br />
return temp1;<br />
}<br />
}<br />
struct node * insert_beg(struct node *start)                                //insert at begining<br />
{<br />
struct  node *b;<br />
b=(struct node *)malloc(sizeof(struct node));<br />
printf(&#8220;enter the element of node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(b-&gt;info));<br />
b-&gt;next = start;<br />
start = b;<br />
return start;</p>
<p>}</p>
<p>struct node * display(struct node *start)                                //display<br />
{<br />
int num=0;<br />
struct node *new,*temp;<br />
temp=start;<br />
new = start;<br />
if(flag==0)<br />
{    printf(&#8220;\nlink list is empty!!!\n&#8221;);<br />
}<br />
while(temp)<br />
{    temp=temp-&gt;next;<br />
num++;<br />
}<br />
//    printf(&#8220;\nthe number of nodes are %d&#8221;,num);<br />
if(flag)<br />
{<br />
if(num==0)<br />
{    printf(&#8220;\nList is empty !!!!&#8221;);<br />
return start;<br />
}<br />
else<br />
{    printf(&#8220;the link list is &#8212;&gt;&gt;&#8221;);<br />
do<br />
{<br />
printf(&#8221; %d &#8220;, new-&gt;info);<br />
new = new -&gt; next;<br />
}while(new!=NULL);<br />
return start;<br />
}<br />
}<br />
}</p>
<p>struct node * insert_end(struct node *start)                                //insert at end<br />
{<br />
struct node *b, *n;<br />
n = start;<br />
b=(struct node *)malloc(sizeof(struct node));<br />
printf(&#8220;enter the info of node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(b-&gt;info));<br />
printf(&#8220;\nthe last element is %d&#8221;,b-&gt;info);</p>
<p>while(n-&gt;next)<br />
{     n=n-&gt;next;<br />
}<br />
n-&gt;next = b;<br />
b-&gt;next = NULL;<br />
return start;<br />
}</p>
<p>struct node * insert_nth(struct node *start)                                //insert at nth node<br />
{<br />
int pos,i;<br />
struct node *temp,*new,*b;<br />
new=(struct node *)malloc(sizeof(struct node));<br />
temp = start;<br />
printf(&#8220;enter the position you want to insert at \n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;pos);<br />
for(i=1;i&lt;pos-1;i++)<br />
{     temp    = temp -&gt;next;<br />
}<br />
b=temp-&gt;next;<br />
printf(&#8220;enter the info of node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(new-&gt;info));<br />
temp-&gt;next=new;<br />
new-&gt;next=b;</p>
<p>printf(&#8220;link added successfully\n&#8221;);<br />
return start;<br />
}</p>
<p>struct node * insert_key(struct node *start)                                //insert after key<br />
{<br />
int key;<br />
struct node *new,*temp,*b;<br />
temp=start;<br />
new=(struct node *)malloc(sizeof(struct node));<br />
printf(&#8220;enter the key value \n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;key);<br />
while(key!= (temp-&gt;info))<br />
{    temp=temp-&gt;next;<br />
}<br />
printf(&#8220;enter the info of the node\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;(new-&gt;info));<br />
b=temp-&gt;next;<br />
temp-&gt;next=new;<br />
new-&gt;next=b;<br />
return start;<br />
}</p>
<p>struct node * delete_node(struct node *start)                                //delete node menu<br />
{<br />
int choice;<br />
struct node *temp;</p>
<p>if(flag==0)<br />
printf(&#8220;linked list empty!!!\n&#8221;);<br />
else<br />
{<br />
printf(&#8220;&#8212;&#8212;&#8212;-DELETE MENU&#8212;&#8212;&#8212;&#8211;\n&#8221;);<br />
printf(&#8220;1. Delete from begining\n&#8221;);<br />
printf(&#8220;2. Delete from end\n&#8221;);<br />
printf(&#8220;3. Delete nth node \n&#8221;);<br />
printf(&#8220;4. Delete after key value\n&#8221;);<br />
printf(&#8220;\n\nEnter your choice\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;choice);<br />
switch(choice)<br />
{<br />
case 1 : temp = del_beg(start);<br />
break;<br />
case 2 : temp = del_end(start);<br />
break;<br />
case 3 : temp = del_nth(start);<br />
break;<br />
case 4 : temp = del_key(start);<br />
break;<br />
default : printf(&#8220;\nINVALID&#8221;);<br />
}<br />
return temp;<br />
}<br />
}</p>
<p>struct node *del_beg(struct node *start)                                //delete menu<br />
{<br />
struct node *temp;<br />
temp=start;<br />
int num=0;<br />
while(temp)<br />
{    temp= temp-&gt;next;<br />
num++;<br />
}</p>
<p>if(num==0)<br />
printf(&#8220;nothing to delete\n&#8221;);<br />
else<br />
{    start = start-&gt;next;<br />
return start;<br />
}<br />
}</p>
<p>struct node *del_end(struct node *start)                                //delete from end<br />
{<br />
struct node *temp;<br />
temp = start;<br />
int num=0;<br />
while(temp)<br />
{    temp= temp-&gt;next;<br />
num++;<br />
}<br />
temp=start;<br />
if(num==0)<br />
{    printf(&#8220;\nnothing to delete&#8221;);<br />
}<br />
else<br />
{    while(temp-&gt;next-&gt;next)<br />
{    temp=temp-&gt;next;<br />
}<br />
temp-&gt;next=NULL;<br />
return start;<br />
}<br />
}</p>
<p>struct node * del_nth(struct node *start)                                //delete nth node<br />
{<br />
int pos,i;<br />
struct node *temp,*b;<br />
temp = start;<br />
int num=0;<br />
while(temp)<br />
{    temp= temp-&gt;next;<br />
num++;<br />
}<br />
temp=start;<br />
if(num==0)<br />
printf(&#8220;\nnothing to delete&#8221;);<br />
else<br />
{    printf(&#8220;enter the position\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;pos);<br />
for(i=1;i&lt;pos;i++)<br />
{    temp = temp-&gt;next;<br />
}<br />
b = temp-&gt;next;<br />
temp=start;<br />
for(i=1;i&lt;pos-1;i++)<br />
{    temp = temp-&gt;next;<br />
}<br />
temp-&gt;next=b;<br />
return start;<br />
}<br />
}</p>
<p>struct node * del_key(struct node *start)                                //delete at key value<br />
{<br />
int key,num=0;<br />
struct node *temp,*b;<br />
temp=start;<br />
if(num==0)<br />
printf(&#8220;\nnothing to delete&#8221;);<br />
else<br />
{    printf(&#8220;enter the node to delete\n&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;key);<br />
while(temp-&gt;info != key)<br />
{    temp = temp-&gt;next;<br />
}<br />
if(!temp)<br />
{    printf(&#8220;\nthe entered key not found&#8221;);<br />
return start;<br />
}<br />
b=temp-&gt;next;<br />
temp=start;<br />
while(temp-&gt;next-&gt;info != key)<br />
{    temp=temp-&gt;next;<br />
}<br />
temp-&gt;next=b;<br />
return start;<br />
}</p>
<p>}<br />
struct node * sorting(struct node * start)                                //sorting menu<br />
{<br />
int choice;<br />
struct node *temp;<br />
printf(&#8220;\n&#8212;&#8212;&#8212;&#8212;-SORTING MENU&#8212;&#8212;&#8212;&#8212;&#8211;&#8221;);<br />
printf(&#8220;\n1. sort ascending&#8221;);<br />
printf(&#8220;\n2. sort descending&#8221;);<br />
printf(&#8220;\n\nenter your choice&#8221;);<br />
scanf(&#8220;%d&#8221;,&amp;choice);<br />
switch(choice)<br />
{    case 1 : temp = sort_ascend(start);<br />
break;<br />
case 2 : temp = sort_descend(start);<br />
break;<br />
default : printf(&#8220;\nINVALID&#8221;);<br />
}<br />
return temp;</p>
<p>}</p>
<p>struct node * sort_ascend(struct node *start)                                 //sorting ascending order(bubble sort)<br />
{<br />
int count=0,j,i;<br />
struct node *temp,*b;<br />
b=(struct node *)malloc(sizeof(struct node ));<br />
b-&gt;next=NULL;<br />
temp = start;<br />
while(temp)<br />
{    temp=temp-&gt;next;<br />
count++;<br />
}<br />
temp=start;<br />
printf(&#8220;\nthe no of nodes are %d&#8221;,count);<br />
if(!count)<br />
printf(&#8220;\nThe Link list is empty!!!&#8221;);<br />
else<br />
{<br />
for(j=0;j&lt;count;j++)<br />
{<br />
for(i=0;i&lt;count-j-1;i++)<br />
{    if((temp-&gt;info) &gt; (temp-&gt;next-&gt;info) )<br />
{    b-&gt;info = temp-&gt;info;<br />
temp-&gt;info = temp-&gt;next-&gt;info;<br />
temp-&gt;next-&gt;info = b-&gt;info;<br />
temp=temp-&gt;next;</p>
<p>}<br />
else<br />
temp=temp-&gt;next;<br />
}<br />
temp=start;<br />
}<br />
return start;<br />
}<br />
}</p>
<p>struct node * sort_descend(struct node *start)                                //sorting descending order(bubble sort)<br />
{</p>
<p>int count=0,j,i;<br />
struct node *temp,*b;<br />
b=(struct node *)malloc(sizeof(struct node ));<br />
b-&gt;next=NULL;<br />
temp = start;<br />
while(temp)<br />
{    temp=temp-&gt;next;<br />
count++;<br />
}<br />
temp=start;<br />
printf(&#8220;\nthe no of nodes are %d&#8221;,count);<br />
if(!count)<br />
printf(&#8220;The Link list is empty!!!!&#8221;);<br />
else<br />
{<br />
for(j=0;j&lt;count;j++)<br />
{<br />
for(i=0;i&lt;count-j-1;i++)<br />
{    if((temp-&gt;info) &lt; (temp-&gt;next-&gt;info) )<br />
{    b-&gt;info = temp-&gt;info;<br />
temp-&gt;info = temp-&gt;next-&gt;info;<br />
temp-&gt;next-&gt;info = b-&gt;info;<br />
temp=temp-&gt;next;</p>
<p>}<br />
else<br />
temp=temp-&gt;next;<br />
}<br />
temp=start;<br />
}<br />
return start;<br />
}<br />
}</p>
<p>struct node * destroy(struct node * start)                                //destroy link list<br />
{<br />
start=NULL;<br />
printf(&#8220;\nThe Link List has been Destroyed&#8221;);<br />
return start;</p>
<p>}</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/07/c-assignment-link-list-operations-q1pass-by-value-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
