diff options
Diffstat (limited to 'sal/systools')
-rw-r--r-- | sal/systools/win32/uwinapi/legacy.c | 35 | ||||
-rw-r--r-- | sal/systools/win32/uwinapi/snprintf.c | 31 | ||||
-rw-r--r-- | sal/systools/win32/uwinapi/sntprintf.c | 120 | ||||
-rw-r--r-- | sal/systools/win32/uwinapi/snwprintf.c | 26 | ||||
-rw-r--r-- | sal/systools/win32/uwinapi/uwinapi.def | 8 |
5 files changed, 0 insertions, 220 deletions
diff --git a/sal/systools/win32/uwinapi/legacy.c b/sal/systools/win32/uwinapi/legacy.c deleted file mode 100644 index e88c7524ed22..000000000000 --- a/sal/systools/win32/uwinapi/legacy.c +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#define WIN32_LEAN_AND_MEAN -#include <windows.h> - -#ifdef _MSC_VER -#pragma warning(disable:4273) // inconsistent dll linkage -#endif - -#if (defined(_MSC_VER) && (_MSC_VER >= 1900)) || defined __clang__ -// older versions use uwinapi.def file for export -__declspec(dllexport) -#endif -DWORD WINAPI GetShortPathNameW(LPCWSTR lpszLongPath,LPWSTR lpszShortPath,DWORD cchBuffer) -{ - typedef DWORD (WINAPI * GetShortPathNameW_t) (LPCWSTR,LPWSTR,DWORD); - - GetShortPathNameW_t p_GetShortPathNameW = - (GetShortPathNameW_t) GetProcAddress ( - GetModuleHandle ("kernel32.dll"), "GetShortPathNameW"); - - if (p_GetShortPathNameW) - return p_GetShortPathNameW(lpszLongPath,lpszShortPath,cchBuffer); - else - return 0; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/systools/win32/uwinapi/snprintf.c b/sal/systools/win32/uwinapi/snprintf.c deleted file mode 100644 index de927644404e..000000000000 --- a/sal/systools/win32/uwinapi/snprintf.c +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -/* Not unicode */ -#undef _UNICODE - -/* Support MBCS and SBCS */ - -#ifndef _MBCS -#define _MBCS -#endif - -#include "sntprintf.c" - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/systools/win32/uwinapi/sntprintf.c b/sal/systools/win32/uwinapi/sntprintf.c deleted file mode 100644 index 22ce4f7d3050..000000000000 --- a/sal/systools/win32/uwinapi/sntprintf.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#define LO_SNPRINTF_DLLIMPORT __declspec( dllexport ) - -#include <stdarg.h> -#include <stdio.h> - -#include <tchar.h> -#include <systools/win32/snprintf.h> - -#ifdef _MSC_VER -#pragma warning(disable:4273) // inconsistent dll linkage -#endif - -/* VS 2015 and above support ISO C snprintf */ -#if _MSC_VER < 1900 - -/* This function retrieves the pointer to the last character of a buffer. - That is the pointer to the last character of the buffer that fits - completely into that buffer or the position of the terminating zero. - - buffer Pointer to a _TXCHAR buffer to be examined - count size of the buffer to be examined - - return The pointer to the last character that fits into the buffer or - NULL if count is zero or count is one and the first byte was a - leading DBCS character -*/ - -static _TCHAR *GetLastBufferChar( _TCHAR *buffer, size_t count ) -{ - _TCHAR *last = NULL; - _TCHAR *cur = buffer; - - while ( (size_t)(cur - buffer) < count ) - { - last = cur; - - if ( !*last ) - break; - - cur = _tcsinc(last); - } - - return last; -} - - -/* Implementation of snprintf following the ISO/IEC 9899:1999 (ISO C99) standard */ - -LO_SNPRINTF_DLLIMPORT int __cdecl vsntprintf( _TCHAR *buffer, size_t count, const _TCHAR *format, va_list list ) -{ - int retval; - - /* First of all call the existing non POSIX standard function assuming - the buffer size will be large enough */ - - retval = _vsntprintf( buffer, count, format, list ); - - if ( retval < 0 ) - { - /* If the buffer wasn't large enough ensure that the buffer will be - zero terminated */ - - _TCHAR *last = GetLastBufferChar( buffer, count ); - if (last ) - *last = 0; - - /* Retrieve the count of characters that would have been written - if the buffer were large enough */ - - retval = _vsctprintf( format, list ); - } - else if ( (size_t)retval == count && count ) - { - /* If the buffer was large enough but not large enough for the trailing - zero make the buffer zero terminated */ - - _TCHAR *last = GetLastBufferChar( buffer, count ); - if (last ) - *last = 0; - } - - return retval; -} - -/* Implementation of snprintf following the ISO/IEC 9899:1999 (ISO C99) standard */ - -LO_SNPRINTF_DLLIMPORT int __cdecl sntprintf( _TCHAR *buffer, size_t count, const _TCHAR *format, ... ) -{ - va_list list; - int retval; - - va_start( list, format ); - retval = vsntprintf( buffer, count, format, list ); - va_end( list ); - - return retval; -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/systools/win32/uwinapi/snwprintf.c b/sal/systools/win32/uwinapi/snwprintf.c deleted file mode 100644 index cd076ae5795a..000000000000 --- a/sal/systools/win32/uwinapi/snwprintf.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef _UNICODE -#define _UNICODE -#endif - -#include "sntprintf.c" - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sal/systools/win32/uwinapi/uwinapi.def b/sal/systools/win32/uwinapi/uwinapi.def deleted file mode 100644 index f740fb1c160c..000000000000 --- a/sal/systools/win32/uwinapi/uwinapi.def +++ /dev/null @@ -1,8 +0,0 @@ -LIBRARY "uwinapi.dll" - -EXPORTS - GetShortPathNameW PRIVATE - snprintf - snwprintf - vsnprintf - vsnwprintf |