Commit 731c7d85 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Removed old unused files.

parent 3a908033
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2011 SSAB Oxelosund AB.
*
* This file is part of Proview.
*
* This program 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.
*
* This program 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* rt_futex.c -- Futex operations
PROVIEW/R
Contains functions that are heavily os-dependant.
Author: Robert Karlsson 21 Apr 2004
Description:
This module provides an interface to futexes - "fast user level
locking in Linux". This is achieved through the multiplexing
system call sys_futex(). As implemented below this interface provides
a synchronization mechanism that can be used both between threads
in one process as well as between threads in different processes */
#if !defined(OS_LINUX)
# error "This file is valid only for OS_LINUX"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/syscall.h>
#include <unistd.h>
#define FUTEX_WAIT (0)
#define FUTEX_WAKE (1)
#define FUTEX_FD (2)
#define FUTEX_REQUEUE (3)
int
futex_wait (
int *futex,
int val
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_timed_wait (
int *futex,
int val,
const struct timespec * timespec
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, timespec);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_wake (
int *futex,
int nr
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAKE, nr, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
/*
* Proview $Id: rt_futex.c,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_futex.c -- Futex operations
PROVIEW/R
Contains functions that are heavily os-dependant.
Author: Robert Karlsson 21 Apr 2004
Description:
This module provides an interface to futexes - "fast user level
locking in Linux". This is achieved through the multiplexing
system call sys_futex(). As implemented below this interface provides
a synchronization mechanism that can be used both between threads
in one process as well as between threads in different processes */
#if !defined(OS_MACOS)
# error "This file is valid only for Mac OS"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/syscall.h>
#include <unistd.h>
#define FUTEX_WAIT (0)
#define FUTEX_WAKE (1)
#define FUTEX_FD (2)
#define FUTEX_REQUEUE (3)
int
futex_wait (
int *futex,
int val
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_timed_wait (
int *futex,
int val,
const struct timespec * timespec
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, timespec);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_wake (
int *futex,
int nr
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAKE, nr, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
/*
* Proview $Id: rt_futex.h,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_futex_h
#define rt_futex_h
#ifdef __cplusplus
extern "C" {
#endif
int futex_wait(int *futex, int val);
int futex_timed_wait(int *futex, int val, const struct timespec * timespec);
int futex_wake(int *futex,int nr);
#ifdef __cplusplus
}
#endif
#endif
/*
* Proview $Id: rt_futex.c,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_futex.c -- Futex operations
PROVIEW/R
Contains functions that are heavily os-dependant.
Author: Robert Karlsson 21 Apr 2004
Description:
This module provides an interface to futexes - "fast user level
locking in Linux". This is achieved through the multiplexing
system call sys_futex(). As implemented below this interface provides
a synchronization mechanism that can be used both between threads
in one process as well as between threads in different processes */
#if !defined(OS_MACOS)
# error "This file is valid only for Mac OS"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/syscall.h>
#include <unistd.h>
#define FUTEX_WAIT (0)
#define FUTEX_WAKE (1)
#define FUTEX_FD (2)
#define FUTEX_REQUEUE (3)
int
futex_wait (
int *futex,
int val
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_timed_wait (
int *futex,
int val,
const struct timespec * timespec
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, timespec);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_wake (
int *futex,
int nr
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAKE, nr, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
/*
* Proview $Id: rt_futex.h,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_futex_h
#define rt_futex_h
#ifdef __cplusplus
extern "C" {
#endif
int futex_wait(int *futex, int val);
int futex_timed_wait(int *futex, int val, const struct timespec * timespec);
int futex_wake(int *futex,int nr);
#ifdef __cplusplus
}
#endif
#endif
/*
* Proview $Id: rt_futex.c,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* rt_futex.c -- Futex operations
PROVIEW/R
Contains functions that are heavily os-dependant.
Author: Robert Karlsson 21 Apr 2004
Description:
This module provides an interface to futexes - "fast user level
locking in Linux". This is achieved through the multiplexing
system call sys_futex(). As implemented below this interface provides
a synchronization mechanism that can be used both between threads
in one process as well as between threads in different processes */
#if !defined(OS_MACOS)
# error "This file is valid only for Mac OS"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/syscall.h>
#include <unistd.h>
#define FUTEX_WAIT (0)
#define FUTEX_WAKE (1)
#define FUTEX_FD (2)
#define FUTEX_REQUEUE (3)
int
futex_wait (
int *futex,
int val
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_timed_wait (
int *futex,
int val,
const struct timespec * timespec
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAIT, val, timespec);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
int
futex_wake (
int *futex,
int nr
)
{
int ok;
ok = syscall(SYS_futex, futex, FUTEX_WAKE, nr, NULL);
if (ok == -1) {
return errno;
}
else {
return ok;
}
}
/*
* Proview $Id: rt_futex.h,v 1.2 2005-09-01 14:57:57 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program 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.
*
* This program 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_futex_h
#define rt_futex_h
#ifdef __cplusplus
extern "C" {
#endif
int futex_wait(int *futex, int val);
int futex_timed_wait(int *futex, int val, const struct timespec * timespec);
int futex_wake(int *futex,int nr);
#ifdef __cplusplus
}
#endif
#endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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.
*
* This program 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* rt_dvms.c -- Decode VMS-data
Functions to convert data loaded from file
in VAX format to big endian format. */
#include <stdio.h>
#include <string.h>
#include "pwr.h"
#include "pwr_class.h"
#include "co_float.h"
#include "rt_dvms.h"
#include "rt_errh.h"
#include "rt_gdb.h"
#include "rt_mvol.h"
static pwr_tBoolean
dvms_bool (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
ENDIAN_SWAP_BOOLP(p);
p += sizeof(int);
}
return TRUE;
}
static pwr_tBoolean
dvms_error (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
errh_Error("dvms_error, type not supported, pwr_tFloat64");
return FALSE;
}
static pwr_tBoolean
dvms_ieee2vaxf (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
co_ieee2vaxf(bo, co_dHostByteOrder, p, p);
p += sizeof(float);
}
return TRUE;
}
static pwr_tBoolean
dvms_vaxf2ieee (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
co_vaxf2ieee(bo, co_dHostByteOrder, p, p);
p += sizeof(float);
}
return TRUE;
}
static pwr_tBoolean
dvms_int (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
}
return TRUE;
}
static pwr_tBoolean
dvms_2_int (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem * 2; i > 0; i--) {
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
}
return TRUE;
}
static pwr_tBoolean
dvms_short (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
ENDIAN_SWAP_SHORTP(p);
p += sizeof(short);
}
return TRUE;
}
static pwr_tBoolean
dvms_aref (
char *p,
gdb_sAttribute *ap,
co_eBO bo
)
{
int i;
p += ap->offs;
for (i = ap->elem; i > 0; i--) {
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
ENDIAN_SWAP_INTP(p);
p += sizeof(int);
}
return TRUE;
}
static dvmsFctn dvmsSwap[pwr_eTix_] = {
NULL, /* pwr_eTix__ */
dvms_bool, /* pwr_eTix_Boolean */
dvms_error, /* pwr_eTix_Float32 */
dvms_error, /* pwr_eTix_Float64 */
NULL, /* pwr_eTix_Char */
NULL, /* pwr_eTix_Int8 */
dvms_short, /* pwr_eTix_Int16 */
dvms_int, /* pwr_eTix_Int32 */
NULL, /* pwr_eTix_UInt8 */
dvms_short, /* pwr_eTix_UInt16 */
dvms_int, /* pwr_eTix_UInt32 */
dvms_2_int, /* pwr_eTix_Objid */
NULL, /* pwr_eTix_Buffer */
NULL, /* pwr_eTix_String */
dvms_int, /* pwr_eTix_Enum */
NULL, /* pwr_eTix_Struct */
dvms_int, /* pwr_eTix_Mask */
NULL, /* pwr_eTix_Array */
dvms_2_int, /* pwr_eTix_Time */
NULL, /* pwr_eTix_Text */
dvms_aref, /* pwr_eTix_AttrRef */
dvms_2_int, /* pwr_eTix_UInt64 */
dvms_2_int, /* pwr_eTix_Int64 */
dvms_int, /* pwr_eTix_ClassId */
dvms_int, /* pwr_eTix_TypeId */
dvms_int, /* pwr_eTix_VolumeId */
dvms_int, /* pwr_eTix_ObjectIx */
dvms_2_int, /* pwr_eTix_RefId */
};
static dvmsFctn dvmsNull[pwr_eTix_] = {
NULL, /* pwr_eTix__ */
NULL, /* pwr_eTix_Boolean */
dvms_error, /* pwr_eTix_Float32 */
dvms_error, /* pwr_eTix_Float64 */
NULL, /* pwr_eTix_Char */
NULL, /* pwr_eTix_Int8 */
NULL, /* pwr_eTix_Int16 */
NULL, /* pwr_eTix_Int32 */
NULL, /* pwr_eTix_UInt8 */
NULL, /* pwr_eTix_UInt16 */
NULL, /* pwr_eTix_UInt32 */
NULL, /* pwr_eTix_Objid */
NULL, /* pwr_eTix_Buffer */
NULL, /* pwr_eTix_String */
NULL, /* pwr_eTix_Enum */
NULL, /* pwr_eTix_Struct */
NULL, /* pwr_eTix_Mask */
NULL, /* pwr_eTix_Array */
NULL, /* pwr_eTix_Time */
NULL, /* pwr_eTix_Text */
NULL, /* pwr_eTix_AttrRef */
NULL, /* pwr_eTix_UInt64 */
NULL, /* pwr_eTix_Int64 */
NULL, /* pwr_eTix_ClassId */
NULL, /* pwr_eTix_TypeId */
NULL, /* pwr_eTix_VolumeId */
NULL, /* pwr_eTix_ObjectIx */
NULL, /* pwr_eTix_RefId */
};
dvmsFctn* dvms_GetFctns(const co_mFormat* fmp)
{
dvmsFctn *fctns;
if (fmp->b.bo == co_dHostByteOrder) {
if (fmp->b.ft == co_dHostFloatType)
return NULL;
fctns = dvmsNull;
}
else
fctns = dvmsSwap;
if (fmp->b.ft == co_dHostFloatType) {
fctns[pwr_eTix_Float32] = NULL;
fctns[pwr_eTix_Float64] = NULL;
}
else if (co_dHostFloatType == co_eFT_ieeeS) {
fctns[pwr_eTix_Float32] = dvms_vaxf2ieee;
fctns[pwr_eTix_Float64] = dvms_error;
}
else {
fctns[pwr_eTix_Float32] = dvms_ieee2vaxf;
fctns[pwr_eTix_Float64] = dvms_error;
}
return fctns;
}
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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.
*
* This program 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef rt_dvms_h
#define rt_dvms_h
/* rt_dvms.h -- Decode VMS-data
Functions to convert data loaded from file
in VAX format to big endian format. */
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef co_pdr_h
# include "co_pdr.h"
#endif
#ifndef rt_gdb_h
# include "rt_gdb.h"
#endif
typedef pwr_tBoolean (*dvmsFctn)(char *p, gdb_sAttribute *ap, co_eBO bo);
/**
* Returns an array of conversion functions for the passed source format
*/
dvmsFctn* dvms_GetFctns(const co_mFormat* fmp);
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#ifndef wb_ldhld_h
#define wb_ldhld_h
/* wb_ldhld.h -- <short description>
PROVIEW/R
Copyright (C) 1996 by Comator Process AB.
This module contains functions to create load data files. */
#ifndef pwr_class_h
#include "pwr_class.h"
#endif
#ifndef wb_ldh_h
#include "wb_ldh.h"
#endif
/*============================================================================*\
Exported functions.
\*============================================================================*/
pwr_tStatus ldhld_CreateLoadFile (
ldh_tSesContext Session
);
pwr_tStatus ldhld_Diff (
char *NodeName,
pwr_tProjVersion NewDnoVersion,
char *DiffFileName,
char *DECnetNodeName
);
#endif
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment