Click here to Skip to main content
12,350,831 members (41,655 online)
Click here to Skip to main content

Stats

28.9K views
396 downloads
21 bookmarked
Posted

Multidevice ASIO output plugin for WinAMP

, 13 Feb 2009 CDDL
A tiny WinAMP output DLL that uses a C++ replacement of the official ASIO SDK that supports multiple ASIO devices.
// sprintf.cpp

// based on:
// LIBCTINY - Matt Pietrek 2001
// MSDN Magazine, January 2001

// 08/12/06 (mv)

#include <windows.h>
#include <stdio.h>
#include "libct.h"

#include <cassert>

#define EOF     (-1)

// Force the linker to include USER32.LIB
#pragma comment(linker, "/defaultlib:user32.lib")

EXTERN_C int sprintf(char *buffer, const char *format, ...)
{
    int retValue;
    va_list argptr;
          
    va_start(argptr, format);
    retValue = ::wvsprintfA(buffer, format, argptr);
    va_end(argptr);

    return retValue;
}

EXTERN_C int _snprintf(char *dest, size_t n, const char *fmt, ...)
{
    assert( ( n < 1024 ) && "wvsprintf() supports an output buffer with a maximum of 1024 bytes." ); n;

	va_list args;
	va_start(args, fmt);
	int retValue = ::wvsprintfA(dest, fmt, args);
	va_end(args);
	return retValue;
}

EXTERN_C int _snwprintf(wchar_t *dest, size_t n, const wchar_t *fmt, ...)
{
    assert( ( n < 1024 ) && "wvsprintf() supports an output buffer with a maximum of 1024 bytes." ); n;

    va_list args;
    va_start(args, fmt);
    int retValue = ::wvsprintfW(dest, fmt, args);
    va_end(args);
    return retValue;
}

EXTERN_C int vsnprintf(char *dest, size_t n, const char *fmt, va_list args)
{
	assert( ( n < 1024 ) && "wvsprintf() supports an output buffer with a maximum of 1024 bytes." ); n;
	return ::wvsprintfA(dest, fmt, args);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Common Development and Distribution License (CDDL)

Share

About the Author

Domagoj Šarić
Software Developer Little Endian Ltd.
Croatia Croatia
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160621.1 | Last Updated 13 Feb 2009
Article Copyright 2009 by Domagoj Šarić
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid