~ubuntu-branches/ubuntu/warty/xmedcon/warty

« back to all changes in this revision

Viewing changes to source/m-progress.c

  • Committer: Bazaar Package Importer
  • Author(s): Roland Marcus Rutschmann
  • Date: 2004-06-07 09:00:14 UTC
  • Revision ID: james.westby@ubuntu.com-20040607090014-t39n52qc9zjqqqkh
Tags: upstream-0.9.6
ImportĀ upstreamĀ versionĀ 0.9.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
 * filename: m-progress.c                                                  *
 
3
 *                                                                         *
 
4
 * UTIL C-source: Medical Image Conversion Utility                         *
 
5
 *                                                                         *
 
6
 * purpose      : pointer hooks for progress functions                     *
 
7
 *                                                                         *
 
8
 * project      : (X)MedCon by Erik Nolf                                   *
 
9
 *                                                                         *
 
10
 * Functions    : MdcSetProgress()   - Set progress value                  *
 
11
 *                MdcIncrProgress()  - Increment progress value            *
 
12
 *                MdcBeginProgress() - Begin of progress                   *
 
13
 *                MdcEndProgress()   - End   of progress                   *
 
14
 *                                                                         *
 
15
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
16
/* $Id: m-progress.c,v 1.2 2004/05/09 22:48:03 enlf Exp $
 
17
 */
 
18
 
 
19
/*
 
20
   Copyright (C) 1997-2004 by Erik Nolf
 
21
 
 
22
   This program is free software; you can redistribute it and/or modify it
 
23
   under the terms of the GNU General Public License as published by the
 
24
   Free Software Foundation; either version 2, or (at your option) any later
 
25
   version.
 
26
 
 
27
   This program is distributed in the hope that it will be useful, but
 
28
   WITHOUT ANY WARRANTY; without even the implied warranty of
 
29
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
 
30
   Public License for more details.
 
31
 
 
32
   You should have received a copy of the GNU General Public License along
 
33
   with this program; if not, write to the Free Software Foundation, Inc.,
 
34
   59 Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
35
 
 
36
/****************************************************************************
 
37
                              H E A D E R S  
 
38
 ****************************************************************************/
 
39
 
 
40
#include <stdio.h>
 
41
 
 
42
#include "m-defs.h"
 
43
#include "m-error.h"
 
44
#include "m-progress.h"
 
45
 
 
46
 
 
47
/****************************************************************************
 
48
                            F U N C T I O N S 
 
49
 ****************************************************************************/
 
50
 
 
51
int MDC_PROGRESS = MDC_NO;
 
52
 
 
53
static void MdcProgressBar(int type, float value, char *label)
 
54
{
 
55
  switch (type) {
 
56
    case MDC_PROGRESS_BEGIN: if (label != NULL) MdcPrntScrn("\n%35s ",label);
 
57
        break;
 
58
    case MDC_PROGRESS_SET  : MdcPrntScrn(".");
 
59
        break;
 
60
    case MDC_PROGRESS_INCR : MdcPrntScrn(".");
 
61
        break;
 
62
    case MDC_PROGRESS_END  : MdcPrntScrn("\n");
 
63
        break;
 
64
  }
 
65
}
 
66
 
 
67
void (*MdcProgress)(int type, float value, char *label) = MdcProgressBar;
 
68