Ignore:
Timestamp:
Jun 2, 2006, 5:07:25 PM (16 years ago)
Author:
Eugene Romanenko
Message:

added licence block to source files

Location:
trunk/Lucide/SOURCE/plugins/ludoc
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/plugins/ludoc/cpconv.cpp

    r2 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135#include <os2.h>
    236
     
    142176    size_t    retval = 0;
    143177
    144   /* The caller wish to initate the conversion state and/or write initial
    145      shift prefix (or something like that) to the output buffer. */
    146   if (!in || !*in)
    147     {
    148       if (!out || !*out || !out_left || !*out_left)
    149         /* do nothing since we don't have any shift state in the iconv_t. */
     178    if (!in || !*in) {
    150179        return 0;
    151 
    152       /** @todo We don't have any shift state I or so, so what to do now?
    153        *        Let's do nothing till we have anyone complaining about his DBCS
    154        *        stuff not working 100%, and accept patches for that guy.
    155        *        Perhaps try call UniUconvFromUcs(conv->to, and some empty input buffer or so...
    156        */
    157       return 0;
    158     }
    159 
    160   sl =  *in_left;
    161   ucs = (UniChar *) alloca (sl * sizeof (UniChar));
    162   orig_ucs = ucs;
    163 
    164   rc = UniUconvToUcs (objtoucs, (void **)in, in_left, &ucs, &sl, &retval);
    165   if (rc)
    166     goto error;
    167   sl = ucs - orig_ucs;
    168   ucs = orig_ucs;
    169   /* UniUconvFromUcs will stop at first null byte (huh? indeed?)
    170      while we want ALL the bytes converted.  */
    171 #if 1
    172   rc = UniUconvFromUcs (objfromucs, &ucs, &sl, (void **)out, out_left, &nonid);
    173   if (rc)
    174     goto error;
    175   retval += nonid;
    176 #else
    177   while (sl)
    178     {
    179       size_t usl = 0;
    180       while (sl && (ucs[usl] != 0))
    181         usl++, sl--;
    182       rc = UniUconvFromUcs (objfromucs, &ucs, &usl, (void **)out, out_left, &nonid);
    183       if (rc)
     180    }
     181
     182    sl =  *in_left;
     183    ucs = (UniChar *) alloca(sl * sizeof(UniChar));
     184    orig_ucs = ucs;
     185
     186    rc = UniUconvToUcs(objtoucs, (void **)in, in_left, &ucs, &sl, &retval);
     187    if (rc) {
    184188        goto error;
    185       retval += nonid;
    186       if (sl && *out_left)
    187         {
    188           *(*out)++ = 0;
    189           (*out_left)--;
    190           ucs++; sl--;
    191         }
    192     }
    193 #endif
    194   return 0;
     189    }
     190    sl = ucs - orig_ucs;
     191    ucs = orig_ucs;
     192    rc = UniUconvFromUcs(objfromucs, &ucs, &sl, (void **)out, out_left, &nonid);
     193    if (rc) {
     194        goto error;
     195    }
     196    retval += nonid;
     197    return 0;
    195198
    196199error:
    197200    err = 1;
    198   return -1;
     201    return -1;
    199202}
    200203
     
    245248        *uni++;
    246249    }
    247 //printf( "\n" );   
     250//printf( "\n" );
    248251}
    249252
     
    307310/*void main()
    308311{
    309         const char *testutf8 = "test UTF-8  ’¥áâ! à®¢¥àª !";
    310         char buf[ 100 ];
    311         memset( buf, 0, sizeof( buf ) );
    312         char *bufsav = buf;
    313         char *buf1 = buf;
    314         unsigned in_len = strlen( testutf8 );
    315         unsigned out_len = sizeof( buf );
    316        
    317         cnvUTF8ToUCS4( &testutf8, &in_len, &buf1, &out_len );
    318        
    319         for ( int i = 0; i<100; i++ )
    320         {
    321                 printf( ":%d:", (int)bufsav[i] );
    322         }
    323         printf( "\n" );
     312    const char *testutf8 = "test UTF-8  ’¥áâ! à®¢¥àª !";
     313    char buf[ 100 ];
     314    memset( buf, 0, sizeof( buf ) );
     315    char *bufsav = buf;
     316    char *buf1 = buf;
     317    unsigned in_len = strlen( testutf8 );
     318    unsigned out_len = sizeof( buf );
     319   
     320    cnvUTF8ToUCS4( &testutf8, &in_len, &buf1, &out_len );
     321   
     322    for ( int i = 0; i<100; i++ )
     323    {
     324        printf( ":%d:", (int)bufsav[i] );
     325    }
     326    printf( "\n" );
    324327}
    325328*/
  • trunk/Lucide/SOURCE/plugins/ludoc/cpconv.h

    r2 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135#ifndef __cpconv_h
    236#define __cpconv_h
  • trunk/Lucide/SOURCE/plugins/ludoc/ludoc.cpp

    r27 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135
    236/*
  • trunk/Lucide/SOURCE/plugins/ludoc/luinode.cpp

    r2 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135
    236/*
  • trunk/Lucide/SOURCE/plugins/ludoc/lupixbuf.cpp

    r27 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135
    236/*
  • trunk/Lucide/SOURCE/plugins/ludoc/lutypes.h

    r2 r35  
     1/* ***** BEGIN LICENSE BLOCK *****
     2 * Version: CDDL 1.0/LGPL 2.1
     3 *
     4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
     5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
     6 * this file except in compliance with the License. You may obtain a copy of
     7 * the License at http://www.sun.com/cddl/
     8 *
     9 * Software distributed under the License is distributed on an "AS IS" basis,
     10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
     11 * for the specific language governing rights and limitations under the
     12 * License.
     13 *
     14 * The Initial Developer of the Original Code is
     15 * Eugene Romanenko, netlabs.org.
     16 * Portions created by the Initial Developer are Copyright (C) 2006
     17 * the Initial Developer. All Rights Reserved.
     18 *
     19 * Contributor(s):
     20 *
     21 * Alternatively, the contents of this file may be used under the terms of
     22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
     23 * in which case the provisions of the LGPL are applicable instead of those
     24 * above. If you wish to allow use of your version of this file only under the
     25 * terms of the LGPL, and not to allow others to use your version of this file
     26 * under the terms of the CDDL, indicate your decision by deleting the
     27 * provisions above and replace them with the notice and other provisions
     28 * required by the LGPL. If you do not delete the provisions above, a recipient
     29 * may use your version of this file under the terms of any one of the CDDL
     30 * or the LGPL.
     31 *
     32 * ***** END LICENSE BLOCK ***** */
     33
     34
    135#ifndef lutypes_h
    236#define lutypes_h
Note: See TracChangeset for help on using the changeset viewer.