#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
◆ MAXLEN
◆ MAXRECORDS
#define MAXRECORDS 65536 /* maximum number of records that can be sorted */ |
◆ cmpr()
Definition at line 28 of file sort.c.
29{
31
34
36 {
38 {
40 }
41 else
42 {
44 }
46 {
48 }
49 else
50 {
52 }
53 }
54
56 {
58 }
59 else
60 {
62 }
63}
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
Referenced by main().
◆ main()
Definition at line 86 of file sort.c.
87{
90
91
94
98 {
99 if (*(
cp = *++
argv) ==
'/')
100 {
102 {
103 case 'R':
104 case 'r':
106 break;
107
108 case '?':
109 case 'h':
110 case 'H':
112 break;
113
114 case '+':
117 {
119 }
120 break;
121
122 default:
124 }
125 }
126 }
127
129 {
132 }
133
136 {
139 }
140
142 {
144 {
145 break;
146 }
147
149 {
151 }
152
155 {
157
158
159 for (
i = 0;
i <
nr;
i++)
160 {
162 }
165 }
166
168 }
169
171 {
172 fputs(
"SORT: number of records exceeds maximum\n",
stderr);
173
174
175 for (
i = 0;
i <
nr;
i++)
176 {
178 }
180
181
183 }
184
186
187 for (
i = 0;
i <
nr;
i++)
188 {
191 }
192
193
194 for (
i = 0;
i <
nr;
i++)
195 {
197 }
199 return 0;
200}
int cmpr(const void *a, const void *b)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
◆ usage()
Definition at line 65 of file sort.c.
66{
68 fputs(
"Sorts input and writes output to a file, console or a device.\n",
70
72 {
74 }
75
76 fputs(
" SORT [options] < [drive:1][path1]file1 > [drive2:][path2]file2\n",
78
79 fputs(
" Command | SORT [options] > [drive:][path]file\n",
stderr);
82 fputs(
" /+n Start sorting with column n\n",
stderr);
84}
Referenced by main().
◆ err
◆ help
◆ rev
◆ sortcol