-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscrolling.cpp
34 lines (31 loc) · 1.08 KB
/
scrolling.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/************************************************************************
** RollNo:2018201033 Name : Darshan Kansagara **
************************************************************************/
//**********************************************************************
// Header file Included
//**********************************************************************
#include "myheader.h"
//**********************************************************************
// Global declaration
//**********************************************************************
unsigned int rowsize, colsize;
//**********************************************************************
// Method returns count of maximun num of file to be printed on terminal
//**********************************************************************
int getFilePrintingcount()
{
int lenRecord;
struct winsize win;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &win);
rowsize = win.ws_row - 1;
colsize = win.ws_col;
if (totalFiles <= rowsize)
{
lenRecord = totalFiles;
}
else
{
lenRecord = rowsize;
}
return lenRecord;
}