~ubuntu-branches/ubuntu/hardy/uim/hardy

« back to all changes in this revision

Viewing changes to emacs/candidate.c

  • Committer: Bazaar Package Importer
  • Author(s): Steinar H. Gunderson
  • Date: 2006-07-06 22:17:24 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060706221724-6sobw1fcsxj647hp
Tags: 1:1.1.0-1.2
* Non-maintainer upload.
* Added -Wno-cast-align to CFLAGS, as per the RM's recommendations:

  < vorlon> Sesse: -Wno-cast-align and to hell with it :P

  Really fixes FTBFS. (Really Closes: #375081)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
  Copyright (c) 2005 uim Project http://uim.freedesktop.org/
 
2
  Copyright (c) 2005-2006 uim Project http://uim.freedesktop.org/
3
3
 
4
4
  All rights reserved.
5
5
 
36
36
 
37
37
#include "candidate.h"
38
38
 
 
39
candidate_info *
 
40
create_candidate()
 
41
{
 
42
  candidate_info *cand;
 
43
 
 
44
  cand = (candidate_info *)malloc(sizeof(candidate_info));
 
45
  cand->valid = 0;
 
46
 
 
47
  return cand;
 
48
}
 
49
 
39
50
int
40
51
new_candidate(uim_context context, candidate_info *cand, int num, int limit)
41
52
{
44
55
 
45
56
  if (cand->valid) clear_candidate(cand);
46
57
 
47
 
 
48
58
  cand->valid = 1;
49
59
 
50
60
  cand->index = 0; 
65
75
}
66
76
 
67
77
 
68
 
void
 
78
int
69
79
show_candidate(candidate_info *cand)
70
80
{
71
81
  int i;
72
82
  int page;
73
83
  int index;
74
84
 
75
 
  if (!cand->valid || cand->num == 0) return;
 
85
  if (cand->num == 0) {
 
86
        a_printf("( e )");
 
87
        return 0;
 
88
  }
76
89
 
77
90
  index = cand->index;
78
91
  page = index / cand->disp_limit;
102
115
  }
103
116
 
104
117
  a_printf(") ");
 
118
 
 
119
  return 1;
105
120
}
106
121
 
107
122