~ubuntu-branches/ubuntu/dapper/gnustep-base/dapper

« back to all changes in this revision

Viewing changes to Source/Additions/GSCategories.m

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Berg, Hubert Chan, Christoph Berg
  • Date: 2005-12-29 18:14:22 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051229181422-abmd8d53tpyxrum2
Tags: 1.11.2-1
[ Hubert Chan ]
* New upstream release.

[ Christoph Berg ]
* Point gdomap symlink to /usr/sbin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
   You should have received a copy of the GNU Library General Public
20
20
   License along with this library; if not, write to the Free
21
 
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
 
21
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
22
22
 
23
23
*/
24
24
#include "config.h"
41
41
 * is on or after the first of january.<br />
42
42
 * This has the effect that, if january first is a friday, saturday or
43
43
 * sunday, the days of that week (up to and including the sunday) are
44
 
 * considered to be in week 53 of the preceeding year. Similarly if the
 
44
 * considered to be in week 53 of the preceding year. Similarly if the
45
45
 * last day of the year is a monday tuesday or wednesday, these days are
46
46
 * part of week 1 of the next year.
47
47
 */
147
147
 * a hexadecimal coding of the bytes.  The parsing of the string is
148
148
 * fairly tolerant, ignoring whitespace and permitting both upper and
149
149
 * lower case hexadecimal digits (the -hexadecimalRepresentation method
150
 
 * produces a string using only uppercase digits with no white spaqce).<br />
 
150
 * produces a string using only uppercase digits with no white space).<br />
151
151
 * If the string does not contain one or more pairs of hexadecimal digits
152
152
 * then an exception is raised.
153
153
 */
609
609
                  lineLength -= 3;
610
610
                }
611
611
            }
612
 
          else if (pos > 6 && strncmp(bytes, "begin ", 6) == 0)
 
612
          else if (pos > 6 && strncmp((const char*)bytes, "begin ", 6) == 0)
613
613
            {
614
614
              unsigned  off = 6;
615
615
              unsigned  end = pos;
678
678
  /*
679
679
   * The header is a line of the form 'begin mode filename'
680
680
   */
681
 
  sprintf(buf, "begin %03o ", mode);
682
 
  [encoded appendBytes: buf length: strlen(buf)];
 
681
  sprintf((char*)buf, "begin %03o ", mode);
 
682
  [encoded appendBytes: buf length: strlen((const char*)buf)];
683
683
  [encoded appendData: [name dataUsingEncoding: NSASCIIStringEncoding]];
684
684
  [encoded appendBytes: "\n" length: 1];
685
685
 
752
752
  /*
753
753
   * Encode a line of length zero followed by 'end' as the terminator.
754
754
   */
755
 
  [encoded appendBytes: "`\n" length: 4];
756
 
  [encoded appendBytes: "end\n" length: 4];
 
755
  [encoded appendBytes: "`\nend\n" length: 6];
757
756
  return YES;
758
757
}
759
758
@end
824
823
 * WARNING: The -compare: method for NSObject is deprecated
825
824
 *          due to subclasses declaring the same selector with
826
825
 *          conflicting signatures.
827
 
 *          Comparision of arbitrary objects is not just meaningless
 
826
 *          Comparison of arbitrary objects is not just meaningless
828
827
 *          but also dangerous as most concrete implementations
829
828
 *          expect comparable objects as arguments often accessing
830
829
 *          instance variables directly.
1003
1002
}
1004
1003
 
1005
1004
/**
1006
 
 * Returns a string in which any (and all) occurrances of
 
1005
 * Returns a string in which any (and all) occurrences of
1007
1006
 * replace in the receiver have been replaced with by.
1008
1007
 * Returns the receiver if replace
1009
1008
 * does not occur within the receiver.  NB. an empty string is
1059
1058
}
1060
1059
 
1061
1060
/**
1062
 
 * Replaces all occurrances of the string replace with the string by
 
1061
 * Replaces all occurrences of the string replace with the string by
1063
1062
 * in the receiver.<br />
1064
1063
 * Has no effect if replace does not occur within the
1065
1064
 * receiver.  NB. an empty string is not considered to exist within
1067
1066
 * Calls - replaceOccurrencesOfString:withString:options:range: passing
1068
1067
 * zero for the options and a range from 0 with the length of the receiver.
1069
1068
 *
1070
 
 * Note that is has to work for [tmp replaceString:@"&" withString:@"&amp;"];
 
1069
 * Note that is has to work for
 
1070
 * [tmp replaceString: @"&amp;" withString: @"&amp;amp;"];
1071
1071
 */
1072
1072
- (void) replaceString: (NSString*)replace
1073
1073
            withString: (NSString*)by