Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/lib/librecsort/rsclose.c
1808 views
1
/***********************************************************************
2
* *
3
* This software is part of the ast package *
4
* Copyright (c) 1996-2011 AT&T Intellectual Property *
5
* and is licensed under the *
6
* Eclipse Public License, Version 1.0 *
7
* by AT&T Intellectual Property *
8
* *
9
* A copy of the License is available at *
10
* http://www.eclipse.org/org/documents/epl-v10.html *
11
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
12
* *
13
* Information and Software Systems Research *
14
* AT&T Research *
15
* Florham Park NJ *
16
* *
17
* Phong Vo <[email protected]> *
18
* Glenn Fowler <[email protected]> *
19
* *
20
***********************************************************************/
21
#include "rshdr.h"
22
23
/* Close a sorting context
24
**
25
** Written by Kiem-Phong Vo (07/18/96)
26
*/
27
28
#if __STD_C
29
int rsclose(Rs_t* rs)
30
#else
31
int rsclose(rs)
32
Rs_t* rs;
33
#endif
34
{
35
reg int rv;
36
37
while (rsdisc(rs, NIL(Rsdisc_t*), RS_POP));
38
if ((rv = RSNOTIFY(rs,RS_CLOSE,0,0,rs->disc)) < 0)
39
return rv;
40
41
if(rs->vm)
42
vmclose(rs->vm);
43
if(rs->methdata)
44
vmfree(Vmheap,rs->methdata);
45
vmfree(Vmheap,rs);
46
47
return 0;
48
}
49
50