Sha256: e92fc53ab4aa2124d681ca35edb4b1d3b6be379e0cebd278c7a9429ba990b570

Contents?: true

Size: 827 Bytes

Versions: 98

Compression:

Stored size: 827 Bytes

Contents

/*
 * NSLog() clone, but writes to arbitrary output stream
 */

#import <Foundation/Foundation.h>
#import <stdio.h>

int nsvfprintf (FILE *stream, NSString *format, va_list args) {
    int retval;

    NSString *str = (NSString *) CFStringCreateWithFormatAndArguments(NULL, NULL, (CFStringRef) format, args);
    retval = fprintf(stream, "[DEBUG] %s\n", [str UTF8String]);
    [str release];

    return retval;
}

int nsfprintf (FILE *stream, NSString *format, ...) {
    va_list ap;
    int retval;

    va_start(ap, format);
    {
        retval = nsvfprintf(stream, format, ap);
    } 
    va_end(ap);

    return retval;
}

int nsprintf (NSString *format, ...) {
    va_list ap;
    int retval;

    va_start(ap, format);
    {
        retval = nsvfprintf(stderr, format, ap);
    } 
    va_end(ap);

    return retval;
}

Version data entries

98 entries across 98 versions & 2 rubygems

Version Path
rhodes-7.6.0 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-7.5.1 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-7.4.1 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-7.1.17 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-6.2.0 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-6.0.11 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.18 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.17 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.15 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.0.22 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.2 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.0.7 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.0.3 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-5.5.0 res/build-tools/iphonesim/Source/nsprintf.m
tauplatform-1.0.3 res/build-tools/iphonesim/Source/nsprintf.m
tauplatform-1.0.2 res/build-tools/iphonesim/Source/nsprintf.m
tauplatform-1.0.1 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-3.5.1.12 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-3.3.5 res/build-tools/iphonesim/Source/nsprintf.m
rhodes-3.4.2 res/build-tools/iphonesim/Source/nsprintf.m