-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sortline.h
140 lines (115 loc) · 5.2 KB
/
Sortline.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#ifndef SORTLINE_H_INCLUDED
#define SORTLINE_H_INCLUDED
#include <stdio.h>
#include <wchar.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <stddef.h>
#include <stdlib.h>
#include <wchar.h>
const int LIM_SIZE = 500;
const int BRED_SIZE = 1000; //кол-во четверостиший.
const int TRUE = 1;
const int FALSE = 0;
struct line_t //структура строки( содержит саму строку и ее длину).
{
wchar_t *line;
long length;
};
//-----------------------------------------------------------------------------
//! @brief Line Processing
//! @param [in] onegin - source file for processing
//! @param [in] res - the file where the processing result will be written
//! @param [in] mode - mode of how to process the data
//! @param [in] isbred - mode for delusional generation
//! @author Hollbrok
//! @version 1.3.0
//! @brief
//-----------------------------------------------------------------------------
void LineProcessing(FILE *onegin, FILE *res, char *mode, char* isbred);
//-----------------------------------------------------------------------------
//! @brief Full Sorting strings
//! @param [in] lines - pointer to an array of string structures
//! @param [in] n - number of string structures
//! @param [in] mode - mode of how to process the data
//! @author Hollbrok
//! @version 2.2.1
//! @brief
//-----------------------------------------------------------------------------
void Sorting(line_t *lines, long n, char *mode);
//-----------------------------------------------------------------------------
//! @brief Sorting lines
//! @param [in] lines - pointer to an array of string structures
//! @param [in] n - number of the lines
//! @param [in] mode - mode of how to process the data
//! @author Hollbrok
//! @version 0.1.1
//! @param
//-----------------------------------------------------------------------------
void Insertion(line_t *lines, long n, char *mode);
//-----------------------------------------------------------------------------
//! @brief Swaps two string structures
//! @param [in] lines - pointer to an array of string structures
//! @param [in] l - first line number
//! @param [in] r - second line number
//! @author Hollbrok
//! @version 0.2.7
//! @param
//-----------------------------------------------------------------------------
void Switcher(line_t *lines, long l, long r);//меняет строки местами.
//-----------------------------------------------------------------------------
//! @brief Generates random text based on rhymes
//! @param [in] lines - pointer to an array of string structures
//! @param [in] bred_ind - id whether it is necessary to make a delusional generator
//! @param [in] n - number of string structures
//! @author Hollbrok
//! @version 4.1.1
//! @param
//-----------------------------------------------------------------------------
void Bred_Gen(line_t *lines, char *bred_ind, long n);//бредогенератор.
//-----------------------------------------------------------------------------
//! @brief Decrease comparator
//! @param [in] lines - pointer to an array of string structures
//! @param [in] a - first line number to swap
//! @param [in] b - second line number to swap
//! @author Hollbrok
//! @version 2.2.8
//! @param
//-----------------------------------------------------------------------------
int strcomp_decrease(line_t *lines, long a, long b);//по убыванию.
//-----------------------------------------------------------------------------
//! @brief From the end decrease comparator
//! @param [in] lines - pointer to an array of string structures
//! @param [in] a - first line number to swap
//! @param [in] b - second line number to swap
//! @author Hollbrok
//! @version 2.2.8
//! @param
//-----------------------------------------------------------------------------
int strcomp_decrease_end(line_t *lines, long a, long b);//по убыванию c конца строки.
//-----------------------------------------------------------------------------
//! @brief Increase comparator
//! @param [in] lines - pointer to an array of string structures
//! @param [in] a - first line number to swap
//! @param [in] b - second line number to swap
//! @author Hollbrok
//! @version 2.2.8
//! @param
//-----------------------------------------------------------------------------
int strcomp_increase(line_t *lines, long a, long b);//по возрастанию.
//-----------------------------------------------------------------------------
//! @brief From the end increase comparator
//! @param [in] lines - pointer to an array of string structures
//! @param [in] a - first line number to swap
//! @param [in] b - second line number to swap
//! @author Hollbrok
//! @version 2.2.8
//! @param
//-----------------------------------------------------------------------------
int strcomp_increase_end(line_t *lines, long a, long b);//по возрастанию с конца строки.
#endif // SORTLINE_H_INCLUDED