~ubuntu-branches/ubuntu/intrepid/ruby1.9/intrepid-updates

« back to all changes in this revision

Viewing changes to ext/iconv/iconv.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-09-04 16:01:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070904160117-i15zckg2nhxe9fyw
Tags: 1.9.0+20070830-2ubuntu1
* Sync from Debian; remaining changes:
  - Add -g to CFLAGS.
* Fixes build failure on ia64.
* Fixes build failure with gcc-4.2 on lpia.
* Robustify check for target_os, fixing build failure on lpia.
* Set Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
  iconv.c -
5
5
 
6
 
  $Author: usa $
7
 
  $Date: 2007-05-10 15:20:33 +0900 (木, 10  5月 2007) $
 
6
  $Author: akr $
 
7
  $Date: 2007-08-30 08:12:21 +0900 (木, 30  8月 2007) $
8
8
  created at: Wed Dec  1 20:28:09 JST 1999
9
9
 
10
10
  All the files in this distribution are covered under the Ruby's
14
14
 
15
15
**********************************************************************/
16
16
 
17
 
#include "ruby.h"
 
17
#include "ruby/ruby.h"
18
18
#include <errno.h>
19
19
#include <iconv.h>
20
20
#include <assert.h>
21
 
#include "st.h"
22
 
#include "intern.h"
 
21
#include "ruby/st.h"
 
22
#include "ruby/intern.h"
23
23
 
24
24
/*
25
25
 * Document-class: Iconv
138
138
{
139
139
    VALUE val = *code;
140
140
 
141
 
    if (RHASH(charset_map)->tbl && RHASH(charset_map)->tbl->num_entries) {
 
141
    if (RHASH_SIZE(charset_map)) {
142
142
        VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0);
143
143
        StringValuePtr(key);
144
 
        if (st_lookup(RHASH(charset_map)->tbl, key, &val)) {
 
144
        if (st_lookup(RHASH_TBL(charset_map), key, &val)) {
145
145
            *code = val;
146
146
        }
147
147
    }