mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
* Utilize documentation rules in Makefile Package.
* doc/GNUmakefile: Rewrite to use Makefile Package. * doc/Makefile.postamble: Remove old obsolete rules. * Documentation which covers GNUstep as a whole versus just gstep-base has been moved to the top level Documentation dir. * GNUstep-HOWTO: Delete. * doc/gnustep-base.tmpl.texi: GNUstep-HOWTO and FAQ removed. Add variable so that included files know they are within the main document. * doc/gnustep-howto.tmpl.texi: Delete. * doc/faq.tmpl.texi: Delete. * doc/announce.tmpl.texi: Don't include version.texi needlessly. * doc/news.tmpl.texi: Don't include version.texi needlessly. * doc/todo.tmpl.texi: Don't include version.texi needlessly. * src/GNUmakefile: Don't compile Random class as the name too often conflicts with user apps. * src/GetDefEncoding.m: Reformat. * src/NSArray.m (-replaceObjectsInRange:withObjectsFromArray:): Fix range check. Use enumerator instead of count. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2783 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d25ca368b1
commit
8a67770732
13 changed files with 141 additions and 2202 deletions
|
@ -62,61 +62,61 @@ NSStringEncoding GetDefEncoding()
|
|||
availableEncodings = [NSString availableStringEncodings];
|
||||
|
||||
encoding = getenv("GNUSTEP_STRING_ENCODING");
|
||||
if(encoding)
|
||||
{
|
||||
count=0;
|
||||
while((count<str_encoding_table_size)&
|
||||
strcmp(str_encoding_table[count].ename,encoding))
|
||||
if (encoding)
|
||||
{
|
||||
count++;
|
||||
count = 0;
|
||||
while ((count < str_encoding_table_size) &
|
||||
strcmp(str_encoding_table[count].ename,encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if( !(count == str_encoding_table_size) )
|
||||
{
|
||||
ret = str_encoding_table[count].enc;
|
||||
if ((ret == NSUnicodeStringEncoding) ||
|
||||
(ret == NSSymbolStringEncoding))
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported as default c string encoding.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
else /*encoding should be supported but is it implemented?*/
|
||||
{
|
||||
count = 0;
|
||||
tmp = 0;
|
||||
while ( !(availableEncodings[count] == 0) )
|
||||
{
|
||||
if ( !(ret == availableEncodings[count]) )
|
||||
tmp = 0;
|
||||
else
|
||||
{
|
||||
tmp = ret;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
};
|
||||
if (!tmp)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not yet implemented.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
};
|
||||
};
|
||||
}
|
||||
else /* encoding not found */
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
}
|
||||
if(!(count==str_encoding_table_size))
|
||||
{
|
||||
ret= str_encoding_table[count].enc;
|
||||
if((ret==NSUnicodeStringEncoding) ||
|
||||
(ret==NSSymbolStringEncoding))
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported as default c string encoding.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
else /*encoding should be supported but is it implemented?*/
|
||||
{
|
||||
count=0;
|
||||
tmp=0;
|
||||
while(!(availableEncodings[count]==0))
|
||||
{
|
||||
if(!(ret==availableEncodings[count]))
|
||||
tmp=0;
|
||||
else
|
||||
{
|
||||
tmp=ret;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
};
|
||||
if(!tmp)
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not yet implemented.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
};
|
||||
};
|
||||
}
|
||||
else /* encoding not found */
|
||||
{
|
||||
fprintf(stderr, "WARNING: %s - encoding not supported.\n", encoding);
|
||||
fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
}
|
||||
else /* envirinment var not found */
|
||||
{
|
||||
/* This shouldn't be required. It really should be in UserDefaults - asf */
|
||||
//fprintf(stderr,"WARNING: GNUSTEP_STRING_ENCODING environment variable not found\n");
|
||||
//fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret=NSASCIIStringEncoding;
|
||||
}
|
||||
{
|
||||
/* This shouldn't be required. It really should be in UserDefaults - asf */
|
||||
//fprintf(stderr,"WARNING: GNUSTEP_STRING_ENCODING environment variable not found\n");
|
||||
//fprintf(stderr, "NSASCIIStringEncoding set as default.\n");
|
||||
ret = NSASCIIStringEncoding;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
@ -124,14 +124,15 @@ NSString*
|
|||
GetEncodingName(NSStringEncoding encoding)
|
||||
{
|
||||
char* ret;
|
||||
unsigned int count=0;
|
||||
while((count<str_encoding_table_size)&
|
||||
unsigned int count=0;
|
||||
while ((count < str_encoding_table_size) &
|
||||
!(str_encoding_table[count].enc == encoding))
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if(!(count==str_encoding_table_size))
|
||||
ret= str_encoding_table[count].ename;
|
||||
else ret="Unknown encoding";
|
||||
{
|
||||
count++;
|
||||
}
|
||||
if ( !(count == str_encoding_table_size) )
|
||||
ret = str_encoding_table[count].ename;
|
||||
else
|
||||
ret = "Unknown encoding";
|
||||
return [NSString stringWithCString:ret];
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue