summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-04-06 16:58:39 +0300
committerUoti Urpala <uau@mplayer2.org>2012-04-06 17:45:56 +0300
commite2fc1f640fdf473fdf8f1de6fd1212731b8ffa13 (patch)
tree11127d96adabf22894f4848bdd9bbda67d67542e /osdep
parentb93ed278362185ff980e0ce8f4ab3029f8fe395f (diff)
downloadmpv-e2fc1f640fdf473fdf8f1de6fd1212731b8ffa13.tar.bz2
mpv-e2fc1f640fdf473fdf8f1de6fd1212731b8ffa13.tar.xz
build: remove OS/2 support
Diffstat (limited to 'osdep')
-rw-r--r--osdep/getch2-os2.c200
-rw-r--r--osdep/getch2.c2
-rw-r--r--osdep/getch2.h4
-rw-r--r--osdep/mmap-os2.c211
-rw-r--r--osdep/osdep.h50
-rw-r--r--osdep/priority.c2
6 files changed, 3 insertions, 466 deletions
diff --git a/osdep/getch2-os2.c b/osdep/getch2-os2.c
deleted file mode 100644
index 05e408ff45..0000000000
--- a/osdep/getch2-os2.c
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * OS/2 TermIO
- *
- * Copyright (c) 2007 KO Myung-Hun (komh@chollian.net)
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#define INCL_KBD
-#define INCL_VIO
-#define INCL_DOS
-#include <os2.h>
-
-#include <stdio.h>
-#include <string.h>
-
-#include "config.h"
-#include "input/keycodes.h"
-#include "input/input.h"
-#include "mp_fifo.h"
-#include "getch2.h"
-
-#if defined(HAVE_LANGINFO) && defined(CONFIG_ICONV)
-#include <locale.h>
-#include <langinfo.h>
-#endif
-
-int mp_input_slave_cmd_func( int fd, char *dest, int size )
-{
- PPIB ppib;
- CHAR szPipeName[ 100 ];
- HFILE hpipe;
- ULONG ulAction;
- ULONG cbActual;
- ULONG rc;
-
- DosGetInfoBlocks( NULL, &ppib );
-
- sprintf( szPipeName, "\\PIPE\\MPLAYER\\%lx", ppib->pib_ulpid );
-
- rc = DosOpen( szPipeName, &hpipe, &ulAction, 0, FILE_NORMAL,
- OPEN_ACTION_OPEN_IF_EXISTS,
- OPEN_SHARE_DENYREADWRITE | OPEN_ACCESS_READWRITE,
- NULL );
- if( rc )
- return MP_INPUT_NOTHING;
-
- rc = DosRead( hpipe, dest, size, &cbActual );
- if( rc )
- return MP_INPUT_NOTHING;
-
- rc = cbActual;
-
- // Send ACK
- DosWrite( hpipe, &rc, sizeof( ULONG ), &cbActual );
-
- DosClose( hpipe );
-
- return rc;
-}
-
-
-int screen_width = 80;
-int screen_height = 24;
-char *erase_to_end_of_line = NULL;
-
-void get_screen_size( void )
-{
- VIOMODEINFO vmi;
-
- vmi.cb = sizeof( VIOMODEINFO );
-
- VioGetMode( &vmi, 0 );
-
- screen_width = vmi.col;
- screen_height = vmi.row;
-}
-
-static int getch2_status = 0;
-
-static int getch2_internal( void )
-{
- KBDKEYINFO kki;
-
- if( !getch2_status )
- return -1;
-
- if( KbdCharIn( &kki, IO_NOWAIT, 0 ))
- return -1;
-
- // key pressed ?
- if( kki.fbStatus )
- {
- // extended key ?
- if(( kki.chChar == 0x00 ) || ( kki.chChar == 0xE0 ))
- {
- switch( kki.chScan )
- {
- case 0x4B : // Left
- return KEY_LEFT;
-
- case 0x48 : // Up
- return KEY_UP;
-
- case 0x4D : // Right
- return KEY_RIGHT;
-
- case 0x50 : // Down
- return KEY_DOWN;
-
- case 0x53 : // Delete
- return KEY_DELETE;
-
- case 0x52 : // Insert
- return KEY_INSERT;
-
- case 0x47 : // Home
- return KEY_HOME;
-
- case 0x4F : // End
- return KEY_END;
-
- case 0x49 : // Page Up
- return KEY_PAGE_UP;
-
- case 0x51 : // Page Down
- return KEY_PAGE_DOWN;
- }
- }
- else
- {
- switch( kki.chChar )
- {
- case 0x08 : // Backspace
- return KEY_BS;
-
- case 0x1B : // Esc
- return KEY_ESC;
-
- case 0x0D : // Enter
- // Keypad Enter ?
- if( kki.chScan == 0xE0 )
- return KEY_KPENTER;
- break;
- }
-
- return kki.chChar;
- }
- }
-
- return -1;
-}
-
-void getch2(struct mp_fifo *fifo)
-{
- int key;
-
- key = getch2_internal();
- if( key != -1 )
- mplayer_put_key(fifo, key);
-}
-
-void getch2_enable( void )
-{
- getch2_status = 1;
-}
-
-void getch2_disable( void )
-{
- getch2_status = 0;
-}
-
-#ifdef CONFIG_ICONV
-char *get_term_charset( void )
-{
- char *charset = NULL;
-
-#ifdef HAVE_LANGINFO
- setlocale( LC_CTYPE, "");
- charset = strdup( nl_langinfo( CODESET ));
- setlocale( LC_CTYPE, "C");
-#endif
-
- return charset;
-}
-#endif
diff --git a/osdep/getch2.c b/osdep/getch2.c
index dcd5b1ad84..0cbaa82a25 100644
--- a/osdep/getch2.c
+++ b/osdep/getch2.c
@@ -24,7 +24,7 @@
#include "config.h"
//#define HAVE_TERMCAP
-#if !defined(__OS2__) && !defined(__MORPHOS__)
+#if !defined(__MORPHOS__)
#define CONFIG_IOCTL
#endif
diff --git a/osdep/getch2.h b/osdep/getch2.h
index 458881c15f..4442f1181d 100644
--- a/osdep/getch2.h
+++ b/osdep/getch2.h
@@ -60,8 +60,8 @@ bool getch2(struct mp_fifo *fifo);
char *get_term_charset(void);
#endif
-#if defined(__MINGW32__) || defined(__OS2__)
-/* slave cmd function for Windows and OS/2 */
+#if defined(__MINGW32__)
+// slave cmd function for Windows
int mp_input_slave_cmd_func(int fd,char* dest,int size);
#define USE_FD0_CMD_SELECT 0
#define MP_INPUT_SLAVE_CMD_FUNC mp_input_slave_cmd_func
diff --git a/osdep/mmap-os2.c b/osdep/mmap-os2.c
deleted file mode 100644
index 61fcc4f5db..0000000000
--- a/osdep/mmap-os2.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * very simple implementation of mmap() for OS/2
- *
- * Copyright (c) 2008 KO Myung-Hun (komh@chollian.net)
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#define INCL_DOS
-#include <os2.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <io.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "config.h"
-#include "mmap.h"
-#include "mmap_anon.h"
-
-typedef struct os2_mmap_s
-{
- void *addr;
- size_t len;
- int flags;
- struct os2_mmap_s *prev;
- struct os2_mmap_s *next;
-} os2_mmap;
-static os2_mmap *m_mmap = NULL;
-
-void *mmap( void *addr, size_t len, int prot, int flags, int fildes, off_t off )
-{
- os2_mmap *new_mmap;
-
- ULONG fl;
- ULONG rc;
-
- void *ret;
-
- if( prot & PROT_WRITE )
- {
- if( flags & MAP_SHARED )
- return MAP_FAILED;
-
- if( !( flags & MAP_PRIVATE ))
- return MAP_FAILED;
- }
-
- if( flags & MAP_FIXED )
- {
- ULONG cb;
-
- cb = len;
- rc = DosQueryMem( addr, &cb, &fl );
- if( rc || ( cb < len ))
- return MAP_FAILED;
-
- rc = DosSetMem( addr, len, fPERM );
- if( rc )
- return MAP_FAILED;
-
- ret = addr;
- }
- else
- {
- // Allocate tiled memory compatible with 16-bit selectors
- // 'fs_seg' in 'ldt_keeper.c' need this attribute
- rc = DosAllocMem( &ret, len, fALLOC );
- if( rc )
- return MAP_FAILED;
- }
-
- new_mmap = malloc( sizeof( os2_mmap ));
- new_mmap->addr = ret;
- new_mmap->len = len;
- new_mmap->flags = flags;
- new_mmap->prev = m_mmap;
- new_mmap->next = NULL;
-
- if( m_mmap )
- m_mmap->next = new_mmap;
- m_mmap = new_mmap;
-
- if( !( flags & MAP_ANON ))
- {
- int pos;
-
- /* Now read in the file */
- if(( pos = lseek( fildes, off, SEEK_SET )) == -1)
- {
- munmap( ret, len );
-
- return MAP_FAILED;
- }
-
- read( fildes, ret, len );
- lseek( fildes, pos, SEEK_SET ); /* Restore the file pointer */
- }
-
- fl = 0;
-
- if( prot & PROT_READ )
- fl |= PAG_READ;
-
- if( prot & PROT_WRITE )
- fl |= PAG_WRITE;
-
- if( prot & PROT_EXEC )
- fl |= PAG_EXECUTE;
-
- if( prot & PROT_NONE )
- fl |= PAG_GUARD;
-
- rc = DosSetMem( ret, len, fl );
- if( rc )
- {
- munmap( ret, len );
-
- return MAP_FAILED;
- }
-
- return ret;
-}
-
-int munmap( void *addr, size_t len )
-{
- os2_mmap *mm;
-
- for( mm = m_mmap; mm; mm = mm->prev )
- {
- if( mm->addr == addr )
- break;
- }
-
- if( mm )
- {
-
- if( !( mm->flags & MAP_FIXED ))
- DosFreeMem( addr );
-
- if( mm->next )
- mm->next->prev = mm->prev;
-
- if( mm->prev )
- mm->prev->next = mm->next;
-
- if( m_mmap == mm )
- m_mmap = mm->prev;
-
- free( mm );
-
- return 0;
- }
-
- return -1;
-}
-
-int mprotect( void *addr, size_t len, int prot )
-{
- os2_mmap *mm;
-
- for( mm = m_mmap; mm; mm = mm->prev )
- {
- if( mm->addr == addr )
- break;
- }
-
- if( mm )
- {
- ULONG fl;
-
- fl = 0;
-
- if( prot & PROT_READ )
- fl |= PAG_READ;
-
- if( prot & PROT_WRITE )
- fl |= PAG_WRITE;
-
- if( prot & PROT_EXEC )
- fl |= PAG_EXECUTE;
-
- if( prot & PROT_NONE )
- fl |= PAG_GUARD;
-
- if( DosSetMem( addr, len, fl ) == 0 )
- return 0;
- }
-
- return -1;
-}
-
-void *mmap_anon( void *addr, size_t len, int prot, int flags, off_t off )
-{
- return mmap( addr, len, prot, flags | MAP_ANON, -1, off );
-}
diff --git a/osdep/osdep.h b/osdep/osdep.h
deleted file mode 100644
index 654309c015..0000000000
--- a/osdep/osdep.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Header in order to include OS-specific headers, macros, types and so on
- *
- * Copyright (c) 2010 by KO Myung-Hun (komh@chollian.net)
- *
- * This file is part of MPlayer.
- *
- * MPlayer is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * MPlayer is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-#ifndef MPLAYER_OSDEP_H
-#define MPLAYER_OSDEP_H
-
-#ifdef __OS2__
-#define INCL_DOS
-#define INCL_DOSDEVIOCTL
-#include <os2.h>
-
-#include <process.h> /* getpid() */
-
-#define REALTIME_PRIORITY_CLASS MAKESHORT(0, PRTYC_TIMECRITICAL)
-#define HIGH_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_REGULAR)
-#define ABOVE_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM / 2, PRTYC_REGULAR)
-#define NORMAL_PRIORITY_CLASS MAKESHORT(0, PRTYC_REGULAR)
-#define BELOW_NORMAL_PRIORITY_CLASS MAKESHORT(PRTYD_MAXIMUM, PRTYC_IDLETIME)
-#define IDLE_PRIORITY_CLASS MAKESHORT(0, PRTYC_IDLETIME)
-
-#define SetPriorityClass(pid, prio) \
- DosSetPriority(PRTYS_PROCESS, \
- HIBYTE(prio), \
- LOBYTE(prio), \
- pid)
-
-#define GetCurrentProcess() getpid()
-#endif /* __OS2__ */
-
-#endif /* MPLAYER_OSDEP_H */
-
diff --git a/osdep/priority.c b/osdep/priority.c
index 0803a3299e..dfa2c54ff5 100644
--- a/osdep/priority.c
+++ b/osdep/priority.c
@@ -20,8 +20,6 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "osdep.h"
-
#if defined(__MINGW32__) || defined(__CYGWIN__)
#include <windows.h>
#endif