projects
/
routino
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.5
[routino]
/
src
/
sorting.c
diff --git
a/src/sorting.c
b/src/sorting.c
index
54bfdf0
..
396d363
100644
(file)
--- a/
src/sorting.c
+++ b/
src/sorting.c
@@
-1,11
+1,11
@@
/***************************************
/***************************************
- $Header: /home/amb/routino/src/RCS/sorting.c,v 1.8 2010/04/09 15:15:02 amb Exp $
+ $Header: /home/amb/routino/src/RCS/sorting.c,v 1.11 2010/09/25 13:54:18 amb Exp $
Merge sort functions.
Part of the Routino routing software.
******************/ /******************
Merge sort functions.
Part of the Routino routing software.
******************/ /******************
- This file Copyright 2009 Andrew M. Bishop
+ This file Copyright 2009-2010 Andrew M. Bishop
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@
-27,6
+27,7
@@
#include <string.h>
#include <assert.h>
#include <string.h>
#include <assert.h>
+#include "files.h"
#include "functions.h"
#include "functions.h"
@@
-107,7
+108,7
@@
void filesort_fixed(int fd_in,int fd_out,size_t itemsize,int (*compare)(const vo
/* Sort the data pointers using a heap sort */
/* Sort the data pointers using a heap sort */
- heapsort(datap,n,compare);
+ filesort_heapsort(datap,n,compare);
/* Shortcut if all read in and sorted at once */
/* Shortcut if all read in and sorted at once */
@@
-129,7
+130,7
@@
void filesort_fixed(int fd_in,int fd_out,size_t itemsize,int (*compare)(const vo
sprintf(filename,"%s/filesort.%d.tmp",option_tmpdirname,nfiles);
sprintf(filename,"%s/filesort.%d.tmp",option_tmpdirname,nfiles);
- fd=OpenFile(filename);
+ fd=OpenFileNew(filename);
for(i=0;i<n;i++)
WriteFile(fd,datap[i],itemsize);
for(i=0;i<n;i++)
WriteFile(fd,datap[i],itemsize);
@@
-374,7
+375,7
@@
void filesort_vary(int fd_in,int fd_out,int (*compare)(const void*,const void*),
/* Sort the data pointers using a heap sort */
/* Sort the data pointers using a heap sort */
- heapsort(datap,n,compare);
+ filesort_heapsort(datap,n,compare);
/* Shortcut if all read in and sorted at once */
/* Shortcut if all read in and sorted at once */
@@
-398,7
+399,7
@@
void filesort_vary(int fd_in,int fd_out,int (*compare)(const void*,const void*),
sprintf(filename,"%s/filesort.%d.tmp",option_tmpdirname,nfiles);
sprintf(filename,"%s/filesort.%d.tmp",option_tmpdirname,nfiles);
- fd=OpenFile(filename);
+ fd=OpenFileNew(filename);
for(i=0;i<n;i++)
{
for(i=0;i<n;i++)
{
@@
-574,7
+575,7
@@
void filesort_vary(int fd_in,int fd_out,int (*compare)(const void*,const void*),
data to be sorted was an array of things not pointers).
++++++++++++++++++++++++++++++++++++++*/
data to be sorted was an array of things not pointers).
++++++++++++++++++++++++++++++++++++++*/
-void heapsort(void **datap,size_t nitems,int(*compare)(const void*, const void*))
+void filesort_heapsort(void **datap,size_t nitems,int(*compare)(const void*, const void*))
{
int i;
{
int i;