~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to general/g.mapsets/get_maps.c

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include <stdio.h>
 
2
#include <stdlib.h>
 
3
#include <string.h>
2
4
#include <grass/gis.h>
3
5
#include "local_proto.h"
4
6
 
 
7
static int cmp(const void *, const void *);
 
8
 
5
9
int get_available_mapsets(void)
6
10
{
7
11
    char **ms;
14
18
    for(i = 0; i < nmapsets; i++)
15
19
        mapset_name[i] = G_store(ms[i]);
16
20
 
 
21
    /* sort mapsets */
 
22
    qsort(mapset_name, nmapsets, sizeof(char *), cmp);
 
23
 
17
24
    return 0;
18
25
}
 
26
 
 
27
static int cmp(const void *a, const void *b) 
 
28
{
 
29
    return (strcmp(*(char **)a, *(char **)b));
 
30
}