mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
This is a follow-up of 3cd1253. A C++ program was written to automate the license update originally. That program was translated to Python so it can be kept in the repository and run when needed. It has been tested on Windows using the standard Python 3 installation and on Linux.
The original version skipped files that had "//" at the beginning since most were files that should be excluded. The relevant files are now in an exclusion list and the rest are processed normally. The .hpp file extension has been added as well. The script rewrote CompressorJNI.cpp to remove the carriage returns from its line endings.
48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
/* the project. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#pragma once
|
|
|
|
#include <pthread.h>
|
|
#include <stdint.h>
|
|
|
|
#ifndef _FUNCPTR_DEFINED
|
|
#define _FUNCPTR_DEFINED
|
|
#ifdef __cplusplus
|
|
typedef int (*FUNCPTR)(...);
|
|
/* ptr to function returning int */
|
|
#else
|
|
typedef int (*FUNCPTR)(); /* ptr to function returning int */
|
|
#endif /* __cplusplus */
|
|
#endif /* _FUNCPTR_DEFINED */
|
|
|
|
#ifndef _STATUS_DEFINED
|
|
#define _STATUS_DEFINED
|
|
typedef int STATUS;
|
|
#endif /* _STATUS_DEFINED */
|
|
|
|
#ifndef OK
|
|
#define OK 0
|
|
#endif /* OK */
|
|
#ifndef ERROR
|
|
#define ERROR (-1)
|
|
#endif /* ERROR */
|
|
|
|
#define NULL_TASK NULL
|
|
typedef pthread_t* TASK;
|
|
|
|
extern "C" {
|
|
// Note: These constants used to be declared extern and were defined in
|
|
// Task.cpp. This caused issues with the JNI bindings for java, and so the
|
|
// instantiations were moved here.
|
|
const int32_t HAL_taskLib_ILLEGAL_PRIORITY = 22; // 22 is EINVAL
|
|
|
|
STATUS verifyTaskID(TASK task);
|
|
STATUS setTaskPriority(TASK task, int priority); // valid priority [1..99]
|
|
STATUS getTaskPriority(TASK task, int* priority);
|
|
}
|