blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 2 268 | content_id stringlengths 40 40 | detected_licenses listlengths 0 58 | license_type stringclasses 2 values | repo_name stringlengths 5 118 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 816 values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 2.31k 677M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 151 values | src_encoding stringclasses 33 values | language stringclasses 1 value | is_vendor bool 2 classes | is_generated bool 2 classes | length_bytes int64 3 10.3M | extension stringclasses 119 values | content stringlengths 3 10.3M | authors listlengths 1 1 | author_id stringlengths 0 228 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
408e9a61e890610fcbb089b5be38b14d32d03be2 | aa7e7bd3b14b22fd8fde475d98594008386e62bd | /antman/lib/my/src/my_str_islower.c | ff87a139296587fb888ed44eb341b2857a541f71 | [] | no_license | amarataf/Antman | fc005880f41f25af193052b85886ae5bf02be1e2 | 98b4391d06f194a97038da744129b1c78744bb9a | refs/heads/master | 2023-03-16T12:12:43.729461 | 2021-02-22T08:58:53 | 2021-02-22T08:58:53 | 338,056,330 | 5 | 1 | null | null | null | null | UTF-8 | C | false | false | 334 | c | /*
** EPITECH PROJECT, 2020
** my_str_islower
** File description:
** return 1 if the string is only lowcase
*/
int my_str_islower(char const *str)
{
int i = 0;
while (str[i] != '\0') {
if (str[i] >= 'a' && str[i] <= 'z') {
i++;
} else {
return (0);
}
}
return (1);
}
| [
"adria.marata-fernandez@epitech.eu"
] | adria.marata-fernandez@epitech.eu |
d896d1c460dcf4bec786dd8f485d30b7f8edf198 | d743178a58b323045d87a4a6795741eb3df9c8a4 | /2018101042_assgn2/set_ip_op_redirection.c | b8bac4c345edf957ab6f9ca95fa91f4c7e81c983 | [] | no_license | arathyrose/shell-c | c88e63bd671dee697915172109ccaa8540dedda8 | 67afdd97c7d30ebd23534040b62e25c003ec2ae8 | refs/heads/master | 2020-08-31T05:14:56.792057 | 2020-06-01T10:27:02 | 2020-06-01T10:27:02 | 218,601,147 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,528 | c | /**
* This function handles the redirection symbol, that is, it sets the input and output files
* */
#include "shell.h"
int debug_set_ip_op_redirection = 0;
void set_ip_op_redirection(char **args)
{
for (int i = 0; !is_emptystr(args[i]); i++)
{
if (strcmp(args[i], "<") == 0) // Redirect for input
{
if (debug_set_ip_op_redirection)
printn_debug("Redirect for input");
int fd_input = open(args[i + 1], O_RDONLY, 0);
if (fd_input < 0)
file_error();
dup2(fd_input, 0);
close(fd_input);
args[i] = NULL;
}
else if (!strcmp(args[i], ">")) // Redirect for output for writing
{
if (debug_set_ip_op_redirection)
printn_debug("Redirect for output for writing");
int fd_write = open(args[i + 1], O_WRONLY | O_TRUNC | O_CREAT, 0644);
if (fd_write < 0)
file_error();
dup2(fd_write, 1);
close(fd_write);
args[i] = NULL;
}
else if (!strcmp(args[i], ">>")) // Redirect for output for appending
{
if (debug_set_ip_op_redirection)
printn_debug("Redirect for output for appending");
int fd_append = open(args[i + 1], O_APPEND | O_RDWR | O_CREAT, 0644);
if (fd_append < 0)
file_error();
dup2(fd_append, 1);
close(fd_append);
args[i] = NULL;
}
}
} | [
"arathyrose2000@gmail.com"
] | arathyrose2000@gmail.com |
b0f662a952f11fe109bbdcc2f1c89c0e76e5560b | db145f439cbff99959b2b66da78f58fc77ca2052 | /src/sorta.h | 573fcd759e57dd214c618ba9b0b9aab952d77cd8 | [] | no_license | briansteffens/sorta | 082b9deb2fb5dd01859f5a9c70b6594ec220228d | 2c59518a77f81092cfdb0096843de61bb7c387d1 | refs/heads/master | 2020-12-24T12:40:25.878974 | 2017-08-16T16:32:03 | 2017-08-16T16:32:03 | 72,964,116 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 778 | h | #ifndef SORTA_H
#define SORTA_H
#include <stdbool.h>
typedef int (*compare_function)(void*, void*);
int compare_int(void* left, void* right);
void mem_swap(void* dest, void* src, int bytes);
void insertion_sort(void* list, int size, int items, compare_function compare);
void selection_sort(void* list, int size, int items, compare_function compare);
void bubble_sort(void* list, int size, int items, compare_function compare);
void shell_sort(void* list, int size, int len, compare_function compare,
int gaps[], int gaps_len);
void merge_sort(void* list, int size, int len, compare_function compare);
void heap_sort(void* list, int size, int len, compare_function compare);
void quick_sort(void* list, int size, int len, compare_function compare);
#endif
| [
"briansteffens@gmail.com"
] | briansteffens@gmail.com |
a1eebc8a9993f4e79b426d9b0b1c8e7d7979c623 | 2fdcfbd9a3123ec2f8c658b785e32068c86a5f3a | /BLE-CC254x-1.3.2-KEY/Components/hal/common/hal_drivers.c | 34e4f1a98af4172e6c55812822c32515120d2d38 | [] | no_license | gejiangwendi/c_and_8bit-mcu | 21d8f68aa705baac7023bb6d9e81d0d0d5f4282a | a61e331d25d65315790054e20150c89bba18b9f9 | refs/heads/master | 2021-06-21T12:15:30.658010 | 2020-03-09T14:31:33 | 2020-03-09T14:31:33 | 100,465,334 | 0 | 1 | null | null | null | null | WINDOWS-1258 | C | false | false | 8,796 | c | /**************************************************************************************************
Filename: hal_drivers.c
Revised: $Date: 2007-07-06 10:42:24 -0700 (Fri, 06 Jul 2007) $
Revision: $Revision: 13579 $
Description: This file contains the interface to the Drivers Service.
Copyright 2005-2012 Texas Instruments Incorporated. All rights reserved.
IMPORTANT: Your use of this Software is limited to those specific rights
granted under the terms of a software license agreement between the user
who downloaded the software, his/her employer (which must be your employer)
and Texas Instruments Incorporated (the "License"). You may not use this
Software unless you agree to abide by the terms of the License. The License
limits your use, and you acknowledge, that the Software may not be modified,
copied or distributed unless embedded on a Texas Instruments microcontroller
or used solely and exclusively in conjunction with a Texas Instruments radio
frequency transceiver, which is integrated into your product. Other than for
the foregoing purpose, you may not use, reproduce, copy, prepare derivative
works of, modify, distribute, perform, display or sell this Software and/or
its documentation for any purpose.
YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
Should you have any questions regarding your right to use this Software,
contact Texas Instruments Incorporated at www.TI.com.
**************************************************************************************************/
/**************************************************************************************************
* INCLUDES
**************************************************************************************************/
#include "hal_adc.h"
#if (defined HAL_AES) && (HAL_AES == TRUE)
#include "hal_aes.h"
#endif
#if (defined HAL_BUZZER) && (HAL_BUZZER == TRUE)
#include "hal_buzzer.h"
#endif
#if (defined HAL_DMA) && (HAL_DMA == TRUE)
#include "hal_dma.h"
#endif
#include "hal_drivers.h"
#include "hal_key.h"
#include "hal_lcd.h"
#include "hal_led.h"
#include "hal_sleep.h"
#include "hal_timer.h"
#include "hal_types.h"
#include "hal_uart.h"
#ifdef CC2591_COMPRESSION_WORKAROUND
#include "mac_rx.h"
#endif
#include "OSAL.h"
#if defined POWER_SAVING
#include "OSAL_PwrMgr.h"
#endif
#if (defined HAL_HID) && (HAL_HID == TRUE)
#include "usb_hid.h"
#endif
/**************************************************************************************************
* GLOBAL VARIABLES
**************************************************************************************************/
uint8 Hal_TaskID;
extern void HalLedUpdate( void ); /* Notes: This for internal only so it shouldn't be in hal_led.h */
/**************************************************************************************************
* @fn Hal_Init
*
* @brief Hal Initialization function.
*
* @param task_id - Hal TaskId
*
* @return None
**************************************************************************************************/
void Hal_Init( uint8 task_id )
{
/* Register task ID */
Hal_TaskID = task_id;
#ifdef CC2591_COMPRESSION_WORKAROUND
osal_start_reload_timer( Hal_TaskID, PERIOD_RSSI_RESET_EVT, PERIOD_RSSI_RESET_TIMEOUT );
#endif
}
/**************************************************************************************************
* @fn Hal_DriverInit
*
* @brief Initialize HW - These need to be initialized before anyone.
*
* @param task_id - Hal TaskId
*
* @return None
**************************************************************************************************/
void HalDriverInit (void)
{
/* TIMER */
#if (defined HAL_TIMER) && (HAL_TIMER == TRUE)
#endif
/* ADC */
#if (defined HAL_ADC) && (HAL_ADC == TRUE)
HalAdcInit();
#endif
/* DMA */
#if (defined HAL_DMA) && (HAL_DMA == TRUE)
// Must be called before the init call to any module that uses DMA.
HalDmaInit();
#endif
/* AES */
#if (defined HAL_AES) && (HAL_AES == TRUE)
HalAesInit();
#endif
/* LCD */
#if (defined HAL_LCD) && (HAL_LCD == TRUE)
HalLcdInit();
#endif
/* LED */
#if (defined HAL_LED) && (HAL_LED == TRUE)
HalLedInit();
#endif
/* UART */
#if (defined HAL_UART) && (HAL_UART == TRUE)
HalUARTInit();
#endif
/* KEY */
#if (defined HAL_KEY) && (HAL_KEY == TRUE)
HalKeyInit();
#endif
/* HID */
#if (defined HAL_HID) && (HAL_HID == TRUE)
usbHidInit();
#endif
}
/**************************************************************************************************
* @fn Hal_ProcessEvent
*
* @brief Hal Process Event
*
* @param task_id - Hal TaskId
* events - events
*
* @return None
**************************************************************************************************/
uint16 Hal_ProcessEvent( uint8 task_id, uint16 events )
{
uint8 *msgPtr;
(void)task_id; // Intentionally unreferenced parameter
if ( events & SYS_EVENT_MSG )
{
msgPtr = osal_msg_receive(Hal_TaskID);
while (msgPtr)
{
/* Do something here - for now, just deallocate the msg and move on */
/* De-allocate */
osal_msg_deallocate( msgPtr );
/* Next */
msgPtr = osal_msg_receive( Hal_TaskID );
}
return events ^ SYS_EVENT_MSG;
}
#if (defined HAL_BUZZER) && (HAL_BUZZER == TRUE)
if (events & HAL_BUZZER_EVENT)
{
HalBuzzerStop();
return events ^ HAL_BUZZER_EVENT;
}
#endif
#ifdef CC2591_COMPRESSION_WORKAROUND
if ( events & PERIOD_RSSI_RESET_EVT )
{
macRxResetRssi();
return (events ^ PERIOD_RSSI_RESET_EVT);
}
#endif
if ( events & HAL_LED_BLINK_EVENT )
{
#if (defined (BLINK_LEDS)) && (HAL_LED == TRUE)
HalLedUpdate();
#endif /* BLINK_LEDS && HAL_LED */
return events ^ HAL_LED_BLINK_EVENT;
}
if (events & HAL_KEY_EVENT)
{
#if (defined HAL_KEY) && (HAL_KEY == TRUE)
/* Check for keys */
HalKeyPoll();
/* if interrupt disabled, do next polling */
if (!Hal_KeyIntEnable)
{
osal_start_timerEx( Hal_TaskID, HAL_KEY_EVENT, 100);
}
#endif
return events ^ HAL_KEY_EVENT;
}
#if defined POWER_SAVING
if ( events & HAL_SLEEP_TIMER_EVENT )
{
halRestoreSleepLevel();
return events ^ HAL_SLEEP_TIMER_EVENT;
}
if ( events & HAL_PWRMGR_HOLD_EVENT )
{
(void)osal_pwrmgr_task_state(Hal_TaskID, PWRMGR_HOLD);
(void)osal_stop_timerEx(Hal_TaskID, HAL_PWRMGR_CONSERVE_EVENT);
(void)osal_clear_event(Hal_TaskID, HAL_PWRMGR_CONSERVE_EVENT);
return (events & ~(HAL_PWRMGR_HOLD_EVENT | HAL_PWRMGR_CONSERVE_EVENT));
}
if ( events & HAL_PWRMGR_CONSERVE_EVENT )
{
(void)osal_pwrmgr_task_state(Hal_TaskID, PWRMGR_CONSERVE);
return events ^ HAL_PWRMGR_CONSERVE_EVENT;
}
#endif
return 0;
}
/**************************************************************************************************
* @fn Hal_ProcessPoll
*
* @brief This routine will be called by OSAL to poll UART, TIMER...
*
* @param task_id - Hal TaskId
*
* @return None
**************************************************************************************************/
void Hal_ProcessPoll ()
{
/* UART Poll */
#if (defined HAL_UART) && (HAL_UART == TRUE)
HalUARTPoll();
#endif
/* HID poll */
#if (defined HAL_HID) && (HAL_HID == TRUE)
usbHidProcessEvents();
#endif
#if defined( POWER_SAVING )
/* Allow sleep before the next OSAL event loop */
ALLOW_SLEEP_MODE();
#endif
}
/**************************************************************************************************
**************************************************************************************************/
| [
"danghao0815@163.com"
] | danghao0815@163.com |
53812d3be1572bec5aca9c337baa09c6c2e05963 | c057f5dac86462d99804a4c50bb24f96cf3b6aa7 | /AEDS-1/LISTA 6/parte 3/Q1.6.pt3.c | a22d5ff9ad5ab9754a39e6d851dab81c7fbe1b80 | [] | no_license | TigoNunes/Activities-PUC-first-period | fb4837f09f63c7c04f6837a011cec37d24dabaf4 | 95a1fc465c7243f7b5e6a52b0e575034bb4cba96 | refs/heads/master | 2023-07-04T20:54:33.528066 | 2021-08-22T04:47:22 | 2021-08-22T04:47:22 | 386,070,479 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,123 | c | /******************************************************************************
Calcular e retornar o enésimo termo de uma progressão aritmética onde o primeiro
termo e a razão são informados pelo usuário.
*******************************************************************************/
#include <stdio.h>
void PG(float primeiro, float razao, int quantidade, float *enesimo)
{
while(quantidade > 1)
{
*enesimo = *enesimo + razao;
quantidade--;
}
}
int main()
{
float primeiro, razao;
int quantidade;
float enesimo;
printf("Determine o primeiro numero e a razao da progressao geometrica\n");
printf("Primeiro numero: ");
scanf("%f", &primeiro);
enesimo = primeiro;
printf("Razao: ");
scanf("%f", &razao);
printf("Determine quantos numeros que voce deseja ver.\n");
printf("Quantidade: ");
scanf("%d", &quantidade);
printf("Enesimo numero antes: %.2f\n", enesimo);
PG(primeiro, razao, quantidade, &enesimo);
printf("Enesimo numero depois: %.2f\n", enesimo);
return 0;
}
| [
"noreply@github.com"
] | TigoNunes.noreply@github.com |
f2bd8eb5d7467a0a119a348e501ba0f330230ff7 | 80d53c47731e8a9343bd781f99e60a93b5a25f82 | /src/Hardware/runs.h | a96307c93917235275f3e55ed1409da43eac87f4 | [] | no_license | Jonnyh6677/TestRepo2 | 9b9bb377e9519c6f9662b7e0604117043bc868bb | 5afe78aef8c01dec41fc87e220c47b4cc2dcd674 | refs/heads/master | 2023-01-19T20:08:28.838821 | 2020-12-04T10:32:04 | 2020-12-04T10:32:04 | 318,481,929 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,190 | h | #ifndef RUNS_h
#define RUNS_h
#include "MotorDriver.h"
#define FILTER_COLOR_NONE 0
#define FILTER_COLOR_GREY 1
#define FILTER_COLOR_BLUE 2
#define FILTER_COLOR_GREEN 3
#define FILTER_COLOR_ORANGE 4
#define FILTER_COLOR_RED 5
#define POS_LEFT 0
#define POS_RIGHT 1
#define POS_MIDDLE 3
int32_t s32RunsMotorStop(void);
void vRunsSerialMode();
void vRunsInitRun(uint32_t initPosition);
void vRunsMoveTo(int32_t positionAbsolute);
void vProcessSlitsRun(uint8_t sampleRun, uint8_t step);
void vProcessWLRun(uint8_t sampleRun, uint8_t step);
void vRunsTestMoveTo();
void vRunsExampleRun(uint8_t run);
void vRunsStepLoseCheck();
void vRunsMoveToSpecialPos(uint8_t u8pos);
int32_t vRunsMoveToLsSig(int32_t targetPosition, int32_t* decSteps);
void vRunsOffsetInFrontLsRun(uint32_t* steps);
void vRunsOffsetBehindLsRun(uint32_t* steps);
void vRunsStartOffsetRun();
void vRunsMoveToWl(uint16_t u16wl, uint8_t monochromatorType);
void vRunsMoveGratingToWl(uint16_t u16wl, uint8_t monochromatorType);
void vRunsMoveFilterToWl(uint16_t u16wl, uint8_t monochromatorType);
void vRunsMoveToSlitPos(uint8_t u8slitAxis, float fSlitWidth);
#endif
| [
"Jonathan.haas@bmglabtech.com"
] | Jonathan.haas@bmglabtech.com |
1f820bf8edce88cf12b8cdd510a73eeba890c650 | 0cd9d43dfd78f780491279dae9c3d40f381554ec | /lib/libft/ft_memchr.c | 0abbf4ddd033a9c95e95a1d1646afb0b87678b9a | [] | no_license | Anchenni/Cub3d | 64e3ba587781333706b7bc2b8016f1903748ff60 | e2108a5fbb141770349c3c6aab6f37cc386809c6 | refs/heads/master | 2023-04-20T14:11:01.423959 | 2021-05-07T21:08:34 | 2021-05-07T21:08:34 | 362,977,656 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,196 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: anchenni <anchenni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/14 13:50:55 by anchenni #+# #+# */
/* Updated: 2020/07/16 20:06:50 by anchenni ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
#include "libft.h"
void *ft_memchr(const void *s, int c, size_t n)
{
unsigned char *str;
size_t i;
if (!s || n <= 0)
return (0);
str = (unsigned char *)s;
i = 0;
while (i < n)
{
if (str[i] == (unsigned char)c)
return ((void*)(str + i));
i++;
}
return (NULL);
}
| [
"root@Anouars-MacBook-Pro.local"
] | root@Anouars-MacBook-Pro.local |
af4915f9f2c9394993ef1874f5fc444e95d75e99 | 09c81d6f33b89ac0f3835a249826f4fdafc76266 | /1.54inch_e-paper_module_c_code/STM32/STM32-F103ZET6/User/e-Paper/EPD_1in54c.c | 10d907b5bb9ebfb95b6ed576b5f94d18982b580a | [] | no_license | fprumbau/prototype | 2ce025c759d4bd2e49c5dae96e3d78ead442101b | 065c6465eac3968f9735eae881095118120de9b7 | refs/heads/master | 2020-06-13T02:22:32.724469 | 2019-06-30T15:02:41 | 2019-06-30T15:02:41 | 194,499,767 | 0 | 0 | null | null | null | null | ISO-8859-13 | C | false | false | 6,494 | c | /*****************************************************************************
* | File : EPD_1in54c.c
* | Author : Waveshare team
* | Function : Electronic paper driver
* | Info :
*----------------
* | This version: V2.0
* | Date : 2018-11-14
* | Info :
* 1.Remove:ImageBuff[EPD_HEIGHT * EPD_WIDTH / 8]
* 2.Change:EPD_Display(UBYTE *Image)
* Need to pass parameters: pointer to cached data
* 3.Change:
* EPD_RST -> EPD_RST_PIN
* EPD_DC -> EPD_DC_PIN
* EPD_CS -> EPD_CS_PIN
* EPD_BUSY -> EPD_BUSY_PIN
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documnetation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
******************************************************************************/
#include "EPD_1in54c.h"
#include "Debug.h"
/******************************************************************************
function : Software reset
parameter:
******************************************************************************/
static void EPD_Reset(void)
{
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(200);
DEV_Digital_Write(EPD_RST_PIN, 0);
DEV_Delay_ms(200);
DEV_Digital_Write(EPD_RST_PIN, 1);
DEV_Delay_ms(200);
}
/******************************************************************************
function : send command
parameter:
Reg : Command register
******************************************************************************/
static void EPD_SendCommand(UBYTE Reg)
{
DEV_Digital_Write(EPD_DC_PIN, 0);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Reg);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : send data
parameter:
Data : Write data
******************************************************************************/
static void EPD_SendData(UBYTE Data)
{
DEV_Digital_Write(EPD_DC_PIN, 1);
DEV_Digital_Write(EPD_CS_PIN, 0);
DEV_SPI_WriteByte(Data);
DEV_Digital_Write(EPD_CS_PIN, 1);
}
/******************************************************************************
function : Wait until the busy_pin goes LOW
parameter:
******************************************************************************/
static void EPD_WaitUntilIdle(void)
{
unsigned char busy;
do
{
EPD_SendCommand(0x71);
busy = DEV_Digital_Read(EPD_BUSY_PIN);
busy =!(busy & 0x01);
}
while(busy);
DEV_Delay_ms(200);
}
/******************************************************************************
function : Initialize the e-Paper register
parameter:
******************************************************************************/
UBYTE EPD_Init(void)
{
EPD_Reset();
EPD_SendCommand(0x06); //boost soft start
EPD_SendData(0x17);
EPD_SendData(0x17);
EPD_SendData(0x17);
EPD_SendCommand(0x04);
EPD_WaitUntilIdle();
EPD_SendCommand(0x00); //panel setting
EPD_SendData(0x0f); //LUT from OTP£¬160x296
EPD_SendData(0x0d); //VCOM to 0V fast
EPD_SendCommand(0x61); //resolution setting
EPD_SendData(0x98); //152
EPD_SendData(0x00); //152
EPD_SendData(0x98);
EPD_SendCommand(0X50); //VCOM AND DATA INTERVAL SETTING
EPD_SendData(0x77); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7
return 0;
}
/******************************************************************************
function : Clear screen
parameter:
******************************************************************************/
void EPD_Clear(void)
{
UWORD Width, Height;
Width = (EPD_WIDTH % 8 == 0)? (EPD_WIDTH / 8 ): (EPD_WIDTH / 8 + 1);
Height = EPD_HEIGHT;
//send black data
EPD_SendCommand(0x10);
for(UWORD i = 0; i < Height; i++) {
for(UWORD i = 0; i < Width; i++) {
EPD_SendData(0xFF);
}
}
//send red data
EPD_SendCommand(0x13);
for(UWORD i = 0; i < Height; i++) {
for(UWORD i = 0; i < Width; i++) {
EPD_SendData(0xFF);
}
}
//Display refresh
EPD_SendCommand(0x12);
EPD_WaitUntilIdle();
}
/******************************************************************************
function : Sends the image buffer in RAM to e-Paper and displays
parameter:
******************************************************************************/
void EPD_Display(const UBYTE *blackimage, const UBYTE *redimage)
{
UWORD Width, Height;
Width = (EPD_WIDTH % 8 == 0)? (EPD_WIDTH / 8 ): (EPD_WIDTH / 8 + 1);
Height = EPD_HEIGHT;
//send black data
EPD_SendCommand(0x10);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_SendData(blackimage[i + j * Width]);
}
}
//send red data
EPD_SendCommand(0x13);
for (UWORD j = 0; j < Height; j++) {
for (UWORD i = 0; i < Width; i++) {
EPD_SendData(redimage[i + j * Width]);
}
}
//Display refresh
EPD_SendCommand(0x12);
EPD_WaitUntilIdle();
}
/******************************************************************************
function : Enter sleep mode
parameter:
******************************************************************************/
void EPD_Sleep(void)
{
EPD_SendCommand(0X02); //power off
EPD_WaitUntilIdle();
EPD_SendCommand(0X07); //deep sleep
EPD_SendData(0xA5);
}
| [
"fprumbau@gmail.com"
] | fprumbau@gmail.com |
b139b9129f12197bcb83c2b33aa7214ba54dba95 | d8bc00e0fc53d0116f42fd64401b08bb75d12ae7 | /test/FilterTest.c | 80fa54eea3b5c6fcebc4ff562afe238de792c394 | [
"Apache-2.0"
] | permissive | aristanetworks/ctypegen | 2eea3423f885761c37eff10e29c2f7af3b6adef6 | aa02e71cdba319648e96c996276aa65d03ebfb33 | refs/heads/master | 2023-06-10T00:13:15.871958 | 2023-06-02T13:55:07 | 2023-06-02T16:05:12 | 134,200,269 | 29 | 9 | Apache-2.0 | 2020-04-01T21:37:06 | 2018-05-21T00:58:17 | Python | UTF-8 | C | false | false | 772 | c | /*
Copyright 2021 Arista Networks.
Licensed 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
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
struct FilterTrue {
} filterTrue;
struct FilterFalse {
} filterFalse;
struct FilterHint {
struct {
int field;
} anonInnerStruct;
} filterHint;
| [
"peadar@arista.com"
] | peadar@arista.com |
0f3edb29ce68944c4967e7a12901f51b58f06b86 | b796663433ec83132f492f31c4d4b29b3472e485 | /.history/quantcomp_20210322171446.c | 0a0e6faa292af80f53ad8b169ef9f369e47cc56f | [] | no_license | EwanThomas0o/PHYM004-Quantum-Computer-Simulation | 207ed34523c4e64948d7db309c5f3f01347f9a07 | 0d2ea2e0c24043420d3197a70c38b9eb94b8948b | refs/heads/main | 2023-03-25T13:49:15.950079 | 2021-03-26T12:10:29 | 2021-03-26T12:10:29 | 329,259,055 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 44,315 | c | /* Title: Quantum Computer Simulation PHYM004
Author: Ewan-James Thomas
File_name: quantcomp.c
License: Public Domain & GNU licensing
*/
/****************** PHYM004 PR2: Quantum Computer Simulation ******************/
//
// Purpose
// -------
//
// Usage
// -----
// All gates apart from measure_register return type wavefunction and so the wavefunction of the entire
// system must be updates with each gate call .
//
// Compiled with make file by using command "make quant -q 5" on command line. -q flag defines number of qubits.
// NOTE: Shor's Alg only works with 7 qubits
// Then execute the binary file with "make do"
// Example
// -------
//
/* UPDATES
Date Version Comments
---- ------- --------
13/01/21 0.0.1 Create file with intention to work on part 1: Building a quantum register
14/01/21 0.0.2 Quantum register of 3 qubits created. Now working on quantum gates for register
24/01/21 0.0.3 Measuring all Qbits in register now works with a different seed for rng each time based on TOD
24/01/21 0.0.4 Started working on Hadamard Gate
26/01/21 0.0.5 Hadamard gate for 3 qubits working, however not flexible wrt N
28/01/21 0.0.6 Hadamard gate working for general N
28/01/21 0.0.7 Same goes for phase gate
28/01/21 0.0.8 Implemented Grovers algorithm, not sure if working...
1/02/21 0.0.9 Grovers Algorithm corectly implemented.
1/02/21 0.1.0 Need to Generalise for any number of qubits, N as i keep getting memory problems
1/02/21 0.1.0 Fixed for general N, although some refinement needed
17/02/21 0.1.1 Implementing CNOT Gate. Error found. Will squash tomorrow.
18/02/21 0.1.2 CNOT implemented. NOT 100% correct.
18/02/21 0.1.3 CNOT implemented successfully
22/02/21 0.1.4 Trying to implement sparse matrices to speed up
22/02/21 0.1.4 using vector views etc to improve usability and speed (no need for memcpy)
22/02/21 0.1.5 Sparse matrices implemented, Need to create complex sparse multiplier
22/02/21 "" Some progress making complex sp matrix multiplier, not working 100% yet tho
23/02/21 "" Change matrices to ints (rather than doubles to save memory)
1/03/21 "" Handbuild complex sparse matrix multiplier seems to be working in test program but sets wf to zero here...
2/03/21 0.1.6 Phase gate now works! Was setting nz elements in spmatrix to 0!
8/03/21 0.2.0 CPhase working. Now on to implementing the non-quantum section of Shor's Alg
9/03/21 "" Working on step 4 of shors algorithm still. Some bugs need fixing.
9/03/21 0.3.0 Output of x~ is now correct for a=7, C=15, N=7
10/03/21 0.4.0 Now working on non-quantum steps, getting denominator from x-tilde and trying to find real period
11/03/21 0.4.1 Added a few functions to assist with finding the period, no success yet
12/03/21 0.5.0 Can use quantum method to factor :)
22/03/21 1.0.0 Implemented xmalloc (malloc wrapper)
22/03/21 1.0.0 Comments on all fucntions informing user of usage.
22/03/21 1.0.0 Reason for getting 1 and 15 is bc testP must be wrong see step 5 in paper
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <sys/time.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_complex_math.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_spmatrix.h>
#include <gsl/gsl_spblas.h>
#include "quantcomp.h"
#define BASIS 2
#define N 7 // Number of qubits defined
#define STATES_MAX 1024 //max of 10 qubits
#define L 3
#define M 4
struct timeval tv;
typedef struct primeFactors{
int a;
int b;
}primeFactors;
void* xmalloc(int bits){
void* ptr = malloc(bits);
if (ptr == NULL)
{
printf("Memory exhausted");
exit(0);
}
return ptr;
}
void qubit_error(){
printf("Please operate the gate on a valid qubit\n");
exit(1);
}
// Simply prints the probability amplitudes of each state.
//
// Arguments
// ---------
// [1] Wavefunction -> Contains probability amplitudes to be printed.
//
// Returns
// -------
// void
void print_wf(gsl_vector_complex* wavefunction){
for (int i = 0; i < wavefunction->size; i++){
printf("%lg + %lgi\n", GSL_REAL(gsl_vector_complex_get(wavefunction, i)), GSL_IMAG(gsl_vector_complex_get(wavefunction, i)));
}printf("\n")
}
// Hand built function based on cblas functions to multiply non sparse complex matrix and vecotrs and function used to
// multiply sparse matrices in COO format. Possible extensions in the future could be to allow this func to manage CCS and CRS
// formated matrices
//
// Argumnents
// ----------
// [1] CBLAS_TRANSPOSE_t -> is the matrix to be transposed or not, legacy feature.
// [2] A -> sparse complex matrix to be multiplied
// [3] x -> complex vector to be multiplied
// [4] y -> Where the procuct of A and x is stored.
//
// Returns
// -------
// [1] y -> The product of the matrix A and vector x
gsl_vector_complex* myMulFunc(const CBLAS_TRANSPOSE_t TransA,
gsl_spmatrix_complex *A, gsl_vector_complex *x,
gsl_vector_complex *y)
{
const size_t P = A->size1;
const size_t K = A->size2;
if ((TransA == CblasNoTrans && K != x->size) ||
(TransA == CblasTrans && P != x->size))
{
return NULL;
//GSL_ERROR("invalid length of x vector", GSL_EBADLEN);
}
else if ((TransA == CblasNoTrans && P != y->size) ||
(TransA == CblasTrans && K != y->size))
{
return NULL;
//GSL_ERROR("invalid length of y vector", GSL_EBADLEN);
}
else
{
size_t incX;
size_t lenX, lenY;
double *X, *Y;
double *Ad;
int *Ai, *Aj;
int p;
if (TransA == CblasNoTrans)
{
lenX = K;
lenY = P;
}
else
{
lenX = P;
lenY = K;
}
/* form y := op(A)*x */
Ad = A->data;
X = x->data;
incX = x->stride;
Y = y->data;
if (GSL_SPMATRIX_ISTRIPLET(A))
{
if (TransA == CblasNoTrans)
{
Ai = A->i;
Aj = A->p;
}
else
{
Ai = A->p;
Aj = A->i;
}
for (p = 0; p < (int) A->nz; ++p)
{
double ar = Ad[2*Ai[p]];
double ai = Ad[2*Ai[p]+1];
double xr = X[2*p*incX];
double xi = X[2*p*incX+1];
// printf("Multiplying %.3lg with %.3lg and %.3lg with %.3lg for real part of element\n", ar, xr, ai, xi);
// printf("Multiplying %.3lg with %.3lg and %.3lg with %lg for imag part of element\n", ar, xi, ai, xr);
gsl_vector_complex_set(y, Aj[p], gsl_complex_rect((ar * xr - ai * xi), (ar * xi + ai * xr)) );
}
}
else
{
return NULL;
//GSL_ERROR("unsupported matrix type", GSL_EINVAL);
}
return y;
}
}
// Creates a wavefunction where all spins are "down" i.e. |00..0>.
// A 1 in the ket represents a spin down. e.g. |010> means all qubits are spin down apart from qbit 2. Note how 010 is 2 in binary.
// Since 000 is 0 in binary, we set probability amplitude of state 0 to 1.
// Arguments
// ---------
// [1] states -> The number of total states for the system. This depends on the number of quibits defined and the basis vector.
//
// Returns
// ---------
// [1] wavefunction of gsl_vector_complex type initialised to probability of 1 for all qubits in spin down state |000>
gsl_vector_complex* initWavefunctionSpinDown(int states){
gsl_vector_complex* wavefunction = NULL;
wavefunction = gsl_vector_complex_alloc(states);
// Probability amplitude stored in "wavefuction" vector
gsl_vector_complex_set(wavefunction, 0, GSL_COMPLEX_ONE);
return wavefunction;
}
// Set the probability amplitudes of all states to 1/sqrt(basis^N) so equal probability of wavefunction collapsing into any state.
// Arguments
// ---------
// [1] states -> The number of total states for the system. This depends on the number of quibits defined and the basis vector.]
//
// Returns
// ---------
// [1] wavefunction of gsl_vector_complex type initialised so that there is equal chance to find the system in every state.
gsl_vector_complex* initWavefunctionEqualProb(int states){ //Initialising wf to "Equal Probability" of all states
gsl_vector_complex* wavefunction = NULL;
wavefunction = gsl_vector_complex_alloc(states);
gsl_vector_complex_set_all(wavefunction , gsl_complex_rect(1/sqrt(pow(BASIS, N)), 0));
return wavefunction;
}
// Initialises the wavefunction of the system to |00...01> as required by Shor's Algorithm
// Arguments
// ---------
// [1] States -> Number of possible quantum states
//
// Returns
// -------
// [1] wavefunction -> wf initialised to |00...01>
gsl_vector_complex* initWavefunctionShors(int states){ //Initialising wf to "Equal Probability" of all states
gsl_vector_complex* wavefunction = NULL;
wavefunction = gsl_vector_complex_alloc(states);
gsl_vector_complex_set(wavefunction, 1, GSL_COMPLEX_ONE);
return wavefunction;
}
// Takes an integer and return binary representation in string format
// Arguments
// ---------
// [1] a -> The integer number that is to be turned into a binary string
//
// Returns
// ---------
// [1] a string that is the binary representation of the integer a
char* intToBinary(int a){
int bin = 0;
int remainder, temp = 1;
while(a != 0){
remainder = a % 2;
a /= 2;
bin += remainder*temp;
temp *= 10;
}
char *bin_str = (char *) xmalloc(N*sizeof(char));
sprintf(bin_str, "%02d", bin);
return bin_str;
}
// Uses pointers to update the wavefunction, rather than using memcopy which has complexity 0(n^2)
//
// Arguments
// ---------
// [1] new_state -> The state that we wavefunction will be updated to
// [2] wavefunction -> The wavefuction that describes the system that is to be updated
// Returns
// -------
// [1] An updated wavefunction of type gsl_vector_complex
gsl_vector_complex* swapsies(gsl_vector_complex* new_state, gsl_vector_complex* wavefunction){
//update the old wf with the new
gsl_vector_complex** ptr1 = &new_state;
gsl_vector_complex** ptr2 = &wavefunction;
gsl_vector_complex* temp;
temp = *ptr1;
*ptr1 = *ptr2;
*ptr2 = temp;
gsl_vector_complex_free(new_state);
return wavefunction;
}
// A function that alllows one to multiply a complex vector and a real sparse matrix, involves splitting vector into two "views"
//
// Arguments
// ---------
// [1] vector -> The vector that is to be multipled
// [2] matrix -> Matrix to be multiplied
//
// Returns
// -------
// [1] mv -> matrix*vector result of type gsl_vector_complex
gsl_vector_complex* complexVecMultRealMat(gsl_vector_complex* vector, gsl_spmatrix* matrix){
// Splitting vector up into real and imag
gsl_vector_view real = gsl_vector_complex_real(vector); // Temp object on the stack so not mem intensive
gsl_vector_view imag = gsl_vector_complex_imag(vector);
gsl_vector_complex* mv = gsl_vector_complex_alloc(vector->size);
gsl_vector_view new_real = gsl_vector_complex_real(mv);
gsl_vector_view new_imag = gsl_vector_complex_imag(mv);
gsl_spblas_dgemv(CblasNoTrans, 1.0, matrix, &real.vector, 0.0, &new_real.vector);
gsl_spblas_dgemv(CblasNoTrans, 1.0, matrix, &imag.vector, 0.0, &new_imag.vector);
return mv;
}
// Get unitary matrix in sparse format COO
//
// Arguments
// ---------
// [1] matrix -> Matrix to become unit amtrix
//
// Returns
// -------
// [1] matrix -> unit matrix in sparse form
gsl_spmatrix* spmatrixIdentity(gsl_spmatrix* matrix){
int i = 0;
int j = 0;
while(i < matrix->size1 && j < matrix->size2)
{
gsl_spmatrix_set(matrix, i ,j, 1);
i++;
j++;
}
return matrix;
}
// Arguments
// ---------
// [1] matrix -> The matrix that is to be printed
void print_matrix(gsl_spmatrix_complex* matrix){
for(int i = 0; i < matrix->size1;i++){
for(int j = 0; j < matrix->size2; j++){
printf("%.3lg + %.3lgi\t", GSL_REAL(gsl_spmatrix_complex_get(matrix, i, j)), GSL_IMAG(gsl_spmatrix_complex_get(matrix, i, j)));
}printf("\n");
}
}
// To measure the quantum state we must use the discrete probability distribution provided by the
// wavefuntion. The measurement function finds the probabilities of each state and observes the wf
// according to those probabilities using a random number generator. After measurement the wavefunction is "collapsed" and gives the
// measurement over and over again.
// Arguments
// ---------
// [1] Wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
char* measureRegisterGate(gsl_vector_complex* wavefunction){
int states = (int) wavefunction->size;
double probabilities[states];
for(int i = 0; i < states; i++){ //creating a list of the probabilities (non-normalised)
probabilities[i] = GSL_REAL(gsl_vector_complex_get(wavefunction,i))*GSL_REAL(gsl_vector_complex_get(wavefunction,i)) + GSL_IMAG(gsl_vector_complex_get(wavefunction,i))*GSL_IMAG(gsl_vector_complex_get(wavefunction,i));
}
gsl_ran_discrete_t* lookup = gsl_ran_discrete_preproc(states, probabilities); // Preproc normalises the probabilities given by wf
gettimeofday(&tv,NULL); // Get time of day in usec so that the seed changes giving a different stream of #'s each time
unsigned long int seed = tv.tv_usec; // Seed depends on time of day so repeates every 24 hours.
gsl_rng* r = gsl_rng_alloc(gsl_rng_mt19937); // Mersene Twister Algorithm is used for high quality random numbers
gsl_rng_set(r, seed);
size_t t = gsl_ran_discrete(r, lookup); // Choosing from the discrete probability distribution defined by the wavefunction probability amplitudes
// Wavefunction collapsed so will only find system in the state from now on
printf("Wavefunction collapsed into the state:\n|%s>\n", intToBinary(t));
gsl_vector_complex_set_all(wavefunction, GSL_COMPLEX_ZERO);
gsl_vector_complex_set(wavefunction, t, GSL_COMPLEX_ONE); // Set measured state to probability one so that if we measure again we get the same outcome
// Free memory to avoid bloats
gsl_ran_discrete_free(lookup);
gsl_rng_free(r);
return intToBinary(t);
}
// This function will find the element of the tensor product for a given gate for one qubit
// Arguments
// ---------
// [1] inta -> the row of the desired element in base 2
// [2] intb -> the col of the desired element in base 2
// [3] qubit -> specifies which qubit the Hadamard gate will be acting upon.
// Returns
// ---------
// [1] The value of the abth element of the corrresponding hadamard gate
double findElementHad(char* inta, char* intb, int qubit){
// Hadamard gate for single qubit used to calculate tensor product
gsl_matrix *hadamard_single = gsl_matrix_alloc(BASIS, BASIS);
gsl_matrix_set_all(hadamard_single, 1/sqrt(BASIS));
gsl_matrix_set(hadamard_single,1,1, -1/sqrt(BASIS));
double value = 1.0;
for(int i = 0; i < N; i++){
if(inta[i] != intb[i] && i != qubit - 1){
// Invokes Kronecker delta
return 0.0;
}
value = gsl_matrix_get(hadamard_single, inta[qubit-1] - '0', intb[qubit -1] - '0');
}
gsl_matrix_free(hadamard_single);
return value;
}
// This function calculates values of the phase matrix for a system of arbitrary size in an element-wise method.
// Arguments
// ---------
// [1] inta -> the row of the desired element in base 2
// [2] intb -> the col of the desired element in base 2
// [3] qubit -> specifies which qubit the Phase gate will be acting upon.
// [4] phi -> The angle of rotation
// Returns
// ---------
// [1] The value for the abth element of the corresponding phase matrix
gsl_complex findElementPhase(char* inta, char* intb, int qubit, double phi){
// Phase gate for single qubit used to calculate tensor product
gsl_matrix_complex *phase_single = gsl_matrix_complex_alloc(BASIS, BASIS);
gsl_matrix_complex_set_identity(phase_single);
gsl_matrix_complex_set(phase_single,1,1, gsl_complex_polar(1,phi));
gsl_complex value = gsl_complex_rect(1,0);
for(int i = 0; i < N; i++){
if(inta[i] != intb[i] && i != qubit - 1){
return GSL_COMPLEX_ZERO; // Invokes Kronecker delta
}
value = gsl_matrix_complex_get(phase_single, inta[qubit-1] - '0', intb[qubit -1] - '0');
}
gsl_matrix_complex_free(phase_single);
return value;
}
// This function calculates values of the cnot matrix for a system of arbitrary size in an element-wise method.
// Arguments
// ---------
// [1] row -> the row of the desired element in base 2
// [2] col -> the col of the desired element in base 2
// [3] control_qubit -> specifies which qubit acts as the control
// [4] target_qubit -> specifies target qubit
// [5] num_qubits -> total number of qubits
// Returns
// ---------
// [1] The value of the row-columnth element of the corresponding CNOT gate
double findElementCnot(char* row, char* col, int control_qubit, int target_qubit, int num_qbits){
// Defining the two qubit cnot gate that we will draw values from
gsl_matrix *cnot = gsl_matrix_alloc(BASIS*BASIS, BASIS*BASIS);
gsl_matrix_set_zero(cnot);
gsl_matrix_set(cnot, 0, 0, 1);
gsl_matrix_set(cnot, 1, 1, 1);
gsl_matrix_set(cnot, 2, 3, 1);
gsl_matrix_set(cnot, 3, 2, 1);
for(int i = 0; i < num_qbits; i++){
// Employ the deltas first
char char1 = row[i];
char char2 = col[i];
if(i != target_qubit-1 && i != control_qubit-1 && char1!=char2){
// If an element of row and col strings not a match on any element other that targ or contr then we know
// a delta will set the whole element to zero
return 0.0;
}
}
// If deltas dont cause the value to be zero then we find corresponding element from cnot matrix
char str1[] = "00";
char str2[] = "00";
// Pushing the control qubit to the front of row and col string
str1[0] = row[control_qubit-1];
str1[1] = row[target_qubit-1];
str2[0] = col[control_qubit-1];
str2[1] = col[target_qubit-1];
// Need to go from binary to dec to find the element
long row_index = strtol(str1, NULL, 2);
long col_index = strtol(str2, NULL, 2);
double value = gsl_matrix_get(cnot, row_index, col_index);
gsl_matrix_free(cnot);
return value;
}
// Gate used to calculate f(x) on the l register
// Arguments
// ---------
// [1] control -> which qubit is the control qubit
// [2] a -> random number between 1 and C
// [2] C -> Composite number to be factorised
// [3] wavefunction -> The wavefunction that describes the system that is to be updated.
//
// Returns
// -------
// [1] -> updated wavefunction after multiplying by f(x)
gsl_vector_complex* amodcGate(int control, int a, int C, gsl_vector_complex* wavefunction){ // only need to cycle through rows as permutation matrix
gsl_vector_complex* newState = gsl_vector_complex_alloc(wavefunction->size);
double A;
double A0 = (double) (a % C);
double A1 = (double) ((int)pow((double)a, 2.0) % C);
double A2 = (double) ((int)pow((double)a, 4.0) % C);
if (control == 3)
{
A = A0;
}
if (control == 2)
{
A = A1;
}
if (control == 1)
{
A = A2;
}
gsl_spmatrix* amodx = gsl_spmatrix_alloc(128, 128);
for(int k = 0; k < amodx->size2; k++){
char* binK = intToBinary(k);
if(binK[control-1] - '0' == 0){
gsl_spmatrix_set(amodx, k, k, 1.0);
}
if (binK[control-1] - '0' != 0)
{
char* f = xmalloc(4);
strlcpy(f, binK+3, 4+1); // Taking the substring m3m2m1m0 from l2l1l0m3m2m1m0
if( (int)strtol(f, NULL, 2) >= C){
gsl_spmatrix_set(amodx, k, k, 1.0);
}
else if(binK[control-1] - '0' != 0 && (int)strtol(f, NULL, 2) < C)
{
int fprime = (int)A*strtol(f, NULL, 2) % C; // f' = f*A*mod(C)
char* binFprime = xmalloc(N); // a char is one byte
binFprime = intToBinary(fprime);
char *l = xmalloc(N);
strlcpy(l, binK, 3+1);
strncat(l, binFprime+3, 4);
int j = (int)strtol(l, NULL, 2);
gsl_spmatrix_set(amodx, j, k, 1.0);
free(l);
free(binFprime);
free(f);
}
free(binK);
}
}
newState = complexVecMultRealMat(wavefunction, amodx);
return swapsies(newState, wavefunction);
}
// This function calculates values of the cphase matrix for a system of arbitrary size in an element-wise method.
// Arguments
// ---------
// [1] row -> the row of the desired element in base 2
// [2] col -> the col of the desired element in base 2
// [3] control_qubit -> specifies which qubit acts as the control
// [4] target_qubit -> specifies target qubit
// [5] num_qubits -> total number of qubits
// Returns
// ---------
// [1] The value of the row-columnth element of the corresponding cphase gate
gsl_complex findElementCphase(char* row, char* col, int control_qubit, int target_qubit, int num_qbits, double phase){
// Defining the two qubit cphase gate that we will draw values from
gsl_spmatrix_complex *cphase = gsl_spmatrix_complex_alloc(BASIS*BASIS, BASIS*BASIS);
gsl_spmatrix_complex_set_zero(cphase);
gsl_spmatrix_complex_set(cphase, 0, 0, GSL_COMPLEX_ONE);
gsl_spmatrix_complex_set(cphase, 1, 1, GSL_COMPLEX_ONE);
gsl_spmatrix_complex_set(cphase, 2, 2, GSL_COMPLEX_ONE);
gsl_spmatrix_complex_set(cphase, 3, 3, gsl_complex_polar(1, phase));
for(int i = 0; i < num_qbits; i++){
// Employ the deltas first
char char1 = row[i];
char char2 = col[i];
if(i != target_qubit-1 && i != control_qubit-1 && char1!=char2){
// If an element of row and col strings not a match on any element other that targ or contr then we know
// a delta will set the whole element to zero
return GSL_COMPLEX_ZERO; // may not need to return this as using spmatrix and these are all initialised to zero anyway!
}
}
// If deltas dont cause the value to be zero then we find corresponding element from cphase matrix
char str1[] = "00";
char str2[] = "00";
// Pushing the control qubit to the front of row and col string
str1[0] = row[control_qubit-1];
str1[1] = row[target_qubit-1];
str2[0] = col[control_qubit-1];
str2[1] = col[target_qubit-1];
// Need to go from binary to dec to find the element location
long row_index = strtol(str1, NULL, 2);
long col_index = strtol(str2, NULL, 2);
gsl_complex value = gsl_spmatrix_complex_get(cphase, row_index, col_index);
gsl_spmatrix_complex_free(cphase);
return value;
}
// Controlled phase gate. Architecture based of Cnot gate
// Arguments
// ---------
// [1] wavefunction -> The wavefunction that describes the system that is to be updated.
// [2] control -> defines control qubit
// [3] target -> defines target qubit
// [4] phase -> defined the angle \theta used in e^{i\theta}
//
// Returns
// -------
// [1] -> wavefunction -> updated wavefunction
gsl_vector_complex* CphaseGate(gsl_vector_complex* wavefunction, int control, int target, double phase){
/* Will need to only put val if val is non-zero due to sparse nature, need to use myMulFunc in order to multiply
complex matrix by complex vector */
gsl_spmatrix_complex* cphasegate = gsl_spmatrix_complex_alloc(wavefunction->size, wavefunction->size);
for(int i = 0; i < wavefunction->size; i++){
for(int j = 0; j < wavefunction->size; j++){
gsl_complex val = findElementCphase(intToBinary(i), intToBinary(j), control, target, N, phase);
if(GSL_REAL(val) == 0 && GSL_IMAG(val) == 0){
/* Do Nothing */
}
else{
gsl_spmatrix_complex_set(cphasegate, i , j, val);
}
}
}
gsl_vector_complex* r_psi = gsl_vector_complex_alloc(wavefunction->size);
myMulFunc(CblasNoTrans, cphasegate, wavefunction, r_psi); // complex sparse multiplier, works with COO only
/* Maybe use the same block of memory for the matrix and vectors? */
return swapsies(r_psi, wavefunction);
}
// The Hadamard gate operates on the register by setting qubits into a superposition of their basis states.
// This function does this by allowing the user to specify which qubit we will be setting to a superposition.
// This will have effects when it comes to measuring the whole register as sometimes that qubit will be spin up,
// sometimes it will be spin down, which will change the overall state of the register.
// Arguments
// ---------
// [1] Wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
// [2] qubit -> specifies which qubit the Hadamard gate will be acting upon.
// Returns
// ---------
// [1] Wavefunction after entire register has been acted on by desired hadamard gate.
gsl_vector_complex* hadamardGate(gsl_vector_complex* wavefunction, int qubit){
if(qubit > N){
printf("Please operate the gate on a valid qubit\n");
exit(0);
}
// Will beome the NxN matrix for operation on whole register
gsl_spmatrix *hadamard = gsl_spmatrix_alloc(wavefunction->size, wavefunction->size);
for(int i = 0; i < wavefunction->size; i++){
for(int j = 0; j < wavefunction->size; j++){
double val = findElementHad(intToBinary(i), intToBinary(j), qubit);
gsl_spmatrix_set(hadamard, i , j, val);
}
}
gsl_vector_complex* h_psi = gsl_vector_complex_alloc(wavefunction->size);
h_psi = complexVecMultRealMat(wavefunction, hadamard);
return swapsies(h_psi, wavefunction); ; //updates wf to new state using pointers rather than memcopy
}
// A phase gate does not alter the probabilites of finding the the system in a given state,
// however it does alter the relative phase between the states. Quantum phase cannot be measured
// directly, however it can have effects if more gates are subsequently applied before register measuremnt.
// Arguments
// ---------
// [1] Wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
// [2] qubit -> specifies which qubit the phase shift gate is operating on.
// [3] phase -> the angle of rotation
// Returns
// ---------
// [1] Wavefunction after entire register has been acted upon by desired phase shift gate
gsl_vector_complex* phaseShiftGate(gsl_vector_complex *wavefunction, int qubit, double phase){
if(qubit > N){
printf("Please operate the gate on a valid qubit\n");
exit(0);
}
// Will beome the NxN matrix for operation on whole register
gsl_spmatrix_complex *phaseGate = gsl_spmatrix_complex_alloc(wavefunction->size, wavefunction->size);
for(int i = 0; i < wavefunction->size; i++){
for(int j = 0; j < wavefunction->size; j++){
gsl_complex val = findElementPhase(intToBinary(i), intToBinary(j), qubit, phase);
if(GSL_REAL(val) == 0 && GSL_IMAG(val) == 0){
/* Do Nothing */
}
else{
gsl_spmatrix_complex_set(phaseGate, i , j, val);
}
}
}
gsl_vector_complex* r_psi = gsl_vector_complex_alloc(wavefunction->size);
print_matrix(phaseGate);
myMulFunc(CblasNoTrans, phaseGate, wavefunction, r_psi); // complex sparse multiplier, works with COO only
return r_psi;
}
// Quantum oracle gate used in grovers quantum search algorithm. Argument answer is the "Correct question" mentioned
// in paper
// Arguments
// ---------
// [1] wavefunction ->
// [2] answer -> which state is the "correct" states
//
// Returns
// -------
// [1] wavefunction -> updated wf
gsl_vector_complex* oracleGate(gsl_vector_complex* wavefunction, int answer){
gsl_spmatrix* oracleGate = gsl_spmatrix_alloc(wavefunction->size, wavefunction->size);
spmatrixIdentity(oracleGate);
gsl_spmatrix_set(oracleGate, answer-1, answer-1, -1); //Minus one as index from 0
gsl_vector_complex* o_psi = gsl_vector_complex_alloc(wavefunction->size);
o_psi = complexVecMultRealMat(wavefunction, oracleGate);
return swapsies(o_psi, wavefunction);
}
// Unity matrix of size 2^N*2^N with -1 in the 0,0th element
//
// Arguments
// ---------
// [1] wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
//
// Returns
// -------
// [1] wavefunction -> wavefunction after muliplication with j gate
gsl_vector_complex* jGate(gsl_vector_complex* wavefunction){
gsl_spmatrix* jGate = gsl_spmatrix_alloc(wavefunction->size, wavefunction->size);
spmatrixIdentity(jGate);
gsl_spmatrix_set(jGate, 0, 0, -1);
gsl_vector_complex* j_psi = gsl_vector_complex_alloc(wavefunction->size);
j_psi = complexVecMultRealMat(wavefunction, jGate);
return swapsies(j_psi, wavefunction);
}
// An ensemble of gates that are used within grovers block
// Arguments
// ---------
// [1] wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
// [2] Answer -> The right choice in grovers alg
// Returns
// -------
// [1] wavefunction -> wavefunction after muliplication with j gate
gsl_vector_complex* groversBlock(gsl_vector_complex* wavefunction, int answer){
gsl_vector_complex* b_psi = gsl_vector_complex_alloc(wavefunction->size);
gsl_vector_complex_set_zero(b_psi);
//First operation in the block is to apply a quantum oracle gate
b_psi = oracleGate(wavefunction, answer);
//Then we apply a hadamard gate to each gate
for(int i = 1; i < N+1; i++){
b_psi = hadamardGate(b_psi, i); // +1 bc had takes in canonical qubit number.
}
// Apply the j gate
b_psi = jGate(b_psi);
// Finally a hadamard gate on each qubit again
for(int j = 1; j < N+1; j++){
b_psi = hadamardGate(b_psi, j);
}
return b_psi;
}
// The controlled-not gate operates on two qubits. The target and the control. If the control is |1>, the target quibit is flipped
// irrespective of its value. If the control qubit is |0> the target remains unchanged.
//
// Arguments
// ---------
// [1] Wavefunction -> Defines the state of the system with probability amplitudes of possible configurations
// [2] Control -> Specifies the control qubit (Min: 0 ; Max: 2^N-1 )
// [3] target -> Specifies the target qubit (Min: 0 ; Max: 2^N-1 )
//
// Returns
// -------
// [1] Wavefunction -> Wavefunction after manipulation by the cnot gate
gsl_vector_complex* cnotGate(gsl_vector_complex* wavefunction, int control, int target){
gsl_vector_complex* c_psi = gsl_vector_complex_alloc(wavefunction->size);
gsl_vector_complex_set_zero(c_psi);
gsl_spmatrix *cnot = gsl_spmatrix_alloc(wavefunction->size, wavefunction->size);
for(int i = 0; i < wavefunction->size; i++){
for(int j = 0; j < wavefunction->size; j++){
gsl_spmatrix_set(cnot, i, j, findElementCnot(intToBinary(i), intToBinary(j), control, target, N));
}
}
c_psi = complexVecMultRealMat(wavefunction, cnot);
return swapsies(c_psi, wavefunction);
}
// Given a composite number, i.e. the product of two primes, Shors alg is able to factorise this composite number faster than any classic algorithm. Use a high degree of encapsulation here.
//
// Arguments
// ---------
// [1] composite_number -> number that is to be factored
//
// Returns
// -------
// [1] Factor
int isPower(int number){
if (number % 2 == 0) // Checking if number is even or power of two
{
return 2;
}
for(int i = 3; i < (int)(number / 3); i++){ //Starting with seeing if 3^n == number for a whole number n, then to 4^n etc
double n = log(number) / log(i);
if(ceil(n) == n){ //Checking if power of a smaller number
return pow(i,n);
}
}
return 1;
}
// Utilising Euclids algorithm (recursive) to find GCD
//
// Arguments
// ---------
// [1] n1 -> number 1
// [2] n2 -> number 2
//
// Returns
// -------
// [1] greatest common divisor of n1 and n2
int greatestCommonDivisor(int n1, int n2){
if(n2 != 0){
return greatestCommonDivisor(n2, n1 % n2); //Call until n2 is set to zero
}
else
{
return n1;
}
}
// Given a string, this function will reverse it. Used in finding xtilde
// Arguments
// ---------
// [1] string -> to be reversed
//
// Returns
// -------
// [1] rev -> reversed string
char* reverseString(const char* string){
char* rev;
int begin, end, count;
count = strlen(string);
rev = xmalloc(count);
end = count - 1;
for(begin = 0; begin < count; begin++)
{
rev[begin] = string[end];
end--;
}
// Not forgetting the terminating charecter
rev[begin] = '\0';
return rev;
}
// Obtains the values of qubits in the x register by measuring the wf, then turns result into the IQFT.
// Arguments
// ---------
// [1] wavefunction -> Describes state of the system.
//
// Returns
// -------
// [1] xtilde -> The IQFT of the x register
int readsXReg(gsl_vector_complex* wavefunction){
//Wavefunction needs to be collapsed in order for this to work properly! Add a measure gate just to be sure it is collapsed
char* state;
char* binXTransformed;
// After wf is collapsed we measure which state it's in, turn this number into binary, then read the first 3 digits in reverse
// and convert back into base 10 to find the fourier trans of x
state = measureRegisterGate(wavefunction);
binXTransformed = xmalloc(3); // use xmalloc??
if(binXTransformed == NULL){
printf("Malloc failed");
}
strlcpy(binXTransformed, state, 4); // 4 to include terminating charecter for security as apposed to strncpy()
// Need to reverse binXTransformed
binXTransformed = reverseString(binXTransformed);
// printf("%s\n", binXTransformed);
int xTilde = (int)strtol(binXTransformed, NULL, 2);
printf("x tilde = %d\n", xTilde);
free(binXTransformed);
return xTilde;
}
// Gives numerator and demoninator of a fraction
// Arguments
// ---------
// [1] number -> decimal number
// [2] ->
//
// Returns
// -------
// [1] ints -> returns a type containing a pair of ints. In this case they represent the numerator and denominator
primeFactors decimalToFraction(double decimalNum){
primeFactors ints;
double intVal = floor(decimalNum);
double decVal = decimalNum - intVal;
double pVal = 1000000000;
int gcd = greatestCommonDivisor(round(decVal * pVal), pVal);
double num = round(decVal * pVal) / gcd;
double deno = pVal / gcd;
ints.a = intVal * deno + num; //top
ints.b = deno; //bottom
return ints;
}
// Checks to see whether the period generated is suitable according to rules set out by
// D. Candela
// Arguments
// ---------
// [1] a -> Random number chosen between 1 and C
// [2] p -> period attempt
// [3] C -> Composite number
//
// Return
// ------
// [1] 0 if p is not suitable, in this case go back and pick a new a!
// [2] 1 if p is all good for usage
int testP(int a, int p, int C){
double congruence = (double)(((int)pow((double)a, (double)p/2)) % C);
printf("congruence = %lg\n", congruence);
double minusOneCongruence = 14;
// printf("%lg", congruence);
if((p % 2 == 0 /*is even*/ && congruence == minusOneCongruence) || (p % 2 != 0) /* ensuring a^p/2 != -1 mod(C)*/ ){
// If this is the case we need to pick a new "a" or rand, as i've called it in shors().
return 1;
}
else
{
return 0;
}
}
// Chooses a random int between 1 and C.
// Arguments
// ---------
// [1] compositeNumber -> known as C in rest of code. The number that will be factored.
//
// Returns
// -------
// [1] rand -> Random int between 1 and compositeNumber
int getRand(int compositeNumber){
gsl_rng * r = gsl_rng_alloc (gsl_rng_mt19937); // High quality random number generator
gettimeofday(&tv,NULL);
unsigned long int seed = tv.tv_usec; // Seed depends on time of day so repeates every 24 hours.
gsl_rng_set(r, seed);
int rand = 0;
while (rand < 2)
{
rand = gsl_rng_uniform_int(r, compositeNumber); // Goes until rand is in range 1 < rand < C
}
// printf("rand %d\n", rand);
gsl_rng_free(r);
return rand;
}
// All gates needed to set up Shor's algorithm
// Arguments
// ---------
// [1] wavefunction -> Description of system to be updated
// [2] rand -> the "a" for a given attempt of shor's alg
// [3] compositeNumber -> The number to be factored.
// Returns
// -------
// [1] wavefunction -> updated wavefunction
gsl_vector_complex* shorsBlock(gsl_vector_complex* wavefunction, int rand, int compositeNumber){
// Applying hadamard gates to the x register
wavefunction = initWavefunctionShors(wavefunction->size);
for(int xQubitHad = 1; xQubitHad < M; xQubitHad++){
wavefunction = hadamardGate(wavefunction, xQubitHad);
}
// Multiplying f register by f(x)
for(int xQubitCGate = L; xQubitCGate > 0; xQubitCGate--){
wavefunction = amodcGate(xQubitCGate, rand, compositeNumber, wavefunction);
}
// IQFT block--------------------------------------------
wavefunction = hadamardGate(wavefunction, 1);
wavefunction = CphaseGate(wavefunction, 1, 2, M_PI_2);
wavefunction = CphaseGate(wavefunction, 1, 3, M_PI_4);
wavefunction = hadamardGate(wavefunction, 2);
wavefunction = CphaseGate(wavefunction, 2, 3, M_PI_2);
wavefunction = hadamardGate(wavefunction, 3);
return wavefunction;
}
// Stitches together multiple functions in order to execute full shor's algorithm
// Arguments
// ---------
// [1] wavefunction ->
// [2] compositeNumber ->
//
// Returns
// -------
// [1] Factors -> non-trivial factors of the composite number
primeFactors shors(gsl_vector_complex* wavefunction, int compositeNumber){
wavefunction = initWavefunctionShors(wavefunction->size);
primeFactors factors;
factors.a = 0;
factors.b = 0;
// Step 1 in SA
int isp = isPower(compositeNumber);
if(isp != 1){
factors.a = isp;
factors.b = (int) compositeNumber / isp;
printf("factor a = %d \n factor b = %d", factors.a, factors.b);
return factors;
}
// Step 2 in SA
// if not a factor of two or a power of another number, pick a random number between 1 and compositeNumber
int rand = getRand(compositeNumber);
// Now we have our "a", we can now carry out the quantum part of shors algorithm
int gcf = greatestCommonDivisor(rand, compositeNumber);
if( gcf > 1){
factors.a = gcf;
factors.b = (int)compositeNumber/gcf;
printf("factor a = %d \nfactor b = %d\n", factors.a, factors.b);
return factors;
}
// Finding the period p
wavefunction = shorsBlock(wavefunction, rand, compositeNumber);
// Measure the wavefunction to collapse is and observe the IQFT of x
// print_wf(wavefunction);
double omega = (double) readsXReg(wavefunction) / pow(2,L);
// need an if omega = 0 to reset as cannot obtain a period guess from this as not expressable as a fraction.
printf("omega try 1 = %lg\n", omega);
//Now we need to get p from omega! omega = s/p, and then try some factors of s/p i.e. if omega = 0.5 then omega = 1/2 = 2/4 = 4/8, so we try 2,4,8 to fit aP con 1 mod c
// Remember we need the smallest value of p that satisfies this rule!
// Hopefully this while will ensure we never measure a zero on the x reg. The 0 contains no infomation about the period
int i = 2;
while(omega == 0){
wavefunction = shorsBlock(wavefunction, rand, compositeNumber);
omega = (double) readsXReg(wavefunction) / pow(2,L);
printf("omega try %d = %lg\n",i, omega);
i++;
}
// omega = 0.75 = 3/4 = 6/8
// omega = 0.25 = 1/4 = 2/8
// Now we have an omega in the form s/p, we try the values of p proposed.
int p = decimalToFraction(omega).b; //Extract the denominator from the fraction
printf("Denominator = %d\n", p);
// Checking for true period
for (size_t i = 1; i < N; i++)
{
double periodTrial = i*p;
printf("rand = %d\n", rand);
double k = (double)((int)pow((double)rand, periodTrial) % compositeNumber);
double oneCongruence = 1 % compositeNumber;
printf("Check to see if 1 mod(15) = %d^%lg mod(15)\nk = %lg and 1 mod(15) = %lg\n",rand, periodTrial, k, oneCongruence);
if(k == oneCongruence) //How we check for congruence, ensuring we have the right period.
{
int test = testP(rand, periodTrial, compositeNumber);
if(test == 0){
factors.a = greatestCommonDivisor( pow(rand, (periodTrial)/2) + 1, compositeNumber);
factors.b = greatestCommonDivisor( pow(rand, (periodTrial)/2) - 1, compositeNumber);
printf("a = %d b = %d\n", factors.a, factors.b);
return factors;
}
else
{ // Going back and choosing another a
factors = shors(wavefunction, compositeNumber);
}
}
}
return factors;
}
// int main(){
// int states = (int)pow(BASIS, N);
// gsl_vector_complex* wavefunction = initWavefunctionShors(states);
// //Putting system into equal super position of superposition all 2^N basis'
// // wavefunction = hadamardGate(wavefunction, 1);
// // wavefunction = hadamardGate(wavefunction, 2);
// // wavefunction = hadamardGate(wavefunction, 3);
// // // wavefunction = cnotGate(wavefunction, 1,2 );
// // // wavefunction = CphaseGate(wavefunction, 2, 1, M_PI_4);
// // // for(int i = 0; i < floor(M_PI_4*sqrt(pow(2,N))); i++){ // Needs to be called "floor(pi/4*sqrt(2^N))"" times for optimum output roughly 2 in our case
// // // wavefunction = groversBlock(wavefunction, 7); //Second argument is the basis state you want to be "right" in this case its |110>
// // // }
// // wavefunction = amodcGate(3, 7, 15, wavefunction);
// // wavefunction = amodcGate(2, 7, 15, wavefunction);
// // wavefunction = amodcGate(1, 7, 15, wavefunction);
// // // // IQFT block
// // wavefunction = hadamardGate(wavefunction, 1);
// // wavefunction = CphaseGate(wavefunction, 1, 2, M_PI_2);
// // wavefunction = CphaseGate(wavefunction, 1, 3, M_PI_4);
// // wavefunction = hadamardGate(wavefunction, 2);
// // wavefunction = CphaseGate(wavefunction, 2, 3, M_PI_2);
// // wavefunction = hadamardGate(wavefunction, 3);
// // // wavefunction = phaseShiftGate(wavefunction, 3, 3.14159);
// // shors(wavefunction, 15);
// // print_wf(wavefunction);
// // readsXReg(wavefunction);
// // measureRegisterGate(wavefunction);
// return 0;
// } | [
"ewan.thomas98@gmail.com"
] | ewan.thomas98@gmail.com |
4a0ab813812d33810529d470c8e4089c6d0b71aa | 202bbc35b672ebda80f7295a7793995d5d877206 | /ScubaSteve/Builds/IOS/Classes/Native/mscorlib_System_Array_InternalEnumerator_1_gen_107MethodDeclarations.h | c1311fd3a87232b285ce5bb2a9eb4fc99b9fda1c | [] | no_license | gohun04/ScubaSteve | c2388d677c77b374fccb62c0e8cce4740d06ca50 | 2428e54e97238f48f67652a8dd982e1f6821e7e0 | refs/heads/master | 2021-01-01T16:00:07.055501 | 2015-04-25T09:07:26 | 2015-04-25T09:07:26 | 34,557,070 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,667 | h | #pragma once
// System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>
struct InternalEnumerator_1_t3475;
// System.Object
struct Object_t;
// System.Array
struct Array_t;
// UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption
#include "AssemblyU2DCSharpU2Dfirstpass_UnityStandardAssets_CrossPlatf_16.h"
// System.Void System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>::.ctor(System.Array)
void InternalEnumerator_1__ctor_m19168 (InternalEnumerator_1_t3475 * __this, Array_t * ___array, MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Object System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>::System.Collections.IEnumerator.get_Current()
Object_t * InternalEnumerator_1_System_Collections_IEnumerator_get_Current_m19169 (InternalEnumerator_1_t3475 * __this, MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Void System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>::Dispose()
void InternalEnumerator_1_Dispose_m19170 (InternalEnumerator_1_t3475 * __this, MethodInfo* method) IL2CPP_METHOD_ATTR;
// System.Boolean System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>::MoveNext()
bool InternalEnumerator_1_MoveNext_m19171 (InternalEnumerator_1_t3475 * __this, MethodInfo* method) IL2CPP_METHOD_ATTR;
// T System.Array/InternalEnumerator`1<UnityStandardAssets.CrossPlatformInput.TouchPad/AxisOption>::get_Current()
int32_t InternalEnumerator_1_get_Current_m19172 (InternalEnumerator_1_t3475 * __this, MethodInfo* method) IL2CPP_METHOD_ATTR;
| [
"jacobpipers@msn.com"
] | jacobpipers@msn.com |
a9fea78fee11f4361612d5f2c36f56758752cf42 | 0e9bb62d216b408a7eac90c756ad46125a99658b | /planeSweep.h | 13b50d6c625a63a3882551c04519b7e625a8300c | [] | no_license | VivianLyy/Top-m-MaxOverlap | 2e2e66f061499207128c59672a199ae8f251c1b7 | ffc9860b44959f0c6288b03cbeaa4bb6b26d5475 | refs/heads/master | 2020-03-15T10:18:25.394274 | 2018-05-04T06:11:14 | 2018-05-04T06:11:14 | 132,095,182 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,386 | h |
#ifndef PLANES_H
#define PLANE_H
#include <math.h>
#include "circle.h"
#include "qsort.h"
#include "config.h"
struct interval_s
{
double left;
double right;
int weight;
};
typedef struct interval_s interval;
struct intervalList_s
{
int noOfElt;
interval **elt;
};
typedef struct intervalList_s intervalList;
struct fourPoint_s
{
double x1;
double x2;
double x3;
double x4;
double y1;
double y2;
double y3;
double y4;
};
typedef struct fourPoint_s fourPoint;
struct fourPointList_s
{
int noOfElt;
fourPoint **elt;
};
typedef struct fourPointList_s fourPointList;
fourPointList *findOptimalByPlaneSweep(int L, circleList *aCircleList);
extern mySetSet *filter_calculateGreatestNoOfIntersection(mySet *unionBoxSet, configure *aConfig, mySetSet *overlapTable, node_type *rootC, int *sortedIndex, circleList *aCircleList, rtree_info *rtreeInfo);
//mySetSet *filter_findOptimalInNewDim(int L, circleList *aCircleList);
//mySetSet *filter_findOptimalInNewDim(int L, configure *aConfig, mySetSet *overlapTable, node_type *rootC, int *sortedIndex, circleList *aCircleList, rtree_info *rtreeInfo);
mySetSet *filter_findOptimalInNewDim(int L, circleList *rhombusList, configure *aConfig, mySetSet *overlapTable, node_type *rootC, int *sortedIndex, circleList *aCircleList, rtree_info *rtreeInfo);
#endif
| [
"13501923325@163.com"
] | 13501923325@163.com |
2db2b6d5236f4ec2b0f23c37593e686617fde994 | 2b15bb1b94b46888bc21ae61747b6c6b770eed62 | /ProfileManager/profile_transmit.c | fdb3e85bb1cfb4432a88f4ebf28e8acbd975a2b4 | [] | no_license | SBS-kkramer/HyperNav_Firmware | cd25f209fec60f9a92095254e4c7366c1c841874 | bc6b8be7b98e21b5007cc5ed1c5ebc416a1c6fe6 | refs/heads/master | 2023-07-23T20:16:19.795273 | 2021-09-08T06:25:28 | 2021-09-08T06:25:28 | 342,882,781 | 0 | 2 | null | null | null | null | UTF-8 | C | false | false | 18,062 | c | # include "profile_transmit.h"
# include <errno.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <unistd.h>
# include <sys/ioctl.h>
# include <sys/types.h>
# include <sys/socket.h>
# include <netinet/in.h>
# include <netdb.h>
# include "zlib.h"
# include "profile_description.h"
# include "profile_packet.h"
static int packet_process_transmit ( Profile_Data_Packet_t* original, transmit_instructions_t* tx_instruct, uint8_t* bstStatus, const char* data_dir, int tx_fd ) {
// Process packet
// Binary -> Graycode -> Bitplaned -> Compressed -> ASCII-Encoded
// Represent spectra pixel values in graycode
//
Profile_Data_Packet_t represent;
// TODO: Round to proper position before graycoding if noise_remove>0
if (tx_instruct->representation == REP_GRAY)
{
memset( &represent, 0, sizeof(Profile_Data_Packet_t) );
if ( data_packet_bin2gray( &original, &represent ) )
{
fprintf ( stderr, "Failed in data_packet_bin2gray()\n" );
return 1;
}
else
{
data_packet_save ( &represent, data_dir, "G" );
}
}
else
{
memcpy( &represent, &original, sizeof(Profile_Data_Packet_t) );
}
//fprintf ( stderr, " gray %d\n", p );
// Arrange the spectral data in bitplanes
//
Profile_Data_Packet_t arranged;
if ( tx_instruct->use_bitplanes == BITPLANE )
{
memset( &arranged, 0, sizeof(Profile_Data_Packet_t) );
if ( data_packet_bitplane( &represent, &arranged, tx_instruct->noise_bits_remove ) )
{
fprintf ( stderr, "Failed in data_packet_bitplane()\n" );
return 1;
}
data_packet_save ( &arranged, data_dir, "B" );
}
else
{
memcpy ( &arranged, &represent, sizeof(Profile_Data_Packet_t) );
}
//fprintf ( stderr, " plne %d\n", p );
// Compress the packet
//
Profile_Data_Packet_t compressed;
if ( tx_instruct->compression == ZLIB )
{
memset( &compressed, 0, sizeof(Profile_Data_Packet_t) );
char compression = 'G';
if ( data_packet_compress( &arranged, &compressed, compression ) )
{
fprintf ( stderr, "Failed in data_packet_compress()\n" );
return 1;
}
data_packet_save ( &compressed, data_dir, "C" );
} else {
memcpy( &compressed, &arranged, sizeof(Profile_Data_Packet_t) );
}
//fprintf ( stderr, " zlib %d\n", p );
// Encode the packet
//
Profile_Data_Packet_t encoded;
if ( tx_instruct->encoding != NO_ENCODING )
{
memset( &encoded, 0, sizeof(Profile_Data_Packet_t) );
char encoding;
switch ( tx_instruct->encoding )
{
case ASCII85: encoding = 'A'; break;
case BASE64 : encoding = 'B'; break;
default : encoding = 'N'; break;
}
if ( data_packet_encode ( &compressed, &encoded, encoding ) )
{
fprintf ( stderr, "Failed in data_packet_compress()\n" );
return 1;
}
data_packet_save ( &encoded, data_dir, "E" );
}
else
{
memcpy( &encoded, &compressed, sizeof(Profile_Data_Packet_t) );
}
//fprintf ( stderr, " zlib %d\n", p );
// Transmit the packet
//
return data_packet_txmit ( &encoded, tx_instruct->burst_size, tx_fd, bstStatus );
}
int profile_transmit ( const char* data_dir,
uint16_t proID,
transmit_instructions_t* tx_instruct,
uint16_t port,
char* host_ip
)
{
const char* const function_name = "profile_transmit()";
int tx_fd = -1; // Transmit file descriptor
// If 0==port use stdout (fd=1)
// Else open socket to host_ip:port
if ( 0 == port ) {
tx_fd = 1;
} else {
tx_fd = socket(AF_INET, SOCK_STREAM, 0);
if ( tx_fd < 0 ) {
perror ( "PMTX-ERROR" );
return 1;
}
struct hostent* server = gethostbyname( host_ip );
if ( NULL == server ) {
fprintf ( stderr, "PMTX-ERROR, no '%s' host\n", host_ip );
return 1;
}
struct sockaddr_in server_address;
memset ( &server_address, 0, sizeof(server_address) );
server_address.sin_family = AF_INET;
// memcpy ( &server_address.sin_addr.s_addr, server->h_addr, server->h_length);
bcopy((char *)server->h_addr, (char *)&server_address.sin_addr.s_addr, server->h_length);
server_address.sin_port = htons(port);
if (connect( tx_fd, (struct sockaddr*) &server_address, sizeof(server_address) ) < 0 ) {
char msg[128];
snprintf ( msg, 128, "PMTX-ERROR: Connect to %s %x", host_ip, server->h_addr );
perror( msg );
return 1;
}
}
// Set I/O to NON Blocking -- Required to not block on no input
//
int flg = 1;
ioctl ( tx_fd, FIONBIO, &flg );
// Get information about the profile to be transferred
//
Profile_Description_t profile_description;
profile_description_retrieve ( &profile_description, data_dir, proID );
profile_description.profiler_sn = 876;
// Define packets
//
Profile_Packet_Definition_t packet_definition;
packet_definition.profiler_sn = profile_description.profiler_sn;
packet_definition.profile_yyddd = profile_description.profile_yyddd ;
packet_definition.numData_SBRD = profile_description.nSBRD;
packet_definition.numData_PORT = profile_description.nPORT;
packet_definition.numData_OCR = profile_description.nOCR;
packet_definition.numData_MCOMS = profile_description.nMCOMS;
packet_definition.nPerPacket_SBRD = 5;
packet_definition.nPerPacket_PORT = 5;
packet_definition.nPerPacket_OCR = 500;
packet_definition.nPerPacket_MCOMS = 500;
if ( profile_description.nSBRD )
{
packet_definition.numPackets_SBRD = 1 + ( profile_description.nSBRD -1 ) / packet_definition.nPerPacket_SBRD;
}
else
{
packet_definition.numPackets_SBRD = 0;
}
if ( profile_description.nPORT )
{
packet_definition.numPackets_PORT = 1 + ( profile_description.nPORT -1 ) / packet_definition.nPerPacket_PORT;
}
else
{
packet_definition.numPackets_PORT = 0;
}
if ( profile_description.nOCR )
{
packet_definition.numPackets_OCR = 1 + ( profile_description.nOCR -1 ) / packet_definition.nPerPacket_OCR;
}
else
{
packet_definition.numPackets_OCR = 0;
}
if ( profile_description.nMCOMS )
{
packet_definition.numPackets_MCOMS = 1 + ( profile_description.nMCOMS-1 ) / packet_definition.nPerPacket_MCOMS;
}
else
{
packet_definition.numPackets_MCOMS = 0;
}
// Generate packet files from profile data files
// (split by size and prepend by packet header)
//
uint16_t num_packets = 0;
char fname[32];
// generate_header packet file (number 0)
Profile_Info_Packet_t info_packet;
profile_packet_definition_to_info_packet ( &packet_definition, &info_packet );
// FIXME -- Profile_Info_Packet_t MetaData
int m;
for (m = 0; m < BEGPAK_META; m++)
{
info_packet.meta_info[m] = '.';
}
info_packet_save ( &info_packet, data_dir, "Z" );
num_packets ++;
// Package Starboard Radiometer Data
sprintf ( fname, "%s/%05d/M.sbd", data_dir, profile_description.profile_yyddd );
FILE* fp = fopen ( fname, "r" );
if ( !fp ) {
fprintf ( stderr, "Cannot open %s\n", fname );
return 1;
}
uint16_t sP;
for ( sP = 1; sP <= packet_definition.numPackets_SBRD; sP++, num_packets++ )
{
//fprintf ( stderr, "Building packet %c %d\n", 'S', sP );
Profile_Data_Packet_t raw;
char numString[16];
raw.HYNV_num = packet_definition.profiler_sn;
raw.PROF_num = packet_definition.profile_yyddd;
raw.PCKT_num = num_packets;
raw.sensor_type = 'S';
raw.empty_space = ' ';
memcpy ( raw.sensor_ID, "SATYLU0000", 10 );
uint16_t number_of_data;
if ( sP<packet_definition.numPackets_SBRD )
{
number_of_data = packet_definition.nPerPacket_SBRD;
}
else
{ // The last packet may contain fewer items
number_of_data = profile_description.nSBRD - (packet_definition.numPackets_SBRD-1) * packet_definition.nPerPacket_SBRD;
}
snprintf ( numString, 5, "% 4hu", number_of_data );
memcpy ( raw.number_of_data, numString, 4 );
raw.representation = 'B';
raw.noise_bits_removed = 'N';
raw.compression = '0';
raw.ASCII_encoding = 'N';
int d;
for ( d = 0; d < number_of_data; d++ )
{
//fprintf ( stderr, "... frame %d\n", d+1 );
Spectrometer_Data_t h;
fread( &h, sizeof(Spectrometer_Data_t), 1, fp );
memcpy ( raw.contents.structured.sensor_data.pixel[d], h.light_minus_dark_spectrum, N_SPEC_PIX*sizeof(uint16_t));
memcpy ( &(raw.contents.structured.aux_data.spec_aux[d]), &(h.aux), sizeof(Spec_Aux_Data_t) );
}
uint16_t data_size = number_of_data * ( N_SPEC_PIX*sizeof (uint16_t) + sizeof (Spec_Aux_Data_t) );
snprintf ( numString, 7, "% 6hu", data_size );
memcpy ( raw.compressed_sz, " ", 6 );
memcpy ( raw.encoded_sz, " ", 6 );
if ( data_packet_save ( &raw, data_dir, "Z" ) )
{
fclose ( fp );
return 1;
}
}
fclose( fp );
// TODO PORT, OCR, MCOMS
size_t start_input = 0;
size_t end_input = 0;
size_t const size_input = 2*1024L;
unsigned char* all_input = malloc ( size_input );
// num_packets = num_data * sizeof(packet_data) / sizeof(data)
//
uint16_t maxBrsts = sizeof(Profile_Data_Packet_t) / tx_instruct->burst_size;
uint8_t allAck = 0;
// Status: 0 = Done Sending / 1 = To Send / 2 = Received acknowledged
uint8_t* pckStatus = malloc ( (size_t)num_packets * sizeof(uint8_t) );
uint8_t** bstStatus = malloc ( (size_t)num_packets * sizeof(uint8_t*) );
if ( bstStatus ) {
bstStatus[0] = (uint8_t*) malloc ( (size_t)num_packets*maxBrsts*sizeof(uint8_t) );
if ( !bstStatus[0] ) {
free ( bstStatus );
bstStatus = 0;
} else {
uint16_t p;
for ( p=1; p<num_packets; p++ ) {
bstStatus[p] = bstStatus[p-1] + maxBrsts;
}
}
}
if ( !all_input | !pckStatus | !bstStatus ) {
// SYSTEM FAILURE!!!
// Need fallback
fprintf ( stderr, "SYSTEM FAILURE MALLOC - Implement fallback" );
}
uint16_t p;
uint16_t b;
for (p = 0; p < num_packets; p++)
{
pckStatus[p] = 1;
for (b = 0; b < maxBrsts; b++)
{
bstStatus[p][b] = 1;
}
}
time_t lastRx = time((time_t*)0);
uint16_t needToSend = 1;
do {
uint8_t newResendRequest = 0;
for ( p = 0; p < num_packets && !newResendRequest; p++ )
{
if (1 != pckStatus[p])
{
//fprintf ( stderr, "Tx %hu not required\n", p );
}
else
{
fprintf ( stderr, "Tx %hu ...\n", p );
if ( 0 == p )
{
if ( 0 == info_packet_txmit ( &info_packet, tx_instruct->burst_size, tx_fd, bstStatus[p] ) )
{
pckStatus[p] = 0; // transmit was ok, done this one
for (b = 0; b < maxBrsts; b++ )
{
bstStatus[p][b] = 0;
}
fprintf ( stderr, "Tx %hu done\n", p );
}
else
{
fprintf ( stderr, "Tx %hu failed\n", p );
}
}
else
{
// Read a packet
//
Profile_Data_Packet_t original;
memset ( &original, 0, sizeof (Profile_Data_Packet_t) );
data_packet_retrieve ( &original, data_dir, "Z", proID, p );
//fprintf ( stderr, " read %d\n", p );
//
if ( 0 == packet_process_transmit ( &original, tx_instruct, bstStatus[p], data_dir, tx_fd ) )
{
pckStatus[p] = 0; // transmit was ok, done this one
for ( b = 0; b < maxBrsts; b++ )
{
bstStatus[p][b] = 0;
}
}
}
}
// Read up to RXBUFSZ bytes from current input into buffer
//
# define RXBUFSZ 4096
char buf[RXBUFSZ];
size_t n;
if ( 0 >= ( n = read ( tx_fd, buf, RXBUFSZ ) ) )
{
//fprintf ( stderr, "No input.\n" );
}
else
{
lastRx = time((time_t*)0);
// Append new input to existing (unparsed) input
// start_input == 0 by design
//
memcpy ( all_input+end_input, buf, n );
end_input += n;
// fprintf ( stderr, "Parse %d bytes [%d..%d]\n", end_input-start_input, start_input, end_input );
// fprintf ( stderr, "Parse %*.*s\n", end_input-start_input, end_input-start_input, all_input+start_input );
// Scan as long as there is terminated input
//
unsigned char* terminator = 0;
while ( end_input - start_input > 6
&& 0 != (terminator = strstr ( all_input + start_input, "\r\n" ) ) )
{
terminator[0] = 0;
uint16_t hID, prID, paID, bID;
uint32_t crcRX;
if ( 0 == strncmp ( all_input+start_input, "RXED", 4 ) )
{
sscanf ( all_input + start_input + 4, ",%hu,%hu,%hu,%hu,%x",
&hID, &prID, &paID, &bID, &crcRX );
if ( hID != profile_description.profiler_sn || prID != profile_description.profile_yyddd )
{
fprintf ( stderr, "<- Server RXED incorrect IDs: %s\n", all_input+start_input );
}
else
{
uLong crc = crc32 ( 0L, Z_NULL, 0 );
crc = crc32 ( crc, all_input + start_input, 25 );
if ( crc != crcRX )
{
fprintf ( stderr, "<- Server RXED Packet %hu - CRC %08x %08x mismatch\n", paID, crcRX, crc );
}
else
{
fprintf ( stderr, "<- Server RXED Packet %hu\n", paID );
if ( paID < num_packets )
{
switch ( pckStatus[paID] )
{
case 0: pckStatus[paID] = 2; break;
case 1: fprintf ( stderr, "Error: Server confirmed receive of not yet sent packet %hu\n", paID ); break;
case 2: fprintf ( stderr, "Error: Server re-confirmed receive of packet %hu\n", paID ); break;
default: fprintf ( stderr, "Fatal: Server requested resend of undefined packet %hu\n", paID ); break;
}
}
}
}
}
else if ( 0 == strncmp ( all_input + start_input, "RSND", 4 ) )
{
sscanf ( all_input+start_input + 4, ",%hu,%hu,%hu,%hu,%x",
&hID,
&prID,
&paID,
&bID,
&crcRX
);
if ( hID != profile_description.profiler_sn || prID != profile_description.profile_yyddd )
{
fprintf ( stderr, "<- Server RSND incorrect IDs: %s\n", all_input+start_input );
}
else
{
uLong crc = crc32 ( 0L, Z_NULL, 0 );
crc = crc32 ( crc, all_input + start_input, 25 );
if ( crc != crcRX )
{
fprintf ( stderr, "<- Server RSND Packet %hu - CRC %08x %08x mismatch\n", paID, crcRX, crc );
}
else
{
fprintf ( stderr, "<- Server RSND request Packet %hu %hu\n", paID, bID );
if ( paID < num_packets )
{
newResendRequest = 1;
if ( 0 == pckStatus[paID] || 1 == pckStatus[paID] )
{
if ( 999 == bID )
{
// Resend all bursts
for ( b=0; b<maxBrsts; b++ )
{
bstStatus[paID][b] = 1;
}
}
else
{
bstStatus[paID][bID] = 1;
}
}
switch ( pckStatus[paID] )
{
case 0: pckStatus[paID] = 1; break;
case 1: if ( 999 == bID ) fprintf ( stderr, "Error: Server requested resend of not yet sent packet %hu\n", paID ); break;
case 2: fprintf ( stderr, "Error: Server requested resend of received packet %hu\n", paID ); break;
default: fprintf ( stderr, "Fatal: Server requested resend of undefined packet %hu\n", paID ); break;
}
}
}
}
}
else if ( 0 == strncmp ( all_input + start_input, "ALIF", 4 ) )
{
// TODO mod timeout
}
else
{
fprintf ( stderr, "<- Server sent %s\n", all_input+start_input );
}
start_input += strlen(all_input+start_input) + 2;
}
// Shift unparsed input to start of memory
//
memmove ( all_input, all_input+start_input, end_input-start_input );
end_input -= start_input;
start_input = 0;
if ( end_input > 0 )
fprintf ( stderr, "Unparsed %d\n", end_input );
if ( end_input > 64 )
{
// There is a problem!
// Commands have a max lenght of 64 bytes,
// and incomplete commands must be cleaned up
// to prevent input buffer contamination!
}
}
} // End of packet tx loop
if ( !newResendRequest )
{
// Allow time to receive all resend requests
allAck = 2;
for ( p=0; p<num_packets; p++ )
{
if ( 2 != pckStatus[p] )
{
allAck = 0;
}
}
}
//fprintf ( stderr, "%d %d %d\n", (int)allAck, time((time_t*)0), lastRx );
} while ( allAck!=2 && time((time_t*)0)<lastRx+120 );
// TODO == Send End-of-Transmission ???
free ( all_input );
return 0;
}
| [
"kkramer@seabird.com"
] | kkramer@seabird.com |
9e08bde059aed9e88562715e6c2a2d8c3c39a913 | 7781ce6f4465d8ad8a5c19439d93d06f2e43e373 | /UART-bi_int/main.c | 0f85e928d4ea3161569dd40c7a362ebd6bc26883 | [] | no_license | diemlt4/STM32F4 | a6948d5fc6d4fb2a93919328544389d66b4a85ab | 3e7d0eb93900c20218beb6baa13bd86065089d9d | refs/heads/master | 2021-03-30T02:42:46.051858 | 2016-06-10T03:33:31 | 2016-06-10T03:33:31 | 248,007,745 | 0 | 1 | null | 2020-03-17T15:38:00 | 2020-03-17T15:37:59 | null | UTF-8 | C | false | false | 10,614 | c | /*
* This program turns on the 4 leds of the stm32f4 discovery board in order with
* Timer 6. Change the lighting direction by pressing user button.
*/
/* Include STM32F4 and standard peripherals configuration headers. */
#include <stm32f4xx.h>
#include "stm32f4xx_conf.h"
#include <ctype.h>
#include <string.h>
/* Define the readable hardware memory address, according to the
* schematic of STM32F4-Discovery.
*/
/* LEDs. */
#define GREEN GPIO_Pin_12 // Green LED connects to PD12
#define ORANGE GPIO_Pin_13 // Orange LED connects to PD13
#define RED GPIO_Pin_14 // Red LED connects to PD14
#define BLUE GPIO_Pin_15 // Blue LED connects to PD15
#define ALL_LEDS (GREEN | ORANGE | RED | BLUE) // all leds
#define LEDn 4 // 4 LEDs
#define LEDS_GPIO_PORT (GPIOD) // LEDs connect to Port D
/* User Button. */
#define USER_BUTTON GPIO_Pin_0 // User Button connects to PA0
#define BUTTON_GPIO_PORT (GPIOA) // User Button connects to Port A
/* The array stores the led order used to switch them on and off. */
static uint16_t leds[LEDn] = {GREEN, ORANGE, RED, BLUE};
/* Check Timer 6 is timeout or not. */
#define is_timeout() (TIM_GetFlagStatus(TIM6, TIM_FLAG_Update) == SET)
/* Reset the Timer 6 update flag which is for timeout. */
#define reset_timeout() (TIM_ClearFlag(TIM6, TIM_FLAG_Update))
/* This is how long we wait in the delay function. */
#define LED_LONG 8400L
#define PAUSE_SHORT 20L
/* The delay counters for specific purpose. */
int16_t led_long = LED_LONG;
int16_t pause_short = PAUSE_SHORT;
/* A simple time comsuming function. */
static void delay(void) {
/* Check it is timeput or not. */
while(is_timeout()) {
/* Clear the timeout flag. */
reset_timeout();
/* Decrease counters. */
led_long--;
pause_short--;
}
}
/* Initial Timer 6 for timing. */
void setup_timer(void) {
/* Structure storing the information of Timer 6. */
TIM_TimeBaseInitTypeDef TIM_BaseStruct;
/* Enable Timer 6 clock. */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM6, ENABLE);
/* Set the timing clock prescaler. */
TIM_BaseStruct.TIM_Prescaler = 100 - 1;
/* Set the timer count up. */
TIM_BaseStruct.TIM_CounterMode = TIM_CounterMode_Up;
/* Set the timer's top counting value. */
TIM_BaseStruct.TIM_Period = 10 - 1;
/* Set the internal clock division. */
TIM_BaseStruct.TIM_ClockDivision = TIM_CKD_DIV1;
/* No repetition counter for Timer 6. */
TIM_BaseStruct.TIM_RepetitionCounter = 0;
/* Write this data into memory at the address mapped to Timer 6. */
TIM_TimeBaseInit(TIM6, &TIM_BaseStruct);
/* Enable Timer 6's counter. */
TIM_Cmd(TIM6, ENABLE);
}
/* Initialize the GPIO port D for output LEDs. */
static void setup_leds(void) {
/* Structure storing the information of GPIO Port D. */
static GPIO_InitTypeDef GPIO_InitStructure;
/* Enable the GPIOD peripheral clock. */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
/* Pin numbers of LEDs are mapped to bits number. */
GPIO_InitStructure.GPIO_Pin = ALL_LEDS;
/* Pins in output mode. */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
/* Clock speed rate for the selected pins. */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
/* Operating output type for the selected pins. */
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
/* Operating Pull-up/Pull down for the selected pins. */
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
/* Write this data into memory at the address
* mapped to GPIO device port D, where the led pins
* are connected */
GPIO_Init(LEDS_GPIO_PORT, &GPIO_InitStructure);
}
/* Initialize the GPIO port A for input User Button. */
static void setup_button(void) {
/* Structure storing the information of GPIO Port A. */
static GPIO_InitTypeDef GPIO_InitStructure;
/* Enable the GPIOA peripheral clock. */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
/* Pin number of User Button is mapped to a bit number. */
GPIO_InitStructure.GPIO_Pin = USER_BUTTON;
/* Pin in input mode. */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
/* Clock speed rate for the selected pins. */
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
/* Operating output type for the selected pins. */
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
/* Operating Pull-up/Pull down for the selected pins. */
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
/* Write this data into memory at the address
* mapped to GPIO device port A, where the led pins
* are connected */
GPIO_Init(BUTTON_GPIO_PORT, &GPIO_InitStructure);
}
/* Turn all leds on and off 4 times. */
static void flash_all_leds(void) {
int i;
/* Turn off all leds */
GPIO_ResetBits(LEDS_GPIO_PORT, ALL_LEDS);
for (i = 0; i < 8; i++)
{
/* Turn on all user leds */
GPIO_ToggleBits(LEDS_GPIO_PORT, ALL_LEDS);
/* Wait a short time */
while(led_long > 0) {
delay();
}
led_long = LED_LONG;
}
}
/* Light LEDs in order. */
static void light_leds(int8_t step) {
static int8_t i = 0;
/* Check it is delay enough time. */
if(led_long <= 0) {
led_long = LED_LONG;
/* Turn off all LEDS. */
GPIO_ResetBits(LEDS_GPIO_PORT, ALL_LEDS);
/* Choose next LED and turn it on. */
i = (i + step + LEDn) % LEDn;
GPIO_SetBits(LEDS_GPIO_PORT, leds[i]);
}
}
/* Get the status of User Button.
* 0: Not pressed.
* 1: Pressed.
*/
#define read_button() (GPIO_ReadInputDataBit(BUTTON_GPIO_PORT, USER_BUTTON))
/* Get LEDs' lighting direction.
* 1: Clockwise.
* -1: Counterclockwise.
*/
static int8_t get_leds_direction(void) {
static int8_t step = 1;
/* Current & previous state of User Button. */
static uint8_t nstate = 0, pstate = 0; // 0: Not pressed, 1: pressed.
nstate = read_button();
/* Check the User Button is pressed or not. */
if((nstate == 1) && (pstate == 0)) {
/* If the User Button is pressed, reverse the direction. */
step *= -1;
/* Avoid button ocsillation. */
while(pause_short > 0) {
delay();
}
pause_short = PAUSE_SHORT;
}
/* Save the current state by previous state. */
pstate = nstate;
return step;
}
/* Initialize the USART6. */
static void setup_usart(void) {
USART_InitTypeDef USART_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
/* Enable the GPIOA peripheral clock. */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);
/* Make PC6, PC7 as alternative function of USART6. */
GPIO_PinAFConfig(GPIOC, GPIO_PinSource6, GPIO_AF_USART6);
GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_USART6);
/* Initialize PC6, PC7. */
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* Enable the USART6 peripheral clock. */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART6, ENABLE);
/* Initialize USART6 with
* 115200 buad rate,
* 8 data bits,
* 1 stop bit,
* no parity check,
* none flow control.
*/
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
USART_Init(USART6, &USART_InitStructure);
/* Enable USART6. */
USART_Cmd(USART6, ENABLE);
/* Enable USART6 RX interrupt. */
USART_ITConfig(USART6, USART_IT_RXNE, ENABLE);
/* Enable USART6 in NVIC vector. */
NVIC_EnableIRQ(USART6_IRQn);
}
/* USART read 1 byte. */
#define USART_ReadByte(USARTx) (USART_ReceiveData(USARTx))
/* USART send 1 byte. */
#define USART_SendByte(USARTx, b) (USART_SendData(USARTx, b))
/* Define USART sending mode. */
#define BLOCKING 0
#define NON_BLOCKING 1
/* Global varables to hold the state of the string going to be send. */
uint8_t *USART6_Out;
size_t USART6_OutLen;
/* Send bytes array with designated length through USART. */
size_t USART_Send(USART_TypeDef *USARTx, void *buf, size_t l, uint8_t flags) {
size_t i = 0;
uint8_t *pBuf;
pBuf = buf;
/* Send with blocking mode. */
if(flags == BLOCKING) {
for(i=0; i<l; i++) {
while(USART_GetFlagStatus(USARTx, USART_FLAG_TC) == RESET);
USART_SendByte(USARTx, (uint16_t)(pBuf[i]));
}
}
/* Send with non-blocking mode. */
else if(flags == NON_BLOCKING) {
USART6_Out = pBuf;
USART6_OutLen = l;
/* Enable USART6 TX interrupt. */
USART_ITConfig(USART6, USART_IT_TXE, ENABLE);
}
return i;
}
/* Print the string through USART with blocking. */
inline void USART_Printf(USART_TypeDef* USARTx, char *str) {
USART_Send(USARTx, str, strlen(str), BLOCKING);
}
/* USART6 IRQ handler. */
void USART6_IRQHandler(void) {
char c[] = "\0\r\n\0";
/* USART6 RX interrupt. */
if(USART6->SR & USART_SR_RXNE) {
c[0] = USART_ReadByte(USART6);
USART_Printf(USART6, "Pressed key: ");
USART_Printf(USART6, c);
}
/* USART6 TX interrupt. */
if(USART6->SR & USART_SR_TXE) {
if(USART6_OutLen > 0) {
USART_SendByte(USART6, toupper(*USART6_Out));
USART6_Out++;
USART6_OutLen--;
}
else {
/* Disable USART6 TX interrupt after transmit finished. */
USART_ITConfig(USART6, USART_IT_TXE, DISABLE);
}
}
}
/* Main function, the entry point of this program.
* The main function is called from the startup code in file
* Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/TrueSTUDIO/
* startup_stm32f40_41xxx.s (line 107)
*/
int main(void) {
int8_t step;
/* Setup input / output for User Button and LEDs. */
setup_leds();
setup_button();
/* Setup timer to time. */
setup_timer();
/* Setup USART6 with RX interrupt. */
setup_usart();
/* Wellcome LEDs. */
flash_all_leds();
/* Print hello string. */
USART_Printf(USART6, "Hello world!\r\n");
USART_Send(USART6, "Hello in blocking.\r\n", 20, BLOCKING);
USART_Send(USART6, "Hello in non-blocking 1.\r\n", 26, NON_BLOCKING);
while (1) {
/* Check delay time. */
delay();
/* Get the lighting direction. */
step = get_leds_direction();
/* Light LEDs in order. */
light_leds(step);
}
return 0; // never returns actually
}
| [
"zack_pan@alumni.ncu.edu.tw"
] | zack_pan@alumni.ncu.edu.tw |
99cffc3c669fce4a6c7ce3003c27c8097e36af57 | b2cf7e6836ee5f14084214114c505ddea873f494 | /apps/temp_mon/fsw/platform_inc/temp_mon_msgids.h | 7ab9e3cebc58eab263ee3df68f194cf43461a7e6 | [
"NASA-1.3"
] | permissive | jeremyzhang1/cFE-beavsat | 091e9099daafe58db22128024919f8003105422e | 4ef3de5c7307b2261fe611f8373bc6bcfddea364 | refs/heads/master | 2020-03-27T11:38:03.227897 | 2018-08-03T18:12:32 | 2018-08-03T18:12:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,256 | h | /*=======================================================================================
** File Name: temp_mon_msgids.h
**
** Title: Message ID Header File for TEMP_MON Application
**
** $Author: Austin Cosby
** $Revision: 1.1 $
** $Date: 2018-07-27
**
** Purpose: This header file contains declartions and definitions of all TEMP_MON's
** Message IDs.
**
** Modification History:
** Date | Author | Description
** ---------------------------
** 2018-07-27 | Austin Cosby | Build #: Code Started
**
**=====================================================================================*/
#ifndef _TEMP_MON_MSGIDS_H_
#define _TEMP_MON_MSGIDS_H_
/***** TODO: These Message ID values are default and may need to be changed by the developer *****/
#define TEMP_MON_CMD_MID 0x18E0
#define TEMP_MON_SEND_HK_MID 0x18E1
#define TEMP_MON_WAKEUP_MID 0x18F0
#define TEMP_MON_OUT_DATA_MID 0x18F1
#define TEMP_MON_HK_TLM_MID 0x08CC
#endif /* _TEMP_MON_MSGIDS_H_ */
/*=======================================================================================
** End of file temp_mon_msgids.h
**=====================================================================================*/
| [
"wecosby@gmail.com"
] | wecosby@gmail.com |
8c510aed4e9735217707f0b9dded0b0189d68465 | 81a1367960cf88168ba38bccfdcd01e22b33a4fc | /include/rpc/rpc-nmc.h | ae3bad5e6c8f786d108eb2ca87576e4834152b11 | [] | no_license | RC-MODULE/nmpp | 3ade5fdd40f24960e586669febae715885e21330 | a41c26c650c2dee42b2ae07329f7e139c4178134 | refs/heads/master | 2022-11-02T07:56:09.382120 | 2022-09-21T17:34:38 | 2022-09-21T17:34:38 | 44,173,133 | 9 | 12 | null | 2022-04-28T08:42:55 | 2015-10-13T11:59:04 | Assembly | UTF-8 | C | false | false | 6,926 | h | #include "easynmc\aura.h"
//typedef void (func_p_t)(void*);
//typedef void*(func_i_p_t)(int);
typedef void (func_ppi_t)(void*,void*,int);
typedef int (func_ppi_i_t)(void*,void*,int);
typedef int (func_ppr_i_t)(void*,void*,int*);
typedef void (func_pppi_t)(void*,void*,void*,int);
typedef void (func_pipi_t)(void*,int,void*,int);
typedef void (func_plpi_t)(void*,long,void*,int);
typedef void (func_pip_t)(void*,int,void*);
typedef void (func_ppp_t)(void*,void*,void*);
typedef int (func_ppp_i_t)(void*,void*,void*);
typedef void (func_pppii_t) (void*,void*,void*,int,int);
typedef void (func_piippi_t) (void*,int,int,void*,void*,int);
typedef void (func_ppip_t) (void*,void*,int,void*);
#include <time.h>
//#define NMC_RPC_I_P(func) \
//void rpc_ ## func(void *in, void *out) \
//{ \
// unsigned i = aura_get_u32(); \
// func_i_t *unifunc=(func_i_t*)func; \
// void* p=unifunc(i); \
// aura_put_u32((int)p); \
//}
//
//#define NMC_RPC_I(func) \
//void rpc_ ## func(void *in, void *out) \
//{ \
// unsigned i = aura_get_u32(); \
// func_i_p_t *unifunc=(func_i_p_t*)func; \
// unifunc(i); \
//}
#define NMC_RPC_PPI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
clock_t t0,t1,t2; \
t0=clock(); \
aura_buffer buf_src = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_ppi_t *unifunc=(func_ppi_t*)func; \
unifunc(src,dst,size); \
}
#define NMC_RPC_PPI_I(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_ppi_i_t *unifunc=(func_ppi_i_t*)func; \
int ret=unifunc(src,dst,size); \
aura_put_u32(ret); \
}
#define NMC_RPC_PPPI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
aura_buffer buf_src1 = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
int *src1 = aura_buffer_to_ptr(buf_src1); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_pppi_t *unifunc=(func_pppi_t*)func; \
unifunc(src0,src1,dst,size); \
}
#define NMC_RPC_PIPI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src = aura_get_buf(); \
unsigned val = aura_get_u32(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_pipi_t *unifunc=(func_pipi_t*)func; \
unifunc(src,val,dst,size); \
}
#define NMC_RPC_PLPI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src = aura_get_buf(); \
unsigned long long val = aura_get_u64(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_plpi_t *unifunc=(func_plpi_t*)func; \
unifunc(src,val,dst,size); \
}
#define NMC_RPC_PPLI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
unsigned long long val = aura_get_u64(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_pipi_t *unifunc=(func_pipi_t*)func; \
}
#define NMC_RPC_PPP(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
aura_buffer buf_src1 = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
int *src1 = aura_buffer_to_ptr(buf_src1); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_ppp_t *unifunc=(func_ppp_t*)func; \
unifunc(src0,src1,dst); \
}
#define NMC_RPC_PPP_I(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
aura_buffer buf_src1 = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
int *src1 = aura_buffer_to_ptr(buf_src1); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned size = aura_get_u32(); \
func_ppp_t *unifunc=(func_ppp_t*)func; \
int ret = unifunc(src0,src1,dst); \
aura_put_u32(ret); \
}
#define NMC_RPC_PIR(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
unsigned size = aura_get_u32(); \
func_pip_t *unifunc=(func_pip_t*)func; \
int ret ; \
unifunc(src0,size,&ret); \
aura_put_u32(ret); \
}
#define NMC_RPC_PPR_I(func) \
void rpc_ ## func(void *in, void *out) \
{ \
int handle=123; \
aura_buffer buf_src = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src = aura_buffer_to_ptr(buf_src); \
int *dst = aura_buffer_to_ptr(buf_dst); \
func_ppr_i_t *unifunc=(func_ppr_i_t*)func; \
int ret = unifunc(src,dst,&handle); \
aura_put_u32(handle); \
aura_put_u32(ret); \
}
#define NMC_RPC_PIR64(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
unsigned size = aura_get_u32(); \
func_pip_t *unifunc=(func_pip_t*)func; \
long ret ; \
unifunc(src0,size,&ret); \
aura_put_u64(ret); \
}
//#define NMC_RPC_PPIR64(func) \
//void rpc_ ## func(void *in, void *out) \
//{ \
// aura_buffer buf_src0 = aura_get_buf(); \
// aura_buffer buf_src1 = aura_get_buf(); \
// int *src0 = aura_buffer_to_ptr(buf_src0); \
// int *src1 = aura_buffer_to_ptr(buf_src1); \
// unsigned size = aura_get_u32(); \
// func_ppip_t *unifunc=(func_ppip_t*)func; \
// long ret ; \
// unifunc(src0,src1,size,&ret); \
// aura_put_u64(ret); \
//}
//
#define NMC_RPC_PPPII(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
aura_buffer buf_src1 = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
int *src1 = aura_buffer_to_ptr(buf_src1); \
int *dst = aura_buffer_to_ptr(buf_dst); \
unsigned height = aura_get_u32(); \
unsigned width = aura_get_u32(); \
func_pppii_t *unifunc=(func_pppii_t*)func; \
unifunc(src0,src1,dst,height,width); \
}
#define NMC_RPC_PIIPPI(func) \
void rpc_ ## func(void *in, void *out) \
{ \
aura_buffer buf_src0 = aura_get_buf(); \
unsigned height = aura_get_u32(); \
unsigned width0 = aura_get_u32(); \
aura_buffer buf_src1 = aura_get_buf(); \
aura_buffer buf_dst = aura_get_buf(); \
unsigned width1 = aura_get_u32(); \
int *src0 = aura_buffer_to_ptr(buf_src0); \
int *src1 = aura_buffer_to_ptr(buf_src1); \
int *dst = aura_buffer_to_ptr(buf_dst); \
func_piippi_t *unifunc=(func_piippi_t*)func; \
unifunc(src0,height,width0,src1,dst,width1); \
}
| [
"mushkaev@module.ru"
] | mushkaev@module.ru |
40efeff1d62e6a287735cfc9cc511bcd4620d08d | b0bf7998d91f64236654d5bae42171810fe2a98e | /ourproject/Temp/StagingArea/Data/il2cppOutput/t553MD.h | 8a1d5f8c1cce834a50042157cb8297ae62b53bcc | [] | no_license | starinu/493Project | b91ee6cdd2837fbb86fe4e43cb6b949d0851cfdd | 3906b5292741694685f95a35ae6475ae96831033 | refs/heads/master | 2021-01-10T03:43:20.298633 | 2015-11-21T05:23:07 | 2015-11-21T05:23:07 | 46,602,286 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,043 | h | #pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include <assert.h>
#include <exception>
struct t553;
#include "codegen/il2cpp-codegen.h"
#include "t550.h"
#include "t6.h"
#include "t551.h"
#include "t552.h"
extern "C" void m2798 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" int32_t m2799 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2800 (t553 * __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2801 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2802 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2803 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2804 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" t6 m2805 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2806 (t553 * __this, t6 p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" int32_t m2807 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2808 (t553 * __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2809 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2810 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" int32_t m2811 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2812 (t553 * __this, int32_t p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2813 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2814 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2815 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2816 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" float m2817 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2818 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2819 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2820 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2821 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2822 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2823 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2824 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2825 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2826 (t553 * __this, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2827 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
extern "C" void m2828 (t553 * __this, float p0, const MethodInfo* method) IL2CPP_METHOD_ATTR;
| [
"liuth@0587357572.wireless.umich.net"
] | liuth@0587357572.wireless.umich.net |
1be5093fc0df0e9ed0ba58452bbd3dd37cd17c7b | 46367579a54a09dd220dd9a678b1452f06897f11 | /branches/hdf5_CppAPI_Constants/src/H5Apkg.h | b815d11a4f424df3abe7ba3a604025deee6dc44e | [
"LicenseRef-scancode-llnl",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-hdf4"
] | permissive | TPLink32/hdf5 | 33ff24c9b6133f0f51cb6cc2b722fba7bb1777dd | 0d6987c15284bd9f34c7e44452a152833d42a738 | refs/heads/master | 2021-05-31T01:15:39.463663 | 2016-04-14T23:02:09 | 2016-04-14T23:02:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 12,974 | h | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
* of the source code distribution tree; Copyright.html can be found at the *
* root level of an installed copy of the electronic HDF5 document set and *
* is linked from the top-level documents page. It can also be found at *
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
* Programmer: Quincey Koziol
* Monday, Apr 20
*
* Purpose: This file contains declarations which are visible only within
* the H5A package. Source files outside the H5A package should
* include H5Aprivate.h instead.
*/
#if !(defined H5A_FRIEND || defined H5A_MODULE)
#error "Do not include this file outside the H5A package!"
#endif
#ifndef _H5Apkg_H
#define _H5Apkg_H
/*
* Define this to enable debugging.
*/
#ifdef NDEBUG
# undef H5A_DEBUG
#endif
/* Get package's private header */
#include "H5Aprivate.h"
/* Other private headers needed by this file */
#include "H5B2private.h" /* v2 B-trees */
#include "H5FLprivate.h" /* Free Lists */
#include "H5HFprivate.h" /* Fractal heaps */
#include "H5Oprivate.h" /* Object headers */
#include "H5Sprivate.h" /* Dataspace */
#include "H5Tprivate.h" /* Datatype functions */
/**************************/
/* Package Private Macros */
/**************************/
/* This is the initial version, which does not have support for shared datatypes */
#define H5O_ATTR_VERSION_1 1
/* This version allows support for shared datatypes & dataspaces by adding a
* 'flag' byte indicating when those components are shared. This version
* also dropped the alignment on all the components.
*/
#define H5O_ATTR_VERSION_2 2
/* Add support for different character encodings of attribute names */
#define H5O_ATTR_VERSION_3 3
/* The latest version of the format. Look through the 'encode', 'decode'
* and 'size' message callbacks for places to change when updating this.
*/
#define H5O_ATTR_VERSION_LATEST H5O_ATTR_VERSION_3
/****************************/
/* Package Private Typedefs */
/****************************/
/* Define the shared attribute structure */
typedef struct H5A_shared_t {
uint8_t version; /* Version to encode attribute with */
char *name; /* Attribute's name */
H5T_cset_t encoding; /* Character encoding of attribute name */
H5T_t *dt; /* Attribute's datatype */
size_t dt_size; /* Size of datatype on disk */
H5S_t *ds; /* Attribute's dataspace */
size_t ds_size; /* Size of dataspace on disk */
void *data; /* Attribute data (on a temporary basis) */
size_t data_size; /* Size of data on disk */
H5O_msg_crt_idx_t crt_idx; /* Attribute's creation index in the object header */
unsigned nrefs; /* Ref count for times this object is refered */
} H5A_shared_t;
/* Define the main attribute structure */
struct H5A_t {
H5O_shared_t sh_loc; /* Shared message info (must be first) */
H5O_loc_t oloc; /* Object location for object attribute is on */
hbool_t obj_opened; /* Object header entry opened? */
H5G_name_t path; /* Group hierarchy path */
H5A_shared_t *shared; /* Shared attribute information */
};
/* Typedefs for "dense" attribute storage */
/* (fractal heap & v2 B-tree info) */
/* Typedef for native 'name' field index records in the v2 B-tree */
/* (Keep 'id' field first so generic record handling in callbacks works) */
typedef struct H5A_dense_bt2_name_rec_t {
H5O_fheap_id_t id; /* Heap ID for attribute */
uint8_t flags; /* Object header message flags for attribute */
H5O_msg_crt_idx_t corder; /* 'creation order' field value */
uint32_t hash; /* Hash of 'name' field value */
} H5A_dense_bt2_name_rec_t;
/* Typedef for native 'creation order' field index records in the v2 B-tree */
/* (Keep 'id' field first so generic record handling in callbacks works) */
typedef struct H5A_dense_bt2_corder_rec_t {
H5O_fheap_id_t id; /* Heap ID for attribute */
uint8_t flags; /* Object header message flags for attribute */
H5O_msg_crt_idx_t corder; /* 'creation order' field value */
} H5A_dense_bt2_corder_rec_t;
/* Define the 'found' callback function pointer for matching an attribute record in a v2 B-tree */
typedef herr_t (*H5A_bt2_found_t)(const H5A_t *attr, hbool_t *took_ownership, void *op_data);
/*
* Common data exchange structure for dense attribute storage. This structure
* is passed through the v2 B-tree layer to the methods for the objects
* to which the v2 B-tree points.
*/
typedef struct H5A_bt2_ud_common_t {
/* downward */
H5F_t *f; /* Pointer to file that fractal heap is in */
hid_t dxpl_id; /* DXPL for operation */
H5HF_t *fheap; /* Fractal heap handle */
H5HF_t *shared_fheap; /* Fractal heap handle for shared messages */
const char *name; /* Name of attribute to compare */
uint32_t name_hash; /* Hash of name of attribute to compare */
uint8_t flags; /* Flags for attribute storage location */
H5O_msg_crt_idx_t corder; /* Creation order value of attribute to compare */
H5A_bt2_found_t found_op; /* Callback when correct attribute is found */
void *found_op_data; /* Callback data when correct attribute is found */
} H5A_bt2_ud_common_t;
/*
* Data exchange structure for dense attribute storage. This structure is
* passed through the v2 B-tree layer when inserting attributes.
*/
typedef struct H5A_bt2_ud_ins_t {
/* downward */
H5A_bt2_ud_common_t common; /* Common info for B-tree user data (must be first) */
H5O_fheap_id_t id; /* Heap ID of attribute to insert */
} H5A_bt2_ud_ins_t;
/* Data structure to hold table of attributes for an object */
typedef struct {
size_t nattrs; /* # of attributes in table */
H5A_t **attrs; /* Pointer to array of attribute pointers */
} H5A_attr_table_t;
/*****************************/
/* Package Private Variables */
/*****************************/
/* Declare extern the free list for H5A_t's */
H5FL_EXTERN(H5A_t);
/* Declare the external free lists for H5A_shared_t's */
H5FL_EXTERN(H5A_shared_t);
/* Declare extern a free list to manage blocks of type conversion data */
H5FL_BLK_EXTERN(attr_buf);
/* The v2 B-tree class for indexing 'name' field on attributes */
H5_DLLVAR const H5B2_class_t H5A_BT2_NAME[1];
/* The v2 B-tree class for indexing 'creation order' field on attributes */
H5_DLLVAR const H5B2_class_t H5A_BT2_CORDER[1];
/******************************/
/* Package Private Prototypes */
/******************************/
/* Function prototypes for H5A package scope */
H5_DLL H5A_t *H5A_create(const H5G_loc_t *loc, const char *name,
const H5T_t *type, const H5S_t *space, hid_t acpl_id, hid_t dxpl_id);
H5_DLL H5A_t *H5A_open_by_name(const H5G_loc_t *loc, const char *obj_name,
const char *attr_name, hid_t lapl_id, hid_t dxpl_id);
H5_DLL H5A_t *H5A_open_by_idx(const H5G_loc_t *loc, const char *obj_name,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5A__open_common(const H5G_loc_t *loc, H5A_t *attr);
H5_DLL H5A_t *H5A_copy(H5A_t *new_attr, const H5A_t *old_attr);
H5_DLL herr_t H5A__get_info(const H5A_t *attr, H5A_info_t *ainfo);
H5_DLL hid_t H5A_get_type(H5A_t *attr);
H5_DLL hid_t H5A_get_space(H5A_t *attr);
H5_DLL hid_t H5A_get_create_plist(H5A_t* attr);
H5_DLL herr_t H5A_free(H5A_t *attr);
H5_DLL herr_t H5A_close(H5A_t *attr);
H5_DLL htri_t H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo);
H5_DLL herr_t H5A_set_version(const H5F_t *f, H5A_t *attr);
H5_DLL herr_t H5A_rename_by_name(H5G_loc_t loc, const char *obj_name, const char *old_attr_name,
const char *new_attr_name, hid_t lapl_id, hid_t dxpl_id);
H5_DLL htri_t H5A_exists_by_name(H5G_loc_t loc, const char *obj_name, const char *attr_name,
hid_t lapl_id, hid_t dxpl_id);
H5_DLL herr_t H5A__write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id);
H5_DLL herr_t H5A__read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id);
H5_DLL ssize_t H5A__get_name(H5A_t *attr, size_t buf_size, char *buf);
/* Attribute "dense" storage routines */
H5_DLL herr_t H5A_dense_create(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
H5_DLL H5A_t *H5A_dense_open(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
const char *name);
H5_DLL herr_t H5A_dense_insert(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
H5A_t *attr);
H5_DLL herr_t H5A_dense_write(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
H5A_t *attr);
H5_DLL herr_t H5A_dense_rename(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
const char *old_name, const char *new_name);
H5_DLL herr_t H5A_dense_iterate(H5F_t *f, hid_t dxpl_id, hid_t loc_id,
const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op,
void *op_data);
H5_DLL herr_t H5A_dense_remove(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
const char *name);
H5_DLL herr_t H5A_dense_remove_by_idx(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
H5_DLL htri_t H5A_dense_exists(H5F_t *f, hid_t dxpl_id, const H5O_ainfo_t *ainfo,
const char *name);
H5_DLL herr_t H5A_dense_delete(H5F_t *f, hid_t dxpl_id, H5O_ainfo_t *ainfo);
/* Attribute table operations */
H5_DLL herr_t H5A_compact_build_table(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5_index_t idx_type, H5_iter_order_t order, H5A_attr_table_t *atable);
H5_DLL herr_t H5A_dense_build_table(H5F_t *f, hid_t dxpl_id,
const H5O_ainfo_t *ainfo, H5_index_t idx_type, H5_iter_order_t order,
H5A_attr_table_t *atable);
H5_DLL herr_t H5A_attr_iterate_table(const H5A_attr_table_t *atable,
hsize_t skip, hsize_t *last_attr, hid_t loc_id,
const H5A_attr_iter_op_t *attr_op, void *op_data);
H5_DLL herr_t H5A_attr_release_table(H5A_attr_table_t *atable);
/* Attribute operations */
H5_DLL herr_t H5O_attr_create(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr);
H5_DLL H5A_t *H5O_attr_open_by_name(const H5O_loc_t *loc, const char *name,
hid_t dxpl_id);
H5_DLL H5A_t *H5O_attr_open_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
H5_DLL herr_t H5O_attr_update_shared(H5F_t *f, hid_t dxpl_id, H5O_t *oh,
H5A_t *attr, H5O_shared_t *sh_mesg);
H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id,
H5A_t *attr);
H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id,
const char *old_name, const char *new_name);
H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name,
hid_t dxpl_id);
H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type,
H5_iter_order_t order, hsize_t n, hid_t dxpl_id);
H5_DLL htri_t H5O_attr_exists(const H5O_loc_t *loc, const char *name, hid_t dxpl_id);
#ifndef H5_NO_DEPRECATED_SYMBOLS
H5_DLL int H5O_attr_count(const H5O_loc_t *loc, hid_t dxpl_id);
#endif /* H5_NO_DEPRECATED_SYMBOLS */
H5_DLL H5A_t *H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size,
H5O_copy_t *cpy_info, hid_t dxpl_id);
H5_DLL herr_t H5A_attr_post_copy_file(const H5O_loc_t *src_oloc, const H5A_t *mesg_src,
H5O_loc_t *dst_oloc, const H5A_t *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
H5_DLL herr_t H5A_dense_post_copy_file_all(const H5O_loc_t *src_oloc, const H5O_ainfo_t * ainfo_src,
H5O_loc_t *dst_oloc, H5O_ainfo_t *ainfo_dst, hid_t dxpl_id, H5O_copy_t *cpy_info);
/* Testing functions */
#ifdef H5A_TESTING
H5_DLL htri_t H5A_is_shared_test(hid_t aid);
H5_DLL herr_t H5A_get_shared_rc_test(hid_t attr_id, hsize_t *ref_count);
#endif /* H5A_TESTING */
#endif /* _H5Apkg_H */
| [
"bmribler@dab4d1a6-ed17-0410-a064-d1ae371a2980"
] | bmribler@dab4d1a6-ed17-0410-a064-d1ae371a2980 |
67ee2beacdd4247c218187ea73591e38c56e82db | 8546e4cec83bfa793f52decba8f789bddea717a2 | /sounds.h | 6d5b1f47c8ecc2bf2af2e3643b1a43e10ed2bfe6 | [
"BSD-2-Clause"
] | permissive | tytydraco/DDRBOY | 881ff7ed3062f4f9b10bbfb8233b56b3a959cf8c | 1b0b98ee103f831e38cafb68662fb118fe3fb22b | refs/heads/master | 2022-08-11T03:03:21.629902 | 2022-07-30T05:50:41 | 2022-07-30T05:50:41 | 123,229,584 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 338 | h | #ifndef SOUNDS_H
#define SOUNDS_H
const uint16_t SOUND_START[] PROGMEM = {
100, 100, 200, 100, 300, 100, 400, 100, 500, 100, TONES_END
};
const uint16_t SOUND_GAME_OVER[] PROGMEM = {
500, 100, 400, 100, 300, 100, 200, 100, 100, 100, TONES_END
};
const uint16_t SOUND_OK[] PROGMEM = {
500, 100, 0, 20, 500, 100, TONES_END
};
#endif
| [
"tylernij@gmail.com"
] | tylernij@gmail.com |
59fd8a318055a413176757cbcc0c3537aa0eb1f4 | f72d1dc8916c80f9f93b7061385ee93d72cbaa01 | /src/util/simd_utils.h | c1449711b5ac92a13afa7af7bade9b0d021845c6 | [
"BSD-3-Clause",
"BSL-1.0",
"BSD-2-Clause"
] | permissive | wurp/hyperscan | bffb33561b99263bd70c0a9f6c43505b88071b74 | 1dfcacedf1b4b8c099c00b3705d72b676033c33f | refs/heads/master | 2020-04-05T14:27:33.291824 | 2019-07-10T17:33:42 | 2019-07-10T17:33:42 | 156,930,099 | 0 | 1 | NOASSERTION | 2018-11-09T23:43:17 | 2018-11-09T23:43:17 | null | UTF-8 | C | false | false | 32,758 | h | /*
* Copyright (c) 2015-2017, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Intel Corporation nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/** \file
* \brief SIMD types and primitive operations.
*/
#ifndef SIMD_UTILS
#define SIMD_UTILS
#if !defined(_WIN32) && !defined(__SSSE3__)
#error SSSE3 instructions must be enabled
#endif
#include "config.h"
#include "ue2common.h"
#include "simd_types.h"
#include "unaligned.h"
#include "util/arch.h"
#include "util/intrinsics.h"
#include <string.h> // for memcpy
// Define a common assume_aligned using an appropriate compiler built-in, if
// it's available. Note that we need to handle C or C++ compilation.
#ifdef __cplusplus
# ifdef HAVE_CXX_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#else
# ifdef HAVE_CC_BUILTIN_ASSUME_ALIGNED
# define assume_aligned(x, y) __builtin_assume_aligned((x), (y))
# endif
#endif
// Fallback to identity case.
#ifndef assume_aligned
#define assume_aligned(x, y) (x)
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern const char vbs_mask_data[];
#ifdef __cplusplus
}
#endif
static really_inline m128 ones128(void) {
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
/* gcc gets this right */
return _mm_set1_epi8(0xFF);
#else
/* trick from Intel's optimization guide to generate all-ones.
* ICC converts this to the single cmpeq instruction */
return _mm_cmpeq_epi8(_mm_setzero_si128(), _mm_setzero_si128());
#endif
}
static really_inline m128 zeroes128(void) {
return _mm_setzero_si128();
}
/** \brief Bitwise not for m128*/
static really_inline m128 not128(m128 a) {
return _mm_xor_si128(a, ones128());
}
/** \brief Return 1 if a and b are different otherwise 0 */
static really_inline int diff128(m128 a, m128 b) {
return (_mm_movemask_epi8(_mm_cmpeq_epi8(a, b)) ^ 0xffff);
}
static really_inline int isnonzero128(m128 a) {
return !!diff128(a, zeroes128());
}
/**
* "Rich" version of diff128(). Takes two vectors a and b and returns a 4-bit
* mask indicating which 32-bit words contain differences.
*/
static really_inline u32 diffrich128(m128 a, m128 b) {
a = _mm_cmpeq_epi32(a, b);
return ~(_mm_movemask_ps(_mm_castsi128_ps(a))) & 0xf;
}
/**
* "Rich" version of diff128(), 64-bit variant. Takes two vectors a and b and
* returns a 4-bit mask indicating which 64-bit words contain differences.
*/
static really_inline u32 diffrich64_128(m128 a, m128 b) {
#if defined(HAVE_SSE41)
a = _mm_cmpeq_epi64(a, b);
return ~(_mm_movemask_ps(_mm_castsi128_ps(a))) & 0x5;
#else
u32 d = diffrich128(a, b);
return (d | (d >> 1)) & 0x5;
#endif
}
static really_really_inline
m128 lshift64_m128(m128 a, unsigned b) {
#if defined(HAVE__BUILTIN_CONSTANT_P)
if (__builtin_constant_p(b)) {
return _mm_slli_epi64(a, b);
}
#endif
m128 x = _mm_cvtsi32_si128(b);
return _mm_sll_epi64(a, x);
}
#define rshift64_m128(a, b) _mm_srli_epi64((a), (b))
#define eq128(a, b) _mm_cmpeq_epi8((a), (b))
#define movemask128(a) ((u32)_mm_movemask_epi8((a)))
static really_inline m128 set16x8(u8 c) {
return _mm_set1_epi8(c);
}
static really_inline m128 set4x32(u32 c) {
return _mm_set1_epi32(c);
}
static really_inline u32 movd(const m128 in) {
return _mm_cvtsi128_si32(in);
}
static really_inline u64a movq(const m128 in) {
#if defined(ARCH_X86_64)
return _mm_cvtsi128_si64(in);
#else // 32-bit - this is horrific
u32 lo = movd(in);
u32 hi = movd(_mm_srli_epi64(in, 32));
return (u64a)hi << 32 | lo;
#endif
}
/* another form of movq */
static really_inline
m128 load_m128_from_u64a(const u64a *p) {
return _mm_set_epi64x(0LL, *p);
}
#define rshiftbyte_m128(a, count_immed) _mm_srli_si128(a, count_immed)
#define lshiftbyte_m128(a, count_immed) _mm_slli_si128(a, count_immed)
#if defined(HAVE_SSE41)
#define extract32from128(a, imm) _mm_extract_epi32(a, imm)
#define extract64from128(a, imm) _mm_extract_epi64(a, imm)
#else
#define extract32from128(a, imm) movd(_mm_srli_si128(a, imm << 2))
#define extract64from128(a, imm) movq(_mm_srli_si128(a, imm << 3))
#endif
#if !defined(HAVE_AVX2)
// TODO: this entire file needs restructuring - this carveout is awful
#define extractlow64from256(a) movq(a.lo)
#define extractlow32from256(a) movd(a.lo)
#if defined(HAVE_SSE41)
#define extract32from256(a, imm) _mm_extract_epi32((imm >> 2) ? a.hi : a.lo, imm % 4)
#define extract64from256(a, imm) _mm_extract_epi64((imm >> 1) ? a.hi : a.lo, imm % 2)
#else
#define extract32from256(a, imm) movd(_mm_srli_si128((imm >> 2) ? a.hi : a.lo, (imm % 4) * 4))
#define extract64from256(a, imm) movq(_mm_srli_si128((imm >> 1) ? a.hi : a.lo, (imm % 2) * 8))
#endif
#endif // !AVX2
static really_inline m128 and128(m128 a, m128 b) {
return _mm_and_si128(a,b);
}
static really_inline m128 xor128(m128 a, m128 b) {
return _mm_xor_si128(a,b);
}
static really_inline m128 or128(m128 a, m128 b) {
return _mm_or_si128(a,b);
}
static really_inline m128 andnot128(m128 a, m128 b) {
return _mm_andnot_si128(a, b);
}
// aligned load
static really_inline m128 load128(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = assume_aligned(ptr, 16);
return _mm_load_si128((const m128 *)ptr);
}
// aligned store
static really_inline void store128(void *ptr, m128 a) {
assert(ISALIGNED_N(ptr, alignof(m128)));
ptr = assume_aligned(ptr, 16);
*(m128 *)ptr = a;
}
// unaligned load
static really_inline m128 loadu128(const void *ptr) {
return _mm_loadu_si128((const m128 *)ptr);
}
// unaligned store
static really_inline void storeu128(void *ptr, m128 a) {
_mm_storeu_si128 ((m128 *)ptr, a);
}
// packed unaligned store of first N bytes
static really_inline
void storebytes128(void *ptr, m128 a, unsigned int n) {
assert(n <= sizeof(a));
memcpy(ptr, &a, n);
}
// packed unaligned load of first N bytes, pad with zero
static really_inline
m128 loadbytes128(const void *ptr, unsigned int n) {
m128 a = zeroes128();
assert(n <= sizeof(a));
memcpy(&a, ptr, n);
return a;
}
#ifdef __cplusplus
extern "C" {
#endif
extern const u8 simd_onebit_masks[];
#ifdef __cplusplus
}
#endif
static really_inline
m128 mask1bit128(unsigned int n) {
assert(n < sizeof(m128) * 8);
u32 mask_idx = ((n % 8) * 64) + 95;
mask_idx -= n / 8;
return loadu128(&simd_onebit_masks[mask_idx]);
}
// switches on bit N in the given vector.
static really_inline
void setbit128(m128 *ptr, unsigned int n) {
*ptr = or128(mask1bit128(n), *ptr);
}
// switches off bit N in the given vector.
static really_inline
void clearbit128(m128 *ptr, unsigned int n) {
*ptr = andnot128(mask1bit128(n), *ptr);
}
// tests bit N in the given vector.
static really_inline
char testbit128(m128 val, unsigned int n) {
const m128 mask = mask1bit128(n);
#if defined(HAVE_SSE41)
return !_mm_testz_si128(mask, val);
#else
return isnonzero128(and128(mask, val));
#endif
}
// offset must be an immediate
#define palignr(r, l, offset) _mm_alignr_epi8(r, l, offset)
static really_inline
m128 pshufb_m128(m128 a, m128 b) {
m128 result;
result = _mm_shuffle_epi8(a, b);
return result;
}
static really_inline
m256 pshufb_m256(m256 a, m256 b) {
#if defined(HAVE_AVX2)
return _mm256_shuffle_epi8(a, b);
#else
m256 rv;
rv.lo = pshufb_m128(a.lo, b.lo);
rv.hi = pshufb_m128(a.hi, b.hi);
return rv;
#endif
}
#if defined(HAVE_AVX512)
static really_inline
m512 pshufb_m512(m512 a, m512 b) {
return _mm512_shuffle_epi8(a, b);
}
static really_inline
m512 maskz_pshufb_m512(__mmask64 k, m512 a, m512 b) {
return _mm512_maskz_shuffle_epi8(k, a, b);
}
#endif
static really_inline
m128 variable_byte_shift_m128(m128 in, s32 amount) {
assert(amount >= -16 && amount <= 16);
m128 shift_mask = loadu128(vbs_mask_data + 16 - amount);
return pshufb_m128(in, shift_mask);
}
static really_inline
m128 max_u8_m128(m128 a, m128 b) {
return _mm_max_epu8(a, b);
}
static really_inline
m128 min_u8_m128(m128 a, m128 b) {
return _mm_min_epu8(a, b);
}
static really_inline
m128 sadd_u8_m128(m128 a, m128 b) {
return _mm_adds_epu8(a, b);
}
static really_inline
m128 sub_u8_m128(m128 a, m128 b) {
return _mm_sub_epi8(a, b);
}
static really_inline
m128 set64x2(u64a hi, u64a lo) {
return _mm_set_epi64x(hi, lo);
}
/****
**** 256-bit Primitives
****/
#if defined(HAVE_AVX2)
static really_really_inline
m256 lshift64_m256(m256 a, unsigned b) {
#if defined(HAVE__BUILTIN_CONSTANT_P)
if (__builtin_constant_p(b)) {
return _mm256_slli_epi64(a, b);
}
#endif
m128 x = _mm_cvtsi32_si128(b);
return _mm256_sll_epi64(a, x);
}
#define rshift64_m256(a, b) _mm256_srli_epi64((a), (b))
static really_inline
m256 set32x8(u32 in) {
return _mm256_set1_epi8(in);
}
#define eq256(a, b) _mm256_cmpeq_epi8((a), (b))
#define movemask256(a) ((u32)_mm256_movemask_epi8((a)))
static really_inline
m256 set2x128(m128 a) {
return _mm256_broadcastsi128_si256(a);
}
#else
static really_really_inline
m256 lshift64_m256(m256 a, int b) {
m256 rv = a;
rv.lo = lshift64_m128(rv.lo, b);
rv.hi = lshift64_m128(rv.hi, b);
return rv;
}
static really_inline
m256 rshift64_m256(m256 a, int b) {
m256 rv = a;
rv.lo = rshift64_m128(rv.lo, b);
rv.hi = rshift64_m128(rv.hi, b);
return rv;
}
static really_inline
m256 set32x8(u32 in) {
m256 rv;
rv.lo = set16x8((u8) in);
rv.hi = rv.lo;
return rv;
}
static really_inline
m256 eq256(m256 a, m256 b) {
m256 rv;
rv.lo = eq128(a.lo, b.lo);
rv.hi = eq128(a.hi, b.hi);
return rv;
}
static really_inline
u32 movemask256(m256 a) {
u32 lo_mask = movemask128(a.lo);
u32 hi_mask = movemask128(a.hi);
return lo_mask | (hi_mask << 16);
}
static really_inline
m256 set2x128(m128 a) {
m256 rv = {a, a};
return rv;
}
#endif
static really_inline m256 zeroes256(void) {
#if defined(HAVE_AVX2)
return _mm256_setzero_si256();
#else
m256 rv = {zeroes128(), zeroes128()};
return rv;
#endif
}
static really_inline m256 ones256(void) {
#if defined(HAVE_AVX2)
m256 rv = _mm256_set1_epi8(0xFF);
#else
m256 rv = {ones128(), ones128()};
#endif
return rv;
}
#if defined(HAVE_AVX2)
static really_inline m256 and256(m256 a, m256 b) {
return _mm256_and_si256(a, b);
}
#else
static really_inline m256 and256(m256 a, m256 b) {
m256 rv;
rv.lo = and128(a.lo, b.lo);
rv.hi = and128(a.hi, b.hi);
return rv;
}
#endif
#if defined(HAVE_AVX2)
static really_inline m256 or256(m256 a, m256 b) {
return _mm256_or_si256(a, b);
}
#else
static really_inline m256 or256(m256 a, m256 b) {
m256 rv;
rv.lo = or128(a.lo, b.lo);
rv.hi = or128(a.hi, b.hi);
return rv;
}
#endif
#if defined(HAVE_AVX2)
static really_inline m256 xor256(m256 a, m256 b) {
return _mm256_xor_si256(a, b);
}
#else
static really_inline m256 xor256(m256 a, m256 b) {
m256 rv;
rv.lo = xor128(a.lo, b.lo);
rv.hi = xor128(a.hi, b.hi);
return rv;
}
#endif
#if defined(HAVE_AVX2)
static really_inline m256 not256(m256 a) {
return _mm256_xor_si256(a, ones256());
}
#else
static really_inline m256 not256(m256 a) {
m256 rv;
rv.lo = not128(a.lo);
rv.hi = not128(a.hi);
return rv;
}
#endif
#if defined(HAVE_AVX2)
static really_inline m256 andnot256(m256 a, m256 b) {
return _mm256_andnot_si256(a, b);
}
#else
static really_inline m256 andnot256(m256 a, m256 b) {
m256 rv;
rv.lo = andnot128(a.lo, b.lo);
rv.hi = andnot128(a.hi, b.hi);
return rv;
}
#endif
static really_inline int diff256(m256 a, m256 b) {
#if defined(HAVE_AVX2)
return !!(_mm256_movemask_epi8(_mm256_cmpeq_epi8(a, b)) ^ (int)-1);
#else
return diff128(a.lo, b.lo) || diff128(a.hi, b.hi);
#endif
}
static really_inline int isnonzero256(m256 a) {
#if defined(HAVE_AVX2)
return !!diff256(a, zeroes256());
#else
return isnonzero128(or128(a.lo, a.hi));
#endif
}
/**
* "Rich" version of diff256(). Takes two vectors a and b and returns an 8-bit
* mask indicating which 32-bit words contain differences.
*/
static really_inline u32 diffrich256(m256 a, m256 b) {
#if defined(HAVE_AVX2)
a = _mm256_cmpeq_epi32(a, b);
return ~(_mm256_movemask_ps(_mm256_castsi256_ps(a))) & 0xFF;
#else
m128 z = zeroes128();
a.lo = _mm_cmpeq_epi32(a.lo, b.lo);
a.hi = _mm_cmpeq_epi32(a.hi, b.hi);
m128 packed = _mm_packs_epi16(_mm_packs_epi32(a.lo, a.hi), z);
return ~(_mm_movemask_epi8(packed)) & 0xff;
#endif
}
/**
* "Rich" version of diff256(), 64-bit variant. Takes two vectors a and b and
* returns an 8-bit mask indicating which 64-bit words contain differences.
*/
static really_inline u32 diffrich64_256(m256 a, m256 b) {
u32 d = diffrich256(a, b);
return (d | (d >> 1)) & 0x55555555;
}
// aligned load
static really_inline m256 load256(const void *ptr) {
assert(ISALIGNED_N(ptr, alignof(m256)));
#if defined(HAVE_AVX2)
return _mm256_load_si256((const m256 *)ptr);
#else
m256 rv = { load128(ptr), load128((const char *)ptr + 16) };
return rv;
#endif
}
// aligned load of 128-bit value to low and high part of 256-bit value
static really_inline m256 load2x128(const void *ptr) {
#if defined(HAVE_AVX2)
return set2x128(load128(ptr));
#else
assert(ISALIGNED_N(ptr, alignof(m128)));
m256 rv;
rv.hi = rv.lo = load128(ptr);
return rv;
#endif
}
static really_inline m256 loadu2x128(const void *ptr) {
return set2x128(loadu128(ptr));
}
// aligned store
static really_inline void store256(void *ptr, m256 a) {
assert(ISALIGNED_N(ptr, alignof(m256)));
#if defined(HAVE_AVX2)
_mm256_store_si256((m256 *)ptr, a);
#else
ptr = assume_aligned(ptr, 16);
*(m256 *)ptr = a;
#endif
}
// unaligned load
static really_inline m256 loadu256(const void *ptr) {
#if defined(HAVE_AVX2)
return _mm256_loadu_si256((const m256 *)ptr);
#else
m256 rv = { loadu128(ptr), loadu128((const char *)ptr + 16) };
return rv;
#endif
}
// unaligned store
static really_inline void storeu256(void *ptr, m256 a) {
#if defined(HAVE_AVX2)
_mm256_storeu_si256((m256 *)ptr, a);
#else
storeu128(ptr, a.lo);
storeu128((char *)ptr + 16, a.hi);
#endif
}
// packed unaligned store of first N bytes
static really_inline
void storebytes256(void *ptr, m256 a, unsigned int n) {
assert(n <= sizeof(a));
memcpy(ptr, &a, n);
}
// packed unaligned load of first N bytes, pad with zero
static really_inline
m256 loadbytes256(const void *ptr, unsigned int n) {
m256 a = zeroes256();
assert(n <= sizeof(a));
memcpy(&a, ptr, n);
return a;
}
static really_inline
m256 mask1bit256(unsigned int n) {
assert(n < sizeof(m256) * 8);
u32 mask_idx = ((n % 8) * 64) + 95;
mask_idx -= n / 8;
return loadu256(&simd_onebit_masks[mask_idx]);
}
static really_inline
m256 set64x4(u64a hi_1, u64a hi_0, u64a lo_1, u64a lo_0) {
#if defined(HAVE_AVX2)
return _mm256_set_epi64x(hi_1, hi_0, lo_1, lo_0);
#else
m256 rv;
rv.hi = set64x2(hi_1, hi_0);
rv.lo = set64x2(lo_1, lo_0);
return rv;
#endif
}
#if !defined(HAVE_AVX2)
// switches on bit N in the given vector.
static really_inline
void setbit256(m256 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
m128 *sub;
if (n < 128) {
sub = &ptr->lo;
} else {
sub = &ptr->hi;
n -= 128;
}
setbit128(sub, n);
}
// switches off bit N in the given vector.
static really_inline
void clearbit256(m256 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
m128 *sub;
if (n < 128) {
sub = &ptr->lo;
} else {
sub = &ptr->hi;
n -= 128;
}
clearbit128(sub, n);
}
// tests bit N in the given vector.
static really_inline
char testbit256(m256 val, unsigned int n) {
assert(n < sizeof(val) * 8);
m128 sub;
if (n < 128) {
sub = val.lo;
} else {
sub = val.hi;
n -= 128;
}
return testbit128(sub, n);
}
static really_really_inline
m128 movdq_hi(m256 x) {
return x.hi;
}
static really_really_inline
m128 movdq_lo(m256 x) {
return x.lo;
}
static really_inline
m256 combine2x128(m128 hi, m128 lo) {
m256 rv = {lo, hi};
return rv;
}
#else // AVX2
// switches on bit N in the given vector.
static really_inline
void setbit256(m256 *ptr, unsigned int n) {
*ptr = or256(mask1bit256(n), *ptr);
}
static really_inline
void clearbit256(m256 *ptr, unsigned int n) {
*ptr = andnot256(mask1bit256(n), *ptr);
}
// tests bit N in the given vector.
static really_inline
char testbit256(m256 val, unsigned int n) {
const m256 mask = mask1bit256(n);
return !_mm256_testz_si256(mask, val);
}
static really_really_inline
m128 movdq_hi(m256 x) {
return _mm256_extracti128_si256(x, 1);
}
static really_really_inline
m128 movdq_lo(m256 x) {
return _mm256_extracti128_si256(x, 0);
}
#define cast256to128(a) _mm256_castsi256_si128(a)
#define cast128to256(a) _mm256_castsi128_si256(a)
#define swap128in256(a) _mm256_permute4x64_epi64(a, 0x4E)
#define insert128to256(a, b, imm) _mm256_inserti128_si256(a, b, imm)
#define rshift128_m256(a, count_immed) _mm256_srli_si256(a, count_immed)
#define lshift128_m256(a, count_immed) _mm256_slli_si256(a, count_immed)
#define extract64from256(a, imm) _mm_extract_epi64(_mm256_extracti128_si256(a, imm >> 1), imm % 2)
#define extract32from256(a, imm) _mm_extract_epi32(_mm256_extracti128_si256(a, imm >> 2), imm % 4)
#define extractlow64from256(a) _mm_cvtsi128_si64(cast256to128(a))
#define extractlow32from256(a) movd(cast256to128(a))
#define interleave256hi(a, b) _mm256_unpackhi_epi8(a, b)
#define interleave256lo(a, b) _mm256_unpacklo_epi8(a, b)
#define vpalignr(r, l, offset) _mm256_alignr_epi8(r, l, offset)
static really_inline
m256 combine2x128(m128 hi, m128 lo) {
#if defined(_mm256_set_m128i)
return _mm256_set_m128i(hi, lo);
#else
return insert128to256(cast128to256(lo), hi, 1);
#endif
}
#endif //AVX2
#if defined(HAVE_AVX512)
#define extract128from512(a, imm) _mm512_extracti32x4_epi32(a, imm)
#define interleave512hi(a, b) _mm512_unpackhi_epi8(a, b)
#define interleave512lo(a, b) _mm512_unpacklo_epi8(a, b)
#define set2x256(a) _mm512_broadcast_i64x4(a)
#define mask_set2x256(src, k, a) _mm512_mask_broadcast_i64x4(src, k, a)
#define vpermq512(idx, a) _mm512_permutexvar_epi64(idx, a)
#endif
/****
**** 384-bit Primitives
****/
static really_inline m384 and384(m384 a, m384 b) {
m384 rv;
rv.lo = and128(a.lo, b.lo);
rv.mid = and128(a.mid, b.mid);
rv.hi = and128(a.hi, b.hi);
return rv;
}
static really_inline m384 or384(m384 a, m384 b) {
m384 rv;
rv.lo = or128(a.lo, b.lo);
rv.mid = or128(a.mid, b.mid);
rv.hi = or128(a.hi, b.hi);
return rv;
}
static really_inline m384 xor384(m384 a, m384 b) {
m384 rv;
rv.lo = xor128(a.lo, b.lo);
rv.mid = xor128(a.mid, b.mid);
rv.hi = xor128(a.hi, b.hi);
return rv;
}
static really_inline m384 not384(m384 a) {
m384 rv;
rv.lo = not128(a.lo);
rv.mid = not128(a.mid);
rv.hi = not128(a.hi);
return rv;
}
static really_inline m384 andnot384(m384 a, m384 b) {
m384 rv;
rv.lo = andnot128(a.lo, b.lo);
rv.mid = andnot128(a.mid, b.mid);
rv.hi = andnot128(a.hi, b.hi);
return rv;
}
static really_really_inline
m384 lshift64_m384(m384 a, unsigned b) {
m384 rv;
rv.lo = lshift64_m128(a.lo, b);
rv.mid = lshift64_m128(a.mid, b);
rv.hi = lshift64_m128(a.hi, b);
return rv;
}
static really_inline m384 zeroes384(void) {
m384 rv = {zeroes128(), zeroes128(), zeroes128()};
return rv;
}
static really_inline m384 ones384(void) {
m384 rv = {ones128(), ones128(), ones128()};
return rv;
}
static really_inline int diff384(m384 a, m384 b) {
return diff128(a.lo, b.lo) || diff128(a.mid, b.mid) || diff128(a.hi, b.hi);
}
static really_inline int isnonzero384(m384 a) {
return isnonzero128(or128(or128(a.lo, a.mid), a.hi));
}
/**
* "Rich" version of diff384(). Takes two vectors a and b and returns a 12-bit
* mask indicating which 32-bit words contain differences.
*/
static really_inline u32 diffrich384(m384 a, m384 b) {
m128 z = zeroes128();
a.lo = _mm_cmpeq_epi32(a.lo, b.lo);
a.mid = _mm_cmpeq_epi32(a.mid, b.mid);
a.hi = _mm_cmpeq_epi32(a.hi, b.hi);
m128 packed = _mm_packs_epi16(_mm_packs_epi32(a.lo, a.mid),
_mm_packs_epi32(a.hi, z));
return ~(_mm_movemask_epi8(packed)) & 0xfff;
}
/**
* "Rich" version of diff384(), 64-bit variant. Takes two vectors a and b and
* returns a 12-bit mask indicating which 64-bit words contain differences.
*/
static really_inline u32 diffrich64_384(m384 a, m384 b) {
u32 d = diffrich384(a, b);
return (d | (d >> 1)) & 0x55555555;
}
// aligned load
static really_inline m384 load384(const void *ptr) {
assert(ISALIGNED_16(ptr));
m384 rv = { load128(ptr), load128((const char *)ptr + 16),
load128((const char *)ptr + 32) };
return rv;
}
// aligned store
static really_inline void store384(void *ptr, m384 a) {
assert(ISALIGNED_16(ptr));
ptr = assume_aligned(ptr, 16);
*(m384 *)ptr = a;
}
// unaligned load
static really_inline m384 loadu384(const void *ptr) {
m384 rv = { loadu128(ptr), loadu128((const char *)ptr + 16),
loadu128((const char *)ptr + 32)};
return rv;
}
// packed unaligned store of first N bytes
static really_inline
void storebytes384(void *ptr, m384 a, unsigned int n) {
assert(n <= sizeof(a));
memcpy(ptr, &a, n);
}
// packed unaligned load of first N bytes, pad with zero
static really_inline
m384 loadbytes384(const void *ptr, unsigned int n) {
m384 a = zeroes384();
assert(n <= sizeof(a));
memcpy(&a, ptr, n);
return a;
}
// switches on bit N in the given vector.
static really_inline
void setbit384(m384 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
m128 *sub;
if (n < 128) {
sub = &ptr->lo;
} else if (n < 256) {
sub = &ptr->mid;
} else {
sub = &ptr->hi;
}
setbit128(sub, n % 128);
}
// switches off bit N in the given vector.
static really_inline
void clearbit384(m384 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
m128 *sub;
if (n < 128) {
sub = &ptr->lo;
} else if (n < 256) {
sub = &ptr->mid;
} else {
sub = &ptr->hi;
}
clearbit128(sub, n % 128);
}
// tests bit N in the given vector.
static really_inline
char testbit384(m384 val, unsigned int n) {
assert(n < sizeof(val) * 8);
m128 sub;
if (n < 128) {
sub = val.lo;
} else if (n < 256) {
sub = val.mid;
} else {
sub = val.hi;
}
return testbit128(sub, n % 128);
}
/****
**** 512-bit Primitives
****/
#define eq512mask(a, b) _mm512_cmpeq_epi8_mask((a), (b))
#define masked_eq512mask(k, a, b) _mm512_mask_cmpeq_epi8_mask((k), (a), (b))
static really_inline
m512 zeroes512(void) {
#if defined(HAVE_AVX512)
return _mm512_setzero_si512();
#else
m512 rv = {zeroes256(), zeroes256()};
return rv;
#endif
}
static really_inline
m512 ones512(void) {
#if defined(HAVE_AVX512)
return _mm512_set1_epi8(0xFF);
//return _mm512_xor_si512(_mm512_setzero_si512(), _mm512_setzero_si512());
#else
m512 rv = {ones256(), ones256()};
return rv;
#endif
}
#if defined(HAVE_AVX512)
static really_inline
m512 set64x8(u8 a) {
return _mm512_set1_epi8(a);
}
static really_inline
m512 set8x64(u64a a) {
return _mm512_set1_epi64(a);
}
static really_inline
m512 set512_64(u64a hi_3, u64a hi_2, u64a hi_1, u64a hi_0,
u64a lo_3, u64a lo_2, u64a lo_1, u64a lo_0) {
return _mm512_set_epi64(hi_3, hi_2, hi_1, hi_0,
lo_3, lo_2, lo_1, lo_0);
}
static really_inline
m512 swap256in512(m512 a) {
m512 idx = set512_64(3ULL, 2ULL, 1ULL, 0ULL, 7ULL, 6ULL, 5ULL, 4ULL);
return vpermq512(idx, a);
}
static really_inline
m512 set4x128(m128 a) {
return _mm512_broadcast_i32x4(a);
}
#endif
static really_inline
m512 and512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return _mm512_and_si512(a, b);
#else
m512 rv;
rv.lo = and256(a.lo, b.lo);
rv.hi = and256(a.hi, b.hi);
return rv;
#endif
}
static really_inline
m512 or512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return _mm512_or_si512(a, b);
#else
m512 rv;
rv.lo = or256(a.lo, b.lo);
rv.hi = or256(a.hi, b.hi);
return rv;
#endif
}
static really_inline
m512 xor512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return _mm512_xor_si512(a, b);
#else
m512 rv;
rv.lo = xor256(a.lo, b.lo);
rv.hi = xor256(a.hi, b.hi);
return rv;
#endif
}
static really_inline
m512 not512(m512 a) {
#if defined(HAVE_AVX512)
return _mm512_xor_si512(a, ones512());
#else
m512 rv;
rv.lo = not256(a.lo);
rv.hi = not256(a.hi);
return rv;
#endif
}
static really_inline
m512 andnot512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return _mm512_andnot_si512(a, b);
#else
m512 rv;
rv.lo = andnot256(a.lo, b.lo);
rv.hi = andnot256(a.hi, b.hi);
return rv;
#endif
}
#if defined(HAVE_AVX512)
static really_really_inline
m512 lshift64_m512(m512 a, unsigned b) {
#if defined(HAVE__BUILTIN_CONSTANT_P)
if (__builtin_constant_p(b)) {
return _mm512_slli_epi64(a, b);
}
#endif
m128 x = _mm_cvtsi32_si128(b);
return _mm512_sll_epi64(a, x);
}
#else
static really_really_inline
m512 lshift64_m512(m512 a, unsigned b) {
m512 rv;
rv.lo = lshift64_m256(a.lo, b);
rv.hi = lshift64_m256(a.hi, b);
return rv;
}
#endif
#if defined(HAVE_AVX512)
#define rshift64_m512(a, b) _mm512_srli_epi64((a), (b))
#define rshift128_m512(a, count_immed) _mm512_bsrli_epi128(a, count_immed)
#define lshift128_m512(a, count_immed) _mm512_bslli_epi128(a, count_immed)
#endif
#if !defined(_MM_CMPINT_NE)
#define _MM_CMPINT_NE 0x4
#endif
static really_inline
int diff512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return !!_mm512_cmp_epi8_mask(a, b, _MM_CMPINT_NE);
#else
return diff256(a.lo, b.lo) || diff256(a.hi, b.hi);
#endif
}
static really_inline
int isnonzero512(m512 a) {
#if defined(HAVE_AVX512)
return diff512(a, zeroes512());
#elif defined(HAVE_AVX2)
m256 x = or256(a.lo, a.hi);
return !!diff256(x, zeroes256());
#else
m128 x = or128(a.lo.lo, a.lo.hi);
m128 y = or128(a.hi.lo, a.hi.hi);
return isnonzero128(or128(x, y));
#endif
}
/**
* "Rich" version of diff512(). Takes two vectors a and b and returns a 16-bit
* mask indicating which 32-bit words contain differences.
*/
static really_inline
u32 diffrich512(m512 a, m512 b) {
#if defined(HAVE_AVX512)
return _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_NE);
#elif defined(HAVE_AVX2)
return diffrich256(a.lo, b.lo) | (diffrich256(a.hi, b.hi) << 8);
#else
a.lo.lo = _mm_cmpeq_epi32(a.lo.lo, b.lo.lo);
a.lo.hi = _mm_cmpeq_epi32(a.lo.hi, b.lo.hi);
a.hi.lo = _mm_cmpeq_epi32(a.hi.lo, b.hi.lo);
a.hi.hi = _mm_cmpeq_epi32(a.hi.hi, b.hi.hi);
m128 packed = _mm_packs_epi16(_mm_packs_epi32(a.lo.lo, a.lo.hi),
_mm_packs_epi32(a.hi.lo, a.hi.hi));
return ~(_mm_movemask_epi8(packed)) & 0xffff;
#endif
}
/**
* "Rich" version of diffrich(), 64-bit variant. Takes two vectors a and b and
* returns a 16-bit mask indicating which 64-bit words contain differences.
*/
static really_inline
u32 diffrich64_512(m512 a, m512 b) {
//TODO: cmp_epi64?
u32 d = diffrich512(a, b);
return (d | (d >> 1)) & 0x55555555;
}
// aligned load
static really_inline
m512 load512(const void *ptr) {
#if defined(HAVE_AVX512)
return _mm512_load_si512(ptr);
#else
assert(ISALIGNED_N(ptr, alignof(m256)));
m512 rv = { load256(ptr), load256((const char *)ptr + 32) };
return rv;
#endif
}
// aligned store
static really_inline
void store512(void *ptr, m512 a) {
assert(ISALIGNED_N(ptr, alignof(m512)));
#if defined(HAVE_AVX512)
return _mm512_store_si512(ptr, a);
#elif defined(HAVE_AVX2)
m512 *x = (m512 *)ptr;
store256(&x->lo, a.lo);
store256(&x->hi, a.hi);
#else
ptr = assume_aligned(ptr, 16);
*(m512 *)ptr = a;
#endif
}
// unaligned load
static really_inline
m512 loadu512(const void *ptr) {
#if defined(HAVE_AVX512)
return _mm512_loadu_si512(ptr);
#else
m512 rv = { loadu256(ptr), loadu256((const char *)ptr + 32) };
return rv;
#endif
}
#if defined(HAVE_AVX512)
static really_inline
m512 loadu_maskz_m512(__mmask64 k, const void *ptr) {
return _mm512_maskz_loadu_epi8(k, ptr);
}
static really_inline
m512 loadu_mask_m512(m512 src, __mmask64 k, const void *ptr) {
return _mm512_mask_loadu_epi8(src, k, ptr);
}
static really_inline
m512 set_mask_m512(__mmask64 k) {
return _mm512_movm_epi8(k);
}
#endif
// packed unaligned store of first N bytes
static really_inline
void storebytes512(void *ptr, m512 a, unsigned int n) {
assert(n <= sizeof(a));
memcpy(ptr, &a, n);
}
// packed unaligned load of first N bytes, pad with zero
static really_inline
m512 loadbytes512(const void *ptr, unsigned int n) {
m512 a = zeroes512();
assert(n <= sizeof(a));
memcpy(&a, ptr, n);
return a;
}
static really_inline
m512 mask1bit512(unsigned int n) {
assert(n < sizeof(m512) * 8);
u32 mask_idx = ((n % 8) * 64) + 95;
mask_idx -= n / 8;
return loadu512(&simd_onebit_masks[mask_idx]);
}
// switches on bit N in the given vector.
static really_inline
void setbit512(m512 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
#if !defined(HAVE_AVX2)
m128 *sub;
if (n < 128) {
sub = &ptr->lo.lo;
} else if (n < 256) {
sub = &ptr->lo.hi;
} else if (n < 384) {
sub = &ptr->hi.lo;
} else {
sub = &ptr->hi.hi;
}
setbit128(sub, n % 128);
#elif defined(HAVE_AVX512)
*ptr = or512(mask1bit512(n), *ptr);
#else
m256 *sub;
if (n < 256) {
sub = &ptr->lo;
} else {
sub = &ptr->hi;
n -= 256;
}
setbit256(sub, n);
#endif
}
// switches off bit N in the given vector.
static really_inline
void clearbit512(m512 *ptr, unsigned int n) {
assert(n < sizeof(*ptr) * 8);
#if !defined(HAVE_AVX2)
m128 *sub;
if (n < 128) {
sub = &ptr->lo.lo;
} else if (n < 256) {
sub = &ptr->lo.hi;
} else if (n < 384) {
sub = &ptr->hi.lo;
} else {
sub = &ptr->hi.hi;
}
clearbit128(sub, n % 128);
#elif defined(HAVE_AVX512)
*ptr = andnot512(mask1bit512(n), *ptr);
#else
m256 *sub;
if (n < 256) {
sub = &ptr->lo;
} else {
sub = &ptr->hi;
n -= 256;
}
clearbit256(sub, n);
#endif
}
// tests bit N in the given vector.
static really_inline
char testbit512(m512 val, unsigned int n) {
assert(n < sizeof(val) * 8);
#if !defined(HAVE_AVX2)
m128 sub;
if (n < 128) {
sub = val.lo.lo;
} else if (n < 256) {
sub = val.lo.hi;
} else if (n < 384) {
sub = val.hi.lo;
} else {
sub = val.hi.hi;
}
return testbit128(sub, n % 128);
#elif defined(HAVE_AVX512)
const m512 mask = mask1bit512(n);
return !!_mm512_test_epi8_mask(mask, val);
#else
m256 sub;
if (n < 256) {
sub = val.lo;
} else {
sub = val.hi;
n -= 256;
}
return testbit256(sub, n);
#endif
}
#endif
| [
"matthew.barr@intel.com"
] | matthew.barr@intel.com |
47090cdc4f3e35891ee2d11483abf7a8105bb5d8 | 0cb919aab98c45162ee9d51cc6a1e37814961d43 | /corectari/ft_printf/bla/ft_chartoint.c | 095f0f7f1953649bf7323cba4d27135588ad7fc4 | [] | no_license | gustavo249/power | b66aace2a4dd6d83094f551b029c6bd4eda13580 | bf7b35fefa531be68af7b4a20ff937803411a9c1 | refs/heads/master | 2021-01-10T11:03:21.372194 | 2016-02-15T12:35:16 | 2016-02-15T12:35:16 | 45,904,657 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,244 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_chartoint.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ocota <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/11/14 04:44:51 by ocota #+# #+# */
/* Updated: 2015/11/14 04:46:09 by ocota ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_chartoint(char c)
{
if (c == 'A' || c == 'a')
return (10);
else if (c == 'B' || c == 'b')
return (11);
else if (c == 'C' || c == 'c')
return (12);
else if (c == 'D' || c == 'd')
return (13);
else if (c == 'E' || c == 'e')
return (14);
else if (c == 'F' || c == 'f')
return (15);
else
return (c - 48);
}
| [
"rcrisan@e1p18.cluj.42.fr"
] | rcrisan@e1p18.cluj.42.fr |
1be8d070689128620e3caa9ddee4bd82e0e4007b | b71b8bd385c207dffda39d96c7bee5f2ccce946c | /testcases/CWE134_Uncontrolled_Format_String/s02/CWE134_Uncontrolled_Format_String__char_environment_vprintf_04.c | a3aa29f9ae55b2dd4c2638202a2a2364532ff8c1 | [] | no_license | Sporknugget/Juliet_prep | e9bda84a30bdc7938bafe338b4ab2e361449eda5 | 97d8922244d3d79b62496ede4636199837e8b971 | refs/heads/master | 2023-05-05T14:41:30.243718 | 2021-05-25T16:18:13 | 2021-05-25T16:18:13 | 369,334,230 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,242 | c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__char_environment_vprintf_04.c
Label Definition File: CWE134_Uncontrolled_Format_String.vasinks.label.xml
Template File: sources-vasinks-04.tmpl.c
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: environment Read input from an environment variable
* GoodSource: Copy a fixed string into data
* Sinks: vprintf
* GoodSink: vprintf with a format string
* BadSink : vprintf without a format string
* Flow Variant: 04 Control flow: if(STATIC_CONST_TRUE) and if(STATIC_CONST_FALSE)
*
* */
#include <stdarg.h>
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
#define ENV_VARIABLE "ADD"
#ifdef _WIN32
#define GETENV getenv
#else
#define GETENV getenv
#endif
/* The two variables below are declared "const", so a tool should
be able to identify that reads of these will always return their
initialized values. */
static const int STATIC_CONST_TRUE = 1; /* true */
static const int STATIC_CONST_FALSE = 0; /* false */
#ifndef OMITBAD
static void badVaSinkB(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
vprintf(data, args);
va_end(args);
}
}
void CWE134_Uncontrolled_Format_String__char_environment_vprintf_04_bad()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
{
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
}
{
badVaSinkB(data, data);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
static void goodB2G1VaSinkG(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* FIX: Specify the format disallowing a format string vulnerability */
vprintf("%s", args);
va_end(args);
}
}
/* goodB2G1() - use badsource and goodsink by changing the second STATIC_CONST_TRUE to STATIC_CONST_FALSE */
static void goodB2G1()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
{
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
}
{
goodB2G1VaSinkG(data, data);
}
}
static void goodB2G2VaSinkG(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* FIX: Specify the format disallowing a format string vulnerability */
vprintf("%s", args);
va_end(args);
}
}
/* goodB2G2() - use badsource and goodsink by reversing the blocks in the second if */
static void goodB2G2()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
{
{
/* Append input from an environment variable to data */
size_t dataLen = strlen(data);
char * environment = GETENV(ENV_VARIABLE);
/* If there is data in the environment variable */
if (environment != NULL)
{
/* POTENTIAL FLAW: Read data from an environment variable */
strncat(data+dataLen, environment, 100-dataLen-1);
}
}
}
{
goodB2G2VaSinkG(data, data);
}
}
static void goodG2B1VaSinkB(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
vprintf(data, args);
va_end(args);
}
}
/* goodG2B1() - use goodsource and badsink by changing the first STATIC_CONST_TRUE to STATIC_CONST_FALSE */
static void goodG2B1()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
{
/* FIX: Use a fixed string that does not contain a format specifier */
strcpy(data, "fixedstringtest");
}
{
goodG2B1VaSinkB(data, data);
}
}
static void goodG2B2VaSinkB(char * data, ...)
{
{
va_list args;
va_start(args, data);
/* POTENTIAL FLAW: Do not specify the format allowing a possible format string vulnerability */
vprintf(data, args);
va_end(args);
}
}
/* goodG2B2() - use goodsource and badsink by reversing the blocks in the first if */
static void goodG2B2()
{
char * data;
char dataBuffer[100] = "";
data = dataBuffer;
{
/* FIX: Use a fixed string that does not contain a format specifier */
strcpy(data, "fixedstringtest");
}
{
goodG2B2VaSinkB(data, data);
}
}
void CWE134_Uncontrolled_Format_String__char_environment_vprintf_04_good()
{
goodG2B1();
goodG2B2();
goodB2G1();
goodB2G2();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE134_Uncontrolled_Format_String__char_environment_vprintf_04_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE134_Uncontrolled_Format_String__char_environment_vprintf_04_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"jaredzap@rams.colostate.edu"
] | jaredzap@rams.colostate.edu |
4660aa8a508a68444692c71c62b3e9a3a036a6fd | 187c76fffeeeb0f06e0729a9234cd397cc026f73 | /macros/stc/velut_m.h | f8b9a65c07b5dce9d82b93bdc00bdf828677fdcf | [
"MIT"
] | permissive | mfkiwl/riscv-pvp | 2b728030a68aa5045083891d0d8bb6fab22818ba | 91154e7c0e97c611a21fed33499498b6fcaf0420 | refs/heads/master | 2023-04-16T20:41:36.722091 | 2021-05-10T09:25:29 | 2021-05-10T09:25:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 8,766 | h | // See LICENSE for license details.
#ifndef __TEST_MACROS_VELUT_M_H
#define __TEST_MACROS_VELUT_M_H
#include "test_macros.h"
#include "test_macros_stc.h"
#include "exception.h"
#define LDINS lh
#define STINS sh
#define ESIZE 2
#define SETCSR(height, width, stride_s1, stride_s2, stride_dst) \
li a0, (width << 16 + height); \
csrw shape_s1, a0; \
li a0, (stride_s2 << 16 + stride_s1); \
li a1, stride_dst; \
csrw stride_s, a0; \
csrw stride_d, a1;
// As there are 16 bit in a float 16, the maxmial value of binary
// representation for a half float is 64*1024 - 1, the maximal index
// for LUT is 64*1024*2, so the maximal table size is 128kB.
// split L1B(last 1 buffer) into 3 blocks of the following size
// 576kB + 576kB + 128kB
#define VELUTM_RD_ADDR 0xc0000000
#define VELUTM_RS1_ADDR 0xc0090000
#define VELUTM_RS2_ADDR 0xC0120000
// The instruction set specification Rev0.19 has the following note:
// The address of table, the second source operand of lut.m, must not
// be met the following conditions: 0x0F800 <= base_address < 0x2F7FF
// Now spike and hardware implementation both not compily with this.
// If the rule is compilied with later, the macro should be defined as
// follows:
// #define LUTM_RS2_ADDR 0x0F800
#define EQM(vec1, vec2, vlen) VV_CHECK_EQ_HF(vec1, vec2, vlen, 0.0001, 5)
/*******************************************************************************
* Functional tests with basic data
******************************************************************************/
/**
* Functional tests with basic data
*
* @testnum test case number
* @result start addr for test result
* @val1 start addr for source matrix
* @val2 start addr for source table
* @width matrix width
* @height matrix height
* @tsize size of the source table
* @ebits element bits, 8 for byte, 16 for half, 32 for word
* @eqm macro for compare two matrix
*/
#define TEST_VELUT_M_INTERNAL( testnum, result, val1, width, height, val2, tsize, ebits, eqm ) \
test_ ## testnum: \
li TESTNUM, testnum; \
COPY(VELUTM_RS1_ADDR, val1, height*width, LDINS, STINS, ESIZE) \
COPY(VELUTM_RS2_ADDR, val2, tsize, LDINS, STINS, ESIZE) \
SETCSR(height, width, 0, 0, 0) \
PERF_BEGIN() \
la a0, VELUTM_RD_ADDR; \
la a1, VELUTM_RS1_ADDR; \
la a2, VELUTM_RS2_ADDR; \
velut.m (a0), (a1), (a2); \
PERF_END(width ## _ ## height ## _ ## testnum) \
COPY(test_##testnum##_data, VELUTM_RD_ADDR, height*width, LDINS, STINS, ESIZE) \
eqm(result, test_ ## testnum ## _data, (width * height)); \
.pushsection .data; \
test_ ## testnum ## _data: \
.fill (width * height), (ebits/8), 0; \
.popsection
/**
* Functional tests with basic data
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @tsize size of the source table
*/
#define TEST_VELUT_M( testnum, width, height, tsize ) \
TEST_VELUT_M_INTERNAL(testnum, t##testnum##_rd, t##testnum##_rs1, \
width, height, t##testnum##_rs2, tsize, 16, EQM)
/**
* Functional tests with stride data
*
* @testnum test case number
* @inst inst to test
* @result start addr for test result
* @val1 start addr for source matrix
* @width matrix width
* @height matrix height
* @val2 start addr for table
* @tsize size of the source table
* @dstride dest matrix stride
* @sstride source matrix stride
* @eqm macro for compare two matrix
*/
#define TEST_VELUT_M_STRIDE_INTERNAL(testnum, inst, result, val1, width, height, val2, tsize, dstride, sstride) \
test_ ## testnum: \
li TESTNUM, testnum; \
COPY_STRIDE_D(VELUTM_RS1_ADDR, val1, height, width, sstride, LDINS, STINS, ESIZE) \
COPY(VELUTM_RS2_ADDR, val2, tsize, LDINS, STINS, ESIZE) \
SETCSR(height, width, sstride, 0, dstride) \
PERF_BEGIN() \
la a0, VELUTM_RD_ADDR; \
la a1, VELUTM_RS1_ADDR; \
la a2, VELUTM_RS2_ADDR; \
inst (a0), (a1), (a2); \
PERF_END(width ## _ ## height ## _ ## sstride ## _ ##testnum) \
COPY_STRIDE_S(test_##testnum##_data, VELUTM_RD_ADDR, height, width, dstride, LDINS, STINS, ESIZE) \
EQM(result, test_ ## testnum ## _data, (width * height)); \
.pushsection .data; \
test_ ## testnum ## _data: \
.fill (width * height), ESIZE, 0; \
.popsection
/**
* Functional tests with stride data
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @tsize size of the source table
* @dstride dest matrix stride
* @sstride source matrix stride
*/
#define TEST_VELUT_M_STRIDE( testnum, width, height, tsize, dstride, sstride) \
TEST_VELUT_M_STRIDE_INTERNAL(testnum, velut.m, t##testnum##_rd, t##testnum##_rs1, width, height, t##testnum##_rs2, tsize, dstride, sstride)
/**
* Functional tests with inplace compute on rs1
* rd = rs1
*
* @testnum test case number
* @result start addr for test result
* @val1 start addr for source matrix1
* @width matrix width
* @height matrix height
* @val2 start addr for source matrix2
* @tsize size of the source table
*/
#define TEST_VELUT_M_INPLACE_RS1_INTERNAL( testnum, result, val1, width, height, val2, tsize) \
test_ ## testnum: \
li TESTNUM, testnum; \
COPY(VELUTM_RS1_ADDR, val1, height*width, LDINS, STINS, ESIZE) \
COPY(VELUTM_RS2_ADDR, val2, tsize, LDINS, STINS, ESIZE) \
SETCSR(height, width, 0, 0, 0) \
la a1, VELUTM_RS1_ADDR; \
la a2, VELUTM_RS2_ADDR; \
velut.m (a1), (a1), (a2); \
COPY(test_##testnum##_data, VELUTM_RS1_ADDR, height*width, LDINS, STINS, ESIZE) \
EQM(result, test_ ## testnum ## _data, (width * height)); \
.pushsection .data; \
test_ ## testnum ## _data: \
.fill (width * height), ESIZE, 0; \
.popsection
/**
* Functional tests with inplace compute on rs1
* rd = rs1
*
* @testnum test case number
* @inst inst to test
* @width matrix width
* @height matrix height
* @tsize size of the source table
*/
#define TEST_VELUT_M_INPLACE_RS1( testnum, width, height, tsize) \
TEST_VELUT_M_INPLACE_RS1_INTERNAL(testnum, t##testnum##_rd, \
t##testnum##_rs1, width, height, t##testnum##_rs2, tsize )
/*******************************************************************************
* Exception tests
******************************************************************************/
/**
* Misaligned base address for operands
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @doff address offset for dest operand
* @soff1 address offset for source operand 1
* @soff2 address offset for source operand 2
*/
#define TEST_VELUT_M_MISALIGNED_BASE( testnum, width, height, doff, soff1, soff2) \
test_ ## testnum: \
TEST_EXCEPTION(CAUSE_NCP_CUST_MISALIGNED_BASE, test_ ## testnum ## _end); \
li TESTNUM, testnum; \
SETCSR(height, width, 0, 0, 0) \
li a0, VELUTM_RD_ADDR + doff; \
li a1, VELUTM_RS1_ADDR + soff1; \
li a2, VELUTM_RS2_ADDR + soff2; \
velut.m (a0), (a1), (a2); \
j fail; \
test_ ## testnum ## _end: \
/**
* Invalid params exception
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @tsize size of the source table
*/
#define TEST_VELUT_M_INVALID_PARAM( testnum, width, height) \
test_ ## testnum: \
TEST_EXCEPTION(CAUSE_NCP_CUST_INVALID_PARAM, test_ ## testnum ## _end); \
li TESTNUM, testnum; \
SETCSR(height, width, 0, 0, 0) \
li a0, VELUTM_RD_ADDR; \
li a1, VELUTM_RS1_ADDR; \
li a2, VELUTM_RS2_ADDR; \
velut.m (a0), (a1), (a2); \
j fail; \
test_ ## testnum ## _end: \
/**
* Misaligned address because stride for operands
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @dstride stride for dest operand
* @sstride stride for source operand 1
*/
#define TEST_VELUT_M_MISALIGNED_STRIDE( testnum, width, height, dstride, sstride) \
test_ ## testnum: \
TEST_EXCEPTION(CAUSE_NCP_CUST_MISALIGNED_STRIDE, test_ ## testnum ## _end); \
li TESTNUM, testnum; \
SETCSR(height, width, sstride, 0, dstride) \
li a0, VELUTM_RD_ADDR; \
li a1, VELUTM_RS1_ADDR; \
li a2, VELUTM_RS2_ADDR; \
velut.m (a0), (a1), (a2); \
j fail; \
test_ ## testnum ## _end: \
/**
* Access fault
*
* @testnum test case number
* @width matrix width
* @height matrix height
* @src1 address for source operand 1
* @src2 address for source operand 2
*/
#define TEST_VELUT_M_ACCESS_FAULT( testnum, width, height, dst, src1, src2) \
test_ ## testnum: \
TEST_EXCEPTION(CAUSE_NCP_CUST_ACCESS, test_ ## testnum ## _end); \
li TESTNUM, testnum; \
SETCSR(height, width, 0, 0, 0) \
li a0, dst; \
li a1, src1; \
li a2, src2; \
velut.m (a0), (a1), (a2); \
j fail; \
test_ ## testnum ## _end: \
#endif
| [
"xin.ouyang@streamcomputing.com"
] | xin.ouyang@streamcomputing.com |
7a5d5ccd117bd11c8eed3cdca1cc3fda4b325284 | 34db04001db1c6204b7953849cd0852efe548f64 | /pet/tests/tobi2.c | 7944693b720269035a03fa1196613d66cd456b6b | [
"MIT"
] | permissive | yaozhujia/ppcg | 8fb676ca370f575e549d75e234b71b17d98acf5f | e5ec097899611c86a238fb7656534a2f77bf6b37 | refs/heads/master | 2020-03-29T00:40:33.926966 | 2020-02-27T01:25:38 | 2020-02-27T01:25:38 | 149,306,257 | 0 | 0 | MIT | 2018-09-18T15:02:50 | 2018-09-18T14:56:45 | C | UTF-8 | C | false | false | 204 | c | #include <limits.h>
int main() {
unsigned int N = UINT_MAX;
unsigned int i;
int a;
#pragma scop
for (i = 0; i < 20 && i < N + 10; ++i)
a = 5;
#pragma endscop
}
| [
"peter.nie@huawei.com"
] | peter.nie@huawei.com |
f531644e894ddb4e0591bed09c5c6db4857c998c | 9b553bbfc8b0807d7f860964d6044d6ccf6d1342 | /include/rel/d/a/npc/d_a_npc_tkj/d_a_npc_tkj.h | d52c65f8288c3f2c88582e2524aaed09cb187fed | [] | no_license | DedoGamingONE/tp | 5e2e668f7120b154cf6ef6b002c2b4b51ae07ee5 | 5020395dfd34d4dc846e3ea228f6271bfca1c72a | refs/heads/master | 2023-09-03T06:55:25.773029 | 2021-10-24T21:35:00 | 2021-10-24T21:35:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 100 | h | #ifndef D_A_NPC_TKJ_H
#define D_A_NPC_TKJ_H
#include "dolphin/types.h"
#endif /* D_A_NPC_TKJ_H */
| [
""
] | |
7d42794fe638b562b474df983d329f3a09ab5f6c | c55859fad14aa7878d38d178073fa77399abf34f | /video_api/video_encoder/include/xin26x_params.h | f7eb1161175cad645f9e4f72bef2fda157d28abd | [] | no_license | master-of-zen/xin26x | f58d6d444634d23de430b26389ef6f41be196032 | c75fd8b55986dc855ab3d2149713b2388467c216 | refs/heads/master | 2022-12-24T11:27:32.898156 | 2020-10-15T06:38:01 | 2020-10-15T06:38:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,580 | h | /***************************************************************************//**
*
* @file xin26x_params.h
* @brief This files contains h26x encoder configuration api.
* @authors Pig Peppa
* @copyright (c) 2020, Pig Peppa <pig.peppa@qq.com> All rights reserved
*
*******************************************************************************/
#ifndef _xin26x_params_h_
#define _xin26x_params_h_
#include "xin26x_logger.h"
#ifdef __cplusplus
extern "C" {
#endif
#define XIN26X_OPTION_SET_IDR 0
#define XIN26X_OPTION_SET_FPS 1
#define XIN26X_OPTION_SET_BITRATE 2
#define XIN26X_OPTION_SET_TEMPLAYER 3
#define XIN26X_OPTION_SET_RCMODE 4
#define XIN26X_OPTION_GET_PSNR 5
#define XIN26X_DYN_COMMAND_INVALID (255)
#define XIN26X_STAT_NONE 0
#define XIN26X_STAT_SEQ 1
#define XIN26X_STAT_PIC 2
typedef struct xin_frame_desc
{
UINT8 *yuvBuf[3];
UINT32 lumaWidth;
UINT32 lumaHeight;
intptr_t lumaStride;
intptr_t chromaStride;
} xin_frame_desc;
typedef struct xin_out_buf_desc
{
UINT8 *bitsBuf;
SINT32 bytesGenerate;
UINT32 temporalLayer;
} xin_out_buf_desc;
typedef struct xin26x_params
{
UINT32 inputWidth;
UINT32 inputHeight;
float frameRate;
UINT32 bitRate;
UINT32 minQp;
UINT32 maxQp;
UINT32 rcMode;
BOOL frameSkip;
UINT32 encoderMode;
UINT32 algorithmMode;
UINT32 frameToBeEncoded;
UINT32 bFrameNum;
UINT32 refFrameNum;
UINT32 refreshType;
UINT32 temporalLayerNum;
UINT32 intraPeriod;
UINT32 screenContentMode;
UINT32 bitDepth;
UINT32 minCbSize;
UINT32 maxCbSize;
UINT32 minTbSize;
UINT32 maxTbSize;
UINT32 interTbDepth;
UINT32 intraTbDepth;
UINT32 qp;
BOOL calcPsnr;
BOOL enableSao;
BOOL enableStrongIntraSmoothing;
BOOL enableTMvp;
BOOL enableSignDataHiding;
BOOL enableRdoq;
BOOL enableIntraNxN;
BOOL enableInterNxN;
BOOL constrainedIntraPredFlag;
BOOL transformSkipFlag;
BOOL enableCuQpDelta;
UINT32 diffCuQpDeltaDepth;
UINT32 motionSearchMode;
UINT32 searchRange;
BOOL enableSmp;
BOOL enableAmp;
// h266 settings
UINT32 ctuSize;
UINT32 minQtSize;
UINT32 maxBtSize;
UINT32 maxTtSize;
UINT32 maxMttDepth;
UINT32 minCuSize;
UINT32 maxTrSkipSize;
BOOL lumaTrSize64;
// av1 settings
UINT32 sbSize;
BOOL enableRectPartType;
UINT32 outputFormat;
BOOL enableMultiThread;
UINT32 threadNum;
BOOL enableWpp;
BOOL enableFpp;
UINT32 numTileCols;
UINT32 numTileRows;
BOOL unitTree;
UINT32 lookAhead;
UINT32 laThreadNum;
double unitTreeStrength;
BOOL disableDeblockFilter;
XinLogEntry pfXinLogEntry;
UINT32 statLevel;
} xin26x_params;
typedef struct xin26x_dynamic_params
{
UINT32 optionId;
float frameRate;
UINT32 bitRate;
UINT32 temporalLayerNum;
UINT32 rcMode;
double psnrYuv[3];
} xin26x_dynamic_params;
#ifdef __cplusplus
}
#endif
#endif
| [
"pig.peppa@qq.com"
] | pig.peppa@qq.com |
4a873787d203cf6373f39553d953d124338a3cc2 | d23f548571b1e6640d52c94303b036df54c25f45 | /Algorithms/Bubble_sort.c | 7cc653959adc67c70217f49cbdb629622bfe75a4 | [] | no_license | Ajay-Chidambaram/Day-To-Day | 96b7b56dbf93a6261c8881b18bca661db1d6221b | 40fbfa111dda98972faecc2039ec3ab133f06764 | refs/heads/master | 2022-11-23T06:56:40.061087 | 2020-07-20T16:56:00 | 2020-07-20T16:56:00 | 273,741,786 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 684 | c | /***************************************
BUBBLE SORT ALGORITHM
***************************************/
#include<stdio.h>
void swap(int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
void bubble_sort(int a[], int n)
{
for(int i=0;i<n-1;i++)
{
for(int j=0;j<n-i-1;j++)
{
if(a[j+1] < a[j])
{
swap(&a[j+1],&a[j]);
}
}
}
}
int main()
{
int a[] = {8,1,2,10,9,5};
int n = 6;
bubble_sort(a,n);
for(int i=0;i<6;i++)
printf("%d ",a[i]);
} | [
"noreply@github.com"
] | Ajay-Chidambaram.noreply@github.com |
53c148c0a3427d7c7e4622fc409aad1f822b9d4c | 767b2117aa6598ecf183aa0791ab63a9643bc869 | /user/uart/uart.h | 01d18452b0df68973ec54993c74b8ab04572c25b | [] | no_license | Rigry/EO62_sens | 978456bde83f7c503522b90d284dcf0eb48bb8bb | c383117106af6fcc825ef4b8ac67aaac466e9582 | refs/heads/master | 2020-05-01T16:07:58.467944 | 2019-03-25T10:40:01 | 2019-03-25T10:40:01 | 177,564,945 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,790 | h | /*
* Функции приема/отправки данных по uart
* Используется timer2 для определения конца пакета по приему
* - не должен быть использован в программе
* UART_BUF_SIZE должен быть задан в macros.h, там же операции с битами
*
*/
#include <stdbool.h>
#include "macros.h"
// #include <avr/io.h>
#include <stdint.h>
#ifndef UART_H_
#define UART_H_
struct UartBufSt { //структура работы с УАРТ на уровне отделенном от работы с регистрами
uint8_t Buf[UART_BUF_SIZE]; //буффер куда приходят, откуда уходят данные
uint8_t N; //количество переданных, принятых данных
uint8_t NeedSend; //количество байт, которыйе необходимо передать из Buf,
//число отличное от нуля, переводит в режим передачи функцией UARTStartByRec()
bool EndMes; //признак конца пакета для модбаса
};
enum EvenParityENUM
{ none,
even,
odd
};
//перечисление допустимых будрейтов для 16М осцилятора
//подумать как сделать для отсальных в будущем
enum Baud16M
{ BR9600 = 9600,
BR19200 = 19200,
BR38400 = 38400,
BR76800 = 76800
};
struct UARTSettingsStruc //структура настройки UART
{ enum Baud16M baudrate; //из перечисления
uint8_t CharacterSise; //количество бит в кадре данных (пока пишу только для 8)
enum EvenParityENUM EvenParity; //проверка на четность
uint8_t StopBits;
};
void UARTInit(struct UARTSettingsStruc Settings);
//прием байта из аппаратного буфера УАРТ
void UARTRec(struct UartBufSt *UartBuf, uint8_t UDRbuf);
//передача следующего байта из буфера (если он есть) в аппаратный буфер
void UARTNextByTrans(struct UartBufSt *UartBuf);
//инициирует отправку байтов из буфера, последующие байты отправляются функцией UARTNextByTrans()
void UARTStartByRec(struct UartBufSt *UartBuf);
//должна вызываться в обработчике прерывания таймера 2 по сравнению для определения конца пакета
void UARTendMB(struct UartBufSt *UartBuf);
#endif //UART_H_ | [
"dvk@phobos.factory.alexplus.ru"
] | dvk@phobos.factory.alexplus.ru |
9bb78cdf095f676a956ce189fba686442e909ea5 | b34e2a006f55a67f36eade7994f6712e9b90f534 | /one answer/2017053008商议文_D1059.C | a75bda11603e21a2322e4c89c7ad4d4f80799a32 | [] | no_license | shang1999/items-of-error-correction | 7a0717763c1031aa583db35cf196aabf07f113d6 | 4479f82c0f8138b14fcc2ace15f0b329e4a5e0de | refs/heads/master | 2020-03-12T08:07:17.487188 | 2018-04-22T05:36:17 | 2018-04-22T05:36:17 | 130,520,607 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 323 | c | #include <stdio.h>
int main(void)
{
int *ptr, i, arrA[10];
/*********Found************/
ptr=arrA;
for (i=0; i<10; i++)
{
scanf("%d", ptr++);
}
printf("\n");
/*********Found************/
ptr=arrA;
for(i=0; i<10; i++, ptr++)
{
printf("%d ",*ptr);
}
printf("\n");
return 0;
}
| [
"noreply@github.com"
] | shang1999.noreply@github.com |
08225bc964881f0f7c3f5e1bd7a89faded14b82e | 73bcbe015f1849753775b7c421b6488d54e45902 | /tek1/Advanced/PSU_my_sokoban_2019/lib/my/my_strcmp.c | 3603a6f507728617c5d8bf50ca6c6d51d7ee3e61 | [] | no_license | bartz-dev/Epitech_Project | 33b745c6c68c24461df8b7acbc21835a1221a43e | 8d01f78093c0b965b491f0b36aa89025cab9b20a | refs/heads/main | 2023-08-28T15:32:39.324743 | 2021-10-25T16:22:37 | 2021-10-25T16:22:37 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 282 | c | /*
** EPITECH PROJECT, 2019
** PSU_my_sokoban_2019
** File description:
** my_strcmp.c
*/
#include "my.h"
int my_strcmp(char const *s1, char const *s2)
{
for (int i = 0; s1[i] == s2[i]; i++)
if (s1[i] == '\0' && s2[i] == '\0')
return (1);
return (0);
} | [
"clement.fleur@epitech.eu"
] | clement.fleur@epitech.eu |
af4c756d52db3b36664f4c1670688f4d8f8f9c67 | bd1fea86d862456a2ec9f56d57f8948456d55ee6 | /000/079/659/CWE134_Uncontrolled_Format_String__char_console_w32_vsnprintf_61b.c | aaa1b058c1d23c06b4c7157549fea8876f7f8e66 | [] | no_license | CU-0xff/juliet-cpp | d62b8485104d8a9160f29213368324c946f38274 | d8586a217bc94cbcfeeec5d39b12d02e9c6045a2 | refs/heads/master | 2021-03-07T15:44:19.446957 | 2020-03-10T12:45:40 | 2020-03-10T12:45:40 | 246,275,244 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 3,110 | c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE134_Uncontrolled_Format_String__char_console_w32_vsnprintf_61b.c
Label Definition File: CWE134_Uncontrolled_Format_String.vasinks.label.xml
Template File: sources-vasinks-61b.tmpl.c
*/
/*
* @description
* CWE: 134 Uncontrolled Format String
* BadSource: console Read input from the console
* GoodSource: Copy a fixed string into data
* Sinks: w32_vsnprintf
* GoodSink: vsnprintf with a format string
* BadSink : vsnprintf without a format string
* Flow Variant: 61 Data flow: data returned from one function to another in different source files
*
* */
#include <stdarg.h>
#include "std_testcase.h"
#ifndef _WIN32
#include <wchar.h>
#endif
#ifndef OMITBAD
char * CWE134_Uncontrolled_Format_String__char_console_w32_vsnprintf_61b_badSource(char * data)
{
{
/* Read input from the console */
size_t dataLen = strlen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
return data;
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B() uses the GoodSource with the BadSink */
char * CWE134_Uncontrolled_Format_String__char_console_w32_vsnprintf_61b_goodG2BSource(char * data)
{
/* FIX: Use a fixed string that does not contain a format specifier */
strcpy(data, "fixedstringtest");
return data;
}
/* goodB2G() uses the BadSource with the GoodSink */
char * CWE134_Uncontrolled_Format_String__char_console_w32_vsnprintf_61b_goodB2GSource(char * data)
{
{
/* Read input from the console */
size_t dataLen = strlen(data);
/* if there is room in data, read into it from the console */
if (100-dataLen > 1)
{
/* POTENTIAL FLAW: Read data from the console */
if (fgets(data+dataLen, (int)(100-dataLen), stdin) != NULL)
{
/* The next few lines remove the carriage return from the string that is
* inserted by fgets() */
dataLen = strlen(data);
if (dataLen > 0 && data[dataLen-1] == '\n')
{
data[dataLen-1] = '\0';
}
}
else
{
printLine("fgets() failed");
/* Restore NUL terminator if fgets fails */
data[dataLen] = '\0';
}
}
}
return data;
}
#endif /* OMITGOOD */
| [
"frank@fischer.com.mt"
] | frank@fischer.com.mt |
a24ee4156b1246a91774e021d1359fac5c330589 | de8c0ea84980b6d9bb6e3e23b87e6066a65f4995 | /3pp/linux/drivers/staging/gasket/gasket_core.h | c417acadb0d51ac2d9f2b235da6fb3e9f1d8966b | [
"MIT",
"Linux-syscall-note",
"GPL-2.0-only"
] | permissive | eerimoq/monolinux-example-project | 7cc19c6fc179a6d1fd3ec60f383f906b727e6715 | 57c4c2928b11cc04db59fb5ced962762099a9895 | refs/heads/master | 2021-02-08T10:57:58.215466 | 2020-07-02T08:04:25 | 2020-07-02T08:04:25 | 244,144,570 | 6 | 0 | MIT | 2020-07-02T08:15:50 | 2020-03-01T12:24:47 | C | UTF-8 | C | false | false | 19,536 | h | /* SPDX-License-Identifier: GPL-2.0 */
/*
* Gasket generic driver. Defines the set of data types and functions necessary
* to define a driver using the Gasket generic driver framework.
*
* Copyright (C) 2018 Google, Inc.
*/
#ifndef __GASKET_CORE_H__
#define __GASKET_CORE_H__
#include <linux/cdev.h>
#include <linux/compiler.h>
#include <linux/device.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include "gasket_constants.h"
/**
* struct gasket_num_name - Map numbers to names.
* @ein_num: Number.
* @ein_name: Name associated with the number, a char pointer.
*
* This structure maps numbers to names. It is used to provide printable enum
* names, e.g {0, "DEAD"} or {1, "ALIVE"}.
*/
struct gasket_num_name {
uint snn_num;
const char *snn_name;
};
/*
* Register location for packed interrupts.
* Each value indicates the location of an interrupt field (in units of
* gasket_driver_desc->interrupt_pack_width) within the containing register.
* In other words, this indicates the shift to use when creating a mask to
* extract/set bits within a register for a given interrupt.
*/
enum gasket_interrupt_packing {
PACK_0 = 0,
PACK_1 = 1,
PACK_2 = 2,
PACK_3 = 3,
UNPACKED = 4,
};
/* Type of the interrupt supported by the device. */
enum gasket_interrupt_type {
PCI_MSIX = 0,
};
/*
* Used to describe a Gasket interrupt. Contains an interrupt index, a register,
* and packing data for that interrupt. The register and packing data
* fields are relevant only for PCI_MSIX interrupt type and can be
* set to 0 for everything else.
*/
struct gasket_interrupt_desc {
/* Device-wide interrupt index/number. */
int index;
/* The register offset controlling this interrupt. */
u64 reg;
/* The location of this interrupt inside register reg, if packed. */
int packing;
};
/*
* This enum is used to identify memory regions being part of the physical
* memory that belongs to a device.
*/
enum mappable_area_type {
PCI_BAR = 0, /* Default */
BUS_REGION, /* For SYSBUS devices, i.e. AXI etc... */
COHERENT_MEMORY
};
/*
* Metadata for each BAR mapping.
* This struct is used so as to track PCI memory, I/O space, AXI and coherent
* memory area... i.e. memory objects which can be referenced in the device's
* mmap function.
*/
struct gasket_bar_data {
/* Virtual base address. */
u8 __iomem *virt_base;
/* Physical base address. */
ulong phys_base;
/* Length of the mapping. */
ulong length_bytes;
/* Type of mappable area */
enum mappable_area_type type;
};
/* Maintains device open ownership data. */
struct gasket_ownership {
/* 1 if the device is owned, 0 otherwise. */
int is_owned;
/* TGID of the owner. */
pid_t owner;
/* Count of current device opens in write mode. */
int write_open_count;
};
/* Page table modes of operation. */
enum gasket_page_table_mode {
/* The page table is partitionable as normal, all simple by default. */
GASKET_PAGE_TABLE_MODE_NORMAL,
/* All entries are always simple. */
GASKET_PAGE_TABLE_MODE_SIMPLE,
/* All entries are always extended. No extended bit is used. */
GASKET_PAGE_TABLE_MODE_EXTENDED,
};
/* Page table configuration. One per table. */
struct gasket_page_table_config {
/* The identifier/index of this page table. */
int id;
/* The operation mode of this page table. */
enum gasket_page_table_mode mode;
/* Total (first-level) entries in this page table. */
ulong total_entries;
/* Base register for the page table. */
int base_reg;
/*
* Register containing the extended page table. This value is unused in
* GASKET_PAGE_TABLE_MODE_SIMPLE and GASKET_PAGE_TABLE_MODE_EXTENDED
* modes.
*/
int extended_reg;
/* The bit index indicating whether a PT entry is extended. */
int extended_bit;
};
/* Maintains information about a device node. */
struct gasket_cdev_info {
/* The internal name of this device. */
char name[GASKET_NAME_MAX];
/* Device number. */
dev_t devt;
/* Kernel-internal device structure. */
struct device *device;
/* Character device for real. */
struct cdev cdev;
/* Flag indicating if cdev_add has been called for the devices. */
int cdev_added;
/* Pointer to the overall gasket_dev struct for this device. */
struct gasket_dev *gasket_dev_ptr;
/* Ownership data for the device in question. */
struct gasket_ownership ownership;
};
/* Describes the offset and length of mmapable device BAR regions. */
struct gasket_mappable_region {
u64 start;
u64 length_bytes;
};
/* Describe the offset, size, and permissions for a device bar. */
struct gasket_bar_desc {
/*
* The size of each PCI BAR range, in bytes. If a value is 0, that BAR
* will not be mapped into kernel space at all.
* For devices with 64 bit BARs, only elements 0, 2, and 4 should be
* populated, and 1, 3, and 5 should be set to 0.
* For example, for a device mapping 1M in each of the first two 64-bit
* BARs, this field would be set as { 0x100000, 0, 0x100000, 0, 0, 0 }
* (one number per bar_desc struct.)
*/
u64 size;
/* The permissions for this bar. (Should be VM_WRITE/VM_READ/VM_EXEC,
* and can be or'd.) If set to GASKET_NOMAP, the bar will
* not be used for mmapping.
*/
ulong permissions;
/* The memory address corresponding to the base of this bar, if used. */
u64 base;
/* The number of mappable regions in this bar. */
int num_mappable_regions;
/* The mappable subregions of this bar. */
const struct gasket_mappable_region *mappable_regions;
/* Type of mappable area */
enum mappable_area_type type;
};
/* Describes the offset, size, and permissions for a coherent buffer. */
struct gasket_coherent_buffer_desc {
/* The size of the coherent buffer. */
u64 size;
/* The permissions for this bar. (Should be VM_WRITE/VM_READ/VM_EXEC,
* and can be or'd.) If set to GASKET_NOMAP, the bar will
* not be used for mmaping.
*/
ulong permissions;
/* device side address. */
u64 base;
};
/* Coherent buffer structure. */
struct gasket_coherent_buffer {
/* Virtual base address. */
u8 *virt_base;
/* Physical base address. */
ulong phys_base;
/* Length of the mapping. */
ulong length_bytes;
};
/* Description of Gasket-specific permissions in the mmap field. */
enum gasket_mapping_options { GASKET_NOMAP = 0 };
/* This struct represents an undefined bar that should never be mapped. */
#define GASKET_UNUSED_BAR \
{ \
0, GASKET_NOMAP, 0, 0, NULL, 0 \
}
/* Internal data for a Gasket device. See gasket_core.c for more information. */
struct gasket_internal_desc;
#define MAX_NUM_COHERENT_PAGES 16
/*
* Device data for Gasket device instances.
*
* This structure contains the data required to manage a Gasket device.
*/
struct gasket_dev {
/* Pointer to the internal driver description for this device. */
struct gasket_internal_desc *internal_desc;
/* Device info */
struct device *dev;
/* PCI subsystem metadata. */
struct pci_dev *pci_dev;
/* This device's index into internal_desc->devs. */
int dev_idx;
/* The name of this device, as reported by the kernel. */
char kobj_name[GASKET_NAME_MAX];
/* Virtual address of mapped BAR memory range. */
struct gasket_bar_data bar_data[PCI_STD_NUM_BARS];
/* Coherent buffer. */
struct gasket_coherent_buffer coherent_buffer;
/* Number of page tables for this device. */
int num_page_tables;
/* Address translations. Page tables have a private implementation. */
struct gasket_page_table *page_table[GASKET_MAX_NUM_PAGE_TABLES];
/* Interrupt data for this device. */
struct gasket_interrupt_data *interrupt_data;
/* Status for this device - GASKET_STATUS_ALIVE or _DEAD. */
uint status;
/* Number of times this device has been reset. */
uint reset_count;
/* Dev information for the cdev node. */
struct gasket_cdev_info dev_info;
/* Hardware revision value for this device. */
int hardware_revision;
/* Protects access to per-device data (i.e. this structure). */
struct mutex mutex;
/* cdev hash tracking/membership structure, Accel and legacy. */
/* Unused until Accel is upstreamed. */
struct hlist_node hlist_node;
struct hlist_node legacy_hlist_node;
};
/* Type of the ioctl handler callback. */
typedef long (*gasket_ioctl_handler_cb_t)(struct file *file, uint cmd,
void __user *argp);
/* Type of the ioctl permissions check callback. See below. */
typedef int (*gasket_ioctl_permissions_cb_t)(struct file *filp, uint cmd,
void __user *argp);
/*
* Device type descriptor.
*
* This structure contains device-specific data needed to identify and address a
* type of device to be administered via the Gasket generic driver.
*
* Device IDs are per-driver. In other words, two drivers using the Gasket
* framework will each have a distinct device 0 (for example).
*/
struct gasket_driver_desc {
/* The name of this device type. */
const char *name;
/* The name of this specific device model. */
const char *chip_model;
/* The version of the chip specified in chip_model. */
const char *chip_version;
/* The version of this driver: "1.0.0", "2.1.3", etc. */
const char *driver_version;
/*
* Non-zero if we should create "legacy" (device and device-class-
* specific) character devices and sysfs nodes.
*/
/* Unused until Accel is upstreamed. */
int legacy_support;
/* Major and minor numbers identifying the device. */
int major, minor;
/* Module structure for this driver. */
struct module *module;
/* PCI ID table. */
const struct pci_device_id *pci_id_table;
/* The number of page tables handled by this driver. */
int num_page_tables;
/* The index of the bar containing the page tables. */
int page_table_bar_index;
/* Registers used to control each page table. */
const struct gasket_page_table_config *page_table_configs;
/* The bit index indicating whether a PT entry is extended. */
int page_table_extended_bit;
/*
* Legacy mmap address adjusment for legacy devices only. Should be 0
* for any new device.
*/
ulong legacy_mmap_address_offset;
/* Set of 6 bar descriptions that describe all PCIe bars.
* Note that BUS/AXI devices (i.e. non PCI devices) use those.
*/
struct gasket_bar_desc bar_descriptions[PCI_STD_NUM_BARS];
/*
* Coherent buffer description.
*/
struct gasket_coherent_buffer_desc coherent_buffer_description;
/* Interrupt type. (One of gasket_interrupt_type). */
int interrupt_type;
/* Index of the bar containing the interrupt registers to program. */
int interrupt_bar_index;
/* Number of interrupts in the gasket_interrupt_desc array */
int num_interrupts;
/* Description of the interrupts for this device. */
const struct gasket_interrupt_desc *interrupts;
/*
* If this device packs multiple interrupt->MSI-X mappings into a
* single register (i.e., "uses packed interrupts"), only a single bit
* width is supported for each interrupt mapping (unpacked/"full-width"
* interrupts are always supported). This value specifies that width. If
* packed interrupts are not used, this value is ignored.
*/
int interrupt_pack_width;
/* Driver callback functions - all may be NULL */
/*
* device_open_cb: Callback for when a device node is opened in write
* mode.
* @dev: The gasket_dev struct for this driver instance.
*
* This callback should perform device-specific setup that needs to
* occur only once when a device is first opened.
*/
int (*device_open_cb)(struct gasket_dev *dev);
/*
* device_release_cb: Callback when a device is closed.
* @gasket_dev: The gasket_dev struct for this driver instance.
*
* This callback is called whenever a device node fd is closed, as
* opposed to device_close_cb, which is called when the _last_
* descriptor for an open file is closed. This call is intended to
* handle any per-user or per-fd cleanup.
*/
int (*device_release_cb)(struct gasket_dev *gasket_dev,
struct file *file);
/*
* device_close_cb: Callback for when a device node is closed for the
* last time.
* @dev: The gasket_dev struct for this driver instance.
*
* This callback should perform device-specific cleanup that only
* needs to occur when the last reference to a device node is closed.
*
* This call is intended to handle and device-wide cleanup, as opposed
* to per-fd cleanup (which should be handled by device_release_cb).
*/
int (*device_close_cb)(struct gasket_dev *dev);
/*
* get_mappable_regions_cb: Get descriptors of mappable device memory.
* @gasket_dev: Pointer to the struct gasket_dev for this device.
* @bar_index: BAR for which to retrieve memory ranges.
* @mappable_regions: Out-pointer to the list of mappable regions on the
* device/BAR for this process.
* @num_mappable_regions: Out-pointer for the size of mappable_regions.
*
* Called when handling mmap(), this callback is used to determine which
* regions of device memory may be mapped by the current process. This
* information is then compared to mmap request to determine which
* regions to actually map.
*/
int (*get_mappable_regions_cb)(struct gasket_dev *gasket_dev,
int bar_index,
struct gasket_mappable_region **mappable_regions,
int *num_mappable_regions);
/*
* ioctl_permissions_cb: Check permissions for generic ioctls.
* @filp: File structure pointer describing this node usage session.
* @cmd: ioctl number to handle.
* @arg: ioctl-specific data pointer.
*
* Returns 1 if the ioctl may be executed, 0 otherwise. If this callback
* isn't specified a default routine will be used, that only allows the
* original device opener (i.e, the "owner") to execute state-affecting
* ioctls.
*/
gasket_ioctl_permissions_cb_t ioctl_permissions_cb;
/*
* ioctl_handler_cb: Callback to handle device-specific ioctls.
* @filp: File structure pointer describing this node usage session.
* @cmd: ioctl number to handle.
* @arg: ioctl-specific data pointer.
*
* Invoked whenever an ioctl is called that the generic Gasket
* framework doesn't support. If no cb is registered, unknown ioctls
* return -EINVAL. Should return an error status (either -EINVAL or
* the error result of the ioctl being handled).
*/
gasket_ioctl_handler_cb_t ioctl_handler_cb;
/*
* device_status_cb: Callback to determine device health.
* @dev: Pointer to the gasket_dev struct for this device.
*
* Called to determine if the device is healthy or not. Should return
* a member of the gasket_status_type enum.
*
*/
int (*device_status_cb)(struct gasket_dev *dev);
/*
* hardware_revision_cb: Get the device's hardware revision.
* @dev: Pointer to the gasket_dev struct for this device.
*
* Called to determine the reported rev of the physical hardware.
* Revision should be >0. A negative return value is an error.
*/
int (*hardware_revision_cb)(struct gasket_dev *dev);
/*
* device_reset_cb: Reset the hardware in question.
* @dev: Pointer to the gasket_dev structure for this device.
*
* Called by reset ioctls. This function should not
* lock the gasket_dev mutex. It should return 0 on success
* and an error on failure.
*/
int (*device_reset_cb)(struct gasket_dev *dev);
};
/*
* Register the specified device type with the framework.
* @desc: Populated/initialized device type descriptor.
*
* This function does _not_ take ownership of desc; the underlying struct must
* exist until the matching call to gasket_unregister_device.
* This function should be called from your driver's module_init function.
*/
int gasket_register_device(const struct gasket_driver_desc *desc);
/*
* Remove the specified device type from the framework.
* @desc: Descriptor for the device type to unregister; it should have been
* passed to gasket_register_device in a previous call.
*
* This function should be called from your driver's module_exit function.
*/
void gasket_unregister_device(const struct gasket_driver_desc *desc);
/* Add a PCI gasket device. */
int gasket_pci_add_device(struct pci_dev *pci_dev,
struct gasket_dev **gasket_devp);
/* Remove a PCI gasket device. */
void gasket_pci_remove_device(struct pci_dev *pci_dev);
/* Enable a Gasket device. */
int gasket_enable_device(struct gasket_dev *gasket_dev);
/* Disable a Gasket device. */
void gasket_disable_device(struct gasket_dev *gasket_dev);
/*
* Reset the Gasket device.
* @gasket_dev: Gasket device struct.
*
* Calls device_reset_cb. Returns 0 on success and an error code othewrise.
* gasket_reset_nolock will not lock the mutex, gasket_reset will.
*
*/
int gasket_reset(struct gasket_dev *gasket_dev);
int gasket_reset_nolock(struct gasket_dev *gasket_dev);
/*
* Memory management functions. These will likely be spun off into their own
* file in the future.
*/
/* Unmaps the specified mappable region from a VMA. */
int gasket_mm_unmap_region(const struct gasket_dev *gasket_dev,
struct vm_area_struct *vma,
const struct gasket_mappable_region *map_region);
/*
* Get the ioctl permissions callback.
* @gasket_dev: Gasket device structure.
*/
gasket_ioctl_permissions_cb_t
gasket_get_ioctl_permissions_cb(struct gasket_dev *gasket_dev);
/**
* Lookup a name by number in a num_name table.
* @num: Number to lookup.
* @table: Array of num_name structures, the table for the lookup.
*
*/
const char *gasket_num_name_lookup(uint num,
const struct gasket_num_name *table);
/* Handy inlines */
static inline ulong gasket_dev_read_64(struct gasket_dev *gasket_dev, int bar,
ulong location)
{
return readq_relaxed(&gasket_dev->bar_data[bar].virt_base[location]);
}
static inline void gasket_dev_write_64(struct gasket_dev *dev, u64 value,
int bar, ulong location)
{
writeq_relaxed(value, &dev->bar_data[bar].virt_base[location]);
}
static inline void gasket_dev_write_32(struct gasket_dev *dev, u32 value,
int bar, ulong location)
{
writel_relaxed(value, &dev->bar_data[bar].virt_base[location]);
}
static inline u32 gasket_dev_read_32(struct gasket_dev *dev, int bar,
ulong location)
{
return readl_relaxed(&dev->bar_data[bar].virt_base[location]);
}
static inline void gasket_read_modify_write_64(struct gasket_dev *dev, int bar,
ulong location, u64 value,
u64 mask_width, u64 mask_shift)
{
u64 mask, tmp;
tmp = gasket_dev_read_64(dev, bar, location);
mask = ((1ULL << mask_width) - 1) << mask_shift;
tmp = (tmp & ~mask) | (value << mask_shift);
gasket_dev_write_64(dev, tmp, bar, location);
}
static inline void gasket_read_modify_write_32(struct gasket_dev *dev, int bar,
ulong location, u32 value,
u32 mask_width, u32 mask_shift)
{
u32 mask, tmp;
tmp = gasket_dev_read_32(dev, bar, location);
mask = ((1 << mask_width) - 1) << mask_shift;
tmp = (tmp & ~mask) | (value << mask_shift);
gasket_dev_write_32(dev, tmp, bar, location);
}
/* Get the Gasket driver structure for a given device. */
const struct gasket_driver_desc *gasket_get_driver_desc(struct gasket_dev *dev);
/* Get the device structure for a given device. */
struct device *gasket_get_device(struct gasket_dev *dev);
/* Helper function, Asynchronous waits on a given set of bits. */
int gasket_wait_with_reschedule(struct gasket_dev *gasket_dev, int bar,
u64 offset, u64 mask, u64 val,
uint max_retries, u64 delay_ms);
#endif /* __GASKET_CORE_H__ */
| [
"erik.moqvist@gmail.com"
] | erik.moqvist@gmail.com |
879dd3e1eb3c7ded5d894e7ed8d27d95ab9d700a | 576507416eefaf1f249616d8b2414479c5659d07 | /C-programs/Decision control statement program/Check wheather year is leap year or not.c | fc2a96a7375eff353b39b48d9e7224ca5747c0af | [] | no_license | nehasutay/C-programs | ad833072670bf77c898a3b0b6db5964f0f02aeca | ee62e33312d90174188d3f0c7e75c8787ac7b113 | refs/heads/master | 2021-05-19T06:40:55.955839 | 2020-05-20T15:26:50 | 2020-05-20T15:26:50 | 251,513,490 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 309 | c | #include<stdio.h>
#include<conio.h>
void main()
{
int year,leap;
printf("Enter year from keyboard");
scanf("%d",&year);
leap=year%4;
if(leap==0)
{
printf("Year is leap year");
}
else
{
printf("Year is not leap year");
}
getch();
}
| [
"noreply@github.com"
] | nehasutay.noreply@github.com |
d057ae0ecc87910726a9d711c88c2b7bb9b5f08f | 2cd6809299f9217bc42542a27f817fb21a1a5cc7 | /fib.c | 147c99314df77b9ac1b492c930d65a4275254ccc | [] | no_license | marqueymarc/scala-perl-ruby | 6c1d3a886b54970822c7bb279d098ec760ae2692 | f22043b695174e84cfc7212abfd45aa08560a2ed | refs/heads/master | 2021-01-24T06:12:51.964923 | 2011-05-17T23:00:39 | 2011-05-17T23:00:39 | 1,763,334 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 348 | c | # include <stdio.h>
int fib(int n) {
if (n <= 1) { return 1; }
int last = 1;
int pen = 1;
int i;
for (i = 1; i < n; i++) {
int both = last + pen;
pen = last;
last = both;
}
return last;
}
main(int argc, char**argv) {
int n = 0;
if (argc >= 2)
n = atoi(argv[1]);
printf("fib(%d) = %d\n", n, fib(n));
}
| [
"marc@marcmeyer.com"
] | marc@marcmeyer.com |
4aeaf17c1a213ec3dcc32bee8aa07bb2bb612507 | 4e0ede554d3d06be73bf52be7cc1ea73279f8f69 | /mid01/yhw/hw3/3binary.c | 95dbf39c00fc4abb27ac82f62a3a00f2b984fe8a | [] | no_license | ccl1616/programming-10801 | fa352c771d128b2eb404abfa4378e34d11fcd71b | 74c482a76aada7ca5ac098824c555bbb6ec533a1 | refs/heads/master | 2023-05-14T19:55:26.072283 | 2021-06-05T03:29:01 | 2021-06-05T03:29:01 | 234,897,958 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 691 | c | #include <stdio.h>
int main(void)
{
int n,o[11];
scanf("%d",&n);
int i = 0; //印出原來數字的binary
while(n != 0)
{
o[i] = (n % 2);//n = 11 1 1 0 1
n = n / 2; // 5 2 1 0
i ++;
}
int c,r,q,m; //印出+1(+c)後的binary
i = 0,c = 1,m = 0;
while(c == 1)
{
r = (o[i] + c) % 2;
q = (o[i] + c) / 2;
o[i] = r;
if(o[i] == 0){
m ++;
}
c = q;
i ++;
}
int j = 10; //從大位數減回來 遇到0就不輸出
while(o[j] == 0) j --;
while(j >= 0) printf("%d",o[j --]);
printf(" %d",m); //要拿來算進位的m
return 0;
} | [
"noreply@github.com"
] | ccl1616.noreply@github.com |
4fbaf63df203545ced7934e19a924ff8838c6631 | a2cae322fd366df1c77794bca646d8bd5dede1b6 | /src/gallium/drivers/freedreno/a4xx/fd4_emit.h | c5fb24d8d1342b328e61e1e7706fa89f86dc1b7d | [] | no_license | John-Gee/Mesa-3D | bc97538db56abecc664746ec59d85d0dca308732 | dbfa62df4301b66051384b3aa43e145c4630fc86 | refs/heads/master | 2021-01-18T02:14:16.120587 | 2014-11-22T14:36:37 | 2014-11-22T14:36:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,922 | h | /* -*- mode: C; c-file-style: "k&r"; tab-width 4; indent-tabs-mode: t; -*- */
/*
* Copyright (C) 2014 Rob Clark <robclark@freedesktop.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Authors:
* Rob Clark <robclark@freedesktop.org>
*/
#ifndef FD4_EMIT_H
#define FD4_EMIT_H
#include "pipe/p_context.h"
#include "freedreno_context.h"
#include "fd4_util.h"
#include "fd4_program.h"
#include "ir3_shader.h"
struct fd_ringbuffer;
enum adreno_state_block;
void fd4_emit_constant(struct fd_ringbuffer *ring,
enum adreno_state_block sb,
uint32_t regid, uint32_t offset, uint32_t sizedwords,
const uint32_t *dwords, struct pipe_resource *prsc);
void fd4_emit_gmem_restore_tex(struct fd_ringbuffer *ring,
struct pipe_surface *psurf);
/* grouped together emit-state for prog/vertex/state emit: */
struct fd4_emit {
const struct fd_vertex_state *vtx;
const struct fd_program_stateobj *prog;
const struct pipe_draw_info *info;
struct ir3_shader_key key;
uint32_t dirty;
bool rasterflat;
/* cached to avoid repeated lookups of same variants: */
struct ir3_shader_variant *vp, *fp;
/* TODO: other shader stages.. */
};
static inline struct ir3_shader_variant *
fd4_emit_get_vp(struct fd4_emit *emit)
{
if (!emit->vp) {
struct fd4_shader_stateobj *so = emit->prog->vp;
emit->vp = ir3_shader_variant(so->shader, emit->key);
}
return emit->vp;
}
static inline struct ir3_shader_variant *
fd4_emit_get_fp(struct fd4_emit *emit)
{
if (!emit->fp) {
struct fd4_shader_stateobj *so = emit->prog->fp;
emit->fp = ir3_shader_variant(so->shader, emit->key);
}
return emit->fp;
}
void fd4_emit_vertex_bufs(struct fd_ringbuffer *ring, struct fd4_emit *emit);
void fd4_emit_state(struct fd_context *ctx, struct fd_ringbuffer *ring,
struct fd4_emit *emit);
void fd4_emit_restore(struct fd_context *ctx);
#endif /* FD4_EMIT_H */
| [
"robclark@freedesktop.org"
] | robclark@freedesktop.org |
79bb84135bab3cde3c8f3daf7e1fb7b6354dbd64 | 387549ab27d89668e656771a19c09637612d57ed | /DRGLib UE project/Source/FSD/Public/RobotShieldSwitchSigDelegate.h | 83eb42f2e7080acbffeffefe83595554f0ac10d2 | [
"MIT"
] | permissive | SamsDRGMods/DRGLib | 3b7285488ef98b7b22ab4e00fec64a4c3fb6a30a | 76f17bc76dd376f0d0aa09400ac8cb4daad34ade | refs/heads/main | 2023-07-03T10:37:47.196444 | 2023-04-07T23:18:54 | 2023-04-07T23:18:54 | 383,509,787 | 16 | 5 | MIT | 2023-04-07T23:18:55 | 2021-07-06T15:08:14 | C++ | UTF-8 | C | false | false | 207 | h | #pragma once
#include "CoreMinimal.h"
#include "RobotShieldSwitchSigDelegate.generated.h"
UDELEGATE(BlueprintCallable) DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FRobotShieldSwitchSig, bool, aIsGrowing);
| [
"samamstar@gmail.com"
] | samamstar@gmail.com |
a9066493e8d058b540344f084eb387a5fb1fe013 | d5158ffa216d3751a35e1943a350bdfc22897eb4 | /err.h | 3e5db9b9a7c73571efc15fe5ed8f35e38525e213 | [] | no_license | lkrids/pixQL | c20b18d003210a3cbafe080d66d0fd6c7248d74f | 35071203ed9dd52089f79065595dd9472ffffec4 | refs/heads/master | 2021-01-22T15:00:50.624004 | 2015-06-30T16:29:41 | 2015-06-30T16:29:41 | 38,320,355 | 0 | 0 | null | 2015-06-30T16:29:15 | 2015-06-30T16:29:15 | C | UTF-8 | C | false | false | 261 | h | #ifndef _ERR_H_
#define _ERR_H_
#include <stdio.h> //sprintf
#define ERROR(...) ({ sprintf(err->info, ##__VA_ARGS__); return ERR; })
typedef enum
{
ERR = 0,
NO_ERR = 1
} ERR_EXISTS;
typedef struct
{
long zero_pad;
char info[1024];
} PixErr;
#endif
| [
"phildo211@gmail.com"
] | phildo211@gmail.com |
17ffa0d763dd4694f77ab5e6d2324f608084f8c5 | 7f3d4b8ee2b8e03f79088dbd2f14c4c9a02f5584 | /cli-srv/server.h | b87c2c62dd5703b52e12076b69493fca7f6639ac | [] | no_license | maurizioastegher/interprocess-communication-with-named-pipes | f686d2f73e68cbae4e88ede29d13d3cf9ffd70af | 3a4af8c55865c952542014e51e4f38d2764da988 | refs/heads/master | 2020-12-02T17:49:05.613749 | 2017-07-06T14:24:49 | 2017-07-06T14:24:49 | 96,432,633 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 323 | h |
#define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) //lettura e scrittura per owner, lettura per gruppo e altri
void server(InputData* datiRicevuti, int fifoFD, int* final_keyCreata, char *risultato);
int leggiInputDaFile(char* fileName, char* testoLetto);
int devrandom(char *stringaCasuale, int secret_keySize);
| [
"maurizio.astegher@gmail.com"
] | maurizio.astegher@gmail.com |
d194679e4098b665a9d6940ca825a260fcfa99ce | e2f47c07f8d90856d3cfcc8f25e8dc6e0f177e8e | /constant.h | d3f340fc8859040a6fe4b335f2a8df4fd90c7330 | [] | no_license | zhaoshun/Random-Number-Gods | 575687748592f916246e905711a1f42f8d9353e5 | 33388748e84d29e0966f0cab1cf482e08b9421c9 | refs/heads/master | 2021-01-18T12:45:16.499117 | 2011-12-07T06:58:36 | 2011-12-07T06:58:36 | 2,929,998 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 115 | h | #include <stdint.h>
struct rng *rngod_constant_add(uint32_t seed);
struct rng *rngod_constant_add_default(void);
| [
"nash@nash.id.au"
] | nash@nash.id.au |
8e55074ce161e7714a893b61f42a32f41d845443 | 024d18609af522718f6a11c4c434548f5f103205 | /menu.c | b20e95c7bafe6e22839d347b23dfa80465f707f3 | [] | no_license | saleheenshafiq9/IIT-Students-Information-System | 316195f28f49094272d0f1e988aa7dd34088970f | e22e52f8f6a8a668ce486ecd32ef1f0c0e9bc9bc | refs/heads/master | 2020-04-30T15:36:33.962708 | 2019-04-22T19:30:58 | 2019-04-22T19:30:58 | 176,924,813 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 391 | c | #include<stdio.h>
#include<stdlib.h>
void menu()
{
int n;
printf("Choose Your Option:\n1.Profiling\n2.Input Result\n3.Search\n4.Exit\n");
scanf("%d",&n);
if(n==1)
studentinfo();
else if(n==4)
return 0;
else if(n==2)
details();
else if(n==3)
resultcount();
else
{
printf("Wrong");
return 0;
}
}
| [
"noreply@github.com"
] | saleheenshafiq9.noreply@github.com |
aea0c2cae64d40d85ab83de3beedf9b9c1057ab1 | a7acd38cda08e09fb3d31a43860db7de0fec5ffe | /chapter17/sockaddr_un.c | 39fbf6a389997f4027b694d2f3838b605f0ca07f | [] | no_license | L-maple/apue | 042d3d5a5374fe5c4083887ae260a4509edb527a | 82c194c90f62fe5f496476ca066119cb7c8a7e81 | refs/heads/master | 2022-12-02T08:15:05.428210 | 2020-08-10T02:25:16 | 2020-08-10T02:25:16 | 263,200,924 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 495 | c | #include "apue.h"
#include <sys/socket.h>
#include <sys/un.h>
int
main(void)
{
int fd, size;
struct sockaddr_un un;
un.sun_family = AF_UNIX;
strcpy(un.sun_path, "foo.socket");
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
err_sys("socket failed");
size = offsetof(struct sockaddr_un, sun_path) + strlen(un.sun_path);
if (bind(fd, (struct sockaddr*)&un, size) < 0)
err_sys("bind failed");
printf("UNIX domain socket bound\n");
exit(0);
}
| [
"creekliu@tencent.com"
] | creekliu@tencent.com |
9806f5d952d957e1ab8edd22a15b54d798ba3d50 | 5df7ad08fb6333184652d682b04dca5759f70b57 | /AR Portal Project/Library/Il2cppBuildCache/Android/armeabi-v7a/il2cppOutput/System.Configuration_CodeGen.c | e0d2b43325e67ae14b2b90799b4326c7e58413b3 | [] | no_license | Wygahard/AR_Portal | dcbeee908bda3559ee24a6baca7fadf8d009ddf3 | ddc582626aa8d7050c27966927eb0d6e33032f93 | refs/heads/main | 2023-05-05T04:27:32.448628 | 2021-05-28T22:10:13 | 2021-05-28T22:10:13 | 369,345,216 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 5,501 | c | #include "pch-c.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include "codegen/il2cpp-codegen-metadata.h"
// 0x00000001 System.Void System.Configuration.ConfigurationSection::DeserializeSection(System.Xml.XmlReader)
extern void ConfigurationSection_DeserializeSection_m1C615C8DFE790CC354FBBA7E24DC47D34FF35892 (void);
// 0x00000002 System.Boolean System.Configuration.ConfigurationSection::IsModified()
extern void ConfigurationSection_IsModified_mE1B598DDAA4CB726AA146CA26FF50B08264C99CA (void);
// 0x00000003 System.Void System.Configuration.ConfigurationSection::ResetModified()
extern void ConfigurationSection_ResetModified_m2E13CE65C1ACB85FAE901015FC7DF5ED93FC8BD9 (void);
// 0x00000004 System.String System.Configuration.ConfigurationSection::SerializeSection(System.Configuration.ConfigurationElement,System.String,System.Configuration.ConfigurationSaveMode)
extern void ConfigurationSection_SerializeSection_m02D8387BAC999E6DF264C895775FD5A2E20A78F2 (void);
// 0x00000005 System.Configuration.ConfigurationPropertyCollection System.Configuration.ConfigurationElement::get_Properties()
extern void ConfigurationElement_get_Properties_m9BEF5154370B1E154727190595DF0B7E68F4AA35 (void);
// 0x00000006 System.Boolean System.Configuration.ConfigurationElement::IsModified()
extern void ConfigurationElement_IsModified_mEBE1C1B7CBDE483BBD4D10CE356D5DAD5E91A760 (void);
// 0x00000007 System.Void System.Configuration.ConfigurationElement::Reset(System.Configuration.ConfigurationElement)
extern void ConfigurationElement_Reset_mBB5E07E68F8F5B8980BAD6FD48444FE0CB6CD852 (void);
// 0x00000008 System.Void System.Configuration.ConfigurationElement::ResetModified()
extern void ConfigurationElement_ResetModified_m5C8C779356B852E71503BC907E0A870988B13792 (void);
// 0x00000009 System.Void System.Configuration.ConfigurationCollectionAttribute::.ctor(System.Type)
extern void ConfigurationCollectionAttribute__ctor_m89928B3545B1827E694566EC696326B4A3F85206 (void);
// 0x0000000A System.Void System.Configuration.IgnoreSection::.ctor()
extern void IgnoreSection__ctor_m5D6F875ED441BB5BDBDC88367453018FD4ADAA21 (void);
// 0x0000000B System.Configuration.ConfigurationPropertyCollection System.Configuration.IgnoreSection::get_Properties()
extern void IgnoreSection_get_Properties_m9DEFC7F18A9DD901D65941DF65150798D4A4D613 (void);
// 0x0000000C System.Void System.Configuration.IgnoreSection::DeserializeSection(System.Xml.XmlReader)
extern void IgnoreSection_DeserializeSection_mD8F2A20AC1A2B9E594D17A81D19414AB36F74A35 (void);
// 0x0000000D System.Boolean System.Configuration.IgnoreSection::IsModified()
extern void IgnoreSection_IsModified_mECA1267F687512A088A94149235591453E6E37FC (void);
// 0x0000000E System.Void System.Configuration.IgnoreSection::Reset(System.Configuration.ConfigurationElement)
extern void IgnoreSection_Reset_m41C043D527066CDB0A8CE5659AE44979885F00B2 (void);
// 0x0000000F System.Void System.Configuration.IgnoreSection::ResetModified()
extern void IgnoreSection_ResetModified_m194F47B7E5C45CC2341BF2729411FA9E6B814C36 (void);
// 0x00000010 System.String System.Configuration.IgnoreSection::SerializeSection(System.Configuration.ConfigurationElement,System.String,System.Configuration.ConfigurationSaveMode)
extern void IgnoreSection_SerializeSection_mE2219D4373E65ADEFA760E951D87E8E151306E9E (void);
// 0x00000011 System.Void Unity.ThrowStub::ThrowNotSupportedException()
extern void ThrowStub_ThrowNotSupportedException_m7D3AEF39540E1D8CFA631552E9D0116434E7A9ED (void);
static Il2CppMethodPointer s_methodPointers[17] =
{
ConfigurationSection_DeserializeSection_m1C615C8DFE790CC354FBBA7E24DC47D34FF35892,
ConfigurationSection_IsModified_mE1B598DDAA4CB726AA146CA26FF50B08264C99CA,
ConfigurationSection_ResetModified_m2E13CE65C1ACB85FAE901015FC7DF5ED93FC8BD9,
ConfigurationSection_SerializeSection_m02D8387BAC999E6DF264C895775FD5A2E20A78F2,
ConfigurationElement_get_Properties_m9BEF5154370B1E154727190595DF0B7E68F4AA35,
ConfigurationElement_IsModified_mEBE1C1B7CBDE483BBD4D10CE356D5DAD5E91A760,
ConfigurationElement_Reset_mBB5E07E68F8F5B8980BAD6FD48444FE0CB6CD852,
ConfigurationElement_ResetModified_m5C8C779356B852E71503BC907E0A870988B13792,
ConfigurationCollectionAttribute__ctor_m89928B3545B1827E694566EC696326B4A3F85206,
IgnoreSection__ctor_m5D6F875ED441BB5BDBDC88367453018FD4ADAA21,
IgnoreSection_get_Properties_m9DEFC7F18A9DD901D65941DF65150798D4A4D613,
IgnoreSection_DeserializeSection_mD8F2A20AC1A2B9E594D17A81D19414AB36F74A35,
IgnoreSection_IsModified_mECA1267F687512A088A94149235591453E6E37FC,
IgnoreSection_Reset_m41C043D527066CDB0A8CE5659AE44979885F00B2,
IgnoreSection_ResetModified_m194F47B7E5C45CC2341BF2729411FA9E6B814C36,
IgnoreSection_SerializeSection_mE2219D4373E65ADEFA760E951D87E8E151306E9E,
ThrowStub_ThrowNotSupportedException_m7D3AEF39540E1D8CFA631552E9D0116434E7A9ED,
};
static const int32_t s_InvokerIndices[17] =
{
1599,
1894,
1911,
494,
1873,
1894,
1599,
1911,
1599,
1911,
1873,
1599,
1894,
1599,
1911,
494,
3040,
};
extern const CustomAttributesCacheGenerator g_System_Configuration_AttributeGenerators[];
IL2CPP_EXTERN_C const Il2CppCodeGenModule g_System_Configuration_CodeGenModule;
const Il2CppCodeGenModule g_System_Configuration_CodeGenModule =
{
"System.Configuration.dll",
17,
s_methodPointers,
0,
NULL,
s_InvokerIndices,
0,
NULL,
0,
NULL,
0,
NULL,
NULL,
g_System_Configuration_AttributeGenerators,
NULL, // module initializer,
NULL,
NULL,
NULL,
};
| [
"Wygahard@hotmail.fr"
] | Wygahard@hotmail.fr |
b7b11ba60d98a613e910ec31b1b12efb1123970a | a60c4be10d7e484258f684d55d4faea4a94593ad | /lib/scc/xmalloc.c | 5ff239ae2c5897d628d488d1ff2423704891e23f | [
"ISC"
] | permissive | nakijun/scc | b8cc6e7a4873d988c9e973c83ac572d3fc54125d | e53520a8ec6d7838423fea56e1b028ced9558f59 | refs/heads/master | 2020-11-27T20:51:33.592527 | 2018-02-16T08:50:46 | 2018-02-16T08:50:46 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 201 | c | static char sccsid[] = "@(#) ./lib/scc/xmalloc.c";
#include <stdlib.h>
#include "../../inc/scc.h"
void *
xmalloc(size_t size)
{
void *p = malloc(size);
if (!p)
die("out of memory");
return p;
}
| [
"k0ga@shike2.com"
] | k0ga@shike2.com |
394dd7112245c0e2d276d148591446c3c539677f | 70f72f2dc3779287e693135efc98479be69553c7 | /nRF5_SDK_for_Thread_and_Zigbee_v4.1.0/examples/multiprotocol/ble_zigbee/ble_zigbee_dynamic_light_switch_nus/pca10100/s140/config/sdk_config.h | 78790ab92e3ffde3c245fbfdf86ffd637826903c | [] | no_license | MKreher/ble_scanner | 933845031a786858bfccbd404f8b9b3f8b9ae270 | 899b2004e9e9ec6c4b4a6fa0b09a089a409abb14 | refs/heads/master | 2021-07-04T01:56:24.174083 | 2021-05-16T16:17:01 | 2021-05-16T16:17:01 | 238,542,086 | 0 | 1 | null | 2020-03-07T21:03:44 | 2020-02-05T20:29:18 | C | UTF-8 | C | false | false | 287,365 | h | /**
* Copyright (c) 2017 - 2020, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form, except as embedded into a Nordic
* Semiconductor ASA integrated circuit in a product or a software update for
* such product, must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other
* materials provided with the distribution.
*
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* 4. This software, with or without modification, must only be used with a
* Nordic Semiconductor ASA integrated circuit.
*
* 5. Any software provided in binary form under this license must not be reverse
* engineered, decompiled, modified and/or disassembled.
*
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef SDK_CONFIG_H
#define SDK_CONFIG_H
// <<< Use Configuration Wizard in Context Menu >>>\n
#ifdef USE_APP_CONFIG
#include "app_config.h"
#endif
// <h> None
//==========================================================
// <o> MULTIPROTOCOL_802154_MODE - multiprotocol_802154_config - Common multiprotocol configuration for IEEE 802.15.4
// <i> MULTIPROTOCOL_802154_MODE_FAST_SWITCHING_TIMES: This mode allows for the fastest swithing times between 802.15.4 and BLE.
// <i> MULTIPROTOCOL_802154_MODE_LOW_CPU_UTILIZATION: This mode allows for the lower CPU utilization during BLE timeslot.
// <0=> MULTIPROTOCOL_802154_MODE_FAST_SWITCHING_TIMES
// <1=> MULTIPROTOCOL_802154_MODE_LOW_CPU_UTILIZATION
#ifndef MULTIPROTOCOL_802154_MODE
#define MULTIPROTOCOL_802154_MODE 0
#endif
// </h>
//==========================================================
// <h> Example
//==========================================================
// <s> NUS_DEVICE_NAME - multiprotocol_utils - Common multiprotocol functions used by examples
// <i> Name of the device advertised by the Nordic UART Service
#ifndef NUS_DEVICE_NAME
#define NUS_DEVICE_NAME "Zigbee_Switch"
#endif
// </h>
//==========================================================
// <h> Zigbee
//==========================================================
// <h> zb_error - ZBOSS error handling helpers
//==========================================================
// <q> ZB_ERROR_TO_STRING_ENABLED - Include functions for mapping ZBOSS errors to string
#ifndef ZB_ERROR_TO_STRING_ENABLED
#define ZB_ERROR_TO_STRING_ENABLED 1
#endif
// <q> ZB_ERROR_PRINT_TO_LOG - Print ZBOSS errors to NRF LOG
#ifndef ZB_ERROR_PRINT_TO_LOG
#define ZB_ERROR_PRINT_TO_LOG 1
#endif
// </h>
//==========================================================
// <h> zigbee_stack - ZBOSS Zigbee stack
//==========================================================
// <o> ZIGBEE_CHANNEL - 802.15.4 channel used by Zigbee <11-26>
// <i> 802.15.4 channel used by Zigbee. Defaults to 16.
#ifndef ZIGBEE_CHANNEL
#define ZIGBEE_CHANNEL 16
#endif
// <o> ZIGBEE_TRACE_LEVEL - Trace level of Zigbee stack logs. <0-4>
// <i> Trace level of Zigbee stack binary logs. Possible values: 0 - disable, 1 - error, 2 - warning, 3 - info, 4 - debug. Disabled by default.
#ifndef ZIGBEE_TRACE_LEVEL
#define ZIGBEE_TRACE_LEVEL 0
#endif
// <o> ZIGBEE_TRACE_MASK - Trace mask of Zigbee stack logs. <0-2376>
// <i> Selectively enable Zigbee binary trace logs. Possible values (logical or): TRACE_SUBSYSTEM_ZCL, TRACE_SUBSYSTEM_ZDO, TRACE_SUBSYSTEM_NWK. Defaults to 0x0000.
#ifndef ZIGBEE_TRACE_MASK
#define ZIGBEE_TRACE_MASK 0
#endif
// <o> ZIGBEE_TIMER_INSTANCE_NO - nRF timer instance used by Zigbee stack
#ifndef ZIGBEE_TIMER_INSTANCE_NO
#define ZIGBEE_TIMER_INSTANCE_NO 3
#endif
// <o> ZIGBEE_NVRAM_PAGE_SIZE - Size of logical Zigbee NVRAM page in bytes
// <i> The size must be a multiply of physical page size
#ifndef ZIGBEE_NVRAM_PAGE_SIZE
#define ZIGBEE_NVRAM_PAGE_SIZE 8192
#endif
// <o> ZIGBEE_NVRAM_PAGE_COUNT - Number of Zigbee NVRAM data pages
#ifndef ZIGBEE_NVRAM_PAGE_COUNT
#define ZIGBEE_NVRAM_PAGE_COUNT 2
#endif
// <o> ZIGBEE_NVRAM_CONFIG_PAGE_SIZE - Size of logical Zigbee NVRAM production configuration page in bytes
// <i> The size must be a multiply of physical page size
#ifndef ZIGBEE_NVRAM_CONFIG_PAGE_SIZE
#define ZIGBEE_NVRAM_CONFIG_PAGE_SIZE 4096
#endif
// <o> ZIGBEE_NVRAM_CONFIG_PAGE_COUNT - Number of Zigbee NVRAM production configuration pages
#ifndef ZIGBEE_NVRAM_CONFIG_PAGE_COUNT
#define ZIGBEE_NVRAM_CONFIG_PAGE_COUNT 1
#endif
// <o> ZIGBEE_VENDOR_OUI - A decimal value that represents MAC Address Block Large (MA-L, formerly called Organizationally Unique Identifier, or OUI), a part of the device's EUI-64 address.
// <i> By default, use Nordic Semiconductor's MA-L block (f4-ce-36), assigned by the IEEE Registration Authority.
#ifndef ZIGBEE_VENDOR_OUI
#define ZIGBEE_VENDOR_OUI 16043574
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// <h> nRF_BLE
//==========================================================
// <q> BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module
#ifndef BLE_ADVERTISING_ENABLED
#define BLE_ADVERTISING_ENABLED 1
#endif
// <q> BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands
#ifndef BLE_DTM_ENABLED
#define BLE_DTM_ENABLED 0
#endif
// <q> BLE_RACP_ENABLED - ble_racp - Record Access Control Point library
#ifndef BLE_RACP_ENABLED
#define BLE_RACP_ENABLED 0
#endif
// <e> NRF_BLE_CONN_PARAMS_ENABLED - ble_conn_params - Initiating and executing a connection parameters negotiation procedure
//==========================================================
#ifndef NRF_BLE_CONN_PARAMS_ENABLED
#define NRF_BLE_CONN_PARAMS_ENABLED 1
#endif
// <o> NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION - The largest acceptable deviation in slave latency.
// <i> The largest deviation (+ or -) from the requested slave latency that will not be renegotiated.
#ifndef NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION
#define NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION 499
#endif
// <o> NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION - The largest acceptable deviation (in 10 ms units) in supervision timeout.
// <i> The largest deviation (+ or -, in 10 ms units) from the requested supervision timeout that will not be renegotiated.
#ifndef NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION
#define NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION 65535
#endif
// </e>
// <q> NRF_BLE_GATT_ENABLED - nrf_ble_gatt - GATT module
#ifndef NRF_BLE_GATT_ENABLED
#define NRF_BLE_GATT_ENABLED 1
#endif
// <e> NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write)
//==========================================================
#ifndef NRF_BLE_QWR_ENABLED
#define NRF_BLE_QWR_ENABLED 0
#endif
// <o> NRF_BLE_QWR_MAX_ATTR - Maximum number of attribute handles that can be registered. This number must be adjusted according to the number of attributes for which Queued Writes will be enabled. If it is zero, the module will reject all Queued Write requests.
#ifndef NRF_BLE_QWR_MAX_ATTR
#define NRF_BLE_QWR_MAX_ATTR 0
#endif
// </e>
// <e> PEER_MANAGER_ENABLED - peer_manager - Peer Manager
//==========================================================
#ifndef PEER_MANAGER_ENABLED
#define PEER_MANAGER_ENABLED 0
#endif
// <o> PM_MAX_REGISTRANTS - Number of event handlers that can be registered.
#ifndef PM_MAX_REGISTRANTS
#define PM_MAX_REGISTRANTS 3
#endif
// <o> PM_FLASH_BUFFERS - Number of internal buffers for flash operations.
// <i> Decrease this value to lower RAM usage.
#ifndef PM_FLASH_BUFFERS
#define PM_FLASH_BUFFERS 4
#endif
// <q> PM_CENTRAL_ENABLED - Enable/disable central-specific Peer Manager functionality.
// <i> Enable/disable central-specific Peer Manager functionality.
#ifndef PM_CENTRAL_ENABLED
#define PM_CENTRAL_ENABLED 1
#endif
// <q> PM_SERVICE_CHANGED_ENABLED - Enable/disable the service changed management for GATT server in Peer Manager.
// <i> If not using a GATT server, or using a server wihout a service changed characteristic,
// <i> disable this to save code space.
#ifndef PM_SERVICE_CHANGED_ENABLED
#define PM_SERVICE_CHANGED_ENABLED 1
#endif
// <q> PM_PEER_RANKS_ENABLED - Enable/disable the peer rank management in Peer Manager.
// <i> Set this to false to save code space if not using the peer rank API.
#ifndef PM_PEER_RANKS_ENABLED
#define PM_PEER_RANKS_ENABLED 1
#endif
// <q> PM_LESC_ENABLED - Enable/disable LESC support in Peer Manager.
// <i> If set to true, you need to call nrf_ble_lesc_request_handler() in the main loop to respond to LESC-related BLE events. If LESC support is not required, set this to false to save code space.
#ifndef PM_LESC_ENABLED
#define PM_LESC_ENABLED 0
#endif
// <e> PM_RA_PROTECTION_ENABLED - Enable/disable protection against repeated pairing attempts in Peer Manager.
//==========================================================
#ifndef PM_RA_PROTECTION_ENABLED
#define PM_RA_PROTECTION_ENABLED 0
#endif
// <o> PM_RA_PROTECTION_TRACKED_PEERS_NUM - Maximum number of peers whose authorization status can be tracked.
#ifndef PM_RA_PROTECTION_TRACKED_PEERS_NUM
#define PM_RA_PROTECTION_TRACKED_PEERS_NUM 8
#endif
// <o> PM_RA_PROTECTION_MIN_WAIT_INTERVAL - Minimum waiting interval (in ms) before a new pairing attempt can be initiated.
#ifndef PM_RA_PROTECTION_MIN_WAIT_INTERVAL
#define PM_RA_PROTECTION_MIN_WAIT_INTERVAL 4000
#endif
// <o> PM_RA_PROTECTION_MAX_WAIT_INTERVAL - Maximum waiting interval (in ms) before a new pairing attempt can be initiated.
#ifndef PM_RA_PROTECTION_MAX_WAIT_INTERVAL
#define PM_RA_PROTECTION_MAX_WAIT_INTERVAL 64000
#endif
// <o> PM_RA_PROTECTION_REWARD_PERIOD - Reward period (in ms).
// <i> The waiting interval is gradually decreased when no new failed pairing attempts are made during reward period.
#ifndef PM_RA_PROTECTION_REWARD_PERIOD
#define PM_RA_PROTECTION_REWARD_PERIOD 10000
#endif
// </e>
// <o> PM_HANDLER_SEC_DELAY_MS - Delay before starting security.
// <i> This might be necessary for interoperability reasons, especially as peripheral.
#ifndef PM_HANDLER_SEC_DELAY_MS
#define PM_HANDLER_SEC_DELAY_MS 0
#endif
// </e>
// </h>
//==========================================================
// <h> nRF_BLE_Services
//==========================================================
// <q> BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client
#ifndef BLE_ANCS_C_ENABLED
#define BLE_ANCS_C_ENABLED 0
#endif
// <q> BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client
#ifndef BLE_ANS_C_ENABLED
#define BLE_ANS_C_ENABLED 0
#endif
// <q> BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client
#ifndef BLE_BAS_C_ENABLED
#define BLE_BAS_C_ENABLED 0
#endif
// <e> BLE_BAS_ENABLED - ble_bas - Battery Service
//==========================================================
#ifndef BLE_BAS_ENABLED
#define BLE_BAS_ENABLED 0
#endif
// <e> BLE_BAS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef BLE_BAS_CONFIG_LOG_ENABLED
#define BLE_BAS_CONFIG_LOG_ENABLED 0
#endif
// <o> BLE_BAS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef BLE_BAS_CONFIG_LOG_LEVEL
#define BLE_BAS_CONFIG_LOG_LEVEL 3
#endif
// <o> BLE_BAS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_BAS_CONFIG_INFO_COLOR
#define BLE_BAS_CONFIG_INFO_COLOR 0
#endif
// <o> BLE_BAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_BAS_CONFIG_DEBUG_COLOR
#define BLE_BAS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <q> BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service
#ifndef BLE_CSCS_ENABLED
#define BLE_CSCS_ENABLED 0
#endif
// <q> BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client
#ifndef BLE_CTS_C_ENABLED
#define BLE_CTS_C_ENABLED 0
#endif
// <q> BLE_DIS_ENABLED - ble_dis - Device Information Service
#ifndef BLE_DIS_ENABLED
#define BLE_DIS_ENABLED 0
#endif
// <q> BLE_GLS_ENABLED - ble_gls - Glucose Service
#ifndef BLE_GLS_ENABLED
#define BLE_GLS_ENABLED 0
#endif
// <q> BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service
#ifndef BLE_HIDS_ENABLED
#define BLE_HIDS_ENABLED 0
#endif
// <q> BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client
#ifndef BLE_HRS_C_ENABLED
#define BLE_HRS_C_ENABLED 0
#endif
// <q> BLE_HRS_ENABLED - ble_hrs - Heart Rate Service
#ifndef BLE_HRS_ENABLED
#define BLE_HRS_ENABLED 0
#endif
// <q> BLE_HTS_ENABLED - ble_hts - Health Thermometer Service
#ifndef BLE_HTS_ENABLED
#define BLE_HTS_ENABLED 0
#endif
// <q> BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client
#ifndef BLE_IAS_C_ENABLED
#define BLE_IAS_C_ENABLED 0
#endif
// <e> BLE_IAS_ENABLED - ble_ias - Immediate Alert Service
//==========================================================
#ifndef BLE_IAS_ENABLED
#define BLE_IAS_ENABLED 0
#endif
// <e> BLE_IAS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef BLE_IAS_CONFIG_LOG_ENABLED
#define BLE_IAS_CONFIG_LOG_ENABLED 0
#endif
// <o> BLE_IAS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef BLE_IAS_CONFIG_LOG_LEVEL
#define BLE_IAS_CONFIG_LOG_LEVEL 3
#endif
// <o> BLE_IAS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_IAS_CONFIG_INFO_COLOR
#define BLE_IAS_CONFIG_INFO_COLOR 0
#endif
// <o> BLE_IAS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_IAS_CONFIG_DEBUG_COLOR
#define BLE_IAS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <q> BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client
#ifndef BLE_LBS_C_ENABLED
#define BLE_LBS_C_ENABLED 0
#endif
// <q> BLE_LBS_ENABLED - ble_lbs - LED Button Service
#ifndef BLE_LBS_ENABLED
#define BLE_LBS_ENABLED 0
#endif
// <q> BLE_LLS_ENABLED - ble_lls - Link Loss Service
#ifndef BLE_LLS_ENABLED
#define BLE_LLS_ENABLED 0
#endif
// <q> BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service
#ifndef BLE_NUS_C_ENABLED
#define BLE_NUS_C_ENABLED 0
#endif
// <e> BLE_NUS_ENABLED - ble_nus - Nordic UART Service
//==========================================================
#ifndef BLE_NUS_ENABLED
#define BLE_NUS_ENABLED 1
#endif
// <e> BLE_NUS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef BLE_NUS_CONFIG_LOG_ENABLED
#define BLE_NUS_CONFIG_LOG_ENABLED 0
#endif
// <o> BLE_NUS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef BLE_NUS_CONFIG_LOG_LEVEL
#define BLE_NUS_CONFIG_LOG_LEVEL 3
#endif
// <o> BLE_NUS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_NUS_CONFIG_INFO_COLOR
#define BLE_NUS_CONFIG_INFO_COLOR 0
#endif
// <o> BLE_NUS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef BLE_NUS_CONFIG_DEBUG_COLOR
#define BLE_NUS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <q> BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client
#ifndef BLE_RSCS_C_ENABLED
#define BLE_RSCS_C_ENABLED 0
#endif
// <q> BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service
#ifndef BLE_RSCS_ENABLED
#define BLE_RSCS_ENABLED 0
#endif
// <q> BLE_TPS_ENABLED - ble_tps - TX Power Service
#ifndef BLE_TPS_ENABLED
#define BLE_TPS_ENABLED 0
#endif
// </h>
//==========================================================
// <h> nRF_Core
//==========================================================
// <e> NRF_MPU_LIB_ENABLED - nrf_mpu_lib - Module for MPU
//==========================================================
#ifndef NRF_MPU_LIB_ENABLED
#define NRF_MPU_LIB_ENABLED 0
#endif
// <q> NRF_MPU_LIB_CLI_CMDS - Enable CLI commands specific to the module.
#ifndef NRF_MPU_LIB_CLI_CMDS
#define NRF_MPU_LIB_CLI_CMDS 0
#endif
// </e>
// <e> NRF_STACK_GUARD_ENABLED - nrf_stack_guard - Stack guard
//==========================================================
#ifndef NRF_STACK_GUARD_ENABLED
#define NRF_STACK_GUARD_ENABLED 0
#endif
// <o> NRF_STACK_GUARD_CONFIG_SIZE - Size of the stack guard.
// <5=> 32 bytes
// <6=> 64 bytes
// <7=> 128 bytes
// <8=> 256 bytes
// <9=> 512 bytes
// <10=> 1024 bytes
// <11=> 2048 bytes
// <12=> 4096 bytes
#ifndef NRF_STACK_GUARD_CONFIG_SIZE
#define NRF_STACK_GUARD_CONFIG_SIZE 7
#endif
// </e>
// </h>
//==========================================================
// <h> nRF_Crypto
//==========================================================
// <e> NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library.
//==========================================================
#ifndef NRF_CRYPTO_ENABLED
#define NRF_CRYPTO_ENABLED 1
#endif
// <o> NRF_CRYPTO_ALLOCATOR - Memory allocator
// <i> Choose memory allocator used by nrf_crypto. Default is alloca if possible or nrf_malloc otherwise. If 'User macros' are selected, the user has to create 'nrf_crypto_allocator.h' file that contains NRF_CRYPTO_ALLOC, NRF_CRYPTO_FREE, and NRF_CRYPTO_ALLOC_ON_STACK.
// <0=> Default
// <1=> User macros
// <2=> On stack (alloca)
// <3=> C dynamic memory (malloc)
// <4=> SDK Memory Manager (nrf_malloc)
#ifndef NRF_CRYPTO_ALLOCATOR
#define NRF_CRYPTO_ALLOCATOR 0
#endif
// <e> NRF_CRYPTO_BACKEND_CC310_BL_ENABLED - Enable the ARM Cryptocell CC310 reduced backend.
// <i> The CC310 hardware-accelerated cryptography backend with reduced functionality and footprint (only available on nRF52840).
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310_BL.
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP224R1_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310_BL.
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_ECC_SECP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED - CC310_BL SHA-256 hash functionality.
// <i> CC310_BL backend implementation for hardware-accelerated SHA-256.
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED - nrf_cc310_bl buffers to RAM before running hash operation
// <i> Enabling this makes hashing of addresses in FLASH range possible. Size of buffer allocated for hashing is set by NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_ENABLED 0
#endif
// <o> NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE - nrf_cc310_bl hash outputs digests in little endian
// <i> Makes the nrf_cc310_bl hash functions output digests in little endian format. Only for use in nRF SDK DFU!
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE
#define NRF_CRYPTO_BACKEND_CC310_BL_HASH_AUTOMATIC_RAM_BUFFER_SIZE 4096
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310 bl.
// <i> Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used
#ifndef NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_BL_INTERRUPTS_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_CC310_ENABLED - Enable the ARM Cryptocell CC310 backend.
// <i> The CC310 hardware-accelerated cryptography backend (only available on nRF52840).
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_CC310_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED - Enable the AES CBC mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED - Enable the AES CTR mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CTR_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED - Enable the AES ECB mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_ECB_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED - Enable the AES CBC_MAC mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CBC_MAC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED - Enable the AES CMAC mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CMAC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED - Enable the AES CCM mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED - Enable the AES CCM* mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_AES_CCM_STAR_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_CHACHA_POLY_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED - Enable the secp160r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED - Enable the secp160r2 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160R2_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED - Enable the secp192r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED - Enable the secp224r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED - Enable the secp256r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED - Enable the secp384r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP384R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED - Enable the secp521r1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP521R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED - Enable the secp160k1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP160K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED - Enable the secp192k1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP192K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED - Enable the secp224k1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP224K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED - Enable the secp256k1 elliptic curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_SECP256K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED - Enable the Curve25519 curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_CURVE25519_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED - Enable the Ed25519 curve support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_ECC_ED25519_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED - CC310 SHA-256 hash functionality.
// <i> CC310 backend implementation for hardware-accelerated SHA-256.
#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED - CC310 SHA-512 hash functionality
// <i> CC310 backend implementation for SHA-512 (in software).
#ifndef NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_HASH_SHA512_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED - CC310 HMAC using SHA-256
// <i> CC310 backend implementation for HMAC using hardware-accelerated SHA-256.
#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED - CC310 HMAC using SHA-512
// <i> CC310 backend implementation for HMAC using SHA-512 (in software).
#ifndef NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_HMAC_SHA512_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED - Enable RNG support using CC310.
#ifndef NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_RNG_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED - Enable Interrupts while support using CC310.
// <i> Select a library version compatible with the configuration. When interrupts are disable, a version named _noint must be used
#ifndef NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED
#define NRF_CRYPTO_BACKEND_CC310_INTERRUPTS_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_CIFRA_ENABLED - Enable the Cifra backend.
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_CIFRA_ENABLED
#define NRF_CRYPTO_BACKEND_CIFRA_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED - Enable the AES EAX mode using Cifra.
#ifndef NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED
#define NRF_CRYPTO_BACKEND_CIFRA_AES_EAX_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED - Enable the mbed TLS backend.
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED - Enable the AES CBC mode mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED - Enable the AES CTR mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CTR_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED - Enable the AES CFB mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CFB_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED - Enable the AES ECB mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_ECB_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED - Enable the AES CBC MAC mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CBC_MAC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED - Enable the AES CMAC mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CMAC_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED - Enable the AES CCM mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_CCM_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED - Enable the AES GCM mode using mbed TLS.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_AES_GCM_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve
// <i> Enable this setting if you need secp192r1 (NIST 192-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve
// <i> Enable this setting if you need secp224r1 (NIST 224-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve
// <i> Enable this setting if you need secp256r1 (NIST 256-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED - Enable secp384r1 (NIST 384-bit) curve
// <i> Enable this setting if you need secp384r1 (NIST 384-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP384R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED - Enable secp521r1 (NIST 521-bit) curve
// <i> Enable this setting if you need secp521r1 (NIST 521-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP521R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED - Enable secp192k1 (Koblitz 192-bit) curve
// <i> Enable this setting if you need secp192k1 (Koblitz 192-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP192K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED - Enable secp224k1 (Koblitz 224-bit) curve
// <i> Enable this setting if you need secp224k1 (Koblitz 224-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP224K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve
// <i> Enable this setting if you need secp256k1 (Koblitz 256-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_SECP256K1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED - Enable bp256r1 (Brainpool 256-bit) curve
// <i> Enable this setting if you need bp256r1 (Brainpool 256-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED - Enable bp384r1 (Brainpool 384-bit) curve
// <i> Enable this setting if you need bp384r1 (Brainpool 384-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP384R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED - Enable bp512r1 (Brainpool 512-bit) curve
// <i> Enable this setting if you need bp512r1 (Brainpool 512-bit) support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_BP512R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED - Enable Curve25519 curve
// <i> Enable this setting if you need Curve25519 support using MBEDTLS
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_ECC_CURVE25519_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED - Enable mbed TLS SHA-256 hash functionality.
// <i> mbed TLS backend implementation for SHA-256.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED - Enable mbed TLS SHA-512 hash functionality.
// <i> mbed TLS backend implementation for SHA-512.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_HASH_SHA512_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED - Enable mbed TLS HMAC using SHA-256.
// <i> mbed TLS backend implementation for HMAC using SHA-256.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED - Enable mbed TLS HMAC using SHA-512.
// <i> mbed TLS backend implementation for HMAC using SHA-512.
#ifndef NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_MBEDTLS_HMAC_SHA512_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED - Enable the micro-ecc backend.
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED
#define NRF_CRYPTO_BACKEND_MICRO_ECC_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED - Enable secp192r1 (NIST 192-bit) curve
// <i> Enable this setting if you need secp192r1 (NIST 192-bit) support using micro-ecc
#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED
#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP192R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED - Enable secp224r1 (NIST 224-bit) curve
// <i> Enable this setting if you need secp224r1 (NIST 224-bit) support using micro-ecc
#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED
#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP224R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED - Enable secp256r1 (NIST 256-bit) curve
// <i> Enable this setting if you need secp256r1 (NIST 256-bit) support using micro-ecc
#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED - Enable secp256k1 (Koblitz 256-bit) curve
// <i> Enable this setting if you need secp256k1 (Koblitz 256-bit) support using micro-ecc
#ifndef NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED
#define NRF_CRYPTO_BACKEND_MICRO_ECC_ECC_SECP256K1_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED - Enable the nRF HW RNG backend.
// <i> The nRF HW backend provide access to RNG peripheral in nRF5x devices.
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED
#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED - Enable mbed TLS CTR-DRBG algorithm.
// <i> Enable mbed TLS CTR-DRBG standardized by NIST (NIST SP 800-90A Rev. 1). The nRF HW RNG is used as an entropy source for seeding.
#ifndef NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED
#define NRF_CRYPTO_BACKEND_NRF_HW_RNG_MBEDTLS_CTR_DRBG_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_NRF_SW_ENABLED - Enable the legacy nRFx sw for crypto.
// <i> The nRF SW cryptography backend (only used in bootloader context).
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_NRF_SW_ENABLED
#define NRF_CRYPTO_BACKEND_NRF_SW_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED - nRF SW hash backend support for SHA-256
// <i> The nRF SW backend provide access to nRF SDK legacy hash implementation of SHA-256.
#ifndef NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_NRF_SW_HASH_SHA256_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_OBERON_ENABLED - Enable the Oberon backend
// <i> The Oberon backend
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_OBERON_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED - Enable the CHACHA-POLY mode using Oberon.
#ifndef NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_CHACHA_POLY_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED - Enable secp256r1 curve
// <i> Enable this setting if you need secp256r1 curve support using Oberon library
#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_ECC_SECP256R1_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED - Enable Curve25519 ECDH
// <i> Enable this setting if you need Curve25519 ECDH support using Oberon library
#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_ECC_CURVE25519_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED - Enable Ed25519 signature scheme
// <i> Enable this setting if you need Ed25519 support using Oberon library
#ifndef NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_ECC_ED25519_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED - Oberon SHA-256 hash functionality
// <i> Oberon backend implementation for SHA-256.
#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED - Oberon SHA-512 hash functionality
// <i> Oberon backend implementation for SHA-512.
#ifndef NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_HASH_SHA512_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED - Oberon HMAC using SHA-256
// <i> Oberon backend implementation for HMAC using SHA-256.
#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA256_ENABLED 1
#endif
// <q> NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED - Oberon HMAC using SHA-512
// <i> Oberon backend implementation for HMAC using SHA-512.
#ifndef NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED
#define NRF_CRYPTO_BACKEND_OBERON_HMAC_SHA512_ENABLED 1
#endif
// </e>
// <e> NRF_CRYPTO_BACKEND_OPTIGA_ENABLED - Enable the nrf_crypto Optiga Trust X backend.
// <i> Enables the nrf_crypto backend for Optiga Trust X devices.
//==========================================================
#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ENABLED
#define NRF_CRYPTO_BACKEND_OPTIGA_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED - Optiga backend support for RNG
// <i> The Optiga backend provide external chip RNG.
#ifndef NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED
#define NRF_CRYPTO_BACKEND_OPTIGA_RNG_ENABLED 0
#endif
// <q> NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED - Optiga backend support for ECC secp256r1
// <i> The Optiga backend provide external chip ECC using secp256r1.
#ifndef NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED
#define NRF_CRYPTO_BACKEND_OPTIGA_ECC_SECP256R1_ENABLED 1
#endif
// </e>
// <q> NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED - Big-endian byte order in raw Curve25519 data
// <i> Enable big-endian byte order in Curve25519 API, if set to 1. Use little-endian, if set to 0.
#ifndef NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED
#define NRF_CRYPTO_CURVE25519_BIG_ENDIAN_ENABLED 0
#endif
// </e>
// </h>
//==========================================================
// <h> nRF_DFU
//==========================================================
// <h> ble_dfu - Device Firmware Update
//==========================================================
// <q> BLE_DFU_ENABLED - Enable DFU Service.
#ifndef BLE_DFU_ENABLED
#define BLE_DFU_ENABLED 0
#endif
// <q> NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds.
#ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS
#define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// <h> nRF_Drivers
//==========================================================
// <e> COMP_ENABLED - nrf_drv_comp - COMP peripheral driver - legacy layer
//==========================================================
#ifndef COMP_ENABLED
#define COMP_ENABLED 0
#endif
// <o> COMP_CONFIG_REF - Reference voltage
// <0=> Internal 1.2V
// <1=> Internal 1.8V
// <2=> Internal 2.4V
// <4=> VDD
// <7=> ARef
#ifndef COMP_CONFIG_REF
#define COMP_CONFIG_REF 1
#endif
// <o> COMP_CONFIG_MAIN_MODE - Main mode
// <0=> Single ended
// <1=> Differential
#ifndef COMP_CONFIG_MAIN_MODE
#define COMP_CONFIG_MAIN_MODE 0
#endif
// <o> COMP_CONFIG_SPEED_MODE - Speed mode
// <0=> Low power
// <1=> Normal
// <2=> High speed
#ifndef COMP_CONFIG_SPEED_MODE
#define COMP_CONFIG_SPEED_MODE 2
#endif
// <o> COMP_CONFIG_HYST - Hystheresis
// <0=> No
// <1=> 50mV
#ifndef COMP_CONFIG_HYST
#define COMP_CONFIG_HYST 0
#endif
// <o> COMP_CONFIG_ISOURCE - Current Source
// <0=> Off
// <1=> 2.5 uA
// <2=> 5 uA
// <3=> 10 uA
#ifndef COMP_CONFIG_ISOURCE
#define COMP_CONFIG_ISOURCE 0
#endif
// <o> COMP_CONFIG_INPUT - Analog input
// <0=> 0
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef COMP_CONFIG_INPUT
#define COMP_CONFIG_INPUT 0
#endif
// <o> COMP_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef COMP_CONFIG_IRQ_PRIORITY
#define COMP_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <q> EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - legacy layer
#ifndef EGU_ENABLED
#define EGU_ENABLED 0
#endif
// <e> GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver - legacy layer
//==========================================================
#ifndef GPIOTE_ENABLED
#define GPIOTE_ENABLED 1
#endif
// <o> GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins
#ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
#define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 7
#endif
// <o> GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef GPIOTE_CONFIG_IRQ_PRIORITY
#define GPIOTE_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> I2S_ENABLED - nrf_drv_i2s - I2S peripheral driver - legacy layer
//==========================================================
#ifndef I2S_ENABLED
#define I2S_ENABLED 0
#endif
// <o> I2S_CONFIG_SCK_PIN - SCK pin <0-31>
#ifndef I2S_CONFIG_SCK_PIN
#define I2S_CONFIG_SCK_PIN 31
#endif
// <o> I2S_CONFIG_LRCK_PIN - LRCK pin <1-31>
#ifndef I2S_CONFIG_LRCK_PIN
#define I2S_CONFIG_LRCK_PIN 30
#endif
// <o> I2S_CONFIG_MCK_PIN - MCK pin
#ifndef I2S_CONFIG_MCK_PIN
#define I2S_CONFIG_MCK_PIN 255
#endif
// <o> I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31>
#ifndef I2S_CONFIG_SDOUT_PIN
#define I2S_CONFIG_SDOUT_PIN 29
#endif
// <o> I2S_CONFIG_SDIN_PIN - SDIN pin <0-31>
#ifndef I2S_CONFIG_SDIN_PIN
#define I2S_CONFIG_SDIN_PIN 28
#endif
// <o> I2S_CONFIG_MASTER - Mode
// <0=> Master
// <1=> Slave
#ifndef I2S_CONFIG_MASTER
#define I2S_CONFIG_MASTER 0
#endif
// <o> I2S_CONFIG_FORMAT - Format
// <0=> I2S
// <1=> Aligned
#ifndef I2S_CONFIG_FORMAT
#define I2S_CONFIG_FORMAT 0
#endif
// <o> I2S_CONFIG_ALIGN - Alignment
// <0=> Left
// <1=> Right
#ifndef I2S_CONFIG_ALIGN
#define I2S_CONFIG_ALIGN 0
#endif
// <o> I2S_CONFIG_SWIDTH - Sample width (bits)
// <0=> 8
// <1=> 16
// <2=> 24
#ifndef I2S_CONFIG_SWIDTH
#define I2S_CONFIG_SWIDTH 1
#endif
// <o> I2S_CONFIG_CHANNELS - Channels
// <0=> Stereo
// <1=> Left
// <2=> Right
#ifndef I2S_CONFIG_CHANNELS
#define I2S_CONFIG_CHANNELS 1
#endif
// <o> I2S_CONFIG_MCK_SETUP - MCK behavior
// <0=> Disabled
// <2147483648=> 32MHz/2
// <1342177280=> 32MHz/3
// <1073741824=> 32MHz/4
// <805306368=> 32MHz/5
// <671088640=> 32MHz/6
// <536870912=> 32MHz/8
// <402653184=> 32MHz/10
// <369098752=> 32MHz/11
// <285212672=> 32MHz/15
// <268435456=> 32MHz/16
// <201326592=> 32MHz/21
// <184549376=> 32MHz/23
// <142606336=> 32MHz/30
// <138412032=> 32MHz/31
// <134217728=> 32MHz/32
// <100663296=> 32MHz/42
// <68157440=> 32MHz/63
// <34340864=> 32MHz/125
#ifndef I2S_CONFIG_MCK_SETUP
#define I2S_CONFIG_MCK_SETUP 536870912
#endif
// <o> I2S_CONFIG_RATIO - MCK/LRCK ratio
// <0=> 32x
// <1=> 48x
// <2=> 64x
// <3=> 96x
// <4=> 128x
// <5=> 192x
// <6=> 256x
// <7=> 384x
// <8=> 512x
#ifndef I2S_CONFIG_RATIO
#define I2S_CONFIG_RATIO 2000
#endif
// <o> I2S_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef I2S_CONFIG_IRQ_PRIORITY
#define I2S_CONFIG_IRQ_PRIORITY 6
#endif
// <e> I2S_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef I2S_CONFIG_LOG_ENABLED
#define I2S_CONFIG_LOG_ENABLED 0
#endif
// <o> I2S_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef I2S_CONFIG_LOG_LEVEL
#define I2S_CONFIG_LOG_LEVEL 3
#endif
// <o> I2S_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef I2S_CONFIG_INFO_COLOR
#define I2S_CONFIG_INFO_COLOR 0
#endif
// <o> I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef I2S_CONFIG_DEBUG_COLOR
#define I2S_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> LPCOMP_ENABLED - nrf_drv_lpcomp - LPCOMP peripheral driver - legacy layer
//==========================================================
#ifndef LPCOMP_ENABLED
#define LPCOMP_ENABLED 0
#endif
// <o> LPCOMP_CONFIG_REFERENCE - Reference voltage
// <0=> Supply 1/8
// <1=> Supply 2/8
// <2=> Supply 3/8
// <3=> Supply 4/8
// <4=> Supply 5/8
// <5=> Supply 6/8
// <6=> Supply 7/8
// <8=> Supply 1/16 (nRF52)
// <9=> Supply 3/16 (nRF52)
// <10=> Supply 5/16 (nRF52)
// <11=> Supply 7/16 (nRF52)
// <12=> Supply 9/16 (nRF52)
// <13=> Supply 11/16 (nRF52)
// <14=> Supply 13/16 (nRF52)
// <15=> Supply 15/16 (nRF52)
// <7=> External Ref 0
// <65543=> External Ref 1
#ifndef LPCOMP_CONFIG_REFERENCE
#define LPCOMP_CONFIG_REFERENCE 3
#endif
// <o> LPCOMP_CONFIG_DETECTION - Detection
// <0=> Crossing
// <1=> Up
// <2=> Down
#ifndef LPCOMP_CONFIG_DETECTION
#define LPCOMP_CONFIG_DETECTION 2
#endif
// <o> LPCOMP_CONFIG_INPUT - Analog input
// <0=> 0
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef LPCOMP_CONFIG_INPUT
#define LPCOMP_CONFIG_INPUT 0
#endif
// <q> LPCOMP_CONFIG_HYST - Hysteresis
#ifndef LPCOMP_CONFIG_HYST
#define LPCOMP_CONFIG_HYST 0
#endif
// <o> LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef LPCOMP_CONFIG_IRQ_PRIORITY
#define LPCOMP_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> NRFX_CLOCK_ENABLED - nrfx_clock - CLOCK peripheral driver
//==========================================================
#ifndef NRFX_CLOCK_ENABLED
#define NRFX_CLOCK_ENABLED 1
#endif
// <o> NRFX_CLOCK_CONFIG_LF_SRC - LF Clock Source
// <0=> RC
// <1=> XTAL
// <2=> Synth
// <131073=> External Low Swing
// <196609=> External Full Swing
#ifndef NRFX_CLOCK_CONFIG_LF_SRC
#define NRFX_CLOCK_CONFIG_LF_SRC 1
#endif
// <o> NRFX_CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_CLOCK_CONFIG_IRQ_PRIORITY
#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_CLOCK_CONFIG_LOG_ENABLED
#define NRFX_CLOCK_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_CLOCK_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_CLOCK_CONFIG_LOG_LEVEL
#define NRFX_CLOCK_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_CLOCK_CONFIG_INFO_COLOR
#define NRFX_CLOCK_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_CLOCK_CONFIG_DEBUG_COLOR
#define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_COMP_ENABLED - nrfx_comp - COMP peripheral driver
//==========================================================
#ifndef NRFX_COMP_ENABLED
#define NRFX_COMP_ENABLED 0
#endif
// <o> NRFX_COMP_CONFIG_REF - Reference voltage
// <0=> Internal 1.2V
// <1=> Internal 1.8V
// <2=> Internal 2.4V
// <4=> VDD
// <7=> ARef
#ifndef NRFX_COMP_CONFIG_REF
#define NRFX_COMP_CONFIG_REF 1
#endif
// <o> NRFX_COMP_CONFIG_MAIN_MODE - Main mode
// <0=> Single ended
// <1=> Differential
#ifndef NRFX_COMP_CONFIG_MAIN_MODE
#define NRFX_COMP_CONFIG_MAIN_MODE 0
#endif
// <o> NRFX_COMP_CONFIG_SPEED_MODE - Speed mode
// <0=> Low power
// <1=> Normal
// <2=> High speed
#ifndef NRFX_COMP_CONFIG_SPEED_MODE
#define NRFX_COMP_CONFIG_SPEED_MODE 2
#endif
// <o> NRFX_COMP_CONFIG_HYST - Hystheresis
// <0=> No
// <1=> 50mV
#ifndef NRFX_COMP_CONFIG_HYST
#define NRFX_COMP_CONFIG_HYST 0
#endif
// <o> NRFX_COMP_CONFIG_ISOURCE - Current Source
// <0=> Off
// <1=> 2.5 uA
// <2=> 5 uA
// <3=> 10 uA
#ifndef NRFX_COMP_CONFIG_ISOURCE
#define NRFX_COMP_CONFIG_ISOURCE 0
#endif
// <o> NRFX_COMP_CONFIG_INPUT - Analog input
// <0=> 0
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_COMP_CONFIG_INPUT
#define NRFX_COMP_CONFIG_INPUT 0
#endif
// <o> NRFX_COMP_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_COMP_CONFIG_IRQ_PRIORITY
#define NRFX_COMP_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_COMP_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_COMP_CONFIG_LOG_ENABLED
#define NRFX_COMP_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_COMP_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_COMP_CONFIG_LOG_LEVEL
#define NRFX_COMP_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_COMP_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_COMP_CONFIG_INFO_COLOR
#define NRFX_COMP_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_COMP_CONFIG_DEBUG_COLOR
#define NRFX_COMP_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_GPIOTE_ENABLED - nrfx_gpiote - GPIOTE peripheral driver
//==========================================================
#ifndef NRFX_GPIOTE_ENABLED
#define NRFX_GPIOTE_ENABLED 1
#endif
// <o> NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins
#ifndef NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS
#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1
#endif
// <o> NRFX_GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_GPIOTE_CONFIG_IRQ_PRIORITY
#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_GPIOTE_CONFIG_LOG_ENABLED
#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_GPIOTE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_GPIOTE_CONFIG_LOG_LEVEL
#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_GPIOTE_CONFIG_INFO_COLOR
#define NRFX_GPIOTE_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_GPIOTE_CONFIG_DEBUG_COLOR
#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_I2S_ENABLED - nrfx_i2s - I2S peripheral driver
//==========================================================
#ifndef NRFX_I2S_ENABLED
#define NRFX_I2S_ENABLED 0
#endif
// <o> NRFX_I2S_CONFIG_SCK_PIN - SCK pin <0-31>
#ifndef NRFX_I2S_CONFIG_SCK_PIN
#define NRFX_I2S_CONFIG_SCK_PIN 31
#endif
// <o> NRFX_I2S_CONFIG_LRCK_PIN - LRCK pin <1-31>
#ifndef NRFX_I2S_CONFIG_LRCK_PIN
#define NRFX_I2S_CONFIG_LRCK_PIN 30
#endif
// <o> NRFX_I2S_CONFIG_MCK_PIN - MCK pin
#ifndef NRFX_I2S_CONFIG_MCK_PIN
#define NRFX_I2S_CONFIG_MCK_PIN 255
#endif
// <o> NRFX_I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31>
#ifndef NRFX_I2S_CONFIG_SDOUT_PIN
#define NRFX_I2S_CONFIG_SDOUT_PIN 29
#endif
// <o> NRFX_I2S_CONFIG_SDIN_PIN - SDIN pin <0-31>
#ifndef NRFX_I2S_CONFIG_SDIN_PIN
#define NRFX_I2S_CONFIG_SDIN_PIN 28
#endif
// <o> NRFX_I2S_CONFIG_MASTER - Mode
// <0=> Master
// <1=> Slave
#ifndef NRFX_I2S_CONFIG_MASTER
#define NRFX_I2S_CONFIG_MASTER 0
#endif
// <o> NRFX_I2S_CONFIG_FORMAT - Format
// <0=> I2S
// <1=> Aligned
#ifndef NRFX_I2S_CONFIG_FORMAT
#define NRFX_I2S_CONFIG_FORMAT 0
#endif
// <o> NRFX_I2S_CONFIG_ALIGN - Alignment
// <0=> Left
// <1=> Right
#ifndef NRFX_I2S_CONFIG_ALIGN
#define NRFX_I2S_CONFIG_ALIGN 0
#endif
// <o> NRFX_I2S_CONFIG_SWIDTH - Sample width (bits)
// <0=> 8
// <1=> 16
// <2=> 24
#ifndef NRFX_I2S_CONFIG_SWIDTH
#define NRFX_I2S_CONFIG_SWIDTH 1
#endif
// <o> NRFX_I2S_CONFIG_CHANNELS - Channels
// <0=> Stereo
// <1=> Left
// <2=> Right
#ifndef NRFX_I2S_CONFIG_CHANNELS
#define NRFX_I2S_CONFIG_CHANNELS 1
#endif
// <o> NRFX_I2S_CONFIG_MCK_SETUP - MCK behavior
// <0=> Disabled
// <2147483648=> 32MHz/2
// <1342177280=> 32MHz/3
// <1073741824=> 32MHz/4
// <805306368=> 32MHz/5
// <671088640=> 32MHz/6
// <536870912=> 32MHz/8
// <402653184=> 32MHz/10
// <369098752=> 32MHz/11
// <285212672=> 32MHz/15
// <268435456=> 32MHz/16
// <201326592=> 32MHz/21
// <184549376=> 32MHz/23
// <142606336=> 32MHz/30
// <138412032=> 32MHz/31
// <134217728=> 32MHz/32
// <100663296=> 32MHz/42
// <68157440=> 32MHz/63
// <34340864=> 32MHz/125
#ifndef NRFX_I2S_CONFIG_MCK_SETUP
#define NRFX_I2S_CONFIG_MCK_SETUP 536870912
#endif
// <o> NRFX_I2S_CONFIG_RATIO - MCK/LRCK ratio
// <0=> 32x
// <1=> 48x
// <2=> 64x
// <3=> 96x
// <4=> 128x
// <5=> 192x
// <6=> 256x
// <7=> 384x
// <8=> 512x
#ifndef NRFX_I2S_CONFIG_RATIO
#define NRFX_I2S_CONFIG_RATIO 2000
#endif
// <o> NRFX_I2S_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_I2S_CONFIG_IRQ_PRIORITY
#define NRFX_I2S_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_I2S_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_I2S_CONFIG_LOG_ENABLED
#define NRFX_I2S_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_I2S_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_I2S_CONFIG_LOG_LEVEL
#define NRFX_I2S_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_I2S_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_I2S_CONFIG_INFO_COLOR
#define NRFX_I2S_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_I2S_CONFIG_DEBUG_COLOR
#define NRFX_I2S_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_LPCOMP_ENABLED - nrfx_lpcomp - LPCOMP peripheral driver
//==========================================================
#ifndef NRFX_LPCOMP_ENABLED
#define NRFX_LPCOMP_ENABLED 0
#endif
// <o> NRFX_LPCOMP_CONFIG_REFERENCE - Reference voltage
// <0=> Supply 1/8
// <1=> Supply 2/8
// <2=> Supply 3/8
// <3=> Supply 4/8
// <4=> Supply 5/8
// <5=> Supply 6/8
// <6=> Supply 7/8
// <8=> Supply 1/16 (nRF52)
// <9=> Supply 3/16 (nRF52)
// <10=> Supply 5/16 (nRF52)
// <11=> Supply 7/16 (nRF52)
// <12=> Supply 9/16 (nRF52)
// <13=> Supply 11/16 (nRF52)
// <14=> Supply 13/16 (nRF52)
// <15=> Supply 15/16 (nRF52)
// <7=> External Ref 0
// <65543=> External Ref 1
#ifndef NRFX_LPCOMP_CONFIG_REFERENCE
#define NRFX_LPCOMP_CONFIG_REFERENCE 3
#endif
// <o> NRFX_LPCOMP_CONFIG_DETECTION - Detection
// <0=> Crossing
// <1=> Up
// <2=> Down
#ifndef NRFX_LPCOMP_CONFIG_DETECTION
#define NRFX_LPCOMP_CONFIG_DETECTION 2
#endif
// <o> NRFX_LPCOMP_CONFIG_INPUT - Analog input
// <0=> 0
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_LPCOMP_CONFIG_INPUT
#define NRFX_LPCOMP_CONFIG_INPUT 0
#endif
// <q> NRFX_LPCOMP_CONFIG_HYST - Hysteresis
#ifndef NRFX_LPCOMP_CONFIG_HYST
#define NRFX_LPCOMP_CONFIG_HYST 0
#endif
// <o> NRFX_LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_LPCOMP_CONFIG_IRQ_PRIORITY
#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_LPCOMP_CONFIG_LOG_ENABLED
#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_LPCOMP_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_LPCOMP_CONFIG_LOG_LEVEL
#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_LPCOMP_CONFIG_INFO_COLOR
#define NRFX_LPCOMP_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_LPCOMP_CONFIG_DEBUG_COLOR
#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_NFCT_ENABLED - nrfx_nfct - NFCT peripheral driver
//==========================================================
#ifndef NRFX_NFCT_ENABLED
#define NRFX_NFCT_ENABLED 0
#endif
// <o> NRFX_NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_NFCT_CONFIG_IRQ_PRIORITY
#define NRFX_NFCT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_NFCT_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_NFCT_CONFIG_LOG_ENABLED
#define NRFX_NFCT_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_NFCT_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_NFCT_CONFIG_LOG_LEVEL
#define NRFX_NFCT_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_NFCT_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_NFCT_CONFIG_INFO_COLOR
#define NRFX_NFCT_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_NFCT_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_NFCT_CONFIG_DEBUG_COLOR
#define NRFX_NFCT_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_PDM_ENABLED - nrfx_pdm - PDM peripheral driver
//==========================================================
#ifndef NRFX_PDM_ENABLED
#define NRFX_PDM_ENABLED 0
#endif
// <o> NRFX_PDM_CONFIG_MODE - Mode
// <0=> Stereo
// <1=> Mono
#ifndef NRFX_PDM_CONFIG_MODE
#define NRFX_PDM_CONFIG_MODE 1
#endif
// <o> NRFX_PDM_CONFIG_EDGE - Edge
// <0=> Left falling
// <1=> Left rising
#ifndef NRFX_PDM_CONFIG_EDGE
#define NRFX_PDM_CONFIG_EDGE 0
#endif
// <o> NRFX_PDM_CONFIG_CLOCK_FREQ - Clock frequency
// <134217728=> 1000k
// <138412032=> 1032k (default)
// <142606336=> 1067k
#ifndef NRFX_PDM_CONFIG_CLOCK_FREQ
#define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032
#endif
// <o> NRFX_PDM_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_PDM_CONFIG_IRQ_PRIORITY
#define NRFX_PDM_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_PDM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_PDM_CONFIG_LOG_ENABLED
#define NRFX_PDM_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_PDM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_PDM_CONFIG_LOG_LEVEL
#define NRFX_PDM_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_PDM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PDM_CONFIG_INFO_COLOR
#define NRFX_PDM_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PDM_CONFIG_DEBUG_COLOR
#define NRFX_PDM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_POWER_ENABLED - nrfx_power - POWER peripheral driver
//==========================================================
#ifndef NRFX_POWER_ENABLED
#define NRFX_POWER_ENABLED 0
#endif
// <o> NRFX_POWER_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_POWER_CONFIG_IRQ_PRIORITY
#define NRFX_POWER_CONFIG_IRQ_PRIORITY 6
#endif
// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCEN
#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0
#endif
// <q> NRFX_POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef NRFX_POWER_CONFIG_DEFAULT_DCDCENHV
#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif
// </e>
// <e> NRFX_PPI_ENABLED - nrfx_ppi - PPI peripheral allocator
//==========================================================
#ifndef NRFX_PPI_ENABLED
#define NRFX_PPI_ENABLED 0
#endif
// <e> NRFX_PPI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_PPI_CONFIG_LOG_ENABLED
#define NRFX_PPI_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_PPI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_PPI_CONFIG_LOG_LEVEL
#define NRFX_PPI_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_PPI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PPI_CONFIG_INFO_COLOR
#define NRFX_PPI_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PPI_CONFIG_DEBUG_COLOR
#define NRFX_PPI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_PRS_ENABLED - nrfx_prs - Peripheral Resource Sharing module
//==========================================================
#ifndef NRFX_PRS_ENABLED
#define NRFX_PRS_ENABLED 1
#endif
// <q> NRFX_PRS_BOX_0_ENABLED - Enables box 0 in the module.
#ifndef NRFX_PRS_BOX_0_ENABLED
#define NRFX_PRS_BOX_0_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_1_ENABLED - Enables box 1 in the module.
#ifndef NRFX_PRS_BOX_1_ENABLED
#define NRFX_PRS_BOX_1_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_2_ENABLED - Enables box 2 in the module.
#ifndef NRFX_PRS_BOX_2_ENABLED
#define NRFX_PRS_BOX_2_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_3_ENABLED - Enables box 3 in the module.
#ifndef NRFX_PRS_BOX_3_ENABLED
#define NRFX_PRS_BOX_3_ENABLED 0
#endif
// <q> NRFX_PRS_BOX_4_ENABLED - Enables box 4 in the module.
#ifndef NRFX_PRS_BOX_4_ENABLED
#define NRFX_PRS_BOX_4_ENABLED 1
#endif
// <e> NRFX_PRS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_PRS_CONFIG_LOG_ENABLED
#define NRFX_PRS_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_PRS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_PRS_CONFIG_LOG_LEVEL
#define NRFX_PRS_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_PRS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PRS_CONFIG_INFO_COLOR
#define NRFX_PRS_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_PRS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PRS_CONFIG_DEBUG_COLOR
#define NRFX_PRS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver
//==========================================================
#ifndef NRFX_PWM_ENABLED
#define NRFX_PWM_ENABLED 0
#endif
// <q> NRFX_PWM0_ENABLED - Enable PWM0 instance
#ifndef NRFX_PWM0_ENABLED
#define NRFX_PWM0_ENABLED 0
#endif
// <q> NRFX_PWM1_ENABLED - Enable PWM1 instance
#ifndef NRFX_PWM1_ENABLED
#define NRFX_PWM1_ENABLED 0
#endif
// <q> NRFX_PWM2_ENABLED - Enable PWM2 instance
#ifndef NRFX_PWM2_ENABLED
#define NRFX_PWM2_ENABLED 0
#endif
// <q> NRFX_PWM3_ENABLED - Enable PWM3 instance
#ifndef NRFX_PWM3_ENABLED
#define NRFX_PWM3_ENABLED 0
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31>
#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31>
#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31>
#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31>
#ifndef NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN
#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock
// <0=> 16 MHz
// <1=> 8 MHz
// <2=> 4 MHz
// <3=> 2 MHz
// <4=> 1 MHz
// <5=> 500 kHz
// <6=> 250 kHz
// <7=> 125 kHz
#ifndef NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK
#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode
// <0=> Up
// <1=> Up and Down
#ifndef NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE
#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE - Top value
#ifndef NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE
#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode
// <0=> Common
// <1=> Grouped
// <2=> Individual
// <3=> Waveform
#ifndef NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE
#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_STEP_MODE - Step mode
// <0=> Auto
// <1=> Triggered
#ifndef NRFX_PWM_DEFAULT_CONFIG_STEP_MODE
#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0
#endif
// <o> NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_PWM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_PWM_CONFIG_LOG_ENABLED
#define NRFX_PWM_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_PWM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_PWM_CONFIG_LOG_LEVEL
#define NRFX_PWM_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_PWM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PWM_CONFIG_INFO_COLOR
#define NRFX_PWM_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_PWM_CONFIG_DEBUG_COLOR
#define NRFX_PWM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_QDEC_ENABLED - nrfx_qdec - QDEC peripheral driver
//==========================================================
#ifndef NRFX_QDEC_ENABLED
#define NRFX_QDEC_ENABLED 0
#endif
// <o> NRFX_QDEC_CONFIG_REPORTPER - Report period
// <0=> 10 Samples
// <1=> 40 Samples
// <2=> 80 Samples
// <3=> 120 Samples
// <4=> 160 Samples
// <5=> 200 Samples
// <6=> 240 Samples
// <7=> 280 Samples
#ifndef NRFX_QDEC_CONFIG_REPORTPER
#define NRFX_QDEC_CONFIG_REPORTPER 0
#endif
// <o> NRFX_QDEC_CONFIG_SAMPLEPER - Sample period
// <0=> 128 us
// <1=> 256 us
// <2=> 512 us
// <3=> 1024 us
// <4=> 2048 us
// <5=> 4096 us
// <6=> 8192 us
// <7=> 16384 us
#ifndef NRFX_QDEC_CONFIG_SAMPLEPER
#define NRFX_QDEC_CONFIG_SAMPLEPER 7
#endif
// <o> NRFX_QDEC_CONFIG_PIO_A - A pin <0-31>
#ifndef NRFX_QDEC_CONFIG_PIO_A
#define NRFX_QDEC_CONFIG_PIO_A 31
#endif
// <o> NRFX_QDEC_CONFIG_PIO_B - B pin <0-31>
#ifndef NRFX_QDEC_CONFIG_PIO_B
#define NRFX_QDEC_CONFIG_PIO_B 31
#endif
// <o> NRFX_QDEC_CONFIG_PIO_LED - LED pin <0-31>
#ifndef NRFX_QDEC_CONFIG_PIO_LED
#define NRFX_QDEC_CONFIG_PIO_LED 31
#endif
// <o> NRFX_QDEC_CONFIG_LEDPRE - LED pre
#ifndef NRFX_QDEC_CONFIG_LEDPRE
#define NRFX_QDEC_CONFIG_LEDPRE 511
#endif
// <o> NRFX_QDEC_CONFIG_LEDPOL - LED polarity
// <0=> Active low
// <1=> Active high
#ifndef NRFX_QDEC_CONFIG_LEDPOL
#define NRFX_QDEC_CONFIG_LEDPOL 1
#endif
// <q> NRFX_QDEC_CONFIG_DBFEN - Debouncing enable
#ifndef NRFX_QDEC_CONFIG_DBFEN
#define NRFX_QDEC_CONFIG_DBFEN 0
#endif
// <q> NRFX_QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable
#ifndef NRFX_QDEC_CONFIG_SAMPLE_INTEN
#define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0
#endif
// <o> NRFX_QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_QDEC_CONFIG_IRQ_PRIORITY
#define NRFX_QDEC_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_QDEC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_QDEC_CONFIG_LOG_ENABLED
#define NRFX_QDEC_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_QDEC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_QDEC_CONFIG_LOG_LEVEL
#define NRFX_QDEC_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_QDEC_CONFIG_INFO_COLOR
#define NRFX_QDEC_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_QDEC_CONFIG_DEBUG_COLOR
#define NRFX_QDEC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_RNG_ENABLED - nrfx_rng - RNG peripheral driver
//==========================================================
#ifndef NRFX_RNG_ENABLED
#define NRFX_RNG_ENABLED 1
#endif
// <q> NRFX_RNG_CONFIG_ERROR_CORRECTION - Error correction
#ifndef NRFX_RNG_CONFIG_ERROR_CORRECTION
#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1
#endif
// <o> NRFX_RNG_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_RNG_CONFIG_IRQ_PRIORITY
#define NRFX_RNG_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_RNG_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_RNG_CONFIG_LOG_ENABLED
#define NRFX_RNG_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_RNG_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_RNG_CONFIG_LOG_LEVEL
#define NRFX_RNG_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_RNG_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_RNG_CONFIG_INFO_COLOR
#define NRFX_RNG_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_RNG_CONFIG_DEBUG_COLOR
#define NRFX_RNG_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_RTC_ENABLED - nrfx_rtc - RTC peripheral driver
//==========================================================
#ifndef NRFX_RTC_ENABLED
#define NRFX_RTC_ENABLED 0
#endif
// <q> NRFX_RTC0_ENABLED - Enable RTC0 instance
#ifndef NRFX_RTC0_ENABLED
#define NRFX_RTC0_ENABLED 0
#endif
// <q> NRFX_RTC1_ENABLED - Enable RTC1 instance
#ifndef NRFX_RTC1_ENABLED
#define NRFX_RTC1_ENABLED 0
#endif
// <q> NRFX_RTC2_ENABLED - Enable RTC2 instance
#ifndef NRFX_RTC2_ENABLED
#define NRFX_RTC2_ENABLED 0
#endif
// <o> NRFX_RTC_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt
#ifndef NRFX_RTC_MAXIMUM_LATENCY_US
#define NRFX_RTC_MAXIMUM_LATENCY_US 2000
#endif
// <o> NRFX_RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768>
#ifndef NRFX_RTC_DEFAULT_CONFIG_FREQUENCY
#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768
#endif
// <q> NRFX_RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering
#ifndef NRFX_RTC_DEFAULT_CONFIG_RELIABLE
#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0
#endif
// <o> NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_RTC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_RTC_CONFIG_LOG_ENABLED
#define NRFX_RTC_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_RTC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_RTC_CONFIG_LOG_LEVEL
#define NRFX_RTC_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_RTC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_RTC_CONFIG_INFO_COLOR
#define NRFX_RTC_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_RTC_CONFIG_DEBUG_COLOR
#define NRFX_RTC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_SAADC_ENABLED - nrfx_saadc - SAADC peripheral driver
//==========================================================
#ifndef NRFX_SAADC_ENABLED
#define NRFX_SAADC_ENABLED 1
#endif
// <o> NRFX_SAADC_CONFIG_RESOLUTION - Resolution
// <0=> 8 bit
// <1=> 10 bit
// <2=> 12 bit
// <3=> 14 bit
#ifndef NRFX_SAADC_CONFIG_RESOLUTION
#define NRFX_SAADC_CONFIG_RESOLUTION 1
#endif
// <o> NRFX_SAADC_CONFIG_OVERSAMPLE - Sample period
// <0=> Disabled
// <1=> 2x
// <2=> 4x
// <3=> 8x
// <4=> 16x
// <5=> 32x
// <6=> 64x
// <7=> 128x
// <8=> 256x
#ifndef NRFX_SAADC_CONFIG_OVERSAMPLE
#define NRFX_SAADC_CONFIG_OVERSAMPLE 0
#endif
// <q> NRFX_SAADC_CONFIG_LP_MODE - Enabling low power mode
#ifndef NRFX_SAADC_CONFIG_LP_MODE
#define NRFX_SAADC_CONFIG_LP_MODE 0
#endif
// <o> NRFX_SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_SAADC_CONFIG_IRQ_PRIORITY
#define NRFX_SAADC_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_SAADC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_SAADC_CONFIG_LOG_ENABLED
#define NRFX_SAADC_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_SAADC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_SAADC_CONFIG_LOG_LEVEL
#define NRFX_SAADC_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SAADC_CONFIG_INFO_COLOR
#define NRFX_SAADC_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SAADC_CONFIG_DEBUG_COLOR
#define NRFX_SAADC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_SPIM_ENABLED - nrfx_spim - SPIM peripheral driver
//==========================================================
#ifndef NRFX_SPIM_ENABLED
#define NRFX_SPIM_ENABLED 0
#endif
// <q> NRFX_SPIM0_ENABLED - Enable SPIM0 instance
#ifndef NRFX_SPIM0_ENABLED
#define NRFX_SPIM0_ENABLED 0
#endif
// <q> NRFX_SPIM1_ENABLED - Enable SPIM1 instance
#ifndef NRFX_SPIM1_ENABLED
#define NRFX_SPIM1_ENABLED 0
#endif
// <q> NRFX_SPIM2_ENABLED - Enable SPIM2 instance
#ifndef NRFX_SPIM2_ENABLED
#define NRFX_SPIM2_ENABLED 0
#endif
// <q> NRFX_SPIM3_ENABLED - Enable SPIM3 instance
#ifndef NRFX_SPIM3_ENABLED
#define NRFX_SPIM3_ENABLED 0
#endif
// <q> NRFX_SPIM_EXTENDED_ENABLED - Enable extended SPIM features
#ifndef NRFX_SPIM_EXTENDED_ENABLED
#define NRFX_SPIM_EXTENDED_ENABLED 0
#endif
// <o> NRFX_SPIM_MISO_PULL_CFG - MISO pin pull configuration.
// <0=> NRF_GPIO_PIN_NOPULL
// <1=> NRF_GPIO_PIN_PULLDOWN
// <3=> NRF_GPIO_PIN_PULLUP
#ifndef NRFX_SPIM_MISO_PULL_CFG
#define NRFX_SPIM_MISO_PULL_CFG 1
#endif
// <o> NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_SPIM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_SPIM_CONFIG_LOG_ENABLED
#define NRFX_SPIM_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_SPIM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_SPIM_CONFIG_LOG_LEVEL
#define NRFX_SPIM_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_SPIM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPIM_CONFIG_INFO_COLOR
#define NRFX_SPIM_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_SPIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPIM_CONFIG_DEBUG_COLOR
#define NRFX_SPIM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_SPIS_ENABLED - nrfx_spis - SPIS peripheral driver
//==========================================================
#ifndef NRFX_SPIS_ENABLED
#define NRFX_SPIS_ENABLED 0
#endif
// <q> NRFX_SPIS0_ENABLED - Enable SPIS0 instance
#ifndef NRFX_SPIS0_ENABLED
#define NRFX_SPIS0_ENABLED 0
#endif
// <q> NRFX_SPIS1_ENABLED - Enable SPIS1 instance
#ifndef NRFX_SPIS1_ENABLED
#define NRFX_SPIS1_ENABLED 0
#endif
// <q> NRFX_SPIS2_ENABLED - Enable SPIS2 instance
#ifndef NRFX_SPIS2_ENABLED
#define NRFX_SPIS2_ENABLED 0
#endif
// <o> NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <o> NRFX_SPIS_DEFAULT_DEF - SPIS default DEF character <0-255>
#ifndef NRFX_SPIS_DEFAULT_DEF
#define NRFX_SPIS_DEFAULT_DEF 255
#endif
// <o> NRFX_SPIS_DEFAULT_ORC - SPIS default ORC character <0-255>
#ifndef NRFX_SPIS_DEFAULT_ORC
#define NRFX_SPIS_DEFAULT_ORC 255
#endif
// <e> NRFX_SPIS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_SPIS_CONFIG_LOG_ENABLED
#define NRFX_SPIS_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_SPIS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_SPIS_CONFIG_LOG_LEVEL
#define NRFX_SPIS_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPIS_CONFIG_INFO_COLOR
#define NRFX_SPIS_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPIS_CONFIG_DEBUG_COLOR
#define NRFX_SPIS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_SPI_ENABLED - nrfx_spi - SPI peripheral driver
//==========================================================
#ifndef NRFX_SPI_ENABLED
#define NRFX_SPI_ENABLED 0
#endif
// <q> NRFX_SPI0_ENABLED - Enable SPI0 instance
#ifndef NRFX_SPI0_ENABLED
#define NRFX_SPI0_ENABLED 0
#endif
// <q> NRFX_SPI1_ENABLED - Enable SPI1 instance
#ifndef NRFX_SPI1_ENABLED
#define NRFX_SPI1_ENABLED 0
#endif
// <q> NRFX_SPI2_ENABLED - Enable SPI2 instance
#ifndef NRFX_SPI2_ENABLED
#define NRFX_SPI2_ENABLED 0
#endif
// <o> NRFX_SPI_MISO_PULL_CFG - MISO pin pull configuration.
// <0=> NRF_GPIO_PIN_NOPULL
// <1=> NRF_GPIO_PIN_PULLDOWN
// <3=> NRF_GPIO_PIN_PULLUP
#ifndef NRFX_SPI_MISO_PULL_CFG
#define NRFX_SPI_MISO_PULL_CFG 1
#endif
// <o> NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_SPI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_SPI_CONFIG_LOG_ENABLED
#define NRFX_SPI_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_SPI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_SPI_CONFIG_LOG_LEVEL
#define NRFX_SPI_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_SPI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPI_CONFIG_INFO_COLOR
#define NRFX_SPI_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SPI_CONFIG_DEBUG_COLOR
#define NRFX_SPI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_SWI_ENABLED - nrfx_swi - SWI/EGU peripheral allocator
//==========================================================
#ifndef NRFX_SWI_ENABLED
#define NRFX_SWI_ENABLED 0
#endif
// <q> NRFX_EGU_ENABLED - Enable EGU support
#ifndef NRFX_EGU_ENABLED
#define NRFX_EGU_ENABLED 0
#endif
// <q> NRFX_SWI0_DISABLED - Exclude SWI0 from being utilized by the driver
#ifndef NRFX_SWI0_DISABLED
#define NRFX_SWI0_DISABLED 0
#endif
// <q> NRFX_SWI1_DISABLED - Exclude SWI1 from being utilized by the driver
#ifndef NRFX_SWI1_DISABLED
#define NRFX_SWI1_DISABLED 0
#endif
// <q> NRFX_SWI2_DISABLED - Exclude SWI2 from being utilized by the driver
#ifndef NRFX_SWI2_DISABLED
#define NRFX_SWI2_DISABLED 0
#endif
// <q> NRFX_SWI3_DISABLED - Exclude SWI3 from being utilized by the driver
#ifndef NRFX_SWI3_DISABLED
#define NRFX_SWI3_DISABLED 0
#endif
// <q> NRFX_SWI4_DISABLED - Exclude SWI4 from being utilized by the driver
#ifndef NRFX_SWI4_DISABLED
#define NRFX_SWI4_DISABLED 0
#endif
// <q> NRFX_SWI5_DISABLED - Exclude SWI5 from being utilized by the driver
#ifndef NRFX_SWI5_DISABLED
#define NRFX_SWI5_DISABLED 0
#endif
// <e> NRFX_SWI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_SWI_CONFIG_LOG_ENABLED
#define NRFX_SWI_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_SWI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_SWI_CONFIG_LOG_LEVEL
#define NRFX_SWI_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_SWI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SWI_CONFIG_INFO_COLOR
#define NRFX_SWI_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_SWI_CONFIG_DEBUG_COLOR
#define NRFX_SWI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <q> NRFX_SYSTICK_ENABLED - nrfx_systick - ARM(R) SysTick driver
#ifndef NRFX_SYSTICK_ENABLED
#define NRFX_SYSTICK_ENABLED 1
#endif
// <e> NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver
//==========================================================
#ifndef NRFX_TIMER_ENABLED
#define NRFX_TIMER_ENABLED 1
#endif
// <q> NRFX_TIMER0_ENABLED - Enable TIMER0 instance
#ifndef NRFX_TIMER0_ENABLED
#define NRFX_TIMER0_ENABLED 0
#endif
// <q> NRFX_TIMER1_ENABLED - Enable TIMER1 instance
#ifndef NRFX_TIMER1_ENABLED
#define NRFX_TIMER1_ENABLED 0
#endif
// <q> NRFX_TIMER2_ENABLED - Enable TIMER2 instance
#ifndef NRFX_TIMER2_ENABLED
#define NRFX_TIMER2_ENABLED 0
#endif
// <q> NRFX_TIMER3_ENABLED - Enable TIMER3 instance
#ifndef NRFX_TIMER3_ENABLED
#define NRFX_TIMER3_ENABLED 0
#endif
// <q> NRFX_TIMER4_ENABLED - Enable TIMER4 instance
#ifndef NRFX_TIMER4_ENABLED
#define NRFX_TIMER4_ENABLED 0
#endif
// <o> NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode
// <0=> 16 MHz
// <1=> 8 MHz
// <2=> 4 MHz
// <3=> 2 MHz
// <4=> 1 MHz
// <5=> 500 kHz
// <6=> 250 kHz
// <7=> 125 kHz
// <8=> 62.5 kHz
// <9=> 31.25 kHz
#ifndef NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY
#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0
#endif
// <o> NRFX_TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation
// <0=> Timer
// <1=> Counter
#ifndef NRFX_TIMER_DEFAULT_CONFIG_MODE
#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0
#endif
// <o> NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width
// <0=> 16 bit
// <1=> 8 bit
// <2=> 24 bit
// <3=> 32 bit
#ifndef NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH
#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0
#endif
// <o> NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_TIMER_CONFIG_LOG_ENABLED
#define NRFX_TIMER_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_TIMER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_TIMER_CONFIG_LOG_LEVEL
#define NRFX_TIMER_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TIMER_CONFIG_INFO_COLOR
#define NRFX_TIMER_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TIMER_CONFIG_DEBUG_COLOR
#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_TWIM_ENABLED - nrfx_twim - TWIM peripheral driver
//==========================================================
#ifndef NRFX_TWIM_ENABLED
#define NRFX_TWIM_ENABLED 0
#endif
// <q> NRFX_TWIM0_ENABLED - Enable TWIM0 instance
#ifndef NRFX_TWIM0_ENABLED
#define NRFX_TWIM0_ENABLED 0
#endif
// <q> NRFX_TWIM1_ENABLED - Enable TWIM1 instance
#ifndef NRFX_TWIM1_ENABLED
#define NRFX_TWIM1_ENABLED 0
#endif
// <o> NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY - Frequency
// <26738688=> 100k
// <67108864=> 250k
// <104857600=> 400k
#ifndef NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY
#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688
#endif
// <q> NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit
#ifndef NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT
#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
#endif
// <o> NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_TWIM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_TWIM_CONFIG_LOG_ENABLED
#define NRFX_TWIM_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_TWIM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_TWIM_CONFIG_LOG_LEVEL
#define NRFX_TWIM_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_TWIM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWIM_CONFIG_INFO_COLOR
#define NRFX_TWIM_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_TWIM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWIM_CONFIG_DEBUG_COLOR
#define NRFX_TWIM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_TWIS_ENABLED - nrfx_twis - TWIS peripheral driver
//==========================================================
#ifndef NRFX_TWIS_ENABLED
#define NRFX_TWIS_ENABLED 0
#endif
// <q> NRFX_TWIS0_ENABLED - Enable TWIS0 instance
#ifndef NRFX_TWIS0_ENABLED
#define NRFX_TWIS0_ENABLED 0
#endif
// <q> NRFX_TWIS1_ENABLED - Enable TWIS1 instance
#ifndef NRFX_TWIS1_ENABLED
#define NRFX_TWIS1_ENABLED 0
#endif
// <q> NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once
// <i> Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code.
#ifndef NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY
#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0
#endif
// <q> NRFX_TWIS_NO_SYNC_MODE - Remove support for synchronous mode
// <i> Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources.
#ifndef NRFX_TWIS_NO_SYNC_MODE
#define NRFX_TWIS_NO_SYNC_MODE 0
#endif
// <o> NRFX_TWIS_DEFAULT_CONFIG_ADDR0 - Address0
#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR0
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0
#endif
// <o> NRFX_TWIS_DEFAULT_CONFIG_ADDR1 - Address1
#ifndef NRFX_TWIS_DEFAULT_CONFIG_ADDR1
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0
#endif
// <o> NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration
// <0=> Disabled
// <1=> Pull down
// <3=> Pull up
#ifndef NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL
#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0
#endif
// <o> NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration
// <0=> Disabled
// <1=> Pull down
// <3=> Pull up
#ifndef NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL
#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0
#endif
// <o> NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_TWIS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_TWIS_CONFIG_LOG_ENABLED
#define NRFX_TWIS_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_TWIS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_TWIS_CONFIG_LOG_LEVEL
#define NRFX_TWIS_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWIS_CONFIG_INFO_COLOR
#define NRFX_TWIS_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWIS_CONFIG_DEBUG_COLOR
#define NRFX_TWIS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_TWI_ENABLED - nrfx_twi - TWI peripheral driver
//==========================================================
#ifndef NRFX_TWI_ENABLED
#define NRFX_TWI_ENABLED 0
#endif
// <q> NRFX_TWI0_ENABLED - Enable TWI0 instance
#ifndef NRFX_TWI0_ENABLED
#define NRFX_TWI0_ENABLED 0
#endif
// <q> NRFX_TWI1_ENABLED - Enable TWI1 instance
#ifndef NRFX_TWI1_ENABLED
#define NRFX_TWI1_ENABLED 0
#endif
// <o> NRFX_TWI_DEFAULT_CONFIG_FREQUENCY - Frequency
// <26738688=> 100k
// <67108864=> 250k
// <104857600=> 400k
#ifndef NRFX_TWI_DEFAULT_CONFIG_FREQUENCY
#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688
#endif
// <q> NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit
#ifndef NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT
#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
#endif
// <o> NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_TWI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_TWI_CONFIG_LOG_ENABLED
#define NRFX_TWI_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_TWI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_TWI_CONFIG_LOG_LEVEL
#define NRFX_TWI_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_TWI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWI_CONFIG_INFO_COLOR
#define NRFX_TWI_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_TWI_CONFIG_DEBUG_COLOR
#define NRFX_TWI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_UARTE_ENABLED - nrfx_uarte - UARTE peripheral driver
//==========================================================
#ifndef NRFX_UARTE_ENABLED
#define NRFX_UARTE_ENABLED 1
#endif
// <o> NRFX_UARTE0_ENABLED - Enable UARTE0 instance
#ifndef NRFX_UARTE0_ENABLED
#define NRFX_UARTE0_ENABLED 0
#endif
// <o> NRFX_UARTE1_ENABLED - Enable UARTE1 instance
#ifndef NRFX_UARTE1_ENABLED
#define NRFX_UARTE1_ENABLED 0
#endif
// <o> NRFX_UARTE_DEFAULT_CONFIG_HWFC - Hardware Flow Control
// <0=> Disabled
// <1=> Enabled
#ifndef NRFX_UARTE_DEFAULT_CONFIG_HWFC
#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0
#endif
// <o> NRFX_UARTE_DEFAULT_CONFIG_PARITY - Parity
// <0=> Excluded
// <14=> Included
#ifndef NRFX_UARTE_DEFAULT_CONFIG_PARITY
#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0
#endif
// <o> NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE - Default Baudrate
// <323584=> 1200 baud
// <643072=> 2400 baud
// <1290240=> 4800 baud
// <2576384=> 9600 baud
// <3862528=> 14400 baud
// <5152768=> 19200 baud
// <7716864=> 28800 baud
// <8388608=> 31250 baud
// <10289152=> 38400 baud
// <15007744=> 56000 baud
// <15400960=> 57600 baud
// <20615168=> 76800 baud
// <30801920=> 115200 baud
// <61865984=> 230400 baud
// <67108864=> 250000 baud
// <121634816=> 460800 baud
// <251658240=> 921600 baud
// <268435456=> 1000000 baud
#ifndef NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE
#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE 30801920
#endif
// <o> NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_UARTE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_UARTE_CONFIG_LOG_ENABLED
#define NRFX_UARTE_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_UARTE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_UARTE_CONFIG_LOG_LEVEL
#define NRFX_UARTE_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_UARTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_UARTE_CONFIG_INFO_COLOR
#define NRFX_UARTE_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_UARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_UARTE_CONFIG_DEBUG_COLOR
#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_UART_ENABLED - nrfx_uart - UART peripheral driver
//==========================================================
#ifndef NRFX_UART_ENABLED
#define NRFX_UART_ENABLED 1
#endif
// <o> NRFX_UART0_ENABLED - Enable UART0 instance
#ifndef NRFX_UART0_ENABLED
#define NRFX_UART0_ENABLED 0
#endif
// <o> NRFX_UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
// <0=> Disabled
// <1=> Enabled
#ifndef NRFX_UART_DEFAULT_CONFIG_HWFC
#define NRFX_UART_DEFAULT_CONFIG_HWFC 0
#endif
// <o> NRFX_UART_DEFAULT_CONFIG_PARITY - Parity
// <0=> Excluded
// <14=> Included
#ifndef NRFX_UART_DEFAULT_CONFIG_PARITY
#define NRFX_UART_DEFAULT_CONFIG_PARITY 0
#endif
// <o> NRFX_UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate
// <323584=> 1200 baud
// <643072=> 2400 baud
// <1290240=> 4800 baud
// <2576384=> 9600 baud
// <3866624=> 14400 baud
// <5152768=> 19200 baud
// <7729152=> 28800 baud
// <8388608=> 31250 baud
// <10309632=> 38400 baud
// <15007744=> 56000 baud
// <15462400=> 57600 baud
// <20615168=> 76800 baud
// <30924800=> 115200 baud
// <61845504=> 230400 baud
// <67108864=> 250000 baud
// <123695104=> 460800 baud
// <247386112=> 921600 baud
// <268435456=> 1000000 baud
#ifndef NRFX_UART_DEFAULT_CONFIG_BAUDRATE
#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE 30924800
#endif
// <o> NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY
#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_UART_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_UART_CONFIG_LOG_ENABLED
#define NRFX_UART_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_UART_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_UART_CONFIG_LOG_LEVEL
#define NRFX_UART_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_UART_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_UART_CONFIG_INFO_COLOR
#define NRFX_UART_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_UART_CONFIG_DEBUG_COLOR
#define NRFX_UART_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRFX_USBD_ENABLED - nrfx_usbd - USBD peripheral driver
//==========================================================
#ifndef NRFX_USBD_ENABLED
#define NRFX_USBD_ENABLED 0
#endif
// <o> NRFX_USBD_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_USBD_CONFIG_IRQ_PRIORITY
#define NRFX_USBD_CONFIG_IRQ_PRIORITY 6
#endif
// <o> NRFX_USBD_CONFIG_DMASCHEDULER_MODE - USBD DMA scheduler working scheme
// <0=> Prioritized access
// <1=> Round Robin
#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_MODE
#define NRFX_USBD_CONFIG_DMASCHEDULER_MODE 0
#endif
// <q> NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers
// <i> This option gives priority to isochronous transfers.
// <i> Enabling it assures that isochronous transfers are always processed,
// <i> even if multiple other transfers are pending.
// <i> Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm
// <i> function is called, so the option is independent of the algorithm chosen.
#ifndef NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST
#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1
#endif
// <q> NRFX_USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready
// <i> If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent.
// <i> Else, there will be no response.
#ifndef NRFX_USBD_CONFIG_ISO_IN_ZLP
#define NRFX_USBD_CONFIG_ISO_IN_ZLP 0
#endif
// </e>
// <e> NRFX_WDT_ENABLED - nrfx_wdt - WDT peripheral driver
//==========================================================
#ifndef NRFX_WDT_ENABLED
#define NRFX_WDT_ENABLED 0
#endif
// <o> NRFX_WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode
// <1=> Run in SLEEP, Pause in HALT
// <8=> Pause in SLEEP, Run in HALT
// <9=> Run in SLEEP and HALT
// <0=> Pause in SLEEP and HALT
#ifndef NRFX_WDT_CONFIG_BEHAVIOUR
#define NRFX_WDT_CONFIG_BEHAVIOUR 1
#endif
// <o> NRFX_WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295>
#ifndef NRFX_WDT_CONFIG_RELOAD_VALUE
#define NRFX_WDT_CONFIG_RELOAD_VALUE 2000
#endif
// <o> NRFX_WDT_CONFIG_NO_IRQ - Remove WDT IRQ handling from WDT driver
// <0=> Include WDT IRQ handling
// <1=> Remove WDT IRQ handling
#ifndef NRFX_WDT_CONFIG_NO_IRQ
#define NRFX_WDT_CONFIG_NO_IRQ 0
#endif
// <o> NRFX_WDT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef NRFX_WDT_CONFIG_IRQ_PRIORITY
#define NRFX_WDT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> NRFX_WDT_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRFX_WDT_CONFIG_LOG_ENABLED
#define NRFX_WDT_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_WDT_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_WDT_CONFIG_LOG_LEVEL
#define NRFX_WDT_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_WDT_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_WDT_CONFIG_INFO_COLOR
#define NRFX_WDT_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_WDT_CONFIG_DEBUG_COLOR
#define NRFX_WDT_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NRF_CLOCK_ENABLED - nrf_drv_clock - CLOCK peripheral driver - legacy layer
//==========================================================
#ifndef NRF_CLOCK_ENABLED
#define NRF_CLOCK_ENABLED 1
#endif
// <o> CLOCK_CONFIG_LF_SRC - LF Clock Source
// <0=> RC
// <1=> XTAL
// <2=> Synth
// <131073=> External Low Swing
// <196609=> External Full Swing
#ifndef CLOCK_CONFIG_LF_SRC
#define CLOCK_CONFIG_LF_SRC 1
#endif
// <q> CLOCK_CONFIG_LF_CAL_ENABLED - Calibration enable for LF Clock Source
#ifndef CLOCK_CONFIG_LF_CAL_ENABLED
#define CLOCK_CONFIG_LF_CAL_ENABLED 0
#endif
// <o> CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef CLOCK_CONFIG_IRQ_PRIORITY
#define CLOCK_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> PDM_ENABLED - nrf_drv_pdm - PDM peripheral driver - legacy layer
//==========================================================
#ifndef PDM_ENABLED
#define PDM_ENABLED 0
#endif
// <o> PDM_CONFIG_MODE - Mode
// <0=> Stereo
// <1=> Mono
#ifndef PDM_CONFIG_MODE
#define PDM_CONFIG_MODE 1
#endif
// <o> PDM_CONFIG_EDGE - Edge
// <0=> Left falling
// <1=> Left rising
#ifndef PDM_CONFIG_EDGE
#define PDM_CONFIG_EDGE 0
#endif
// <o> PDM_CONFIG_CLOCK_FREQ - Clock frequency
// <134217728=> 1000k
// <138412032=> 1032k (default)
// <142606336=> 1067k
#ifndef PDM_CONFIG_CLOCK_FREQ
#define PDM_CONFIG_CLOCK_FREQ 138412032
#endif
// <o> PDM_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef PDM_CONFIG_IRQ_PRIORITY
#define PDM_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> POWER_ENABLED - nrf_drv_power - POWER peripheral driver - legacy layer
//==========================================================
#ifndef POWER_ENABLED
#define POWER_ENABLED 0
#endif
// <o> POWER_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef POWER_CONFIG_IRQ_PRIORITY
#define POWER_CONFIG_IRQ_PRIORITY 6
#endif
// <q> POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef POWER_CONFIG_DEFAULT_DCDCEN
#define POWER_CONFIG_DEFAULT_DCDCEN 0
#endif
// <q> POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator
// <i> This settings means only that components for DCDC regulator are installed and it can be enabled.
#ifndef POWER_CONFIG_DEFAULT_DCDCENHV
#define POWER_CONFIG_DEFAULT_DCDCENHV 0
#endif
// </e>
// <q> PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - legacy layer
#ifndef PPI_ENABLED
#define PPI_ENABLED 0
#endif
// <e> PWM_ENABLED - nrf_drv_pwm - PWM peripheral driver - legacy layer
//==========================================================
#ifndef PWM_ENABLED
#define PWM_ENABLED 0
#endif
// <o> PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31>
#ifndef PWM_DEFAULT_CONFIG_OUT0_PIN
#define PWM_DEFAULT_CONFIG_OUT0_PIN 31
#endif
// <o> PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31>
#ifndef PWM_DEFAULT_CONFIG_OUT1_PIN
#define PWM_DEFAULT_CONFIG_OUT1_PIN 31
#endif
// <o> PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31>
#ifndef PWM_DEFAULT_CONFIG_OUT2_PIN
#define PWM_DEFAULT_CONFIG_OUT2_PIN 31
#endif
// <o> PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31>
#ifndef PWM_DEFAULT_CONFIG_OUT3_PIN
#define PWM_DEFAULT_CONFIG_OUT3_PIN 31
#endif
// <o> PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock
// <0=> 16 MHz
// <1=> 8 MHz
// <2=> 4 MHz
// <3=> 2 MHz
// <4=> 1 MHz
// <5=> 500 kHz
// <6=> 250 kHz
// <7=> 125 kHz
#ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK
#define PWM_DEFAULT_CONFIG_BASE_CLOCK 4
#endif
// <o> PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode
// <0=> Up
// <1=> Up and Down
#ifndef PWM_DEFAULT_CONFIG_COUNT_MODE
#define PWM_DEFAULT_CONFIG_COUNT_MODE 0
#endif
// <o> PWM_DEFAULT_CONFIG_TOP_VALUE - Top value
#ifndef PWM_DEFAULT_CONFIG_TOP_VALUE
#define PWM_DEFAULT_CONFIG_TOP_VALUE 1000
#endif
// <o> PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode
// <0=> Common
// <1=> Grouped
// <2=> Individual
// <3=> Waveform
#ifndef PWM_DEFAULT_CONFIG_LOAD_MODE
#define PWM_DEFAULT_CONFIG_LOAD_MODE 0
#endif
// <o> PWM_DEFAULT_CONFIG_STEP_MODE - Step mode
// <0=> Auto
// <1=> Triggered
#ifndef PWM_DEFAULT_CONFIG_STEP_MODE
#define PWM_DEFAULT_CONFIG_STEP_MODE 0
#endif
// <o> PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY
#define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <q> PWM0_ENABLED - Enable PWM0 instance
#ifndef PWM0_ENABLED
#define PWM0_ENABLED 0
#endif
// <q> PWM1_ENABLED - Enable PWM1 instance
#ifndef PWM1_ENABLED
#define PWM1_ENABLED 0
#endif
// <q> PWM2_ENABLED - Enable PWM2 instance
#ifndef PWM2_ENABLED
#define PWM2_ENABLED 0
#endif
// <q> PWM3_ENABLED - Enable PWM3 instance
#ifndef PWM3_ENABLED
#define PWM3_ENABLED 0
#endif
// </e>
// <e> QDEC_ENABLED - nrf_drv_qdec - QDEC peripheral driver - legacy layer
//==========================================================
#ifndef QDEC_ENABLED
#define QDEC_ENABLED 0
#endif
// <o> QDEC_CONFIG_REPORTPER - Report period
// <0=> 10 Samples
// <1=> 40 Samples
// <2=> 80 Samples
// <3=> 120 Samples
// <4=> 160 Samples
// <5=> 200 Samples
// <6=> 240 Samples
// <7=> 280 Samples
#ifndef QDEC_CONFIG_REPORTPER
#define QDEC_CONFIG_REPORTPER 0
#endif
// <o> QDEC_CONFIG_SAMPLEPER - Sample period
// <0=> 128 us
// <1=> 256 us
// <2=> 512 us
// <3=> 1024 us
// <4=> 2048 us
// <5=> 4096 us
// <6=> 8192 us
// <7=> 16384 us
#ifndef QDEC_CONFIG_SAMPLEPER
#define QDEC_CONFIG_SAMPLEPER 7
#endif
// <o> QDEC_CONFIG_PIO_A - A pin <0-31>
#ifndef QDEC_CONFIG_PIO_A
#define QDEC_CONFIG_PIO_A 31
#endif
// <o> QDEC_CONFIG_PIO_B - B pin <0-31>
#ifndef QDEC_CONFIG_PIO_B
#define QDEC_CONFIG_PIO_B 31
#endif
// <o> QDEC_CONFIG_PIO_LED - LED pin <0-31>
#ifndef QDEC_CONFIG_PIO_LED
#define QDEC_CONFIG_PIO_LED 31
#endif
// <o> QDEC_CONFIG_LEDPRE - LED pre
#ifndef QDEC_CONFIG_LEDPRE
#define QDEC_CONFIG_LEDPRE 511
#endif
// <o> QDEC_CONFIG_LEDPOL - LED polarity
// <0=> Active low
// <1=> Active high
#ifndef QDEC_CONFIG_LEDPOL
#define QDEC_CONFIG_LEDPOL 1
#endif
// <q> QDEC_CONFIG_DBFEN - Debouncing enable
#ifndef QDEC_CONFIG_DBFEN
#define QDEC_CONFIG_DBFEN 0
#endif
// <q> QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable
#ifndef QDEC_CONFIG_SAMPLE_INTEN
#define QDEC_CONFIG_SAMPLE_INTEN 0
#endif
// <o> QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef QDEC_CONFIG_IRQ_PRIORITY
#define QDEC_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> QSPI_ENABLED - nrf_drv_qspi - QSPI peripheral driver - legacy layer
//==========================================================
#ifndef QSPI_ENABLED
#define QSPI_ENABLED 0
#endif
// <o> QSPI_CONFIG_SCK_DELAY - tSHSL, tWHSL and tSHWL in number of 16 MHz periods (62.5 ns). <0-255>
#ifndef QSPI_CONFIG_SCK_DELAY
#define QSPI_CONFIG_SCK_DELAY 1
#endif
// <o> QSPI_CONFIG_XIP_OFFSET - Address offset in the external memory for Execute in Place operation.
#ifndef QSPI_CONFIG_XIP_OFFSET
#define QSPI_CONFIG_XIP_OFFSET 0
#endif
// <o> QSPI_CONFIG_READOC - Number of data lines and opcode used for reading.
// <0=> FastRead
// <1=> Read2O
// <2=> Read2IO
// <3=> Read4O
// <4=> Read4IO
#ifndef QSPI_CONFIG_READOC
#define QSPI_CONFIG_READOC 0
#endif
// <o> QSPI_CONFIG_WRITEOC - Number of data lines and opcode used for writing.
// <0=> PP
// <1=> PP2O
// <2=> PP4O
// <3=> PP4IO
#ifndef QSPI_CONFIG_WRITEOC
#define QSPI_CONFIG_WRITEOC 0
#endif
// <o> QSPI_CONFIG_ADDRMODE - Addressing mode.
// <0=> 24bit
// <1=> 32bit
#ifndef QSPI_CONFIG_ADDRMODE
#define QSPI_CONFIG_ADDRMODE 0
#endif
// <o> QSPI_CONFIG_MODE - SPI mode.
// <0=> Mode 0
// <1=> Mode 1
#ifndef QSPI_CONFIG_MODE
#define QSPI_CONFIG_MODE 0
#endif
// <o> QSPI_CONFIG_FREQUENCY - Frequency divider.
// <0=> 32MHz/1
// <1=> 32MHz/2
// <2=> 32MHz/3
// <3=> 32MHz/4
// <4=> 32MHz/5
// <5=> 32MHz/6
// <6=> 32MHz/7
// <7=> 32MHz/8
// <8=> 32MHz/9
// <9=> 32MHz/10
// <10=> 32MHz/11
// <11=> 32MHz/12
// <12=> 32MHz/13
// <13=> 32MHz/14
// <14=> 32MHz/15
// <15=> 32MHz/16
#ifndef QSPI_CONFIG_FREQUENCY
#define QSPI_CONFIG_FREQUENCY 15
#endif
// <s> QSPI_PIN_SCK - SCK pin value.
#ifndef QSPI_PIN_SCK
#define QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <s> QSPI_PIN_CSN - CSN pin value.
#ifndef QSPI_PIN_CSN
#define QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <s> QSPI_PIN_IO0 - IO0 pin value.
#ifndef QSPI_PIN_IO0
#define QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <s> QSPI_PIN_IO1 - IO1 pin value.
#ifndef QSPI_PIN_IO1
#define QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <s> QSPI_PIN_IO2 - IO2 pin value.
#ifndef QSPI_PIN_IO2
#define QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <s> QSPI_PIN_IO3 - IO3 pin value.
#ifndef QSPI_PIN_IO3
#define QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED
#endif
// <o> QSPI_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef QSPI_CONFIG_IRQ_PRIORITY
#define QSPI_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> RNG_ENABLED - nrf_drv_rng - RNG peripheral driver - legacy layer
//==========================================================
#ifndef RNG_ENABLED
#define RNG_ENABLED 1
#endif
// <q> RNG_CONFIG_ERROR_CORRECTION - Error correction
#ifndef RNG_CONFIG_ERROR_CORRECTION
#define RNG_CONFIG_ERROR_CORRECTION 1
#endif
// <o> RNG_CONFIG_POOL_SIZE - Pool size
#ifndef RNG_CONFIG_POOL_SIZE
#define RNG_CONFIG_POOL_SIZE 64
#endif
// <o> RNG_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef RNG_CONFIG_IRQ_PRIORITY
#define RNG_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> RTC_ENABLED - nrf_drv_rtc - RTC peripheral driver - legacy layer
//==========================================================
#ifndef RTC_ENABLED
#define RTC_ENABLED 0
#endif
// <o> RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768>
#ifndef RTC_DEFAULT_CONFIG_FREQUENCY
#define RTC_DEFAULT_CONFIG_FREQUENCY 32768
#endif
// <q> RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering
#ifndef RTC_DEFAULT_CONFIG_RELIABLE
#define RTC_DEFAULT_CONFIG_RELIABLE 0
#endif
// <o> RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY
#define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <q> RTC0_ENABLED - Enable RTC0 instance
#ifndef RTC0_ENABLED
#define RTC0_ENABLED 0
#endif
// <q> RTC1_ENABLED - Enable RTC1 instance
#ifndef RTC1_ENABLED
#define RTC1_ENABLED 0
#endif
// <q> RTC2_ENABLED - Enable RTC2 instance
#ifndef RTC2_ENABLED
#define RTC2_ENABLED 0
#endif
// <o> NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt
#ifndef NRF_MAXIMUM_LATENCY_US
#define NRF_MAXIMUM_LATENCY_US 2000
#endif
// </e>
// <e> SAADC_ENABLED - nrf_drv_saadc - SAADC peripheral driver - legacy layer
//==========================================================
#ifndef SAADC_ENABLED
#define SAADC_ENABLED 1
#endif
// <o> SAADC_CONFIG_RESOLUTION - Resolution
// <0=> 8 bit
// <1=> 10 bit
// <2=> 12 bit
// <3=> 14 bit
#ifndef SAADC_CONFIG_RESOLUTION
#define SAADC_CONFIG_RESOLUTION 1
#endif
// <o> SAADC_CONFIG_OVERSAMPLE - Sample period
// <0=> Disabled
// <1=> 2x
// <2=> 4x
// <3=> 8x
// <4=> 16x
// <5=> 32x
// <6=> 64x
// <7=> 128x
// <8=> 256x
#ifndef SAADC_CONFIG_OVERSAMPLE
#define SAADC_CONFIG_OVERSAMPLE 0
#endif
// <q> SAADC_CONFIG_LP_MODE - Enabling low power mode
#ifndef SAADC_CONFIG_LP_MODE
#define SAADC_CONFIG_LP_MODE 0
#endif
// <o> SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef SAADC_CONFIG_IRQ_PRIORITY
#define SAADC_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> SPIS_ENABLED - nrf_drv_spis - SPIS peripheral driver - legacy layer
//==========================================================
#ifndef SPIS_ENABLED
#define SPIS_ENABLED 0
#endif
// <o> SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY
#define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <o> SPIS_DEFAULT_MODE - Mode
// <0=> MODE_0
// <1=> MODE_1
// <2=> MODE_2
// <3=> MODE_3
#ifndef SPIS_DEFAULT_MODE
#define SPIS_DEFAULT_MODE 0
#endif
// <o> SPIS_DEFAULT_BIT_ORDER - SPIS default bit order
// <0=> MSB first
// <1=> LSB first
#ifndef SPIS_DEFAULT_BIT_ORDER
#define SPIS_DEFAULT_BIT_ORDER 0
#endif
// <o> SPIS_DEFAULT_DEF - SPIS default DEF character <0-255>
#ifndef SPIS_DEFAULT_DEF
#define SPIS_DEFAULT_DEF 255
#endif
// <o> SPIS_DEFAULT_ORC - SPIS default ORC character <0-255>
#ifndef SPIS_DEFAULT_ORC
#define SPIS_DEFAULT_ORC 255
#endif
// <q> SPIS0_ENABLED - Enable SPIS0 instance
#ifndef SPIS0_ENABLED
#define SPIS0_ENABLED 0
#endif
// <q> SPIS1_ENABLED - Enable SPIS1 instance
#ifndef SPIS1_ENABLED
#define SPIS1_ENABLED 0
#endif
// <q> SPIS2_ENABLED - Enable SPIS2 instance
#ifndef SPIS2_ENABLED
#define SPIS2_ENABLED 0
#endif
// </e>
// <e> SPI_ENABLED - nrf_drv_spi - SPI/SPIM peripheral driver - legacy layer
//==========================================================
#ifndef SPI_ENABLED
#define SPI_ENABLED 0
#endif
// <o> SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY
#define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <o> NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration.
// <0=> NRF_GPIO_PIN_NOPULL
// <1=> NRF_GPIO_PIN_PULLDOWN
// <3=> NRF_GPIO_PIN_PULLUP
#ifndef NRF_SPI_DRV_MISO_PULLUP_CFG
#define NRF_SPI_DRV_MISO_PULLUP_CFG 1
#endif
// <e> SPI0_ENABLED - Enable SPI0 instance
//==========================================================
#ifndef SPI0_ENABLED
#define SPI0_ENABLED 0
#endif
// <q> SPI0_USE_EASY_DMA - Use EasyDMA
#ifndef SPI0_USE_EASY_DMA
#define SPI0_USE_EASY_DMA 1
#endif
// </e>
// <e> SPI1_ENABLED - Enable SPI1 instance
//==========================================================
#ifndef SPI1_ENABLED
#define SPI1_ENABLED 0
#endif
// <q> SPI1_USE_EASY_DMA - Use EasyDMA
#ifndef SPI1_USE_EASY_DMA
#define SPI1_USE_EASY_DMA 1
#endif
// </e>
// <e> SPI2_ENABLED - Enable SPI2 instance
//==========================================================
#ifndef SPI2_ENABLED
#define SPI2_ENABLED 0
#endif
// <q> SPI2_USE_EASY_DMA - Use EasyDMA
#ifndef SPI2_USE_EASY_DMA
#define SPI2_USE_EASY_DMA 1
#endif
// </e>
// </e>
// <q> SYSTICK_ENABLED - nrf_drv_systick - ARM(R) SysTick driver - legacy layer
#ifndef SYSTICK_ENABLED
#define SYSTICK_ENABLED 1
#endif
// <e> TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer
//==========================================================
#ifndef TIMER_ENABLED
#define TIMER_ENABLED 1
#endif
// <o> TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode
// <0=> 16 MHz
// <1=> 8 MHz
// <2=> 4 MHz
// <3=> 2 MHz
// <4=> 1 MHz
// <5=> 500 kHz
// <6=> 250 kHz
// <7=> 125 kHz
// <8=> 62.5 kHz
// <9=> 31.25 kHz
#ifndef TIMER_DEFAULT_CONFIG_FREQUENCY
#define TIMER_DEFAULT_CONFIG_FREQUENCY 0
#endif
// <o> TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation
// <0=> Timer
// <1=> Counter
#ifndef TIMER_DEFAULT_CONFIG_MODE
#define TIMER_DEFAULT_CONFIG_MODE 0
#endif
// <o> TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width
// <0=> 16 bit
// <1=> 8 bit
// <2=> 24 bit
// <3=> 32 bit
#ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH
#define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0
#endif
// <o> TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY
#define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <q> TIMER0_ENABLED - Enable TIMER0 instance
#ifndef TIMER0_ENABLED
#define TIMER0_ENABLED 0
#endif
// <q> TIMER1_ENABLED - Enable TIMER1 instance
#ifndef TIMER1_ENABLED
#define TIMER1_ENABLED 0
#endif
// <q> TIMER2_ENABLED - Enable TIMER2 instance
#ifndef TIMER2_ENABLED
#define TIMER2_ENABLED 0
#endif
// <q> TIMER3_ENABLED - Enable TIMER3 instance
#ifndef TIMER3_ENABLED
#define TIMER3_ENABLED 1
#endif
// <q> TIMER4_ENABLED - Enable TIMER4 instance
#ifndef TIMER4_ENABLED
#define TIMER4_ENABLED 0
#endif
// </e>
// <e> TWIS_ENABLED - nrf_drv_twis - TWIS peripheral driver - legacy layer
//==========================================================
#ifndef TWIS_ENABLED
#define TWIS_ENABLED 0
#endif
// <q> TWIS0_ENABLED - Enable TWIS0 instance
#ifndef TWIS0_ENABLED
#define TWIS0_ENABLED 0
#endif
// <q> TWIS1_ENABLED - Enable TWIS1 instance
#ifndef TWIS1_ENABLED
#define TWIS1_ENABLED 0
#endif
// <q> TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once
// <i> Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code.
#ifndef TWIS_ASSUME_INIT_AFTER_RESET_ONLY
#define TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0
#endif
// <q> TWIS_NO_SYNC_MODE - Remove support for synchronous mode
// <i> Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources.
#ifndef TWIS_NO_SYNC_MODE
#define TWIS_NO_SYNC_MODE 0
#endif
// <o> TWIS_DEFAULT_CONFIG_ADDR0 - Address0
#ifndef TWIS_DEFAULT_CONFIG_ADDR0
#define TWIS_DEFAULT_CONFIG_ADDR0 0
#endif
// <o> TWIS_DEFAULT_CONFIG_ADDR1 - Address1
#ifndef TWIS_DEFAULT_CONFIG_ADDR1
#define TWIS_DEFAULT_CONFIG_ADDR1 0
#endif
// <o> TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration
// <0=> Disabled
// <1=> Pull down
// <3=> Pull up
#ifndef TWIS_DEFAULT_CONFIG_SCL_PULL
#define TWIS_DEFAULT_CONFIG_SCL_PULL 0
#endif
// <o> TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration
// <0=> Disabled
// <1=> Pull down
// <3=> Pull up
#ifndef TWIS_DEFAULT_CONFIG_SDA_PULL
#define TWIS_DEFAULT_CONFIG_SDA_PULL 0
#endif
// <o> TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY
#define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
//==========================================================
#ifndef TWI_ENABLED
#define TWI_ENABLED 0
#endif
// <o> TWI_DEFAULT_CONFIG_FREQUENCY - Frequency
// <26738688=> 100k
// <67108864=> 250k
// <104857600=> 400k
#ifndef TWI_DEFAULT_CONFIG_FREQUENCY
#define TWI_DEFAULT_CONFIG_FREQUENCY 26738688
#endif
// <q> TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init
#ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT
#define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0
#endif
// <q> TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit
#ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT
#define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
#endif
// <o> TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY
#define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <e> TWI0_ENABLED - Enable TWI0 instance
//==========================================================
#ifndef TWI0_ENABLED
#define TWI0_ENABLED 0
#endif
// <q> TWI0_USE_EASY_DMA - Use EasyDMA (if present)
#ifndef TWI0_USE_EASY_DMA
#define TWI0_USE_EASY_DMA 0
#endif
// </e>
// <e> TWI1_ENABLED - Enable TWI1 instance
//==========================================================
#ifndef TWI1_ENABLED
#define TWI1_ENABLED 0
#endif
// <q> TWI1_USE_EASY_DMA - Use EasyDMA (if present)
#ifndef TWI1_USE_EASY_DMA
#define TWI1_USE_EASY_DMA 0
#endif
// </e>
// </e>
// <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
//==========================================================
#ifndef UART_ENABLED
#define UART_ENABLED 1
#endif
// <o> UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control
// <0=> Disabled
// <1=> Enabled
#ifndef UART_DEFAULT_CONFIG_HWFC
#define UART_DEFAULT_CONFIG_HWFC 0
#endif
// <o> UART_DEFAULT_CONFIG_PARITY - Parity
// <0=> Excluded
// <14=> Included
#ifndef UART_DEFAULT_CONFIG_PARITY
#define UART_DEFAULT_CONFIG_PARITY 0
#endif
// <o> UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate
// <323584=> 1200 baud
// <643072=> 2400 baud
// <1290240=> 4800 baud
// <2576384=> 9600 baud
// <3862528=> 14400 baud
// <5152768=> 19200 baud
// <7716864=> 28800 baud
// <10289152=> 38400 baud
// <15400960=> 57600 baud
// <20615168=> 76800 baud
// <30801920=> 115200 baud
// <61865984=> 230400 baud
// <67108864=> 250000 baud
// <121634816=> 460800 baud
// <251658240=> 921600 baud
// <268435456=> 1000000 baud
#ifndef UART_DEFAULT_CONFIG_BAUDRATE
#define UART_DEFAULT_CONFIG_BAUDRATE 30801920
#endif
// <o> UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY
#define UART_DEFAULT_CONFIG_IRQ_PRIORITY 6
#endif
// <q> UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA
#ifndef UART_EASY_DMA_SUPPORT
#define UART_EASY_DMA_SUPPORT 1
#endif
// <q> UART_LEGACY_SUPPORT - Driver supporting Legacy mode
#ifndef UART_LEGACY_SUPPORT
#define UART_LEGACY_SUPPORT 1
#endif
// <e> UART0_ENABLED - Enable UART0 instance
//==========================================================
#ifndef UART0_ENABLED
#define UART0_ENABLED 1
#endif
// <q> UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA
#ifndef UART0_CONFIG_USE_EASY_DMA
#define UART0_CONFIG_USE_EASY_DMA 1
#endif
// </e>
// <e> UART1_ENABLED - Enable UART1 instance
//==========================================================
#ifndef UART1_ENABLED
#define UART1_ENABLED 0
#endif
// </e>
// </e>
// <e> USBD_ENABLED - nrf_drv_usbd - Software Component
//==========================================================
#ifndef USBD_ENABLED
#define USBD_ENABLED 0
#endif
// <o> USBD_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef USBD_CONFIG_IRQ_PRIORITY
#define USBD_CONFIG_IRQ_PRIORITY 6
#endif
// <o> USBD_CONFIG_DMASCHEDULER_MODE - USBD SMA scheduler working scheme
// <0=> Prioritized access
// <1=> Round Robin
#ifndef USBD_CONFIG_DMASCHEDULER_MODE
#define USBD_CONFIG_DMASCHEDULER_MODE 0
#endif
// <q> USBD_CONFIG_DMASCHEDULER_ISO_BOOST - Give priority to isochronous transfers
// <i> This option gives priority to isochronous transfers.
// <i> Enabling it assures that isochronous transfers are always processed,
// <i> even if multiple other transfers are pending.
// <i> Isochronous endpoints are prioritized before the usbd_dma_scheduler_algorithm
// <i> function is called, so the option is independent of the algorithm chosen.
#ifndef USBD_CONFIG_DMASCHEDULER_ISO_BOOST
#define USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1
#endif
// <q> USBD_CONFIG_ISO_IN_ZLP - Respond to an IN token on ISO IN endpoint with ZLP when no data is ready
// <i> If set, ISO IN endpoint will respond to an IN token with ZLP when no data is ready to be sent.
// <i> Else, there will be no response.
// <i> NOTE: This option does not work on Engineering A chip.
#ifndef USBD_CONFIG_ISO_IN_ZLP
#define USBD_CONFIG_ISO_IN_ZLP 0
#endif
// </e>
// <e> WDT_ENABLED - nrf_drv_wdt - WDT peripheral driver - legacy layer
//==========================================================
#ifndef WDT_ENABLED
#define WDT_ENABLED 0
#endif
// <o> WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode
// <1=> Run in SLEEP, Pause in HALT
// <8=> Pause in SLEEP, Run in HALT
// <9=> Run in SLEEP and HALT
// <0=> Pause in SLEEP and HALT
#ifndef WDT_CONFIG_BEHAVIOUR
#define WDT_CONFIG_BEHAVIOUR 1
#endif
// <o> WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295>
#ifndef WDT_CONFIG_RELOAD_VALUE
#define WDT_CONFIG_RELOAD_VALUE 2000
#endif
// <o> WDT_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef WDT_CONFIG_IRQ_PRIORITY
#define WDT_CONFIG_IRQ_PRIORITY 6
#endif
// </e>
// <h> nrfx_qspi - QSPI peripheral driver
//==========================================================
// </h>
//==========================================================
// </h>
//==========================================================
// <h> nRF_Drivers_External
//==========================================================
// <q> NRF_TWI_SENSOR_ENABLED - nrf_twi_sensor - nRF TWI Sensor module
#ifndef NRF_TWI_SENSOR_ENABLED
#define NRF_TWI_SENSOR_ENABLED 0
#endif
// </h>
//==========================================================
// <h> nRF_Libraries
//==========================================================
// <q> APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher
#ifndef APP_GPIOTE_ENABLED
#define APP_GPIOTE_ENABLED 0
#endif
// <q> APP_PWM_ENABLED - app_pwm - PWM functionality
#ifndef APP_PWM_ENABLED
#define APP_PWM_ENABLED 0
#endif
// <e> APP_SCHEDULER_ENABLED - app_scheduler - Events scheduler
//==========================================================
#ifndef APP_SCHEDULER_ENABLED
#define APP_SCHEDULER_ENABLED 1
#endif
// <q> APP_SCHEDULER_WITH_PAUSE - Enabling pause feature
#ifndef APP_SCHEDULER_WITH_PAUSE
#define APP_SCHEDULER_WITH_PAUSE 0
#endif
// <q> APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling
#ifndef APP_SCHEDULER_WITH_PROFILER
#define APP_SCHEDULER_WITH_PROFILER 0
#endif
// </e>
// <e> APP_SDCARD_ENABLED - app_sdcard - SD/MMC card support using SPI
//==========================================================
#ifndef APP_SDCARD_ENABLED
#define APP_SDCARD_ENABLED 0
#endif
// <o> APP_SDCARD_SPI_INSTANCE - SPI instance used
// <0=> 0
// <1=> 1
// <2=> 2
#ifndef APP_SDCARD_SPI_INSTANCE
#define APP_SDCARD_SPI_INSTANCE 0
#endif
// <o> APP_SDCARD_FREQ_INIT - SPI frequency
// <33554432=> 125 kHz
// <67108864=> 250 kHz
// <134217728=> 500 kHz
// <268435456=> 1 MHz
// <536870912=> 2 MHz
// <1073741824=> 4 MHz
// <2147483648=> 8 MHz
#ifndef APP_SDCARD_FREQ_INIT
#define APP_SDCARD_FREQ_INIT 67108864
#endif
// <o> APP_SDCARD_FREQ_DATA - SPI frequency
// <33554432=> 125 kHz
// <67108864=> 250 kHz
// <134217728=> 500 kHz
// <268435456=> 1 MHz
// <536870912=> 2 MHz
// <1073741824=> 4 MHz
// <2147483648=> 8 MHz
#ifndef APP_SDCARD_FREQ_DATA
#define APP_SDCARD_FREQ_DATA 1073741824
#endif
// </e>
// <e> APP_TIMER_ENABLED - app_timer - Application timer functionality
//==========================================================
#ifndef APP_TIMER_ENABLED
#define APP_TIMER_ENABLED 1
#endif
// <o> APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler.
// <0=> 32768 Hz
// <1=> 16384 Hz
// <3=> 8192 Hz
// <7=> 4096 Hz
// <15=> 2048 Hz
// <31=> 1024 Hz
#ifndef APP_TIMER_CONFIG_RTC_FREQUENCY
#define APP_TIMER_CONFIG_RTC_FREQUENCY 1
#endif
// <o> APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority
// <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
// <0=> 0 (highest)
// <1=> 1
// <2=> 2
// <3=> 3
// <4=> 4
// <5=> 5
// <6=> 6
// <7=> 7
#ifndef APP_TIMER_CONFIG_IRQ_PRIORITY
#define APP_TIMER_CONFIG_IRQ_PRIORITY 6
#endif
// <o> APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue.
// <i> Size of the queue depends on how many timers are used
// <i> in the system, how often timers are started and overall
// <i> system latency. If queue size is too small app_timer calls
// <i> will fail.
#ifndef APP_TIMER_CONFIG_OP_QUEUE_SIZE
#define APP_TIMER_CONFIG_OP_QUEUE_SIZE 10
#endif
// <q> APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler
#ifndef APP_TIMER_CONFIG_USE_SCHEDULER
#define APP_TIMER_CONFIG_USE_SCHEDULER 0
#endif
// <q> APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on
// <i> If option is enabled RTC is kept running even if there is no active timers.
// <i> This option can be used when app_timer is used for timestamping.
#ifndef APP_TIMER_KEEPS_RTC_ACTIVE
#define APP_TIMER_KEEPS_RTC_ACTIVE 0
#endif
// <o> APP_TIMER_SAFE_WINDOW_MS - Maximum possible latency (in milliseconds) of handling app_timer event.
// <i> Maximum possible timeout that can be set is reduced by safe window.
// <i> Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS.
// <i> Since RTC is not stopped when processor is halted in debugging session, this value
// <i> must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS
// <i> without corrupting app_timer behavior.
#ifndef APP_TIMER_SAFE_WINDOW_MS
#define APP_TIMER_SAFE_WINDOW_MS 300000
#endif
// <h> App Timer Legacy configuration - Legacy configuration.
//==========================================================
// <q> APP_TIMER_WITH_PROFILER - Enable app_timer profiling
#ifndef APP_TIMER_WITH_PROFILER
#define APP_TIMER_WITH_PROFILER 0
#endif
// <q> APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used.
#ifndef APP_TIMER_CONFIG_SWI_NUMBER
#define APP_TIMER_CONFIG_SWI_NUMBER 0
#endif
// </h>
//==========================================================
// </e>
// <q> APP_USBD_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class
#ifndef APP_USBD_AUDIO_ENABLED
#define APP_USBD_AUDIO_ENABLED 0
#endif
// <e> APP_USBD_ENABLED - app_usbd - USB Device library
//==========================================================
#ifndef APP_USBD_ENABLED
#define APP_USBD_ENABLED 0
#endif
// <o> APP_USBD_VID - Vendor ID. <0x0000-0xFFFF>
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/
#ifndef APP_USBD_VID
#define APP_USBD_VID 0
#endif
// <o> APP_USBD_PID - Product ID. <0x0000-0xFFFF>
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Selected Product ID
#ifndef APP_USBD_PID
#define APP_USBD_PID 0
#endif
// <o> APP_USBD_DEVICE_VER_MAJOR - Major device version <0-99>
// <i> Major device version, will be converted automatically to BCD notation. Use just decimal values.
#ifndef APP_USBD_DEVICE_VER_MAJOR
#define APP_USBD_DEVICE_VER_MAJOR 1
#endif
// <o> APP_USBD_DEVICE_VER_MINOR - Minor device version <0-9>
// <i> Minor device version, will be converted automatically to BCD notation. Use just decimal values.
#ifndef APP_USBD_DEVICE_VER_MINOR
#define APP_USBD_DEVICE_VER_MINOR 0
#endif
// <o> APP_USBD_DEVICE_VER_SUB - Sub-minor device version <0-9>
// <i> Sub-minor device version, will be converted automatically to BCD notation. Use just decimal values.
#ifndef APP_USBD_DEVICE_VER_SUB
#define APP_USBD_DEVICE_VER_SUB 0
#endif
// <q> APP_USBD_CONFIG_SELF_POWERED - Self-powered device, as opposed to bus-powered.
#ifndef APP_USBD_CONFIG_SELF_POWERED
#define APP_USBD_CONFIG_SELF_POWERED 1
#endif
// <o> APP_USBD_CONFIG_MAX_POWER - MaxPower field in configuration descriptor in milliamps. <0-500>
#ifndef APP_USBD_CONFIG_MAX_POWER
#define APP_USBD_CONFIG_MAX_POWER 100
#endif
// <q> APP_USBD_CONFIG_POWER_EVENTS_PROCESS - Process power events.
// <i> Enable processing power events in USB event handler.
#ifndef APP_USBD_CONFIG_POWER_EVENTS_PROCESS
#define APP_USBD_CONFIG_POWER_EVENTS_PROCESS 1
#endif
// <e> APP_USBD_CONFIG_EVENT_QUEUE_ENABLE - Enable event queue.
// <i> This is the default configuration when all the events are placed into internal queue.
// <i> Disable it when an external queue is used like app_scheduler or if you wish to process all events inside interrupts.
// <i> Processing all events from the interrupt level adds requirement not to call any functions that modifies the USBD library state from the context higher than USB interrupt context.
// <i> Functions that modify USBD state are functions for sleep, wakeup, start, stop, enable, and disable.
//==========================================================
#ifndef APP_USBD_CONFIG_EVENT_QUEUE_ENABLE
#define APP_USBD_CONFIG_EVENT_QUEUE_ENABLE 1
#endif
// <o> APP_USBD_CONFIG_EVENT_QUEUE_SIZE - The size of the event queue. <16-64>
// <i> The size of the queue for the events that would be processed in the main loop.
#ifndef APP_USBD_CONFIG_EVENT_QUEUE_SIZE
#define APP_USBD_CONFIG_EVENT_QUEUE_SIZE 32
#endif
// <o> APP_USBD_CONFIG_SOF_HANDLING_MODE - Change SOF events handling mode.
// <i> Normal queue - SOF events are pushed normally into the event queue.
// <i> Compress queue - SOF events are counted and binded with other events or executed when the queue is empty.
// <i> This prevents the queue from filling up with SOF events.
// <i> Interrupt - SOF events are processed in interrupt.
// <0=> Normal queue
// <1=> Compress queue
// <2=> Interrupt
#ifndef APP_USBD_CONFIG_SOF_HANDLING_MODE
#define APP_USBD_CONFIG_SOF_HANDLING_MODE 1
#endif
// </e>
// <q> APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE - Provide a function that generates timestamps for logs based on the current SOF.
// <i> The function app_usbd_sof_timestamp_get is implemented if the logger is enabled.
// <i> Use it when initializing the logger.
// <i> SOF processing is always enabled when this configuration parameter is active.
// <i> Note: This option is configured outside of APP_USBD_CONFIG_LOG_ENABLED.
// <i> This means that it works even if the logging in this very module is disabled.
#ifndef APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE
#define APP_USBD_CONFIG_SOF_TIMESTAMP_PROVIDE 0
#endif
// <o> APP_USBD_CONFIG_DESC_STRING_SIZE - Maximum size of the NULL-terminated string of the string descriptor. <31-254>
// <i> 31 characters can be stored in the internal USB buffer used for transfers.
// <i> Any value higher than 31 creates an additional buffer just for descriptor strings.
#ifndef APP_USBD_CONFIG_DESC_STRING_SIZE
#define APP_USBD_CONFIG_DESC_STRING_SIZE 31
#endif
// <q> APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED - Enable UTF8 conversion.
// <i> Enable UTF8-encoded characters. In normal processing, only ASCII characters are available.
#ifndef APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED
#define APP_USBD_CONFIG_DESC_STRING_UTF_ENABLED 0
#endif
// <s> APP_USBD_STRINGS_LANGIDS - Supported languages identifiers.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Comma-separated list of supported languages.
#ifndef APP_USBD_STRINGS_LANGIDS
#define APP_USBD_STRINGS_LANGIDS APP_USBD_LANG_AND_SUBLANG(APP_USBD_LANG_ENGLISH, APP_USBD_SUBLANG_ENGLISH_US)
#endif
// <e> APP_USBD_STRING_ID_MANUFACTURER - Define manufacturer string ID.
// <i> Setting ID to 0 disables the string.
//==========================================================
#ifndef APP_USBD_STRING_ID_MANUFACTURER
#define APP_USBD_STRING_ID_MANUFACTURER 1
#endif
// <q> APP_USBD_STRINGS_MANUFACTURER_EXTERN - Define whether @ref APP_USBD_STRINGS_MANUFACTURER is created by macro or declared as a global variable.
#ifndef APP_USBD_STRINGS_MANUFACTURER_EXTERN
#define APP_USBD_STRINGS_MANUFACTURER_EXTERN 0
#endif
// <s> APP_USBD_STRINGS_MANUFACTURER - String descriptor for the manufacturer name.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Comma-separated list of manufacturer names for each defined language.
// <i> Use @ref APP_USBD_STRING_DESC macro to create string descriptor from a NULL-terminated string.
// <i> Use @ref APP_USBD_STRING_RAW8_DESC macro to create string descriptor from comma-separated uint8_t values.
// <i> Use @ref APP_USBD_STRING_RAW16_DESC macro to create string descriptor from comma-separated uint16_t values.
// <i> Alternatively, configure the macro to point to any internal variable pointer that already contains the descriptor.
// <i> Setting string to NULL disables that string.
// <i> The order of manufacturer names must be the same like in @ref APP_USBD_STRINGS_LANGIDS.
#ifndef APP_USBD_STRINGS_MANUFACTURER
#define APP_USBD_STRINGS_MANUFACTURER APP_USBD_STRING_DESC("Nordic Semiconductor")
#endif
// </e>
// <e> APP_USBD_STRING_ID_PRODUCT - Define product string ID.
// <i> Setting ID to 0 disables the string.
//==========================================================
#ifndef APP_USBD_STRING_ID_PRODUCT
#define APP_USBD_STRING_ID_PRODUCT 2
#endif
// <q> APP_USBD_STRINGS_PRODUCT_EXTERN - Define whether @ref APP_USBD_STRINGS_PRODUCT is created by macro or declared as a global variable.
#ifndef APP_USBD_STRINGS_PRODUCT_EXTERN
#define APP_USBD_STRINGS_PRODUCT_EXTERN 0
#endif
// <s> APP_USBD_STRINGS_PRODUCT - String descriptor for the product name.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> List of product names that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER.
#ifndef APP_USBD_STRINGS_PRODUCT
#define APP_USBD_STRINGS_PRODUCT APP_USBD_STRING_DESC("nRF52 USB Product")
#endif
// </e>
// <e> APP_USBD_STRING_ID_SERIAL - Define serial number string ID.
// <i> Setting ID to 0 disables the string.
//==========================================================
#ifndef APP_USBD_STRING_ID_SERIAL
#define APP_USBD_STRING_ID_SERIAL 3
#endif
// <q> APP_USBD_STRING_SERIAL_EXTERN - Define whether @ref APP_USBD_STRING_SERIAL is created by macro or declared as a global variable.
#ifndef APP_USBD_STRING_SERIAL_EXTERN
#define APP_USBD_STRING_SERIAL_EXTERN 0
#endif
// <s> APP_USBD_STRING_SERIAL - String descriptor for the serial number.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Serial number that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER.
#ifndef APP_USBD_STRING_SERIAL
#define APP_USBD_STRING_SERIAL APP_USBD_STRING_DESC("000000000000")
#endif
// </e>
// <e> APP_USBD_STRING_ID_CONFIGURATION - Define configuration string ID.
// <i> Setting ID to 0 disables the string.
//==========================================================
#ifndef APP_USBD_STRING_ID_CONFIGURATION
#define APP_USBD_STRING_ID_CONFIGURATION 4
#endif
// <q> APP_USBD_STRING_CONFIGURATION_EXTERN - Define whether @ref APP_USBD_STRINGS_CONFIGURATION is created by macro or declared as global variable.
#ifndef APP_USBD_STRING_CONFIGURATION_EXTERN
#define APP_USBD_STRING_CONFIGURATION_EXTERN 0
#endif
// <s> APP_USBD_STRINGS_CONFIGURATION - String descriptor for the device configuration.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> Configuration string that is defined the same way like in @ref APP_USBD_STRINGS_MANUFACTURER.
#ifndef APP_USBD_STRINGS_CONFIGURATION
#define APP_USBD_STRINGS_CONFIGURATION APP_USBD_STRING_DESC("Default configuration")
#endif
// </e>
// <s> APP_USBD_STRINGS_USER - Default values for user strings.
// <i> Note: This value is not editable in Configuration Wizard.
// <i> This value stores all application specific user strings with the default initialization.
// <i> The setup is done by X-macros.
// <i> Expected macro parameters:
// <i> @code
// <i> X(mnemonic, [=str_idx], ...)
// <i> @endcode
// <i> - @c mnemonic: Mnemonic of the string descriptor that would be added to
// <i> @ref app_usbd_string_desc_idx_t enumerator.
// <i> - @c str_idx : String index value, can be set or left empty.
// <i> For example, WinUSB driver requires descriptor to be present on 0xEE index.
// <i> Then use X(USBD_STRING_WINUSB, =0xEE, (APP_USBD_STRING_DESC(...)))
// <i> - @c ... : List of string descriptors for each defined language.
#ifndef APP_USBD_STRINGS_USER
#define APP_USBD_STRINGS_USER X(APP_USER_1, , APP_USBD_STRING_DESC("User 1"))
#endif
// </e>
// <e> APP_USBD_HID_ENABLED - app_usbd_hid - USB HID class
//==========================================================
#ifndef APP_USBD_HID_ENABLED
#define APP_USBD_HID_ENABLED 0
#endif
// <o> APP_USBD_HID_DEFAULT_IDLE_RATE - Default idle rate for HID class. <0-255>
// <i> 0 means indefinite duration, any other value is multiplied by 4 milliseconds. Refer to Chapter 7.2.4 of HID 1.11 Specification.
#ifndef APP_USBD_HID_DEFAULT_IDLE_RATE
#define APP_USBD_HID_DEFAULT_IDLE_RATE 0
#endif
// <o> APP_USBD_HID_REPORT_IDLE_TABLE_SIZE - Size of idle rate table. <1-255>
// <i> Must be higher than the highest report ID used.
#ifndef APP_USBD_HID_REPORT_IDLE_TABLE_SIZE
#define APP_USBD_HID_REPORT_IDLE_TABLE_SIZE 4
#endif
// </e>
// <q> APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic
#ifndef APP_USBD_HID_GENERIC_ENABLED
#define APP_USBD_HID_GENERIC_ENABLED 0
#endif
// <q> APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard
#ifndef APP_USBD_HID_KBD_ENABLED
#define APP_USBD_HID_KBD_ENABLED 0
#endif
// <q> APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse
#ifndef APP_USBD_HID_MOUSE_ENABLED
#define APP_USBD_HID_MOUSE_ENABLED 0
#endif
// <q> APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class
#ifndef APP_USBD_MSC_ENABLED
#define APP_USBD_MSC_ENABLED 0
#endif
// <q> CRC16_ENABLED - crc16 - CRC16 calculation routines
#ifndef CRC16_ENABLED
#define CRC16_ENABLED 0
#endif
// <q> CRC32_ENABLED - crc32 - CRC32 calculation routines
#ifndef CRC32_ENABLED
#define CRC32_ENABLED 0
#endif
// <q> ECC_ENABLED - ecc - Elliptic Curve Cryptography Library
#ifndef ECC_ENABLED
#define ECC_ENABLED 0
#endif
// <e> FDS_ENABLED - fds - Flash data storage module
//==========================================================
#ifndef FDS_ENABLED
#define FDS_ENABLED 0
#endif
// <h> Pages - Virtual page settings
// <i> Configure the number of virtual pages to use and their size.
//==========================================================
// <o> FDS_VIRTUAL_PAGES - Number of virtual flash pages to use.
// <i> One of the virtual pages is reserved by the system for garbage collection.
// <i> Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection.
// <i> The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes.
#ifndef FDS_VIRTUAL_PAGES
#define FDS_VIRTUAL_PAGES 3
#endif
// <o> FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page.
// <i> Expressed in number of 4-byte words.
// <i> By default, a virtual page is the same size as a physical page.
// <i> The size of a virtual page must be a multiple of the size of a physical page.
// <1024=> 1024
// <2048=> 2048
#ifndef FDS_VIRTUAL_PAGE_SIZE
#define FDS_VIRTUAL_PAGE_SIZE 1024
#endif
// <s> FDS_VIRTUAL_PAGES_RESERVED - The number of virtual flash pages that are used by other modules.
// <i> FDS module stores its data in the last pages of the flash memory.
// <i> By setting this value, you can move flash end address used by the FDS.
// <i> As a result the reserved space can be used by other modules.
#ifndef FDS_VIRTUAL_PAGES_RESERVED
#define FDS_VIRTUAL_PAGES_RESERVED ((ZIGBEE_NVRAM_PAGE_SIZE * ZIGBEE_NVRAM_PAGE_COUNT + ZIGBEE_NVRAM_CONFIG_PAGE_SIZE * ZIGBEE_NVRAM_CONFIG_PAGE_COUNT)/(FDS_VIRTUAL_PAGE_SIZE * 4))
#endif
// </h>
//==========================================================
// <h> Backend - Backend configuration
// <i> Configure which nrf_fstorage backend is used by FDS to write to flash.
//==========================================================
// <o> FDS_BACKEND - FDS flash backend.
// <i> NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present.
// <i> NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice.
// <1=> NRF_FSTORAGE_NVMC
// <2=> NRF_FSTORAGE_SD
#ifndef FDS_BACKEND
#define FDS_BACKEND 2
#endif
// </h>
//==========================================================
// <h> Queue - Queue settings
//==========================================================
// <o> FDS_OP_QUEUE_SIZE - Size of the internal queue.
// <i> Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors.
#ifndef FDS_OP_QUEUE_SIZE
#define FDS_OP_QUEUE_SIZE 4
#endif
// </h>
//==========================================================
// <h> CRC - CRC functionality
//==========================================================
// <e> FDS_CRC_CHECK_ON_READ - Enable CRC checks.
// <i> Save a record's CRC when it is written to flash and check it when the record is opened.
// <i> Records with an incorrect CRC can still be 'seen' by the user using FDS functions, but they cannot be opened.
// <i> Additionally, they will not be garbage collected until they are deleted.
//==========================================================
#ifndef FDS_CRC_CHECK_ON_READ
#define FDS_CRC_CHECK_ON_READ 0
#endif
// <o> FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records.
// <i> Perform a CRC check on newly written records.
// <i> This setting can be used to make sure that the record data was not altered while being written to flash.
// <1=> Enabled
// <0=> Disabled
#ifndef FDS_CRC_CHECK_ON_WRITE
#define FDS_CRC_CHECK_ON_WRITE 0
#endif
// </e>
// </h>
//==========================================================
// <h> Users - Number of users
//==========================================================
// <o> FDS_MAX_USERS - Maximum number of callbacks that can be registered.
#ifndef FDS_MAX_USERS
#define FDS_MAX_USERS 4
#endif
// </h>
//==========================================================
// </e>
// <q> HARDFAULT_HANDLER_ENABLED - hardfault_default - HardFault default handler for debugging and release
#ifndef HARDFAULT_HANDLER_ENABLED
#define HARDFAULT_HANDLER_ENABLED 0
#endif
// <e> HCI_MEM_POOL_ENABLED - hci_mem_pool - memory pool implementation used by HCI
//==========================================================
#ifndef HCI_MEM_POOL_ENABLED
#define HCI_MEM_POOL_ENABLED 0
#endif
// <o> HCI_TX_BUF_SIZE - TX buffer size in bytes.
#ifndef HCI_TX_BUF_SIZE
#define HCI_TX_BUF_SIZE 600
#endif
// <o> HCI_RX_BUF_SIZE - RX buffer size in bytes.
#ifndef HCI_RX_BUF_SIZE
#define HCI_RX_BUF_SIZE 600
#endif
// <o> HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size.
#ifndef HCI_RX_BUF_QUEUE_SIZE
#define HCI_RX_BUF_QUEUE_SIZE 4
#endif
// </e>
// <e> HCI_SLIP_ENABLED - hci_slip - SLIP protocol implementation used by HCI
//==========================================================
#ifndef HCI_SLIP_ENABLED
#define HCI_SLIP_ENABLED 0
#endif
// <o> HCI_UART_BAUDRATE - Default Baudrate
// <323584=> 1200 baud
// <643072=> 2400 baud
// <1290240=> 4800 baud
// <2576384=> 9600 baud
// <3862528=> 14400 baud
// <5152768=> 19200 baud
// <7716864=> 28800 baud
// <10289152=> 38400 baud
// <15400960=> 57600 baud
// <20615168=> 76800 baud
// <30801920=> 115200 baud
// <61865984=> 230400 baud
// <67108864=> 250000 baud
// <121634816=> 460800 baud
// <251658240=> 921600 baud
// <268435456=> 1000000 baud
#ifndef HCI_UART_BAUDRATE
#define HCI_UART_BAUDRATE 30801920
#endif
// <o> HCI_UART_FLOW_CONTROL - Hardware Flow Control
// <0=> Disabled
// <1=> Enabled
#ifndef HCI_UART_FLOW_CONTROL
#define HCI_UART_FLOW_CONTROL 0
#endif
// <o> HCI_UART_RX_PIN - UART RX pin
#ifndef HCI_UART_RX_PIN
#define HCI_UART_RX_PIN 8
#endif
// <o> HCI_UART_TX_PIN - UART TX pin
#ifndef HCI_UART_TX_PIN
#define HCI_UART_TX_PIN 6
#endif
// <o> HCI_UART_RTS_PIN - UART RTS pin
#ifndef HCI_UART_RTS_PIN
#define HCI_UART_RTS_PIN 5
#endif
// <o> HCI_UART_CTS_PIN - UART CTS pin
#ifndef HCI_UART_CTS_PIN
#define HCI_UART_CTS_PIN 7
#endif
// </e>
// <e> HCI_TRANSPORT_ENABLED - hci_transport - HCI transport
//==========================================================
#ifndef HCI_TRANSPORT_ENABLED
#define HCI_TRANSPORT_ENABLED 0
#endif
// <o> HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits.
#ifndef HCI_MAX_PACKET_SIZE_IN_BITS
#define HCI_MAX_PACKET_SIZE_IN_BITS 8000
#endif
// </e>
// <q> LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module
#ifndef LED_SOFTBLINK_ENABLED
#define LED_SOFTBLINK_ENABLED 0
#endif
// <q> LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module
#ifndef LOW_POWER_PWM_ENABLED
#define LOW_POWER_PWM_ENABLED 0
#endif
// <e> MEM_MANAGER_ENABLED - mem_manager - Dynamic memory allocator
//==========================================================
#ifndef MEM_MANAGER_ENABLED
#define MEM_MANAGER_ENABLED 0
#endif
// <o> MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255>
#ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT
#define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1
#endif
// <o> MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block.
// <i> Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE
#define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32
#endif
// <o> MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255>
#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT
#define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block.
// <i> Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE
#define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256
#endif
// <o> MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255>
#ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT
#define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block.
// <i> Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE
#define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256
#endif
// <o> MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255>
#ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT
#define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block.
// <i> Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE
#define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320
#endif
// <o> MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255>
#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT
#define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block.
// <i> Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE
#define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444
#endif
// <o> MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255>
#ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT
#define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block.
// <i> Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE
#define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64
#endif
// <o> MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255>
#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT
#define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0
#endif
// <o> MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block.
// <i> Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized.
#ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE
#define MEMORY_MANAGER_XXSMALL_BLOCK_SIZE 32
#endif
// <e> MEM_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef MEM_MANAGER_CONFIG_LOG_ENABLED
#define MEM_MANAGER_CONFIG_LOG_ENABLED 0
#endif
// <o> MEM_MANAGER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef MEM_MANAGER_CONFIG_LOG_LEVEL
#define MEM_MANAGER_CONFIG_LOG_LEVEL 3
#endif
// <o> MEM_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef MEM_MANAGER_CONFIG_INFO_COLOR
#define MEM_MANAGER_CONFIG_INFO_COLOR 0
#endif
// <o> MEM_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef MEM_MANAGER_CONFIG_DEBUG_COLOR
#define MEM_MANAGER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <q> MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module.
#ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK
#define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0
#endif
// </e>
// <e> NRF_BALLOC_ENABLED - nrf_balloc - Block allocator module
//==========================================================
#ifndef NRF_BALLOC_ENABLED
#define NRF_BALLOC_ENABLED 1
#endif
// <e> NRF_BALLOC_CONFIG_DEBUG_ENABLED - Enables debug mode in the module.
//==========================================================
#ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED
#define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0
#endif
// <o> NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255>
#ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS
#define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1
#endif
// <o> NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255>
#ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS
#define NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS 1
#endif
// <q> NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module.
#ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED
#define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0
#endif
// <q> NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module.
#ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED
#define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0
#endif
// <q> NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module.
#ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED
#define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0
#endif
// <q> NRF_BALLOC_CLI_CMDS - Enable CLI commands specific to the module
#ifndef NRF_BALLOC_CLI_CMDS
#define NRF_BALLOC_CLI_CMDS 0
#endif
// </e>
// </e>
// <e> NRF_CSENSE_ENABLED - nrf_csense - Capacitive sensor module
//==========================================================
#ifndef NRF_CSENSE_ENABLED
#define NRF_CSENSE_ENABLED 0
#endif
// <o> NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched.
#ifndef NRF_CSENSE_PAD_HYSTERESIS
#define NRF_CSENSE_PAD_HYSTERESIS 15
#endif
// <o> NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step.
#ifndef NRF_CSENSE_PAD_DEVIATION
#define NRF_CSENSE_PAD_DEVIATION 70
#endif
// <o> NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account.
#ifndef NRF_CSENSE_MIN_PAD_VALUE
#define NRF_CSENSE_MIN_PAD_VALUE 20
#endif
// <o> NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance.
#ifndef NRF_CSENSE_MAX_PADS_NUMBER
#define NRF_CSENSE_MAX_PADS_NUMBER 20
#endif
// <o> NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement.
#ifndef NRF_CSENSE_MAX_VALUE
#define NRF_CSENSE_MAX_VALUE 1000
#endif
// <o> NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module.
// <i> This is used when capacitive sensor does not use COMP.
#ifndef NRF_CSENSE_OUTPUT_PIN
#define NRF_CSENSE_OUTPUT_PIN 26
#endif
// </e>
// <e> NRF_DRV_CSENSE_ENABLED - nrf_drv_csense - Capacitive sensor low-level module
//==========================================================
#ifndef NRF_DRV_CSENSE_ENABLED
#define NRF_DRV_CSENSE_ENABLED 0
#endif
// <e> USE_COMP - Use the comparator to implement the capacitive sensor driver.
// <i> Due to Anomaly 84, COMP I_SOURCE is not functional. It has too high a varation.
//==========================================================
#ifndef USE_COMP
#define USE_COMP 0
#endif
// <o> TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51).
#ifndef TIMER0_FOR_CSENSE
#define TIMER0_FOR_CSENSE 1
#endif
// <o> TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51).
#ifndef TIMER1_FOR_CSENSE
#define TIMER1_FOR_CSENSE 2
#endif
// <o> MEASUREMENT_PERIOD - Single measurement period.
// <i> Time of a single measurement can be calculated as
// <i> T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ).
// <i> I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad.
#ifndef MEASUREMENT_PERIOD
#define MEASUREMENT_PERIOD 20
#endif
// </e>
// </e>
// <e> NRF_FSTORAGE_ENABLED - nrf_fstorage - Flash abstraction library
//==========================================================
#ifndef NRF_FSTORAGE_ENABLED
#define NRF_FSTORAGE_ENABLED 1
#endif
// <h> nrf_fstorage - Common settings
// <i> Common settings to all fstorage implementations
//==========================================================
// <q> NRF_FSTORAGE_PARAM_CHECK_DISABLED - Disable user input validation
// <i> If selected, use ASSERT to validate user input.
// <i> This effectively removes user input validation in production code.
// <i> Recommended setting: OFF, only enable this setting if size is a major concern.
#ifndef NRF_FSTORAGE_PARAM_CHECK_DISABLED
#define NRF_FSTORAGE_PARAM_CHECK_DISABLED 0
#endif
// </h>
//==========================================================
// <h> nrf_fstorage_sd - Implementation using the SoftDevice
// <i> Configuration options for the fstorage implementation using the SoftDevice
//==========================================================
// <o> NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations
// <i> Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM.
#ifndef NRF_FSTORAGE_SD_QUEUE_SIZE
#define NRF_FSTORAGE_SD_QUEUE_SIZE 4
#endif
// <o> NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy
// <i> Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error.
// <i> The SoftDevice might fail to schedule flash access due to high BLE activity.
#ifndef NRF_FSTORAGE_SD_MAX_RETRIES
#define NRF_FSTORAGE_SD_MAX_RETRIES 8
#endif
// <o> NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation
// <i> This value must be a multiple of four.
// <i> Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity.
// <i> This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write.
// <i> That is 1024 bytes for nRF51 ICs and 4096 bytes for nRF52 ICs.
#ifndef NRF_FSTORAGE_SD_MAX_WRITE_SIZE
#define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096
#endif
// </h>
//==========================================================
// </e>
// <q> NRF_GFX_ENABLED - nrf_gfx - GFX module
#ifndef NRF_GFX_ENABLED
#define NRF_GFX_ENABLED 0
#endif
// <q> NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module
#ifndef NRF_MEMOBJ_ENABLED
#define NRF_MEMOBJ_ENABLED 1
#endif
// <e> NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module
//==========================================================
#ifndef NRF_PWR_MGMT_ENABLED
#define NRF_PWR_MGMT_ENABLED 1
#endif
// <e> NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED - Enables pin debug in the module.
// <i> Selected pin will be set when CPU is in sleep mode.
//==========================================================
#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED
#define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0
#endif
// <o> NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number
// <0=> 0 (P0.0)
// <1=> 1 (P0.1)
// <2=> 2 (P0.2)
// <3=> 3 (P0.3)
// <4=> 4 (P0.4)
// <5=> 5 (P0.5)
// <6=> 6 (P0.6)
// <7=> 7 (P0.7)
// <8=> 8 (P0.8)
// <9=> 9 (P0.9)
// <10=> 10 (P0.10)
// <11=> 11 (P0.11)
// <12=> 12 (P0.12)
// <13=> 13 (P0.13)
// <14=> 14 (P0.14)
// <15=> 15 (P0.15)
// <16=> 16 (P0.16)
// <17=> 17 (P0.17)
// <18=> 18 (P0.18)
// <19=> 19 (P0.19)
// <20=> 20 (P0.20)
// <21=> 21 (P0.21)
// <22=> 22 (P0.22)
// <23=> 23 (P0.23)
// <24=> 24 (P0.24)
// <25=> 25 (P0.25)
// <26=> 26 (P0.26)
// <27=> 27 (P0.27)
// <28=> 28 (P0.28)
// <29=> 29 (P0.29)
// <30=> 30 (P0.30)
// <31=> 31 (P0.31)
// <32=> 32 (P1.0)
// <33=> 33 (P1.1)
// <34=> 34 (P1.2)
// <35=> 35 (P1.3)
// <36=> 36 (P1.4)
// <37=> 37 (P1.5)
// <38=> 38 (P1.6)
// <39=> 39 (P1.7)
// <40=> 40 (P1.8)
// <41=> 41 (P1.9)
// <42=> 42 (P1.10)
// <43=> 43 (P1.11)
// <44=> 44 (P1.12)
// <45=> 45 (P1.13)
// <46=> 46 (P1.14)
// <47=> 47 (P1.15)
// <4294967295=> Not connected
#ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN
#define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31
#endif
// </e>
// <q> NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor.
// <i> Module will trace percentage of CPU usage in one second intervals.
#ifndef NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED
#define NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED 0
#endif
// <e> NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED - Enable standby timeout.
//==========================================================
#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED
#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0
#endif
// <o> NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds).
// <i> Shutdown procedure will begin no earlier than after this number of seconds.
#ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S
#define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S 3
#endif
// </e>
// <q> NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning.
#ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED
#define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 1
#endif
// <q> NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second.
#ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY
#define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0
#endif
// <q> NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler.
#ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER
#define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0
#endif
// <o> NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers.
// <i> The number of stages of the shutdown process.
#ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT
#define NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT 3
#endif
// </e>
// <e> NRF_QUEUE_ENABLED - nrf_queue - Queue module
//==========================================================
#ifndef NRF_QUEUE_ENABLED
#define NRF_QUEUE_ENABLED 1
#endif
// <q> NRF_QUEUE_CLI_CMDS - Enable CLI commands specific to the module
#ifndef NRF_QUEUE_CLI_CMDS
#define NRF_QUEUE_CLI_CMDS 0
#endif
// </e>
// <q> NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator
#ifndef NRF_SECTION_ITER_ENABLED
#define NRF_SECTION_ITER_ENABLED 1
#endif
// <q> NRF_SORTLIST_ENABLED - nrf_sortlist - Sorted list
#ifndef NRF_SORTLIST_ENABLED
#define NRF_SORTLIST_ENABLED 1
#endif
// <q> NRF_SPI_MNGR_ENABLED - nrf_spi_mngr - SPI transaction manager
#ifndef NRF_SPI_MNGR_ENABLED
#define NRF_SPI_MNGR_ENABLED 0
#endif
// <q> NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string.
#ifndef NRF_STRERROR_ENABLED
#define NRF_STRERROR_ENABLED 1
#endif
// <q> NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager
#ifndef NRF_TWI_MNGR_ENABLED
#define NRF_TWI_MNGR_ENABLED 0
#endif
// <q> SLIP_ENABLED - slip - SLIP encoding and decoding
#ifndef SLIP_ENABLED
#define SLIP_ENABLED 0
#endif
// <e> TASK_MANAGER_ENABLED - task_manager - Task manager.
//==========================================================
#ifndef TASK_MANAGER_ENABLED
#define TASK_MANAGER_ENABLED 0
#endif
// <q> TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module
#ifndef TASK_MANAGER_CLI_CMDS
#define TASK_MANAGER_CLI_CMDS 0
#endif
// <o> TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created
#ifndef TASK_MANAGER_CONFIG_MAX_TASKS
#define TASK_MANAGER_CONFIG_MAX_TASKS 2
#endif
// <o> TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2)
#ifndef TASK_MANAGER_CONFIG_STACK_SIZE
#define TASK_MANAGER_CONFIG_STACK_SIZE 1024
#endif
// <q> TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling.
#ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED
#define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1
#endif
// <o> TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard.
// <0=> Disabled
// <4=> 32 bytes
// <5=> 64 bytes
// <6=> 128 bytes
// <7=> 256 bytes
// <8=> 512 bytes
#ifndef TASK_MANAGER_CONFIG_STACK_GUARD
#define TASK_MANAGER_CONFIG_STACK_GUARD 7
#endif
// </e>
// <h> app_button - buttons handling module
//==========================================================
// <q> BUTTON_ENABLED - Enables Button module
#ifndef BUTTON_ENABLED
#define BUTTON_ENABLED 1
#endif
// <q> BUTTON_HIGH_ACCURACY_ENABLED - Enables GPIOTE high accuracy for buttons
#ifndef BUTTON_HIGH_ACCURACY_ENABLED
#define BUTTON_HIGH_ACCURACY_ENABLED 0
#endif
// </h>
//==========================================================
// <h> app_usbd_cdc_acm - USB CDC ACM class
//==========================================================
// <q> APP_USBD_CDC_ACM_ENABLED - Enabling USBD CDC ACM Class library
#ifndef APP_USBD_CDC_ACM_ENABLED
#define APP_USBD_CDC_ACM_ENABLED 0
#endif
// <q> APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE - Send ZLP on write with same size as endpoint
// <i> If enabled, CDC ACM class will automatically send a zero length packet after transfer which has the same size as endpoint.
// <i> This may limit throughput if a lot of binary data is sent, but in terminal mode operation it makes sure that the data is always displayed right after it is sent.
#ifndef APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE
#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1
#endif
// </h>
//==========================================================
// <h> nrf_cli - Command line interface
//==========================================================
// <q> NRF_CLI_ENABLED - Enable/disable the CLI module.
#ifndef NRF_CLI_ENABLED
#define NRF_CLI_ENABLED 0
#endif
// <o> NRF_CLI_ARGC_MAX - Maximum number of parameters passed to the command handler.
#ifndef NRF_CLI_ARGC_MAX
#define NRF_CLI_ARGC_MAX 12
#endif
// <q> NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI built-in commands.
#ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED
#define NRF_CLI_BUILD_IN_CMDS_ENABLED 1
#endif
// <o> NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for a single command.
#ifndef NRF_CLI_CMD_BUFF_SIZE
#define NRF_CLI_CMD_BUFF_SIZE 128
#endif
// <q> NRF_CLI_ECHO_STATUS - CLI echo status. If set, echo is ON.
#ifndef NRF_CLI_ECHO_STATUS
#define NRF_CLI_ECHO_STATUS 1
#endif
// <q> NRF_CLI_WILDCARD_ENABLED - Enable wildcard functionality for CLI commands.
#ifndef NRF_CLI_WILDCARD_ENABLED
#define NRF_CLI_WILDCARD_ENABLED 0
#endif
// <q> NRF_CLI_METAKEYS_ENABLED - Enable additional control keys for CLI commands like ctrl+a, ctrl+e, ctrl+w, ctrl+u
#ifndef NRF_CLI_METAKEYS_ENABLED
#define NRF_CLI_METAKEYS_ENABLED 0
#endif
// <o> NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size.
#ifndef NRF_CLI_PRINTF_BUFF_SIZE
#define NRF_CLI_PRINTF_BUFF_SIZE 23
#endif
// <e> NRF_CLI_HISTORY_ENABLED - Enable CLI history mode.
//==========================================================
#ifndef NRF_CLI_HISTORY_ENABLED
#define NRF_CLI_HISTORY_ENABLED 1
#endif
// <o> NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history.
#ifndef NRF_CLI_HISTORY_ELEMENT_SIZE
#define NRF_CLI_HISTORY_ELEMENT_SIZE 32
#endif
// <o> NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects.
#ifndef NRF_CLI_HISTORY_ELEMENT_COUNT
#define NRF_CLI_HISTORY_ELEMENT_COUNT 8
#endif
// </e>
// <q> NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors.
#ifndef NRF_CLI_VT100_COLORS_ENABLED
#define NRF_CLI_VT100_COLORS_ENABLED 1
#endif
// <q> NRF_CLI_STATISTICS_ENABLED - Enable CLI statistics.
#ifndef NRF_CLI_STATISTICS_ENABLED
#define NRF_CLI_STATISTICS_ENABLED 1
#endif
// <q> NRF_CLI_LOG_BACKEND - Enable logger backend interface.
#ifndef NRF_CLI_LOG_BACKEND
#define NRF_CLI_LOG_BACKEND 1
#endif
// <q> NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager
#ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED
#define NRF_CLI_USES_TASK_MANAGER_ENABLED 0
#endif
// </h>
//==========================================================
// <h> nrf_fprintf - fprintf function.
//==========================================================
// <q> NRF_FPRINTF_ENABLED - Enable/disable fprintf module.
#ifndef NRF_FPRINTF_ENABLED
#define NRF_FPRINTF_ENABLED 1
#endif
// <q> NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED - For each printed LF, function will add CR.
#ifndef NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED
#define NRF_FPRINTF_FLAG_AUTOMATIC_CR_ON_LF_ENABLED 1
#endif
// <q> NRF_FPRINTF_DOUBLE_ENABLED - Enable IEEE-754 double precision formatting.
#ifndef NRF_FPRINTF_DOUBLE_ENABLED
#define NRF_FPRINTF_DOUBLE_ENABLED 0
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// <h> nRF_Log
//==========================================================
// <e> NRF_LOG_BACKEND_UART_ENABLED - nrf_log_backend_uart - Log UART backend
//==========================================================
#ifndef NRF_LOG_BACKEND_UART_ENABLED
#define NRF_LOG_BACKEND_UART_ENABLED 1
#endif
// <o> NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin
#ifndef NRF_LOG_BACKEND_UART_TX_PIN
#define NRF_LOG_BACKEND_UART_TX_PIN 6
#endif
// <o> NRF_LOG_BACKEND_UART_BAUDRATE - Default Baudrate
// <323584=> 1200 baud
// <643072=> 2400 baud
// <1290240=> 4800 baud
// <2576384=> 9600 baud
// <3862528=> 14400 baud
// <5152768=> 19200 baud
// <7716864=> 28800 baud
// <10289152=> 38400 baud
// <15400960=> 57600 baud
// <20615168=> 76800 baud
// <30801920=> 115200 baud
// <61865984=> 230400 baud
// <67108864=> 250000 baud
// <121634816=> 460800 baud
// <251658240=> 921600 baud
// <268435456=> 1000000 baud
#ifndef NRF_LOG_BACKEND_UART_BAUDRATE
#define NRF_LOG_BACKEND_UART_BAUDRATE 268435456
#endif
// <o> NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings.
// <i> Size of the buffer is a trade-off between RAM usage and processing.
// <i> if buffer is smaller then strings will often be fragmented.
// <i> It is recommended to use size which will fit typical log and only the
// <i> longer one will be fragmented.
#ifndef NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE
#define NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE 64
#endif
// </e>
// <e> NRF_LOG_ENABLED - nrf_log - Logger
//==========================================================
#ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 1
#endif
// <h> Log message pool - Configuration of log message pool
//==========================================================
// <o> NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects.
// <i> If a small value is set, then performance of logs processing
// <i> is degraded because data is fragmented. Bigger value impacts
// <i> RAM memory utilization. The size is set to fit a message with
// <i> a timestamp and up to 2 arguments in a single memory object.
#ifndef NRF_LOG_MSGPOOL_ELEMENT_SIZE
#define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20
#endif
// <o> NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects
// <i> If a small value is set, then it may lead to a deadlock
// <i> in certain cases if backend has high latency and holds
// <i> multiple messages for long time. Bigger value impacts
// <i> RAM memory usage.
#ifndef NRF_LOG_MSGPOOL_ELEMENT_COUNT
#define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8
#endif
// </h>
//==========================================================
// <q> NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full.
// <i> If set then oldest logs are overwritten. Otherwise a
// <i> marker is injected informing about overflow.
#ifndef NRF_LOG_ALLOW_OVERFLOW
#define NRF_LOG_ALLOW_OVERFLOW 1
#endif
// <o> NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes).
// <i> Must be power of 2 and multiple of 4.
// <i> If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum.
// <128=> 128
// <256=> 256
// <512=> 512
// <1024=> 1024
// <2048=> 2048
// <4096=> 4096
// <8192=> 8192
// <16384=> 16384
#ifndef NRF_LOG_BUFSIZE
#define NRF_LOG_BUFSIZE 1024
#endif
// <q> NRF_LOG_CLI_CMDS - Enable CLI commands for the module.
#ifndef NRF_LOG_CLI_CMDS
#define NRF_LOG_CLI_CMDS 0
#endif
// <o> NRF_LOG_DEFAULT_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_LOG_DEFAULT_LEVEL
#define NRF_LOG_DEFAULT_LEVEL 3
#endif
// <q> NRF_LOG_DEFERRED - Enable deffered logger.
// <i> Log data is buffered and can be processed in idle.
#ifndef NRF_LOG_DEFERRED
#define NRF_LOG_DEFERRED 1
#endif
// <q> NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs.
#ifndef NRF_LOG_FILTERS_ENABLED
#define NRF_LOG_FILTERS_ENABLED 1
#endif
// <q> NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED - Enable use of critical region for non deffered mode when flushing logs.
// <i> When enabled NRF_LOG_FLUSH is called from critical section when non deffered mode is used.
// <i> Log output will never be corrupted as access to the log backend is exclusive
// <i> but system will spend significant amount of time in critical section
#ifndef NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED
#define NRF_LOG_NON_DEFFERED_CRITICAL_REGION_ENABLED 0
#endif
// <o> NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH.
// <16=> 16
// <32=> 32
// <64=> 64
// <128=> 128
// <256=> 256
// <512=> 512
// <1024=> 1024
#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE
#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128
#endif
// <o> NRF_LOG_STR_PUSH_BUFFER_SIZE - Size of the buffer dedicated for strings stored using @ref NRF_LOG_PUSH.
// <16=> 16
// <32=> 32
// <64=> 64
// <128=> 128
// <256=> 256
// <512=> 512
// <1024=> 1024
#ifndef NRF_LOG_STR_PUSH_BUFFER_SIZE
#define NRF_LOG_STR_PUSH_BUFFER_SIZE 128
#endif
// <e> NRF_LOG_USES_COLORS - If enabled then ANSI escape code for colors is prefixed to every string
//==========================================================
#ifndef NRF_LOG_USES_COLORS
#define NRF_LOG_USES_COLORS 0
#endif
// <o> NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_LOG_COLOR_DEFAULT
#define NRF_LOG_COLOR_DEFAULT 0
#endif
// <o> NRF_LOG_ERROR_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_LOG_ERROR_COLOR
#define NRF_LOG_ERROR_COLOR 2
#endif
// <o> NRF_LOG_WARNING_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_LOG_WARNING_COLOR
#define NRF_LOG_WARNING_COLOR 4
#endif
// </e>
// <e> NRF_LOG_USES_TIMESTAMP - Enable timestamping
// <i> Function for getting the timestamp is provided by the user
//==========================================================
#ifndef NRF_LOG_USES_TIMESTAMP
#define NRF_LOG_USES_TIMESTAMP 0
#endif
// <o> NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY - Default frequency of the timestamp (in Hz) or 0 to use app_timer frequency.
#ifndef NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY
#define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0
#endif
// </e>
// <h> nrf_log module configuration
//==========================================================
// <h> nrf_log in nRF_Core
//==========================================================
// <e> NRF_MPU_LIB_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_MPU_LIB_CONFIG_LOG_ENABLED
#define NRF_MPU_LIB_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_MPU_LIB_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_MPU_LIB_CONFIG_LOG_LEVEL
#define NRF_MPU_LIB_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_MPU_LIB_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_MPU_LIB_CONFIG_INFO_COLOR
#define NRF_MPU_LIB_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_MPU_LIB_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_MPU_LIB_CONFIG_DEBUG_COLOR
#define NRF_MPU_LIB_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_STACK_GUARD_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_STACK_GUARD_CONFIG_LOG_ENABLED
#define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL
#define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR
#define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR
#define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> TASK_MANAGER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef TASK_MANAGER_CONFIG_LOG_ENABLED
#define TASK_MANAGER_CONFIG_LOG_ENABLED 0
#endif
// <o> TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef TASK_MANAGER_CONFIG_LOG_LEVEL
#define TASK_MANAGER_CONFIG_LOG_LEVEL 3
#endif
// <o> TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TASK_MANAGER_CONFIG_INFO_COLOR
#define TASK_MANAGER_CONFIG_INFO_COLOR 0
#endif
// <o> TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR
#define TASK_MANAGER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </h>
//==========================================================
// <h> nrf_log in nRF_Drivers
//==========================================================
// <e> CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef CLOCK_CONFIG_LOG_ENABLED
#define CLOCK_CONFIG_LOG_ENABLED 0
#endif
// <o> CLOCK_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef CLOCK_CONFIG_LOG_LEVEL
#define CLOCK_CONFIG_LOG_LEVEL 3
#endif
// <o> CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef CLOCK_CONFIG_INFO_COLOR
#define CLOCK_CONFIG_INFO_COLOR 0
#endif
// <o> CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef CLOCK_CONFIG_DEBUG_COLOR
#define CLOCK_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> COMP_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef COMP_CONFIG_LOG_ENABLED
#define COMP_CONFIG_LOG_ENABLED 0
#endif
// <o> COMP_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef COMP_CONFIG_LOG_LEVEL
#define COMP_CONFIG_LOG_LEVEL 3
#endif
// <o> COMP_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef COMP_CONFIG_INFO_COLOR
#define COMP_CONFIG_INFO_COLOR 0
#endif
// <o> COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef COMP_CONFIG_DEBUG_COLOR
#define COMP_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> GPIOTE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef GPIOTE_CONFIG_LOG_ENABLED
#define GPIOTE_CONFIG_LOG_ENABLED 0
#endif
// <o> GPIOTE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef GPIOTE_CONFIG_LOG_LEVEL
#define GPIOTE_CONFIG_LOG_LEVEL 3
#endif
// <o> GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef GPIOTE_CONFIG_INFO_COLOR
#define GPIOTE_CONFIG_INFO_COLOR 0
#endif
// <o> GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef GPIOTE_CONFIG_DEBUG_COLOR
#define GPIOTE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> LPCOMP_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef LPCOMP_CONFIG_LOG_ENABLED
#define LPCOMP_CONFIG_LOG_ENABLED 0
#endif
// <o> LPCOMP_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef LPCOMP_CONFIG_LOG_LEVEL
#define LPCOMP_CONFIG_LOG_LEVEL 3
#endif
// <o> LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef LPCOMP_CONFIG_INFO_COLOR
#define LPCOMP_CONFIG_INFO_COLOR 0
#endif
// <o> LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef LPCOMP_CONFIG_DEBUG_COLOR
#define LPCOMP_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> MAX3421E_HOST_CONFIG_LOG_ENABLED - Enable logging in the module
//==========================================================
#ifndef MAX3421E_HOST_CONFIG_LOG_ENABLED
#define MAX3421E_HOST_CONFIG_LOG_ENABLED 0
#endif
// <o> MAX3421E_HOST_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef MAX3421E_HOST_CONFIG_LOG_LEVEL
#define MAX3421E_HOST_CONFIG_LOG_LEVEL 3
#endif
// <o> MAX3421E_HOST_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef MAX3421E_HOST_CONFIG_INFO_COLOR
#define MAX3421E_HOST_CONFIG_INFO_COLOR 0
#endif
// <o> MAX3421E_HOST_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef MAX3421E_HOST_CONFIG_DEBUG_COLOR
#define MAX3421E_HOST_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRFX_USBD_CONFIG_LOG_ENABLED - Enable logging in the module
//==========================================================
#ifndef NRFX_USBD_CONFIG_LOG_ENABLED
#define NRFX_USBD_CONFIG_LOG_ENABLED 0
#endif
// <o> NRFX_USBD_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRFX_USBD_CONFIG_LOG_LEVEL
#define NRFX_USBD_CONFIG_LOG_LEVEL 3
#endif
// <o> NRFX_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_USBD_CONFIG_INFO_COLOR
#define NRFX_USBD_CONFIG_INFO_COLOR 0
#endif
// <o> NRFX_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRFX_USBD_CONFIG_DEBUG_COLOR
#define NRFX_USBD_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> PDM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef PDM_CONFIG_LOG_ENABLED
#define PDM_CONFIG_LOG_ENABLED 0
#endif
// <o> PDM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef PDM_CONFIG_LOG_LEVEL
#define PDM_CONFIG_LOG_LEVEL 3
#endif
// <o> PDM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PDM_CONFIG_INFO_COLOR
#define PDM_CONFIG_INFO_COLOR 0
#endif
// <o> PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PDM_CONFIG_DEBUG_COLOR
#define PDM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> PPI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef PPI_CONFIG_LOG_ENABLED
#define PPI_CONFIG_LOG_ENABLED 0
#endif
// <o> PPI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef PPI_CONFIG_LOG_LEVEL
#define PPI_CONFIG_LOG_LEVEL 3
#endif
// <o> PPI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PPI_CONFIG_INFO_COLOR
#define PPI_CONFIG_INFO_COLOR 0
#endif
// <o> PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PPI_CONFIG_DEBUG_COLOR
#define PPI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> PWM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef PWM_CONFIG_LOG_ENABLED
#define PWM_CONFIG_LOG_ENABLED 0
#endif
// <o> PWM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef PWM_CONFIG_LOG_LEVEL
#define PWM_CONFIG_LOG_LEVEL 3
#endif
// <o> PWM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PWM_CONFIG_INFO_COLOR
#define PWM_CONFIG_INFO_COLOR 0
#endif
// <o> PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PWM_CONFIG_DEBUG_COLOR
#define PWM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> QDEC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef QDEC_CONFIG_LOG_ENABLED
#define QDEC_CONFIG_LOG_ENABLED 0
#endif
// <o> QDEC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef QDEC_CONFIG_LOG_LEVEL
#define QDEC_CONFIG_LOG_LEVEL 3
#endif
// <o> QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef QDEC_CONFIG_INFO_COLOR
#define QDEC_CONFIG_INFO_COLOR 0
#endif
// <o> QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef QDEC_CONFIG_DEBUG_COLOR
#define QDEC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> RNG_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef RNG_CONFIG_LOG_ENABLED
#define RNG_CONFIG_LOG_ENABLED 0
#endif
// <o> RNG_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef RNG_CONFIG_LOG_LEVEL
#define RNG_CONFIG_LOG_LEVEL 3
#endif
// <o> RNG_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef RNG_CONFIG_INFO_COLOR
#define RNG_CONFIG_INFO_COLOR 0
#endif
// <o> RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef RNG_CONFIG_DEBUG_COLOR
#define RNG_CONFIG_DEBUG_COLOR 0
#endif
// <q> RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers.
#ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED
#define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0
#endif
// </e>
// <e> RTC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef RTC_CONFIG_LOG_ENABLED
#define RTC_CONFIG_LOG_ENABLED 0
#endif
// <o> RTC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef RTC_CONFIG_LOG_LEVEL
#define RTC_CONFIG_LOG_LEVEL 3
#endif
// <o> RTC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef RTC_CONFIG_INFO_COLOR
#define RTC_CONFIG_INFO_COLOR 0
#endif
// <o> RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef RTC_CONFIG_DEBUG_COLOR
#define RTC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> SAADC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef SAADC_CONFIG_LOG_ENABLED
#define SAADC_CONFIG_LOG_ENABLED 0
#endif
// <o> SAADC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef SAADC_CONFIG_LOG_LEVEL
#define SAADC_CONFIG_LOG_LEVEL 3
#endif
// <o> SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SAADC_CONFIG_INFO_COLOR
#define SAADC_CONFIG_INFO_COLOR 0
#endif
// <o> SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SAADC_CONFIG_DEBUG_COLOR
#define SAADC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> SPIS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef SPIS_CONFIG_LOG_ENABLED
#define SPIS_CONFIG_LOG_ENABLED 0
#endif
// <o> SPIS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef SPIS_CONFIG_LOG_LEVEL
#define SPIS_CONFIG_LOG_LEVEL 3
#endif
// <o> SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SPIS_CONFIG_INFO_COLOR
#define SPIS_CONFIG_INFO_COLOR 0
#endif
// <o> SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SPIS_CONFIG_DEBUG_COLOR
#define SPIS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> SPI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef SPI_CONFIG_LOG_ENABLED
#define SPI_CONFIG_LOG_ENABLED 0
#endif
// <o> SPI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef SPI_CONFIG_LOG_LEVEL
#define SPI_CONFIG_LOG_LEVEL 3
#endif
// <o> SPI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SPI_CONFIG_INFO_COLOR
#define SPI_CONFIG_INFO_COLOR 0
#endif
// <o> SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SPI_CONFIG_DEBUG_COLOR
#define SPI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> TIMER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef TIMER_CONFIG_LOG_ENABLED
#define TIMER_CONFIG_LOG_ENABLED 0
#endif
// <o> TIMER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef TIMER_CONFIG_LOG_LEVEL
#define TIMER_CONFIG_LOG_LEVEL 3
#endif
// <o> TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TIMER_CONFIG_INFO_COLOR
#define TIMER_CONFIG_INFO_COLOR 0
#endif
// <o> TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TIMER_CONFIG_DEBUG_COLOR
#define TIMER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> TWIS_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef TWIS_CONFIG_LOG_ENABLED
#define TWIS_CONFIG_LOG_ENABLED 0
#endif
// <o> TWIS_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef TWIS_CONFIG_LOG_LEVEL
#define TWIS_CONFIG_LOG_LEVEL 3
#endif
// <o> TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TWIS_CONFIG_INFO_COLOR
#define TWIS_CONFIG_INFO_COLOR 0
#endif
// <o> TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TWIS_CONFIG_DEBUG_COLOR
#define TWIS_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> TWI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef TWI_CONFIG_LOG_ENABLED
#define TWI_CONFIG_LOG_ENABLED 0
#endif
// <o> TWI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef TWI_CONFIG_LOG_LEVEL
#define TWI_CONFIG_LOG_LEVEL 3
#endif
// <o> TWI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TWI_CONFIG_INFO_COLOR
#define TWI_CONFIG_INFO_COLOR 0
#endif
// <o> TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef TWI_CONFIG_DEBUG_COLOR
#define TWI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> UART_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef UART_CONFIG_LOG_ENABLED
#define UART_CONFIG_LOG_ENABLED 0
#endif
// <o> UART_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef UART_CONFIG_LOG_LEVEL
#define UART_CONFIG_LOG_LEVEL 3
#endif
// <o> UART_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef UART_CONFIG_INFO_COLOR
#define UART_CONFIG_INFO_COLOR 0
#endif
// <o> UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef UART_CONFIG_DEBUG_COLOR
#define UART_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> USBD_CONFIG_LOG_ENABLED - Enable logging in the module
//==========================================================
#ifndef USBD_CONFIG_LOG_ENABLED
#define USBD_CONFIG_LOG_ENABLED 0
#endif
// <o> USBD_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef USBD_CONFIG_LOG_LEVEL
#define USBD_CONFIG_LOG_LEVEL 3
#endif
// <o> USBD_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef USBD_CONFIG_INFO_COLOR
#define USBD_CONFIG_INFO_COLOR 0
#endif
// <o> USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef USBD_CONFIG_DEBUG_COLOR
#define USBD_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> WDT_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef WDT_CONFIG_LOG_ENABLED
#define WDT_CONFIG_LOG_ENABLED 0
#endif
// <o> WDT_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef WDT_CONFIG_LOG_LEVEL
#define WDT_CONFIG_LOG_LEVEL 3
#endif
// <o> WDT_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef WDT_CONFIG_INFO_COLOR
#define WDT_CONFIG_INFO_COLOR 0
#endif
// <o> WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef WDT_CONFIG_DEBUG_COLOR
#define WDT_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </h>
//==========================================================
// <h> nrf_log in nRF_Libraries
//==========================================================
// <e> APP_BUTTON_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_BUTTON_CONFIG_LOG_ENABLED
#define APP_BUTTON_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_BUTTON_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_BUTTON_CONFIG_LOG_LEVEL
#define APP_BUTTON_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled.
// <i> If module generates a lot of logs, initial log level can
// <i> be decreased to prevent flooding. Severity level can be
// <i> increased on instance basis.
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL
#define APP_BUTTON_CONFIG_INITIAL_LOG_LEVEL 3
#endif
// <o> APP_BUTTON_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_BUTTON_CONFIG_INFO_COLOR
#define APP_BUTTON_CONFIG_INFO_COLOR 0
#endif
// <o> APP_BUTTON_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_BUTTON_CONFIG_DEBUG_COLOR
#define APP_BUTTON_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_TIMER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_TIMER_CONFIG_LOG_ENABLED
#define APP_TIMER_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_TIMER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_TIMER_CONFIG_LOG_LEVEL
#define APP_TIMER_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_TIMER_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled.
// <i> If module generates a lot of logs, initial log level can
// <i> be decreased to prevent flooding. Severity level can be
// <i> increased on instance basis.
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_TIMER_CONFIG_INITIAL_LOG_LEVEL
#define APP_TIMER_CONFIG_INITIAL_LOG_LEVEL 3
#endif
// <o> APP_TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_TIMER_CONFIG_INFO_COLOR
#define APP_TIMER_CONFIG_INFO_COLOR 0
#endif
// <o> APP_TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_TIMER_CONFIG_DEBUG_COLOR
#define APP_TIMER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED
#define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL
#define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR
#define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0
#endif
// <o> APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR
#define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_USBD_CONFIG_LOG_ENABLED - Enable logging in the module.
//==========================================================
#ifndef APP_USBD_CONFIG_LOG_ENABLED
#define APP_USBD_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_USBD_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_USBD_CONFIG_LOG_LEVEL
#define APP_USBD_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_CONFIG_INFO_COLOR
#define APP_USBD_CONFIG_INFO_COLOR 0
#endif
// <o> APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_CONFIG_DEBUG_COLOR
#define APP_USBD_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_USBD_DUMMY_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_USBD_DUMMY_CONFIG_LOG_ENABLED
#define APP_USBD_DUMMY_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_USBD_DUMMY_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_USBD_DUMMY_CONFIG_LOG_LEVEL
#define APP_USBD_DUMMY_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_USBD_DUMMY_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_DUMMY_CONFIG_INFO_COLOR
#define APP_USBD_DUMMY_CONFIG_INFO_COLOR 0
#endif
// <o> APP_USBD_DUMMY_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_DUMMY_CONFIG_DEBUG_COLOR
#define APP_USBD_DUMMY_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_USBD_MSC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_USBD_MSC_CONFIG_LOG_ENABLED
#define APP_USBD_MSC_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL
#define APP_USBD_MSC_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_MSC_CONFIG_INFO_COLOR
#define APP_USBD_MSC_CONFIG_INFO_COLOR 0
#endif
// <o> APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR
#define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED
#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_ENABLED 0
#endif
// <o> APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL
#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_LOG_LEVEL 3
#endif
// <o> APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR
#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_INFO_COLOR 0
#endif
// <o> APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR
#define APP_USBD_NRF_DFU_TRIGGER_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_ATFIFO_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_ATFIFO_CONFIG_LOG_ENABLED
#define NRF_ATFIFO_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_ATFIFO_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_ATFIFO_CONFIG_LOG_LEVEL
#define NRF_ATFIFO_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL
#define NRF_ATFIFO_CONFIG_LOG_INIT_FILTER_LEVEL 3
#endif
// <o> NRF_ATFIFO_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_ATFIFO_CONFIG_INFO_COLOR
#define NRF_ATFIFO_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_ATFIFO_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_ATFIFO_CONFIG_DEBUG_COLOR
#define NRF_ATFIFO_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_BALLOC_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_BALLOC_CONFIG_LOG_ENABLED
#define NRF_BALLOC_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BALLOC_CONFIG_LOG_LEVEL
#define NRF_BALLOC_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL - Initial severity level if dynamic filtering is enabled.
// <i> If module generates a lot of logs, initial log level can
// <i> be decreased to prevent flooding. Severity level can be
// <i> increased on instance basis.
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL
#define NRF_BALLOC_CONFIG_INITIAL_LOG_LEVEL 3
#endif
// <o> NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BALLOC_CONFIG_INFO_COLOR
#define NRF_BALLOC_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR
#define NRF_BALLOC_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED
#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL
#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL
#define NRF_BLOCK_DEV_EMPTY_CONFIG_LOG_INIT_FILTER_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR
#define NRF_BLOCK_DEV_EMPTY_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR
#define NRF_BLOCK_DEV_EMPTY_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED
#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL
#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL
#define NRF_BLOCK_DEV_QSPI_CONFIG_LOG_INIT_FILTER_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR
#define NRF_BLOCK_DEV_QSPI_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR
#define NRF_BLOCK_DEV_QSPI_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED
#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL
#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL
#define NRF_BLOCK_DEV_RAM_CONFIG_LOG_INIT_FILTER_LEVEL 3
#endif
// <o> NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR
#define NRF_BLOCK_DEV_RAM_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR
#define NRF_BLOCK_DEV_RAM_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED
#define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL
#define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR
#define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR
#define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED
#define NRF_CLI_LIBUARTE_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL
#define NRF_CLI_LIBUARTE_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR
#define NRF_CLI_LIBUARTE_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR
#define NRF_CLI_LIBUARTE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_CLI_UART_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_CLI_UART_CONFIG_LOG_ENABLED
#define NRF_CLI_UART_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL
#define NRF_CLI_UART_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_UART_CONFIG_INFO_COLOR
#define NRF_CLI_UART_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR
#define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_LIBUARTE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_LIBUARTE_CONFIG_LOG_ENABLED
#define NRF_LIBUARTE_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_LIBUARTE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_LIBUARTE_CONFIG_LOG_LEVEL
#define NRF_LIBUARTE_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_LIBUARTE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_LIBUARTE_CONFIG_INFO_COLOR
#define NRF_LIBUARTE_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_LIBUARTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_LIBUARTE_CONFIG_DEBUG_COLOR
#define NRF_LIBUARTE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_MEMOBJ_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_MEMOBJ_CONFIG_LOG_ENABLED
#define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL
#define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR
#define NRF_MEMOBJ_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR
#define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_PWR_MGMT_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_PWR_MGMT_CONFIG_LOG_ENABLED
#define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL
#define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR
#define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR
#define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_QUEUE_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_QUEUE_CONFIG_LOG_ENABLED
#define NRF_QUEUE_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_QUEUE_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_QUEUE_CONFIG_LOG_LEVEL
#define NRF_QUEUE_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL - Initial severity level if dynamic filtering is enabled
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL
#define NRF_QUEUE_CONFIG_LOG_INIT_FILTER_LEVEL 3
#endif
// <o> NRF_QUEUE_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_QUEUE_CONFIG_INFO_COLOR
#define NRF_QUEUE_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_QUEUE_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_QUEUE_CONFIG_DEBUG_COLOR
#define NRF_QUEUE_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_SDH_ANT_LOG_ENABLED - Enable logging in SoftDevice handler (ANT) module.
//==========================================================
#ifndef NRF_SDH_ANT_LOG_ENABLED
#define NRF_SDH_ANT_LOG_ENABLED 0
#endif
// <o> NRF_SDH_ANT_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_SDH_ANT_LOG_LEVEL
#define NRF_SDH_ANT_LOG_LEVEL 3
#endif
// <o> NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_ANT_INFO_COLOR
#define NRF_SDH_ANT_INFO_COLOR 0
#endif
// <o> NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_ANT_DEBUG_COLOR
#define NRF_SDH_ANT_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_SDH_BLE_LOG_ENABLED - Enable logging in SoftDevice handler (BLE) module.
//==========================================================
#ifndef NRF_SDH_BLE_LOG_ENABLED
#define NRF_SDH_BLE_LOG_ENABLED 1
#endif
// <o> NRF_SDH_BLE_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_SDH_BLE_LOG_LEVEL
#define NRF_SDH_BLE_LOG_LEVEL 3
#endif
// <o> NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_BLE_INFO_COLOR
#define NRF_SDH_BLE_INFO_COLOR 0
#endif
// <o> NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_BLE_DEBUG_COLOR
#define NRF_SDH_BLE_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_SDH_LOG_ENABLED - Enable logging in SoftDevice handler module.
//==========================================================
#ifndef NRF_SDH_LOG_ENABLED
#define NRF_SDH_LOG_ENABLED 1
#endif
// <o> NRF_SDH_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_SDH_LOG_LEVEL
#define NRF_SDH_LOG_LEVEL 3
#endif
// <o> NRF_SDH_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_INFO_COLOR
#define NRF_SDH_INFO_COLOR 0
#endif
// <o> NRF_SDH_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_DEBUG_COLOR
#define NRF_SDH_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_SDH_SOC_LOG_ENABLED - Enable logging in SoftDevice handler (SoC) module.
//==========================================================
#ifndef NRF_SDH_SOC_LOG_ENABLED
#define NRF_SDH_SOC_LOG_ENABLED 1
#endif
// <o> NRF_SDH_SOC_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_SDH_SOC_LOG_LEVEL
#define NRF_SDH_SOC_LOG_LEVEL 3
#endif
// <o> NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_SOC_INFO_COLOR
#define NRF_SDH_SOC_INFO_COLOR 0
#endif
// <o> NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SDH_SOC_DEBUG_COLOR
#define NRF_SDH_SOC_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_SORTLIST_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_SORTLIST_CONFIG_LOG_ENABLED
#define NRF_SORTLIST_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_SORTLIST_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_SORTLIST_CONFIG_LOG_LEVEL
#define NRF_SORTLIST_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_SORTLIST_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SORTLIST_CONFIG_INFO_COLOR
#define NRF_SORTLIST_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_SORTLIST_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_SORTLIST_CONFIG_DEBUG_COLOR
#define NRF_SORTLIST_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> NRF_TWI_SENSOR_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NRF_TWI_SENSOR_CONFIG_LOG_ENABLED
#define NRF_TWI_SENSOR_CONFIG_LOG_ENABLED 0
#endif
// <o> NRF_TWI_SENSOR_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NRF_TWI_SENSOR_CONFIG_LOG_LEVEL
#define NRF_TWI_SENSOR_CONFIG_LOG_LEVEL 3
#endif
// <o> NRF_TWI_SENSOR_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_TWI_SENSOR_CONFIG_INFO_COLOR
#define NRF_TWI_SENSOR_CONFIG_INFO_COLOR 0
#endif
// <o> NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR
#define NRF_TWI_SENSOR_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// <e> PM_LOG_ENABLED - Enable logging in Peer Manager and its submodules.
//==========================================================
#ifndef PM_LOG_ENABLED
#define PM_LOG_ENABLED 1
#endif
// <o> PM_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef PM_LOG_LEVEL
#define PM_LOG_LEVEL 3
#endif
// <o> PM_LOG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PM_LOG_INFO_COLOR
#define PM_LOG_INFO_COLOR 0
#endif
// <o> PM_LOG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef PM_LOG_DEBUG_COLOR
#define PM_LOG_DEBUG_COLOR 0
#endif
// </e>
// </h>
//==========================================================
// <h> nrf_log in nRF_Serialization
//==========================================================
// <e> SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED
#define SER_HAL_TRANSPORT_CONFIG_LOG_ENABLED 0
#endif
// <o> SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL
#define SER_HAL_TRANSPORT_CONFIG_LOG_LEVEL 3
#endif
// <o> SER_HAL_TRANSPORT_CONFIG_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SER_HAL_TRANSPORT_CONFIG_INFO_COLOR
#define SER_HAL_TRANSPORT_CONFIG_INFO_COLOR 0
#endif
// <o> SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR
#define SER_HAL_TRANSPORT_CONFIG_DEBUG_COLOR 0
#endif
// </e>
// </h>
//==========================================================
// </h>
//==========================================================
// </e>
// <q> NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED - nrf_log_str_formatter - Log string formatter
#ifndef NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED
#define NRF_LOG_STR_FORMATTER_TIMESTAMP_FORMAT_ENABLED 1
#endif
// </h>
//==========================================================
// <h> nRF_NFC
//==========================================================
// <q> NFC_AC_REC_ENABLED - nfc_ac_rec - NFC NDEF Alternative Carrier record encoder
#ifndef NFC_AC_REC_ENABLED
#define NFC_AC_REC_ENABLED 0
#endif
// <q> NFC_AC_REC_PARSER_ENABLED - nfc_ac_rec_parser - Alternative Carrier record parser
#ifndef NFC_AC_REC_PARSER_ENABLED
#define NFC_AC_REC_PARSER_ENABLED 0
#endif
// <e> NFC_BLE_OOB_ADVDATA_ENABLED - nfc_ble_oob_advdata - AD data for OOB pairing encoder
//==========================================================
#ifndef NFC_BLE_OOB_ADVDATA_ENABLED
#define NFC_BLE_OOB_ADVDATA_ENABLED 0
#endif
// <o> ADVANCED_ADVDATA_SUPPORT - Non-mandatory AD types for BLE OOB pairing are encoded inside the NDEF message (e.g. service UUIDs)
// <1=> Enabled
// <0=> Disabled
#ifndef ADVANCED_ADVDATA_SUPPORT
#define ADVANCED_ADVDATA_SUPPORT 0
#endif
// </e>
// <q> NFC_BLE_OOB_ADVDATA_PARSER_ENABLED - nfc_ble_oob_advdata_parser - BLE OOB pairing AD data parser
#ifndef NFC_BLE_OOB_ADVDATA_PARSER_ENABLED
#define NFC_BLE_OOB_ADVDATA_PARSER_ENABLED 0
#endif
// <e> NFC_BLE_PAIR_LIB_ENABLED - nfc_ble_pair_lib - Library parameters
//==========================================================
#ifndef NFC_BLE_PAIR_LIB_ENABLED
#define NFC_BLE_PAIR_LIB_ENABLED 0
#endif
// <e> NFC_BLE_PAIR_LIB_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_BLE_PAIR_LIB_LOG_ENABLED
#define NFC_BLE_PAIR_LIB_LOG_ENABLED 0
#endif
// <o> NFC_BLE_PAIR_LIB_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_BLE_PAIR_LIB_LOG_LEVEL
#define NFC_BLE_PAIR_LIB_LOG_LEVEL 3
#endif
// <o> NFC_BLE_PAIR_LIB_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_BLE_PAIR_LIB_INFO_COLOR
#define NFC_BLE_PAIR_LIB_INFO_COLOR 0
#endif
// <o> NFC_BLE_PAIR_LIB_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_BLE_PAIR_LIB_DEBUG_COLOR
#define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0
#endif
// </e>
// <h> NFC_BLE_PAIR_LIB_SECURITY_PARAMETERS - Common Peer Manager security parameters.
//==========================================================
// <e> BLE_NFC_SEC_PARAM_BOND - Enables device bonding.
// <i> If bonding is enabled at least one of the BLE_NFC_SEC_PARAM_KDIST options must be enabled.
//==========================================================
#ifndef BLE_NFC_SEC_PARAM_BOND
#define BLE_NFC_SEC_PARAM_BOND 1
#endif
// <q> BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device.
#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC
#define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1
#endif
// <q> BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device.
#ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID
#define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1
#endif
// <q> BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer.
#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC
#define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1
#endif
// <q> BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer.
#ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID
#define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1
#endif
// </e>
// <o> BLE_NFC_SEC_PARAM_MIN_KEY_SIZE - Minimal size of a security key.
// <7=> 7
// <8=> 8
// <9=> 9
// <10=> 10
// <11=> 11
// <12=> 12
// <13=> 13
// <14=> 14
// <15=> 15
// <16=> 16
#ifndef BLE_NFC_SEC_PARAM_MIN_KEY_SIZE
#define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7
#endif
// <o> BLE_NFC_SEC_PARAM_MAX_KEY_SIZE - Maximal size of a security key.
// <7=> 7
// <8=> 8
// <9=> 9
// <10=> 10
// <11=> 11
// <12=> 12
// <13=> 13
// <14=> 14
// <15=> 15
// <16=> 16
#ifndef BLE_NFC_SEC_PARAM_MAX_KEY_SIZE
#define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16
#endif
// </h>
//==========================================================
// </e>
// <q> NFC_BLE_PAIR_MSG_ENABLED - nfc_ble_pair_msg - NDEF message for OOB pairing encoder
#ifndef NFC_BLE_PAIR_MSG_ENABLED
#define NFC_BLE_PAIR_MSG_ENABLED 0
#endif
// <q> NFC_CH_COMMON_ENABLED - nfc_ble_pair_common - OOB pairing common data
#ifndef NFC_CH_COMMON_ENABLED
#define NFC_CH_COMMON_ENABLED 0
#endif
// <q> NFC_EP_OOB_REC_ENABLED - nfc_ep_oob_rec - EP record for BLE pairing encoder
#ifndef NFC_EP_OOB_REC_ENABLED
#define NFC_EP_OOB_REC_ENABLED 0
#endif
// <q> NFC_HS_REC_ENABLED - nfc_hs_rec - Handover Select NDEF record encoder
#ifndef NFC_HS_REC_ENABLED
#define NFC_HS_REC_ENABLED 0
#endif
// <q> NFC_LE_OOB_REC_ENABLED - nfc_le_oob_rec - LE record for BLE pairing encoder
#ifndef NFC_LE_OOB_REC_ENABLED
#define NFC_LE_OOB_REC_ENABLED 0
#endif
// <q> NFC_LE_OOB_REC_PARSER_ENABLED - nfc_le_oob_rec_parser - LE record parser
#ifndef NFC_LE_OOB_REC_PARSER_ENABLED
#define NFC_LE_OOB_REC_PARSER_ENABLED 0
#endif
// <q> NFC_NDEF_LAUNCHAPP_MSG_ENABLED - nfc_launchapp_msg - Encoding data for NDEF Application Launching message for NFC Tag
#ifndef NFC_NDEF_LAUNCHAPP_MSG_ENABLED
#define NFC_NDEF_LAUNCHAPP_MSG_ENABLED 0
#endif
// <q> NFC_NDEF_LAUNCHAPP_REC_ENABLED - nfc_launchapp_rec - Encoding data for NDEF Application Launching record for NFC Tag
#ifndef NFC_NDEF_LAUNCHAPP_REC_ENABLED
#define NFC_NDEF_LAUNCHAPP_REC_ENABLED 0
#endif
// <e> NFC_NDEF_MSG_ENABLED - nfc_ndef_msg - NFC NDEF Message generator module
//==========================================================
#ifndef NFC_NDEF_MSG_ENABLED
#define NFC_NDEF_MSG_ENABLED 0
#endif
// <o> NFC_NDEF_MSG_TAG_TYPE - NFC Tag Type
// <2=> Type 2 Tag
// <4=> Type 4 Tag
#ifndef NFC_NDEF_MSG_TAG_TYPE
#define NFC_NDEF_MSG_TAG_TYPE 2
#endif
// </e>
// <e> NFC_NDEF_MSG_PARSER_ENABLED - nfc_ndef_msg_parser - NFC NDEF message parser module
//==========================================================
#ifndef NFC_NDEF_MSG_PARSER_ENABLED
#define NFC_NDEF_MSG_PARSER_ENABLED 0
#endif
// <e> NFC_NDEF_MSG_PARSER_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_NDEF_MSG_PARSER_LOG_ENABLED
#define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0
#endif
// <o> NFC_NDEF_MSG_PARSER_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_NDEF_MSG_PARSER_LOG_LEVEL
#define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3
#endif
// <o> NFC_NDEF_MSG_PARSER_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_NDEF_MSG_PARSER_INFO_COLOR
#define NFC_NDEF_MSG_PARSER_INFO_COLOR 0
#endif
// </e>
// </e>
// <q> NFC_NDEF_RECORD_ENABLED - nfc_ndef_record - NFC NDEF Record generator module
#ifndef NFC_NDEF_RECORD_ENABLED
#define NFC_NDEF_RECORD_ENABLED 0
#endif
// <e> NFC_NDEF_RECORD_PARSER_ENABLED - nfc_ndef_record_parser - NFC NDEF Record parser module
//==========================================================
#ifndef NFC_NDEF_RECORD_PARSER_ENABLED
#define NFC_NDEF_RECORD_PARSER_ENABLED 0
#endif
// <e> NFC_NDEF_RECORD_PARSER_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_NDEF_RECORD_PARSER_LOG_ENABLED
#define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0
#endif
// <o> NFC_NDEF_RECORD_PARSER_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_NDEF_RECORD_PARSER_LOG_LEVEL
#define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3
#endif
// <o> NFC_NDEF_RECORD_PARSER_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_NDEF_RECORD_PARSER_INFO_COLOR
#define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0
#endif
// </e>
// </e>
// <q> NFC_NDEF_TEXT_RECORD_ENABLED - nfc_text_rec - Encoding data for a text record for NFC Tag
#ifndef NFC_NDEF_TEXT_RECORD_ENABLED
#define NFC_NDEF_TEXT_RECORD_ENABLED 0
#endif
// <q> NFC_NDEF_URI_MSG_ENABLED - nfc_uri_msg - Encoding data for NDEF message with URI record for NFC Tag
#ifndef NFC_NDEF_URI_MSG_ENABLED
#define NFC_NDEF_URI_MSG_ENABLED 0
#endif
// <q> NFC_NDEF_URI_REC_ENABLED - nfc_uri_rec - Encoding data for a URI record for NFC Tag
#ifndef NFC_NDEF_URI_REC_ENABLED
#define NFC_NDEF_URI_REC_ENABLED 0
#endif
// <e> NFC_PLATFORM_ENABLED - nfc_platform - NFC platform module for Clock control.
//==========================================================
#ifndef NFC_PLATFORM_ENABLED
#define NFC_PLATFORM_ENABLED 0
#endif
// <e> NFC_PLATFORM_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_PLATFORM_LOG_ENABLED
#define NFC_PLATFORM_LOG_ENABLED 0
#endif
// <o> NFC_PLATFORM_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_PLATFORM_LOG_LEVEL
#define NFC_PLATFORM_LOG_LEVEL 3
#endif
// <o> NFC_PLATFORM_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_PLATFORM_INFO_COLOR
#define NFC_PLATFORM_INFO_COLOR 0
#endif
// <o> NFC_PLATFORM_DEBUG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_PLATFORM_DEBUG_COLOR
#define NFC_PLATFORM_DEBUG_COLOR 0
#endif
// </e>
// </e>
// <e> NFC_T2T_PARSER_ENABLED - nfc_type_2_tag_parser - Parser for decoding Type 2 Tag data
//==========================================================
#ifndef NFC_T2T_PARSER_ENABLED
#define NFC_T2T_PARSER_ENABLED 0
#endif
// <e> NFC_T2T_PARSER_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_T2T_PARSER_LOG_ENABLED
#define NFC_T2T_PARSER_LOG_ENABLED 0
#endif
// <o> NFC_T2T_PARSER_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_T2T_PARSER_LOG_LEVEL
#define NFC_T2T_PARSER_LOG_LEVEL 3
#endif
// <o> NFC_T2T_PARSER_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_T2T_PARSER_INFO_COLOR
#define NFC_T2T_PARSER_INFO_COLOR 0
#endif
// </e>
// </e>
// <e> NFC_T4T_APDU_ENABLED - nfc_t4t_apdu - APDU encoder/decoder for Type 4 Tag
//==========================================================
#ifndef NFC_T4T_APDU_ENABLED
#define NFC_T4T_APDU_ENABLED 0
#endif
// <e> NFC_T4T_APDU_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_T4T_APDU_LOG_ENABLED
#define NFC_T4T_APDU_LOG_ENABLED 0
#endif
// <o> NFC_T4T_APDU_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_T4T_APDU_LOG_LEVEL
#define NFC_T4T_APDU_LOG_LEVEL 3
#endif
// <o> NFC_T4T_APDU_LOG_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_T4T_APDU_LOG_COLOR
#define NFC_T4T_APDU_LOG_COLOR 0
#endif
// </e>
// </e>
// <e> NFC_T4T_CC_FILE_PARSER_ENABLED - nfc_t4t_cc_file - Capability Container file for Type 4 Tag
//==========================================================
#ifndef NFC_T4T_CC_FILE_PARSER_ENABLED
#define NFC_T4T_CC_FILE_PARSER_ENABLED 0
#endif
// <e> NFC_T4T_CC_FILE_PARSER_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_T4T_CC_FILE_PARSER_LOG_ENABLED
#define NFC_T4T_CC_FILE_PARSER_LOG_ENABLED 0
#endif
// <o> NFC_T4T_CC_FILE_PARSER_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_T4T_CC_FILE_PARSER_LOG_LEVEL
#define NFC_T4T_CC_FILE_PARSER_LOG_LEVEL 3
#endif
// <o> NFC_T4T_CC_FILE_PARSER_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_T4T_CC_FILE_PARSER_INFO_COLOR
#define NFC_T4T_CC_FILE_PARSER_INFO_COLOR 0
#endif
// </e>
// </e>
// <e> NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED - nfc_t4t_hl_detection_procedures - NDEF Detection Procedure for Type 4 Tag
//==========================================================
#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED
#define NFC_T4T_HL_DETECTION_PROCEDURES_ENABLED 0
#endif
// <e> NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED
#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_ENABLED 0
#endif
// <o> NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL
#define NFC_T4T_HL_DETECTION_PROCEDURES_LOG_LEVEL 3
#endif
// <o> NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR
#define NFC_T4T_HL_DETECTION_PROCEDURES_INFO_COLOR 0
#endif
// </e>
// <o> APDU_BUFF_SIZE - Size (in bytes) of the buffer for APDU storage
#ifndef APDU_BUFF_SIZE
#define APDU_BUFF_SIZE 250
#endif
// <o> CC_STORAGE_BUFF_SIZE - Size (in bytes) of the buffer for CC file storage
#ifndef CC_STORAGE_BUFF_SIZE
#define CC_STORAGE_BUFF_SIZE 64
#endif
// </e>
// <e> NFC_T4T_TLV_BLOCK_PARSER_ENABLED - nfc_t4t_tlv_block - TLV block for Type 4 Tag
//==========================================================
#ifndef NFC_T4T_TLV_BLOCK_PARSER_ENABLED
#define NFC_T4T_TLV_BLOCK_PARSER_ENABLED 0
#endif
// <e> NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED - Enables logging in the module.
//==========================================================
#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED
#define NFC_T4T_TLV_BLOCK_PARSER_LOG_ENABLED 0
#endif
// <o> NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL - Default Severity level
// <0=> Off
// <1=> Error
// <2=> Warning
// <3=> Info
// <4=> Debug
#ifndef NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL
#define NFC_T4T_TLV_BLOCK_PARSER_LOG_LEVEL 3
#endif
// <o> NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR - ANSI escape code prefix.
// <0=> Default
// <1=> Black
// <2=> Red
// <3=> Green
// <4=> Yellow
// <5=> Blue
// <6=> Magenta
// <7=> Cyan
// <8=> White
#ifndef NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR
#define NFC_T4T_TLV_BLOCK_PARSER_INFO_COLOR 0
#endif
// </e>
// </e>
// </h>
//==========================================================
// <h> nRF_SoftDevice
//==========================================================
// <e> NRF_SDH_BLE_ENABLED - nrf_sdh_ble - SoftDevice BLE event handler
//==========================================================
#ifndef NRF_SDH_BLE_ENABLED
#define NRF_SDH_BLE_ENABLED 1
#endif
// <h> BLE Stack configuration - Stack configuration parameters
// <i> The SoftDevice handler will configure the stack with these parameters when calling @ref nrf_sdh_ble_default_cfg_set.
// <i> Other libraries might depend on these values; keep them up-to-date even if you are not explicitely calling @ref nrf_sdh_ble_default_cfg_set.
//==========================================================
// <o> NRF_SDH_BLE_GAP_DATA_LENGTH <27-251>
// <i> Requested BLE GAP data length to be negotiated.
#ifndef NRF_SDH_BLE_GAP_DATA_LENGTH
#define NRF_SDH_BLE_GAP_DATA_LENGTH 251
#endif
// <o> NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links.
#ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT
#define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
#endif
// <o> NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links.
#ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT
#define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0
#endif
// <o> NRF_SDH_BLE_TOTAL_LINK_COUNT - Total link count.
// <i> Maximum number of total concurrent connections using the default configuration.
#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT
#define NRF_SDH_BLE_TOTAL_LINK_COUNT 1
#endif
// <o> NRF_SDH_BLE_GAP_EVENT_LENGTH - GAP event length.
// <i> The time set aside for this connection on every connection interval in 1.25 ms units.
#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH
#define NRF_SDH_BLE_GAP_EVENT_LENGTH 6
#endif
// <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.
#ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE
#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 247
#endif
// <o> NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4.
#ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE
#define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408
#endif
// <o> NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs.
#ifndef NRF_SDH_BLE_VS_UUID_COUNT
#define NRF_SDH_BLE_VS_UUID_COUNT 1
#endif
// <q> NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table.
#ifndef NRF_SDH_BLE_SERVICE_CHANGED
#define NRF_SDH_BLE_SERVICE_CHANGED 0
#endif
// </h>
//==========================================================
// <h> BLE Observers - Observers and priority levels
//==========================================================
// <o> NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers.
// <i> This setting configures the number of priority levels available for BLE event handlers.
// <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
#ifndef NRF_SDH_BLE_OBSERVER_PRIO_LEVELS
#define NRF_SDH_BLE_OBSERVER_PRIO_LEVELS 4
#endif
// <h> BLE Observers priorities - Invididual priorities
//==========================================================
// <o> BLE_ADV_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Advertising module.
#ifndef BLE_ADV_BLE_OBSERVER_PRIO
#define BLE_ADV_BLE_OBSERVER_PRIO 1
#endif
// <o> BLE_ANCS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Apple Notification Service Client.
#ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO
#define BLE_ANCS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_ANS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Alert Notification Service Client.
#ifndef BLE_ANS_C_BLE_OBSERVER_PRIO
#define BLE_ANS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_BAS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Battery Service.
#ifndef BLE_BAS_BLE_OBSERVER_PRIO
#define BLE_BAS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_BAS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Battery Service Client.
#ifndef BLE_BAS_C_BLE_OBSERVER_PRIO
#define BLE_BAS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_BPS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Blood Pressure Service.
#ifndef BLE_BPS_BLE_OBSERVER_PRIO
#define BLE_BPS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_CONN_PARAMS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Connection parameters module.
#ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO
#define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 1
#endif
// <o> BLE_CONN_STATE_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Connection State module.
#ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO
#define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0
#endif
// <o> BLE_CSCS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service.
#ifndef BLE_CSCS_BLE_OBSERVER_PRIO
#define BLE_CSCS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_CTS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Current Time Service Client.
#ifndef BLE_CTS_C_BLE_OBSERVER_PRIO
#define BLE_CTS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_DB_DISC_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Database Discovery module.
#ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO
#define BLE_DB_DISC_BLE_OBSERVER_PRIO 1
#endif
// <o> BLE_DFU_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the DFU Service.
#ifndef BLE_DFU_BLE_OBSERVER_PRIO
#define BLE_DFU_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_DIS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Device Information Client.
#ifndef BLE_DIS_C_BLE_OBSERVER_PRIO
#define BLE_DIS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_GLS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Glucose Service.
#ifndef BLE_GLS_BLE_OBSERVER_PRIO
#define BLE_GLS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_HIDS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Human Interface Device Service.
#ifndef BLE_HIDS_BLE_OBSERVER_PRIO
#define BLE_HIDS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_HRS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Heart Rate Service.
#ifndef BLE_HRS_BLE_OBSERVER_PRIO
#define BLE_HRS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_HRS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Heart Rate Service Client.
#ifndef BLE_HRS_C_BLE_OBSERVER_PRIO
#define BLE_HRS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_HTS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Health Thermometer Service.
#ifndef BLE_HTS_BLE_OBSERVER_PRIO
#define BLE_HTS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_IAS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Immediate Alert Service.
#ifndef BLE_IAS_BLE_OBSERVER_PRIO
#define BLE_IAS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_IAS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Immediate Alert Service Client.
#ifndef BLE_IAS_C_BLE_OBSERVER_PRIO
#define BLE_IAS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_LBS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the LED Button Service.
#ifndef BLE_LBS_BLE_OBSERVER_PRIO
#define BLE_LBS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_LBS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the LED Button Service Client.
#ifndef BLE_LBS_C_BLE_OBSERVER_PRIO
#define BLE_LBS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_LLS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Link Loss Service.
#ifndef BLE_LLS_BLE_OBSERVER_PRIO
#define BLE_LLS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_LNS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Location Navigation Service.
#ifndef BLE_LNS_BLE_OBSERVER_PRIO
#define BLE_LNS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_NUS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the UART Service.
#ifndef BLE_NUS_BLE_OBSERVER_PRIO
#define BLE_NUS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_NUS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the UART Central Service.
#ifndef BLE_NUS_C_BLE_OBSERVER_PRIO
#define BLE_NUS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_OTS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Object transfer service.
#ifndef BLE_OTS_BLE_OBSERVER_PRIO
#define BLE_OTS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_OTS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Object transfer service client.
#ifndef BLE_OTS_C_BLE_OBSERVER_PRIO
#define BLE_OTS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_RSCS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Running Speed and Cadence Service.
#ifndef BLE_RSCS_BLE_OBSERVER_PRIO
#define BLE_RSCS_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_RSCS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Running Speed and Cadence Client.
#ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO
#define BLE_RSCS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> BLE_TPS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the TX Power Service.
#ifndef BLE_TPS_BLE_OBSERVER_PRIO
#define BLE_TPS_BLE_OBSERVER_PRIO 2
#endif
// <o> BSP_BTN_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Button Control module.
#ifndef BSP_BTN_BLE_OBSERVER_PRIO
#define BSP_BTN_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the NFC pairing library.
#ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO
#define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1
#endif
// <o> NRF_BLE_BMS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Bond Management Service.
#ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO
#define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2
#endif
// <o> NRF_BLE_CGMS_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service.
#ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO
#define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2
#endif
// <o> NRF_BLE_ES_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Eddystone module.
#ifndef NRF_BLE_ES_BLE_OBSERVER_PRIO
#define NRF_BLE_ES_BLE_OBSERVER_PRIO 2
#endif
// <o> NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the GATT Service Client.
#ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO
#define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2
#endif
// <o> NRF_BLE_GATT_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the GATT module.
#ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO
#define NRF_BLE_GATT_BLE_OBSERVER_PRIO 1
#endif
// <o> NRF_BLE_GQ_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the GATT Queue module.
#ifndef NRF_BLE_GQ_BLE_OBSERVER_PRIO
#define NRF_BLE_GQ_BLE_OBSERVER_PRIO 1
#endif
// <o> NRF_BLE_QWR_BLE_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the Queued writes module.
#ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO
#define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2
#endif
// <o> NRF_BLE_SCAN_OBSERVER_PRIO
// <i> Priority for dispatching the BLE events to the Scanning Module.
#ifndef NRF_BLE_SCAN_OBSERVER_PRIO
#define NRF_BLE_SCAN_OBSERVER_PRIO 1
#endif
// <o> PM_BLE_OBSERVER_PRIO - Priority with which BLE events are dispatched to the Peer Manager module.
#ifndef PM_BLE_OBSERVER_PRIO
#define PM_BLE_OBSERVER_PRIO 1
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// </e>
// <e> NRF_SDH_ENABLED - nrf_sdh - SoftDevice handler
//==========================================================
#ifndef NRF_SDH_ENABLED
#define NRF_SDH_ENABLED 1
#endif
// <h> Dispatch model
// <i> This setting configures how Stack events are dispatched to the application.
//==========================================================
// <o> NRF_SDH_DISPATCH_MODEL
// <i> NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context.
// <i> NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler.
// <i> NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually.
// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT
// <1=> NRF_SDH_DISPATCH_MODEL_APPSH
// <2=> NRF_SDH_DISPATCH_MODEL_POLLING
#ifndef NRF_SDH_DISPATCH_MODEL
#define NRF_SDH_DISPATCH_MODEL 0
#endif
// </h>
//==========================================================
// <h> Clock - SoftDevice clock configuration
//==========================================================
// <o> NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source.
// <0=> NRF_CLOCK_LF_SRC_RC
// <1=> NRF_CLOCK_LF_SRC_XTAL
// <2=> NRF_CLOCK_LF_SRC_SYNTH
#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 1
#endif
// <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval.
#ifndef NRF_SDH_CLOCK_LF_RC_CTIV
#define NRF_SDH_CLOCK_LF_RC_CTIV 0
#endif
// <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature.
// <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
// <i> if the temperature has not changed.
#ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
#define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
#endif
// <o> NRF_SDH_CLOCK_LF_ACCURACY - External clock accuracy used in the LL to compute timing.
// <0=> NRF_CLOCK_LF_ACCURACY_250_PPM
// <1=> NRF_CLOCK_LF_ACCURACY_500_PPM
// <2=> NRF_CLOCK_LF_ACCURACY_150_PPM
// <3=> NRF_CLOCK_LF_ACCURACY_100_PPM
// <4=> NRF_CLOCK_LF_ACCURACY_75_PPM
// <5=> NRF_CLOCK_LF_ACCURACY_50_PPM
// <6=> NRF_CLOCK_LF_ACCURACY_30_PPM
// <7=> NRF_CLOCK_LF_ACCURACY_20_PPM
// <8=> NRF_CLOCK_LF_ACCURACY_10_PPM
// <9=> NRF_CLOCK_LF_ACCURACY_5_PPM
// <10=> NRF_CLOCK_LF_ACCURACY_2_PPM
// <11=> NRF_CLOCK_LF_ACCURACY_1_PPM
#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 7
#endif
// </h>
//==========================================================
// <h> SDH Observers - Observers and priority levels
//==========================================================
// <o> NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers.
// <i> This setting configures the number of priority levels available for the SoftDevice request event handlers.
// <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
#ifndef NRF_SDH_REQ_OBSERVER_PRIO_LEVELS
#define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2
#endif
// <o> NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers.
// <i> This setting configures the number of priority levels available for the SoftDevice state event handlers.
// <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
#ifndef NRF_SDH_STATE_OBSERVER_PRIO_LEVELS
#define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2
#endif
// <o> NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers.
// <i> This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC).
// <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
#ifndef NRF_SDH_STACK_OBSERVER_PRIO_LEVELS
#define NRF_SDH_STACK_OBSERVER_PRIO_LEVELS 2
#endif
// <h> State Observers priorities - Invididual priorities
//==========================================================
// <o> CLOCK_CONFIG_STATE_OBSERVER_PRIO
// <i> Priority with which state events are dispatched to the Clock driver.
#ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO
#define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0
#endif
// <o> POWER_CONFIG_STATE_OBSERVER_PRIO
// <i> Priority with which state events are dispatched to the Power driver.
#ifndef POWER_CONFIG_STATE_OBSERVER_PRIO
#define POWER_CONFIG_STATE_OBSERVER_PRIO 0
#endif
// <o> RNG_CONFIG_STATE_OBSERVER_PRIO
// <i> Priority with which state events are dispatched to this module.
#ifndef RNG_CONFIG_STATE_OBSERVER_PRIO
#define RNG_CONFIG_STATE_OBSERVER_PRIO 0
#endif
// </h>
//==========================================================
// <h> Stack Event Observers priorities - Invididual priorities
//==========================================================
// <o> NRF_SDH_ANT_STACK_OBSERVER_PRIO
// <i> This setting configures the priority with which ANT events are processed with respect to other events coming from the stack.
// <i> Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC.
// <i> Zero is the highest priority.
#ifndef NRF_SDH_ANT_STACK_OBSERVER_PRIO
#define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0
#endif
// <o> NRF_SDH_BLE_STACK_OBSERVER_PRIO
// <i> This setting configures the priority with which BLE events are processed with respect to other events coming from the stack.
// <i> Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC.
// <i> Zero is the highest priority.
#ifndef NRF_SDH_BLE_STACK_OBSERVER_PRIO
#define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0
#endif
// <o> NRF_SDH_SOC_STACK_OBSERVER_PRIO
// <i> This setting configures the priority with which SoC events are processed with respect to other events coming from the stack.
// <i> Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE.
// <i> Zero is the highest priority.
#ifndef NRF_SDH_SOC_STACK_OBSERVER_PRIO
#define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// </e>
// <e> NRF_SDH_SOC_ENABLED - nrf_sdh_soc - SoftDevice SoC event handler
//==========================================================
#ifndef NRF_SDH_SOC_ENABLED
#define NRF_SDH_SOC_ENABLED 1
#endif
// <h> SoC Observers - Observers and priority levels
//==========================================================
// <o> NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers.
// <i> This setting configures the number of priority levels available for the SoC event handlers.
// <i> The priority level of a handler determines the order in which it receives events, with respect to other handlers.
#ifndef NRF_SDH_SOC_OBSERVER_PRIO_LEVELS
#define NRF_SDH_SOC_OBSERVER_PRIO_LEVELS 2
#endif
// <h> SoC Observers priorities - Invididual priorities
//==========================================================
// <o> BLE_DFU_SOC_OBSERVER_PRIO
// <i> Priority with which BLE events are dispatched to the DFU Service.
#ifndef BLE_DFU_SOC_OBSERVER_PRIO
#define BLE_DFU_SOC_OBSERVER_PRIO 1
#endif
// <o> CLOCK_CONFIG_SOC_OBSERVER_PRIO
// <i> Priority with which SoC events are dispatched to the Clock driver.
#ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO
#define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0
#endif
// <o> POWER_CONFIG_SOC_OBSERVER_PRIO
// <i> Priority with which SoC events are dispatched to the Power driver.
#ifndef POWER_CONFIG_SOC_OBSERVER_PRIO
#define POWER_CONFIG_SOC_OBSERVER_PRIO 0
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// </e>
// </h>
//==========================================================
// <h> nRF_drv_radio_802_15_4
//==========================================================
// <h> nrf_fem_config - nRF 21540 FEM configuration options
//==========================================================
// <o> FEM_CONTROL_DEFAULT_PA_PIN - Pin number, controlling Power Amplifier of the FEM module
#ifndef FEM_CONTROL_DEFAULT_PA_PIN
#define FEM_CONTROL_DEFAULT_PA_PIN 22
#endif
// <o> FEM_CONTROL_DEFAULT_LNA_PIN - Pin number, controlling Low Noise Amplifier of the FEM module
#ifndef FEM_CONTROL_DEFAULT_LNA_PIN
#define FEM_CONTROL_DEFAULT_LNA_PIN 19
#endif
// <o> FEM_CONTROL_DEFAULT_PDN_PIN - Pin number, controlling Power Down pin of the FEM module
#ifndef FEM_CONTROL_DEFAULT_PDN_PIN
#define FEM_CONTROL_DEFAULT_PDN_PIN 23
#endif
// <o> FEM_CONTROL_DEFAULT_MODE_PIN - Pin number, selecting Mode of the FEM module
#ifndef FEM_CONTROL_DEFAULT_MODE_PIN
#define FEM_CONTROL_DEFAULT_MODE_PIN 17
#endif
// <o> FEM_CONTROL_DEFAULT_ANTSEL_PIN - Pin number, selecting Antenna output of the FEM module
#ifndef FEM_CONTROL_DEFAULT_ANTSEL_PIN
#define FEM_CONTROL_DEFAULT_ANTSEL_PIN 20
#endif
// <o> FEM_CONTROL_DEFAULT_MOSI_PIN - Pin number, attached to MOSI pin of the FEM module
#ifndef FEM_CONTROL_DEFAULT_MOSI_PIN
#define FEM_CONTROL_DEFAULT_MOSI_PIN 45
#endif
// <o> FEM_CONTROL_DEFAULT_MISO_PIN - Pin number, attached to MISO pin of the FEM module
#ifndef FEM_CONTROL_DEFAULT_MISO_PIN
#define FEM_CONTROL_DEFAULT_MISO_PIN 46
#endif
// <o> FEM_CONTROL_DEFAULT_CLK_PIN - Pin number, attached to CLK pin of the FEM module
#ifndef FEM_CONTROL_DEFAULT_CLK_PIN
#define FEM_CONTROL_DEFAULT_CLK_PIN 47
#endif
// <o> FEM_CONTROL_DEFAULT_CSN_PIN - Pin number, attached to CS pin of the FEM module
#ifndef FEM_CONTROL_DEFAULT_CSN_PIN
#define FEM_CONTROL_DEFAULT_CSN_PIN 21
#endif
// <q> FEM_CONTROL_DEFAULT_ENABLE - Enables FEM control on GPIO pins by default
#ifndef FEM_CONTROL_DEFAULT_ENABLE
#define FEM_CONTROL_DEFAULT_ENABLE 0
#endif
// </h>
//==========================================================
// </h>
//==========================================================
// <<< end of configuration section >>>
#endif //SDK_CONFIG_H
| [
"mk1977-dd@web.de"
] | mk1977-dd@web.de |
bcc2e2c3e0a506150ce53e9de3086faa3cf2ddbf | 26ac91f8f041896baed7afdabcf1832434981b54 | /libft/src/ft_strlowcase.c | 2f7215e136b925d946f205d9c30397e964c304e8 | [] | no_license | ybarraul/ft_printf | 5c7d43d6fb0e1c7a4aa1aa8dc242c2b5a5f53231 | aadf11b4685841f9751eed2bf7a6ce5607886548 | refs/heads/master | 2020-04-02T18:37:32.991755 | 2018-10-25T16:59:22 | 2018-10-25T16:59:22 | 154,707,042 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,144 | c | /* ************************************************************************** */
/* LE - / */
/* / */
/* ft_strlowcase.c .:: .:/ . .:: */
/* +:+:+ +: +: +:+:+ */
/* By: ybarraul <marvin@le-101.fr> +:+ +: +: +:+ */
/* #+# #+ #+ #+# */
/* Created: 2018/01/08 12:53:17 by ybarraul #+# ## ## #+# */
/* Updated: 2018/01/08 12:53:19 by ybarraul ### #+. /#+ ###.fr */
/* / */
/* / */
/* ************************************************************************** */
#include "libft.h"
char *ft_strlowcase(char *str)
{
int i;
i = 0;
while (str[i])
{
if (str[i] >= 'A' && str[i] <= 'Z')
str[i] += 32;
i++;
}
return (str);
}
| [
"ybarraul@z4r1p1.le-101.fr"
] | ybarraul@z4r1p1.le-101.fr |
9bf3b4b662bb38de5797647fea9e34ce169ef0ad | 7612136f2156dd8fb340918f85c502a0577354f8 | /RightArrowStar.c | de234168b624bda830e2d67089ebcbde599c7630 | [] | no_license | 2security/Star | 4ac0858e8c146f307695cb5447a49b6ba725f6ea | 39483c05aeb916268181cb03d9f07189f437c6de | refs/heads/master | 2022-12-17T07:26:04.593149 | 2020-09-14T17:00:32 | 2020-09-14T17:00:32 | 295,481,963 | 1 | 0 | null | null | null | null | UTF-8 | C | false | false | 418 | c | #include<stdio.h>
int main()
{
int n,i,j,k;
printf("Enter no of rows");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=2;j<2*i;j++)
printf(" ");
for(j=n;j>=i;j--)
printf("*");
printf("\n");
}
for(i=1;i<n;i++)
{
for(j=2;j<2*n-2*i;j++)
printf(" ");
for(j=1;j<=i+1;j++)
printf("*");
printf("\n");
}
printf("\n\n");
return 0;
}
| [
"noreply@github.com"
] | 2security.noreply@github.com |
6a24b1cd21fd36e13f12e217a2a9c1086e68b3da | 2eba3b3b3f979c401de3f45667461c41f9b3537a | /cling/autoauto/ROOT8442.C | e154b0e06f628a312214fa128afc705fac84def5 | [] | no_license | root-project/roottest | a8e36a09f019fa557b4ebe3dd72cf633ca0e4c08 | 134508460915282a5d82d6cbbb6e6afa14653413 | refs/heads/master | 2023-09-04T08:09:33.456746 | 2023-08-28T12:36:17 | 2023-08-29T07:02:27 | 50,793,033 | 41 | 105 | null | 2023-09-06T10:55:45 | 2016-01-31T20:15:51 | C++ | UTF-8 | C | false | false | 95 | c | void ROOT8442() {
// Make sure that non-prompt input has no auto-auto.
notdeclared = 42;
}
| [
"Axel.Naumann@cern.ch"
] | Axel.Naumann@cern.ch |
8f95c92865d9a1c2d5f887511ecfac72e5857337 | 37e9bb64362f72c4bc3acf38361568105e0bc504 | /en-act/jni/it_unibz_enactmobile_EnActStart.h | e0f2d86d0480dd110f54d5d906abcc9fc869784e | [] | no_license | gpoleto/en-act | 88ad29a70a38d6352e18b03ee11579df584ec01d | 57a2879f126874b9d03101266b571fcad580f99a | refs/heads/master | 2016-08-04T16:35:10.813853 | 2015-04-16T18:58:31 | 2015-04-16T18:58:31 | 29,138,542 | 0 | 0 | null | null | null | null | UTF-8 | C | false | true | 1,536 | h | /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class it_unibz_enactmobile_EnActStart */
#ifndef _Included_it_unibz_enactmobile_EnActStart
#define _Included_it_unibz_enactmobile_EnActStart
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: it_unibz_enactmobile_EnActStart
* Method: multiplyMatricesFromFile
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_it_unibz_enactmobile_EnActStart_multiplyMatricesFromFile
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: it_unibz_enactmobile_EnActStart
* Method: filterImage
* Signature: (Ljava/lang/String;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_it_unibz_enactmobile_EnActStart_filterImage
(JNIEnv *, jobject, jstring, jstring);
/*
* Class: it_unibz_enactmobile_EnActStart
* Method: meteorContestBenchmark
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_it_unibz_enactmobile_EnActStart_meteorContestBenchmark
(JNIEnv *, jobject);
/*
* Class: it_unibz_enactmobile_EnActStart
* Method: mandelbrotBenchmark
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_it_unibz_enactmobile_EnActStart_mandelbrotBenchmark
(JNIEnv *, jobject, jint);
/*
* Class: it_unibz_enactmobile_EnActStart
* Method: spectralNormBenchmark
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_it_unibz_enactmobile_EnActStart_spectralNormBenchmark
(JNIEnv *, jobject, jint);
#ifdef __cplusplus
}
#endif
#endif
| [
"anton.b.georgiev@gmail.com"
] | anton.b.georgiev@gmail.com |
3b6f514d3aed6062a434b2b1cd6fbf79d82e3099 | d0be9b8d08bb1e70e1878a4cc21c45efbb8f4241 | /srcs/ft_memmove.c | ec32f8ff6a280c632d95dffcd16202cafe8e5746 | [] | no_license | mint42/printf | f2694d3b5cc52c4bec9e4cc120ed93d0dd7f6dda | 99344bef9a34c40081209c8f5714eaa7b75aaf53 | refs/heads/master | 2021-07-23T09:24:07.497339 | 2020-04-18T23:51:03 | 2020-04-18T23:51:03 | 143,647,039 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,200 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memmove.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rreedy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/14 18:03:28 by rreedy #+# #+# */
/* Updated: 2018/06/04 12:21:26 by rreedy ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memmove(void *dst, const void *src, size_t len)
{
size_t i;
i = 0;
if (dst < src)
while (i < len)
{
((unsigned char *)dst)[i] = ((unsigned char *)src)[i];
++i;
}
else
while (len--)
((unsigned char *)dst)[len] = ((unsigned char *)src)[len];
return (dst);
}
| [
"caelanreedy@gmail.com"
] | caelanreedy@gmail.com |
7eb9a63f169721a3905b8d8adbeb3d6f0941757c | 91a882547e393d4c4946a6c2c99186b5f72122dd | /Source/XPSP1/NT/base/win32/winnls/test/nlstest/esgitest.c | cbf9a2386340c7d2b5ff3d13d95236cfb85252d3 | [] | no_license | IAmAnubhavSaini/cryptoAlgorithm-nt5src | 94f9b46f101b983954ac6e453d0cf8d02aa76fc7 | d9e1cdeec650b9d6d3ce63f9f0abe50dabfaf9e2 | refs/heads/master | 2023-09-02T10:14:14.795579 | 2021-11-20T13:47:06 | 2021-11-20T13:47:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 6,089 | c | /*++
Copyright (c) 1991-1999, Microsoft Corporation All rights reserved.
Module Name:
esgitest.c
Abstract:
Test module for NLS API EnumSystemGeoID.
NOTE: This code was simply hacked together quickly in order to
test the different code modules of the NLS component.
This is NOT meant to be a formal regression test.
Revision History:
09-12-2000 JulieB Created.
--*/
//
// Include Files.
//
#include "nlstest.h"
//
// Constant Declarations.
//
#define ESGI_INVALID_FLAG 3
#define NUM_SUPPORTED_GEOIDS 260
//
// Global Variables.
//
int GeoCtr;
int EnumErrors;
//
// Forward Declarations.
//
BOOL
InitEnumSystemGeoID();
int
ESGI_BadParamCheck();
int
ESGI_NormalCase();
BOOL
CALLBACK
MyFuncGeo(
GEOID GeoId);
//
// Callback function.
//
BOOL CALLBACK MyFuncGeo(
GEOID GeoId)
{
TCHAR pData[128];
pData[0] = 0;
if (GetGeoInfoW( GeoId,
GEO_FRIENDLYNAME,
pData,
sizeof(pData) / sizeof(TCHAR),
0 ) == 0)
{
printf("GetGeoInfo failed during Enum for GeoId %d\n", GeoId);
EnumErrors++;
}
else if (pData[0] == 0)
{
printf("GetGeoInfo returned null string during Enum for GeoId %d\n", GeoId);
EnumErrors++;
}
if (Verbose)
{
printf("%d - %ws\n", GeoId, pData);
}
GeoCtr++;
return (TRUE);
}
////////////////////////////////////////////////////////////////////////////
//
// TestEnumSystemGeoID
//
// Test routine for EnumSystemGeoID API.
//
// 09-12-00 JulieB Created.
////////////////////////////////////////////////////////////////////////////
int TestEnumSystemGeoID()
{
int ErrCount = 0; // error count
//
// Print out what's being done.
//
printf("\n\nTESTING EnumSystemGeoID...\n\n");
//
// Initialize global variables.
//
if (!InitEnumSystemGeoID())
{
printf("\nABORTED TestEnumSystemGeoID: Could not Initialize.\n");
return (1);
}
//
// Test bad parameters.
//
ErrCount += ESGI_BadParamCheck();
//
// Test normal cases.
//
ErrCount += ESGI_NormalCase();
//
// Print out result.
//
printf("\nEnumSystemGeoID: ERRORS = %d\n", ErrCount);
//
// Return total number of errors found.
//
return (ErrCount);
}
////////////////////////////////////////////////////////////////////////////
//
// InitEnumSystemGeoID
//
// This routine initializes the global variables. If no errors were
// encountered, then it returns TRUE. Otherwise, it returns FALSE.
//
// 09-12-00 JulieB Created.
////////////////////////////////////////////////////////////////////////////
BOOL InitEnumSystemGeoID()
{
//
// Initialize geo counter.
//
GeoCtr = 0;
//
// Initialize enum error counter.
//
EnumErrors = 0;
//
// Return success.
//
return (TRUE);
}
////////////////////////////////////////////////////////////////////////////
//
// ESGI_BadParamCheck
//
// This routine passes in bad parameters to the API routines and checks to
// be sure they are handled properly. The number of errors encountered
// is returned to the caller.
//
// 09-12-00 JulieB Created.
////////////////////////////////////////////////////////////////////////////
int ESGI_BadParamCheck()
{
int NumErrors = 0; // error count - to be returned
int rc; // return code
//
// Invalid Function.
//
// Variation 1 - Function = invalid
GeoCtr = 0;
EnumErrors = 0;
rc = EnumSystemGeoID(GEOCLASS_NATION, 0, NULL);
NumErrors += EnumErrors;
CheckReturnBadParamEnum( rc,
FALSE,
ERROR_INVALID_PARAMETER,
"Function invalid",
&NumErrors,
GeoCtr,
0 );
//
// Invalid Flag.
//
// Variation 1 - dwFlags = invalid
GeoCtr = 0;
EnumErrors = 0;
rc = EnumSystemGeoID(ESGI_INVALID_FLAG, 0, MyFuncGeo);
NumErrors += EnumErrors;
CheckReturnBadParamEnum( rc,
FALSE,
ERROR_INVALID_FLAGS,
"Flag invalid",
&NumErrors,
GeoCtr,
0 );
// Variation 2 - dwFlags = invalid 2
GeoCtr = 0;
EnumErrors = 0;
rc = EnumSystemGeoID(GEOCLASS_REGION, 0, MyFuncGeo);
NumErrors += EnumErrors;
CheckReturnBadParamEnum( rc,
FALSE,
ERROR_INVALID_FLAGS,
"Flag invalid 2",
&NumErrors,
GeoCtr,
0 );
//
// NOTE: There is no validation on ParentGeoId. This parameter
// isn't used.
//
//
// Return total number of errors found.
//
return (NumErrors);
}
////////////////////////////////////////////////////////////////////////////
//
// ESGI_NormalCase
//
// This routine tests the normal cases of the API routine.
//
// 09-12-00 JulieB Created.
////////////////////////////////////////////////////////////////////////////
int ESGI_NormalCase()
{
int NumErrors = 0; // error count - to be returned
int rc; // return code
// Variation 1 - Installed
GeoCtr = 0;
EnumErrors = 0;
rc = EnumSystemGeoID(GEOCLASS_NATION, 0, MyFuncGeo);
NumErrors += EnumErrors;
CheckReturnValidEnum( rc,
TRUE,
GeoCtr,
NUM_SUPPORTED_GEOIDS,
"GeoClass Nation",
&NumErrors );
//
// Return total number of errors found.
//
return (NumErrors);
}
| [
"support@cryptoalgo.cf"
] | support@cryptoalgo.cf |
71a640ab3b550a0640eb8a4a1d0ce48ee41d84d3 | e26511cb0e0b9551adc05e0e6050d7147e2fd256 | /Gunz/ZCommandTable.h | e62f42336de9db3d04c31347f7044d935e2a0f3f | [] | no_license | PathosEthosLogos/RefinedGunz | 8d79c786bcb91f5fe365a085868626ab687f4f3c | 2f8c09a0cdc85183b0f2624ddc50d2570ff9a7ad | refs/heads/master | 2020-03-12T10:57:16.361321 | 2018-04-19T22:42:09 | 2018-04-19T22:42:09 | 130,584,829 | 1 | 0 | null | 2018-04-22T16:16:44 | 2018-04-22T16:16:43 | null | UTF-8 | C | false | false | 719 | h | #pragma once
void ZAddCommandTable(MCommandManager* pCommandManager);
#define ZC_CON_CLEAR 41000
#define ZC_CON_SIZE 41001
#define ZC_CON_HIDE 41002
#define ZC_CON_CONNECT 41003
#define ZC_CON_DISCONNECT 41004
#define ZC_CON_SAY 41005
#define ZC_TEST_INFO 42000
#define ZC_BEGIN_PROFILE 42001
#define ZC_END_PROFILE 42002
#ifdef _DEBUG
#define ZC_TEST_SETCLIENT1 61000
#define ZC_TEST_SETCLIENT2 61001
#define ZC_TEST_SETCLIENT3 61002
#define ZC_TEST_SETCLIENTALL 61003
#endif
#define ZC_TEST_BIRD1 61004
#define ZC_CHANGESKIN 51000
#define ZC_REPORT_119 51001
#define ZC_MESSAGE 51002
#define ZC_EVENT_OPTAIN_SPECIAL_WORLDITEM 52001
#define MC_QUEST_NPC_LOCAL_SPAWN 53000
| [
"askeno@hotmail.com"
] | askeno@hotmail.com |
fa71acce7602c86e97c3c4942b88854186fdf54a | fd36795a6092e16cdd374fe8367f0f0617a22ea4 | /src/bin/psql/tab-complete.c | 8c10aae476bb03aa8653eb7231791a3906ac3298 | [
"MIT",
"BSD-4-Clause-UC",
"BSD-3-Clause",
"ISC",
"bzip2-1.0.6",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause",
"Artistic-2.0",
"PostgreSQL",
"LicenseRef-scancode-unknown"
] | permissive | DalavanCloud/hawq | eab7d93481173dafb4da42c2d16249310c4c2fc9 | aea301f532079c3a7f1ccf0a452ed79785a1a3a3 | refs/heads/master | 2020-04-29T10:14:22.533820 | 2019-03-15T13:51:53 | 2019-03-16T03:37:51 | 176,054,339 | 1 | 0 | Apache-2.0 | 2019-03-17T04:02:59 | 2019-03-17T04:02:58 | null | UTF-8 | C | false | false | 104,156 | c | /*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* psql - the PostgreSQL interactive terminal
*
* Portions Copyright (c) 2005-2010, Greenplum inc
* Copyright (c) 2000-2010, PostgreSQL Global Development Group
*
* src/bin/psql/tab-complete.c
*/
/*----------------------------------------------------------------------
* This file implements a somewhat more sophisticated readline "TAB
* completion" in psql. It is not intended to be AI, to replace
* learning SQL, or to relieve you from thinking about what you're
* doing. Also it does not always give you all the syntactically legal
* completions, only those that are the most common or the ones that
* the programmer felt most like implementing.
*
* CAVEAT: Tab completion causes queries to be sent to the backend.
* The number of tuples returned gets limited, in most default
* installations to 1000, but if you still don't like this prospect,
* you can turn off tab completion in your ~/.inputrc (or else
* ${INPUTRC}) file so:
*
* $if psql
* set disable-completion on
* $endif
*
* See `man 3 readline' or `info readline' for the full details. Also,
* hence the
*
* BUGS:
*
* - If you split your queries across lines, this whole thing gets
* confused. (To fix this, one would have to read psql's query
* buffer rather than readline's line buffer, which would require
* some major revisions of things.)
*
* - Table or attribute names with spaces in it may confuse it.
*
* - Quotes, parenthesis, and other funny characters are not handled
* all that gracefully.
*----------------------------------------------------------------------
*/
#include "postgres_fe.h"
#include "tab-complete.h"
#include "input.h"
/* If we don't have this, we might as well forget about the whole thing: */
#ifdef USE_READLINE
#include <ctype.h>
#include "libpq-fe.h"
#include "pqexpbuffer.h"
#include "common.h"
#include "settings.h"
#include "stringutils.h"
#ifdef HAVE_RL_FILENAME_COMPLETION_FUNCTION
#define filename_completion_function rl_filename_completion_function
#else
/* missing in some header files */
extern char *filename_completion_function();
#endif
#ifdef HAVE_RL_COMPLETION_MATCHES
#define completion_matches rl_completion_matches
#endif
/* word break characters */
#define WORD_BREAKS "\t\n@$><=;|&{() "
/*
* This struct is used to define "schema queries", which are custom-built
* to obtain possibly-schema-qualified names of database objects. There is
* enough similarity in the structure that we don't want to repeat it each
* time. So we put the components of each query into this struct and
* assemble them with the common boilerplate in _complete_from_query().
*/
typedef struct SchemaQuery
{
/*
* Name of catalog or catalogs to be queried, with alias, eg.
* "pg_catalog.pg_class c". Note that "pg_namespace n" will be added.
*/
const char *catname;
/*
* Selection condition --- only rows meeting this condition are candidates
* to display. If catname mentions multiple tables, include the necessary
* join condition here. For example, "c.relkind = 'r'". Write NULL (not
* an empty string) if not needed.
*/
const char *selcondition;
/*
* Visibility condition --- which rows are visible without schema
* qualification? For example, "pg_catalog.pg_table_is_visible(c.oid)".
*/
const char *viscondition;
/*
* Namespace --- name of field to join to pg_namespace.oid. For example,
* "c.relnamespace".
*/
const char *namespace;
/*
* Result --- the appropriately-quoted name to return, in the case of an
* unqualified name. For example, "pg_catalog.quote_ident(c.relname)".
*/
const char *result;
/*
* In some cases a different result must be used for qualified names.
* Enter that here, or write NULL if result can be used.
*/
const char *qualresult;
} SchemaQuery;
/* Store maximum number of records we want from database queries
* (implemented via SELECT ... LIMIT xx).
*/
static int completion_max_records;
/*
* Communication variables set by COMPLETE_WITH_FOO macros and then used by
* the completion callback functions. Ugly but there is no better way.
*/
static const char *completion_charp; /* to pass a string */
static const char *const * completion_charpp; /* to pass a list of strings */
static const char *completion_info_charp; /* to pass a second string */
static const char *completion_info_charp2; /* to pass a third string */
static const SchemaQuery *completion_squery; /* to pass a SchemaQuery */
/*
* A few macros to ease typing. You can use these to complete the given
* string with
* 1) The results from a query you pass it. (Perhaps one of those below?)
* 2) The results from a schema query you pass it.
* 3) The items from a null-pointer-terminated list.
* 4) A string constant.
* 5) The list of attributes of the given table (possibly schema-qualified).
*/
#define COMPLETE_WITH_QUERY(query) \
do { \
completion_charp = query; \
matches = completion_matches(text, complete_from_query); \
} while (0)
#define COMPLETE_WITH_SCHEMA_QUERY(query, addon) \
do { \
completion_squery = &(query); \
completion_charp = addon; \
matches = completion_matches(text, complete_from_schema_query); \
} while (0)
#define COMPLETE_WITH_LIST(list) \
do { \
completion_charpp = list; \
matches = completion_matches(text, complete_from_list); \
} while (0)
#define COMPLETE_WITH_CONST(string) \
do { \
completion_charp = string; \
matches = completion_matches(text, complete_from_const); \
} while (0)
#define COMPLETE_WITH_ATTR(relation, addon) \
do { \
char *_completion_schema; \
char *_completion_table; \
\
_completion_schema = strtokx(relation, " \t\n\r", ".", "\"", 0, \
false, false, pset.encoding); \
(void) strtokx(NULL, " \t\n\r", ".", "\"", 0, \
false, false, pset.encoding); \
_completion_table = strtokx(NULL, " \t\n\r", ".", "\"", 0, \
false, false, pset.encoding); \
if (_completion_table == NULL) \
{ \
completion_charp = Query_for_list_of_attributes addon; \
completion_info_charp = relation; \
} \
else \
{ \
completion_charp = Query_for_list_of_attributes_with_schema addon; \
completion_info_charp = _completion_table; \
completion_info_charp2 = _completion_schema; \
} \
matches = completion_matches(text, complete_from_query); \
} while (0)
/*
* Assembly instructions for schema queries
*/
static const SchemaQuery Query_for_list_of_aggregates = {
/* catname */
"pg_catalog.pg_proc p",
/* selcondition */
"p.proisagg",
/* viscondition */
"pg_catalog.pg_function_is_visible(p.oid)",
/* namespace */
"p.pronamespace",
/* result */
"pg_catalog.quote_ident(p.proname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_datatypes = {
/* catname */
"pg_catalog.pg_type t",
/* selcondition --- ignore table rowtypes and array types */
"(t.typrelid = 0 "
" OR (SELECT c.relkind = 'c' FROM pg_catalog.pg_class c WHERE c.oid = t.typrelid)) "
"AND t.typname !~ '^_'",
/* viscondition */
"pg_catalog.pg_type_is_visible(t.oid)",
/* namespace */
"t.typnamespace",
/* result */
"pg_catalog.format_type(t.oid, NULL)",
/* qualresult */
"pg_catalog.quote_ident(t.typname)"
};
static const SchemaQuery Query_for_list_of_domains = {
/* catname */
"pg_catalog.pg_type t",
/* selcondition */
"t.typtype = 'd'",
/* viscondition */
"pg_catalog.pg_type_is_visible(t.oid)",
/* namespace */
"t.typnamespace",
/* result */
"pg_catalog.quote_ident(t.typname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_functions = {
/* catname */
"pg_catalog.pg_proc p",
/* selcondition */
NULL,
/* viscondition */
"pg_catalog.pg_function_is_visible(p.oid)",
/* namespace */
"p.pronamespace",
/* result */
"pg_catalog.quote_ident(p.proname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_indexes = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('i')",
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_sequences = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('S')",
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_tables = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('r' , 'x')", /* GPDB: x is obsolete, used only on very old GPDB systems */
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_tisv = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('r', 'i', 'S', 'v' , 'x')", /* GPDB: x is obsolete, used only on very old GPDB systems */
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_tsv = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('r', 'S', 'v' , 'x')", /* GPDB: x is obsolete, used only on very old GPDB systems */
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
static const SchemaQuery Query_for_list_of_views = {
/* catname */
"pg_catalog.pg_class c",
/* selcondition */
"c.relkind IN ('v')",
/* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */
"c.relnamespace",
/* result */
"pg_catalog.quote_ident(c.relname)",
/* qualresult */
NULL
};
/*
* Queries to get lists of names of various kinds of things, possibly
* restricted to names matching a partially entered name. In these queries,
* the first %s will be replaced by the text entered so far (suitably escaped
* to become a SQL literal string). %d will be replaced by the length of the
* string (in unescaped form). A second and third %s, if present, will be
* replaced by a suitably-escaped version of the string provided in
* completion_info_charp. A fourth and fifth %s are similarly replaced by
* completion_info_charp2.
*
* Beware that the allowed sequences of %s and %d are determined by
* _complete_from_query().
*/
#define Query_for_list_of_attributes \
"SELECT pg_catalog.quote_ident(attname) "\
" FROM pg_catalog.pg_attribute a, pg_catalog.pg_class c "\
" WHERE c.oid = a.attrelid "\
" AND a.attnum > 0 "\
" AND NOT a.attisdropped "\
" AND substring(pg_catalog.quote_ident(attname),1,%d)='%s' "\
" AND (pg_catalog.quote_ident(relname)='%s' "\
" OR '\"' || relname || '\"'='%s') "\
" AND pg_catalog.pg_table_is_visible(c.oid)"
#define Query_for_list_of_attributes_with_schema \
"SELECT pg_catalog.quote_ident(attname) "\
" FROM pg_catalog.pg_attribute a, pg_catalog.pg_class c, pg_catalog.pg_namespace n "\
" WHERE c.oid = a.attrelid "\
" AND n.oid = c.relnamespace "\
" AND a.attnum > 0 "\
" AND NOT a.attisdropped "\
" AND substring(pg_catalog.quote_ident(attname),1,%d)='%s' "\
" AND (pg_catalog.quote_ident(relname)='%s' "\
" OR '\"' || relname || '\"' ='%s') "\
" AND (pg_catalog.quote_ident(nspname)='%s' "\
" OR '\"' || nspname || '\"' ='%s') "
#define Query_for_list_of_template_databases \
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
" WHERE substring(pg_catalog.quote_ident(datname),1,%d)='%s' AND datistemplate"
#define Query_for_list_of_databases \
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
" WHERE substring(pg_catalog.quote_ident(datname),1,%d)='%s'"
#define Query_for_list_of_tablespaces \
"SELECT pg_catalog.quote_ident(spcname) FROM pg_catalog.pg_tablespace "\
" WHERE substring(pg_catalog.quote_ident(spcname),1,%d)='%s'"
#define Query_for_list_of_encodings \
" SELECT DISTINCT pg_catalog.pg_encoding_to_char(conforencoding) "\
" FROM pg_catalog.pg_conversion "\
" WHERE substring(pg_catalog.pg_encoding_to_char(conforencoding),1,%d)=UPPER('%s')"
#define Query_for_list_of_languages \
"SELECT pg_catalog.quote_ident(lanname) "\
" FROM pg_catalog.pg_language "\
" WHERE lanname != 'internal' "\
" AND substring(pg_catalog.quote_ident(lanname),1,%d)='%s'"
#define Query_for_list_of_schemas \
"SELECT pg_catalog.quote_ident(nspname) FROM pg_catalog.pg_namespace "\
" WHERE substring(pg_catalog.quote_ident(nspname),1,%d)='%s'"
#define Query_for_list_of_set_vars \
"SELECT name FROM "\
" (SELECT pg_catalog.lower(name) AS name FROM pg_catalog.pg_settings "\
" WHERE context IN ('user', 'superuser') "\
" UNION ALL SELECT 'constraints' "\
" UNION ALL SELECT 'transaction' "\
" UNION ALL SELECT 'session' "\
" UNION ALL SELECT 'role' "\
" UNION ALL SELECT 'tablespace' "\
" UNION ALL SELECT 'all') ss "\
" WHERE substring(name,1,%d)='%s'"
#define Query_for_list_of_show_vars \
"SELECT name FROM "\
" (SELECT pg_catalog.lower(name) AS name FROM pg_catalog.pg_settings "\
" UNION ALL SELECT 'session authorization' "\
" UNION ALL SELECT 'all') ss "\
" WHERE substring(name,1,%d)='%s'"
#define Query_for_list_of_roles \
" SELECT pg_catalog.quote_ident(rolname) "\
" FROM pg_catalog.pg_roles "\
" WHERE substring(pg_catalog.quote_ident(rolname),1,%d)='%s'"
#define Query_for_list_of_grant_roles \
" SELECT pg_catalog.quote_ident(rolname) "\
" FROM pg_catalog.pg_roles "\
" WHERE substring(pg_catalog.quote_ident(rolname),1,%d)='%s'"\
" UNION ALL SELECT 'PUBLIC'"
/* the silly-looking length condition is just to eat up the current word */
#define Query_for_table_owning_index \
"SELECT pg_catalog.quote_ident(c1.relname) "\
" FROM pg_catalog.pg_class c1, pg_catalog.pg_class c2, pg_catalog.pg_index i"\
" WHERE c1.oid=i.indrelid and i.indexrelid=c2.oid"\
" and (%d = pg_catalog.length('%s'))"\
" and pg_catalog.quote_ident(c2.relname)='%s'"\
" and pg_catalog.pg_table_is_visible(c2.oid)"
/* the silly-looking length condition is just to eat up the current word */
#define Query_for_index_of_table \
"SELECT pg_catalog.quote_ident(c2.relname) "\
" FROM pg_catalog.pg_class c1, pg_catalog.pg_class c2, pg_catalog.pg_index i"\
" WHERE c1.oid=i.indrelid and i.indexrelid=c2.oid"\
" and (%d = pg_catalog.length('%s'))"\
" and pg_catalog.quote_ident(c1.relname)='%s'"\
" and pg_catalog.pg_table_is_visible(c2.oid)"
/* the silly-looking length condition is just to eat up the current word */
#define Query_for_list_of_tables_for_trigger \
"SELECT pg_catalog.quote_ident(relname) "\
" FROM pg_catalog.pg_class"\
" WHERE (%d = pg_catalog.length('%s'))"\
" AND oid IN "\
" (SELECT tgrelid FROM pg_catalog.pg_trigger "\
" WHERE pg_catalog.quote_ident(tgname)='%s')"
#define Query_for_list_of_ts_configurations \
"SELECT pg_catalog.quote_ident(cfgname) FROM pg_catalog.pg_ts_config "\
" WHERE substring(pg_catalog.quote_ident(cfgname),1,%d)='%s'"
#define Query_for_list_of_ts_dictionaries \
"SELECT pg_catalog.quote_ident(dictname) FROM pg_catalog.pg_ts_dict "\
" WHERE substring(pg_catalog.quote_ident(dictname),1,%d)='%s'"
#define Query_for_list_of_ts_parsers \
"SELECT pg_catalog.quote_ident(prsname) FROM pg_catalog.pg_ts_parser "\
" WHERE substring(pg_catalog.quote_ident(prsname),1,%d)='%s'"
#define Query_for_list_of_ts_templates \
"SELECT pg_catalog.quote_ident(tmplname) FROM pg_catalog.pg_ts_template "\
" WHERE substring(pg_catalog.quote_ident(tmplname),1,%d)='%s'"
#define Query_for_list_of_fdws \
" SELECT pg_catalog.quote_ident(fdwname) "\
" FROM pg_catalog.pg_foreign_data_wrapper "\
" WHERE substring(pg_catalog.quote_ident(fdwname),1,%d)='%s'"
#define Query_for_list_of_servers \
" SELECT pg_catalog.quote_ident(srvname) "\
" FROM pg_catalog.pg_foreign_server "\
" WHERE substring(pg_catalog.quote_ident(srvname),1,%d)='%s'"
#define Query_for_list_of_user_mappings \
" SELECT pg_catalog.quote_ident(usename) "\
" FROM pg_catalog.pg_user_mappings "\
" WHERE substring(pg_catalog.quote_ident(usename),1,%d)='%s'"
#define Query_for_list_of_access_methods \
" SELECT pg_catalog.quote_ident(amname) "\
" FROM pg_catalog.pg_am "\
" WHERE substring(pg_catalog.quote_ident(amname),1,%d)='%s'"
#define Query_for_list_of_arguments \
" SELECT pg_catalog.oidvectortypes(proargtypes)||')' "\
" FROM pg_catalog.pg_proc "\
" WHERE proname='%s'"
/*
* This is a list of all "things" in Pgsql, which can show up after CREATE or
* DROP; and there is also a query to get a list of them.
*/
typedef struct
{
const char *name;
const char *query; /* simple query, or NULL */
const SchemaQuery *squery; /* schema query, or NULL */
const bool noshow; /* NULL or true if this word should not show
* up after CREATE or DROP */
} pgsql_thing_t;
static const pgsql_thing_t words_after_create[] = {
{"AGGREGATE", NULL, &Query_for_list_of_aggregates},
{"CAST", NULL, NULL}, /* Casts have complex structures for names, so
* skip it */
/*
* CREATE CONSTRAINT TRIGGER is not supported here because it is designed
* to be used only by pg_dump.
*/
{"CONFIGURATION", Query_for_list_of_ts_configurations, NULL, true},
{"CONVERSION", "SELECT pg_catalog.quote_ident(conname) FROM pg_catalog.pg_conversion WHERE substring(pg_catalog.quote_ident(conname),1,%d)='%s'"},
{"DATABASE", Query_for_list_of_databases},
{"DICTIONARY", Query_for_list_of_ts_dictionaries, NULL, true},
{"DOMAIN", NULL, &Query_for_list_of_domains},
{"FOREIGN DATA WRAPPER", NULL, NULL},
{"FUNCTION", NULL, &Query_for_list_of_functions},
{"GROUP", Query_for_list_of_roles},
{"LANGUAGE", Query_for_list_of_languages},
{"INDEX", NULL, &Query_for_list_of_indexes},
{"OPERATOR", NULL, NULL}, /* Querying for this is probably not such a
* good idea. */
{"PARSER", Query_for_list_of_ts_parsers, NULL, true},
{"ROLE", Query_for_list_of_roles},
{"RULE", "SELECT pg_catalog.quote_ident(rulename) FROM pg_catalog.pg_rules WHERE substring(pg_catalog.quote_ident(rulename),1,%d)='%s'"},
{"SCHEMA", Query_for_list_of_schemas},
{"SEQUENCE", NULL, &Query_for_list_of_sequences},
{"SERVER", Query_for_list_of_servers},
{"TABLE", NULL, &Query_for_list_of_tables},
{"TABLESPACE", Query_for_list_of_tablespaces},
{"TEMP", NULL, NULL}, /* for CREATE TEMP TABLE ... */
{"TEMPLATE", Query_for_list_of_ts_templates, NULL, true},
{"TEXT SEARCH", NULL, NULL},
{"TRIGGER", "SELECT pg_catalog.quote_ident(tgname) FROM pg_catalog.pg_trigger WHERE substring(pg_catalog.quote_ident(tgname),1,%d)='%s'"},
{"TYPE", NULL, &Query_for_list_of_datatypes},
{"UNIQUE", NULL, NULL}, /* for CREATE UNIQUE INDEX ... */
{"USER", Query_for_list_of_roles},
{"USER MAPPING FOR", NULL, NULL},
{"VIEW", NULL, &Query_for_list_of_views},
{NULL, NULL, NULL, false} /* end of list */
};
/* Forward declaration of functions */
static char **psql_completion(char *text, int start, int end);
static char *create_command_generator(const char *text, int state);
static char *drop_command_generator(const char *text, int state);
static char *complete_from_query(const char *text, int state);
static char *complete_from_schema_query(const char *text, int state);
static char *_complete_from_query(int is_schema_query,
const char *text, int state);
static char *complete_from_const(const char *text, int state);
static char *complete_from_list(const char *text, int state);
static PGresult *exec_query(const char *query);
static char *previous_word(int point, int skip);
#ifdef NOT_USED
static char *quote_file_name(char *text, int match_type, char *quote_pointer);
static char *dequote_file_name(char *text, char quote_char);
#endif
/*
* Initialize the readline library for our purposes.
*/
void
initialize_readline(void)
{
rl_readline_name = (char *) pset.progname;
rl_attempted_completion_function = (void *) psql_completion;
rl_basic_word_break_characters = WORD_BREAKS;
completion_max_records = 1000;
/*
* There is a variable rl_completion_query_items for this but apparently
* it's not defined everywhere.
*/
}
/*
* The completion function.
*
* According to readline spec this gets passed the text entered so far and its
* start and end positions in the readline buffer. The return value is some
* partially obscure list format that can be generated by readline's
* completion_matches() function, so we don't have to worry about it.
*/
static char **
psql_completion(char *text, int start, int end)
{
/* This is the variable we'll return. */
char **matches = NULL;
/* These are going to contain some scannage of the input line. */
char *prev_wd,
*prev2_wd,
*prev3_wd,
*prev4_wd,
*prev5_wd;
static const char *const sql_commands[] = {
"ABORT", "ALTER", "ANALYZE", "BEGIN", "CHECKPOINT", "CLOSE", "CLUSTER",
"COMMENT", "COMMIT", "COPY", "CREATE", "DEALLOCATE", "DECLARE",
"DELETE FROM", "DISCARD", "DO", "DROP", "END", "EXECUTE", "EXPLAIN", "FETCH",
"GRANT", "INSERT", "LISTEN", "LOAD", "LOCK", "MOVE", "NOTIFY", "PREPARE",
"REASSIGN", "REINDEX", "RELEASE", "RESET", "REVOKE", "ROLLBACK",
"SAVEPOINT", "SELECT", "SET", "SHOW", "START", "TABLE", "TRUNCATE", "UNLISTEN",
"UPDATE", "VACUUM", "VALUES", "WITH", NULL
};
static const char *const backslash_commands[] = {
"\\a", "\\connect", "\\conninfo", "\\C", "\\cd", "\\copy", "\\copyright",
"\\d", "\\da", "\\db", "\\dc", "\\dC", "\\dd", "\\dD", "\\des", "\\deu", "\\dew", "\\df",
"\\dF", "\\dFd", "\\dFp", "\\dFt", "\\dg", "\\di", "\\dl",
"\\dn", "\\do", "\\dp", "\\drds", "\\ds", "\\dS", "\\dt", "\\dT", "\\dv", "\\du",
"\\e", "\\echo", "\\ef", "\\encoding",
"\\f", "\\g", "\\h", "\\help", "\\H", "\\i", "\\l",
"\\lo_import", "\\lo_export", "\\lo_list", "\\lo_unlink",
"\\o", "\\p", "\\password", "\\prompt", "\\pset", "\\q", "\\qecho", "\\r",
"\\set", "\\t", "\\T",
"\\timing", "\\unset", "\\x", "\\w", "\\z", "\\!", NULL
};
(void) end; /* not used */
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character = ' ';
#endif
/* Clear a few things. */
completion_charp = NULL;
completion_charpp = NULL;
completion_info_charp = NULL;
completion_info_charp2 = NULL;
/*
* Scan the input line before our current position for the last five
* words. According to those we'll make some smart decisions on what the
* user is probably intending to type. TODO: Use strtokx() to do this.
*/
prev_wd = previous_word(start, 0);
prev2_wd = previous_word(start, 1);
prev3_wd = previous_word(start, 2);
prev4_wd = previous_word(start, 3);
prev5_wd = previous_word(start, 4);
/* If a backslash command was started, continue */
if (text[0] == '\\')
COMPLETE_WITH_LIST(backslash_commands);
/* If no previous word, suggest one of the basic sql commands */
else if (!prev_wd)
COMPLETE_WITH_LIST(sql_commands);
/* CREATE */
/* complete with something you can create */
else if (pg_strcasecmp(prev_wd, "CREATE") == 0)
matches = completion_matches(text, create_command_generator);
/* DROP, but watch out for DROP embedded in other commands */
/* complete with something you can drop */
else if (pg_strcasecmp(prev_wd, "DROP") == 0 &&
pg_strcasecmp(prev2_wd, "DROP") == 0)
matches = completion_matches(text, drop_command_generator);
/* ALTER */
/*
* complete with what you can alter (TABLE, GROUP, USER, ...) unless we're
* in ALTER TABLE sth ALTER
*/
else if (pg_strcasecmp(prev_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TABLE") != 0)
{
static const char *const list_ALTER[] =
{"AGGREGATE", "CONVERSION", "DATABASE", "DEFAULT PRIVILEGES", "DOMAIN", "FOREIGN DATA WRAPPER", "FUNCTION",
"GROUP", "INDEX", "LANGUAGE", "LARGE OBJECT", "OPERATOR", "ROLE", "SCHEMA", "SERVER", "SEQUENCE", "TABLE",
"TABLESPACE", "TEXT SEARCH", "TRIGGER", "TYPE", "USER", "USER MAPPING FOR", "VIEW", NULL};
COMPLETE_WITH_LIST(list_ALTER);
}
/* ALTER AGGREGATE,FUNCTION <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
(pg_strcasecmp(prev2_wd, "AGGREGATE") == 0 ||
pg_strcasecmp(prev2_wd, "FUNCTION") == 0))
COMPLETE_WITH_CONST("(");
/* ALTER AGGREGATE,FUNCTION <name> (...) */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
(pg_strcasecmp(prev3_wd, "AGGREGATE") == 0 ||
pg_strcasecmp(prev3_wd, "FUNCTION") == 0))
{
if (prev_wd[strlen(prev_wd) - 1] == ')')
{
static const char *const list_ALTERAGG[] =
{"OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
COMPLETE_WITH_LIST(list_ALTERAGG);
}
else
{
char *tmp_buf = malloc(strlen(Query_for_list_of_arguments) + strlen(prev2_wd));
sprintf(tmp_buf, Query_for_list_of_arguments, prev2_wd);
COMPLETE_WITH_QUERY(tmp_buf);
free(tmp_buf);
}
}
/* ALTER CONVERSION,SCHEMA <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
(pg_strcasecmp(prev2_wd, "CONVERSION") == 0 ||
pg_strcasecmp(prev2_wd, "SCHEMA") == 0))
{
static const char *const list_ALTERGEN[] =
{"OWNER TO", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERGEN);
}
/* ALTER DATABASE <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "DATABASE") == 0)
{
static const char *const list_ALTERDATABASE[] =
{"RESET", "SET", "OWNER TO", "RENAME TO", "CONNECTION LIMIT", NULL};
COMPLETE_WITH_LIST(list_ALTERDATABASE);
}
/* ALTER FOREIGN DATA WRAPPER <name> */
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "FOREIGN") == 0 &&
pg_strcasecmp(prev3_wd, "DATA") == 0 &&
pg_strcasecmp(prev2_wd, "WRAPPER") == 0)
{
static const char *const list_ALTER_FDW[] =
{"VALIDATOR", "OPTIONS", "OWNER TO", NULL};
COMPLETE_WITH_LIST(list_ALTER_FDW);
}
/* ALTER INDEX <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "INDEX") == 0)
{
static const char *const list_ALTERINDEX[] =
{"OWNER TO", "RENAME TO", "SET", "RESET", NULL};
COMPLETE_WITH_LIST(list_ALTERINDEX);
}
/* ALTER INDEX <name> SET */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "INDEX") == 0 &&
pg_strcasecmp(prev_wd, "SET") == 0)
{
static const char *const list_ALTERINDEXSET[] =
{"(", "TABLESPACE", NULL};
COMPLETE_WITH_LIST(list_ALTERINDEXSET);
}
/* ALTER INDEX <name> RESET */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "INDEX") == 0 &&
pg_strcasecmp(prev_wd, "RESET") == 0)
COMPLETE_WITH_CONST("(");
/* ALTER INDEX <foo> SET|RESET ( */
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "INDEX") == 0 &&
(pg_strcasecmp(prev2_wd, "SET") == 0 ||
pg_strcasecmp(prev2_wd, "RESET") == 0) &&
pg_strcasecmp(prev_wd, "(") == 0)
{
static const char *const list_INDEXOPTIONS[] =
{"fillfactor", "fastupdate", NULL};
COMPLETE_WITH_LIST(list_INDEXOPTIONS);
}
/* ALTER LANGUAGE <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "LANGUAGE") == 0)
{
static const char *const list_ALTERLANGUAGE[] =
{"OWNER TO", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERLANGUAGE);
}
/* ALTER LARGE OBJECT <oid> */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "LARGE") == 0 &&
pg_strcasecmp(prev2_wd, "OBJECT") == 0)
{
static const char *const list_ALTERLARGEOBJECT[] =
{"OWNER TO", NULL};
COMPLETE_WITH_LIST(list_ALTERLARGEOBJECT);
}
/* ALTER USER,ROLE <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
!(pg_strcasecmp(prev2_wd, "USER") == 0 && pg_strcasecmp(prev_wd, "MAPPING") == 0) &&
(pg_strcasecmp(prev2_wd, "USER") == 0 ||
pg_strcasecmp(prev2_wd, "ROLE") == 0))
{
static const char *const list_ALTERUSER[] =
{"ENCRYPTED", "UNENCRYPTED", "CREATEDB", "NOCREATEDB", "CREATEUSER",
"NOCREATEUSER", "CREATEROLE", "NOCREATEROLE", "INHERIT", "NOINHERIT",
"LOGIN", "NOLOGIN", "CONNECTION LIMIT", "VALID UNTIL", "RENAME TO",
"SUPERUSER", "NOSUPERUSER", "SET", "RESET", NULL};
COMPLETE_WITH_LIST(list_ALTERUSER);
}
/* complete ALTER USER,ROLE <name> ENCRYPTED,UNENCRYPTED with PASSWORD */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
(pg_strcasecmp(prev3_wd, "ROLE") == 0 || pg_strcasecmp(prev3_wd, "USER") == 0) &&
(pg_strcasecmp(prev_wd, "ENCRYPTED") == 0 || pg_strcasecmp(prev_wd, "UNENCRYPTED") == 0))
{
COMPLETE_WITH_CONST("PASSWORD");
}
/* ALTER DEFAULT PRIVILEGES */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "DEFAULT") == 0 &&
pg_strcasecmp(prev_wd, "PRIVILEGES") == 0)
{
static const char *const list_ALTER_DEFAULT_PRIVILEGES[] =
{"FOR ROLE", "FOR USER", "IN SCHEMA", NULL};
COMPLETE_WITH_LIST(list_ALTER_DEFAULT_PRIVILEGES);
}
/* ALTER DEFAULT PRIVILEGES FOR */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "DEFAULT") == 0 &&
pg_strcasecmp(prev2_wd, "PRIVILEGES") == 0 &&
pg_strcasecmp(prev_wd, "FOR") == 0)
{
static const char *const list_ALTER_DEFAULT_PRIVILEGES_FOR[] =
{"ROLE", "USER", NULL};
COMPLETE_WITH_LIST(list_ALTER_DEFAULT_PRIVILEGES_FOR);
}
/* ALTER DEFAULT PRIVILEGES { FOR ROLE ... | IN SCHEMA ... } */
else if (pg_strcasecmp(prev5_wd, "DEFAULT") == 0 &&
pg_strcasecmp(prev4_wd, "PRIVILEGES") == 0 &&
(pg_strcasecmp(prev3_wd, "FOR") == 0 ||
pg_strcasecmp(prev3_wd, "IN") == 0))
{
static const char *const list_ALTER_DEFAULT_PRIVILEGES_REST[] =
{"GRANT", "REVOKE", NULL};
COMPLETE_WITH_LIST(list_ALTER_DEFAULT_PRIVILEGES_REST);
}
/* ALTER DOMAIN <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "DOMAIN") == 0)
{
static const char *const list_ALTERDOMAIN[] =
{"ADD", "DROP", "OWNER TO", "SET", NULL};
COMPLETE_WITH_LIST(list_ALTERDOMAIN);
}
/* ALTER DOMAIN <sth> DROP */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "DOMAIN") == 0 &&
pg_strcasecmp(prev_wd, "DROP") == 0)
{
static const char *const list_ALTERDOMAIN2[] =
{"CONSTRAINT", "DEFAULT", "NOT NULL", NULL};
COMPLETE_WITH_LIST(list_ALTERDOMAIN2);
}
/* ALTER DOMAIN <sth> SET */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "DOMAIN") == 0 &&
pg_strcasecmp(prev_wd, "SET") == 0)
{
static const char *const list_ALTERDOMAIN3[] =
{"DEFAULT", "NOT NULL", "SCHEMA", NULL};
COMPLETE_WITH_LIST(list_ALTERDOMAIN3);
}
/* ALTER SEQUENCE <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "SEQUENCE") == 0)
{
static const char *const list_ALTERSEQUENCE[] =
{"INCREMENT", "MINVALUE", "MAXVALUE", "RESTART", "NO", "CACHE", "CYCLE",
"SET SCHEMA", "OWNED BY", "OWNER TO", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERSEQUENCE);
}
/* ALTER SEQUENCE <name> NO */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "SEQUENCE") == 0 &&
pg_strcasecmp(prev_wd, "NO") == 0)
{
static const char *const list_ALTERSEQUENCE2[] =
{"MINVALUE", "MAXVALUE", "CYCLE", NULL};
COMPLETE_WITH_LIST(list_ALTERSEQUENCE2);
}
/* ALTER SERVER <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "SERVER") == 0)
{
static const char *const list_ALTER_SERVER[] =
{"VERSION", "OPTIONS", "OWNER TO", NULL};
COMPLETE_WITH_LIST(list_ALTER_SERVER);
}
/* ALTER VIEW <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "VIEW") == 0)
{
static const char *const list_ALTERVIEW[] =
{"ALTER COLUMN", "OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
COMPLETE_WITH_LIST(list_ALTERVIEW);
}
/* ALTER TRIGGER <name>, add ON */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "TRIGGER") == 0)
COMPLETE_WITH_CONST("ON");
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TRIGGER") == 0)
{
completion_info_charp = prev2_wd;
COMPLETE_WITH_QUERY(Query_for_list_of_tables_for_trigger);
}
/*
* If we have ALTER TRIGGER <sth> ON, then add the correct tablename
*/
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TRIGGER") == 0 &&
pg_strcasecmp(prev_wd, "ON") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* ALTER TRIGGER <name> ON <name> */
else if (pg_strcasecmp(prev4_wd, "TRIGGER") == 0 &&
pg_strcasecmp(prev2_wd, "ON") == 0)
COMPLETE_WITH_CONST("RENAME TO");
/*
* If we detect ALTER TABLE <name>, suggest either ADD, DROP, ALTER,
* RENAME, CLUSTER ON or OWNER
*/
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "TABLE") == 0)
{
static const char *const list_ALTER2[] =
{"ADD", "ALTER", "CLUSTER ON", "DISABLE", "DROP", "ENABLE", "INHERIT",
"NO INHERIT", "RENAME", "RESET", "OWNER TO", "SET", NULL};
COMPLETE_WITH_LIST(list_ALTER2);
}
/* ALTER TABLE xxx ENABLE */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "ENABLE") == 0)
{
static const char *const list_ALTERENABLE[] =
{"ALWAYS", "REPLICA", "RULE", "TRIGGER", NULL};
COMPLETE_WITH_LIST(list_ALTERENABLE);
}
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "ENABLE") == 0 &&
(pg_strcasecmp(prev_wd, "REPLICA") == 0 ||
pg_strcasecmp(prev_wd, "ALWAYS") == 0))
{
static const char *const list_ALTERENABLE2[] =
{"RULE", "TRIGGER", NULL};
COMPLETE_WITH_LIST(list_ALTERENABLE2);
}
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "DISABLE") == 0)
{
static const char *const list_ALTERDISABLE[] =
{"RULE", "TRIGGER", NULL};
COMPLETE_WITH_LIST(list_ALTERDISABLE);
}
/* If we have TABLE <sth> ALTER|RENAME, provide list of columns */
else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
(pg_strcasecmp(prev_wd, "ALTER") == 0 ||
pg_strcasecmp(prev_wd, "RENAME") == 0))
COMPLETE_WITH_ATTR(prev2_wd, " UNION SELECT 'COLUMN'");
/*
* If we have TABLE <sth> ALTER COLUMN|RENAME COLUMN, provide list of
* columns
*/
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
(pg_strcasecmp(prev2_wd, "ALTER") == 0 ||
pg_strcasecmp(prev2_wd, "RENAME") == 0) &&
pg_strcasecmp(prev_wd, "COLUMN") == 0)
COMPLETE_WITH_ATTR(prev3_wd, "");
/* ALTER TABLE xxx RENAME yyy */
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "RENAME") == 0 &&
pg_strcasecmp(prev_wd, "TO") != 0)
COMPLETE_WITH_CONST("TO");
/* ALTER TABLE xxx RENAME COLUMN yyy */
else if (pg_strcasecmp(prev5_wd, "TABLE") == 0 &&
pg_strcasecmp(prev3_wd, "RENAME") == 0 &&
pg_strcasecmp(prev2_wd, "COLUMN") == 0 &&
pg_strcasecmp(prev_wd, "TO") != 0)
COMPLETE_WITH_CONST("TO");
/* If we have TABLE <sth> DROP, provide COLUMN or CONSTRAINT */
else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "DROP") == 0)
{
static const char *const list_TABLEDROP[] =
{"COLUMN", "CONSTRAINT", NULL};
COMPLETE_WITH_LIST(list_TABLEDROP);
}
/* If we have TABLE <sth> DROP COLUMN, provide list of columns */
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "DROP") == 0 &&
pg_strcasecmp(prev_wd, "COLUMN") == 0)
COMPLETE_WITH_ATTR(prev3_wd, "");
/* ALTER TABLE ALTER [COLUMN] <foo> */
else if ((pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "COLUMN") == 0) ||
(pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "ALTER") == 0))
{
static const char *const list_COLUMNALTER[] =
{"TYPE", "SET", "RESET", "DROP", NULL};
COMPLETE_WITH_LIST(list_COLUMNALTER);
}
/* ALTER TABLE ALTER [COLUMN] <foo> SET */
else if (((pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "COLUMN") == 0) ||
(pg_strcasecmp(prev5_wd, "TABLE") == 0 &&
pg_strcasecmp(prev3_wd, "ALTER") == 0)) &&
pg_strcasecmp(prev_wd, "SET") == 0)
{
static const char *const list_COLUMNSET[] =
{"(", "DEFAULT", "NOT NULL", "STATISTICS", "STORAGE", NULL};
COMPLETE_WITH_LIST(list_COLUMNSET);
}
/* ALTER TABLE ALTER [COLUMN] <foo> SET ( */
else if (((pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "COLUMN") == 0) ||
pg_strcasecmp(prev4_wd, "ALTER") == 0) &&
pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "(") == 0)
{
static const char *const list_COLUMNOPTIONS[] =
{"n_distinct", "n_distinct_inherited", NULL};
COMPLETE_WITH_LIST(list_COLUMNOPTIONS);
}
/* ALTER TABLE ALTER [COLUMN] <foo> SET STORAGE */
else if (((pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "COLUMN") == 0) ||
pg_strcasecmp(prev4_wd, "ALTER") == 0) &&
pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "STORAGE") == 0)
{
static const char *const list_COLUMNSTORAGE[] =
{"PLAIN", "EXTERNAL", "EXTENDED", "MAIN", NULL};
COMPLETE_WITH_LIST(list_COLUMNSTORAGE);
}
/* ALTER TABLE ALTER [COLUMN] <foo> DROP */
else if (((pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "COLUMN") == 0) ||
(pg_strcasecmp(prev5_wd, "TABLE") == 0 &&
pg_strcasecmp(prev3_wd, "ALTER") == 0)) &&
pg_strcasecmp(prev_wd, "DROP") == 0)
{
static const char *const list_COLUMNDROP[] =
{"DEFAULT", "NOT NULL", NULL};
COMPLETE_WITH_LIST(list_COLUMNDROP);
}
else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "CLUSTER") == 0)
COMPLETE_WITH_CONST("ON");
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "CLUSTER") == 0 &&
pg_strcasecmp(prev_wd, "ON") == 0)
{
completion_info_charp = prev3_wd;
COMPLETE_WITH_QUERY(Query_for_index_of_table);
}
/* If we have TABLE <sth> SET, provide WITHOUT,TABLESPACE and SCHEMA */
else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "SET") == 0)
{
static const char *const list_TABLESET[] =
{"(", "WITHOUT", "TABLESPACE", "SCHEMA", NULL};
COMPLETE_WITH_LIST(list_TABLESET);
}
/* If we have TABLE <sth> SET TABLESPACE provide a list of tablespaces */
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "TABLESPACE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
/* If we have TABLE <sth> SET WITHOUT provide CLUSTER or OIDS */
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "WITHOUT") == 0)
{
static const char *const list_TABLESET2[] =
{"CLUSTER", "OIDS", NULL};
COMPLETE_WITH_LIST(list_TABLESET2);
}
/* ALTER TABLE <foo> RESET */
else if (pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "RESET") == 0)
COMPLETE_WITH_CONST("(");
/* ALTER TABLE <foo> SET|RESET ( */
else if (pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
(pg_strcasecmp(prev2_wd, "SET") == 0 ||
pg_strcasecmp(prev2_wd, "RESET") == 0) &&
pg_strcasecmp(prev_wd, "(") == 0)
{
static const char *const list_TABLEOPTIONS[] =
{
"autovacuum_analyze_scale_factor",
"autovacuum_analyze_threshold",
"autovacuum_enabled",
"autovacuum_freeze_max_age",
"autovacuum_freeze_min_age",
"autovacuum_freeze_table_age",
"autovacuum_vacuum_cost_delay",
"autovacuum_vacuum_cost_limit",
"autovacuum_vacuum_scale_factor",
"autovacuum_vacuum_threshold",
"fillfactor",
"toast.autovacuum_enabled",
"toast.autovacuum_freeze_max_age",
"toast.autovacuum_freeze_min_age",
"toast.autovacuum_freeze_table_age",
"toast.autovacuum_vacuum_cost_delay",
"toast.autovacuum_vacuum_cost_limit",
"toast.autovacuum_vacuum_scale_factor",
"toast.autovacuum_vacuum_threshold",
NULL
};
COMPLETE_WITH_LIST(list_TABLEOPTIONS);
}
/* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "TABLESPACE") == 0)
{
static const char *const list_ALTERTSPC[] =
{"RENAME TO", "OWNER TO", "SET", "RESET", NULL};
COMPLETE_WITH_LIST(list_ALTERTSPC);
}
/* ALTER TABLESPACE <foo> SET|RESET */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TABLESPACE") == 0 &&
(pg_strcasecmp(prev_wd, "SET") == 0 ||
pg_strcasecmp(prev_wd, "RESET") == 0))
COMPLETE_WITH_CONST("(");
/* ALTER TABLESPACE <foo> SET|RESET ( */
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "TABLESPACE") == 0 &&
(pg_strcasecmp(prev2_wd, "SET") == 0 ||
pg_strcasecmp(prev2_wd, "RESET") == 0) &&
pg_strcasecmp(prev_wd, "(") == 0)
{
static const char *const list_TABLESPACEOPTIONS[] =
{"seq_page_cost", "random_page_cost", NULL};
COMPLETE_WITH_LIST(list_TABLESPACEOPTIONS);
}
/* ALTER TEXT SEARCH */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "TEXT") == 0 &&
pg_strcasecmp(prev_wd, "SEARCH") == 0)
{
static const char *const list_ALTERTEXTSEARCH[] =
{"CONFIGURATION", "DICTIONARY", "PARSER", "TEMPLATE", NULL};
COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH);
}
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
(pg_strcasecmp(prev2_wd, "TEMPLATE") == 0 ||
pg_strcasecmp(prev2_wd, "PARSER") == 0))
COMPLETE_WITH_CONST("RENAME TO");
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
pg_strcasecmp(prev2_wd, "DICTIONARY") == 0)
{
static const char *const list_ALTERTEXTSEARCH2[] =
{"OWNER TO", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH2);
}
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
pg_strcasecmp(prev2_wd, "CONFIGURATION") == 0)
{
static const char *const list_ALTERTEXTSEARCH3[] =
{"ADD MAPPING FOR", "ALTER MAPPING", "DROP MAPPING FOR", "OWNER TO", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH3);
}
/* complete ALTER TYPE <foo> with OWNER TO, SET SCHEMA */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "TYPE") == 0)
{
static const char *const list_ALTERTYPE[] =
{"OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
COMPLETE_WITH_LIST(list_ALTERTYPE);
}
/* complete ALTER GROUP <foo> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "GROUP") == 0)
{
static const char *const list_ALTERGROUP[] =
{"ADD USER", "DROP USER", "RENAME TO", NULL};
COMPLETE_WITH_LIST(list_ALTERGROUP);
}
/* complete ALTER GROUP <foo> ADD|DROP with USER */
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "GROUP") == 0 &&
(pg_strcasecmp(prev_wd, "ADD") == 0 ||
pg_strcasecmp(prev_wd, "DROP") == 0))
COMPLETE_WITH_CONST("USER");
/* complete {ALTER} GROUP <foo> ADD|DROP USER with a user name */
else if (pg_strcasecmp(prev4_wd, "GROUP") == 0 &&
(pg_strcasecmp(prev2_wd, "ADD") == 0 ||
pg_strcasecmp(prev2_wd, "DROP") == 0) &&
pg_strcasecmp(prev_wd, "USER") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
/* BEGIN, END, ABORT */
else if (pg_strcasecmp(prev_wd, "BEGIN") == 0 ||
pg_strcasecmp(prev_wd, "END") == 0 ||
pg_strcasecmp(prev_wd, "ABORT") == 0)
{
static const char *const list_TRANS[] =
{"WORK", "TRANSACTION", NULL};
COMPLETE_WITH_LIST(list_TRANS);
}
/* COMMIT */
else if (pg_strcasecmp(prev_wd, "COMMIT") == 0)
{
static const char *const list_COMMIT[] =
{"WORK", "TRANSACTION", "PREPARED", NULL};
COMPLETE_WITH_LIST(list_COMMIT);
}
/* RELEASE SAVEPOINT */
else if (pg_strcasecmp(prev_wd, "RELEASE") == 0)
COMPLETE_WITH_CONST("SAVEPOINT");
/* ROLLBACK*/
else if (pg_strcasecmp(prev_wd, "ROLLBACK") == 0)
{
static const char *const list_TRANS[] =
{"WORK", "TRANSACTION", "TO SAVEPOINT", "PREPARED", NULL};
COMPLETE_WITH_LIST(list_TRANS);
}
/* CLUSTER */
/*
* If the previous word is CLUSTER and not without produce list of tables
*/
else if (pg_strcasecmp(prev_wd, "CLUSTER") == 0 &&
pg_strcasecmp(prev2_wd, "WITHOUT") != 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* If we have CLUSTER <sth>, then add "USING" */
else if (pg_strcasecmp(prev2_wd, "CLUSTER") == 0 &&
pg_strcasecmp(prev_wd, "ON") != 0)
{
COMPLETE_WITH_CONST("USING");
}
/*
* If we have CLUSTER <sth> USING, then add the index as well.
*/
else if (pg_strcasecmp(prev3_wd, "CLUSTER") == 0 &&
pg_strcasecmp(prev_wd, "USING") == 0)
{
completion_info_charp = prev2_wd;
COMPLETE_WITH_QUERY(Query_for_index_of_table);
}
/* COMMENT */
else if (pg_strcasecmp(prev_wd, "COMMENT") == 0)
COMPLETE_WITH_CONST("ON");
else if (pg_strcasecmp(prev2_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev_wd, "ON") == 0)
{
static const char *const list_COMMENT[] =
{"CAST", "CONVERSION", "DATABASE", "INDEX", "LANGUAGE", "RULE", "SCHEMA",
"SEQUENCE", "TABLE", "TYPE", "VIEW", "COLUMN", "AGGREGATE", "FUNCTION",
"OPERATOR", "TRIGGER", "CONSTRAINT", "DOMAIN", "LARGE OBJECT",
"TABLESPACE", "TEXT SEARCH", "ROLE", NULL};
COMPLETE_WITH_LIST(list_COMMENT);
}
else if (pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0 &&
pg_strcasecmp(prev2_wd, "TEXT") == 0 &&
pg_strcasecmp(prev_wd, "SEARCH") == 0)
{
static const char *const list_TRANS2[] =
{"CONFIGURATION", "DICTIONARY", "PARSER", "TEMPLATE", NULL};
COMPLETE_WITH_LIST(list_TRANS2);
}
else if ((pg_strcasecmp(prev4_wd, "COMMENT") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0) ||
(pg_strcasecmp(prev5_wd, "ON") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0))
COMPLETE_WITH_CONST("IS");
/* COPY */
/*
* If we have COPY [BINARY] (which you'd have to type yourself), offer
* list of tables (Also cover the analogous backslash command)
*/
else if (pg_strcasecmp(prev_wd, "COPY") == 0 ||
pg_strcasecmp(prev_wd, "\\copy") == 0 ||
(pg_strcasecmp(prev2_wd, "COPY") == 0 &&
pg_strcasecmp(prev_wd, "BINARY") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* If we have COPY|BINARY <sth>, complete it with "TO" or "FROM" */
else if (pg_strcasecmp(prev2_wd, "COPY") == 0 ||
pg_strcasecmp(prev2_wd, "\\copy") == 0 ||
pg_strcasecmp(prev2_wd, "BINARY") == 0)
{
static const char *const list_FROMTO[] =
{"FROM", "TO", NULL};
COMPLETE_WITH_LIST(list_FROMTO);
}
/* If we have COPY|BINARY <sth> FROM|TO, complete with filename */
else if ((pg_strcasecmp(prev3_wd, "COPY") == 0 ||
pg_strcasecmp(prev3_wd, "\\copy") == 0 ||
pg_strcasecmp(prev3_wd, "BINARY") == 0) &&
(pg_strcasecmp(prev_wd, "FROM") == 0 ||
pg_strcasecmp(prev_wd, "TO") == 0))
matches = completion_matches(text, filename_completion_function);
/* Handle COPY|BINARY <sth> FROM|TO filename */
else if ((pg_strcasecmp(prev4_wd, "COPY") == 0 ||
pg_strcasecmp(prev4_wd, "\\copy") == 0 ||
pg_strcasecmp(prev4_wd, "BINARY") == 0) &&
(pg_strcasecmp(prev2_wd, "FROM") == 0 ||
pg_strcasecmp(prev2_wd, "TO") == 0))
{
static const char *const list_COPY[] =
{"BINARY", "OIDS", "DELIMITER", "NULL", "CSV", NULL};
COMPLETE_WITH_LIST(list_COPY);
}
/* Handle COPY|BINARY <sth> FROM|TO filename CSV */
else if (pg_strcasecmp(prev_wd, "CSV") == 0 &&
(pg_strcasecmp(prev3_wd, "FROM") == 0 ||
pg_strcasecmp(prev3_wd, "TO") == 0))
{
static const char *const list_CSV[] =
{"HEADER", "QUOTE", "ESCAPE", "FORCE QUOTE", NULL};
COMPLETE_WITH_LIST(list_CSV);
}
/* CREATE DATABASE */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "DATABASE") == 0)
{
static const char *const list_DATABASE[] =
{"OWNER", "TEMPLATE", "ENCODING", "TABLESPACE", "CONNECTION LIMIT",
NULL};
COMPLETE_WITH_LIST(list_DATABASE);
}
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
pg_strcasecmp(prev3_wd, "DATABASE") == 0 &&
pg_strcasecmp(prev_wd, "TEMPLATE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_template_databases);
/* CREATE FOREIGN DATA WRAPPER */
else if (pg_strcasecmp(prev5_wd, "CREATE") == 0 &&
pg_strcasecmp(prev4_wd, "FOREIGN") == 0 &&
pg_strcasecmp(prev3_wd, "DATA") == 0 &&
pg_strcasecmp(prev2_wd, "WRAPPER") == 0)
COMPLETE_WITH_CONST("VALIDATOR");
/* CREATE INDEX */
/* First off we complete CREATE UNIQUE with "INDEX" */
else if (pg_strcasecmp(prev2_wd, "CREATE") == 0 &&
pg_strcasecmp(prev_wd, "UNIQUE") == 0)
COMPLETE_WITH_CONST("INDEX");
/* If we have CREATE|UNIQUE INDEX, then add "ON" and existing indexes */
else if (pg_strcasecmp(prev_wd, "INDEX") == 0 &&
(pg_strcasecmp(prev2_wd, "CREATE") == 0 ||
pg_strcasecmp(prev2_wd, "UNIQUE") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes,
" UNION SELECT 'ON'"
" UNION SELECT 'CONCURRENTLY'");
/* Complete ... INDEX [<name>] ON with a list of tables */
else if ((pg_strcasecmp(prev3_wd, "INDEX") == 0 ||
pg_strcasecmp(prev2_wd, "INDEX") == 0 ||
pg_strcasecmp(prev2_wd, "CONCURRENTLY") == 0) &&
pg_strcasecmp(prev_wd, "ON") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* If we have CREATE|UNIQUE INDEX <sth> CONCURRENTLY, then add "ON" */
else if ((pg_strcasecmp(prev3_wd, "INDEX") == 0 ||
pg_strcasecmp(prev2_wd, "INDEX") == 0) &&
pg_strcasecmp(prev_wd, "CONCURRENTLY") == 0)
COMPLETE_WITH_CONST("ON");
/* If we have CREATE|UNIQUE INDEX <sth>, then add "ON" or "CONCURRENTLY" */
else if ((pg_strcasecmp(prev3_wd, "CREATE") == 0 ||
pg_strcasecmp(prev3_wd, "UNIQUE") == 0) &&
pg_strcasecmp(prev2_wd, "INDEX") == 0)
{
static const char *const list_CREATE_INDEX[] =
{"CONCURRENTLY", "ON", NULL};
COMPLETE_WITH_LIST(list_CREATE_INDEX);
}
/*
* Complete INDEX <name> ON <table> with a list of table columns (which
* should really be in parens)
*/
else if ((pg_strcasecmp(prev4_wd, "INDEX") == 0 ||
pg_strcasecmp(prev3_wd, "INDEX") == 0 ||
pg_strcasecmp(prev3_wd, "CONCURRENTLY") == 0) &&
pg_strcasecmp(prev2_wd, "ON") == 0)
{
static const char *const list_CREATE_INDEX2[] =
{"(", "USING", NULL};
COMPLETE_WITH_LIST(list_CREATE_INDEX2);
}
else if ((pg_strcasecmp(prev5_wd, "INDEX") == 0 ||
pg_strcasecmp(prev4_wd, "INDEX") == 0 ||
pg_strcasecmp(prev4_wd, "CONCURRENTLY") == 0) &&
pg_strcasecmp(prev3_wd, "ON") == 0 &&
pg_strcasecmp(prev_wd, "(") == 0)
COMPLETE_WITH_ATTR(prev2_wd, "");
/* same if you put in USING */
else if (pg_strcasecmp(prev5_wd, "ON") == 0 &&
pg_strcasecmp(prev3_wd, "USING") == 0 &&
pg_strcasecmp(prev_wd, "(") == 0)
COMPLETE_WITH_ATTR(prev4_wd, "");
/* Complete USING with an index method */
else if (pg_strcasecmp(prev_wd, "USING") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_access_methods);
else if (pg_strcasecmp(prev4_wd, "ON") == 0 &&
pg_strcasecmp(prev2_wd, "USING") == 0)
COMPLETE_WITH_CONST("(");
/* CREATE RULE */
/* Complete "CREATE RULE <sth>" with "AS" */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "RULE") == 0)
COMPLETE_WITH_CONST("AS");
/* Complete "CREATE RULE <sth> AS with "ON" */
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
pg_strcasecmp(prev3_wd, "RULE") == 0 &&
pg_strcasecmp(prev_wd, "AS") == 0)
COMPLETE_WITH_CONST("ON");
/* Complete "RULE * AS ON" with SELECT|UPDATE|DELETE|INSERT */
else if (pg_strcasecmp(prev4_wd, "RULE") == 0 &&
pg_strcasecmp(prev2_wd, "AS") == 0 &&
pg_strcasecmp(prev_wd, "ON") == 0)
{
static const char *const rule_events[] =
{"SELECT", "UPDATE", "INSERT", "DELETE", NULL};
COMPLETE_WITH_LIST(rule_events);
}
/* Complete "AS ON <sth with a 'T' :)>" with a "TO" */
else if (pg_strcasecmp(prev3_wd, "AS") == 0 &&
pg_strcasecmp(prev2_wd, "ON") == 0 &&
(pg_toupper((unsigned char) prev_wd[4]) == 'T' ||
pg_toupper((unsigned char) prev_wd[5]) == 'T'))
COMPLETE_WITH_CONST("TO");
/* Complete "AS ON <sth> TO" with a table name */
else if (pg_strcasecmp(prev4_wd, "AS") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0 &&
pg_strcasecmp(prev_wd, "TO") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* CREATE SERVER <name> */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "SERVER") == 0)
{
static const char *const list_CREATE_SERVER[] =
{"TYPE", "VERSION", "FOREIGN DATA WRAPPER", NULL};
COMPLETE_WITH_LIST(list_CREATE_SERVER);
}
/* CREATE TABLE */
/* Complete "CREATE TEMP/TEMPORARY" with the possible temp objects */
else if (pg_strcasecmp(prev2_wd, "CREATE") == 0 &&
(pg_strcasecmp(prev_wd, "TEMP") == 0 ||
pg_strcasecmp(prev_wd, "TEMPORARY") == 0))
{
static const char *const list_TEMP[] =
{"SEQUENCE", "TABLE", "VIEW", NULL};
COMPLETE_WITH_LIST(list_TEMP);
}
/* CREATE TABLESPACE */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "TABLESPACE") == 0)
{
static const char *const list_CREATETABLESPACE[] =
{"OWNER", "FILESPACE", NULL};
COMPLETE_WITH_LIST(list_CREATETABLESPACE);
}
/* Complete CREATE TABLESPACE name OWNER name with "FILESPACE" */
else if (pg_strcasecmp(prev5_wd, "CREATE") == 0 &&
pg_strcasecmp(prev4_wd, "TABLESPACE") == 0 &&
pg_strcasecmp(prev2_wd, "OWNER") == 0)
{
COMPLETE_WITH_CONST("FILESPACE");
}
/* CREATE TEXT SEARCH */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "TEXT") == 0 &&
pg_strcasecmp(prev_wd, "SEARCH") == 0)
{
static const char *const list_CREATETEXTSEARCH[] =
{"CONFIGURATION", "DICTIONARY", "PARSER", "TEMPLATE", NULL};
COMPLETE_WITH_LIST(list_CREATETEXTSEARCH);
}
else if (pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
pg_strcasecmp(prev2_wd, "CONFIGURATION") == 0)
COMPLETE_WITH_CONST("(");
/* CREATE TRIGGER */
/* complete CREATE TRIGGER <name> with BEFORE,AFTER */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "TRIGGER") == 0)
{
static const char *const list_CREATETRIGGER[] =
{"BEFORE", "AFTER", NULL};
COMPLETE_WITH_LIST(list_CREATETRIGGER);
}
/* complete CREATE TRIGGER <name> BEFORE,AFTER with an event */
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
pg_strcasecmp(prev3_wd, "TRIGGER") == 0 &&
(pg_strcasecmp(prev_wd, "BEFORE") == 0 ||
pg_strcasecmp(prev_wd, "AFTER") == 0))
{
static const char *const list_CREATETRIGGER_EVENTS[] =
{"INSERT", "DELETE", "UPDATE", "TRUNCATE", NULL};
COMPLETE_WITH_LIST(list_CREATETRIGGER_EVENTS);
}
/* complete CREATE TRIGGER <name> BEFORE,AFTER sth with OR,ON */
else if (pg_strcasecmp(prev5_wd, "CREATE") == 0 &&
pg_strcasecmp(prev4_wd, "TRIGGER") == 0 &&
(pg_strcasecmp(prev2_wd, "BEFORE") == 0 ||
pg_strcasecmp(prev2_wd, "AFTER") == 0))
{
static const char *const list_CREATETRIGGER2[] =
{"ON", "OR", NULL};
COMPLETE_WITH_LIST(list_CREATETRIGGER2);
}
/*
* complete CREATE TRIGGER <name> BEFORE,AFTER event ON with a list of
* tables
*/
else if (pg_strcasecmp(prev5_wd, "TRIGGER") == 0 &&
(pg_strcasecmp(prev3_wd, "BEFORE") == 0 ||
pg_strcasecmp(prev3_wd, "AFTER") == 0) &&
pg_strcasecmp(prev_wd, "ON") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* complete CREATE TRIGGER ... EXECUTE with PROCEDURE */
else if (pg_strcasecmp(prev_wd, "EXECUTE") == 0)
COMPLETE_WITH_CONST("PROCEDURE");
/* CREATE ROLE,USER,GROUP */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
!(pg_strcasecmp(prev2_wd, "USER") == 0 && pg_strcasecmp(prev_wd, "MAPPING") == 0) &&
(pg_strcasecmp(prev2_wd, "ROLE") == 0 ||
pg_strcasecmp(prev2_wd, "GROUP") == 0 || pg_strcasecmp(prev2_wd, "USER") == 0))
{
static const char *const list_CREATEROLE[] =
{"ADMIN", "CONNECTION LIMIT", "CREATEDB", "CREATEROLE", "CREATEUSER",
"ENCRYPTED", "IN", "INHERIT", "LOGIN", "NOINHERIT", "NOLOGIN", "NOCREATEDB",
"NOCREATEROLE", "NOCREATEUSER", "NOSUPERUSER", "ROLE", "SUPERUSER", "SYSID",
"UNENCRYPTED", NULL};
COMPLETE_WITH_LIST(list_CREATEROLE);
}
/*
* complete CREATE ROLE,USER,GROUP <name> ENCRYPTED,UNENCRYPTED with
* PASSWORD
*/
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
(pg_strcasecmp(prev3_wd, "ROLE") == 0 ||
pg_strcasecmp(prev3_wd, "GROUP") == 0 || pg_strcasecmp(prev3_wd, "USER") == 0) &&
(pg_strcasecmp(prev_wd, "ENCRYPTED") == 0 || pg_strcasecmp(prev_wd, "UNENCRYPTED") == 0))
{
COMPLETE_WITH_CONST("PASSWORD");
}
/* complete CREATE ROLE,USER,GROUP <name> IN with ROLE,GROUP */
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
(pg_strcasecmp(prev3_wd, "ROLE") == 0 ||
pg_strcasecmp(prev3_wd, "GROUP") == 0 || pg_strcasecmp(prev3_wd, "USER") == 0) &&
pg_strcasecmp(prev_wd, "IN") == 0)
{
static const char *const list_CREATEROLE3[] =
{"GROUP", "ROLE", NULL};
COMPLETE_WITH_LIST(list_CREATEROLE3);
}
/* CREATE VIEW */
/* Complete CREATE VIEW <name> with AS */
else if (pg_strcasecmp(prev3_wd, "CREATE") == 0 &&
pg_strcasecmp(prev2_wd, "VIEW") == 0)
COMPLETE_WITH_CONST("AS");
/* Complete "CREATE VIEW <sth> AS with "SELECT" */
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
pg_strcasecmp(prev3_wd, "VIEW") == 0 &&
pg_strcasecmp(prev_wd, "AS") == 0)
COMPLETE_WITH_CONST("SELECT");
/* DECLARE */
else if (pg_strcasecmp(prev2_wd, "DECLARE") == 0)
{
static const char *const list_DECLARE[] =
{"BINARY", "INSENSITIVE", "SCROLL", "NO SCROLL", "CURSOR", NULL};
COMPLETE_WITH_LIST(list_DECLARE);
}
/* CURSOR */
else if (pg_strcasecmp(prev_wd, "CURSOR") == 0)
{
static const char *const list_DECLARECURSOR[] =
{"WITH HOLD", "WITHOUT HOLD", "FOR", NULL};
COMPLETE_WITH_LIST(list_DECLARECURSOR);
}
/* DELETE */
/*
* Complete DELETE with FROM (only if the word before that is not "ON"
* (cf. rules) or "BEFORE" or "AFTER" (cf. triggers) or GRANT)
*/
else if (pg_strcasecmp(prev_wd, "DELETE") == 0 &&
!(pg_strcasecmp(prev2_wd, "ON") == 0 ||
pg_strcasecmp(prev2_wd, "GRANT") == 0 ||
pg_strcasecmp(prev2_wd, "BEFORE") == 0 ||
pg_strcasecmp(prev2_wd, "AFTER") == 0))
COMPLETE_WITH_CONST("FROM");
/* Complete DELETE FROM with a list of tables */
else if (pg_strcasecmp(prev2_wd, "DELETE") == 0 &&
pg_strcasecmp(prev_wd, "FROM") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* Complete DELETE FROM <table> */
else if (pg_strcasecmp(prev3_wd, "DELETE") == 0 &&
pg_strcasecmp(prev2_wd, "FROM") == 0)
{
static const char *const list_DELETE[] =
{"USING", "WHERE", "SET", NULL};
COMPLETE_WITH_LIST(list_DELETE);
}
/* XXX: implement tab completion for DELETE ... USING */
/* DISCARD */
else if (pg_strcasecmp(prev_wd, "DISCARD") == 0)
{
static const char *const list_DISCARD[] =
{"ALL", "PLANS", "TEMP", NULL};
COMPLETE_WITH_LIST(list_DISCARD);
}
/* DO */
/*
* Complete DO with LANGUAGE.
*/
else if (pg_strcasecmp(prev_wd, "DO") == 0)
{
static const char *const list_DO[] =
{"LANGUAGE", NULL};
COMPLETE_WITH_LIST(list_DO);
}
/* DROP (when not the previous word) */
/* DROP AGGREGATE */
else if (pg_strcasecmp(prev3_wd, "DROP") == 0 &&
pg_strcasecmp(prev2_wd, "AGGREGATE") == 0)
COMPLETE_WITH_CONST("(");
/* DROP object with CASCADE / RESTRICT */
else if ((pg_strcasecmp(prev3_wd, "DROP") == 0 &&
(pg_strcasecmp(prev2_wd, "CONVERSION") == 0 ||
pg_strcasecmp(prev2_wd, "DOMAIN") == 0 ||
pg_strcasecmp(prev2_wd, "FUNCTION") == 0 ||
pg_strcasecmp(prev2_wd, "INDEX") == 0 ||
pg_strcasecmp(prev2_wd, "LANGUAGE") == 0 ||
pg_strcasecmp(prev2_wd, "SCHEMA") == 0 ||
pg_strcasecmp(prev2_wd, "SEQUENCE") == 0 ||
pg_strcasecmp(prev2_wd, "SERVER") == 0 ||
pg_strcasecmp(prev2_wd, "TABLE") == 0 ||
pg_strcasecmp(prev2_wd, "TYPE") == 0 ||
pg_strcasecmp(prev2_wd, "VIEW") == 0)) ||
(pg_strcasecmp(prev4_wd, "DROP") == 0 &&
pg_strcasecmp(prev3_wd, "AGGREGATE") == 0 &&
prev_wd[strlen(prev_wd) - 1] == ')') ||
(pg_strcasecmp(prev5_wd, "DROP") == 0 &&
pg_strcasecmp(prev4_wd, "FOREIGN") == 0 &&
pg_strcasecmp(prev3_wd, "DATA") == 0 &&
pg_strcasecmp(prev2_wd, "WRAPPER") == 0) ||
(pg_strcasecmp(prev5_wd, "DROP") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
(pg_strcasecmp(prev2_wd, "CONFIGURATION") == 0 ||
pg_strcasecmp(prev2_wd, "DICTIONARY") == 0 ||
pg_strcasecmp(prev2_wd, "PARSER") == 0 ||
pg_strcasecmp(prev2_wd, "TEMPLATE") == 0))
)
{
if (pg_strcasecmp(prev3_wd, "DROP") == 0 &&
pg_strcasecmp(prev2_wd, "FUNCTION") == 0)
{
COMPLETE_WITH_CONST("(");
}
else
{
static const char *const list_DROPCR[] =
{"CASCADE", "RESTRICT", NULL};
COMPLETE_WITH_LIST(list_DROPCR);
}
}
else if (pg_strcasecmp(prev4_wd, "DROP") == 0 &&
(pg_strcasecmp(prev3_wd, "AGGREGATE") == 0 ||
pg_strcasecmp(prev3_wd, "FUNCTION") == 0) &&
pg_strcasecmp(prev_wd, "(") == 0)
{
char *tmp_buf = malloc(strlen(Query_for_list_of_arguments) + strlen(prev2_wd));
sprintf(tmp_buf, Query_for_list_of_arguments, prev2_wd);
COMPLETE_WITH_QUERY(tmp_buf);
free(tmp_buf);
}
/* DROP OWNED BY */
else if (pg_strcasecmp(prev2_wd, "DROP") == 0 &&
pg_strcasecmp(prev_wd, "OWNED") == 0)
COMPLETE_WITH_CONST("BY");
else if (pg_strcasecmp(prev3_wd, "DROP") == 0 &&
pg_strcasecmp(prev2_wd, "OWNED") == 0 &&
pg_strcasecmp(prev_wd, "BY") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
else if (pg_strcasecmp(prev3_wd, "DROP") == 0 &&
pg_strcasecmp(prev2_wd, "TEXT") == 0 &&
pg_strcasecmp(prev_wd, "SEARCH") == 0)
{
static const char *const list_ALTERTEXTSEARCH[] =
{"CONFIGURATION", "DICTIONARY", "PARSER", "TEMPLATE", NULL};
COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH);
}
/* EXPLAIN */
/*
* Complete EXPLAIN [ANALYZE] [VERBOSE] with list of EXPLAIN-able commands
*/
else if (pg_strcasecmp(prev_wd, "EXPLAIN") == 0)
{
static const char *const list_EXPLAIN[] =
{"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", "ANALYZE", "VERBOSE", NULL};
COMPLETE_WITH_LIST(list_EXPLAIN);
}
else if (pg_strcasecmp(prev2_wd, "EXPLAIN") == 0 &&
pg_strcasecmp(prev_wd, "ANALYZE") == 0)
{
static const char *const list_EXPLAIN[] =
{"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", "VERBOSE", NULL};
COMPLETE_WITH_LIST(list_EXPLAIN);
}
else if ((pg_strcasecmp(prev2_wd, "EXPLAIN") == 0 &&
pg_strcasecmp(prev_wd, "VERBOSE") == 0) ||
(pg_strcasecmp(prev3_wd, "EXPLAIN") == 0 &&
pg_strcasecmp(prev2_wd, "ANALYZE") == 0 &&
pg_strcasecmp(prev_wd, "VERBOSE") == 0))
{
static const char *const list_EXPLAIN[] =
{"SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE", NULL};
COMPLETE_WITH_LIST(list_EXPLAIN);
}
/* FETCH && MOVE */
/* Complete FETCH with one of FORWARD, BACKWARD, RELATIVE */
else if (pg_strcasecmp(prev_wd, "FETCH") == 0 ||
pg_strcasecmp(prev_wd, "MOVE") == 0)
{
static const char *const list_FETCH1[] =
{"ABSOLUTE", "BACKWARD", "FORWARD", "RELATIVE", NULL};
COMPLETE_WITH_LIST(list_FETCH1);
}
/* Complete FETCH <sth> with one of ALL, NEXT, PRIOR */
else if (pg_strcasecmp(prev2_wd, "FETCH") == 0 ||
pg_strcasecmp(prev2_wd, "MOVE") == 0)
{
static const char *const list_FETCH2[] =
{"ALL", "NEXT", "PRIOR", NULL};
COMPLETE_WITH_LIST(list_FETCH2);
}
/*
* Complete FETCH <sth1> <sth2> with "FROM" or "IN". These are equivalent,
* but we may as well tab-complete both: perhaps some users prefer one
* variant or the other.
*/
else if (pg_strcasecmp(prev3_wd, "FETCH") == 0 ||
pg_strcasecmp(prev3_wd, "MOVE") == 0)
{
static const char *const list_FROMIN[] =
{"FROM", "IN", NULL};
COMPLETE_WITH_LIST(list_FROMIN);
}
/* FOREIGN DATA WRAPPER */
/* applies in ALTER/DROP FDW and in CREATE SERVER */
else if (pg_strcasecmp(prev4_wd, "CREATE") != 0 &&
pg_strcasecmp(prev3_wd, "FOREIGN") == 0 &&
pg_strcasecmp(prev2_wd, "DATA") == 0 &&
pg_strcasecmp(prev_wd, "WRAPPER") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
/* GRANT && REVOKE*/
/* Complete GRANT/REVOKE with a list of privileges */
else if (pg_strcasecmp(prev_wd, "GRANT") == 0 ||
pg_strcasecmp(prev_wd, "REVOKE") == 0)
{
static const char *const list_privilege[] =
{"SELECT", "INSERT", "UPDATE", "DELETE", "TRUNCATE", "REFERENCES",
"TRIGGER", "CREATE", "CONNECT", "TEMPORARY", "EXECUTE", "USAGE",
"ALL", NULL};
COMPLETE_WITH_LIST(list_privilege);
}
/* Complete GRANT/REVOKE <sth> with "ON" */
else if (pg_strcasecmp(prev2_wd, "GRANT") == 0 ||
pg_strcasecmp(prev2_wd, "REVOKE") == 0)
COMPLETE_WITH_CONST("ON");
/*
* Complete GRANT/REVOKE <sth> ON with a list of tables, views, sequences,
* and indexes
*
* keywords DATABASE, FUNCTION, LANGUAGE, SCHEMA added to query result via
* UNION; seems to work intuitively
*
* Note: GRANT/REVOKE can get quite complex; tab-completion as implemented
* here will only work if the privilege list contains exactly one
* privilege
*/
else if ((pg_strcasecmp(prev3_wd, "GRANT") == 0 ||
pg_strcasecmp(prev3_wd, "REVOKE") == 0) &&
pg_strcasecmp(prev_wd, "ON") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv,
" UNION SELECT 'DATABASE'"
" UNION SELECT 'FOREIGN DATA WRAPPER'"
" UNION SELECT 'FOREIGN SERVER'"
" UNION SELECT 'FUNCTION'"
" UNION SELECT 'LANGUAGE'"
" UNION SELECT 'LARGE OBJECT'"
" UNION SELECT 'SCHEMA'"
" UNION SELECT 'TABLESPACE'");
else if ((pg_strcasecmp(prev4_wd, "GRANT") == 0 ||
pg_strcasecmp(prev4_wd, "REVOKE") == 0) &&
pg_strcasecmp(prev2_wd, "ON") == 0 &&
pg_strcasecmp(prev_wd, "FOREIGN") == 0)
{
static const char *const list_privilege_foreign[] =
{"DATA WRAPPER", "SERVER", NULL};
COMPLETE_WITH_LIST(list_privilege_foreign);
}
/* Complete "GRANT/REVOKE * ON * " with "TO/FROM" */
else if ((pg_strcasecmp(prev4_wd, "GRANT") == 0 ||
pg_strcasecmp(prev4_wd, "REVOKE") == 0) &&
pg_strcasecmp(prev2_wd, "ON") == 0)
{
if (pg_strcasecmp(prev_wd, "DATABASE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_databases);
else if (pg_strcasecmp(prev_wd, "FUNCTION") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);
else if (pg_strcasecmp(prev_wd, "LANGUAGE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_languages);
else if (pg_strcasecmp(prev_wd, "SCHEMA") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_schemas);
else if (pg_strcasecmp(prev_wd, "TABLESPACE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
else if (pg_strcasecmp(prev4_wd, "GRANT") == 0)
COMPLETE_WITH_CONST("TO");
else
COMPLETE_WITH_CONST("FROM");
}
/* Complete "GRANT/REVOKE * ON * TO/FROM" with username, GROUP, or PUBLIC */
else if (pg_strcasecmp(prev5_wd, "GRANT") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0)
{
if (pg_strcasecmp(prev_wd, "TO") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_grant_roles);
else
COMPLETE_WITH_CONST("TO");
}
else if (pg_strcasecmp(prev5_wd, "REVOKE") == 0 &&
pg_strcasecmp(prev3_wd, "ON") == 0)
{
if (pg_strcasecmp(prev_wd, "FROM") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_grant_roles);
else
COMPLETE_WITH_CONST("FROM");
}
/* GROUP BY */
else if (pg_strcasecmp(prev3_wd, "FROM") == 0 &&
pg_strcasecmp(prev_wd, "GROUP") == 0)
COMPLETE_WITH_CONST("BY");
/* INSERT */
/* Complete INSERT with "INTO" */
else if (pg_strcasecmp(prev_wd, "INSERT") == 0)
COMPLETE_WITH_CONST("INTO");
/* Complete INSERT INTO with table names */
else if (pg_strcasecmp(prev2_wd, "INSERT") == 0 &&
pg_strcasecmp(prev_wd, "INTO") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* Complete "INSERT INTO <table> (" with attribute names */
else if (pg_strcasecmp(prev4_wd, "INSERT") == 0 &&
pg_strcasecmp(prev3_wd, "INTO") == 0 &&
pg_strcasecmp(prev_wd, "(") == 0)
COMPLETE_WITH_ATTR(prev2_wd, "");
/*
* Complete INSERT INTO <table> with "(" or "VALUES" or "SELECT" or
* "TABLE" or "DEFAULT VALUES"
*/
else if (pg_strcasecmp(prev3_wd, "INSERT") == 0 &&
pg_strcasecmp(prev2_wd, "INTO") == 0)
{
static const char *const list_INSERT[] =
{"(", "DEFAULT VALUES", "SELECT", "TABLE", "VALUES", NULL};
COMPLETE_WITH_LIST(list_INSERT);
}
/*
* Complete INSERT INTO <table> (attribs) with "VALUES" or "SELECT" or
* "TABLE"
*/
else if (pg_strcasecmp(prev4_wd, "INSERT") == 0 &&
pg_strcasecmp(prev3_wd, "INTO") == 0 &&
prev_wd[strlen(prev_wd) - 1] == ')')
{
static const char *const list_INSERT[] =
{"SELECT", "TABLE", "VALUES", NULL};
COMPLETE_WITH_LIST(list_INSERT);
}
/* Insert an open parenthesis after "VALUES" */
else if (pg_strcasecmp(prev_wd, "VALUES") == 0 &&
pg_strcasecmp(prev2_wd, "DEFAULT") != 0)
COMPLETE_WITH_CONST("(");
/* LOCK */
/* Complete LOCK [TABLE] with a list of tables */
else if (pg_strcasecmp(prev_wd, "LOCK") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'TABLE'");
else if (pg_strcasecmp(prev_wd, "TABLE") == 0 &&
pg_strcasecmp(prev2_wd, "LOCK") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
/* For the following, handle the case of a single table only for now */
/* Complete LOCK [TABLE] <table> with "IN" */
else if ((pg_strcasecmp(prev2_wd, "LOCK") == 0 &&
pg_strcasecmp(prev_wd, "TABLE")) ||
(pg_strcasecmp(prev2_wd, "TABLE") == 0 &&
pg_strcasecmp(prev3_wd, "LOCK") == 0))
COMPLETE_WITH_CONST("IN");
/* Complete LOCK [TABLE] <table> IN with a lock mode */
else if (pg_strcasecmp(prev_wd, "IN") == 0 &&
(pg_strcasecmp(prev3_wd, "LOCK") == 0 ||
(pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev4_wd, "LOCK") == 0)))
{
static const char *const lock_modes[] =
{"ACCESS SHARE MODE",
"ROW SHARE MODE", "ROW EXCLUSIVE MODE",
"SHARE UPDATE EXCLUSIVE MODE", "SHARE MODE",
"SHARE ROW EXCLUSIVE MODE",
"EXCLUSIVE MODE", "ACCESS EXCLUSIVE MODE", NULL};
COMPLETE_WITH_LIST(lock_modes);
}
/* NOTIFY */
else if (pg_strcasecmp(prev_wd, "NOTIFY") == 0)
if (pset.sversion >= 80210 && pset.sversion < 80220)
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(relname) FROM pg_catalog.pg_listener WHERE substring(pg_catalog.quote_ident(relname),1,%d)='%s'");
else
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(channel) FROM pg_catalog.pg_listening_channels() AS channel WHERE substring(pg_catalog.quote_ident(channel),1,%d)='%s'");
/* OPTIONS */
else if (pg_strcasecmp(prev_wd, "OPTIONS") == 0)
COMPLETE_WITH_CONST("(");
/* OWNER TO - complete with available roles */
else if (pg_strcasecmp(prev2_wd, "OWNER") == 0 &&
pg_strcasecmp(prev_wd, "TO") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
/* ORDER BY */
else if (pg_strcasecmp(prev3_wd, "FROM") == 0 &&
pg_strcasecmp(prev_wd, "ORDER") == 0)
COMPLETE_WITH_CONST("BY");
else if (pg_strcasecmp(prev4_wd, "FROM") == 0 &&
pg_strcasecmp(prev2_wd, "ORDER") == 0 &&
pg_strcasecmp(prev_wd, "BY") == 0)
COMPLETE_WITH_ATTR(prev3_wd, "");
/* PREPARE xx AS */
else if (pg_strcasecmp(prev_wd, "AS") == 0 &&
pg_strcasecmp(prev3_wd, "PREPARE") == 0)
{
static const char *const list_PREPARE[] =
{"SELECT", "UPDATE", "INSERT", "DELETE", NULL};
COMPLETE_WITH_LIST(list_PREPARE);
}
/*
* PREPARE TRANSACTION is missing on purpose. It's intended for transaction
* managers, not for manual use in interactive sessions.
*/
/* REASSIGN OWNED BY xxx TO yyy */
else if (pg_strcasecmp(prev_wd, "REASSIGN") == 0)
COMPLETE_WITH_CONST("OWNED");
else if (pg_strcasecmp(prev_wd, "OWNED") == 0 &&
pg_strcasecmp(prev2_wd, "REASSIGN") == 0)
COMPLETE_WITH_CONST("BY");
else if (pg_strcasecmp(prev_wd, "BY") == 0 &&
pg_strcasecmp(prev2_wd, "OWNED") == 0 &&
pg_strcasecmp(prev3_wd, "REASSIGN") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
else if (pg_strcasecmp(prev2_wd, "BY") == 0 &&
pg_strcasecmp(prev3_wd, "OWNED") == 0 &&
pg_strcasecmp(prev4_wd, "REASSIGN") == 0)
COMPLETE_WITH_CONST("TO");
else if (pg_strcasecmp(prev_wd, "TO") == 0 &&
pg_strcasecmp(prev3_wd, "BY") == 0 &&
pg_strcasecmp(prev4_wd, "OWNED") == 0 &&
pg_strcasecmp(prev5_wd, "REASSIGN") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
/* REINDEX */
else if (pg_strcasecmp(prev_wd, "REINDEX") == 0)
{
static const char *const list_REINDEX[] =
{"TABLE", "INDEX", "SYSTEM", "DATABASE", NULL};
COMPLETE_WITH_LIST(list_REINDEX);
}
else if (pg_strcasecmp(prev2_wd, "REINDEX") == 0)
{
if (pg_strcasecmp(prev_wd, "TABLE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
else if (pg_strcasecmp(prev_wd, "INDEX") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes, NULL);
else if (pg_strcasecmp(prev_wd, "SYSTEM") == 0 ||
pg_strcasecmp(prev_wd, "DATABASE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_databases);
}
/* SELECT */
/* naah . . . */
/* SET, RESET, SHOW */
/* Complete with a variable name */
else if ((pg_strcasecmp(prev_wd, "SET") == 0 &&
pg_strcasecmp(prev3_wd, "UPDATE") != 0) ||
pg_strcasecmp(prev_wd, "RESET") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_set_vars);
else if (pg_strcasecmp(prev_wd, "SHOW") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_show_vars);
/* Complete "SET TRANSACTION" */
else if ((pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "TRANSACTION") == 0)
|| (pg_strcasecmp(prev2_wd, "START") == 0
&& pg_strcasecmp(prev_wd, "TRANSACTION") == 0)
|| (pg_strcasecmp(prev2_wd, "BEGIN") == 0
&& pg_strcasecmp(prev_wd, "WORK") == 0)
|| (pg_strcasecmp(prev2_wd, "BEGIN") == 0
&& pg_strcasecmp(prev_wd, "TRANSACTION") == 0)
|| (pg_strcasecmp(prev4_wd, "SESSION") == 0
&& pg_strcasecmp(prev3_wd, "CHARACTERISTICS") == 0
&& pg_strcasecmp(prev2_wd, "AS") == 0
&& pg_strcasecmp(prev_wd, "TRANSACTION") == 0))
{
static const char *const my_list[] =
{"ISOLATION LEVEL", "READ", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if ((pg_strcasecmp(prev3_wd, "SET") == 0
|| pg_strcasecmp(prev3_wd, "BEGIN") == 0
|| pg_strcasecmp(prev3_wd, "START") == 0
|| (pg_strcasecmp(prev4_wd, "CHARACTERISTICS") == 0
&& pg_strcasecmp(prev3_wd, "AS") == 0))
&& (pg_strcasecmp(prev2_wd, "TRANSACTION") == 0
|| pg_strcasecmp(prev2_wd, "WORK") == 0)
&& pg_strcasecmp(prev_wd, "ISOLATION") == 0)
COMPLETE_WITH_CONST("LEVEL");
else if ((pg_strcasecmp(prev4_wd, "SET") == 0
|| pg_strcasecmp(prev4_wd, "BEGIN") == 0
|| pg_strcasecmp(prev4_wd, "START") == 0
|| pg_strcasecmp(prev4_wd, "AS") == 0)
&& (pg_strcasecmp(prev3_wd, "TRANSACTION") == 0
|| pg_strcasecmp(prev3_wd, "WORK") == 0)
&& pg_strcasecmp(prev2_wd, "ISOLATION") == 0
&& pg_strcasecmp(prev_wd, "LEVEL") == 0)
{
static const char *const my_list[] =
{"READ", "REPEATABLE", "SERIALIZABLE", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if ((pg_strcasecmp(prev4_wd, "TRANSACTION") == 0 ||
pg_strcasecmp(prev4_wd, "WORK") == 0) &&
pg_strcasecmp(prev3_wd, "ISOLATION") == 0 &&
pg_strcasecmp(prev2_wd, "LEVEL") == 0 &&
pg_strcasecmp(prev_wd, "READ") == 0)
{
static const char *const my_list[] =
{"UNCOMMITTED", "COMMITTED", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if ((pg_strcasecmp(prev4_wd, "TRANSACTION") == 0 ||
pg_strcasecmp(prev4_wd, "WORK") == 0) &&
pg_strcasecmp(prev3_wd, "ISOLATION") == 0 &&
pg_strcasecmp(prev2_wd, "LEVEL") == 0 &&
pg_strcasecmp(prev_wd, "REPEATABLE") == 0)
COMPLETE_WITH_CONST("READ");
else if ((pg_strcasecmp(prev3_wd, "SET") == 0 ||
pg_strcasecmp(prev3_wd, "BEGIN") == 0 ||
pg_strcasecmp(prev3_wd, "START") == 0 ||
pg_strcasecmp(prev3_wd, "AS") == 0) &&
(pg_strcasecmp(prev2_wd, "TRANSACTION") == 0 ||
pg_strcasecmp(prev2_wd, "WORK") == 0) &&
pg_strcasecmp(prev_wd, "READ") == 0)
{
static const char *const my_list[] =
{"ONLY", "WRITE", NULL};
COMPLETE_WITH_LIST(my_list);
}
/* Complete SET CONSTRAINTS <foo> with DEFERRED|IMMEDIATE */
else if (pg_strcasecmp(prev3_wd, "SET") == 0 &&
pg_strcasecmp(prev2_wd, "CONSTRAINTS") == 0)
{
static const char *const constraint_list[] =
{"DEFERRED", "IMMEDIATE", NULL};
COMPLETE_WITH_LIST(constraint_list);
}
/* Complete SET ROLE */
else if (pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "ROLE") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
/* Complete SET SESSION with AUTHORIZATION or CHARACTERISTICS... */
else if (pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev_wd, "SESSION") == 0)
{
static const char *const my_list[] =
{"AUTHORIZATION", "CHARACTERISTICS AS TRANSACTION", NULL};
COMPLETE_WITH_LIST(my_list);
}
/* Complete SET SESSION AUTHORIZATION with username */
else if (pg_strcasecmp(prev3_wd, "SET") == 0
&& pg_strcasecmp(prev2_wd, "SESSION") == 0
&& pg_strcasecmp(prev_wd, "AUTHORIZATION") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles " UNION SELECT 'DEFAULT'");
/* Complete RESET SESSION with AUTHORIZATION */
else if (pg_strcasecmp(prev2_wd, "RESET") == 0 &&
pg_strcasecmp(prev_wd, "SESSION") == 0)
COMPLETE_WITH_CONST("AUTHORIZATION");
/* Complete SET <var> with "TO" */
else if (pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev4_wd, "UPDATE") != 0 &&
pg_strcasecmp(prev_wd, "TABLESPACE") != 0 &&
pg_strcasecmp(prev_wd, "SCHEMA") != 0 &&
prev_wd[strlen(prev_wd) - 1] != ')' &&
pg_strcasecmp(prev4_wd, "DOMAIN") != 0)
COMPLETE_WITH_CONST("TO");
/* Suggest possible variable values */
else if (pg_strcasecmp(prev3_wd, "SET") == 0 &&
(pg_strcasecmp(prev_wd, "TO") == 0 || strcmp(prev_wd, "=") == 0))
{
if (pg_strcasecmp(prev2_wd, "DateStyle") == 0)
{
static const char *const my_list[] =
{"ISO", "SQL", "Postgres", "German",
"YMD", "DMY", "MDY",
"US", "European", "NonEuropean",
"DEFAULT", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if (pg_strcasecmp(prev2_wd, "IntervalStyle") == 0)
{
static const char *const my_list[] =
{"postgres", "postgres_verbose", "sql_standard", "iso_8601", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if (pg_strcasecmp(prev2_wd, "GEQO") == 0)
{
static const char *const my_list[] =
{"ON", "OFF", "DEFAULT", NULL};
COMPLETE_WITH_LIST(my_list);
}
else
{
static const char *const my_list[] =
{"DEFAULT", NULL};
COMPLETE_WITH_LIST(my_list);
}
}
/* START TRANSACTION */
else if (pg_strcasecmp(prev_wd, "START") == 0)
COMPLETE_WITH_CONST("TRANSACTION");
/* TRUNCATE */
else if (pg_strcasecmp(prev_wd, "TRUNCATE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* UNLISTEN */
else if (pg_strcasecmp(prev_wd, "UNLISTEN") == 0)
if (pset.sversion >= 80210 && pset.sversion < 80220)
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(relname) FROM pg_catalog.pg_listener WHERE substring(pg_catalog.quote_ident(relname),1,%d)='%s'");
else
COMPLETE_WITH_QUERY("SELECT pg_catalog.quote_ident(channel) FROM pg_catalog.pg_listening_channels() AS channel WHERE substring(pg_catalog.quote_ident(channel),1,%d)='%s' UNION SELECT '*'");
/* UPDATE */
/* If prev. word is UPDATE suggest a list of tables */
else if (pg_strcasecmp(prev_wd, "UPDATE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* Complete UPDATE <table> with "SET" */
else if (pg_strcasecmp(prev2_wd, "UPDATE") == 0)
COMPLETE_WITH_CONST("SET");
/*
* If the previous word is SET (and it wasn't caught above as the _first_
* word) the word before it was (hopefully) a table name and we'll now
* make a list of attributes.
*/
else if (pg_strcasecmp(prev_wd, "SET") == 0)
COMPLETE_WITH_ATTR(prev2_wd, "");
/* UPDATE xx SET yy = */
else if (pg_strcasecmp(prev2_wd, "SET") == 0 &&
pg_strcasecmp(prev4_wd, "UPDATE") == 0)
COMPLETE_WITH_CONST("=");
/* USER MAPPING */
else if ((pg_strcasecmp(prev3_wd, "ALTER") == 0 ||
pg_strcasecmp(prev3_wd, "CREATE") == 0 ||
pg_strcasecmp(prev3_wd, "DROP") == 0) &&
pg_strcasecmp(prev2_wd, "USER") == 0 &&
pg_strcasecmp(prev_wd, "MAPPING") == 0)
COMPLETE_WITH_CONST("FOR");
else if (pg_strcasecmp(prev4_wd, "CREATE") == 0 &&
pg_strcasecmp(prev3_wd, "USER") == 0 &&
pg_strcasecmp(prev2_wd, "MAPPING") == 0 &&
pg_strcasecmp(prev_wd, "FOR") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles
" UNION SELECT 'CURRENT_USER'"
" UNION SELECT 'PUBLIC'"
" UNION SELECT 'USER'");
else if ((pg_strcasecmp(prev4_wd, "ALTER") == 0 ||
pg_strcasecmp(prev4_wd, "DROP") == 0) &&
pg_strcasecmp(prev3_wd, "USER") == 0 &&
pg_strcasecmp(prev2_wd, "MAPPING") == 0 &&
pg_strcasecmp(prev_wd, "FOR") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_user_mappings);
else if ((pg_strcasecmp(prev5_wd, "CREATE") == 0 ||
pg_strcasecmp(prev5_wd, "ALTER") == 0 ||
pg_strcasecmp(prev5_wd, "DROP") == 0) &&
pg_strcasecmp(prev4_wd, "USER") == 0 &&
pg_strcasecmp(prev3_wd, "MAPPING") == 0 &&
pg_strcasecmp(prev2_wd, "FOR") == 0)
COMPLETE_WITH_CONST("SERVER");
/*
* VACUUM [ FULL | FREEZE ] [ VERBOSE ] [ table ]
* VACUUM [ FULL | FREEZE ] [ VERBOSE ] ANALYZE [ table [ (column [, ...] ) ] ]
*/
else if (pg_strcasecmp(prev_wd, "VACUUM") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'FULL'"
" UNION SELECT 'FREEZE'"
" UNION SELECT 'ANALYZE'"
" UNION SELECT 'VERBOSE'");
else if (pg_strcasecmp(prev2_wd, "VACUUM") == 0 &&
(pg_strcasecmp(prev_wd, "FULL") == 0 ||
pg_strcasecmp(prev_wd, "FREEZE") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'ANALYZE'"
" UNION SELECT 'VERBOSE'");
else if (pg_strcasecmp(prev3_wd, "VACUUM") == 0 &&
pg_strcasecmp(prev_wd, "ANALYZE") == 0 &&
(pg_strcasecmp(prev2_wd, "FULL") == 0 ||
pg_strcasecmp(prev2_wd, "FREEZE") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'VERBOSE'");
else if (pg_strcasecmp(prev3_wd, "VACUUM") == 0 &&
pg_strcasecmp(prev_wd, "VERBOSE") == 0 &&
(pg_strcasecmp(prev2_wd, "FULL") == 0 ||
pg_strcasecmp(prev2_wd, "FREEZE") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'ANALYZE'");
else if (pg_strcasecmp(prev2_wd, "VACUUM") == 0 &&
pg_strcasecmp(prev_wd, "VERBOSE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'ANALYZE'");
else if (pg_strcasecmp(prev2_wd, "VACUUM") == 0 &&
pg_strcasecmp(prev_wd, "ANALYZE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables,
" UNION SELECT 'VERBOSE'");
else if ((pg_strcasecmp(prev_wd, "ANALYZE") == 0 &&
pg_strcasecmp(prev2_wd, "VERBOSE") == 0) ||
(pg_strcasecmp(prev_wd, "VERBOSE") == 0 &&
pg_strcasecmp(prev2_wd, "ANALYZE") == 0))
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* WITH [RECURSIVE] */
else if (pg_strcasecmp(prev_wd, "WITH") == 0)
COMPLETE_WITH_CONST("RECURSIVE");
/* ANALYZE */
/* If the previous word is ANALYZE, produce list of tables */
else if (pg_strcasecmp(prev_wd, "ANALYZE") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
/* WHERE */
/* Simple case of the word before the where being the table name */
else if (pg_strcasecmp(prev_wd, "WHERE") == 0)
COMPLETE_WITH_ATTR(prev2_wd, "");
/* ... FROM ... */
/* TODO: also include SRF ? */
else if (pg_strcasecmp(prev_wd, "FROM") == 0 &&
pg_strcasecmp(prev3_wd, "COPY") != 0 &&
pg_strcasecmp(prev3_wd, "\\copy") != 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv, NULL);
/* Backslash commands */
/* TODO: \dc \dd \dl */
else if (strcmp(prev_wd, "\\connect") == 0 || strcmp(prev_wd, "\\c") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_databases);
else if (strncmp(prev_wd, "\\da", strlen("\\da")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_aggregates, NULL);
else if (strncmp(prev_wd, "\\db", strlen("\\db")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
else if (strncmp(prev_wd, "\\dD", strlen("\\dD")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_domains, NULL);
else if (strncmp(prev_wd, "\\des", strlen("\\des")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_servers);
else if (strncmp(prev_wd, "\\deu", strlen("\\deu")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_user_mappings);
else if (strncmp(prev_wd, "\\dew", strlen("\\dew")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_fdws);
else if (strncmp(prev_wd, "\\df", strlen("\\df")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);
else if (strncmp(prev_wd, "\\dFd", strlen("\\dFd")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_ts_dictionaries);
else if (strncmp(prev_wd, "\\dFp", strlen("\\dFp")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_ts_parsers);
else if (strncmp(prev_wd, "\\dFt", strlen("\\dFt")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_ts_templates);
/* must be at end of \dF */
else if (strncmp(prev_wd, "\\dF", strlen("\\dF")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_ts_configurations);
else if (strncmp(prev_wd, "\\di", strlen("\\di")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_indexes, NULL);
else if (strncmp(prev_wd, "\\dn", strlen("\\dn")) == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_schemas);
else if (strncmp(prev_wd, "\\dp", strlen("\\dp")) == 0
|| strncmp(prev_wd, "\\z", strlen("\\z")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tsv, NULL);
else if (strncmp(prev_wd, "\\ds", strlen("\\ds")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_sequences, NULL);
else if (strncmp(prev_wd, "\\dt", strlen("\\dt")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
else if (strncmp(prev_wd, "\\dT", strlen("\\dT")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_datatypes, NULL);
else if (strncmp(prev_wd, "\\du", strlen("\\du")) == 0
|| (strncmp(prev_wd, "\\dg", strlen("\\dg")) == 0))
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
else if (strncmp(prev_wd, "\\dv", strlen("\\dv")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views, NULL);
/* must be at end of \d list */
else if (strncmp(prev_wd, "\\d", strlen("\\d")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tisv, NULL);
else if (strcmp(prev_wd, "\\ef") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);
else if (strcmp(prev_wd, "\\encoding") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_encodings);
else if (strcmp(prev_wd, "\\h") == 0 || strcmp(prev_wd, "\\help") == 0)
COMPLETE_WITH_LIST(sql_commands);
else if (strcmp(prev_wd, "\\password") == 0)
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
else if (strcmp(prev_wd, "\\pset") == 0)
{
static const char *const my_list[] =
{"format", "border", "expanded",
"null", "fieldsep", "tuples_only", "title", "tableattr",
"linestyle", "pager", "recordsep", NULL};
COMPLETE_WITH_LIST(my_list);
}
else if (strcmp(prev_wd, "\\cd") == 0 ||
strcmp(prev_wd, "\\e") == 0 || strcmp(prev_wd, "\\edit") == 0 ||
strcmp(prev_wd, "\\g") == 0 ||
strcmp(prev_wd, "\\i") == 0 || strcmp(prev_wd, "\\include") == 0 ||
strcmp(prev_wd, "\\o") == 0 || strcmp(prev_wd, "\\out") == 0 ||
strcmp(prev_wd, "\\s") == 0 ||
strcmp(prev_wd, "\\w") == 0 || strcmp(prev_wd, "\\write") == 0
)
matches = completion_matches(text, filename_completion_function);
/*
* Finally, we look through the list of "things", such as TABLE, INDEX and
* check if that was the previous word. If so, execute the query to get a
* list of them.
*/
else
{
int i;
for (i = 0; words_after_create[i].name; i++)
{
if (pg_strcasecmp(prev_wd, words_after_create[i].name) == 0)
{
if (words_after_create[i].query)
COMPLETE_WITH_QUERY(words_after_create[i].query);
else if (words_after_create[i].squery)
COMPLETE_WITH_SCHEMA_QUERY(*words_after_create[i].squery,
NULL);
break;
}
}
}
/*
* If we still don't have anything to match we have to fabricate some sort
* of default list. If we were to just return NULL, readline automatically
* attempts filename completion, and that's usually no good.
*/
if (matches == NULL)
{
COMPLETE_WITH_CONST("");
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
rl_completion_append_character = '\0';
#endif
}
/* free storage */
free(prev_wd);
free(prev2_wd);
free(prev3_wd);
free(prev4_wd);
free(prev5_wd);
/* Return our Grand List O' Matches */
return matches;
}
/*
* GENERATOR FUNCTIONS
*
* These functions do all the actual work of completing the input. They get
* passed the text so far and the count how many times they have been called
* so far with the same text.
* If you read the above carefully, you'll see that these don't get called
* directly but through the readline interface.
* The return value is expected to be the full completion of the text, going
* through a list each time, or NULL if there are no more matches. The string
* will be free()'d by readline, so you must run it through strdup() or
* something of that sort.
*/
/*
* This one gives you one from a list of things you can put after CREATE
* as defined above.
*/
static char *
create_command_generator(const char *text, int state)
{
static int list_index,
string_length;
const char *name;
/* If this is the first time for this completion, init some values */
if (state == 0)
{
list_index = 0;
string_length = strlen(text);
}
/* find something that matches */
while ((name = words_after_create[list_index++].name))
{
if ((pg_strncasecmp(name, text, string_length) == 0) &&
!words_after_create[list_index - 1].noshow)
return pg_strdup(name);
}
/* if nothing matches, return NULL */
return NULL;
}
/*
* This function gives you a list of things you can put after a DROP command.
* Very similar to create_command_generator, but has an additional entry for
* OWNED BY. (We do it this way in order not to duplicate the
* words_after_create list.)
*/
static char *
drop_command_generator(const char *text, int state)
{
static int list_index,
string_length;
const char *name;
if (state == 0)
{
/* If this is the first time for this completion, init some values */
list_index = 0;
string_length = strlen(text);
/*
* DROP can be followed by "OWNED BY", which is not found in the list
* for CREATE matches, so make it the first state. (We do not make it
* the last state because it would be more difficult to detect when we
* have to return NULL instead.)
*
* Make sure we advance to the next state.
*/
list_index++;
if (pg_strncasecmp("OWNED", text, string_length) == 0)
return pg_strdup("OWNED");
}
/*
* In subsequent attempts, try to complete with the same items we use for
* CREATE
*/
while ((name = words_after_create[list_index++ - 1].name))
{
if ((pg_strncasecmp(name, text, string_length) == 0) && (!words_after_create[list_index - 2].noshow))
return pg_strdup(name);
}
/* if nothing matches, return NULL */
return NULL;
}
/* The following two functions are wrappers for _complete_from_query */
static char *
complete_from_query(const char *text, int state)
{
return _complete_from_query(0, text, state);
}
static char *
complete_from_schema_query(const char *text, int state)
{
return _complete_from_query(1, text, state);
}
/*
* This creates a list of matching things, according to a query pointed to
* by completion_charp.
* The query can be one of two kinds:
*
* 1. A simple query which must contain a %d and a %s, which will be replaced
* by the string length of the text and the text itself. The query may also
* have up to four more %s in it; the first two such will be replaced by the
* value of completion_info_charp, the next two by the value of
* completion_info_charp2.
*
* 2. A schema query used for completion of both schema and relation names.
* These are more complex and must contain in the following order:
* %d %s %d %s %d %s %s %d %s
* where %d is the string length of the text and %s the text itself.
*
* It is assumed that strings should be escaped to become SQL literals
* (that is, what is in the query is actually ... '%s' ...)
*
* See top of file for examples of both kinds of query.
*/
static char *
_complete_from_query(int is_schema_query, const char *text, int state)
{
static int list_index,
string_length;
static PGresult *result = NULL;
/*
* If this is the first time for this completion, we fetch a list of our
* "things" from the backend.
*/
if (state == 0)
{
PQExpBufferData query_buffer;
char *e_text;
char *e_info_charp;
char *e_info_charp2;
list_index = 0;
string_length = strlen(text);
/* Free any prior result */
PQclear(result);
result = NULL;
/* Set up suitably-escaped copies of textual inputs */
e_text = pg_malloc(string_length * 2 + 1);
PQescapeString(e_text, text, string_length);
if (completion_info_charp)
{
size_t charp_len;
charp_len = strlen(completion_info_charp);
e_info_charp = pg_malloc(charp_len * 2 + 1);
PQescapeString(e_info_charp, completion_info_charp,
charp_len);
}
else
e_info_charp = NULL;
if (completion_info_charp2)
{
size_t charp_len;
charp_len = strlen(completion_info_charp2);
e_info_charp2 = pg_malloc(charp_len * 2 + 1);
PQescapeString(e_info_charp2, completion_info_charp2,
charp_len);
}
else
e_info_charp2 = NULL;
initPQExpBuffer(&query_buffer);
if (is_schema_query)
{
/* completion_squery gives us the pieces to assemble */
const char *qualresult = completion_squery->qualresult;
if (qualresult == NULL)
qualresult = completion_squery->result;
/* Get unqualified names matching the input-so-far */
appendPQExpBuffer(&query_buffer, "SELECT %s FROM %s WHERE ",
completion_squery->result,
completion_squery->catname);
if (completion_squery->selcondition)
appendPQExpBuffer(&query_buffer, "%s AND ",
completion_squery->selcondition);
appendPQExpBuffer(&query_buffer, "substring(%s,1,%d)='%s'",
completion_squery->result,
string_length, e_text);
appendPQExpBuffer(&query_buffer, " AND %s",
completion_squery->viscondition);
/*
* When fetching relation names, suppress system catalogs unless
* the input-so-far begins with "pg_" or "gp_". This is a compromise
* between not offering system catalogs for completion at all, and
* having them swamp the result when the input is just "p".
*/
if (strcmp(completion_squery->catname,
"pg_catalog.pg_class c") == 0 &&
strncmp(text, "pg_", 3) != 0 &&
strncmp(text, "gp_", 3) != 0)
{
appendPQExpBuffer(&query_buffer,
" AND c.relnamespace <> (SELECT oid FROM"
" pg_catalog.pg_namespace WHERE nspname = 'pg_catalog')");
}
/*
* Add in matching schema names, but only if there is more than
* one potential match among schema names.
*/
appendPQExpBuffer(&query_buffer, "\nUNION\n"
"SELECT pg_catalog.quote_ident(n.nspname) || '.' "
"FROM pg_catalog.pg_namespace n "
"WHERE substring(pg_catalog.quote_ident(n.nspname) || '.',1,%d)='%s'",
string_length, e_text);
appendPQExpBuffer(&query_buffer,
" AND (SELECT pg_catalog.count(*)"
" FROM pg_catalog.pg_namespace"
" WHERE substring(pg_catalog.quote_ident(nspname) || '.',1,%d) ="
" substring('%s',1,pg_catalog.length(pg_catalog.quote_ident(nspname))+1)) > 1",
string_length, e_text);
/*
* Add in matching qualified names, but only if there is exactly
* one schema matching the input-so-far.
*/
appendPQExpBuffer(&query_buffer, "\nUNION\n"
"SELECT pg_catalog.quote_ident(n.nspname) || '.' || %s "
"FROM %s, pg_catalog.pg_namespace n "
"WHERE %s = n.oid AND ",
qualresult,
completion_squery->catname,
completion_squery->namespace);
if (completion_squery->selcondition)
appendPQExpBuffer(&query_buffer, "%s AND ",
completion_squery->selcondition);
appendPQExpBuffer(&query_buffer, "substring(pg_catalog.quote_ident(n.nspname) || '.' || %s,1,%d)='%s'",
qualresult,
string_length, e_text);
/*
* This condition exploits the single-matching-schema rule to
* speed up the query
*/
appendPQExpBuffer(&query_buffer,
" AND substring(pg_catalog.quote_ident(n.nspname) || '.',1,%d) ="
" substring('%s',1,pg_catalog.length(pg_catalog.quote_ident(n.nspname))+1)",
string_length, e_text);
appendPQExpBuffer(&query_buffer,
" AND (SELECT pg_catalog.count(*)"
" FROM pg_catalog.pg_namespace"
" WHERE substring(pg_catalog.quote_ident(nspname) || '.',1,%d) ="
" substring('%s',1,pg_catalog.length(pg_catalog.quote_ident(nspname))+1)) = 1",
string_length, e_text);
/* If an addon query was provided, use it */
if (completion_charp)
appendPQExpBuffer(&query_buffer, "\n%s", completion_charp);
}
else
{
/* completion_charp is an sprintf-style format string */
appendPQExpBuffer(&query_buffer, completion_charp,
string_length, e_text,
e_info_charp, e_info_charp,
e_info_charp2, e_info_charp2);
}
/* Limit the number of records in the result */
appendPQExpBuffer(&query_buffer, "\nLIMIT %d",
completion_max_records);
result = exec_query(query_buffer.data);
termPQExpBuffer(&query_buffer);
free(e_text);
if (e_info_charp)
free(e_info_charp);
if (e_info_charp2)
free(e_info_charp2);
}
/* Find something that matches */
if (result && PQresultStatus(result) == PGRES_TUPLES_OK)
{
const char *item;
while (list_index < PQntuples(result) &&
(item = PQgetvalue(result, list_index++, 0)))
if (pg_strncasecmp(text, item, string_length) == 0)
return pg_strdup(item);
}
/* If nothing matches, free the db structure and return null */
PQclear(result);
result = NULL;
return NULL;
}
/*
* This function returns in order one of a fixed, NULL pointer terminated list
* of strings (if matching). This can be used if there are only a fixed number
* SQL words that can appear at certain spot.
*/
static char *
complete_from_list(const char *text, int state)
{
static int string_length,
list_index,
matches;
static bool casesensitive;
const char *item;
/* need to have a list */
psql_assert(completion_charpp);
/* Initialization */
if (state == 0)
{
list_index = 0;
string_length = strlen(text);
casesensitive = true;
matches = 0;
}
while ((item = completion_charpp[list_index++]))
{
/* First pass is case sensitive */
if (casesensitive && strncmp(text, item, string_length) == 0)
{
matches++;
return pg_strdup(item);
}
/* Second pass is case insensitive, don't bother counting matches */
if (!casesensitive && pg_strncasecmp(text, item, string_length) == 0)
return pg_strdup(item);
}
/*
* No matches found. If we're not case insensitive already, lets switch to
* being case insensitive and try again
*/
if (casesensitive && matches == 0)
{
casesensitive = false;
list_index = 0;
state++;
return complete_from_list(text, state);
}
/* If no more matches, return null. */
return NULL;
}
/*
* This function returns one fixed string the first time even if it doesn't
* match what's there, and nothing the second time. This should be used if
* there is only one possibility that can appear at a certain spot, so
* misspellings will be overwritten. The string to be passed must be in
* completion_charp.
*/
static char *
complete_from_const(const char *text, int state)
{
(void) text; /* We don't care about what was entered
* already. */
psql_assert(completion_charp);
if (state == 0)
return pg_strdup(completion_charp);
else
return NULL;
}
/* HELPER FUNCTIONS */
/*
* Execute a query and report any errors. This should be the preferred way of
* talking to the database in this file.
*/
static PGresult *
exec_query(const char *query)
{
PGresult *result;
if (query == NULL || !pset.db || PQstatus(pset.db) != CONNECTION_OK)
return NULL;
result = PQexec(pset.db, query);
if (PQresultStatus(result) != PGRES_TUPLES_OK)
{
#ifdef NOT_USED
psql_error("tab completion query failed: %s\nQuery was:\n%s\n",
PQerrorMessage(pset.db), query);
#endif
PQclear(result);
result = NULL;
}
return result;
}
/*
* Return the word (space delimited) before point. Set skip > 0 to
* skip that many words; e.g. skip=1 finds the word before the
* previous one. Return value is NULL or a malloc'ed string.
*/
static char *
previous_word(int point, int skip)
{
int i,
start = 0,
end = -1,
inquotes = 0;
char *s;
const char *buf = rl_line_buffer; /* alias */
/* first we look for a space or a parenthesis before the current word */
for (i = point - 1; i >= 0; i--)
if (strchr(WORD_BREAKS, buf[i]))
break;
point = i;
while (skip-- >= 0)
{
int parentheses = 0;
/* now find the first non-space which then constitutes the end */
for (i = point; i >= 0; i--)
if (buf[i] != ' ')
{
end = i;
break;
}
/*
* If no end found we return null, because there is no word before the
* point
*/
if (end == -1)
return NULL;
/*
* Otherwise we now look for the start. The start is either the last
* character before any space going backwards from the end, or it's
* simply character 0. We also handle open quotes and parentheses.
*/
for (start = end; start > 0; start--)
{
if (buf[start] == '"')
inquotes = !inquotes;
if (inquotes == 0)
{
if (buf[start] == ')')
parentheses++;
else if (buf[start] == '(')
{
if (--parentheses <= 0)
break;
}
else if (parentheses == 0 &&
strchr(WORD_BREAKS, buf[start - 1]))
break;
}
}
point = start - 1;
}
/* make a copy */
s = pg_malloc(end - start + 2);
strlcpy(s, &buf[start], end - start + 2);
return s;
}
#ifdef NOT_USED
/*
* Surround a string with single quotes. This works for both SQL and
* psql internal. Currently disabled because it is reported not to
* cooperate with certain versions of readline.
*/
static char *
quote_file_name(char *text, int match_type, char *quote_pointer)
{
char *s;
size_t length;
(void) quote_pointer; /* not used */
length = strlen(text) +(match_type == SINGLE_MATCH ? 3 : 2);
s = pg_malloc(length);
s[0] = '\'';
strcpy(s + 1, text);
if (match_type == SINGLE_MATCH)
s[length - 2] = '\'';
s[length - 1] = '\0';
return s;
}
static char *
dequote_file_name(char *text, char quote_char)
{
char *s;
size_t length;
if (!quote_char)
return pg_strdup(text);
length = strlen(text);
s = pg_malloc(length - 2 + 1);
strlcpy(s, text +1, length - 2 + 1);
return s;
}
#endif /* NOT_USED */
#endif /* USE_READLINE */
| [
"rvs@apache.org"
] | rvs@apache.org |
a8d6f3258d2299bd895b35b6bb41006def30945a | 468c81e1ee3ada3959b3d02c415d5d0c009dcf23 | /linked_list/src/unit_tests.c | 67db2ed7cfd097064a89e5c388ffb4a6b83f9805 | [] | no_license | scagle/linked_list | d468c0847ec722ed7f195bcb41a4b2532af5c84c | 8a577ebdfc64d67293e2c1f65b59ed40bea90c04 | refs/heads/master | 2022-11-23T05:18:05.240248 | 2020-07-27T03:16:51 | 2020-07-27T03:31:02 | 282,783,808 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 12,069 | c | #include <stdio.h>
#include <stdlib.h>
#include "unit_tests.h"
#include "external/minunit.h"
/* Local helper function headers */
static char* test_free_linked_list(ListHead** head);
static char* test_linked_list_depth(ListHead* head, int expected_size);
static char* test_data_sequence(ListHead* head, int *sequence, int sequence_length);
static char* evaluate_operation_result(ListHead** head, int* sequence, int sequence_length, bool want, bool got);
int tests_run = 0; // incremented by minunit.h macros
static UnitTest unit_tests[] = {
run_test_create_linked_list_header,
run_test_free_linked_list_null,
run_test_free_linked_list_empty,
run_test_free_linked_list_not_empty,
run_test_append_link_null_head,
run_test_append_link_empty,
run_test_append_link_not_empty,
run_test_insert_link_null,
run_test_insert_link_begin_empty,
run_test_insert_link_begin_non_empty,
run_test_insert_link_middle,
run_test_insert_link_end,
run_test_insert_link_after_empty,
run_test_insert_link_after_non_empty,
run_test_remove_link_null,
run_test_remove_link_empty,
run_test_remove_link_begin,
run_test_remove_link_middle,
run_test_remove_link_end,
run_test_remove_link_after_empty,
run_test_remove_link_after_non_empty,
};
int run_unit_tests() {
printf("Unit Tests:\n");
const size_t num_unit_tests = sizeof(unit_tests) / sizeof(unit_tests[0]);
if (num_unit_tests == 0) {
printf("*** Warning: No Unit Tests!\n");
return 1;
}
int failed = 0;
for (int i = 0; i < num_unit_tests; i++) {
char* message = run_unit_test(unit_tests[i]);
if (message != 0) {
printf("unit_tests[%d] failed:\n'%s'\n\n", i, message);
failed++;
}
}
printf("Ran '%d' Unit Tests!\n'%d' Passes, '%d' Failures\n", tests_run, tests_run-failed, failed);
return (failed);
}
static char* run_unit_test(UnitTest test) {
mu_run_test(test);
return 0;
}
ListHead* create_simple_linked_list(int elements) {
ListHead* head = create_linked_list_header();
ListItem* temp = NULL;
int i;
for (i = 0; i < elements; i++) {
ListItem* link = (ListItem*)malloc(sizeof(ListItem));
link->data = i;
link->next = temp;
link->prev = NULL;
if (i == 0) {
head->first = link;
} else {
temp->prev = link;
}
temp = link;
}
head->last = temp;
head->size = i;
return head;
}
/* Local helper functions */
static char* test_free_linked_list(ListHead** head) {
// Test if free did it's job
if (head == NULL || *head == NULL) {
free_linked_list(head);
return 0;
}
int linked_list_size = (*head)->size;
int links_freed = free_linked_list(head);
mu_assert("links_freed != linked_list_size", links_freed == linked_list_size);
mu_assert("head was not set to NULL after free", (*head) == NULL);
return 0;
}
static char* test_linked_list_depth(ListHead* head, int expected_size) {
// Test depth of linked_list (deprecated to test_data_sequence)
mu_assert("Running test_linked_list_depth on NULL head", head != NULL);
int actual_size = 0;
ListItem* link = head->first;
while (link != NULL) {
link = link->prev;
actual_size++;
}
mu_assert("linked list actual size doesn't equal expected size", actual_size == expected_size);
return 0;
}
static char* test_data_sequence(ListHead* head, int *sequence, int sequence_length) {
// Test if the linked list exactly matches a sequence of integers
mu_assert("Running test_data_sequence on NULL head", head != NULL);
int index = 0;
ListItem* link = head->first;
while (link != NULL) {
if (index < sequence_length) {
mu_assert_format("linked_list['%d'] != sequence['%d']\n(%d != %d)", // format message
link->data == sequence[index], // test
link->data, sequence[index], link->data, sequence[index] // inputs to format message
);
}
link = link->prev;
index++;
}
mu_assert_format("linked list size was %d, and sequence length was %d",
index == sequence_length,
index, sequence_length
);
return 0;
}
static char* evaluate_operation_result(ListHead** head, int* sequence, int sequence_length, bool result, bool desired_result) {
// Evaluates the output from a linked list data operation, checks values and expected operation success/failure.
// Also frees at the end
mu_assert_format("Expected linked list operation to be %s, result %s",
desired_result == result,
desired_result ? "Successful" : "Failure",
result ? "Successful" : "Failure"
);
mu_assert_format("Head size doesn't match up: (%d != %d)",
(*head)->size == sequence_length,
(*head)->size,
sequence_length
);
char* message = test_data_sequence(*head, sequence, sequence_length);
return test_free_linked_list(head);
}
/* Unit Tests */
static char* run_test_create_linked_list_header() {
printf("Running run_test_create_linked_list_header()\n");
ListHead* head = create_linked_list_header();
mu_assert("head == NULL", head != NULL);
mu_assert("head->first != NULL", head->first == NULL);
mu_assert("head->last != NULL", head->last == NULL);
mu_assert("head->size != 0", head->size == 0);
free_linked_list(&head);
return 0;
}
static char* run_test_free_linked_list_null() {
printf("Running run_test_free_linked_list_null()\n");
return test_free_linked_list(NULL);
}
static char* run_test_free_linked_list_empty() {
printf("Running run_test_free_linked_list_empty()\n");
ListHead* head = create_linked_list_header();
free_linked_list(&head);
return test_free_linked_list(&head);
}
static char* run_test_free_linked_list_not_empty() {
printf("Running run_test_free_linked_list_not_empty()\n");
ListHead* head = create_simple_linked_list(3);
free_linked_list(&head);
return test_free_linked_list(&head);
}
static char* run_test_append_link_null_head() {
printf("Running run_test_append_link_null_head()\n");
bool result = append_link(NULL, 5);
mu_assert("append_link is successful on NULL head (it shouldn't be)", result == false);
return 0;
}
static char* run_test_append_link_empty() {
printf("Running run_test_append_link_empty()\n");
ListHead* head = create_linked_list_header();
bool result = append_link(head, 5);
int sequence[] = {5};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_append_link_not_empty() {
printf("Running run_test_append_link_not_empty()\n");
ListHead* head = create_simple_linked_list(3);
bool result = append_link(head, 3);
int sequence[] = {0, 1, 2, 3};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_null() {
printf("Running run_test_insert_link_null()\n");
bool result = insert_link(NULL, 0, 5);
mu_assert("insert_link is successful on NULL head (it shouldn't be)", result == false);
return 0;
}
static char* run_test_insert_link_begin_empty() {
printf("Running run_test_insert_link_begin_empty()\n");
ListHead* head = create_linked_list_header();
bool result = insert_link(head, 0, 2);
int sequence[] = {2};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_begin_non_empty() {
printf("Running run_test_insert_link_begin_non_empty()\n");
ListHead* head = create_simple_linked_list(5);
bool result = insert_link(head, 0, 13);
int sequence[] = {13, 0, 1, 2, 3, 4};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_middle() {
printf("Running run_test_insert_link_middle()\n");
ListHead* head = create_simple_linked_list(5);
bool result = insert_link(head, 2, 14);
int sequence[] = {0, 1, 14, 2, 3, 4};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_end() {
printf("Running run_test_insert_link_end()\n");
ListHead* head = create_simple_linked_list(5);
bool result = insert_link(head, 5, 15);
int sequence[] = {0, 1, 2, 3, 4, 15};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_after_empty() {
printf("Running run_test_insert_link_after_empty()\n");
ListHead* head = create_linked_list_header();
bool result = insert_link(head, 5, 16);
int sequence[] = {16};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_insert_link_after_non_empty() {
printf("Running run_test_insert_link_after_non_empty()\n");
ListHead* head = create_simple_linked_list(5);
bool result = insert_link(head, 100, 16);
int sequence[] = {0, 1, 2, 3, 4, 16};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_remove_link_null() {
printf("Running run_test_remove_link_null()\n");
bool result = remove_link(NULL, 0);
mu_assert("remove_link is successful on NULL head (it shouldn't be)", result == false);
return 0;
}
static char* run_test_remove_link_empty() {
printf("Running run_test_remove_link_empty()\n");
ListHead* head = create_linked_list_header();
bool result = remove_link(head, 0);
int sequence[] = {};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, false);
}
static char* run_test_remove_link_begin() {
printf("Running run_test_remove_link_begin()\n");
ListHead* head = create_simple_linked_list(5);
bool result = remove_link(head, 0);
int sequence[] = {1, 2, 3, 4};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_remove_link_middle() {
printf("Running run_test_remove_link_middle()\n");
ListHead* head = create_simple_linked_list(5);
bool result = remove_link(head, 2);
int sequence[] = {0, 1, 3, 4};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_remove_link_end() {
printf("Running run_test_remove_link_end()\n");
ListHead* head = create_simple_linked_list(5);
bool result = remove_link(head, 4);
int sequence[] = {0, 1, 2, 3};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, true);
}
static char* run_test_remove_link_after_empty() {
printf("Running run_test_remove_link_after_empty()\n");
ListHead* head = create_linked_list_header();
bool result = remove_link(head, 100);
int sequence[] = {};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, false);
}
static char* run_test_remove_link_after_non_empty() {
printf("Running run_test_remove_link_after_non_empty()\n");
ListHead* head = create_simple_linked_list(5);
bool result = remove_link(head, 100);
int sequence[] = {0, 1, 2, 3, 4};
int length = sizeof(sequence)/sizeof(sequence[0]);
return evaluate_operation_result(&head, sequence, length, result, false);
}
| [
"Steven.Cagle@wdc.com"
] | Steven.Cagle@wdc.com |
cd60f3f7484e1694e62b78fce1128e40987da875 | bccad6cf85ddefb1ffadb60aa338e85139b6a438 | /include/_DEVELOPMENT/clang/freertos/queue.h | 9684ffe1372431c82aaf3697506e9364bee7c90a | [
"ClArtistic"
] | permissive | tschak909/z88dk | 1486945106be919177ef8c9f339050815aad8a17 | 5b0a27dd191be5cb139508e08bc6428fe3fcc1e8 | refs/heads/master | 2021-12-02T07:57:42.262997 | 2021-07-26T21:50:22 | 2021-07-26T21:50:22 | 153,861,034 | 2 | 0 | NOASSERTION | 2018-10-20T02:09:27 | 2018-10-20T02:09:27 | null | UTF-8 | C | false | false | 68,104 | h | /*
* FreeRTOS Kernel V10.4.4
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*
*/
// automatically generated by m4 from headers in proto subdir
#ifndef QUEUE_H
#define QUEUE_H
#ifndef INC_FREERTOS_H
#error "include FreeRTOS.h" must appear in source files before "include queue.h"
#endif
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */
#include <freertos/task.h>
/**
* Type by which queues are referenced. For example, a call to xQueueCreate()
* returns an QueueHandle_t variable that can then be used as a parameter to
* xQueueSend(), xQueueReceive(), etc.
*/
struct QueueDef_t;
typedef struct QueueDef_t * QueueHandle_t;
/**
* Type by which queue sets are referenced. For example, a call to
* xQueueCreateSet() returns an xQueueSet variable that can then be used as a
* parameter to xQueueSelectFromSet(), xQueueAddToSet(), etc.
*/
typedef struct QueueDef_t * QueueSetHandle_t;
/**
* Queue sets can contain both queues and semaphores, so the
* QueueSetMemberHandle_t is defined as a type to be used where a parameter or
* return value can be either an QueueHandle_t or an SemaphoreHandle_t.
*/
typedef struct QueueDef_t * QueueSetMemberHandle_t;
/* For internal use only. */
#define queueSEND_TO_BACK ( ( BaseType_t ) 0 )
#define queueSEND_TO_FRONT ( ( BaseType_t ) 1 )
#define queueOVERWRITE ( ( BaseType_t ) 2 )
/* For internal use only. These definitions *must* match those in queue.c. */
#define queueQUEUE_TYPE_BASE ( ( uint8_t ) 0U )
#define queueQUEUE_TYPE_SET ( ( uint8_t ) 0U )
#define queueQUEUE_TYPE_MUTEX ( ( uint8_t ) 1U )
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( ( uint8_t ) 2U )
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( ( uint8_t ) 3U )
#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( ( uint8_t ) 4U )
/**
* queue. h
* <pre>
* QueueHandle_t xQueueCreate(
* UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize
* );
* </pre>
*
* Creates a new queue instance, and returns a handle by which the new queue
* can be referenced.
*
* Internally, within the FreeRTOS implementation, queues use two blocks of
* memory. The first block is used to hold the queue's data structures. The
* second block is used to hold items placed into the queue. If a queue is
* created using xQueueCreate() then both blocks of memory are automatically
* dynamically allocated inside the xQueueCreate() function. (see
* https://www.FreeRTOS.org/a00111.html). If a queue is created using
* xQueueCreateStatic() then the application writer must provide the memory that
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
* be created without using any dynamic memory allocation.
*
* https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
*
* @param uxQueueLength The maximum number of items that the queue can contain.
*
* @param uxItemSize The number of bytes each item in the queue will require.
* Items are queued by copy, not by reference, so this is the number of bytes
* that will be copied for each posted item. Each item on the queue must be
* the same size.
*
* @return If the queue is successfully create then a handle to the newly
* created queue is returned. If the queue cannot be created then 0 is
* returned.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* };
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1, xQueue2;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
* if( xQueue1 == 0 )
* {
* // Queue was not created and must not be used.
* }
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
* if( xQueue2 == 0 )
* {
* // Queue was not created and must not be used.
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueCreate xQueueCreate
* \ingroup QueueManagement
*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
#define xQueueCreate( uxQueueLength, uxItemSize ) xQueueGenericCreate( ( uxQueueLength ), ( uxItemSize ), ( queueQUEUE_TYPE_BASE ) )
#endif
/**
* queue. h
* <pre>
* QueueHandle_t xQueueCreateStatic(
* UBaseType_t uxQueueLength,
* UBaseType_t uxItemSize,
* uint8_t *pucQueueStorageBuffer,
* StaticQueue_t *pxQueueBuffer
* );
* </pre>
*
* Creates a new queue instance, and returns a handle by which the new queue
* can be referenced.
*
* Internally, within the FreeRTOS implementation, queues use two blocks of
* memory. The first block is used to hold the queue's data structures. The
* second block is used to hold items placed into the queue. If a queue is
* created using xQueueCreate() then both blocks of memory are automatically
* dynamically allocated inside the xQueueCreate() function. (see
* https://www.FreeRTOS.org/a00111.html). If a queue is created using
* xQueueCreateStatic() then the application writer must provide the memory that
* will get used by the queue. xQueueCreateStatic() therefore allows a queue to
* be created without using any dynamic memory allocation.
*
* https://www.FreeRTOS.org/Embedded-RTOS-Queues.html
*
* @param uxQueueLength The maximum number of items that the queue can contain.
*
* @param uxItemSize The number of bytes each item in the queue will require.
* Items are queued by copy, not by reference, so this is the number of bytes
* that will be copied for each posted item. Each item on the queue must be
* the same size.
*
* @param pucQueueStorageBuffer If uxItemSize is not zero then
* pucQueueStorageBuffer must point to a uint8_t array that is at least large
* enough to hold the maximum number of items that can be in the queue at any
* one time - which is ( uxQueueLength * uxItemsSize ) bytes. If uxItemSize is
* zero then pucQueueStorageBuffer can be NULL.
*
* @param pxQueueBuffer Must point to a variable of type StaticQueue_t, which
* will be used to hold the queue's data structure.
*
* @return If the queue is created then a handle to the created queue is
* returned. If pxQueueBuffer is NULL then NULL is returned.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* };
*
#define QUEUE_LENGTH 10
#define ITEM_SIZE sizeof( uint32_t )
*
* // xQueueBuffer will hold the queue structure.
* StaticQueue_t xQueueBuffer;
*
* // ucQueueStorage will hold the items posted to the queue. Must be at least
* // [(queue length) * ( queue item size)] bytes long.
* uint8_t ucQueueStorage[ QUEUE_LENGTH * ITEM_SIZE ];
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( QUEUE_LENGTH, // The number of items the queue can hold.
* ITEM_SIZE // The size of each item in the queue
* &( ucQueueStorage[ 0 ] ), // The buffer that will hold the items in the queue.
* &xQueueBuffer ); // The buffer that will hold the queue structure.
*
* // The queue is guaranteed to be created successfully as no dynamic memory
* // allocation is used. Therefore xQueue1 is now a handle to a valid queue.
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueCreateStatic xQueueCreateStatic
* \ingroup QueueManagement
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
#define xQueueCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxQueueBuffer ) xQueueGenericCreateStatic( ( uxQueueLength ), ( uxItemSize ), ( pucQueueStorage ), ( pxQueueBuffer ), ( queueQUEUE_TYPE_BASE ) )
#endif /* configSUPPORT_STATIC_ALLOCATION */
/**
* queue. h
* <pre>
* BaseType_t xQueueSendToToFront(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
*
* Post an item to the front of a queue. The item is queued by copy, not by
* reference. This function must not be called from an interrupt service
* routine. See xQueueSendFromISR () for an alternative which may be used
* in an ISR.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for space to become available on the queue, should it already
* be full. The call will return immediately if this is set to 0 and the
* queue is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1, xQueue2;
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
*
* // ...
*
* if( xQueue1 != 0 )
* {
* // Send an uint32_t. Wait for 10 ticks for space to become
* // available if necessary.
* if( xQueueSendToFront( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
* {
* // Failed to post the message, even after 10 ticks.
* }
* }
*
* if( xQueue2 != 0 )
* {
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueSendToFront( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
#define xQueueSendToFront( xQueue, pvItemToQueue, xTicksToWait ) \
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )
/**
* queue. h
* <pre>
* BaseType_t xQueueSendToBack(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
*
* This is a macro that calls xQueueGenericSend().
*
* Post an item to the back of a queue. The item is queued by copy, not by
* reference. This function must not be called from an interrupt service
* routine. See xQueueSendFromISR () for an alternative which may be used
* in an ISR.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for space to become available on the queue, should it already
* be full. The call will return immediately if this is set to 0 and the queue
* is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1, xQueue2;
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
*
* // ...
*
* if( xQueue1 != 0 )
* {
* // Send an uint32_t. Wait for 10 ticks for space to become
* // available if necessary.
* if( xQueueSendToBack( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
* {
* // Failed to post the message, even after 10 ticks.
* }
* }
*
* if( xQueue2 != 0 )
* {
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueSendToBack( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
#define xQueueSendToBack( xQueue, pvItemToQueue, xTicksToWait ) \
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
/**
* queue. h
* <pre>
* BaseType_t xQueueSend(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* TickType_t xTicksToWait
* );
* </pre>
*
* This is a macro that calls xQueueGenericSend(). It is included for
* backward compatibility with versions of FreeRTOS.org that did not
* include the xQueueSendToFront() and xQueueSendToBack() macros. It is
* equivalent to xQueueSendToBack().
*
* Post an item on a queue. The item is queued by copy, not by reference.
* This function must not be called from an interrupt service routine.
* See xQueueSendFromISR () for an alternative which may be used in an ISR.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for space to become available on the queue, should it already
* be full. The call will return immediately if this is set to 0 and the
* queue is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1, xQueue2;
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
*
* // ...
*
* if( xQueue1 != 0 )
* {
* // Send an uint32_t. Wait for 10 ticks for space to become
* // available if necessary.
* if( xQueueSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10 ) != pdPASS )
* {
* // Failed to post the message, even after 10 ticks.
* }
* }
*
* if( xQueue2 != 0 )
* {
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0 );
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
#define xQueueSend( xQueue, pvItemToQueue, xTicksToWait ) \
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )
/**
* queue. h
* <pre>
* BaseType_t xQueueOverwrite(
* QueueHandle_t xQueue,
* const void * pvItemToQueue
* );
* </pre>
*
* Only for use with queues that have a length of one - so the queue is either
* empty or full.
*
* Post an item on a queue. If the queue is already full then overwrite the
* value held in the queue. The item is queued by copy, not by reference.
*
* This function must not be called from an interrupt service routine.
* See xQueueOverwriteFromISR () for an alternative which may be used in an ISR.
*
* @param xQueue The handle of the queue to which the data is being sent.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @return xQueueOverwrite() is a macro that calls xQueueGenericSend(), and
* therefore has the same return values as xQueueSendToFront(). However, pdPASS
* is the only value that can be returned because xQueueOverwrite() will write
* to the queue even when the queue is already full.
*
* Example usage:
* <pre>
*
* void vFunction( void *pvParameters )
* {
* QueueHandle_t xQueue;
* uint32_t ulVarToSend, ulValReceived;
*
* // Create a queue to hold one uint32_t value. It is strongly
* // recommended *not* to use xQueueOverwrite() on queues that can
* // contain more than one value, and doing so will trigger an assertion
* // if configASSERT() is defined.
* xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
*
* // Write the value 10 to the queue using xQueueOverwrite().
* ulVarToSend = 10;
* xQueueOverwrite( xQueue, &ulVarToSend );
*
* // Peeking the queue should now return 10, but leave the value 10 in
* // the queue. A block time of zero is used as it is known that the
* // queue holds a value.
* ulValReceived = 0;
* xQueuePeek( xQueue, &ulValReceived, 0 );
*
* if( ulValReceived != 10 )
* {
* // Error unless the item was removed by a different task.
* }
*
* // The queue is still full. Use xQueueOverwrite() to overwrite the
* // value held in the queue with 100.
* ulVarToSend = 100;
* xQueueOverwrite( xQueue, &ulVarToSend );
*
* // This time read from the queue, leaving the queue empty once more.
* // A block time of 0 is used again.
* xQueueReceive( xQueue, &ulValReceived, 0 );
*
* // The value read should be the last value written, even though the
* // queue was already full when the value was written.
* if( ulValReceived != 100 )
* {
* // Error!
* }
*
* // ...
* }
* </pre>
* \defgroup xQueueOverwrite xQueueOverwrite
* \ingroup QueueManagement
*/
#define xQueueOverwrite( xQueue, pvItemToQueue ) \
xQueueGenericSend( ( xQueue ), ( pvItemToQueue ), 0, queueOVERWRITE )
/**
* queue. h
* <pre>
* BaseType_t xQueueGenericSend(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* TickType_t xTicksToWait
* BaseType_t xCopyPosition
* );
* </pre>
*
* It is preferred that the macros xQueueSend(), xQueueSendToFront() and
* xQueueSendToBack() are used in place of calling this function directly.
*
* Post an item on a queue. The item is queued by copy, not by reference.
* This function must not be called from an interrupt service routine.
* See xQueueSendFromISR () for an alternative which may be used in an ISR.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for space to become available on the queue, should it already
* be full. The call will return immediately if this is set to 0 and the
* queue is full. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
*
* @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
* item at the back of the queue, or queueSEND_TO_FRONT to place the item
* at the front of the queue (for high priority messages).
*
* @return pdTRUE if the item was successfully posted, otherwise errQUEUE_FULL.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* uint32_t ulVar = 10UL;
*
* void vATask( void *pvParameters )
* {
* QueueHandle_t xQueue1, xQueue2;
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 uint32_t values.
* xQueue1 = xQueueCreate( 10, sizeof( uint32_t ) );
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue2 = xQueueCreate( 10, sizeof( struct AMessage * ) );
*
* // ...
*
* if( xQueue1 != 0 )
* {
* // Send an uint32_t. Wait for 10 ticks for space to become
* // available if necessary.
* if( xQueueGenericSend( xQueue1, ( void * ) &ulVar, ( TickType_t ) 10, queueSEND_TO_BACK ) != pdPASS )
* {
* // Failed to post the message, even after 10 ticks.
* }
* }
*
* if( xQueue2 != 0 )
* {
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueGenericSend( xQueue2, ( void * ) &pxMessage, ( TickType_t ) 0, queueSEND_TO_BACK );
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueSend xQueueSend
* \ingroup QueueManagement
*/
/*
BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
const void * const pvItemToQueue,
TickType_t xTicksToWait,
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueGenericSend(QueueHandle_t xQueue,const void * const pvItemToQueue,TickType_t xTicksToWait,const BaseType_t xCopyPosition);
/**
* queue. h
* <pre>
* BaseType_t xQueuePeek(
* QueueHandle_t xQueue,
* void * const pvBuffer,
* TickType_t xTicksToWait
* );
* </pre>
*
* Receive an item from a queue without removing the item from the queue.
* The item is received by copy so a buffer of adequate size must be
* provided. The number of bytes copied into the buffer was defined when
* the queue was created.
*
* Successfully received items remain on the queue so will be returned again
* by the next call, or a call to xQueueReceive().
*
* This macro must not be used in an interrupt service routine. See
* xQueuePeekFromISR() for an alternative that can be called from an interrupt
* service routine.
*
* @param xQueue The handle to the queue from which the item is to be
* received.
*
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for an item to receive should the queue be empty at the time
* of the call. The time is defined in tick periods so the constant
* portTICK_PERIOD_MS should be used to convert to real time if this is required.
* xQueuePeek() will return immediately if xTicksToWait is 0 and the queue
* is empty.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* QueueHandle_t xQueue;
*
* // Task to create a queue and post a value.
* void vATask( void *pvParameters )
* {
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
* if( xQueue == 0 )
* {
* // Failed to create the queue.
* }
*
* // ...
*
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
*
* // ... Rest of task code.
* }
*
* // Task to peek the data from the queue.
* void vADifferentTask( void *pvParameters )
* {
* struct AMessage *pxRxedMessage;
*
* if( xQueue != 0 )
* {
* // Peek a message on the created queue. Block for 10 ticks if a
* // message is not immediately available.
* if( xQueuePeek( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
* {
* // pcRxedMessage now points to the struct AMessage variable posted
* // by vATask, but the item still remains on the queue.
* }
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueuePeek xQueuePeek
* \ingroup QueueManagement
*/
/*
BaseType_t xQueuePeek( QueueHandle_t xQueue,
void * const pvBuffer,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueuePeek(QueueHandle_t xQueue,void * const pvBuffer,TickType_t xTicksToWait);
/**
* queue. h
* <pre>
* BaseType_t xQueuePeekFromISR(
* QueueHandle_t xQueue,
* void *pvBuffer,
* );
* </pre>
*
* A version of xQueuePeek() that can be called from an interrupt service
* routine (ISR).
*
* Receive an item from a queue without removing the item from the queue.
* The item is received by copy so a buffer of adequate size must be
* provided. The number of bytes copied into the buffer was defined when
* the queue was created.
*
* Successfully received items remain on the queue so will be returned again
* by the next call, or a call to xQueueReceive().
*
* @param xQueue The handle to the queue from which the item is to be
* received.
*
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
*
* \defgroup xQueuePeekFromISR xQueuePeekFromISR
* \ingroup QueueManagement
*/
/*
BaseType_t xQueuePeekFromISR( QueueHandle_t xQueue,
void * const pvBuffer ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueuePeekFromISR(QueueHandle_t xQueue,void * const pvBuffer);
/**
* queue. h
* <pre>
* BaseType_t xQueueReceive(
* QueueHandle_t xQueue,
* void *pvBuffer,
* TickType_t xTicksToWait
* );
* </pre>
*
* Receive an item from a queue. The item is received by copy so a buffer of
* adequate size must be provided. The number of bytes copied into the buffer
* was defined when the queue was created.
*
* Successfully received items are removed from the queue.
*
* This function must not be used in an interrupt service routine. See
* xQueueReceiveFromISR for an alternative that can.
*
* @param xQueue The handle to the queue from which the item is to be
* received.
*
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @param xTicksToWait The maximum amount of time the task should block
* waiting for an item to receive should the queue be empty at the time
* of the call. xQueueReceive() will return immediately if xTicksToWait
* is zero and the queue is empty. The time is defined in tick periods so the
* constant portTICK_PERIOD_MS should be used to convert to real time if this is
* required.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
* struct AMessage
* {
* char ucMessageID;
* char ucData[ 20 ];
* } xMessage;
*
* QueueHandle_t xQueue;
*
* // Task to create a queue and post a value.
* void vATask( void *pvParameters )
* {
* struct AMessage *pxMessage;
*
* // Create a queue capable of containing 10 pointers to AMessage structures.
* // These should be passed by pointer as they contain a lot of data.
* xQueue = xQueueCreate( 10, sizeof( struct AMessage * ) );
* if( xQueue == 0 )
* {
* // Failed to create the queue.
* }
*
* // ...
*
* // Send a pointer to a struct AMessage object. Don't block if the
* // queue is already full.
* pxMessage = & xMessage;
* xQueueSend( xQueue, ( void * ) &pxMessage, ( TickType_t ) 0 );
*
* // ... Rest of task code.
* }
*
* // Task to receive from the queue.
* void vADifferentTask( void *pvParameters )
* {
* struct AMessage *pxRxedMessage;
*
* if( xQueue != 0 )
* {
* // Receive a message on the created queue. Block for 10 ticks if a
* // message is not immediately available.
* if( xQueueReceive( xQueue, &( pxRxedMessage ), ( TickType_t ) 10 ) )
* {
* // pcRxedMessage now points to the struct AMessage variable posted
* // by vATask.
* }
* }
*
* // ... Rest of task code.
* }
* </pre>
* \defgroup xQueueReceive xQueueReceive
* \ingroup QueueManagement
*/
/*
BaseType_t xQueueReceive( QueueHandle_t xQueue,
void * const pvBuffer,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueReceive(QueueHandle_t xQueue,void * const pvBuffer,TickType_t xTicksToWait);
/**
* queue. h
* <pre>
* UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue );
* </pre>
*
* Return the number of messages stored in a queue.
*
* @param xQueue A handle to the queue being queried.
*
* @return The number of messages available in the queue.
*
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
* \ingroup QueueManagement
*/
/*
UBaseType_t uxQueueMessagesWaiting( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern UBaseType_t uxQueueMessagesWaiting(const QueueHandle_t xQueue);
/**
* queue. h
* <pre>
* UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue );
* </pre>
*
* Return the number of free spaces available in a queue. This is equal to the
* number of items that can be sent to the queue before the queue becomes full
* if no items are removed.
*
* @param xQueue A handle to the queue being queried.
*
* @return The number of spaces available in the queue.
*
* \defgroup uxQueueMessagesWaiting uxQueueMessagesWaiting
* \ingroup QueueManagement
*/
/*
UBaseType_t uxQueueSpacesAvailable( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern UBaseType_t uxQueueSpacesAvailable(const QueueHandle_t xQueue);
/**
* queue. h
* <pre>
* void vQueueDelete( QueueHandle_t xQueue );
* </pre>
*
* Delete a queue - freeing all the memory allocated for storing of items
* placed on the queue.
*
* @param xQueue A handle to the queue to be deleted.
*
* \defgroup vQueueDelete vQueueDelete
* \ingroup QueueManagement
*/
/*
void vQueueDelete( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern void vQueueDelete(QueueHandle_t xQueue);
/**
* queue. h
* <pre>
* BaseType_t xQueueSendToFrontFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
*
* This is a macro that calls xQueueGenericSendFromISR().
*
* Post an item to the front of a queue. It is safe to use this macro from
* within an interrupt service routine.
*
* Items are queued by copy not reference so it is preferable to only
* queue small items, especially when called from an ISR. In most cases
* it would be preferable to store a pointer to the item being queued.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param pxHigherPriorityTaskWoken xQueueSendToFrontFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueSendToFromFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* void vBufferISR( void )
* {
* char cIn;
* BaseType_t xHigherPrioritTaskWoken;
*
* // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWoken = pdFALSE;
*
* // Loop until the buffer is empty.
* do
* {
* // Obtain a byte from the buffer.
* cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
*
* // Post the byte.
* xQueueSendToFrontFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken )
* {
* taskYIELD ();
* }
* }
* </pre>
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
*/
#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )
/**
* queue. h
* <pre>
* BaseType_t xQueueSendToBackFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
*
* This is a macro that calls xQueueGenericSendFromISR().
*
* Post an item to the back of a queue. It is safe to use this macro from
* within an interrupt service routine.
*
* Items are queued by copy not reference so it is preferable to only
* queue small items, especially when called from an ISR. In most cases
* it would be preferable to store a pointer to the item being queued.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param pxHigherPriorityTaskWoken xQueueSendToBackFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueSendToBackFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* void vBufferISR( void )
* {
* char cIn;
* BaseType_t xHigherPriorityTaskWoken;
*
* // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWoken = pdFALSE;
*
* // Loop until the buffer is empty.
* do
* {
* // Obtain a byte from the buffer.
* cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
*
* // Post the byte.
* xQueueSendToBackFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken )
* {
* taskYIELD ();
* }
* }
* </pre>
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
*/
#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
/**
* queue. h
* <pre>
* BaseType_t xQueueOverwriteFromISR(
* QueueHandle_t xQueue,
* const void * pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
*
* A version of xQueueOverwrite() that can be used in an interrupt service
* routine (ISR).
*
* Only for use with queues that can hold a single item - so the queue is either
* empty or full.
*
* Post an item on a queue. If the queue is already full then overwrite the
* value held in the queue. The item is queued by copy, not by reference.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param pxHigherPriorityTaskWoken xQueueOverwriteFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueOverwriteFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return xQueueOverwriteFromISR() is a macro that calls
* xQueueGenericSendFromISR(), and therefore has the same return values as
* xQueueSendToFrontFromISR(). However, pdPASS is the only value that can be
* returned because xQueueOverwriteFromISR() will write to the queue even when
* the queue is already full.
*
* Example usage:
* <pre>
*
* QueueHandle_t xQueue;
*
* void vFunction( void *pvParameters )
* {
* // Create a queue to hold one uint32_t value. It is strongly
* // recommended *not* to use xQueueOverwriteFromISR() on queues that can
* // contain more than one value, and doing so will trigger an assertion
* // if configASSERT() is defined.
* xQueue = xQueueCreate( 1, sizeof( uint32_t ) );
* }
*
* void vAnInterruptHandler( void )
* {
* // xHigherPriorityTaskWoken must be set to pdFALSE before it is used.
* BaseType_t xHigherPriorityTaskWoken = pdFALSE;
* uint32_t ulVarToSend, ulValReceived;
*
* // Write the value 10 to the queue using xQueueOverwriteFromISR().
* ulVarToSend = 10;
* xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
*
* // The queue is full, but calling xQueueOverwriteFromISR() again will still
* // pass because the value held in the queue will be overwritten with the
* // new value.
* ulVarToSend = 100;
* xQueueOverwriteFromISR( xQueue, &ulVarToSend, &xHigherPriorityTaskWoken );
*
* // Reading from the queue will now return 100.
*
* // ...
*
* if( xHigherPrioritytaskWoken == pdTRUE )
* {
* // Writing to the queue caused a task to unblock and the unblocked task
* // has a priority higher than or equal to the priority of the currently
* // executing task (the task this interrupt interrupted). Perform a context
* // switch so this interrupt returns directly to the unblocked task.
* portYIELD_FROM_ISR(); // or portEND_SWITCHING_ISR() depending on the port.
* }
* }
* </pre>
* \defgroup xQueueOverwriteFromISR xQueueOverwriteFromISR
* \ingroup QueueManagement
*/
#define xQueueOverwriteFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueOVERWRITE )
/**
* queue. h
* <pre>
* BaseType_t xQueueSendFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken
* );
* </pre>
*
* This is a macro that calls xQueueGenericSendFromISR(). It is included
* for backward compatibility with versions of FreeRTOS.org that did not
* include the xQueueSendToBackFromISR() and xQueueSendToFrontFromISR()
* macros.
*
* Post an item to the back of a queue. It is safe to use this function from
* within an interrupt service routine.
*
* Items are queued by copy not reference so it is preferable to only
* queue small items, especially when called from an ISR. In most cases
* it would be preferable to store a pointer to the item being queued.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param pxHigherPriorityTaskWoken xQueueSendFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueSendFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* void vBufferISR( void )
* {
* char cIn;
* BaseType_t xHigherPriorityTaskWoken;
*
* // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWoken = pdFALSE;
*
* // Loop until the buffer is empty.
* do
* {
* // Obtain a byte from the buffer.
* cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
*
* // Post the byte.
* xQueueSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWoken );
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
* // Now the buffer is empty we can switch context if necessary.
* if( xHigherPriorityTaskWoken )
* {
* // Actual macro used here is port specific.
* portYIELD_FROM_ISR ();
* }
* }
* </pre>
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
*/
#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) \
xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )
/**
* queue. h
* <pre>
* BaseType_t xQueueGenericSendFromISR(
* QueueHandle_t xQueue,
* const void *pvItemToQueue,
* BaseType_t *pxHigherPriorityTaskWoken,
* BaseType_t xCopyPosition
* );
* </pre>
*
* It is preferred that the macros xQueueSendFromISR(),
* xQueueSendToFrontFromISR() and xQueueSendToBackFromISR() be used in place
* of calling this function directly. xQueueGiveFromISR() is an
* equivalent for use by semaphores that don't actually copy any data.
*
* Post an item on a queue. It is safe to use this function from within an
* interrupt service routine.
*
* Items are queued by copy not reference so it is preferable to only
* queue small items, especially when called from an ISR. In most cases
* it would be preferable to store a pointer to the item being queued.
*
* @param xQueue The handle to the queue on which the item is to be posted.
*
* @param pvItemToQueue A pointer to the item that is to be placed on the
* queue. The size of the items the queue will hold was defined when the
* queue was created, so this many bytes will be copied from pvItemToQueue
* into the queue storage area.
*
* @param pxHigherPriorityTaskWoken xQueueGenericSendFromISR() will set
* *pxHigherPriorityTaskWoken to pdTRUE if sending to the queue caused a task
* to unblock, and the unblocked task has a priority higher than the currently
* running task. If xQueueGenericSendFromISR() sets this value to pdTRUE then
* a context switch should be requested before the interrupt is exited.
*
* @param xCopyPosition Can take the value queueSEND_TO_BACK to place the
* item at the back of the queue, or queueSEND_TO_FRONT to place the item
* at the front of the queue (for high priority messages).
*
* @return pdTRUE if the data was successfully sent to the queue, otherwise
* errQUEUE_FULL.
*
* Example usage for buffered IO (where the ISR can obtain more than one value
* per call):
* <pre>
* void vBufferISR( void )
* {
* char cIn;
* BaseType_t xHigherPriorityTaskWokenByPost;
*
* // We have not woken a task at the start of the ISR.
* xHigherPriorityTaskWokenByPost = pdFALSE;
*
* // Loop until the buffer is empty.
* do
* {
* // Obtain a byte from the buffer.
* cIn = portINPUT_BYTE( RX_REGISTER_ADDRESS );
*
* // Post each byte.
* xQueueGenericSendFromISR( xRxQueue, &cIn, &xHigherPriorityTaskWokenByPost, queueSEND_TO_BACK );
*
* } while( portINPUT_BYTE( BUFFER_COUNT ) );
*
* // Now the buffer is empty we can switch context if necessary. Note that the
* // name of the yield function required is port specific.
* if( xHigherPriorityTaskWokenByPost )
* {
* portYIELD_FROM_ISR();
* }
* }
* </pre>
*
* \defgroup xQueueSendFromISR xQueueSendFromISR
* \ingroup QueueManagement
*/
/*
BaseType_t xQueueGenericSendFromISR( QueueHandle_t xQueue,
const void * const pvItemToQueue,
BaseType_t * const pxHigherPriorityTaskWoken,
const BaseType_t xCopyPosition ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueGenericSendFromISR(QueueHandle_t xQueue,const void * const pvItemToQueue,BaseType_t * const pxHigherPriorityTaskWoken,const BaseType_t xCopyPosition);
/*
BaseType_t xQueueGiveFromISR( QueueHandle_t xQueue,
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueGiveFromISR(QueueHandle_t xQueue,BaseType_t * const pxHigherPriorityTaskWoken);
/**
* queue. h
* <pre>
* BaseType_t xQueueReceiveFromISR(
* QueueHandle_t xQueue,
* void *pvBuffer,
* BaseType_t *pxTaskWoken
* );
* </pre>
*
* Receive an item from a queue. It is safe to use this function from within an
* interrupt service routine.
*
* @param xQueue The handle to the queue from which the item is to be
* received.
*
* @param pvBuffer Pointer to the buffer into which the received item will
* be copied.
*
* @param pxTaskWoken A task may be blocked waiting for space to become
* available on the queue. If xQueueReceiveFromISR causes such a task to
* unblock *pxTaskWoken will get set to pdTRUE, otherwise *pxTaskWoken will
* remain unchanged.
*
* @return pdTRUE if an item was successfully received from the queue,
* otherwise pdFALSE.
*
* Example usage:
* <pre>
*
* QueueHandle_t xQueue;
*
* // Function to create a queue and post some values.
* void vAFunction( void *pvParameters )
* {
* char cValueToPost;
* const TickType_t xTicksToWait = ( TickType_t )0xff;
*
* // Create a queue capable of containing 10 characters.
* xQueue = xQueueCreate( 10, sizeof( char ) );
* if( xQueue == 0 )
* {
* // Failed to create the queue.
* }
*
* // ...
*
* // Post some characters that will be used within an ISR. If the queue
* // is full then this task will block for xTicksToWait ticks.
* cValueToPost = 'a';
* xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
* cValueToPost = 'b';
* xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
*
* // ... keep posting characters ... this task may block when the queue
* // becomes full.
*
* cValueToPost = 'c';
* xQueueSend( xQueue, ( void * ) &cValueToPost, xTicksToWait );
* }
*
* // ISR that outputs all the characters received on the queue.
* void vISR_Routine( void )
* {
* BaseType_t xTaskWokenByReceive = pdFALSE;
* char cRxedChar;
*
* while( xQueueReceiveFromISR( xQueue, ( void * ) &cRxedChar, &xTaskWokenByReceive) )
* {
* // A character was received. Output the character now.
* vOutputCharacter( cRxedChar );
*
* // If removing the character from the queue woke the task that was
* // posting onto the queue cTaskWokenByReceive will have been set to
* // pdTRUE. No matter how many times this loop iterates only one
* // task will be woken.
* }
*
* if( cTaskWokenByPost != ( char ) pdFALSE;
* {
* taskYIELD ();
* }
* }
* </pre>
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR
* \ingroup QueueManagement
*/
/*
BaseType_t xQueueReceiveFromISR( QueueHandle_t xQueue,
void * const pvBuffer,
BaseType_t * const pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueReceiveFromISR(QueueHandle_t xQueue,void * const pvBuffer,BaseType_t * const pxHigherPriorityTaskWoken);
/*
* Utilities to query queues that are safe to use from an ISR. These utilities
* should be used only from witin an ISR, or within a critical section.
*/
/*
BaseType_t xQueueIsQueueEmptyFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueMessagesWaitingFromISR( const QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueIsQueueEmptyFromISR(const QueueHandle_t xQueue);
extern BaseType_t xQueueIsQueueFullFromISR(const QueueHandle_t xQueue);
extern UBaseType_t uxQueueMessagesWaitingFromISR(const QueueHandle_t xQueue);
/*
* For internal use only. Use xSemaphoreCreateMutex(),
* xSemaphoreCreateCounting() or xSemaphoreGetMutexHolder() instead of calling
* these functions directly.
*/
/*
QueueHandle_t xQueueCreateMutex( const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateMutexStatic( const uint8_t ucQueueType,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount ) PRIVILEGED_FUNCTION;
QueueHandle_t xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount,
const UBaseType_t uxInitialCount,
StaticQueue_t * pxStaticQueue ) PRIVILEGED_FUNCTION;
BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolder( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
TaskHandle_t xQueueGetMutexHolderFromISR( QueueHandle_t xSemaphore ) PRIVILEGED_FUNCTION;
*/
extern QueueHandle_t xQueueCreateMutex(const uint8_t ucQueueType);
extern QueueHandle_t xQueueCreateMutexStatic(const uint8_t ucQueueType,StaticQueue_t * pxStaticQueue);
extern QueueHandle_t xQueueCreateCountingSemaphore(const UBaseType_t uxMaxCount,const UBaseType_t uxInitialCount);
extern QueueHandle_t xQueueCreateCountingSemaphoreStatic(const UBaseType_t uxMaxCount,const UBaseType_t uxInitialCount,StaticQueue_t * pxStaticQueue);
extern BaseType_t xQueueSemaphoreTake(QueueHandle_t xQueue,TickType_t xTicksToWait);
extern TaskHandle_t xQueueGetMutexHolder(QueueHandle_t xSemaphore);
extern TaskHandle_t xQueueGetMutexHolderFromISR(QueueHandle_t xSemaphore);
/*
* For internal use only. Use xSemaphoreTakeMutexRecursive() or
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.
*/
/*
BaseType_t xQueueTakeMutexRecursive( QueueHandle_t xMutex,
TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
BaseType_t xQueueGiveMutexRecursive( QueueHandle_t xMutex ) PRIVILEGED_FUNCTION;
*/
extern BaseType_t xQueueTakeMutexRecursive(QueueHandle_t xMutex,TickType_t xTicksToWait);
extern BaseType_t xQueueGiveMutexRecursive(QueueHandle_t xMutex);
/*
* Reset a queue back to its original empty state. The return value is now
* obsolete and is always set to pdPASS.
*/
#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )
/*
* The registry is provided as a means for kernel aware debuggers to
* locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
* a queue, semaphore or mutex handle to the registry if you want the handle
* to be available to a kernel aware debugger. If you are not using a kernel
* aware debugger then this function can be ignored.
*
* configQUEUE_REGISTRY_SIZE defines the maximum number of handles the
* registry can hold. configQUEUE_REGISTRY_SIZE must be greater than 0
* within FreeRTOSConfig.h for the registry to be available. Its value
* does not effect the number of queues, semaphores and mutexes that can be
* created - just the number that the registry can hold.
*
* If vQueueAddToRegistry is called more than once with the same xQueue
* parameter, the registry will store the pcQueueName parameter from the
* most recent call to vQueueAddToRegistry.
*
* @param xQueue The handle of the queue being added to the registry. This
* is the handle returned by a call to xQueueCreate(). Semaphore and mutex
* handles can also be passed in here.
*
* @param pcName The name to be associated with the handle. This is the
* name that the kernel aware debugger will display. The queue registry only
* stores a pointer to the string - so the string must be persistent (global or
* preferably in ROM/Flash), not on the stack.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
/*
void vQueueAddToRegistry( QueueHandle_t xQueue,
const char * pcQueueName ) PRIVILEGED_FUNCTION;
*/
extern void vQueueAddToRegistry(QueueHandle_t xQueue,const char * pcQueueName);
#endif
/*
* The registry is provided as a means for kernel aware debuggers to
* locate queues, semaphores and mutexes. Call vQueueAddToRegistry() add
* a queue, semaphore or mutex handle to the registry if you want the handle
* to be available to a kernel aware debugger, and vQueueUnregisterQueue() to
* remove the queue, semaphore or mutex from the register. If you are not using
* a kernel aware debugger then this function can be ignored.
*
* @param xQueue The handle of the queue being removed from the registry.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
/*
void vQueueUnregisterQueue( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern void vQueueUnregisterQueue(QueueHandle_t xQueue);
#endif
/*
* The queue registry is provided as a means for kernel aware debuggers to
* locate queues, semaphores and mutexes. Call pcQueueGetName() to look
* up and return the name of a queue in the queue registry from the queue's
* handle.
*
* @param xQueue The handle of the queue the name of which will be returned.
* @return If the queue is in the registry then a pointer to the name of the
* queue is returned. If the queue is not in the registry then NULL is
* returned.
*/
#if ( configQUEUE_REGISTRY_SIZE > 0 )
/*
const char * pcQueueGetName( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern const char *pcQueueGetName(QueueHandle_t xQueue);
#endif
/*
* Generic version of the function used to create a queue using dynamic memory
* allocation. This is called by other functions and macros that create other
* RTOS objects that use the queue structure as their base.
*/
#if ( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
/*
QueueHandle_t xQueueGenericCreate( const UBaseType_t uxQueueLength,
const UBaseType_t uxItemSize,
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
*/
extern QueueHandle_t xQueueGenericCreate(const UBaseType_t uxQueueLength,const UBaseType_t uxItemSize,const uint8_t ucQueueType);
#endif
/*
* Generic version of the function used to create a queue using dynamic memory
* allocation. This is called by other functions and macros that create other
* RTOS objects that use the queue structure as their base.
*/
#if ( configSUPPORT_STATIC_ALLOCATION == 1 )
/*
QueueHandle_t xQueueGenericCreateStatic( const UBaseType_t uxQueueLength,
const UBaseType_t uxItemSize,
uint8_t * pucQueueStorage,
StaticQueue_t * pxStaticQueue,
const uint8_t ucQueueType ) PRIVILEGED_FUNCTION;
*/
extern QueueHandle_t xQueueGenericCreateStatic(const UBaseType_t uxQueueLength,const UBaseType_t uxItemSize,uint8_t * pucQueueStorage,StaticQueue_t * pxStaticQueue,const uint8_t ucQueueType);
#endif
/*
* Queue sets provide a mechanism to allow a task to block (pend) on a read
* operation from multiple queues or semaphores simultaneously.
*
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function.
*
* A queue set must be explicitly created using a call to xQueueCreateSet()
* before it can be used. Once created, standard FreeRTOS queues and semaphores
* can be added to the set using calls to xQueueAddToSet().
* xQueueSelectFromSet() is then used to determine which, if any, of the queues
* or semaphores contained in the set is in a state where a queue read or
* semaphore take operation would be successful.
*
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
* for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects.
*
* Note 2: Blocking on a queue set that contains a mutex will not cause the
* mutex holder to inherit the priority of the blocked task.
*
* Note 3: An additional 4 bytes of RAM is required for each space in a every
* queue added to a queue set. Therefore counting semaphores that have a high
* maximum count value should not be added to a queue set.
*
* Note 4: A receive (in the case of a queue) or take (in the case of a
* semaphore) operation must not be performed on a member of a queue set unless
* a call to xQueueSelectFromSet() has first returned a handle to that set member.
*
* @param uxEventQueueLength Queue sets store events that occur on
* the queues and semaphores contained in the set. uxEventQueueLength specifies
* the maximum number of events that can be queued at once. To be absolutely
* certain that events are not lost uxEventQueueLength should be set to the
* total sum of the length of the queues added to the set, where binary
* semaphores and mutexes have a length of 1, and counting semaphores have a
* length set by their maximum count value. Examples:
* + If a queue set is to hold a queue of length 5, another queue of length 12,
* and a binary semaphore, then uxEventQueueLength should be set to
* (5 + 12 + 1), or 18.
* + If a queue set is to hold three binary semaphores then uxEventQueueLength
* should be set to (1 + 1 + 1 ), or 3.
* + If a queue set is to hold a counting semaphore that has a maximum count of
* 5, and a counting semaphore that has a maximum count of 3, then
* uxEventQueueLength should be set to (5 + 3), or 8.
*
* @return If the queue set is created successfully then a handle to the created
* queue set is returned. Otherwise NULL is returned.
*/
/*
QueueSetHandle_t xQueueCreateSet( const UBaseType_t uxEventQueueLength ) PRIVILEGED_FUNCTION;
*/
extern QueueSetHandle_t xQueueCreateSet(const UBaseType_t uxEventQueueLength);
/*
* Adds a queue or semaphore to a queue set that was previously created by a
* call to xQueueCreateSet().
*
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function.
*
* Note 1: A receive (in the case of a queue) or take (in the case of a
* semaphore) operation must not be performed on a member of a queue set unless
* a call to xQueueSelectFromSet() has first returned a handle to that set member.
*
* @param xQueueOrSemaphore The handle of the queue or semaphore being added to
* the queue set (cast to an QueueSetMemberHandle_t type).
*
* @param xQueueSet The handle of the queue set to which the queue or semaphore
* is being added.
*
* @return If the queue or semaphore was successfully added to the queue set
* then pdPASS is returned. If the queue could not be successfully added to the
* queue set because it is already a member of a different queue set then pdFAIL
* is returned.
*/
/*
BaseType_t xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
*/
extern QueueSetHandle_t xQueueAddToSet(QueueSetMemberHandle_t xQueueOrSemaphore,QueueSetHandle_t xQueueSet);
/*
* Removes a queue or semaphore from a queue set. A queue or semaphore can only
* be removed from a set if the queue or semaphore is empty.
*
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function.
*
* @param xQueueOrSemaphore The handle of the queue or semaphore being removed
* from the queue set (cast to an QueueSetMemberHandle_t type).
*
* @param xQueueSet The handle of the queue set in which the queue or semaphore
* is included.
*
* @return If the queue or semaphore was successfully removed from the queue set
* then pdPASS is returned. If the queue was not in the queue set, or the
* queue (or semaphore) was not empty, then pdFAIL is returned.
*/
/*
BaseType_t xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore,
QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
*/
extern QueueSetHandle_t xQueueRemoveFromSet(QueueSetMemberHandle_t xQueueOrSemaphore,QueueSetHandle_t xQueueSet);
/*
* xQueueSelectFromSet() selects from the members of a queue set a queue or
* semaphore that either contains data (in the case of a queue) or is available
* to take (in the case of a semaphore). xQueueSelectFromSet() effectively
* allows a task to block (pend) on a read operation on all the queues and
* semaphores in a queue set simultaneously.
*
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this
* function.
*
* Note 1: See the documentation on https://www.FreeRTOS.org/RTOS-queue-sets.html
* for reasons why queue sets are very rarely needed in practice as there are
* simpler methods of blocking on multiple objects.
*
* Note 2: Blocking on a queue set that contains a mutex will not cause the
* mutex holder to inherit the priority of the blocked task.
*
* Note 3: A receive (in the case of a queue) or take (in the case of a
* semaphore) operation must not be performed on a member of a queue set unless
* a call to xQueueSelectFromSet() has first returned a handle to that set member.
*
* @param xQueueSet The queue set on which the task will (potentially) block.
*
* @param xTicksToWait The maximum time, in ticks, that the calling task will
* remain in the Blocked state (with other tasks executing) to wait for a member
* of the queue set to be ready for a successful queue read or semaphore take
* operation.
*
* @return xQueueSelectFromSet() will return the handle of a queue (cast to
* a QueueSetMemberHandle_t type) contained in the queue set that contains data,
* or the handle of a semaphore (cast to a QueueSetMemberHandle_t type) contained
* in the queue set that is available, or NULL if no such queue or semaphore
* exists before before the specified block time expires.
*/
/*
QueueSetMemberHandle_t xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;
*/
extern QueueSetMemberHandle_t xQueueSelectFromSet(QueueSetHandle_t xQueueSet,const TickType_t xTicksToWait);
/*
* A version of xQueueSelectFromSet() that can be used from an ISR.
*/
/*
QueueSetMemberHandle_t xQueueSelectFromSetFromISR( QueueSetHandle_t xQueueSet ) PRIVILEGED_FUNCTION;
*/
extern QueueSetMemberHandle_t xQueueSelectFromSetFromISR(QueueSetHandle_t xQueueSet);
/* Not public API functions. */
/*
void vQueueWaitForMessageRestricted( QueueHandle_t xQueue,
TickType_t xTicksToWait,
const BaseType_t xWaitIndefinitely ) PRIVILEGED_FUNCTION;
BaseType_t xQueueGenericReset( QueueHandle_t xQueue,
BaseType_t xNewQueue ) PRIVILEGED_FUNCTION;
void vQueueSetQueueNumber( QueueHandle_t xQueue,
UBaseType_t uxQueueNumber ) PRIVILEGED_FUNCTION;
UBaseType_t uxQueueGetQueueNumber( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
uint8_t ucQueueGetQueueType( QueueHandle_t xQueue ) PRIVILEGED_FUNCTION;
*/
extern void vQueueWaitForMessageRestricted(QueueHandle_t xQueue,TickType_t xTicksToWait,const BaseType_t xWaitIndefinitely);
extern BaseType_t xQueueGenericReset(QueueHandle_t xQueue,BaseType_t xNewQueue);
extern void vQueueSetQueueNumber(QueueHandle_t xQueue,UBaseType_t uxQueueNumber);
extern UBaseType_t uxQueueGetQueueNumber(QueueHandle_t xQueue);
extern uint8_t ucQueueGetQueueType(QueueHandle_t xQueue);
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* QUEUE_H */
| [
"phillip.stevens@gmail.com"
] | phillip.stevens@gmail.com |
50781880efaf67ed19899bec89bcb4a6e85967e2 | e89f2409b5ede8acbd54fb975766a94dfc00b2c9 | /JiuDuOJ/[文件操作][华中科技大学11].c | 771b8b16896b6a1c51913c520069e268ec9a8710 | [] | no_license | ShijunDeng/OnlineJudge | 180a7a98526e706ae30e2566d349108d0eb5d3f8 | 13a3f0f2d74fea454016df96447b6f15725506b3 | refs/heads/master | 2021-01-13T03:54:03.851428 | 2018-01-24T14:06:30 | 2018-01-24T14:06:30 | 78,272,950 | 2 | 0 | null | null | null | null | GB18030 | C | false | false | 1,357 | c | #include<stdio.h>
//#include<string.h>
//#include<malloc.h>
//#include<math.h>
//定义状态码
#define OK 0
#define ERROR -1
#define TRUE 1
#define FALSE 0
typedef int Status;
typedef int Boolean;
#define N 1000
/*************************题目说明********************/
/*
*/
Status writeToFile(char str[N])
{
FILE *fp;
fp=fopen("E:\\Work\\Development Files\\C\\str.txt","a+");
fprintf(fp,"%s\n",str);
fclose(fp);
return OK;
}
Status deleteSpace()
{
FILE *fpR,*fpW;
char str[N];
int i=0,j=0;
fpR=fopen("E:\\Work\\Development Files\\C\\str.txt","r");
fpW=fopen("E:\\Work\\Development Files\\C\\strW.txt","a+");
while(fgets(str,N,fpR)!=NULL)
{
i=j=0;
while(str[j]!='\0'&&str[j]!='\n')
{
while(str[j]!='\0'&&str[j]!='\n'&&str[j]!=' ')
{
str[i]=str[j];
i++;
j++;
}
if(str[j]==' ')
{
str[i]=str[j];
i++;
j++;
}
else
{
break;
}
while(str[j]==' ')
{
j++;
}
}
fprintf(fpW,"%s",str);
}
fclose(fpR);
fclose(fpW);
return OK;
}
//业务处理函数:输入数据 调用相关函数完成任务 返回处理结果
Status service()
{
char str[N];
while(gets(str)!=NULL)//while 1#
{
writeToFile(str);
}//end:while 1#
deleteSpace();
return OK;
}
int main()
{
if(ERROR==service())//解决方案出错
{
printf("ERROR!\n");
return ERROR;
}
return OK;
} | [
"M201572621@hust.edu.cn"
] | M201572621@hust.edu.cn |
018b0f6b9a1592251255f5ce526b42fb8aa668d2 | 6fe3cf3b38a51d23540add89f2dcfb83235abb12 | /test_Library/static_library/test_Library.c | 82773a508e7540e8a13c3e5eba02abbd374b8528 | [] | no_license | cupidljh/test | c8ccbf807bbd6ed11706544a61b002e72f3f1bd8 | 84bdb31ce14638cedfe4bec2f8435f4613d2f116 | refs/heads/master | 2021-01-15T08:14:40.876767 | 2016-08-31T00:28:47 | 2016-08-31T00:28:47 | 64,896,200 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 252 | c | #include<stdio.h>
#include<stdlib.h>
#include<assert.h>
extern void hexprint(char* filename);
int main(int argc, char* argv[])
{
/* if(argc == 1){
fputs("error\n",stderr);
exit(1);
}
*/
assert(argc >= 1);
hexprint(argv[1]);
return 0;
}
| [
"cupidljh91@naver.com"
] | cupidljh91@naver.com |
f3612050f21154a5931506214e4cffc6bb155c03 | acb8d4c4f974d872f31997f591fea4d748f94b93 | /p/fystreet/street2201.c | 0a232807fae4e64b1e2d42d0ab0491321519656b | [] | no_license | MudRen/SZMUD | 8ae6b05718b1a83363478469185e0d776b0fda5c | e3b46e6efa6d353f7f0d00ef676f97d5c0ec3949 | refs/heads/master | 2023-05-27T16:04:35.845610 | 2021-06-18T12:47:19 | 2021-06-18T12:47:19 | 361,736,744 | 1 | 2 | null | null | null | null | GB18030 | C | false | false | 582 | c | #define ID 2201
#include <ansi.h>
inherit ROOM;
void create()
{ set("short",HIW"空地"NOR);
set("long",@LONG
这是拥挤的城市中难得一见的开阔地,不过,这里已经被打扫干净,
看上去正在寻找买家呢。想在这里拥有一套自己的房间可不容易,必须要
缴纳一大笔的购地款。
LONG );
set("roomid",ID);
if(ID%2) set("exits",(["east":__DIR__"street"+(string)(ID/100),]));
else set("exits",(["west":__DIR__"street"+(string)(ID/100),]));
set("coor/x",40+(ID%2)*20);
set("coor/y",20+(ID/100)*10);
set("coor/z",0);
setup();
} | [
"i@oiuv.cn"
] | i@oiuv.cn |
a209d9e2da67dd07d1229ca16d5370dda066b09a | 363ff58e450668f5d6fe719137200084aca13f22 | /ex11.c | 020fe82592688ad2637b000d4436f0266b247c31 | [
"BSD-3-Clause"
] | permissive | mmcgurn/MattFlowCases | 607e68a0ac02dcaab1184282d007ac549a69ee30 | 1ef7ca77b447a07fdd14d1e2e902abe3e281b651 | refs/heads/main | 2023-04-26T18:32:38.115627 | 2021-05-20T17:35:02 | 2021-05-20T17:35:02 | 353,406,927 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 113,059 | c | static char help[] = "Second Order TVD Finite Volume Example.\n";
/*F
We use a second order TVD finite volume method to evolve a system of PDEs. Our simple upwinded residual evaluation loops
over all mesh faces and uses a Riemann solver to produce the flux given the face geometry and cell values,
\begin{equation}
f_i = \mathrm{riemann}(\mathrm{phys}, p_\mathrm{centroid}, \hat n, x^L, x^R)
\end{equation}
and then update the cell values given the cell volume.
\begin{eqnarray}
f^L_i &-=& \frac{f_i}{vol^L} \\
f^R_i &+=& \frac{f_i}{vol^R}
\end{eqnarray}
As an example, we can consider the shallow water wave equation,
\begin{eqnarray}
h_t + \nabla\cdot \left( uh \right) &=& 0 \\
(uh)_t + \nabla\cdot \left( u\otimes uh + \frac{g h^2}{2} I \right) &=& 0
\end{eqnarray}
where $h$ is wave height, $u$ is wave velocity, and $g$ is the acceleration due to gravity.
A representative Riemann solver for the shallow water equations is given in the PhysicsRiemann_SW() function,
\begin{eqnarray}
f^{L,R}_h &=& uh^{L,R} \cdot \hat n \\
f^{L,R}_{uh} &=& \frac{f^{L,R}_h}{h^{L,R}} uh^{L,R} + g (h^{L,R})^2 \hat n \\
c^{L,R} &=& \sqrt{g h^{L,R}} \\
s &=& \max\left( \left|\frac{uh^L \cdot \hat n}{h^L}\right| + c^L, \left|\frac{uh^R \cdot \hat n}{h^R}\right| + c^R \right) \\
f_i &=& \frac{A_\mathrm{face}}{2} \left( f^L_i + f^R_i + s \left( x^L_i - x^R_i \right) \right)
\end{eqnarray}
where $c$ is the local gravity wave speed and $f_i$ is a Rusanov flux.
The more sophisticated residual evaluation in RHSFunctionLocal_LS() uses a least-squares fit to a quadratic polynomial
over a neighborhood of the given element.
The mesh is read in from an ExodusII file, usually generated by Cubit.
F*/
#include <petscdmplex.h>
#include <petscdmforest.h>
#include <petscds.h>
#include <petscts.h>
#include <petscsf.h> /* For SplitFaces() */
#define DIM 2 /* Geometric dimension */
#define ALEN(a) (sizeof(a)/sizeof((a)[0]))
static PetscFunctionList PhysicsList, PhysicsRiemannList_SW;
/* Represents continuum physical equations. */
typedef struct _n_Physics *Physics;
/* Physical model includes boundary conditions, initial conditions, and functionals of interest. It is
* discretization-independent, but its members depend on the scenario being solved. */
typedef struct _n_Model *Model;
/* 'User' implements a discretization of a continuous model. */
typedef struct _n_User *User;
typedef PetscErrorCode (*SolutionFunction)(Model,PetscReal,const PetscReal*,PetscScalar*,void*);
typedef PetscErrorCode (*SetUpBCFunction)(PetscDS,Physics);
typedef PetscErrorCode (*FunctionalFunction)(Model,PetscReal,const PetscReal*,const PetscScalar*,PetscReal*,void*);
typedef PetscErrorCode (*SetupFields)(Physics,PetscSection);
static PetscErrorCode ModelSolutionSetDefault(Model,SolutionFunction,void*);
static PetscErrorCode ModelFunctionalRegister(Model,const char*,PetscInt*,FunctionalFunction,void*);
static PetscErrorCode OutputVTK(DM,const char*,PetscViewer*);
struct FieldDescription {
const char *name;
PetscInt dof;
};
typedef struct _n_FunctionalLink *FunctionalLink;
struct _n_FunctionalLink {
char *name;
FunctionalFunction func;
void *ctx;
PetscInt offset;
FunctionalLink next;
};
struct _n_Physics {
PetscRiemannFunc riemann;
PetscInt dof; /* number of degrees of freedom per cell */
PetscReal maxspeed; /* kludge to pick initial time step, need to add monitoring and step control */
void *data;
PetscInt nfields;
const struct FieldDescription *field_desc;
};
struct _n_Model {
MPI_Comm comm; /* Does not do collective communicaton, but some error conditions can be collective */
Physics physics;
FunctionalLink functionalRegistry;
PetscInt maxComputed;
PetscInt numMonitored;
FunctionalLink *functionalMonitored;
PetscInt numCall;
FunctionalLink *functionalCall;
SolutionFunction solution;
SetUpBCFunction setupbc;
void *solutionctx;
PetscReal maxspeed; /* estimate of global maximum speed (for CFL calculation) */
PetscReal bounds[2*DIM];
DMBoundaryType bcs[3];
PetscErrorCode (*errorIndicator)(PetscInt, PetscReal, PetscInt, const PetscScalar[], const PetscScalar[], PetscReal *, void *);
void *errorCtx;
};
struct _n_User {
PetscInt numSplitFaces;
PetscInt vtkInterval; /* For monitor */
char outputBasename[PETSC_MAX_PATH_LEN]; /* Basename for output files */
PetscInt monitorStepOffset;
Model model;
PetscBool vtkmon;
};
PETSC_STATIC_INLINE PetscReal DotDIMReal(const PetscReal *x,const PetscReal *y)
{
PetscInt i;
PetscReal prod=0.0;
for (i=0; i<DIM; i++) prod += x[i]*y[i];
return prod;
}
PETSC_STATIC_INLINE PetscReal NormDIM(const PetscReal *x) { return PetscSqrtReal(PetscAbsReal(DotDIMReal(x,x))); }
PETSC_STATIC_INLINE PetscReal Dot2Real(const PetscReal *x,const PetscReal *y) { return x[0]*y[0] + x[1]*y[1];}
PETSC_STATIC_INLINE PetscReal Norm2Real(const PetscReal *x) { return PetscSqrtReal(PetscAbsReal(Dot2Real(x,x)));}
PETSC_STATIC_INLINE void Normalize2Real(PetscReal *x) { PetscReal a = 1./Norm2Real(x); x[0] *= a; x[1] *= a; }
PETSC_STATIC_INLINE void Waxpy2Real(PetscReal a,const PetscReal *x,const PetscReal *y,PetscReal *w) { w[0] = a*x[0] + y[0]; w[1] = a*x[1] + y[1]; }
PETSC_STATIC_INLINE void Scale2Real(PetscReal a,const PetscReal *x,PetscReal *y) { y[0] = a*x[0]; y[1] = a*x[1]; }
/******************* Advect ********************/
typedef enum {ADVECT_SOL_TILTED,ADVECT_SOL_BUMP,ADVECT_SOL_BUMP_CAVITY} AdvectSolType;
static const char *const AdvectSolTypes[] = {"TILTED","BUMP","BUMP_CAVITY","AdvectSolType","ADVECT_SOL_",0};
typedef enum {ADVECT_SOL_BUMP_CONE,ADVECT_SOL_BUMP_COS} AdvectSolBumpType;
static const char *const AdvectSolBumpTypes[] = {"CONE","COS","AdvectSolBumpType","ADVECT_SOL_BUMP_",0};
typedef struct {
PetscReal wind[DIM];
} Physics_Advect_Tilted;
typedef struct {
PetscReal center[DIM];
PetscReal radius;
AdvectSolBumpType type;
} Physics_Advect_Bump;
typedef struct {
PetscReal inflowState;
AdvectSolType soltype;
union {
Physics_Advect_Tilted tilted;
Physics_Advect_Bump bump;
} sol;
struct {
PetscInt Solution;
PetscInt Error;
} functional;
} Physics_Advect;
static const struct FieldDescription PhysicsFields_Advect[] = {{"U",1},{NULL,0}};
static PetscErrorCode PhysicsBoundary_Advect_Inflow(PetscReal time, const PetscReal *c, const PetscReal *n, const PetscScalar *xI, PetscScalar *xG, void *ctx)
{
Physics phys = (Physics)ctx;
Physics_Advect *advect = (Physics_Advect*)phys->data;
PetscFunctionBeginUser;
xG[0] = advect->inflowState;
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsBoundary_Advect_Outflow(PetscReal time, const PetscReal *c, const PetscReal *n, const PetscScalar *xI, PetscScalar *xG, void *ctx)
{
PetscFunctionBeginUser;
xG[0] = xI[0];
PetscFunctionReturn(0);
}
static void PhysicsRiemann_Advect(PetscInt dim, PetscInt Nf, const PetscReal *qp, const PetscReal *n, const PetscScalar *xL, const PetscScalar *xR, PetscInt numConstants, const PetscScalar constants[], PetscScalar *flux, Physics phys)
{
Physics_Advect *advect = (Physics_Advect*)phys->data;
PetscReal wind[DIM],wn;
switch (advect->soltype) {
case ADVECT_SOL_TILTED: {
Physics_Advect_Tilted *tilted = &advect->sol.tilted;
wind[0] = tilted->wind[0];
wind[1] = tilted->wind[1];
} break;
case ADVECT_SOL_BUMP:
wind[0] = -qp[1];
wind[1] = qp[0];
break;
case ADVECT_SOL_BUMP_CAVITY:
{
PetscInt i;
PetscReal comp2[3] = {0.,0.,0.}, rad2;
rad2 = 0.;
for (i = 0; i < dim; i++) {
comp2[i] = qp[i] * qp[i];
rad2 += comp2[i];
}
wind[0] = -qp[1];
wind[1] = qp[0];
if (rad2 > 1.) {
PetscInt maxI = 0;
PetscReal maxComp2 = comp2[0];
for (i = 1; i < dim; i++) {
if (comp2[i] > maxComp2) {
maxI = i;
maxComp2 = comp2[i];
}
}
wind[maxI] = 0.;
}
}
break;
default:
{
PetscInt i;
for (i = 0; i < DIM; ++i) wind[i] = 0.0;
}
/* default: SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"No support for solution type %s",AdvectSolBumpTypes[advect->soltype]); */
}
wn = Dot2Real(wind, n);
flux[0] = (wn > 0 ? xL[0] : xR[0]) * wn;
}
static PetscErrorCode PhysicsSolution_Advect(Model mod,PetscReal time,const PetscReal *x,PetscScalar *u,void *ctx)
{
Physics phys = (Physics)ctx;
Physics_Advect *advect = (Physics_Advect*)phys->data;
PetscFunctionBeginUser;
switch (advect->soltype) {
case ADVECT_SOL_TILTED: {
PetscReal x0[DIM];
Physics_Advect_Tilted *tilted = &advect->sol.tilted;
Waxpy2Real(-time,tilted->wind,x,x0);
if (x0[1] > 0) u[0] = 1.*x[0] + 3.*x[1];
else u[0] = advect->inflowState;
} break;
case ADVECT_SOL_BUMP_CAVITY:
case ADVECT_SOL_BUMP: {
Physics_Advect_Bump *bump = &advect->sol.bump;
PetscReal x0[DIM],v[DIM],r,cost,sint;
cost = PetscCosReal(time);
sint = PetscSinReal(time);
x0[0] = cost*x[0] + sint*x[1];
x0[1] = -sint*x[0] + cost*x[1];
Waxpy2Real(-1,bump->center,x0,v);
r = Norm2Real(v);
switch (bump->type) {
case ADVECT_SOL_BUMP_CONE:
u[0] = PetscMax(1 - r/bump->radius,0);
break;
case ADVECT_SOL_BUMP_COS:
u[0] = 0.5 + 0.5*PetscCosReal(PetscMin(r/bump->radius,1)*PETSC_PI);
break;
}
} break;
default: SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"Unknown solution type");
}
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsFunctional_Advect(Model mod,PetscReal time,const PetscReal *x,const PetscScalar *y,PetscReal *f,void *ctx)
{
Physics phys = (Physics)ctx;
Physics_Advect *advect = (Physics_Advect*)phys->data;
PetscScalar yexact[1];
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = PhysicsSolution_Advect(mod,time,x,yexact,phys);CHKERRQ(ierr);
f[advect->functional.Solution] = PetscRealPart(y[0]);
f[advect->functional.Error] = PetscAbsScalar(y[0]-yexact[0]);
PetscFunctionReturn(0);
}
static PetscErrorCode SetUpBC_Advect(PetscDS prob, Physics phys)
{
PetscErrorCode ierr;
const PetscInt inflowids[] = {100,200,300},outflowids[] = {101};
PetscFunctionBeginUser;
/* Register "canned" boundary conditions and defaults for where to apply. */
ierr = PetscDSAddBoundary(prob, DM_BC_NATURAL_RIEMANN, "inflow", "Face Sets", 0, 0, NULL, (void (*)(void)) PhysicsBoundary_Advect_Inflow, NULL, ALEN(inflowids), inflowids, phys);CHKERRQ(ierr);
ierr = PetscDSAddBoundary(prob, DM_BC_NATURAL_RIEMANN, "outflow", "Face Sets", 0, 0, NULL, (void (*)(void)) PhysicsBoundary_Advect_Outflow, NULL, ALEN(outflowids), outflowids, phys);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsCreate_Advect(Model mod,Physics phys,PetscOptionItems *PetscOptionsObject)
{
Physics_Advect *advect;
PetscErrorCode ierr;
PetscFunctionBeginUser;
phys->field_desc = PhysicsFields_Advect;
phys->riemann = (PetscRiemannFunc)PhysicsRiemann_Advect;
ierr = PetscNew(&advect);CHKERRQ(ierr);
phys->data = advect;
mod->setupbc = SetUpBC_Advect;
ierr = PetscOptionsHead(PetscOptionsObject,"Advect options");CHKERRQ(ierr);
{
PetscInt two = 2,dof = 1;
advect->soltype = ADVECT_SOL_TILTED;
ierr = PetscOptionsEnum("-advect_sol_type","solution type","",AdvectSolTypes,(PetscEnum)advect->soltype,(PetscEnum*)&advect->soltype,NULL);CHKERRQ(ierr);
switch (advect->soltype) {
case ADVECT_SOL_TILTED: {
Physics_Advect_Tilted *tilted = &advect->sol.tilted;
two = 2;
tilted->wind[0] = 0.0;
tilted->wind[1] = 1.0;
ierr = PetscOptionsRealArray("-advect_tilted_wind","background wind vx,vy","",tilted->wind,&two,NULL);CHKERRQ(ierr);
advect->inflowState = -2.0;
ierr = PetscOptionsRealArray("-advect_tilted_inflow","Inflow state","",&advect->inflowState,&dof,NULL);CHKERRQ(ierr);
phys->maxspeed = Norm2Real(tilted->wind);
} break;
case ADVECT_SOL_BUMP_CAVITY:
case ADVECT_SOL_BUMP: {
Physics_Advect_Bump *bump = &advect->sol.bump;
two = 2;
bump->center[0] = 2.;
bump->center[1] = 0.;
ierr = PetscOptionsRealArray("-advect_bump_center","location of center of bump x,y","",bump->center,&two,NULL);CHKERRQ(ierr);
bump->radius = 0.9;
ierr = PetscOptionsReal("-advect_bump_radius","radius of bump","",bump->radius,&bump->radius,NULL);CHKERRQ(ierr);
bump->type = ADVECT_SOL_BUMP_CONE;
ierr = PetscOptionsEnum("-advect_bump_type","type of bump","",AdvectSolBumpTypes,(PetscEnum)bump->type,(PetscEnum*)&bump->type,NULL);CHKERRQ(ierr);
phys->maxspeed = 3.; /* radius of mesh, kludge */
} break;
}
}
ierr = PetscOptionsTail();CHKERRQ(ierr);
/* Initial/transient solution with default boundary conditions */
ierr = ModelSolutionSetDefault(mod,PhysicsSolution_Advect,phys);CHKERRQ(ierr);
/* Register "canned" functionals */
ierr = ModelFunctionalRegister(mod,"Solution",&advect->functional.Solution,PhysicsFunctional_Advect,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Error",&advect->functional.Error,PhysicsFunctional_Advect,phys);CHKERRQ(ierr);
mod->bcs[0] = mod->bcs[1] = mod->bcs[2] = DM_BOUNDARY_GHOSTED;
PetscFunctionReturn(0);
}
/******************* Shallow Water ********************/
typedef struct {
PetscReal gravity;
PetscReal boundaryHeight;
struct {
PetscInt Height;
PetscInt Speed;
PetscInt Energy;
} functional;
} Physics_SW;
typedef struct {
PetscReal h;
PetscReal uh[DIM];
} SWNode;
typedef union {
SWNode swnode;
PetscReal vals[DIM+1];
} SWNodeUnion;
static const struct FieldDescription PhysicsFields_SW[] = {{"Height",1},{"Momentum",DIM},{NULL,0}};
/*
* h_t + div(uh) = 0
* (uh)_t + div (u\otimes uh + g h^2 / 2 I) = 0
*
* */
static PetscErrorCode SWFlux(Physics phys,const PetscReal *n,const SWNode *x,SWNode *f)
{
Physics_SW *sw = (Physics_SW*)phys->data;
PetscReal uhn,u[DIM];
PetscInt i;
PetscFunctionBeginUser;
Scale2Real(1./x->h,x->uh,u);
uhn = x->uh[0] * n[0] + x->uh[1] * n[1];
f->h = uhn;
for (i=0; i<DIM; i++) f->uh[i] = u[i] * uhn + sw->gravity * PetscSqr(x->h) * n[i];
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsBoundary_SW_Wall(PetscReal time, const PetscReal *c, const PetscReal *n, const PetscScalar *xI, PetscScalar *xG, void *ctx)
{
PetscFunctionBeginUser;
xG[0] = xI[0];
xG[1] = -xI[1];
xG[2] = -xI[2];
PetscFunctionReturn(0);
}
static void PhysicsRiemann_SW_HLL(PetscInt dim, PetscInt Nf, const PetscReal *qp, const PetscReal *n, const PetscScalar *xL, const PetscScalar *xR, PetscInt numConstants, const PetscScalar constants[], PetscScalar *flux, Physics phys)
{
Physics_SW *sw = (Physics_SW *) phys->data;
PetscReal aL, aR;
PetscReal nn[DIM];
#if !defined(PETSC_USE_COMPLEX)
const SWNode *uL = (const SWNode *) xL, *uR = (const SWNode *) xR;
#else
SWNodeUnion uLreal, uRreal;
const SWNode *uL = &uLreal.swnode;
const SWNode *uR = &uRreal.swnode;
#endif
SWNodeUnion fL, fR;
PetscInt i;
PetscReal zero = 0.;
#if defined(PETSC_USE_COMPLEX)
uLreal.swnode.h = 0; uRreal.swnode.h = 0;
for (i = 0; i < 1+dim; i++) uLreal.vals[i] = PetscRealPart(xL[i]);
for (i = 0; i < 1+dim; i++) uRreal.vals[i] = PetscRealPart(xR[i]);
#endif
if (uL->h <= 0 || uR->h <= 0) {
for (i = 0; i < 1 + dim; i++) flux[i] = zero;
return;
} /* SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Reconstructed thickness is negative"); */
nn[0] = n[0];
nn[1] = n[1];
Normalize2Real(nn);
SWFlux(phys, nn, uL, &(fL.swnode));
SWFlux(phys, nn, uR, &(fR.swnode));
/* gravity wave speed */
aL = PetscSqrtReal(sw->gravity * uL->h);
aR = PetscSqrtReal(sw->gravity * uR->h);
// Defining u_tilda and v_tilda as u and v
PetscReal u_L, u_R;
u_L = Dot2Real(uL->uh,nn)/uL->h;
u_R = Dot2Real(uR->uh,nn)/uR->h;
PetscReal sL, sR;
sL = PetscMin(u_L - aL, u_R - aR);
sR = PetscMax(u_L + aL, u_R + aR);
if (sL > zero) {
for (i = 0; i < dim + 1; i++) {
flux[i] = fL.vals[i] * Norm2Real(n);
}
} else if (sR < zero) {
for (i = 0; i < dim + 1; i++) {
flux[i] = fR.vals[i] * Norm2Real(n);
}
} else {
for (i = 0; i < dim + 1; i++) {
flux[i] = ((sR * fL.vals[i] - sL * fR.vals[i] + sR * sL * (xR[i] - xL[i])) / (sR - sL)) * Norm2Real(n);
}
}
}
static void PhysicsRiemann_SW_Rusanov(PetscInt dim, PetscInt Nf, const PetscReal *qp, const PetscReal *n, const PetscScalar *xL, const PetscScalar *xR, PetscInt numConstants, const PetscScalar constants[], PetscScalar *flux, Physics phys)
{
Physics_SW *sw = (Physics_SW*)phys->data;
PetscReal cL,cR,speed;
PetscReal nn[DIM];
#if !defined(PETSC_USE_COMPLEX)
const SWNode *uL = (const SWNode*)xL,*uR = (const SWNode*)xR;
#else
SWNodeUnion uLreal, uRreal;
const SWNode *uL = &uLreal.swnode;
const SWNode *uR = &uRreal.swnode;
#endif
SWNodeUnion fL,fR;
PetscInt i;
PetscReal zero=0.;
#if defined(PETSC_USE_COMPLEX)
uLreal.swnode.h = 0; uRreal.swnode.h = 0;
for (i = 0; i < 1+dim; i++) uLreal.vals[i] = PetscRealPart(xL[i]);
for (i = 0; i < 1+dim; i++) uRreal.vals[i] = PetscRealPart(xR[i]);
#endif
if (uL->h < 0 || uR->h < 0) {for (i=0; i<1+dim; i++) flux[i] = zero/zero; return;} /* SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,"Reconstructed thickness is negative"); */
nn[0] = n[0];
nn[1] = n[1];
Normalize2Real(nn);
SWFlux(phys,nn,uL,&(fL.swnode));
SWFlux(phys,nn,uR,&(fR.swnode));
cL = PetscSqrtReal(sw->gravity*uL->h);
cR = PetscSqrtReal(sw->gravity*uR->h); /* gravity wave speed */
speed = PetscMax(PetscAbsReal(Dot2Real(uL->uh,nn)/uL->h) + cL,PetscAbsReal(Dot2Real(uR->uh,nn)/uR->h) + cR);
for (i=0; i<1+dim; i++) flux[i] = (0.5*(fL.vals[i] + fR.vals[i]) + 0.5*speed*(xL[i] - xR[i])) * Norm2Real(n);
}
static PetscErrorCode PhysicsSolution_SW(Model mod,PetscReal time,const PetscReal *x,PetscScalar *u,void *ctx)
{
PetscReal dx[2],r,sigma;
PetscFunctionBeginUser;
if (time != 0.0) SETERRQ1(mod->comm,PETSC_ERR_SUP,"No solution known for time %g",(double)time);
dx[0] = x[0] - 1.5;
dx[1] = x[1] - 1.0;
r = Norm2Real(dx);
sigma = 0.5;
u[0] = 1 + 2*PetscExpReal(-PetscSqr(r)/(2*PetscSqr(sigma)));
u[1] = 0.0;
u[2] = 0.0;
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsFunctional_SW(Model mod,PetscReal time,const PetscReal *coord,const PetscScalar *xx,PetscReal *f,void *ctx)
{
Physics phys = (Physics)ctx;
Physics_SW *sw = (Physics_SW*)phys->data;
const SWNode *x = (const SWNode*)xx;
PetscReal u[2];
PetscReal h;
PetscFunctionBeginUser;
h = x->h;
Scale2Real(1./x->h,x->uh,u);
f[sw->functional.Height] = h;
f[sw->functional.Speed] = Norm2Real(u) + PetscSqrtReal(sw->gravity*h);
f[sw->functional.Energy] = 0.5*(Dot2Real(x->uh,u) + sw->gravity*PetscSqr(h));
PetscFunctionReturn(0);
}
static PetscErrorCode SetUpBC_SW(PetscDS prob,Physics phys)
{
PetscErrorCode ierr;
const PetscInt wallids[] = {100,101,200,300};
PetscFunctionBeginUser;
ierr = PetscDSAddBoundary(prob, DM_BC_NATURAL_RIEMANN, "wall", "Face Sets", 0, 0, NULL, (void (*)(void)) PhysicsBoundary_SW_Wall, NULL, ALEN(wallids), wallids, phys);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsCreate_SW(Model mod,Physics phys,PetscOptionItems *PetscOptionsObject)
{
Physics_SW *sw;
char sw_riemann[64] = "rusanov";
PetscErrorCode ierr;
PetscFunctionBeginUser;
phys->field_desc = PhysicsFields_SW;
ierr = PetscNew(&sw);CHKERRQ(ierr);
phys->data = sw;
mod->setupbc = SetUpBC_SW;
PetscFunctionListAdd(&PhysicsRiemannList_SW, "rusanov", PhysicsRiemann_SW_Rusanov);
PetscFunctionListAdd(&PhysicsRiemannList_SW, "hll", PhysicsRiemann_SW_HLL);
ierr = PetscOptionsHead(PetscOptionsObject,"SW options");CHKERRQ(ierr);
{
void (*PhysicsRiemann_SW)(PetscInt, PetscInt, const PetscReal *, const PetscReal *, const PetscScalar *, const PetscScalar *, PetscInt, const PetscScalar, PetscScalar *, Physics);
sw->gravity = 1.0;
ierr = PetscOptionsReal("-sw_gravity","Gravitational constant","",sw->gravity,&sw->gravity,NULL);CHKERRQ(ierr);
ierr = PetscOptionsFList("-sw_riemann","Riemann solver","",PhysicsRiemannList_SW,sw_riemann,sw_riemann,sizeof sw_riemann,NULL);CHKERRQ(ierr);
ierr = PetscFunctionListFind(PhysicsRiemannList_SW,sw_riemann,&PhysicsRiemann_SW);CHKERRQ(ierr);
phys->riemann = (PetscRiemannFunc) PhysicsRiemann_SW;
}
ierr = PetscOptionsTail();CHKERRQ(ierr);
phys->maxspeed = PetscSqrtReal(2.0*sw->gravity); /* Mach 1 for depth of 2 */
ierr = ModelSolutionSetDefault(mod,PhysicsSolution_SW,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Height",&sw->functional.Height,PhysicsFunctional_SW,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Speed",&sw->functional.Speed,PhysicsFunctional_SW,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Energy",&sw->functional.Energy,PhysicsFunctional_SW,phys);CHKERRQ(ierr);
mod->bcs[0] = mod->bcs[1] = mod->bcs[2] = DM_BOUNDARY_GHOSTED;
PetscFunctionReturn(0);
}
/******************* Euler Density Shock (EULER_IV_SHOCK,EULER_SS_SHOCK) ********************/
/* An initial-value and self-similar solutions of the compressible Euler equations */
/* Ravi Samtaney and D. I. Pullin */
/* Phys. Fluids 8, 2650 (1996); http://dx.doi.org/10.1063/1.869050 */
typedef enum {EULER_PAR_GAMMA,EULER_PAR_RHOR,EULER_PAR_AMACH,EULER_PAR_ITANA,EULER_PAR_SIZE} EulerParamIdx;
typedef enum {EULER_IV_SHOCK,EULER_SS_SHOCK,EULER_SHOCK_TUBE,EULER_LINEAR_WAVE} EulerType;
typedef struct {
PetscReal r;
PetscReal ru[DIM];
PetscReal E;
} EulerNode;
typedef union {
EulerNode eulernode;
PetscReal vals[DIM+2];
} EulerNodeUnion;
typedef PetscErrorCode (*EquationOfState)(const PetscReal*, const EulerNode*, PetscReal*);
typedef struct {
EulerType type;
PetscReal pars[EULER_PAR_SIZE];
EquationOfState sound;
struct {
PetscInt Density;
PetscInt Momentum;
PetscInt Energy;
PetscInt Pressure;
PetscInt Speed;
} monitor;
} Physics_Euler;
static const struct FieldDescription PhysicsFields_Euler[] = {{"Density",1},{"Momentum",DIM},{"Energy",1},{NULL,0}};
/* initial condition */
int initLinearWave(EulerNode *ux, const PetscReal gamma, const PetscReal coord[], const PetscReal Lx);
static PetscErrorCode PhysicsSolution_Euler(Model mod, PetscReal time, const PetscReal *x, PetscScalar *u, void *ctx)
{
PetscInt i;
Physics phys = (Physics)ctx;
Physics_Euler *eu = (Physics_Euler*)phys->data;
EulerNode *uu = (EulerNode*)u;
PetscReal p0,gamma,c;
PetscFunctionBeginUser;
if (time != 0.0) SETERRQ1(mod->comm,PETSC_ERR_SUP,"No solution known for time %g",(double)time);
for (i=0; i<DIM; i++) uu->ru[i] = 0.0; /* zero out initial velocity */
/* set E and rho */
gamma = eu->pars[EULER_PAR_GAMMA];
if (eu->type==EULER_IV_SHOCK || eu->type==EULER_SS_SHOCK) {
/******************* Euler Density Shock ********************/
/* On initial-value and self-similar solutions of the compressible Euler equations */
/* Ravi Samtaney and D. I. Pullin */
/* Phys. Fluids 8, 2650 (1996); http://dx.doi.org/10.1063/1.869050 */
/* initial conditions 1: left of shock, 0: left of discontinuity 2: right of discontinuity, */
p0 = 1.;
if (x[0] < 0.0 + x[1]*eu->pars[EULER_PAR_ITANA]) {
if (x[0] < mod->bounds[0]*0.5) { /* left of shock (1) */
PetscReal amach,rho,press,gas1,p1;
amach = eu->pars[EULER_PAR_AMACH];
rho = 1.;
press = p0;
p1 = press*(1.0+2.0*gamma/(gamma+1.0)*(amach*amach-1.0));
gas1 = (gamma-1.0)/(gamma+1.0);
uu->r = rho*(p1/press+gas1)/(gas1*p1/press+1.0);
uu->ru[0] = ((uu->r - rho)*PetscSqrtReal(gamma*press/rho)*amach);
uu->E = p1/(gamma-1.0) + .5/uu->r*uu->ru[0]*uu->ru[0];
}
else { /* left of discontinuity (0) */
uu->r = 1.; /* rho = 1 */
uu->E = p0/(gamma-1.0);
}
}
else { /* right of discontinuity (2) */
uu->r = eu->pars[EULER_PAR_RHOR];
uu->E = p0/(gamma-1.0);
}
}
else if (eu->type==EULER_SHOCK_TUBE) {
/* For (x<x0) set (rho,u,p)=(8,0,10) and for (x>x0) set (rho,u,p)=(1,0,1). Choose x0 to the midpoint of the domain in the x-direction. */
if (x[0] < 0.0) {
uu->r = 8.;
uu->E = 10./(gamma-1.);
}
else {
uu->r = 1.;
uu->E = 1./(gamma-1.);
}
}
else if (eu->type==EULER_LINEAR_WAVE) {
initLinearWave( uu, gamma, x, mod->bounds[1] - mod->bounds[0]);
}
else SETERRQ1(mod->comm,PETSC_ERR_SUP,"Unknown type %d",eu->type);
/* set phys->maxspeed: (mod->maxspeed = phys->maxspeed) in main; */
eu->sound(&gamma,uu,&c);
c = (uu->ru[0]/uu->r) + c;
if (c > phys->maxspeed) phys->maxspeed = c;
PetscFunctionReturn(0);
}
static PetscErrorCode Pressure_PG(const PetscReal gamma,const EulerNode *x,PetscReal *p)
{
PetscReal ru2;
PetscFunctionBeginUser;
ru2 = DotDIMReal(x->ru,x->ru);
(*p)=(x->E - 0.5*ru2/x->r)*(gamma - 1.0); /* (E - rho V^2/2)(gamma-1) = e rho (gamma-1) */
PetscFunctionReturn(0);
}
static PetscErrorCode SpeedOfSound_PG(const PetscReal *gamma, const EulerNode *x, PetscReal *c)
{
PetscReal p;
PetscFunctionBeginUser;
Pressure_PG(*gamma,x,&p);
if (p<0.) SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_SUP,"negative pressure time %g -- NEED TO FIX!!!!!!",(double) p);
/* pars[EULER_PAR_GAMMA] = heat capacity ratio */
(*c)=PetscSqrtReal(*gamma * p / x->r);
PetscFunctionReturn(0);
}
/*
* x = (rho,rho*(u_1),...,rho*e)^T
* x_t+div(f_1(x))+...+div(f_DIM(x)) = 0
*
* f_i(x) = u_i*x+(0,0,...,p,...,p*u_i)^T
*
*/
static PetscErrorCode EulerFlux(Physics phys,const PetscReal *n,const EulerNode *x,EulerNode *f)
{
Physics_Euler *eu = (Physics_Euler*)phys->data;
PetscReal nu,p;
PetscInt i;
PetscFunctionBeginUser;
Pressure_PG(eu->pars[EULER_PAR_GAMMA],x,&p);
nu = DotDIMReal(x->ru,n);
f->r = nu; /* A rho u */
nu /= x->r; /* A u */
for (i=0; i<DIM; i++) f->ru[i] = nu * x->ru[i] + n[i]*p; /* r u^2 + p */
f->E = nu * (x->E + p); /* u(e+p) */
PetscFunctionReturn(0);
}
/* PetscReal* => EulerNode* conversion */
static PetscErrorCode PhysicsBoundary_Euler_Wall(PetscReal time, const PetscReal *c, const PetscReal *n, const PetscScalar *a_xI, PetscScalar *a_xG, void *ctx)
{
PetscInt i;
const EulerNode *xI = (const EulerNode*)a_xI;
EulerNode *xG = (EulerNode*)a_xG;
Physics phys = (Physics)ctx;
Physics_Euler *eu = (Physics_Euler*)phys->data;
PetscFunctionBeginUser;
xG->r = xI->r; /* ghost cell density - same */
xG->E = xI->E; /* ghost cell energy - same */
if (n[1] != 0.) { /* top and bottom */
xG->ru[0] = xI->ru[0]; /* copy tang to wall */
xG->ru[1] = -xI->ru[1]; /* reflect perp to t/b wall */
}
else { /* sides */
for (i=0; i<DIM; i++) xG->ru[i] = xI->ru[i]; /* copy */
}
if (eu->type == EULER_LINEAR_WAVE) { /* debug */
#if 0
PetscPrintf(PETSC_COMM_WORLD,"%s coord=%g,%g\n",PETSC_FUNCTION_NAME,c[0],c[1]);
#endif
}
PetscFunctionReturn(0);
}
int godunovflux( const PetscScalar *ul, const PetscScalar *ur, PetscScalar *flux, const PetscReal *nn, const int *ndim, const PetscReal *gamma);
/* PetscReal* => EulerNode* conversion */
static void PhysicsRiemann_Euler_Godunov( PetscInt dim, PetscInt Nf, const PetscReal *qp, const PetscReal *n,
const PetscScalar *xL, const PetscScalar *xR, PetscInt numConstants, const PetscScalar constants[], PetscScalar *flux, Physics phys)
{
Physics_Euler *eu = (Physics_Euler*)phys->data;
PetscReal cL,cR,speed,velL,velR,nn[DIM],s2;
PetscInt i;
PetscErrorCode ierr;
PetscFunctionBeginUser;
for (i=0,s2=0.; i<DIM; i++) {
nn[i] = n[i];
s2 += nn[i]*nn[i];
}
s2 = PetscSqrtReal(s2); /* |n|_2 = sum(n^2)^1/2 */
for (i=0.; i<DIM; i++) nn[i] /= s2;
if (0) { /* Rusanov */
const EulerNode *uL = (const EulerNode*)xL,*uR = (const EulerNode*)xR;
EulerNodeUnion fL,fR;
EulerFlux(phys,nn,uL,&(fL.eulernode));
EulerFlux(phys,nn,uR,&(fR.eulernode));
ierr = eu->sound(&eu->pars[EULER_PAR_GAMMA],uL,&cL);if (ierr) exit(13);
ierr = eu->sound(&eu->pars[EULER_PAR_GAMMA],uR,&cR);if (ierr) exit(14);
velL = DotDIMReal(uL->ru,nn)/uL->r;
velR = DotDIMReal(uR->ru,nn)/uR->r;
speed = PetscMax(velR + cR, velL + cL);
for (i=0; i<2+dim; i++) flux[i] = 0.5*((fL.vals[i]+fR.vals[i]) + speed*(xL[i] - xR[i]))*s2;
}
else {
int dim = DIM;
/* int iwave = */
godunovflux(xL, xR, flux, nn, &dim, &eu->pars[EULER_PAR_GAMMA]);
for (i=0; i<2+dim; i++) flux[i] *= s2;
}
PetscFunctionReturnVoid();
}
static PetscErrorCode PhysicsFunctional_Euler(Model mod,PetscReal time,const PetscReal *coord,const PetscScalar *xx,PetscReal *f,void *ctx)
{
Physics phys = (Physics)ctx;
Physics_Euler *eu = (Physics_Euler*)phys->data;
const EulerNode *x = (const EulerNode*)xx;
PetscReal p;
PetscFunctionBeginUser;
f[eu->monitor.Density] = x->r;
f[eu->monitor.Momentum] = NormDIM(x->ru);
f[eu->monitor.Energy] = x->E;
f[eu->monitor.Speed] = NormDIM(x->ru)/x->r;
Pressure_PG(eu->pars[EULER_PAR_GAMMA], x, &p);
f[eu->monitor.Pressure] = p;
PetscFunctionReturn(0);
}
static PetscErrorCode SetUpBC_Euler(PetscDS prob,Physics phys)
{
PetscErrorCode ierr;
Physics_Euler *eu = (Physics_Euler *) phys->data;
if (eu->type == EULER_LINEAR_WAVE) {
const PetscInt wallids[] = {100,101};
ierr = PetscDSAddBoundary(prob, DM_BC_NATURAL_RIEMANN, "wall", "Face Sets", 0, 0, NULL, (void (*)(void)) PhysicsBoundary_Euler_Wall, NULL, ALEN(wallids), wallids, phys);CHKERRQ(ierr);
}
else {
const PetscInt wallids[] = {100,101,200,300};
ierr = PetscDSAddBoundary(prob, DM_BC_NATURAL_RIEMANN, "wall", "Face Sets", 0, 0, NULL, (void (*)(void)) PhysicsBoundary_Euler_Wall, NULL, ALEN(wallids), wallids, phys);CHKERRQ(ierr);
}
PetscFunctionReturn(0);
}
static PetscErrorCode PhysicsCreate_Euler(Model mod,Physics phys,PetscOptionItems *PetscOptionsObject)
{
Physics_Euler *eu;
PetscErrorCode ierr;
PetscFunctionBeginUser;
phys->field_desc = PhysicsFields_Euler;
phys->riemann = (PetscRiemannFunc) PhysicsRiemann_Euler_Godunov;
ierr = PetscNew(&eu);CHKERRQ(ierr);
phys->data = eu;
mod->setupbc = SetUpBC_Euler;
ierr = PetscOptionsHead(PetscOptionsObject,"Euler options");CHKERRQ(ierr);
{
PetscReal alpha;
char type[64] = "linear_wave";
PetscBool is;
mod->bcs[0] = mod->bcs[1] = mod->bcs[2] = DM_BOUNDARY_GHOSTED;
eu->pars[EULER_PAR_GAMMA] = 1.4;
eu->pars[EULER_PAR_AMACH] = 2.02;
eu->pars[EULER_PAR_RHOR] = 3.0;
eu->pars[EULER_PAR_ITANA] = 0.57735026918963; /* angle of Euler self similar (SS) shock */
ierr = PetscOptionsReal("-eu_gamma","Heat capacity ratio","",eu->pars[EULER_PAR_GAMMA],&eu->pars[EULER_PAR_GAMMA],NULL);CHKERRQ(ierr);
ierr = PetscOptionsReal("-eu_amach","Shock speed (Mach)","",eu->pars[EULER_PAR_AMACH],&eu->pars[EULER_PAR_AMACH],NULL);CHKERRQ(ierr);
ierr = PetscOptionsReal("-eu_rho2","Density right of discontinuity","",eu->pars[EULER_PAR_RHOR],&eu->pars[EULER_PAR_RHOR],NULL);CHKERRQ(ierr);
alpha = 60.;
ierr = PetscOptionsReal("-eu_alpha","Angle of discontinuity","",alpha,&alpha,NULL);CHKERRQ(ierr);
if (alpha<=0. || alpha>90.) SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_SUP,"Alpha bust be > 0 and <= 90 (%g)",alpha);
eu->pars[EULER_PAR_ITANA] = 1./PetscTanReal( alpha * PETSC_PI / 180.0);
ierr = PetscOptionsString("-eu_type","Type of Euler test","",type,type,sizeof(type),NULL);CHKERRQ(ierr);
ierr = PetscStrcmp(type,"linear_wave", &is);CHKERRQ(ierr);
if (is) {
eu->type = EULER_LINEAR_WAVE;
mod->bcs[0] = mod->bcs[1] = mod->bcs[2] = DM_BOUNDARY_PERIODIC;
mod->bcs[1] = DM_BOUNDARY_GHOSTED; /* debug */
ierr = PetscPrintf(PETSC_COMM_WORLD,"%s set Euler type: %s\n",PETSC_FUNCTION_NAME,"linear_wave");CHKERRQ(ierr);
}
else {
if (DIM != 2) SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_SUP,"DIM must be 2 unless linear wave test %s",type);
ierr = PetscStrcmp(type,"iv_shock", &is);CHKERRQ(ierr);
if (is) {
eu->type = EULER_IV_SHOCK;
ierr = PetscPrintf(PETSC_COMM_WORLD,"%s set Euler type: %s\n",PETSC_FUNCTION_NAME,"iv_shock");CHKERRQ(ierr);
}
else {
ierr = PetscStrcmp(type,"ss_shock", &is);CHKERRQ(ierr);
if (is) {
eu->type = EULER_SS_SHOCK;
ierr = PetscPrintf(PETSC_COMM_WORLD,"%s set Euler type: %s\n",PETSC_FUNCTION_NAME,"ss_shock");CHKERRQ(ierr);
}
else {
ierr = PetscStrcmp(type,"shock_tube", &is);CHKERRQ(ierr);
if (is) eu->type = EULER_SHOCK_TUBE;
else SETERRQ1(PETSC_COMM_WORLD,PETSC_ERR_SUP,"Unknown Euler type %s",type);
ierr = PetscPrintf(PETSC_COMM_WORLD,"%s set Euler type: %s\n",PETSC_FUNCTION_NAME,"shock_tube");CHKERRQ(ierr);
}
}
}
}
ierr = PetscOptionsTail();CHKERRQ(ierr);
eu->sound = SpeedOfSound_PG;
phys->maxspeed = 0.; /* will get set in solution */
ierr = ModelSolutionSetDefault(mod,PhysicsSolution_Euler,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Speed",&eu->monitor.Speed,PhysicsFunctional_Euler,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Energy",&eu->monitor.Energy,PhysicsFunctional_Euler,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Density",&eu->monitor.Density,PhysicsFunctional_Euler,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Momentum",&eu->monitor.Momentum,PhysicsFunctional_Euler,phys);CHKERRQ(ierr);
ierr = ModelFunctionalRegister(mod,"Pressure",&eu->monitor.Pressure,PhysicsFunctional_Euler,phys);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode ErrorIndicator_Simple(PetscInt dim, PetscReal volume, PetscInt numComps, const PetscScalar u[], const PetscScalar grad[], PetscReal *error, void *ctx)
{
PetscReal err = 0.;
PetscInt i, j;
PetscFunctionBeginUser;
for (i = 0; i < numComps; i++) {
for (j = 0; j < dim; j++) {
err += PetscSqr(PetscRealPart(grad[i * dim + j]));
}
}
*error = volume * err;
PetscFunctionReturn(0);
}
PetscErrorCode ConstructCellBoundary(DM dm, User user)
{
const char *name = "Cell Sets";
const char *bdname = "split faces";
IS regionIS, innerIS;
const PetscInt *regions, *cells;
PetscInt numRegions, innerRegion, numCells, c;
PetscInt cStart, cEnd, cEndInterior, fStart, fEnd;
PetscBool hasLabel;
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = DMPlexGetHeightStratum(dm, 0, &cStart, &cEnd);CHKERRQ(ierr);
ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr);
ierr = DMPlexGetGhostCellStratum(dm, &cEndInterior, NULL);CHKERRQ(ierr);
ierr = DMHasLabel(dm, name, &hasLabel);CHKERRQ(ierr);
if (!hasLabel) PetscFunctionReturn(0);
ierr = DMGetLabelSize(dm, name, &numRegions);CHKERRQ(ierr);
if (numRegions != 2) PetscFunctionReturn(0);
/* Get the inner id */
ierr = DMGetLabelIdIS(dm, name, ®ionIS);CHKERRQ(ierr);
ierr = ISGetIndices(regionIS, ®ions);CHKERRQ(ierr);
innerRegion = regions[0];
ierr = ISRestoreIndices(regionIS, ®ions);CHKERRQ(ierr);
ierr = ISDestroy(®ionIS);CHKERRQ(ierr);
/* Find the faces between cells in different regions, could call DMPlexCreateNeighborCSR() */
ierr = DMGetStratumIS(dm, name, innerRegion, &innerIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(innerIS, &numCells);CHKERRQ(ierr);
ierr = ISGetIndices(innerIS, &cells);CHKERRQ(ierr);
ierr = DMCreateLabel(dm, bdname);CHKERRQ(ierr);
for (c = 0; c < numCells; ++c) {
const PetscInt cell = cells[c];
const PetscInt *faces;
PetscInt numFaces, f;
if ((cell < cStart) || (cell >= cEnd)) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_LIB, "Got invalid point %d which is not a cell", cell);
ierr = DMPlexGetConeSize(dm, cell, &numFaces);CHKERRQ(ierr);
ierr = DMPlexGetCone(dm, cell, &faces);CHKERRQ(ierr);
for (f = 0; f < numFaces; ++f) {
const PetscInt face = faces[f];
const PetscInt *neighbors;
PetscInt nC, regionA, regionB;
if ((face < fStart) || (face >= fEnd)) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_LIB, "Got invalid point %d which is not a face", face);
ierr = DMPlexGetSupportSize(dm, face, &nC);CHKERRQ(ierr);
if (nC != 2) continue;
ierr = DMPlexGetSupport(dm, face, &neighbors);CHKERRQ(ierr);
if ((neighbors[0] >= cEndInterior) || (neighbors[1] >= cEndInterior)) continue;
if ((neighbors[0] < cStart) || (neighbors[0] >= cEnd)) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_LIB, "Got invalid point %d which is not a cell", neighbors[0]);
if ((neighbors[1] < cStart) || (neighbors[1] >= cEnd)) SETERRQ1(PETSC_COMM_SELF, PETSC_ERR_LIB, "Got invalid point %d which is not a cell", neighbors[1]);
ierr = DMGetLabelValue(dm, name, neighbors[0], ®ionA);CHKERRQ(ierr);
ierr = DMGetLabelValue(dm, name, neighbors[1], ®ionB);CHKERRQ(ierr);
if (regionA < 0) SETERRQ2(PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "Invalid label %s: Cell %d has no value", name, neighbors[0]);
if (regionB < 0) SETERRQ2(PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_WRONG, "Invalid label %s: Cell %d has no value", name, neighbors[1]);
if (regionA != regionB) {
ierr = DMSetLabelValue(dm, bdname, faces[f], 1);CHKERRQ(ierr);
}
}
}
ierr = ISRestoreIndices(innerIS, &cells);CHKERRQ(ierr);
ierr = ISDestroy(&innerIS);CHKERRQ(ierr);
{
DMLabel label;
ierr = DMGetLabel(dm, bdname, &label);CHKERRQ(ierr);
ierr = DMLabelView(label, PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
}
PetscFunctionReturn(0);
}
/* Right now, I have just added duplicate faces, which see both cells. We can
- Add duplicate vertices and decouple the face cones
- Disconnect faces from cells across the rotation gap
*/
PetscErrorCode SplitFaces(DM *dmSplit, const char labelName[], User user)
{
DM dm = *dmSplit, sdm;
PetscSF sfPoint, gsfPoint;
PetscSection coordSection, newCoordSection;
Vec coordinates;
IS idIS;
const PetscInt *ids;
PetscInt *newpoints;
PetscInt dim, depth, maxConeSize, maxSupportSize, numLabels, numGhostCells;
PetscInt numFS, fs, pStart, pEnd, p, cEnd, cEndInterior, vStart, vEnd, v, fStart, fEnd, newf, d, l;
PetscBool hasLabel;
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = DMHasLabel(dm, labelName, &hasLabel);CHKERRQ(ierr);
if (!hasLabel) PetscFunctionReturn(0);
ierr = DMCreate(PetscObjectComm((PetscObject)dm), &sdm);CHKERRQ(ierr);
ierr = DMSetType(sdm, DMPLEX);CHKERRQ(ierr);
ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr);
ierr = DMSetDimension(sdm, dim);CHKERRQ(ierr);
ierr = DMGetLabelIdIS(dm, labelName, &idIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(idIS, &numFS);CHKERRQ(ierr);
ierr = ISGetIndices(idIS, &ids);CHKERRQ(ierr);
user->numSplitFaces = 0;
for (fs = 0; fs < numFS; ++fs) {
PetscInt numBdFaces;
ierr = DMGetStratumSize(dm, labelName, ids[fs], &numBdFaces);CHKERRQ(ierr);
user->numSplitFaces += numBdFaces;
}
ierr = DMPlexGetChart(dm, &pStart, &pEnd);CHKERRQ(ierr);
pEnd += user->numSplitFaces;
ierr = DMPlexSetChart(sdm, pStart, pEnd);CHKERRQ(ierr);
ierr = DMPlexGetGhostCellStratum(dm, &cEndInterior, NULL);CHKERRQ(ierr);
ierr = DMPlexGetHeightStratum(dm, 0, NULL, &cEnd);CHKERRQ(ierr);
numGhostCells = cEnd - cEndInterior;
/* Set cone and support sizes */
ierr = DMPlexGetDepth(dm, &depth);CHKERRQ(ierr);
for (d = 0; d <= depth; ++d) {
ierr = DMPlexGetDepthStratum(dm, d, &pStart, &pEnd);CHKERRQ(ierr);
for (p = pStart; p < pEnd; ++p) {
PetscInt newp = p;
PetscInt size;
ierr = DMPlexGetConeSize(dm, p, &size);CHKERRQ(ierr);
ierr = DMPlexSetConeSize(sdm, newp, size);CHKERRQ(ierr);
ierr = DMPlexGetSupportSize(dm, p, &size);CHKERRQ(ierr);
ierr = DMPlexSetSupportSize(sdm, newp, size);CHKERRQ(ierr);
}
}
ierr = DMPlexGetHeightStratum(dm, 1, &fStart, &fEnd);CHKERRQ(ierr);
for (fs = 0, newf = fEnd; fs < numFS; ++fs) {
IS faceIS;
const PetscInt *faces;
PetscInt numFaces, f;
ierr = DMGetStratumIS(dm, labelName, ids[fs], &faceIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(faceIS, &numFaces);CHKERRQ(ierr);
ierr = ISGetIndices(faceIS, &faces);CHKERRQ(ierr);
for (f = 0; f < numFaces; ++f, ++newf) {
PetscInt size;
/* Right now I think that both faces should see both cells */
ierr = DMPlexGetConeSize(dm, faces[f], &size);CHKERRQ(ierr);
ierr = DMPlexSetConeSize(sdm, newf, size);CHKERRQ(ierr);
ierr = DMPlexGetSupportSize(dm, faces[f], &size);CHKERRQ(ierr);
ierr = DMPlexSetSupportSize(sdm, newf, size);CHKERRQ(ierr);
}
ierr = ISRestoreIndices(faceIS, &faces);CHKERRQ(ierr);
ierr = ISDestroy(&faceIS);CHKERRQ(ierr);
}
ierr = DMSetUp(sdm);CHKERRQ(ierr);
/* Set cones and supports */
ierr = DMPlexGetMaxSizes(dm, &maxConeSize, &maxSupportSize);CHKERRQ(ierr);
ierr = PetscMalloc1(PetscMax(maxConeSize, maxSupportSize), &newpoints);CHKERRQ(ierr);
ierr = DMPlexGetChart(dm, &pStart, &pEnd);CHKERRQ(ierr);
for (p = pStart; p < pEnd; ++p) {
const PetscInt *points, *orientations;
PetscInt size, i, newp = p;
ierr = DMPlexGetConeSize(dm, p, &size);CHKERRQ(ierr);
ierr = DMPlexGetCone(dm, p, &points);CHKERRQ(ierr);
ierr = DMPlexGetConeOrientation(dm, p, &orientations);CHKERRQ(ierr);
for (i = 0; i < size; ++i) newpoints[i] = points[i];
ierr = DMPlexSetCone(sdm, newp, newpoints);CHKERRQ(ierr);
ierr = DMPlexSetConeOrientation(sdm, newp, orientations);CHKERRQ(ierr);
ierr = DMPlexGetSupportSize(dm, p, &size);CHKERRQ(ierr);
ierr = DMPlexGetSupport(dm, p, &points);CHKERRQ(ierr);
for (i = 0; i < size; ++i) newpoints[i] = points[i];
ierr = DMPlexSetSupport(sdm, newp, newpoints);CHKERRQ(ierr);
}
ierr = PetscFree(newpoints);CHKERRQ(ierr);
for (fs = 0, newf = fEnd; fs < numFS; ++fs) {
IS faceIS;
const PetscInt *faces;
PetscInt numFaces, f;
ierr = DMGetStratumIS(dm, labelName, ids[fs], &faceIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(faceIS, &numFaces);CHKERRQ(ierr);
ierr = ISGetIndices(faceIS, &faces);CHKERRQ(ierr);
for (f = 0; f < numFaces; ++f, ++newf) {
const PetscInt *points;
ierr = DMPlexGetCone(dm, faces[f], &points);CHKERRQ(ierr);
ierr = DMPlexSetCone(sdm, newf, points);CHKERRQ(ierr);
ierr = DMPlexGetSupport(dm, faces[f], &points);CHKERRQ(ierr);
ierr = DMPlexSetSupport(sdm, newf, points);CHKERRQ(ierr);
}
ierr = ISRestoreIndices(faceIS, &faces);CHKERRQ(ierr);
ierr = ISDestroy(&faceIS);CHKERRQ(ierr);
}
ierr = ISRestoreIndices(idIS, &ids);CHKERRQ(ierr);
ierr = ISDestroy(&idIS);CHKERRQ(ierr);
ierr = DMPlexStratify(sdm);CHKERRQ(ierr);
/* Convert coordinates */
ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr);
ierr = DMGetCoordinateSection(dm, &coordSection);CHKERRQ(ierr);
ierr = PetscSectionCreate(PetscObjectComm((PetscObject)dm), &newCoordSection);CHKERRQ(ierr);
ierr = PetscSectionSetNumFields(newCoordSection, 1);CHKERRQ(ierr);
ierr = PetscSectionSetFieldComponents(newCoordSection, 0, dim);CHKERRQ(ierr);
ierr = PetscSectionSetChart(newCoordSection, vStart, vEnd);CHKERRQ(ierr);
for (v = vStart; v < vEnd; ++v) {
ierr = PetscSectionSetDof(newCoordSection, v, dim);CHKERRQ(ierr);
ierr = PetscSectionSetFieldDof(newCoordSection, v, 0, dim);CHKERRQ(ierr);
}
ierr = PetscSectionSetUp(newCoordSection);CHKERRQ(ierr);
ierr = DMSetCoordinateSection(sdm, PETSC_DETERMINE, newCoordSection);CHKERRQ(ierr);
ierr = PetscSectionDestroy(&newCoordSection);CHKERRQ(ierr); /* relinquish our reference */
ierr = DMGetCoordinatesLocal(dm, &coordinates);CHKERRQ(ierr);
ierr = DMSetCoordinatesLocal(sdm, coordinates);CHKERRQ(ierr);
/* Convert labels */
ierr = DMGetNumLabels(dm, &numLabels);CHKERRQ(ierr);
for (l = 0; l < numLabels; ++l) {
const char *lname;
PetscBool isDepth, isDim;
ierr = DMGetLabelName(dm, l, &lname);CHKERRQ(ierr);
ierr = PetscStrcmp(lname, "depth", &isDepth);CHKERRQ(ierr);
if (isDepth) continue;
ierr = PetscStrcmp(lname, "dim", &isDim);CHKERRQ(ierr);
if (isDim) continue;
ierr = DMCreateLabel(sdm, lname);CHKERRQ(ierr);
ierr = DMGetLabelIdIS(dm, lname, &idIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(idIS, &numFS);CHKERRQ(ierr);
ierr = ISGetIndices(idIS, &ids);CHKERRQ(ierr);
for (fs = 0; fs < numFS; ++fs) {
IS pointIS;
const PetscInt *points;
PetscInt numPoints;
ierr = DMGetStratumIS(dm, lname, ids[fs], &pointIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(pointIS, &numPoints);CHKERRQ(ierr);
ierr = ISGetIndices(pointIS, &points);CHKERRQ(ierr);
for (p = 0; p < numPoints; ++p) {
PetscInt newpoint = points[p];
ierr = DMSetLabelValue(sdm, lname, newpoint, ids[fs]);CHKERRQ(ierr);
}
ierr = ISRestoreIndices(pointIS, &points);CHKERRQ(ierr);
ierr = ISDestroy(&pointIS);CHKERRQ(ierr);
}
ierr = ISRestoreIndices(idIS, &ids);CHKERRQ(ierr);
ierr = ISDestroy(&idIS);CHKERRQ(ierr);
}
{
/* Convert pointSF */
const PetscSFNode *remotePoints;
PetscSFNode *gremotePoints;
const PetscInt *localPoints;
PetscInt *glocalPoints,*newLocation,*newRemoteLocation;
PetscInt numRoots, numLeaves;
PetscMPIInt size;
ierr = MPI_Comm_size(PetscObjectComm((PetscObject)dm), &size);CHKERRMPI(ierr);
ierr = DMGetPointSF(dm, &sfPoint);CHKERRQ(ierr);
ierr = DMGetPointSF(sdm, &gsfPoint);CHKERRQ(ierr);
ierr = DMPlexGetChart(dm,&pStart,&pEnd);CHKERRQ(ierr);
ierr = PetscSFGetGraph(sfPoint, &numRoots, &numLeaves, &localPoints, &remotePoints);CHKERRQ(ierr);
if (numRoots >= 0) {
ierr = PetscMalloc2(numRoots,&newLocation,pEnd-pStart,&newRemoteLocation);CHKERRQ(ierr);
for (l=0; l<numRoots; l++) newLocation[l] = l; /* + (l >= cEnd ? numGhostCells : 0); */
ierr = PetscSFBcastBegin(sfPoint, MPIU_INT, newLocation, newRemoteLocation,MPI_REPLACE);CHKERRQ(ierr);
ierr = PetscSFBcastEnd(sfPoint, MPIU_INT, newLocation, newRemoteLocation,MPI_REPLACE);CHKERRQ(ierr);
ierr = PetscMalloc1(numLeaves, &glocalPoints);CHKERRQ(ierr);
ierr = PetscMalloc1(numLeaves, &gremotePoints);CHKERRQ(ierr);
for (l = 0; l < numLeaves; ++l) {
glocalPoints[l] = localPoints[l]; /* localPoints[l] >= cEnd ? localPoints[l] + numGhostCells : localPoints[l]; */
gremotePoints[l].rank = remotePoints[l].rank;
gremotePoints[l].index = newRemoteLocation[localPoints[l]];
}
ierr = PetscFree2(newLocation,newRemoteLocation);CHKERRQ(ierr);
ierr = PetscSFSetGraph(gsfPoint, numRoots+numGhostCells, numLeaves, glocalPoints, PETSC_OWN_POINTER, gremotePoints, PETSC_OWN_POINTER);CHKERRQ(ierr);
}
ierr = DMDestroy(dmSplit);CHKERRQ(ierr);
*dmSplit = sdm;
}
PetscFunctionReturn(0);
}
PetscErrorCode CreatePartitionVec(DM dm, DM *dmCell, Vec *partition)
{
PetscSF sfPoint;
PetscSection coordSection;
Vec coordinates;
PetscSection sectionCell;
PetscScalar *part;
PetscInt cStart, cEnd, c;
PetscMPIInt rank;
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = DMGetCoordinateSection(dm, &coordSection);CHKERRQ(ierr);
ierr = DMGetCoordinatesLocal(dm, &coordinates);CHKERRQ(ierr);
ierr = DMClone(dm, dmCell);CHKERRQ(ierr);
ierr = DMGetPointSF(dm, &sfPoint);CHKERRQ(ierr);
ierr = DMSetPointSF(*dmCell, sfPoint);CHKERRQ(ierr);
ierr = DMSetCoordinateSection(*dmCell, PETSC_DETERMINE, coordSection);CHKERRQ(ierr);
ierr = DMSetCoordinatesLocal(*dmCell, coordinates);CHKERRQ(ierr);
ierr = MPI_Comm_rank(PetscObjectComm((PetscObject)dm), &rank);CHKERRMPI(ierr);
ierr = PetscSectionCreate(PetscObjectComm((PetscObject)dm), §ionCell);CHKERRQ(ierr);
ierr = DMPlexGetHeightStratum(*dmCell, 0, &cStart, &cEnd);CHKERRQ(ierr);
ierr = PetscSectionSetChart(sectionCell, cStart, cEnd);CHKERRQ(ierr);
for (c = cStart; c < cEnd; ++c) {
ierr = PetscSectionSetDof(sectionCell, c, 1);CHKERRQ(ierr);
}
ierr = PetscSectionSetUp(sectionCell);CHKERRQ(ierr);
ierr = DMSetLocalSection(*dmCell, sectionCell);CHKERRQ(ierr);
ierr = PetscSectionDestroy(§ionCell);CHKERRQ(ierr);
ierr = DMCreateLocalVector(*dmCell, partition);CHKERRQ(ierr);
ierr = PetscObjectSetName((PetscObject)*partition, "partition");CHKERRQ(ierr);
ierr = VecGetArray(*partition, &part);CHKERRQ(ierr);
for (c = cStart; c < cEnd; ++c) {
PetscScalar *p;
ierr = DMPlexPointLocalRef(*dmCell, c, part, &p);CHKERRQ(ierr);
p[0] = rank;
}
ierr = VecRestoreArray(*partition, &part);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
PetscErrorCode CreateMassMatrix(DM dm, Vec *massMatrix, User user)
{
DM plex, dmMass, dmFace, dmCell, dmCoord;
PetscSection coordSection;
Vec coordinates, facegeom, cellgeom;
PetscSection sectionMass;
PetscScalar *m;
const PetscScalar *fgeom, *cgeom, *coords;
PetscInt vStart, vEnd, v;
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = DMConvert(dm, DMPLEX, &plex);CHKERRQ(ierr);
ierr = DMGetCoordinateSection(dm, &coordSection);CHKERRQ(ierr);
ierr = DMGetCoordinatesLocal(dm, &coordinates);CHKERRQ(ierr);
ierr = DMClone(dm, &dmMass);CHKERRQ(ierr);
ierr = DMSetCoordinateSection(dmMass, PETSC_DETERMINE, coordSection);CHKERRQ(ierr);
ierr = DMSetCoordinatesLocal(dmMass, coordinates);CHKERRQ(ierr);
ierr = PetscSectionCreate(PetscObjectComm((PetscObject)dm), §ionMass);CHKERRQ(ierr);
ierr = DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd);CHKERRQ(ierr);
ierr = PetscSectionSetChart(sectionMass, vStart, vEnd);CHKERRQ(ierr);
for (v = vStart; v < vEnd; ++v) {
PetscInt numFaces;
ierr = DMPlexGetSupportSize(dmMass, v, &numFaces);CHKERRQ(ierr);
ierr = PetscSectionSetDof(sectionMass, v, numFaces*numFaces);CHKERRQ(ierr);
}
ierr = PetscSectionSetUp(sectionMass);CHKERRQ(ierr);
ierr = DMSetLocalSection(dmMass, sectionMass);CHKERRQ(ierr);
ierr = PetscSectionDestroy(§ionMass);CHKERRQ(ierr);
ierr = DMGetLocalVector(dmMass, massMatrix);CHKERRQ(ierr);
ierr = VecGetArray(*massMatrix, &m);CHKERRQ(ierr);
ierr = DMPlexGetGeometryFVM(plex, &facegeom, &cellgeom, NULL);CHKERRQ(ierr);
ierr = VecGetDM(facegeom, &dmFace);CHKERRQ(ierr);
ierr = VecGetArrayRead(facegeom, &fgeom);CHKERRQ(ierr);
ierr = VecGetDM(cellgeom, &dmCell);CHKERRQ(ierr);
ierr = VecGetArrayRead(cellgeom, &cgeom);CHKERRQ(ierr);
ierr = DMGetCoordinateDM(dm, &dmCoord);CHKERRQ(ierr);
ierr = VecGetArrayRead(coordinates, &coords);CHKERRQ(ierr);
for (v = vStart; v < vEnd; ++v) {
const PetscInt *faces;
PetscFVFaceGeom *fgA, *fgB, *cg;
PetscScalar *vertex;
PetscInt numFaces, sides[2], f, g;
ierr = DMPlexPointLocalRead(dmCoord, v, coords, &vertex);CHKERRQ(ierr);
ierr = DMPlexGetSupportSize(dmMass, v, &numFaces);CHKERRQ(ierr);
ierr = DMPlexGetSupport(dmMass, v, &faces);CHKERRQ(ierr);
for (f = 0; f < numFaces; ++f) {
sides[0] = faces[f];
ierr = DMPlexPointLocalRead(dmFace, faces[f], fgeom, &fgA);CHKERRQ(ierr);
for (g = 0; g < numFaces; ++g) {
const PetscInt *cells = NULL;
PetscReal area = 0.0;
PetscInt numCells;
sides[1] = faces[g];
ierr = DMPlexPointLocalRead(dmFace, faces[g], fgeom, &fgB);CHKERRQ(ierr);
ierr = DMPlexGetJoin(dmMass, 2, sides, &numCells, &cells);CHKERRQ(ierr);
if (numCells != 1) SETERRQ(PETSC_COMM_SELF, PETSC_ERR_LIB, "Invalid join for faces");
ierr = DMPlexPointLocalRead(dmCell, cells[0], cgeom, &cg);CHKERRQ(ierr);
area += PetscAbsScalar((vertex[0] - cg->centroid[0])*(fgA->centroid[1] - cg->centroid[1]) - (vertex[1] - cg->centroid[1])*(fgA->centroid[0] - cg->centroid[0]));
area += PetscAbsScalar((vertex[0] - cg->centroid[0])*(fgB->centroid[1] - cg->centroid[1]) - (vertex[1] - cg->centroid[1])*(fgB->centroid[0] - cg->centroid[0]));
m[f*numFaces+g] = Dot2Real(fgA->normal, fgB->normal)*area*0.5;
ierr = DMPlexRestoreJoin(dmMass, 2, sides, &numCells, &cells);CHKERRQ(ierr);
}
}
}
ierr = VecRestoreArrayRead(facegeom, &fgeom);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(cellgeom, &cgeom);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(coordinates, &coords);CHKERRQ(ierr);
ierr = VecRestoreArray(*massMatrix, &m);CHKERRQ(ierr);
ierr = DMDestroy(&dmMass);CHKERRQ(ierr);
ierr = DMDestroy(&plex);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
/* Behavior will be different for multi-physics or when using non-default boundary conditions */
static PetscErrorCode ModelSolutionSetDefault(Model mod,SolutionFunction func,void *ctx)
{
PetscFunctionBeginUser;
mod->solution = func;
mod->solutionctx = ctx;
PetscFunctionReturn(0);
}
static PetscErrorCode ModelFunctionalRegister(Model mod,const char *name,PetscInt *offset,FunctionalFunction func,void *ctx)
{
PetscErrorCode ierr;
FunctionalLink link,*ptr;
PetscInt lastoffset = -1;
PetscFunctionBeginUser;
for (ptr=&mod->functionalRegistry; *ptr; ptr = &(*ptr)->next) lastoffset = (*ptr)->offset;
ierr = PetscNew(&link);CHKERRQ(ierr);
ierr = PetscStrallocpy(name,&link->name);CHKERRQ(ierr);
link->offset = lastoffset + 1;
link->func = func;
link->ctx = ctx;
link->next = NULL;
*ptr = link;
*offset = link->offset;
PetscFunctionReturn(0);
}
static PetscErrorCode ModelFunctionalSetFromOptions(Model mod,PetscOptionItems *PetscOptionsObject)
{
PetscErrorCode ierr;
PetscInt i,j;
FunctionalLink link;
char *names[256];
PetscFunctionBeginUser;
mod->numMonitored = ALEN(names);
ierr = PetscOptionsStringArray("-monitor","list of functionals to monitor","",names,&mod->numMonitored,NULL);CHKERRQ(ierr);
/* Create list of functionals that will be computed somehow */
ierr = PetscMalloc1(mod->numMonitored,&mod->functionalMonitored);CHKERRQ(ierr);
/* Create index of calls that we will have to make to compute these functionals (over-allocation in general). */
ierr = PetscMalloc1(mod->numMonitored,&mod->functionalCall);CHKERRQ(ierr);
mod->numCall = 0;
for (i=0; i<mod->numMonitored; i++) {
for (link=mod->functionalRegistry; link; link=link->next) {
PetscBool match;
ierr = PetscStrcasecmp(names[i],link->name,&match);CHKERRQ(ierr);
if (match) break;
}
if (!link) SETERRQ1(mod->comm,PETSC_ERR_USER,"No known functional '%s'",names[i]);
mod->functionalMonitored[i] = link;
for (j=0; j<i; j++) {
if (mod->functionalCall[j]->func == link->func && mod->functionalCall[j]->ctx == link->ctx) goto next_name;
}
mod->functionalCall[mod->numCall++] = link; /* Just points to the first link using the result. There may be more results. */
next_name:
ierr = PetscFree(names[i]);CHKERRQ(ierr);
}
/* Find out the maximum index of any functional computed by a function we will be calling (even if we are not using it) */
mod->maxComputed = -1;
for (link=mod->functionalRegistry; link; link=link->next) {
for (i=0; i<mod->numCall; i++) {
FunctionalLink call = mod->functionalCall[i];
if (link->func == call->func && link->ctx == call->ctx) {
mod->maxComputed = PetscMax(mod->maxComputed,link->offset);
}
}
}
PetscFunctionReturn(0);
}
static PetscErrorCode FunctionalLinkDestroy(FunctionalLink *link)
{
PetscErrorCode ierr;
FunctionalLink l,next;
PetscFunctionBeginUser;
if (!link) PetscFunctionReturn(0);
l = *link;
*link = NULL;
for (; l; l=next) {
next = l->next;
ierr = PetscFree(l->name);CHKERRQ(ierr);
ierr = PetscFree(l);CHKERRQ(ierr);
}
PetscFunctionReturn(0);
}
/* put the solution callback into a functional callback */
static PetscErrorCode SolutionFunctional(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar *u, void *modctx)
{
Model mod;
PetscErrorCode ierr;
PetscFunctionBegin;
mod = (Model) modctx;
ierr = (*mod->solution)(mod, time, x, u, mod->solutionctx);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
PetscErrorCode SetInitialCondition(DM dm, Vec X, User user)
{
PetscErrorCode (*func[1]) (PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar *u, void *ctx);
void *ctx[1];
Model mod = user->model;
PetscErrorCode ierr;
PetscFunctionBeginUser;
func[0] = SolutionFunctional;
ctx[0] = (void *) mod;
ierr = DMProjectFunction(dm,0.0,func,ctx,INSERT_ALL_VALUES,X);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode OutputVTK(DM dm, const char *filename, PetscViewer *viewer)
{
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = PetscViewerCreate(PetscObjectComm((PetscObject)dm), viewer);CHKERRQ(ierr);
ierr = PetscViewerSetType(*viewer, PETSCVIEWERVTK);CHKERRQ(ierr);
ierr = PetscViewerFileSetName(*viewer, filename);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode MonitorVTK(TS ts,PetscInt stepnum,PetscReal time,Vec X,void *ctx)
{
User user = (User)ctx;
DM dm, plex;
PetscViewer viewer;
char filename[PETSC_MAX_PATH_LEN],*ftable = NULL;
PetscReal xnorm;
PetscErrorCode ierr;
PetscFunctionBeginUser;
ierr = PetscObjectSetName((PetscObject) X, "u");CHKERRQ(ierr);
ierr = VecGetDM(X,&dm);CHKERRQ(ierr);
ierr = VecNorm(X,NORM_INFINITY,&xnorm);CHKERRQ(ierr);
if (stepnum >= 0) {
stepnum += user->monitorStepOffset;
}
if (stepnum >= 0) { /* No summary for final time */
Model mod = user->model;
Vec cellgeom;
PetscInt c,cStart,cEnd,fcount,i;
size_t ftableused,ftablealloc;
const PetscScalar *cgeom,*x;
DM dmCell;
DMLabel vtkLabel;
PetscReal *fmin,*fmax,*fintegral,*ftmp;
ierr = DMConvert(dm, DMPLEX, &plex);CHKERRQ(ierr);
ierr = DMPlexGetGeometryFVM(plex, NULL, &cellgeom, NULL);CHKERRQ(ierr);
fcount = mod->maxComputed+1;
ierr = PetscMalloc4(fcount,&fmin,fcount,&fmax,fcount,&fintegral,fcount,&ftmp);CHKERRQ(ierr);
for (i=0; i<fcount; i++) {
fmin[i] = PETSC_MAX_REAL;
fmax[i] = PETSC_MIN_REAL;
fintegral[i] = 0;
}
ierr = VecGetDM(cellgeom,&dmCell);CHKERRQ(ierr);
ierr = DMPlexGetSimplexOrBoxCells(dmCell,0,&cStart,&cEnd);CHKERRQ(ierr);
ierr = VecGetArrayRead(cellgeom,&cgeom);CHKERRQ(ierr);
ierr = VecGetArrayRead(X,&x);CHKERRQ(ierr);
ierr = DMGetLabel(dm,"vtk",&vtkLabel);CHKERRQ(ierr);
for (c = cStart; c < cEnd; ++c) {
PetscFVCellGeom *cg;
const PetscScalar *cx = NULL;
PetscInt vtkVal = 0;
/* not that these two routines as currently implemented work for any dm with a
* localSection/globalSection */
ierr = DMPlexPointLocalRead(dmCell,c,cgeom,&cg);CHKERRQ(ierr);
ierr = DMPlexPointGlobalRead(dm,c,x,&cx);CHKERRQ(ierr);
if (vtkLabel) {ierr = DMLabelGetValue(vtkLabel,c,&vtkVal);CHKERRQ(ierr);}
if (!vtkVal || !cx) continue; /* ghost, or not a global cell */
for (i=0; i<mod->numCall; i++) {
FunctionalLink flink = mod->functionalCall[i];
ierr = (*flink->func)(mod,time,cg->centroid,cx,ftmp,flink->ctx);CHKERRQ(ierr);
}
for (i=0; i<fcount; i++) {
fmin[i] = PetscMin(fmin[i],ftmp[i]);
fmax[i] = PetscMax(fmax[i],ftmp[i]);
fintegral[i] += cg->volume * ftmp[i];
}
}
ierr = VecRestoreArrayRead(cellgeom,&cgeom);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(X,&x);CHKERRQ(ierr);
ierr = DMDestroy(&plex);CHKERRQ(ierr);
ierr = MPI_Allreduce(MPI_IN_PLACE,fmin,fcount,MPIU_REAL,MPIU_MIN,PetscObjectComm((PetscObject)ts));CHKERRMPI(ierr);
ierr = MPI_Allreduce(MPI_IN_PLACE,fmax,fcount,MPIU_REAL,MPIU_MAX,PetscObjectComm((PetscObject)ts));CHKERRMPI(ierr);
ierr = MPI_Allreduce(MPI_IN_PLACE,fintegral,fcount,MPIU_REAL,MPIU_SUM,PetscObjectComm((PetscObject)ts));CHKERRMPI(ierr);
ftablealloc = fcount * 100;
ftableused = 0;
ierr = PetscMalloc1(ftablealloc,&ftable);CHKERRQ(ierr);
for (i=0; i<mod->numMonitored; i++) {
size_t countused;
char buffer[256],*p;
FunctionalLink flink = mod->functionalMonitored[i];
PetscInt id = flink->offset;
if (i % 3) {
ierr = PetscArraycpy(buffer," ",2);CHKERRQ(ierr);
p = buffer + 2;
} else if (i) {
char newline[] = "\n";
ierr = PetscMemcpy(buffer,newline,sizeof(newline)-1);CHKERRQ(ierr);
p = buffer + sizeof(newline) - 1;
} else {
p = buffer;
}
ierr = PetscSNPrintfCount(p,sizeof buffer-(p-buffer),"%12s [%10.7g,%10.7g] int %10.7g",&countused,flink->name,(double)fmin[id],(double)fmax[id],(double)fintegral[id]);CHKERRQ(ierr);
countused--;
countused += p - buffer;
if (countused > ftablealloc-ftableused-1) { /* reallocate */
char *ftablenew;
ftablealloc = 2*ftablealloc + countused;
ierr = PetscMalloc(ftablealloc,&ftablenew);CHKERRQ(ierr);
ierr = PetscArraycpy(ftablenew,ftable,ftableused);CHKERRQ(ierr);
ierr = PetscFree(ftable);CHKERRQ(ierr);
ftable = ftablenew;
}
ierr = PetscArraycpy(ftable+ftableused,buffer,countused);CHKERRQ(ierr);
ftableused += countused;
ftable[ftableused] = 0;
}
ierr = PetscFree4(fmin,fmax,fintegral,ftmp);CHKERRQ(ierr);
ierr = PetscPrintf(PetscObjectComm((PetscObject)ts),"% 3D time %8.4g |x| %8.4g %s\n",stepnum,(double)time,(double)xnorm,ftable ? ftable : "");CHKERRQ(ierr);
ierr = PetscFree(ftable);CHKERRQ(ierr);
}
if (user->vtkInterval < 1) PetscFunctionReturn(0);
if ((stepnum == -1) ^ (stepnum % user->vtkInterval == 0)) {
if (stepnum == -1) { /* Final time is not multiple of normal time interval, write it anyway */
ierr = TSGetStepNumber(ts,&stepnum);CHKERRQ(ierr);
}
ierr = PetscSNPrintf(filename,sizeof filename,"%s-%03D.vtu",user->outputBasename,stepnum);CHKERRQ(ierr);
ierr = OutputVTK(dm,filename,&viewer);CHKERRQ(ierr);
ierr = VecView(X,viewer);CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
}
PetscFunctionReturn(0);
}
static PetscErrorCode initializeTS(DM dm, User user, TS *ts)
{
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = TSCreate(PetscObjectComm((PetscObject)dm), ts);CHKERRQ(ierr);
ierr = TSSetType(*ts, TSSSP);CHKERRQ(ierr);
ierr = TSSetDM(*ts, dm);CHKERRQ(ierr);
if (user->vtkmon) {
ierr = TSMonitorSet(*ts,MonitorVTK,user,NULL);CHKERRQ(ierr);
}
ierr = DMTSSetBoundaryLocal(dm, DMPlexTSComputeBoundary, user);CHKERRQ(ierr);
ierr = DMTSSetRHSFunctionLocal(dm, DMPlexTSComputeRHSFunctionFVM, user);CHKERRQ(ierr);//TODO: This is were we set the RHS function
ierr = TSSetMaxTime(*ts,2.0);CHKERRQ(ierr);
ierr = TSSetExactFinalTime(*ts,TS_EXACTFINALTIME_STEPOVER);CHKERRQ(ierr);
PetscFunctionReturn(0);
}
static PetscErrorCode adaptToleranceFVM(PetscFV fvm, TS ts, Vec sol, VecTagger refineTag, VecTagger coarsenTag, User user, TS *tsNew, Vec *solNew)
{
DM dm, gradDM, plex, cellDM, adaptedDM = NULL;
Vec cellGeom, faceGeom;
PetscBool isForest, computeGradient;
Vec grad, locGrad, locX, errVec;
PetscInt cStart, cEnd, c, dim, nRefine, nCoarsen;
PetscReal minMaxInd[2] = {PETSC_MAX_REAL, PETSC_MIN_REAL}, minMaxIndGlobal[2], minInd, maxInd, time;
PetscScalar *errArray;
const PetscScalar *pointVals;
const PetscScalar *pointGrads;
const PetscScalar *pointGeom;
DMLabel adaptLabel = NULL;
IS refineIS, coarsenIS;
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = TSGetTime(ts,&time);CHKERRQ(ierr);
ierr = VecGetDM(sol, &dm);CHKERRQ(ierr);
ierr = DMGetDimension(dm,&dim);CHKERRQ(ierr);
ierr = PetscFVGetComputeGradients(fvm,&computeGradient);CHKERRQ(ierr);
ierr = PetscFVSetComputeGradients(fvm,PETSC_TRUE);CHKERRQ(ierr);
ierr = DMIsForest(dm, &isForest);CHKERRQ(ierr);
ierr = DMConvert(dm, DMPLEX, &plex);CHKERRQ(ierr);
ierr = DMPlexGetDataFVM(plex, fvm, &cellGeom, &faceGeom, &gradDM);CHKERRQ(ierr);
ierr = DMCreateLocalVector(plex,&locX);CHKERRQ(ierr);
ierr = DMPlexInsertBoundaryValues(plex, PETSC_TRUE, locX, 0.0, faceGeom, cellGeom, NULL);CHKERRQ(ierr);
ierr = DMGlobalToLocalBegin(plex, sol, INSERT_VALUES, locX);CHKERRQ(ierr);
ierr = DMGlobalToLocalEnd (plex, sol, INSERT_VALUES, locX);CHKERRQ(ierr);
ierr = DMCreateGlobalVector(gradDM, &grad);CHKERRQ(ierr);
ierr = DMPlexReconstructGradientsFVM(plex, locX, grad);CHKERRQ(ierr);
ierr = DMCreateLocalVector(gradDM, &locGrad);CHKERRQ(ierr);
ierr = DMGlobalToLocalBegin(gradDM, grad, INSERT_VALUES, locGrad);CHKERRQ(ierr);
ierr = DMGlobalToLocalEnd(gradDM, grad, INSERT_VALUES, locGrad);CHKERRQ(ierr);
ierr = VecDestroy(&grad);CHKERRQ(ierr);
ierr = DMPlexGetSimplexOrBoxCells(plex,0,&cStart,&cEnd);CHKERRQ(ierr);
ierr = VecGetArrayRead(locGrad,&pointGrads);CHKERRQ(ierr);
ierr = VecGetArrayRead(cellGeom,&pointGeom);CHKERRQ(ierr);
ierr = VecGetArrayRead(locX,&pointVals);CHKERRQ(ierr);
ierr = VecGetDM(cellGeom,&cellDM);CHKERRQ(ierr);
ierr = DMLabelCreate(PETSC_COMM_SELF,"adapt",&adaptLabel);CHKERRQ(ierr);
ierr = VecCreateMPI(PetscObjectComm((PetscObject)plex),cEnd-cStart,PETSC_DETERMINE,&errVec);CHKERRQ(ierr);
ierr = VecSetUp(errVec);CHKERRQ(ierr);
ierr = VecGetArray(errVec,&errArray);CHKERRQ(ierr);
for (c = cStart; c < cEnd; c++) {
PetscReal errInd = 0.;
PetscScalar *pointGrad;
PetscScalar *pointVal;
PetscFVCellGeom *cg;
ierr = DMPlexPointLocalRead(gradDM,c,pointGrads,&pointGrad);CHKERRQ(ierr);
ierr = DMPlexPointLocalRead(cellDM,c,pointGeom,&cg);CHKERRQ(ierr);
ierr = DMPlexPointLocalRead(plex,c,pointVals,&pointVal);CHKERRQ(ierr);
ierr = (user->model->errorIndicator)(dim,cg->volume,user->model->physics->dof,pointVal,pointGrad,&errInd,user->model->errorCtx);CHKERRQ(ierr);
errArray[c-cStart] = errInd;
minMaxInd[0] = PetscMin(minMaxInd[0],errInd);
minMaxInd[1] = PetscMax(minMaxInd[1],errInd);
}
ierr = VecRestoreArray(errVec,&errArray);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(locX,&pointVals);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(cellGeom,&pointGeom);CHKERRQ(ierr);
ierr = VecRestoreArrayRead(locGrad,&pointGrads);CHKERRQ(ierr);
ierr = VecDestroy(&locGrad);CHKERRQ(ierr);
ierr = VecDestroy(&locX);CHKERRQ(ierr);
ierr = DMDestroy(&plex);CHKERRQ(ierr);
ierr = VecTaggerComputeIS(refineTag,errVec,&refineIS);CHKERRQ(ierr);
ierr = VecTaggerComputeIS(coarsenTag,errVec,&coarsenIS);CHKERRQ(ierr);
ierr = ISGetSize(refineIS,&nRefine);CHKERRQ(ierr);
ierr = ISGetSize(coarsenIS,&nCoarsen);CHKERRQ(ierr);
if (nRefine) {ierr = DMLabelSetStratumIS(adaptLabel,DM_ADAPT_REFINE,refineIS);CHKERRQ(ierr);}
if (nCoarsen) {ierr = DMLabelSetStratumIS(adaptLabel,DM_ADAPT_COARSEN,coarsenIS);CHKERRQ(ierr);}
ierr = ISDestroy(&coarsenIS);CHKERRQ(ierr);
ierr = ISDestroy(&refineIS);CHKERRQ(ierr);
ierr = VecDestroy(&errVec);CHKERRQ(ierr);
ierr = PetscFVSetComputeGradients(fvm,computeGradient);CHKERRQ(ierr);
minMaxInd[1] = -minMaxInd[1];
ierr = MPI_Allreduce(minMaxInd,minMaxIndGlobal,2,MPIU_REAL,MPI_MIN,PetscObjectComm((PetscObject)dm));CHKERRMPI(ierr);
minInd = minMaxIndGlobal[0];
maxInd = -minMaxIndGlobal[1];
ierr = PetscInfo2(ts, "error indicator range (%E, %E)\n", minInd, maxInd);CHKERRQ(ierr);
if (nRefine || nCoarsen) { /* at least one cell is over the refinement threshold */
ierr = DMAdaptLabel(dm,adaptLabel,&adaptedDM);CHKERRQ(ierr);
}
ierr = DMLabelDestroy(&adaptLabel);CHKERRQ(ierr);
if (adaptedDM) {
ierr = PetscInfo2(ts, "Adapted mesh, marking %D cells for refinement, and %D cells for coarsening\n", nRefine, nCoarsen);CHKERRQ(ierr);
if (tsNew) {ierr = initializeTS(adaptedDM, user, tsNew);CHKERRQ(ierr);}
if (solNew) {
ierr = DMCreateGlobalVector(adaptedDM, solNew);CHKERRQ(ierr);
ierr = PetscObjectSetName((PetscObject) *solNew, "solution");CHKERRQ(ierr);
ierr = DMForestTransferVec(dm, sol, adaptedDM, *solNew, PETSC_TRUE, time);CHKERRQ(ierr);
}
if (isForest) {ierr = DMForestSetAdaptivityForest(adaptedDM,NULL);CHKERRQ(ierr);} /* clear internal references to the previous dm */
ierr = DMDestroy(&adaptedDM);CHKERRQ(ierr);
} else {
if (tsNew) *tsNew = NULL;
if (solNew) *solNew = NULL;
}
PetscFunctionReturn(0);
}
int main(int argc, char **argv)
{
MPI_Comm comm;
PetscDS prob;
PetscFV fvm;
PetscLimiter limiter = NULL, noneLimiter = NULL;
User user;
Model mod;
Physics phys;
DM dm, plex;
PetscReal ftime, cfl, dt, minRadius;
PetscInt dim, nsteps;
TS ts;
TSConvergedReason reason;
Vec X;
PetscViewer viewer;
PetscBool simplex = PETSC_FALSE, vtkCellGeom, splitFaces, useAMR;
PetscInt overlap, adaptInterval;
char filename[PETSC_MAX_PATH_LEN] = "";
char physname[256] = "advect";
VecTagger refineTag = NULL, coarsenTag = NULL;
PetscErrorCode ierr;
ierr = PetscInitialize(&argc, &argv, (char*) 0, help);if (ierr) return ierr;
comm = PETSC_COMM_WORLD;
ierr = PetscNew(&user);CHKERRQ(ierr);
ierr = PetscNew(&user->model);CHKERRQ(ierr);
ierr = PetscNew(&user->model->physics);CHKERRQ(ierr);
mod = user->model;
phys = mod->physics;
mod->comm = comm;
useAMR = PETSC_FALSE;
adaptInterval = 1;
/* Register physical models to be available on the command line */
ierr = PetscFunctionListAdd(&PhysicsList,"advect" ,PhysicsCreate_Advect);CHKERRQ(ierr);
ierr = PetscFunctionListAdd(&PhysicsList,"sw" ,PhysicsCreate_SW);CHKERRQ(ierr);
ierr = PetscFunctionListAdd(&PhysicsList,"euler" ,PhysicsCreate_Euler);CHKERRQ(ierr);
ierr = PetscOptionsBegin(comm,NULL,"Unstructured Finite Volume Mesh Options","");CHKERRQ(ierr);
{
cfl = 0.9 * 4; /* default SSPRKS2 with s=5 stages is stable for CFL number s-1 */
ierr = PetscOptionsReal("-ufv_cfl","CFL number per step","",cfl,&cfl,NULL);CHKERRQ(ierr);
ierr = PetscOptionsString("-f","Exodus.II filename to read","",filename,filename,sizeof(filename),NULL);CHKERRQ(ierr);
ierr = PetscOptionsBool("-simplex","Flag to use a simplex mesh","",simplex,&simplex,NULL);CHKERRQ(ierr);
splitFaces = PETSC_FALSE;
ierr = PetscOptionsBool("-ufv_split_faces","Split faces between cell sets","",splitFaces,&splitFaces,NULL);CHKERRQ(ierr);
overlap = 1;
ierr = PetscOptionsInt("-ufv_mesh_overlap","Number of cells to overlap partitions","",overlap,&overlap,NULL);CHKERRQ(ierr);
user->vtkInterval = 1;
ierr = PetscOptionsInt("-ufv_vtk_interval","VTK output interval (0 to disable)","",user->vtkInterval,&user->vtkInterval,NULL);CHKERRQ(ierr);
user->vtkmon = PETSC_TRUE;
ierr = PetscOptionsBool("-ufv_vtk_monitor","Use VTKMonitor routine","",user->vtkmon,&user->vtkmon,NULL);CHKERRQ(ierr);
vtkCellGeom = PETSC_FALSE;
ierr = PetscStrcpy(user->outputBasename, "ex11");CHKERRQ(ierr);
ierr = PetscOptionsString("-ufv_vtk_basename","VTK output basename","",user->outputBasename,user->outputBasename,sizeof(user->outputBasename),NULL);CHKERRQ(ierr);
ierr = PetscOptionsBool("-ufv_vtk_cellgeom","Write cell geometry (for debugging)","",vtkCellGeom,&vtkCellGeom,NULL);CHKERRQ(ierr);
ierr = PetscOptionsBool("-ufv_use_amr","use local adaptive mesh refinement","",useAMR,&useAMR,NULL);CHKERRQ(ierr);
ierr = PetscOptionsInt("-ufv_adapt_interval","time steps between AMR","",adaptInterval,&adaptInterval,NULL);CHKERRQ(ierr);
}
ierr = PetscOptionsEnd();CHKERRQ(ierr);
if (useAMR) {
VecTaggerBox refineBox, coarsenBox;
refineBox.min = refineBox.max = PETSC_MAX_REAL;
coarsenBox.min = coarsenBox.max = PETSC_MIN_REAL;
ierr = VecTaggerCreate(comm,&refineTag);CHKERRQ(ierr);
ierr = PetscObjectSetOptionsPrefix((PetscObject)refineTag,"refine_");CHKERRQ(ierr);
ierr = VecTaggerSetType(refineTag,VECTAGGERABSOLUTE);CHKERRQ(ierr);
ierr = VecTaggerAbsoluteSetBox(refineTag,&refineBox);CHKERRQ(ierr);
ierr = VecTaggerSetFromOptions(refineTag);CHKERRQ(ierr);
ierr = VecTaggerSetUp(refineTag);CHKERRQ(ierr);
ierr = PetscObjectViewFromOptions((PetscObject)refineTag,NULL,"-tag_view");CHKERRQ(ierr);
ierr = VecTaggerCreate(comm,&coarsenTag);CHKERRQ(ierr);
ierr = PetscObjectSetOptionsPrefix((PetscObject)coarsenTag,"coarsen_");CHKERRQ(ierr);
ierr = VecTaggerSetType(coarsenTag,VECTAGGERABSOLUTE);CHKERRQ(ierr);
ierr = VecTaggerAbsoluteSetBox(coarsenTag,&coarsenBox);CHKERRQ(ierr);
ierr = VecTaggerSetFromOptions(coarsenTag);CHKERRQ(ierr);
ierr = VecTaggerSetUp(coarsenTag);CHKERRQ(ierr);
ierr = PetscObjectViewFromOptions((PetscObject)coarsenTag,NULL,"-tag_view");CHKERRQ(ierr);
}
ierr = PetscOptionsBegin(comm,NULL,"Unstructured Finite Volume Physics Options","");CHKERRQ(ierr);
{
PetscErrorCode (*physcreate)(Model,Physics,PetscOptionItems*);
ierr = PetscOptionsFList("-physics","Physics module to solve","",PhysicsList,physname,physname,sizeof physname,NULL);CHKERRQ(ierr);
ierr = PetscFunctionListFind(PhysicsList,physname,&physcreate);CHKERRQ(ierr);
ierr = PetscMemzero(phys,sizeof(struct _n_Physics));CHKERRQ(ierr);
ierr = (*physcreate)(mod,phys,PetscOptionsObject);CHKERRQ(ierr);
/* Count number of fields and dofs */
for (phys->nfields=0,phys->dof=0; phys->field_desc[phys->nfields].name; phys->nfields++) phys->dof += phys->field_desc[phys->nfields].dof;
if (phys->dof <= 0) SETERRQ1(comm,PETSC_ERR_ARG_WRONGSTATE,"Physics '%s' did not set dof",physname);
ierr = ModelFunctionalSetFromOptions(mod,PetscOptionsObject);CHKERRQ(ierr);
}
ierr = PetscOptionsEnd();CHKERRQ(ierr);
/* Create mesh */
{
size_t len,i;
for (i = 0; i < DIM; i++) { mod->bounds[2*i] = 0.; mod->bounds[2*i+1] = 1.;};
ierr = PetscStrlen(filename,&len);CHKERRQ(ierr);
dim = DIM;
if (!len) { /* a null name means just do a hex box */
PetscInt cells[3] = {1, 1, 1}; /* coarse mesh is one cell; refine from there */
PetscBool flg1, flg2, skew = PETSC_FALSE;
PetscInt nret1 = DIM;
PetscInt nret2 = 2*DIM;
ierr = PetscOptionsBegin(comm,NULL,"Rectangular mesh options","");CHKERRQ(ierr);
ierr = PetscOptionsIntArray("-grid_size","number of cells in each direction","",cells,&nret1,&flg1);CHKERRQ(ierr);
ierr = PetscOptionsRealArray("-grid_bounds","bounds of the mesh in each direction (i.e., x_min,x_max,y_min,y_max","",mod->bounds,&nret2,&flg2);CHKERRQ(ierr);
ierr = PetscOptionsBool("-grid_skew_60","Skew grid for 60 degree shock mesh","",skew,&skew,NULL);CHKERRQ(ierr);
ierr = PetscOptionsEnd();CHKERRQ(ierr);
if (flg1) {
dim = nret1;
if (dim != DIM) SETERRQ1(comm,PETSC_ERR_ARG_SIZ,"Dim wrong size %D in -grid_size",dim);
}
ierr = DMPlexCreateBoxMesh(comm, dim, simplex, cells, NULL, NULL, mod->bcs, PETSC_TRUE, &dm);CHKERRQ(ierr);
puts("after DMPlexCreateBoxMesh Call");
DMView(dm, PETSC_VIEWER_STDOUT_WORLD);
if (flg2) {
PetscInt dimEmbed, i;
PetscInt nCoords;
PetscScalar *coords;
Vec coordinates;
ierr = DMGetCoordinatesLocal(dm,&coordinates);CHKERRQ(ierr);
ierr = DMGetCoordinateDim(dm,&dimEmbed);CHKERRQ(ierr);
ierr = VecGetLocalSize(coordinates,&nCoords);CHKERRQ(ierr);
if (nCoords % dimEmbed) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_SIZ,"Coordinate vector the wrong size");
ierr = VecGetArray(coordinates,&coords);CHKERRQ(ierr);
for (i = 0; i < nCoords; i += dimEmbed) {
PetscInt j;
PetscScalar *coord = &coords[i];
for (j = 0; j < dimEmbed; j++) {
coord[j] = mod->bounds[2 * j] + coord[j] * (mod->bounds[2 * j + 1] - mod->bounds[2 * j]);
if (dim==2 && cells[1]==1 && j==0 && skew) {
if (cells[0]==2 && i==8) {
coord[j] = .57735026918963; /* hack to get 60 deg skewed mesh */
}
else if (cells[0]==3) {
if (i==2 || i==10) coord[j] = mod->bounds[1]/4.;
else if (i==4) coord[j] = mod->bounds[1]/2.;
else if (i==12) coord[j] = 1.57735026918963*mod->bounds[1]/2.;
}
}
}
}
ierr = VecRestoreArray(coordinates,&coords);CHKERRQ(ierr);
ierr = DMSetCoordinatesLocal(dm,coordinates);CHKERRQ(ierr);
}
} else {
ierr = DMPlexCreateFromFile(comm, filename, PETSC_TRUE, &dm);CHKERRQ(ierr);
}
}
puts("after DMPlexCreateBoxMesh Bracket");
DMView(dm, PETSC_VIEWER_STDOUT_WORLD);
ierr = DMViewFromOptions(dm, NULL, "-orig_dm_view");CHKERRQ(ierr);
ierr = DMGetDimension(dm, &dim);CHKERRQ(ierr);
/* set up BCs, functions, tags */
ierr = DMCreateLabel(dm, "Face Sets");CHKERRQ(ierr);
mod->errorIndicator = ErrorIndicator_Simple;
{
DM dmDist;
ierr = DMSetBasicAdjacency(dm, PETSC_TRUE, PETSC_FALSE);CHKERRQ(ierr);
ierr = DMPlexDistribute(dm, overlap, NULL, &dmDist);CHKERRQ(ierr);
if (dmDist) {
ierr = DMDestroy(&dm);CHKERRQ(ierr);
dm = dmDist;
}
}
ierr = DMSetFromOptions(dm);CHKERRQ(ierr);
{
DM gdm;
ierr = DMPlexConstructGhostCells(dm, NULL, NULL, &gdm);CHKERRQ(ierr);
ierr = DMDestroy(&dm);CHKERRQ(ierr);
dm = gdm;
ierr = DMViewFromOptions(dm, NULL, "-dm_view");CHKERRQ(ierr);
}
if (splitFaces) {ierr = ConstructCellBoundary(dm, user);CHKERRQ(ierr);}
ierr = SplitFaces(&dm, "split faces", user);CHKERRQ(ierr);
ierr = PetscFVCreate(comm, &fvm);CHKERRQ(ierr);
ierr = PetscFVSetFromOptions(fvm);CHKERRQ(ierr);
ierr = PetscFVSetNumComponents(fvm, phys->dof);CHKERRQ(ierr);
ierr = PetscFVSetSpatialDimension(fvm, dim);CHKERRQ(ierr);
ierr = PetscObjectSetName((PetscObject) fvm,"");CHKERRQ(ierr);
{
PetscInt f, dof;
for (f=0,dof=0; f < phys->nfields; f++) {
PetscInt newDof = phys->field_desc[f].dof;
if (newDof == 1) {
ierr = PetscFVSetComponentName(fvm,dof,phys->field_desc[f].name);CHKERRQ(ierr);
}
else {
PetscInt j;
for (j = 0; j < newDof; j++) {
char compName[256] = "Unknown";
ierr = PetscSNPrintf(compName,sizeof(compName),"%s_%d",phys->field_desc[f].name,j);CHKERRQ(ierr);
ierr = PetscFVSetComponentName(fvm,dof+j,compName);CHKERRQ(ierr);
}
}
dof += newDof;
}
}
/* FV is now structured with one field having all physics as components */
ierr = DMAddField(dm, NULL, (PetscObject) fvm);CHKERRQ(ierr);
ierr = DMCreateDS(dm);CHKERRQ(ierr);
ierr = DMGetDS(dm, &prob);CHKERRQ(ierr);
ierr = PetscDSSetRiemannSolver(prob, 0, user->model->physics->riemann);CHKERRQ(ierr);
ierr = PetscDSSetContext(prob, 0, user->model->physics);CHKERRQ(ierr);
ierr = (*mod->setupbc)(prob,phys);CHKERRQ(ierr);
ierr = PetscDSSetFromOptions(prob);CHKERRQ(ierr);
{
char convType[256];
PetscBool flg;
ierr = PetscOptionsBegin(comm, "", "Mesh conversion options", "DMPLEX");CHKERRQ(ierr);
ierr = PetscOptionsFList("-dm_type","Convert DMPlex to another format","ex12",DMList,DMPLEX,convType,256,&flg);CHKERRQ(ierr);
ierr = PetscOptionsEnd();CHKERRQ(ierr);
if (flg) {
DM dmConv;
ierr = DMConvert(dm,convType,&dmConv);CHKERRQ(ierr);
if (dmConv) {
ierr = DMViewFromOptions(dmConv, NULL, "-dm_conv_view");CHKERRQ(ierr);
ierr = DMDestroy(&dm);CHKERRQ(ierr);
dm = dmConv;
ierr = DMSetFromOptions(dm);CHKERRQ(ierr);
}
}
}
ierr = initializeTS(dm, user, &ts);CHKERRQ(ierr);// TODO: setup the ts, this is where the RHS function is set
ierr = DMCreateGlobalVector(dm, &X);CHKERRQ(ierr);
ierr = PetscObjectSetName((PetscObject) X, "solution");CHKERRQ(ierr);
ierr = SetInitialCondition(dm, X, user);CHKERRQ(ierr);
if (useAMR) {
PetscInt adaptIter;
/* use no limiting when reconstructing gradients for adaptivity */
ierr = PetscFVGetLimiter(fvm, &limiter);CHKERRQ(ierr);
ierr = PetscObjectReference((PetscObject) limiter);CHKERRQ(ierr);
ierr = PetscLimiterCreate(PetscObjectComm((PetscObject) fvm), &noneLimiter);CHKERRQ(ierr);
ierr = PetscLimiterSetType(noneLimiter, PETSCLIMITERNONE);CHKERRQ(ierr);
ierr = PetscFVSetLimiter(fvm, noneLimiter);CHKERRQ(ierr);
for (adaptIter = 0; ; ++adaptIter) {
PetscLogDouble bytes;
TS tsNew = NULL;
ierr = PetscMemoryGetCurrentUsage(&bytes);CHKERRQ(ierr);
ierr = PetscInfo2(ts, "refinement loop %D: memory used %g\n", adaptIter, bytes);CHKERRQ(ierr);
ierr = DMViewFromOptions(dm, NULL, "-initial_dm_view");CHKERRQ(ierr);
ierr = VecViewFromOptions(X, NULL, "-initial_vec_view");CHKERRQ(ierr);
#if 0
if (viewInitial) {
PetscViewer viewer;
char buf[256];
PetscBool isHDF5, isVTK;
ierr = PetscViewerCreate(comm,&viewer);CHKERRQ(ierr);
ierr = PetscViewerSetType(viewer,PETSCVIEWERVTK);CHKERRQ(ierr);
ierr = PetscViewerSetOptionsPrefix(viewer,"initial_");CHKERRQ(ierr);
ierr = PetscViewerSetFromOptions(viewer);CHKERRQ(ierr);
ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERHDF5,&isHDF5);CHKERRQ(ierr);
ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERVTK,&isVTK);CHKERRQ(ierr);
if (isHDF5) {
ierr = PetscSNPrintf(buf, 256, "ex11-initial-%d.h5", adaptIter);CHKERRQ(ierr);
} else if (isVTK) {
ierr = PetscSNPrintf(buf, 256, "ex11-initial-%d.vtu", adaptIter);CHKERRQ(ierr);
ierr = PetscViewerPushFormat(viewer,PETSC_VIEWER_VTK_VTU);CHKERRQ(ierr);
}
ierr = PetscViewerFileSetMode(viewer,FILE_MODE_WRITE);CHKERRQ(ierr);
ierr = PetscViewerFileSetName(viewer,buf);CHKERRQ(ierr);
if (isHDF5) {
ierr = DMView(dm,viewer);CHKERRQ(ierr);
ierr = PetscViewerFileSetMode(viewer,FILE_MODE_UPDATE);CHKERRQ(ierr);
}
ierr = VecView(X,viewer);CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
}
#endif
ierr = adaptToleranceFVM(fvm, ts, X, refineTag, coarsenTag, user, &tsNew, NULL);CHKERRQ(ierr);
if (!tsNew) {
break;
} else {
ierr = DMDestroy(&dm);CHKERRQ(ierr);
ierr = VecDestroy(&X);CHKERRQ(ierr);
ierr = TSDestroy(&ts);CHKERRQ(ierr);
ts = tsNew;
ierr = TSGetDM(ts,&dm);CHKERRQ(ierr);
ierr = PetscObjectReference((PetscObject)dm);CHKERRQ(ierr);
ierr = DMCreateGlobalVector(dm,&X);CHKERRQ(ierr);
ierr = PetscObjectSetName((PetscObject) X, "solution");CHKERRQ(ierr);
ierr = SetInitialCondition(dm, X, user);CHKERRQ(ierr);
}
}
/* restore original limiter */
ierr = PetscFVSetLimiter(fvm, limiter);CHKERRQ(ierr);
}
puts("before DMConvert");
DMView(dm, PETSC_VIEWER_STDOUT_WORLD);
ierr = DMConvert(dm, DMPLEX, &plex);CHKERRQ(ierr);
if (vtkCellGeom) {
DM dmCell;
Vec cellgeom, partition;
ierr = DMPlexGetGeometryFVM(plex, NULL, &cellgeom, NULL);CHKERRQ(ierr);
ierr = OutputVTK(dm, "ex11-cellgeom.vtk", &viewer);CHKERRQ(ierr);
ierr = VecView(cellgeom, viewer);CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
ierr = CreatePartitionVec(dm, &dmCell, &partition);CHKERRQ(ierr);
ierr = OutputVTK(dmCell, "ex11-partition.vtk", &viewer);CHKERRQ(ierr);
ierr = VecView(partition, viewer);CHKERRQ(ierr);
ierr = PetscViewerDestroy(&viewer);CHKERRQ(ierr);
ierr = VecDestroy(&partition);CHKERRQ(ierr);
ierr = DMDestroy(&dmCell);CHKERRQ(ierr);
}
/* collect max maxspeed from all processes -- todo */
ierr = DMPlexGetGeometryFVM(plex, NULL, NULL, &minRadius);CHKERRQ(ierr);
ierr = DMDestroy(&plex);CHKERRQ(ierr);
ierr = MPI_Allreduce(&phys->maxspeed,&mod->maxspeed,1,MPIU_REAL,MPIU_MAX,PetscObjectComm((PetscObject)ts));CHKERRMPI(ierr);
if (mod->maxspeed <= 0) SETERRQ1(comm,PETSC_ERR_ARG_WRONGSTATE,"Physics '%s' did not set maxspeed",physname);
dt = cfl * minRadius / mod->maxspeed;
ierr = TSSetTimeStep(ts,dt);CHKERRQ(ierr);
ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
puts("final");
DMView(dm, PETSC_VIEWER_STDOUT_WORLD);
if (!useAMR) {
ierr = TSSolve(ts,X);CHKERRQ(ierr);
ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);
ierr = TSGetStepNumber(ts,&nsteps);CHKERRQ(ierr);
} else {
PetscReal finalTime;
PetscInt adaptIter;
TS tsNew = NULL;
Vec solNew = NULL;
ierr = TSGetMaxTime(ts,&finalTime);CHKERRQ(ierr);
ierr = TSSetMaxSteps(ts,adaptInterval);CHKERRQ(ierr);
ierr = TSSolve(ts,X);CHKERRQ(ierr);
ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);
ierr = TSGetStepNumber(ts,&nsteps);CHKERRQ(ierr);
for (adaptIter = 0;ftime < finalTime;adaptIter++) {
PetscLogDouble bytes;
ierr = PetscMemoryGetCurrentUsage(&bytes);CHKERRQ(ierr);
ierr = PetscInfo2(ts, "AMR time step loop %D: memory used %g\n", adaptIter, bytes);CHKERRQ(ierr);
ierr = PetscFVSetLimiter(fvm,noneLimiter);CHKERRQ(ierr);
ierr = adaptToleranceFVM(fvm,ts,X,refineTag,coarsenTag,user,&tsNew,&solNew);CHKERRQ(ierr);
ierr = PetscFVSetLimiter(fvm,limiter);CHKERRQ(ierr);
if (tsNew) {
ierr = PetscInfo(ts, "AMR used\n");CHKERRQ(ierr);
ierr = DMDestroy(&dm);CHKERRQ(ierr);
ierr = VecDestroy(&X);CHKERRQ(ierr);
ierr = TSDestroy(&ts);CHKERRQ(ierr);
ts = tsNew;
X = solNew;
ierr = TSSetFromOptions(ts);CHKERRQ(ierr);
ierr = VecGetDM(X,&dm);CHKERRQ(ierr);
ierr = PetscObjectReference((PetscObject)dm);CHKERRQ(ierr);
ierr = DMConvert(dm, DMPLEX, &plex);CHKERRQ(ierr);
ierr = DMPlexGetGeometryFVM(dm, NULL, NULL, &minRadius);CHKERRQ(ierr);
ierr = DMDestroy(&plex);CHKERRQ(ierr);
ierr = MPI_Allreduce(&phys->maxspeed,&mod->maxspeed,1,MPIU_REAL,MPIU_MAX,PetscObjectComm((PetscObject)ts));CHKERRMPI(ierr);
if (mod->maxspeed <= 0) SETERRQ1(comm,PETSC_ERR_ARG_WRONGSTATE,"Physics '%s' did not set maxspeed",physname);
dt = cfl * minRadius / mod->maxspeed;
ierr = TSSetStepNumber(ts,nsteps);CHKERRQ(ierr);
ierr = TSSetTime(ts,ftime);CHKERRQ(ierr);
ierr = TSSetTimeStep(ts,dt);CHKERRQ(ierr);
} else {
ierr = PetscInfo(ts, "AMR not used\n");CHKERRQ(ierr);
}
user->monitorStepOffset = nsteps;
ierr = TSSetMaxSteps(ts,nsteps+adaptInterval);CHKERRQ(ierr);
ierr = TSSolve(ts,X);CHKERRQ(ierr);
ierr = TSGetSolveTime(ts,&ftime);CHKERRQ(ierr);
ierr = TSGetStepNumber(ts,&nsteps);CHKERRQ(ierr);
}
}
ierr = TSGetConvergedReason(ts,&reason);CHKERRQ(ierr);
ierr = PetscPrintf(PETSC_COMM_WORLD,"%s at time %g after %D steps\n",TSConvergedReasons[reason],(double)ftime,nsteps);CHKERRQ(ierr);
ierr = TSDestroy(&ts);CHKERRQ(ierr);
ierr = VecTaggerDestroy(&refineTag);CHKERRQ(ierr);
ierr = VecTaggerDestroy(&coarsenTag);CHKERRQ(ierr);
ierr = PetscFunctionListDestroy(&PhysicsList);CHKERRQ(ierr);
ierr = PetscFunctionListDestroy(&PhysicsRiemannList_SW);CHKERRQ(ierr);
ierr = FunctionalLinkDestroy(&user->model->functionalRegistry);CHKERRQ(ierr);
ierr = PetscFree(user->model->functionalMonitored);CHKERRQ(ierr);
ierr = PetscFree(user->model->functionalCall);CHKERRQ(ierr);
ierr = PetscFree(user->model->physics->data);CHKERRQ(ierr);
ierr = PetscFree(user->model->physics);CHKERRQ(ierr);
ierr = PetscFree(user->model);CHKERRQ(ierr);
ierr = PetscFree(user);CHKERRQ(ierr);
ierr = VecDestroy(&X);CHKERRQ(ierr);
ierr = PetscLimiterDestroy(&limiter);CHKERRQ(ierr);
ierr = PetscLimiterDestroy(&noneLimiter);CHKERRQ(ierr);
ierr = PetscFVDestroy(&fvm);CHKERRQ(ierr);
ierr = DMDestroy(&dm);CHKERRQ(ierr);
ierr = PetscFinalize();
return ierr;
}
/* Godunov fluxs */
PetscScalar cvmgp_(PetscScalar *a, PetscScalar *b, PetscScalar *test)
{
/* System generated locals */
PetscScalar ret_val;
if (PetscRealPart(*test) > 0.) {
goto L10;
}
ret_val = *b;
return ret_val;
L10:
ret_val = *a;
return ret_val;
} /* cvmgp_ */
PetscScalar cvmgm_(PetscScalar *a, PetscScalar *b, PetscScalar *test)
{
/* System generated locals */
PetscScalar ret_val;
if (PetscRealPart(*test) < 0.) {
goto L10;
}
ret_val = *b;
return ret_val;
L10:
ret_val = *a;
return ret_val;
} /* cvmgm_ */
int riem1mdt( PetscScalar *gaml, PetscScalar *gamr, PetscScalar *rl, PetscScalar *pl,
PetscScalar *uxl, PetscScalar *rr, PetscScalar *pr,
PetscScalar *uxr, PetscScalar *rstarl, PetscScalar *rstarr, PetscScalar *
pstar, PetscScalar *ustar)
{
/* Initialized data */
static PetscScalar smallp = 1e-8;
/* System generated locals */
int i__1;
PetscScalar d__1, d__2;
/* Local variables */
static int i0;
static PetscScalar cl, cr, wl, zl, wr, zr, pst, durl, skpr1, skpr2;
static int iwave;
static PetscScalar gascl4, gascr4, cstarl, dpstar, cstarr;
/* static PetscScalar csqrl, csqrr, gascl1, gascl2, gascl3, gascr1, gascr2, gascr3; */
static int iterno;
static PetscScalar ustarl, ustarr, rarepr1, rarepr2;
/* gascl1 = *gaml - 1.; */
/* gascl2 = (*gaml + 1.) * .5; */
/* gascl3 = gascl2 / *gaml; */
gascl4 = 1. / (*gaml - 1.);
/* gascr1 = *gamr - 1.; */
/* gascr2 = (*gamr + 1.) * .5; */
/* gascr3 = gascr2 / *gamr; */
gascr4 = 1. / (*gamr - 1.);
iterno = 10;
/* find pstar: */
cl = PetscSqrtScalar(*gaml * *pl / *rl);
cr = PetscSqrtScalar(*gamr * *pr / *rr);
wl = *rl * cl;
wr = *rr * cr;
/* csqrl = wl * wl; */
/* csqrr = wr * wr; */
*pstar = (wl * *pr + wr * *pl) / (wl + wr);
*pstar = PetscMax(PetscRealPart(*pstar),PetscRealPart(smallp));
pst = *pl / *pr;
skpr1 = cr * (pst - 1.) * PetscSqrtScalar(2. / (*gamr * (*gamr - 1. + (*gamr + 1.) * pst)));
d__1 = (*gamr - 1.) / (*gamr * 2.);
rarepr2 = gascr4 * 2. * cr * (1. - PetscPowScalar(pst, d__1));
pst = *pr / *pl;
skpr2 = cl * (pst - 1.) * PetscSqrtScalar(2. / (*gaml * (*gaml - 1. + (*gaml + 1.) * pst)));
d__1 = (*gaml - 1.) / (*gaml * 2.);
rarepr1 = gascl4 * 2. * cl * (1. - PetscPowScalar(pst, d__1));
durl = *uxr - *uxl;
if (PetscRealPart(*pr) < PetscRealPart(*pl)) {
if (PetscRealPart(durl) >= PetscRealPart(rarepr1)) {
iwave = 100;
} else if (PetscRealPart(durl) <= PetscRealPart(-skpr1)) {
iwave = 300;
} else {
iwave = 400;
}
} else {
if (PetscRealPart(durl) >= PetscRealPart(rarepr2)) {
iwave = 100;
} else if (PetscRealPart(durl) <= PetscRealPart(-skpr2)) {
iwave = 300;
} else {
iwave = 200;
}
}
if (iwave == 100) {
/* 1-wave: rarefaction wave, 3-wave: rarefaction wave */
/* case (100) */
i__1 = iterno;
for (i0 = 1; i0 <= i__1; ++i0) {
d__1 = *pstar / *pl;
d__2 = 1. / *gaml;
*rstarl = *rl * PetscPowScalar(d__1, d__2);
cstarl = PetscSqrtScalar(*gaml * *pstar / *rstarl);
ustarl = *uxl - gascl4 * 2. * (cstarl - cl);
zl = *rstarl * cstarl;
d__1 = *pstar / *pr;
d__2 = 1. / *gamr;
*rstarr = *rr * PetscPowScalar(d__1, d__2);
cstarr = PetscSqrtScalar(*gamr * *pstar / *rstarr);
ustarr = *uxr + gascr4 * 2. * (cstarr - cr);
zr = *rstarr * cstarr;
dpstar = zl * zr * (ustarr - ustarl) / (zl + zr);
*pstar -= dpstar;
*pstar = PetscMax(PetscRealPart(*pstar),PetscRealPart(smallp));
if (PetscAbsScalar(dpstar) / PetscRealPart(*pstar) <= 1e-8) {
#if 0
break;
#endif
}
}
/* 1-wave: shock wave, 3-wave: rarefaction wave */
} else if (iwave == 200) {
/* case (200) */
i__1 = iterno;
for (i0 = 1; i0 <= i__1; ++i0) {
pst = *pstar / *pl;
ustarl = *uxl - (pst - 1.) * cl * PetscSqrtScalar(2. / (*gaml * (*gaml - 1. + (*gaml + 1.) * pst)));
zl = *pl / cl * PetscSqrtScalar(*gaml * 2. * (*gaml - 1. + (*gaml + 1.) * pst)) * (*gaml - 1. + (*gaml + 1.) * pst) / (*gaml * 3. - 1. + (*gaml + 1.) * pst);
d__1 = *pstar / *pr;
d__2 = 1. / *gamr;
*rstarr = *rr * PetscPowScalar(d__1, d__2);
cstarr = PetscSqrtScalar(*gamr * *pstar / *rstarr);
zr = *rstarr * cstarr;
ustarr = *uxr + gascr4 * 2. * (cstarr - cr);
dpstar = zl * zr * (ustarr - ustarl) / (zl + zr);
*pstar -= dpstar;
*pstar = PetscMax(PetscRealPart(*pstar),PetscRealPart(smallp));
if (PetscAbsScalar(dpstar) / PetscRealPart(*pstar) <= 1e-8) {
#if 0
break;
#endif
}
}
/* 1-wave: shock wave, 3-wave: shock */
} else if (iwave == 300) {
/* case (300) */
i__1 = iterno;
for (i0 = 1; i0 <= i__1; ++i0) {
pst = *pstar / *pl;
ustarl = *uxl - (pst - 1.) * cl * PetscSqrtScalar(2. / (*gaml * (*gaml - 1. + (*gaml + 1.) * pst)));
zl = *pl / cl * PetscSqrtScalar(*gaml * 2. * (*gaml - 1. + (*gaml + 1.) * pst)) * (*gaml - 1. + (*gaml + 1.) * pst) / (*gaml * 3. - 1. + (*gaml + 1.) * pst);
pst = *pstar / *pr;
ustarr = *uxr + (pst - 1.) * cr * PetscSqrtScalar(2. / (*gamr * (*gamr - 1. + (*gamr + 1.) * pst)));
zr = *pr / cr * PetscSqrtScalar(*gamr * 2. * (*gamr - 1. + (*gamr + 1.) * pst)) * (*gamr - 1. + (*gamr + 1.) * pst) / (*gamr * 3. - 1. + (*gamr + 1.) * pst);
dpstar = zl * zr * (ustarr - ustarl) / (zl + zr);
*pstar -= dpstar;
*pstar = PetscMax(PetscRealPart(*pstar),PetscRealPart(smallp));
if (PetscAbsScalar(dpstar) / PetscRealPart(*pstar) <= 1e-8) {
#if 0
break;
#endif
}
}
/* 1-wave: rarefaction wave, 3-wave: shock */
} else if (iwave == 400) {
/* case (400) */
i__1 = iterno;
for (i0 = 1; i0 <= i__1; ++i0) {
d__1 = *pstar / *pl;
d__2 = 1. / *gaml;
*rstarl = *rl * PetscPowScalar(d__1, d__2);
cstarl = PetscSqrtScalar(*gaml * *pstar / *rstarl);
ustarl = *uxl - gascl4 * 2. * (cstarl - cl);
zl = *rstarl * cstarl;
pst = *pstar / *pr;
ustarr = *uxr + (pst - 1.) * cr * PetscSqrtScalar(2. / (*gamr * (*gamr - 1. + (*gamr + 1.) * pst)));
zr = *pr / cr * PetscSqrtScalar(*gamr * 2. * (*gamr - 1. + (*gamr + 1.) * pst)) * (*gamr - 1. + (*gamr + 1.) * pst) / (*gamr * 3. - 1. + (*gamr + 1.) * pst);
dpstar = zl * zr * (ustarr - ustarl) / (zl + zr);
*pstar -= dpstar;
*pstar = PetscMax(PetscRealPart(*pstar),PetscRealPart(smallp));
if (PetscAbsScalar(dpstar) / PetscRealPart(*pstar) <= 1e-8) {
#if 0
break;
#endif
}
}
}
*ustar = (zl * ustarr + zr * ustarl) / (zl + zr);
if (PetscRealPart(*pstar) > PetscRealPart(*pl)) {
pst = *pstar / *pl;
*rstarl = ((*gaml + 1.) * pst + *gaml - 1.) / ((*gaml - 1.) * pst + *
gaml + 1.) * *rl;
}
if (PetscRealPart(*pstar) > PetscRealPart(*pr)) {
pst = *pstar / *pr;
*rstarr = ((*gamr + 1.) * pst + *gamr - 1.) / ((*gamr - 1.) * pst + *
gamr + 1.) * *rr;
}
return iwave;
}
PetscScalar sign(PetscScalar x)
{
if (PetscRealPart(x) > 0) return 1.0;
if (PetscRealPart(x) < 0) return -1.0;
return 0.0;
}
/* Riemann Solver */
/* -------------------------------------------------------------------- */
int riemannsolver(PetscScalar *xcen, PetscScalar *xp,
PetscScalar *dtt, PetscScalar *rl, PetscScalar *uxl, PetscScalar *pl,
PetscScalar *utl, PetscScalar *ubl, PetscScalar *gaml, PetscScalar *rho1l,
PetscScalar *rr, PetscScalar *uxr, PetscScalar *pr, PetscScalar *utr,
PetscScalar *ubr, PetscScalar *gamr, PetscScalar *rho1r, PetscScalar *rx,
PetscScalar *uxm, PetscScalar *px, PetscScalar *utx, PetscScalar *ubx,
PetscScalar *gam, PetscScalar *rho1)
{
/* System generated locals */
PetscScalar d__1, d__2;
/* Local variables */
static PetscScalar s, c0, p0, r0, u0, w0, x0, x2, ri, cx, sgn0, wsp0, gasc1, gasc2, gasc3, gasc4;
static PetscScalar cstar, pstar, rstar, ustar, xstar, wspst, ushock, streng, rstarl, rstarr, rstars;
int iwave;
if (*rl == *rr && *pr == *pl && *uxl == *uxr && *gaml == *gamr) {
*rx = *rl;
*px = *pl;
*uxm = *uxl;
*gam = *gaml;
x2 = *xcen + *uxm * *dtt;
if (PetscRealPart(*xp) >= PetscRealPart(x2)) {
*utx = *utr;
*ubx = *ubr;
*rho1 = *rho1r;
} else {
*utx = *utl;
*ubx = *ubl;
*rho1 = *rho1l;
}
return 0;
}
iwave = riem1mdt(gaml, gamr, rl, pl, uxl, rr, pr, uxr, &rstarl, &rstarr, &pstar, &ustar);
x2 = *xcen + ustar * *dtt;
d__1 = *xp - x2;
sgn0 = sign(d__1);
/* x is in 3-wave if sgn0 = 1 */
/* x is in 1-wave if sgn0 = -1 */
r0 = cvmgm_(rl, rr, &sgn0);
p0 = cvmgm_(pl, pr, &sgn0);
u0 = cvmgm_(uxl, uxr, &sgn0);
*gam = cvmgm_(gaml, gamr, &sgn0);
gasc1 = *gam - 1.;
gasc2 = (*gam + 1.) * .5;
gasc3 = gasc2 / *gam;
gasc4 = 1. / (*gam - 1.);
c0 = PetscSqrtScalar(*gam * p0 / r0);
streng = pstar - p0;
w0 = *gam * r0 * p0 * (gasc3 * streng / p0 + 1.);
rstars = r0 / (1. - r0 * streng / w0);
d__1 = p0 / pstar;
d__2 = -1. / *gam;
rstarr = r0 * PetscPowScalar(d__1, d__2);
rstar = cvmgm_(&rstarr, &rstars, &streng);
w0 = PetscSqrtScalar(w0);
cstar = PetscSqrtScalar(*gam * pstar / rstar);
wsp0 = u0 + sgn0 * c0;
wspst = ustar + sgn0 * cstar;
ushock = ustar + sgn0 * w0 / rstar;
wspst = cvmgp_(&ushock, &wspst, &streng);
wsp0 = cvmgp_(&ushock, &wsp0, &streng);
x0 = *xcen + wsp0 * *dtt;
xstar = *xcen + wspst * *dtt;
/* using gas formula to evaluate rarefaction wave */
/* ri : reiman invariant */
ri = u0 - sgn0 * 2. * gasc4 * c0;
cx = sgn0 * .5 * gasc1 / gasc2 * ((*xp - *xcen) / *dtt - ri);
*uxm = ri + sgn0 * 2. * gasc4 * cx;
s = p0 / PetscPowScalar(r0, *gam);
d__1 = cx * cx / (*gam * s);
*rx = PetscPowScalar(d__1, gasc4);
*px = cx * cx * *rx / *gam;
d__1 = sgn0 * (x0 - *xp);
*rx = cvmgp_(rx, &r0, &d__1);
d__1 = sgn0 * (x0 - *xp);
*px = cvmgp_(px, &p0, &d__1);
d__1 = sgn0 * (x0 - *xp);
*uxm = cvmgp_(uxm, &u0, &d__1);
d__1 = sgn0 * (xstar - *xp);
*rx = cvmgm_(rx, &rstar, &d__1);
d__1 = sgn0 * (xstar - *xp);
*px = cvmgm_(px, &pstar, &d__1);
d__1 = sgn0 * (xstar - *xp);
*uxm = cvmgm_(uxm, &ustar, &d__1);
if (PetscRealPart(*xp) >= PetscRealPart(x2)) {
*utx = *utr;
*ubx = *ubr;
*rho1 = *rho1r;
} else {
*utx = *utl;
*ubx = *ubl;
*rho1 = *rho1l;
}
return iwave;
}
int godunovflux( const PetscScalar *ul, const PetscScalar *ur,
PetscScalar *flux, const PetscReal *nn, const int *ndim,
const PetscReal *gamma)
{
/* System generated locals */
int i__1,iwave;
PetscScalar d__1, d__2, d__3;
/* Local variables */
static int k;
static PetscScalar bn[3], fn, ft, tg[3], pl, rl, pm, pr, rr, xp, ubl, ubm,
ubr, dtt, unm, tmp, utl, utm, uxl, utr, uxr, gaml, gamm, gamr,
xcen, rhom, rho1l, rho1m, rho1r;
/* Parameter adjustments */
--nn;
--flux;
--ur;
--ul;
/* Function Body */
xcen = 0.;
xp = 0.;
i__1 = *ndim;
for (k = 1; k <= i__1; ++k) {
tg[k - 1] = 0.;
bn[k - 1] = 0.;
}
dtt = 1.;
if (*ndim == 3) {
if (nn[1] == 0. && nn[2] == 0.) {
tg[0] = 1.;
} else {
tg[0] = -nn[2];
tg[1] = nn[1];
}
/* tmp=dsqrt(tg(1)**2+tg(2)**2) */
/* tg=tg/tmp */
bn[0] = -nn[3] * tg[1];
bn[1] = nn[3] * tg[0];
bn[2] = nn[1] * tg[1] - nn[2] * tg[0];
/* Computing 2nd power */
d__1 = bn[0];
/* Computing 2nd power */
d__2 = bn[1];
/* Computing 2nd power */
d__3 = bn[2];
tmp = PetscSqrtScalar(d__1 * d__1 + d__2 * d__2 + d__3 * d__3);
i__1 = *ndim;
for (k = 1; k <= i__1; ++k) {
bn[k - 1] /= tmp;
}
} else if (*ndim == 2) {
tg[0] = -nn[2];
tg[1] = nn[1];
/* tmp=dsqrt(tg(1)**2+tg(2)**2) */
/* tg=tg/tmp */
bn[0] = 0.;
bn[1] = 0.;
bn[2] = 1.;
}
rl = ul[1];
rr = ur[1];
uxl = 0.;
uxr = 0.;
utl = 0.;
utr = 0.;
ubl = 0.;
ubr = 0.;
i__1 = *ndim;
for (k = 1; k <= i__1; ++k) {
uxl += ul[k + 1] * nn[k];
uxr += ur[k + 1] * nn[k];
utl += ul[k + 1] * tg[k - 1];
utr += ur[k + 1] * tg[k - 1];
ubl += ul[k + 1] * bn[k - 1];
ubr += ur[k + 1] * bn[k - 1];
}
uxl /= rl;
uxr /= rr;
utl /= rl;
utr /= rr;
ubl /= rl;
ubr /= rr;
gaml = *gamma;
gamr = *gamma;
/* Computing 2nd power */
d__1 = uxl;
/* Computing 2nd power */
d__2 = utl;
/* Computing 2nd power */
d__3 = ubl;
pl = (*gamma - 1.) * (ul[*ndim + 2] - rl * .5 * (d__1 * d__1 + d__2 * d__2 + d__3 * d__3));
/* Computing 2nd power */
d__1 = uxr;
/* Computing 2nd power */
d__2 = utr;
/* Computing 2nd power */
d__3 = ubr;
pr = (*gamma - 1.) * (ur[*ndim + 2] - rr * .5 * (d__1 * d__1 + d__2 * d__2 + d__3 * d__3));
rho1l = rl;
rho1r = rr;
iwave = riemannsolver(&xcen, &xp, &dtt, &rl, &uxl, &pl, &utl, &ubl, &gaml, &
rho1l, &rr, &uxr, &pr, &utr, &ubr, &gamr, &rho1r, &rhom, &unm, &
pm, &utm, &ubm, &gamm, &rho1m);
flux[1] = rhom * unm;
fn = rhom * unm * unm + pm;
ft = rhom * unm * utm;
/* flux(2)=fn*nn(1)+ft*nn(2) */
/* flux(3)=fn*tg(1)+ft*tg(2) */
flux[2] = fn * nn[1] + ft * tg[0];
flux[3] = fn * nn[2] + ft * tg[1];
/* flux(2)=rhom*unm*(unm)+pm */
/* flux(3)=rhom*(unm)*utm */
if (*ndim == 3) {
flux[4] = rhom * unm * ubm;
}
flux[*ndim + 2] = (rhom * .5 * (unm * unm + utm * utm + ubm * ubm) + gamm / (gamm - 1.) * pm) * unm;
return iwave;
} /* godunovflux_ */
/* Subroutine to set up the initial conditions for the */
/* Shock Interface interaction or linear wave (Ravi Samtaney,Mark Adams). */
/* ----------------------------------------------------------------------- */
int projecteqstate(PetscReal wc[], const PetscReal ueq[], PetscReal lv[][3])
{
int j,k;
/* Wc=matmul(lv,Ueq) 3 vars */
for (k = 0; k < 3; ++k) {
wc[k] = 0.;
for (j = 0; j < 3; ++j) {
wc[k] += lv[k][j]*ueq[j];
}
}
return 0;
}
/* ----------------------------------------------------------------------- */
int projecttoprim(PetscReal v[], const PetscReal wc[], PetscReal rv[][3])
{
int k,j;
/* V=matmul(rv,WC) 3 vars */
for (k = 0; k < 3; ++k) {
v[k] = 0.;
for (j = 0; j < 3; ++j) {
v[k] += rv[k][j]*wc[j];
}
}
return 0;
}
/* ---------------------------------------------------------------------- */
int eigenvectors(PetscReal rv[][3], PetscReal lv[][3], const PetscReal ueq[], PetscReal gamma)
{
int j,k;
PetscReal rho,csnd,p0;
/* PetscScalar u; */
for (k = 0; k < 3; ++k) for (j = 0; j < 3; ++j) { lv[k][j] = 0.; rv[k][j] = 0.; }
rho = ueq[0];
/* u = ueq[1]; */
p0 = ueq[2];
csnd = PetscSqrtReal(gamma * p0 / rho);
lv[0][1] = rho * .5;
lv[0][2] = -.5 / csnd;
lv[1][0] = csnd;
lv[1][2] = -1. / csnd;
lv[2][1] = rho * .5;
lv[2][2] = .5 / csnd;
rv[0][0] = -1. / csnd;
rv[1][0] = 1. / rho;
rv[2][0] = -csnd;
rv[0][1] = 1. / csnd;
rv[0][2] = 1. / csnd;
rv[1][2] = 1. / rho;
rv[2][2] = csnd;
return 0;
}
int initLinearWave(EulerNode *ux, const PetscReal gamma, const PetscReal coord[], const PetscReal Lx)
{
PetscReal p0,u0,wcp[3],wc[3];
PetscReal lv[3][3];
PetscReal vp[3];
PetscReal rv[3][3];
PetscReal eps, ueq[3], rho0, twopi;
/* Function Body */
twopi = 2.*PETSC_PI;
eps = 1e-4; /* perturbation */
rho0 = 1e3; /* density of water */
p0 = 101325.; /* init pressure of 1 atm (?) */
u0 = 0.;
ueq[0] = rho0;
ueq[1] = u0;
ueq[2] = p0;
/* Project initial state to characteristic variables */
eigenvectors(rv, lv, ueq, gamma);
projecteqstate(wc, ueq, lv);
wcp[0] = wc[0];
wcp[1] = wc[1];
wcp[2] = wc[2] + eps * PetscCosReal(coord[0] * 2. * twopi / Lx);
projecttoprim(vp, wcp, rv);
ux->r = vp[0]; /* density */
ux->ru[0] = vp[0] * vp[1]; /* x momentum */
ux->ru[1] = 0.;
#if defined DIM > 2
if (dim>2) ux->ru[2] = 0.;
#endif
/* E = rho * e + rho * v^2/2 = p/(gam-1) + rho*v^2/2 */
ux->E = vp[2]/(gamma - 1.) + 0.5*vp[0]*vp[1]*vp[1];
return 0;
}
/*TEST
# 2D Advection 0-10
test:
suffix: 0
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside.exo
test:
suffix: 1
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad-15.exo
test:
suffix: 2
requires: exodusii
nsize: 2
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside.exo
test:
suffix: 3
requires: exodusii
nsize: 2
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad-15.exo
test:
suffix: 4
requires: exodusii
nsize: 8
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad.exo
test:
suffix: 5
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside.exo -ts_type rosw -ts_adapt_reject_safety 1
test:
suffix: 6
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/squaremotor-30.exo -ufv_split_faces
test:
suffix: 7
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad-15.exo -dm_refine 1
test:
suffix: 8
requires: exodusii
nsize: 2
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad-15.exo -dm_refine 1
test:
suffix: 9
requires: exodusii
nsize: 8
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad-15.exo -dm_refine 1
test:
suffix: 10
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside-quad.exo
# 2D Shallow water
test:
suffix: sw_0
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/annulus-20.exo -bc_wall 100,101 -physics sw -ufv_cfl 5 -petscfv_type leastsquares -petsclimiter_type sin -ts_max_time 1 -ts_ssp_type rks2 -ts_ssp_nstages 10 -monitor height,energy
test:
suffix: sw_hll
args: -ufv_vtk_interval 0 -bc_wall 1,2,3,4 -physics sw -ufv_cfl 3 -petscfv_type leastsquares -petsclimiter_type sin -ts_max_steps 5 -ts_ssp_type rks2 -ts_ssp_nstages 10 -monitor height,energy -grid_bounds 0,5,0,5 -grid_size 25,25 -sw_riemann hll
# 2D Advection: p4est
test:
suffix: p4est_advec_2d
requires: p4est
args: -ufv_vtk_interval 0 -f -dm_type p4est -dm_forest_minimum_refinement 1 -dm_forest_initial_refinement 2 -dm_p4est_refine_pattern hash -dm_forest_maximum_refinement 5
# Advection in a box
test:
suffix: adv_2d_quad_0
args: -ufv_vtk_interval 0 -dm_refine 3 -dm_plex_separate_marker -bc_inflow 1,2,4 -bc_outflow 3
test:
suffix: adv_2d_quad_1
args: -ufv_vtk_interval 0 -dm_refine 3 -dm_plex_separate_marker -grid_bounds -0.5,0.5,-0.5,0.5 -bc_inflow 1,2,4 -bc_outflow 3 -advect_sol_type bump -advect_bump_center 0.25,0 -advect_bump_radius 0.1
timeoutfactor: 3
test:
suffix: adv_2d_quad_p4est_0
requires: p4est
args: -ufv_vtk_interval 0 -dm_refine 5 -dm_type p4est -dm_plex_separate_marker -bc_inflow 1,2,4 -bc_outflow 3
test:
suffix: adv_2d_quad_p4est_1
requires: p4est
args: -ufv_vtk_interval 0 -dm_refine 5 -dm_type p4est -dm_plex_separate_marker -grid_bounds -0.5,0.5,-0.5,0.5 -bc_inflow 1,2,4 -bc_outflow 3 -advect_sol_type bump -advect_bump_center 0.25,0 -advect_bump_radius 0.1
timeoutfactor: 3
test:
suffix: adv_2d_quad_p4est_adapt_0
requires: p4est !__float128 #broken for quad precision
args: -ufv_vtk_interval 0 -dm_refine 3 -dm_type p4est -dm_plex_separate_marker -grid_bounds -0.5,0.5,-0.5,0.5 -bc_inflow 1,2,4 -bc_outflow 3 -advect_sol_type bump -advect_bump_center 0.25,0 -advect_bump_radius 0.1 -ufv_use_amr -refine_vec_tagger_box 0.005,inf -coarsen_vec_tagger_box 0,1.e-5 -petscfv_type leastsquares -ts_max_time 0.01
timeoutfactor: 3
test:
suffix: adv_2d_tri_0
requires: triangle
TODO: how did this ever get in main when there is no support for this
args: -ufv_vtk_interval 0 -simplex -dm_refine 3 -dm_plex_separate_marker -bc_inflow 1,2,4 -bc_outflow 3
test:
suffix: adv_2d_tri_1
requires: triangle
TODO: how did this ever get in main when there is no support for this
args: -ufv_vtk_interval 0 -simplex -dm_refine 5 -dm_plex_separate_marker -grid_bounds -0.5,0.5,-0.5,0.5 -bc_inflow 1,2,4 -bc_outflow 3 -advect_sol_type bump -advect_bump_center 0.25,0 -advect_bump_radius 0.1
test:
suffix: adv_0
requires: exodusii
args: -ufv_vtk_interval 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/blockcylinder-50.exo -bc_inflow 100,101,200 -bc_outflow 201
test:
suffix: shock_0
requires: p4est !single !complex
args: -ufv_vtk_interval 0 -monitor density,energy -f -grid_size 2,1 -grid_bounds -1,1.,0.,1 -bc_wall 1,2,3,4 -dm_type p4est -dm_forest_partition_overlap 1 -dm_forest_maximum_refinement 6 -dm_forest_minimum_refinement 2 -dm_forest_initial_refinement 2 -ufv_use_amr -refine_vec_tagger_box 0.5,inf -coarsen_vec_tagger_box 0,1.e-2 -refine_tag_view -coarsen_tag_view -physics euler -eu_type iv_shock -ufv_cfl 10 -eu_alpha 60. -grid_skew_60 -eu_gamma 1.4 -eu_amach 2.02 -eu_rho2 3. -petscfv_type leastsquares -petsclimiter_type minmod -petscfv_compute_gradients 0 -ts_max_time 0.5 -ts_ssp_type rks2 -ts_ssp_nstages 10 -ufv_vtk_basename ${wPETSC_DIR}/ex11
timeoutfactor: 3
# Test GLVis visualization of PetscFV fields
test:
suffix: glvis_adv_2d_tet
args: -ufv_vtk_interval 0 -ts_monitor_solution glvis: -ts_max_steps 0 -ufv_vtk_monitor 0 -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/square_periodic.msh -dm_plex_gmsh_periodic 0
test:
suffix: glvis_adv_2d_quad
args: -ufv_vtk_interval 0 -ts_monitor_solution glvis: -ts_max_steps 0 -ufv_vtk_monitor 0 -dm_refine 5 -dm_plex_separate_marker -bc_inflow 1,2,4 -bc_outflow 3
test:
suffix: tut_1
requires: exodusii
nsize: 1
args: -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside.exo
test:
suffix: tut_2
requires: exodusii
nsize: 1
args: -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/sevenside.exo -ts_type rosw
test:
suffix: tut_3
requires: exodusii
nsize: 4
args: -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/annulus-20.exo -monitor Error -advect_sol_type bump -petscfv_type leastsquares -petsclimiter_type sin
test:
suffix: tut_4
requires: exodusii
nsize: 4
args: -f ${wPETSC_DIR}/share/petsc/datafiles/meshes/annulus-20.exo -physics sw -monitor Height,Energy -petscfv_type leastsquares -petsclimiter_type minmod
TEST*/
| [
"matt@mcgurn.dev"
] | matt@mcgurn.dev |
01876c47ac236e4dc89ba94c804dcc2f776a3e67 | ac48dc874f5550d03648c28b1eda5720202eb55c | /qcril/qcril_qmi/qcril_qmi_prov.c | 81dcdba8dce38d00a2b93662cba04990f18d5bfe | [
"Apache-2.0"
] | permissive | difr/msm8937-8953_qcom_vendor | 464e478cae4a89de34ac79f4d615e5141c40cbcb | 6cafff53eca7f0c28fa9c470b5211423cf47fd40 | refs/heads/master | 2020-03-20T09:58:48.935110 | 2018-05-27T04:13:22 | 2018-05-27T04:13:22 | 137,355,108 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 89,229 | c | /******************************************************************************
# @file qcril_qmi_prov.c
# @brief Manual Provisioning and MSIM feature
#
# ---------------------------------------------------------------------------
#
# Copyright (c) 2015 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
# ---------------------------------------------------------------------------
#******************************************************************************/
#include "ril.h"
#include "IxErrno.h"
#include "comdef.h"
#include "qcrili.h"
#include "qcril_db.h"
#include "qcril_reqlist.h"
#include "qcril_qmi_nas.h"
#include "qcril_qmi_prov.h"
#include "qcril_uim_card.h"
#include "qcril_qmi_client.h"
#include "qmi_ril_platform_dep.h"
qcril_qmi_prov_common_type prov_common_cache;
/*=========================================================================
FUNCTION: qcril_qmi_prov_send_unsol_sub_pref_change
===========================================================================*/
/*!
@brief
Sends QCRIL_EVT_HOOK_UNSOL_SUB_PROVISION_STATUS to telephony.
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_send_unsol_sub_pref_change()
{
RIL_SubProvStatus resp_payload;
QCRIL_LOG_FUNC_ENTRY();
qcril_qmi_prov_fill_prov_preference_info(&resp_payload);
QCRIL_LOG_INFO( "User pref %d", resp_payload.user_preference);
QCRIL_LOG_INFO( "Current sub pref %d", resp_payload.current_sub_preference);
qcril_hook_unsol_response( QCRIL_DEFAULT_INSTANCE_ID,
QCRIL_EVT_HOOK_UNSOL_SUB_PROVISION_STATUS,
(char *)&resp_payload,
sizeof(resp_payload));
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_get_sim_iccid_req_handler
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_HOOK_GET_SIM_ICCID
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_get_sim_iccid_req_handler
(
const qcril_request_params_type *const params_ptr,
QCRIL_UNUSED(qcril_request_return_type *const ret_ptr)
)
{
char iccid[QMI_DMS_UIM_ID_MAX_V01 + 1];
RIL_Errno ril_req_res = RIL_E_SUCCESS;
qcril_request_resp_params_type resp;
QCRIL_LOG_FUNC_ENTRY();
memset(iccid, 0, sizeof(iccid));
qcril_qmi_prov_get_iccid_from_cache(iccid);
QCRIL_LOG_INFO("iccid - %s",iccid);
qcril_default_request_resp_params( QCRIL_DEFAULT_INSTANCE_ID,
params_ptr->t,
params_ptr->event_id,
ril_req_res,
&resp );
resp.resp_pkt = iccid;
resp.resp_len = strlen(iccid);
qcril_send_request_response( &resp );
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_get_sub_prov_pref_req_handler
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_HOOK_GET_SUB_PROVISION_PREFERENCE_REQ
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_get_sub_prov_pref_req_handler
(
const qcril_request_params_type *const params_ptr,
qcril_request_return_type *const ret_ptr
)
{
RIL_Errno ril_req_res = RIL_E_SUCCESS;
RIL_SubProvStatus resp_payload;
qcril_request_resp_params_type resp;
QCRIL_NOTUSED( ret_ptr );
QCRIL_LOG_FUNC_ENTRY();
memset(&resp_payload, 0, sizeof(resp_payload));
qcril_qmi_prov_fill_prov_preference_info(&resp_payload);
QCRIL_LOG_INFO( "User pref %d", resp_payload.user_preference);
QCRIL_LOG_INFO( "Current sub pref %d", resp_payload.current_sub_preference);
qcril_default_request_resp_params( QCRIL_DEFAULT_INSTANCE_ID,
params_ptr->t,
params_ptr->event_id,
ril_req_res,
&resp );
resp.resp_pkt = &resp_payload;
resp.resp_len = sizeof(resp_payload);
qcril_send_request_response( &resp );
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_handle_prov_state_change
===========================================================================*/
/*!
@brief
Post internal event to handle different states in provisioning module.
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_handle_prov_state_change(qcril_qmi_prov_state_type state)
{
QCRIL_LOG_FUNC_ENTRY();
qcril_event_queue(QCRIL_DEFAULT_INSTANCE_ID,
QCRIL_DEFAULT_MODEM_ID,
QCRIL_DATA_ON_STACK,
QCRIL_EVT_RIL_REQUEST_MANUAL_PROVISIONING,
&state,
sizeof(state),
(RIL_Token) QCRIL_SUB_PROVISION_INTERNAL_TOKEN);
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_set_sub_prov_pref_req_handler
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_HOOK_SET_SUB_PROVISION_PREFERENCE_REQ
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_set_sub_prov_pref_req_handler
(
const qcril_request_params_type *const params_ptr,
qcril_request_return_type *const ret_ptr
)
{
int pending_event;
RIL_Errno ril_req_res = RIL_E_SUCCESS;
qcril_qmi_prov_state_type prov_state;
RIL_SetSubProvPreference *prov_pref;
qcril_reqlist_public_type qcril_req_info;
qcril_request_resp_params_type resp;
QCRIL_NOTUSED( ret_ptr );
QCRIL_LOG_FUNC_ENTRY();
if(NULL != params_ptr->data && params_ptr->datalen > QMI_RIL_ZERO )
{
do
{
memset(&resp, 0, sizeof(resp));
memset(&qcril_req_info, 0, sizeof(qcril_req_info));
prov_pref = (RIL_SetSubProvPreference *)params_ptr->data;
QCRIL_LOG_INFO("USER %s", prov_pref->act_status ? "ACTIVATE":"DEACTIVATE");
/* Set state to USER_ACTIVATE/USER_DEACTIVATE and wait for event
** QCRIL_EVT_QMI_PROV_ACTIVATE_SUB_STATUS/QCRIL_EVT_QMI_PROV_DEACTIVATE_SUB_STATUS.
** As part of above events handling, update user preference in database and send
** response to telephony.
*/
if ( prov_pref->act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
pending_event = QCRIL_EVT_QMI_PROV_ACTIVATE_SUB_STATUS;
prov_state = QCRIL_QMI_PROV_STATE_USER_ACTIVATE;
}
else
{
pending_event = QCRIL_EVT_QMI_PROV_DEACTIVATE_SUB_STATUS;
prov_state = QCRIL_QMI_PROV_STATE_USER_DEACTIVATE;
}
qcril_reqlist_default_entry( params_ptr->t,
params_ptr->event_id,
QCRIL_DEFAULT_MODEM_ID,
QCRIL_REQ_AWAITING_MORE_AMSS_EVENTS,
pending_event,
NULL,
&qcril_req_info );
if ( qcril_reqlist_new( QCRIL_DEFAULT_INSTANCE_ID, &qcril_req_info ) == E_SUCCESS )
{
qcril_qmi_prov_handle_prov_state_change(prov_state);
}
else
{
QCRIL_LOG_ERROR("Failed to add entry to reqlist..");
ril_req_res = RIL_E_GENERIC_FAILURE;
break;
}
} while(FALSE);
}
if ((ril_req_res != RIL_E_SUCCESS))
{
QCRIL_LOG_ESSENTIAL("res %d", ril_req_res);
qcril_default_request_resp_params( QCRIL_DEFAULT_INSTANCE_ID,
params_ptr->t,
params_ptr->event_id,
ril_req_res,
&resp );
qcril_send_request_response( &resp );
}
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_nas_prov_activate_sub_status_hndlr
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_QMI_PROV_ACTIVATE_SUB_STATUS
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_nas_prov_activate_sub_status_hndlr
(
const qcril_request_params_type *const params_ptr,
QCRIL_UNUSED(qcril_request_return_type *const ret_ptr) // Output parameter
)
{
int res = RIL_E_GENERIC_FAILURE;
int found_req_res = RIL_E_GENERIC_FAILURE;
qcril_reqlist_public_type req_info;
qcril_request_resp_params_type resp;
QCRIL_LOG_FUNC_ENTRY();
memset(&resp, 0, sizeof(resp));
memset(&req_info, 0, sizeof(req_info));
if ( params_ptr->data != NULL && params_ptr->datalen > 0 )
{
res = *(int*) params_ptr->data;
found_req_res = qcril_reqlist_query_by_event( QCRIL_DEFAULT_INSTANCE_ID,
QCRIL_DEFAULT_MODEM_ID,
QCRIL_EVT_QMI_PROV_ACTIVATE_SUB_STATUS,
&req_info );
QCRIL_LOG_INFO("found req - %d, res - %d", found_req_res, res );
if ( found_req_res == RIL_E_SUCCESS )
{
if ( res == RIL_E_SUCCESS )
{
/* Request is from user and response is success,
** so update data base with user preference.
*/
qcril_qmi_prov_update_db_with_user_pref(RIL_UICC_SUBSCRIPTION_ACTIVATE);
}
qcril_default_request_resp_params( QCRIL_DEFAULT_INSTANCE_ID,
req_info.t,
req_info.request,
res,
&resp );
qcril_send_request_response( &resp );
qcril_qmi_prov_send_unsol_sub_pref_change();
}
}
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_nas_prov_deactivate_sub_status_hndlr
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_QMI_PROV_DEACTIVATE_SUB_STATUS
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_nas_prov_deactivate_sub_status_hndlr
(
const qcril_request_params_type *const params_ptr,
QCRIL_UNUSED(qcril_request_return_type *const ret_ptr) // Output parameter
)
{
int res = RIL_E_GENERIC_FAILURE;
int found_req_res = RIL_E_GENERIC_FAILURE;
qcril_reqlist_public_type req_info;
qcril_request_resp_params_type resp;
QCRIL_LOG_FUNC_ENTRY();
memset(&resp, 0, sizeof(resp));
memset(&req_info, 0, sizeof(req_info));
if ( params_ptr->data != NULL && params_ptr->datalen > 0 )
{
res = *(int*) params_ptr->data;
found_req_res = qcril_reqlist_query_by_event( QCRIL_DEFAULT_INSTANCE_ID,
QCRIL_DEFAULT_MODEM_ID,
QCRIL_EVT_QMI_PROV_DEACTIVATE_SUB_STATUS,
&req_info );
QCRIL_LOG_INFO("found req - %d, res - %d", found_req_res, res );
if ( found_req_res == RIL_E_SUCCESS )
{
if ( res == RIL_E_SUCCESS )
{
/* Request is from user and response is success,
** so update data base with user preference.
*/
qcril_qmi_prov_update_db_with_user_pref(RIL_UICC_SUBSCRIPTION_DEACTIVATE);
}
qcril_default_request_resp_params( QCRIL_DEFAULT_INSTANCE_ID,
req_info.t,
req_info.request,
res,
&resp );
qcril_send_request_response( &resp );
qcril_qmi_prov_send_unsol_sub_pref_change();
}
}
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_manual_provisioning_hndlr
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_RIL_REQUEST_MANUAL_PROVISIONING.
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_manual_provisioning_hndlr
(
const qcril_request_params_type *const params_ptr,
QCRIL_UNUSED(qcril_request_return_type *const ret_ptr) // Output parameter
)
{
int send_resp = TRUE;
int apps_prov = FALSE;
int apps_deprov = FALSE;
qcril_qmi_prov_action_type prov_action = QCRIL_QMI_PROV_ACTION_NONE;
int app_index = QCRIL_INVALID_APP_INDEX;
RIL_Errno res = RIL_E_SUCCESS;
RIL_UiccSubActStatus act_status;
qcril_qmi_prov_state_type prop_state = QCRIL_QMI_PROV_STATE_NONE;
QCRIL_LOG_FUNC_ENTRY();
if ( params_ptr->datalen > 0 && params_ptr->data != NULL )
{
do
{
prop_state = *(qcril_qmi_prov_state_type*)params_ptr->data;
QCRIL_LOG_INFO("proposed provisioning state - %d", prop_state);
/* Update provisioning state machine with proposed state */
res = qcril_qmi_prov_set_prov_state(prop_state, &prov_action);
if ( res != RIL_E_SUCCESS || prop_state == QCRIL_QMI_PROV_STATE_NONE )
{
/* If defer flag is set, don't send response. */
if ( prov_action == QCRIL_QMI_PROV_ACTION_DEFER )
{
QCRIL_LOG_INFO("Differ this request as already manual provisioning in-progress");
send_resp = FALSE;
}
else if ( prop_state == QCRIL_QMI_PROV_STATE_NONE )
{
QCRIL_LOG_INFO("request is to just to reset the status...");
send_resp = FALSE;
}
break;
}
/* Based on current state, mark applications as pending prov/deprov */
if ( RIL_E_SUCCESS != qcril_qmi_prov_evaluate_and_mark_apps() )
{
res = RIL_E_GENERIC_FAILURE;
break;
}
act_status = qcril_qmi_prov_get_act_status_from_state(prop_state);
/* First send request for one app. Once activation response from UIM
** is received, send another request to UIM for second app if present. */
if ( act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
app_index = qcril_qmi_prov_get_app_index_for_activation();
}
else
{
app_index = qcril_qmi_prov_get_app_index_for_deactivation();
}
if ( app_index != QCRIL_INVALID_APP_INDEX )
{
res = qcril_qmi_prov_activate_deactivate_app( params_ptr->t,
params_ptr->event_id,
act_status );
if ( res == RIL_E_SUCCESS )
{
send_resp = FALSE;
}
}
else
{
QCRIL_LOG_INFO("Checking if all apps are activated/deactivated.");
if ( act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
apps_prov = qcril_qmi_prov_all_apps_provisioned();
}
else
{
apps_deprov = qcril_qmi_prov_all_apps_deprovisioned();
}
/* If all apps are activate/deactivated send success response */
if ( apps_prov || apps_deprov )
{
qcril_qmi_prov_set_curr_sub_prov_status(act_status);
}
else
{
res = RIL_E_GENERIC_FAILURE;
QCRIL_LOG_INFO("No app available on SIM card or SIM card is absent");
}
}
} while ( FALSE );
}
/* If activation/deactivation request is not sent to UIM, send response here */
if ( send_resp == TRUE )
{
qcril_qmi_prov_check_and_send_prov_resp(res, prop_state);
}
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_activate_deactivate_app
===========================================================================*/
/*!
@brief
Core function of provisioning module.
Sends request to UIM for activation/deactivation.
@return
None.
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_activate_deactivate_app
(
RIL_Token t,
int event_id,
RIL_UiccSubActStatus act_status
)
{
RIL_Errno ril_req_res = RIL_E_SUCCESS;
IxErrnoType err_no = E_FAILURE;
qcril_evt_e_type pending_event_id;
RIL_SelectUiccSub select_uicc_sub;
qcril_subs_mode_pref mode_pref;
qcril_reqlist_u_type u_info;
qcril_modem_id_e_type modem_id;
qmi_client_error_type qmi_client_error;
qcril_req_state_e_type pending_state;
qcril_reqlist_nas_type *req_info_ptr = NULL;
qcril_instance_id_e_type instance_id;
qcril_reqlist_public_type reqlist_entry;
qcril_uicc_subs_info_type subs_info;
nas_get_mode_pref_resp_msg_v01 qmi_mode_pref_resp;
memset( &u_info, NIL, sizeof(u_info));
memset( &subs_info, NIL, sizeof(subs_info));
memset( &qmi_mode_pref_resp, NIL, sizeof(qmi_mode_pref_resp) );
memset( &select_uicc_sub, NIL, sizeof(select_uicc_sub) );
instance_id = QCRIL_DEFAULT_INSTANCE_ID;
modem_id = QCRIL_DEFAULT_MODEM_ID;
/* fill data required for UIM to activate/deactivate. */
select_uicc_sub.slot = qmi_ril_get_sim_slot();
select_uicc_sub.sub_type = qcril_qmi_nas_get_modem_stack_id();
select_uicc_sub.act_status = act_status;
if ( act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
pending_state = QCRIL_REQ_AWAITING_MORE_AMSS_EVENTS;
pending_event_id = QCRIL_EVT_CM_ACTIVATE_PROVISION_STATUS;
select_uicc_sub.app_index = qcril_qmi_prov_get_app_index_for_activation();
QCRIL_LOG_DEBUG( "RID %d Activate sub: slot %d app_index %d",
instance_id,
select_uicc_sub.slot,
select_uicc_sub.app_index );
}
else
{
pending_state = QCRIL_REQ_AWAITING_MORE_AMSS_EVENTS;
pending_event_id = QCRIL_EVT_CM_DEACTIVATE_PROVISION_STATUS;
select_uicc_sub.app_index = qcril_qmi_prov_get_app_index_for_deactivation();
QCRIL_LOG_DEBUG( "RID %d Deactivate sub: slot %d app_index %d",
instance_id,
select_uicc_sub.slot,
select_uicc_sub.app_index );
}
qmi_client_error =
qmi_client_send_msg_sync_with_shm( qcril_qmi_client_get_user_handle ( QCRIL_QMI_CLIENT_NAS ),
QMI_NAS_GET_MODE_PREF_REQ_MSG_V01,
NULL,
NIL, // empty request payload
(void*) &qmi_mode_pref_resp,
sizeof( qmi_mode_pref_resp ),
QCRIL_QMI_SYNC_REQ_UNRESTRICTED_TIMEOUT );
ril_req_res = qcril_qmi_util_convert_qmi_response_codes_to_ril_result( qmi_client_error,
&qmi_mode_pref_resp.resp );
QCRIL_LOG_INFO( ".. mode pref r %d, 0mpv %d, 0mp %d, 1mpv %d, 1mp %d, 2mpv %d, 2mp %d",
(int) ril_req_res,
(int) qmi_mode_pref_resp.idx0_mode_pref_valid,
(int) qmi_mode_pref_resp.idx0_mode_pref,
(int) qmi_mode_pref_resp.idx1_mode_pref_valid,
(int) qmi_mode_pref_resp.idx1_mode_pref,
(int) qmi_mode_pref_resp.idx2_mode_pref_valid,
(int) qmi_mode_pref_resp.idx2_mode_pref );
if ( RIL_E_SUCCESS == ril_req_res )
{
if ( RIL_SUBSCRIPTION_1 == select_uicc_sub.sub_type )
{
mode_pref =
qcril_qmi_nas_conv_nas_mode_pref_to_qcril( qmi_mode_pref_resp.idx0_mode_pref_valid,
qmi_mode_pref_resp.idx0_mode_pref,
&select_uicc_sub );
}
else if ( RIL_SUBSCRIPTION_2 == select_uicc_sub.sub_type )
{
mode_pref =
qcril_qmi_nas_conv_nas_mode_pref_to_qcril( qmi_mode_pref_resp.idx1_mode_pref_valid,
qmi_mode_pref_resp.idx1_mode_pref,
&select_uicc_sub );
}
else
{
mode_pref =
qcril_qmi_nas_conv_nas_mode_pref_to_qcril( qmi_mode_pref_resp.idx2_mode_pref_valid,
qmi_mode_pref_resp.idx2_mode_pref,
&select_uicc_sub );
}
QCRIL_LOG_INFO( ".. mode pref-cnv param %d, cnved %d", (int) select_uicc_sub.sub_type, (int) mode_pref );
req_info_ptr = &u_info.nas;
memcpy( &req_info_ptr->select_uicc_sub, &select_uicc_sub, sizeof( RIL_SelectUiccSub ) );
if( E_SUCCESS == qcril_reqlist_query_by_request( instance_id,
event_id, &reqlist_entry ) )
{
QCRIL_LOG_INFO( ".. reqlist updating existing entry, instance id %d", (int) instance_id);
err_no = qcril_reqlist_update_pending_event_id( instance_id,
modem_id, t, pending_event_id );
}
else
{
QCRIL_LOG_INFO( ".. Create new entry, instance id %d", (int) instance_id);
qcril_reqlist_default_entry( t,
event_id,
modem_id,
pending_state,
pending_event_id,
&u_info,
&reqlist_entry );
err_no = qcril_reqlist_new( instance_id, &reqlist_entry );
}
if ( err_no == E_SUCCESS )
{
QCRIL_LOG_INFO( ".. reqlist outstanding new ok, instance id %d", (int) instance_id);
subs_info.subs_mode_pref = mode_pref;
memcpy( &subs_info.uicc_subs_info, &select_uicc_sub, sizeof( RIL_SelectUiccSub ) );
if ( select_uicc_sub.act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
QCRIL_LOG_DEBUG( "Request QCRIL(UIM) to activate slot %d aid %d",
select_uicc_sub.slot,
select_uicc_sub.app_index );
err_no = qcril_process_event( instance_id,
modem_id,
QCRIL_EVT_INTERNAL_MMGSDI_ACTIVATE_SUBS,
(void *) &subs_info,
sizeof( qcril_uicc_subs_info_type ),
(RIL_Token) QCRIL_TOKEN_ID_INTERNAL );
QCRIL_LOG_INFO( ".. QCRIL_EVT_INTERNAL_MMGSDI_ACTIVATE_SUBS res %d", (int) err_no );
}
else
{
QCRIL_LOG_DEBUG( "Request QCRIL(UIM) to deactivate slot %d aid %d",
select_uicc_sub.slot,
select_uicc_sub.app_index );
err_no = qcril_process_event( instance_id,
modem_id,
QCRIL_EVT_INTERNAL_MMGSDI_DEACTIVATE_SUBS,
(void *) &subs_info,
sizeof( qcril_uicc_subs_info_type ),
(RIL_Token) QCRIL_TOKEN_ID_INTERNAL );
QCRIL_LOG_INFO( ".. QCRIL_EVT_INTERNAL_MMGSDI_DEACTIVATE_SUBS res %d", (int) err_no );
}
if ( err_no != E_SUCCESS )
{
QCRIL_LOG_INFO("Failed to send request to QCRIL UIM", err_no);
ril_req_res = RIL_E_GENERIC_FAILURE;
}
}
else
{
QCRIL_LOG_INFO( ".. reqlist oustanding new fail");
ril_req_res = RIL_E_GENERIC_FAILURE;
}
}
/* if success, update app status from
** pending provisioning/pending deprovisioning -> provisioning/deprovisioning
** if failure, update app status to not_provisioned
*/
qcril_qmi_prov_update_app_provision_status_using_app_index(
select_uicc_sub.app_index,
select_uicc_sub.act_status,
ril_req_res);
QCRIL_LOG_INFO("completed with %d", (int) ril_req_res);
return ril_req_res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_all_apps_deprovisioned
===========================================================================*/
/*!
@brief
Check if all SIM applications are deprovisioned.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_prov_all_apps_deprovisioned(void)
{
int res = FALSE;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
QCRIL_LOG_INFO("gw_provision_state: %d cdma_provision_state: %d",
gw_provision_state,
cdma_provision_state);
if ( ( (gw_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) &&
(cdma_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) ) ||
( (gw_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) &&
(cdma_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED ) ) ||
( (cdma_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) &&
(gw_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED ) ) )
{
res = TRUE;
}
else
{
res = FALSE;
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_all_apps_provisioned
===========================================================================*/
/*!
@brief
Check if all SIM applications are provisioned.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_prov_all_apps_provisioned(void)
{
int res = FALSE;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
QCRIL_LOG_INFO("gw_provision_state: %d cdma_provision_state: %d",
gw_provision_state,
cdma_provision_state);
/* In case of failure as well app provision state will be not provisioned */
if ( ( (gw_provision_state == QCRIL_APP_STATUS_PROVISIONED) &&
(cdma_provision_state == QCRIL_APP_STATUS_PROVISIONED)) ||
( (gw_provision_state == QCRIL_APP_STATUS_PROVISIONED) &&
(cdma_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED ) ) ||
( (cdma_provision_state == QCRIL_APP_STATUS_PROVISIONED) &&
(gw_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED ) ) )
{
res = TRUE;
}
else
{
res = FALSE;
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_is_any_app_being_provisioned
===========================================================================*/
/*!
@brief
Check if any SIM application is in process of provisioning.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_prov_is_any_app_being_provisioned(void)
{
int res = FALSE;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
QCRIL_LOG_INFO("gw_provision_state: %d cdma_provision_state: %d",
gw_provision_state,
cdma_provision_state);
if ((gw_provision_state == QCRIL_APP_STATUS_PROVISIONING) ||
(cdma_provision_state == QCRIL_APP_STATUS_PROVISIONING) ||
(gw_provision_state == QCRIL_APP_STATUS_PENDING_PROVISIONING) ||
(cdma_provision_state == QCRIL_APP_STATUS_PENDING_PROVISIONING) )
{
res = TRUE;
}
else
{
res = FALSE;
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_is_any_app_being_deprovisioned
===========================================================================*/
/*!
@brief
Check if any SIM application is in process of deprovisioning.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_prov_is_any_app_being_deprovisioned(void)
{
int res = FALSE;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
QCRIL_LOG_INFO("gw_provision_state: %d cdma_provision_state: %d",
gw_provision_state,
cdma_provision_state);
if ((gw_provision_state == QCRIL_APP_STATUS_DEPROVISIONING) ||
(cdma_provision_state == QCRIL_APP_STATUS_DEPROVISIONING) ||
(gw_provision_state == QCRIL_APP_STATUS_PENDING_DEPROVISIONING) ||
(cdma_provision_state == QCRIL_APP_STATUS_PENDING_DEPROVISIONING) )
{
res = TRUE;
}
else
{
res = FALSE;
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_is_any_app_provisioned
===========================================================================*/
/*!
@brief
Check if any SIM application provisioned.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_prov_is_any_app_provisioned()
{
int res = FALSE;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
QCRIL_LOG_INFO("gw_provision_state: %d cdma_provision_state: %d",
gw_provision_state,
cdma_provision_state);
if ( (gw_provision_state == QCRIL_APP_STATUS_PROVISIONED) ||
(cdma_provision_state == QCRIL_APP_STATUS_PROVISIONED) )
{
res = TRUE;
}
else
{
res = FALSE;
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*===========================================================================
qcril_qmi_prov_get_app_index_for_activation
============================================================================*/
/*!
@brief
Get next applications app_index for activation.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_app_index_for_activation(void)
{
int app_index = QCRIL_INVALID_APP_INDEX;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
if ( gw_provision_state == QCRIL_APP_STATUS_PENDING_PROVISIONING )
{
app_index = qcril_qmi_prov_get_gw_app_index();
}
else if ( cdma_provision_state == QCRIL_APP_STATUS_PENDING_PROVISIONING )
{
app_index = qcril_qmi_prov_get_cdma_app_index();
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(app_index);
return app_index;
}
/*===========================================================================
qcril_qmi_prov_get_app_index_for_deactivation
============================================================================*/
/*!
@brief
Get next applications app_index for deactivation.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_app_index_for_deactivation(void)
{
int app_index = QCRIL_INVALID_APP_INDEX;
qcril_card_app_provision_status gw_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
qcril_card_app_provision_status cdma_provision_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
QCRIL_LOG_FUNC_ENTRY();
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
if ( gw_provision_state == QCRIL_APP_STATUS_PENDING_DEPROVISIONING )
{
app_index = qcril_qmi_prov_get_gw_app_index();
}
else if ( cdma_provision_state == QCRIL_APP_STATUS_PENDING_DEPROVISIONING )
{
app_index = qcril_qmi_prov_get_cdma_app_index();
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(app_index);
return app_index;
}
/*===========================================================================
qcril_qmi_prov_check_and_send_prov_resp
============================================================================*/
/*!
@brief
Send appropriate response based on current prov state.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_check_and_send_prov_resp(RIL_Errno res, qcril_qmi_prov_state_type state)
{
int event = 0;
int send_event = TRUE;
qcril_qmi_prov_state_type curr_state = QCRIL_QMI_PROV_STATE_NONE;
qcril_qmi_prov_status_type prov_status;
QCRIL_LOG_FUNC_ENTRY();
memset(&prov_status, NIL, sizeof(prov_status));
curr_state = qcril_qmi_prov_get_prov_state();
switch ( state )
{
case QCRIL_QMI_PROV_STATE_FM_START:
event = QCRIL_EVT_QMI_PROV_FM_START_STATUS;
break;
case QCRIL_QMI_PROV_STATE_FM_APPLY:
event = QCRIL_EVT_QMI_PROV_FM_APPLY_STATUS;
break;
case QCRIL_QMI_PROV_STATE_USER_ACTIVATE:
event = QCRIL_EVT_QMI_PROV_ACTIVATE_SUB_STATUS;
break;
case QCRIL_QMI_PROV_STATE_USER_DEACTIVATE:
event = QCRIL_EVT_QMI_PROV_DEACTIVATE_SUB_STATUS;
break;
case QCRIL_QMI_PROV_STATE_CARD_UP:
event = QCRIL_EVT_QMI_PROV_STATUS_CHANGED;
break;
default:
send_event = FALSE;
break;
}
/* If state is FM_START is success, wait for FM_APPLY before changing state to NONE.
** In all other cases move to NONE. */
if ( (state == curr_state) &&
!( (state == QCRIL_QMI_PROV_STATE_FM_START) && (res == RIL_E_SUCCESS) ) )
{
qcril_qmi_prov_set_prov_state(QCRIL_QMI_PROV_STATE_NONE, NULL);
}
QCRIL_LOG_INFO("state %d, event to post %d, should send_event %d", state, event, send_event);
if ( send_event == TRUE )
{
qcril_event_queue ( QCRIL_DEFAULT_INSTANCE_ID,
QCRIL_DEFAULT_MODEM_ID,
QCRIL_DATA_ON_STACK,
event,
&res,
sizeof(res),
(RIL_Token)QCRIL_TOKEN_ID_INTERNAL );
}
QCRIL_LOG_FUNC_RETURN();
}
/*===========================================================================
qcril_qmi_prov_evaluate_and_mark_apps_to_deactivate
============================================================================*/
/*!
@brief
Mark applications to deactivate if they are in ready state.
@return
None
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_evaluate_and_mark_apps_to_deactivate(void)
{
int app_index;
RIL_Errno res = RIL_E_SUCCESS;
RIL_CardStatus_v6 ril_card_status;
qcril_instance_id_e_type instance_id = qmi_ril_get_process_instance_id();
/* 3gpp sim app state */
qcril_card_app_provision_status gw_provision_state;
/* 3gpp2 sim app state */
qcril_card_app_provision_status cdma_provision_state;
QCRIL_LOG_FUNC_ENTRY();
memset(&ril_card_status, 0, sizeof(ril_card_status));
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
/* Retrieve card status info */
if (qcril_uim_direct_get_card_status(instance_id,
&ril_card_status) == RIL_E_SUCCESS)
{
/* Mark 3gpp sim app */
app_index = qcril_qm_prov_retrieve_gw_app_index(&ril_card_status);
if (app_index != QCRIL_INVALID_APP_INDEX)
{
QCRIL_LOG_DEBUG("3gpp app index: %d, 3gpp app state %d",
app_index,
ril_card_status.applications[app_index].app_state);
/* Deactivate apps irrespective of current app state.
UIM should return success immediately if app is already deactivated */
if ( ril_card_status.applications[app_index].app_state !=
RIL_APPSTATE_UNKNOWN )
{
qcril_qmi_prov_set_gw_app_index(app_index);
qcril_qmi_prov_set_gw_provision_state(QCRIL_APP_STATUS_PENDING_DEPROVISIONING);
}
}
/* Mark 3gpp2 sim apps */
app_index = qcril_qmi_prov_retrieve_cdma_app_index(&ril_card_status);
if (app_index != QCRIL_INVALID_APP_INDEX)
{
QCRIL_LOG_DEBUG("3gpp2 app index: %d, 3gpp2 app state %d",
app_index,
ril_card_status.applications[app_index].app_state);
/* Deactivate apps irrespective of current app state.
UIM should return success immediately if app is already deactivated */
if ( ril_card_status.applications[app_index].app_state !=
RIL_APPSTATE_UNKNOWN )
{
qcril_qmi_prov_set_cdma_app_index(app_index);
qcril_qmi_prov_set_cdma_provision_state(QCRIL_APP_STATUS_PENDING_DEPROVISIONING);
}
}
}
else
{
res = RIL_E_GENERIC_FAILURE;
QCRIL_LOG_DEBUG("Card status failed to retrieve");
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*===========================================================================
qcril_qmi_prov_evaluate_and_mark_apps_to_activate
============================================================================*/
/*!
@brief
Mark applications to activate if they are in ready state.
@return
None
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_evaluate_and_mark_apps_to_activate(void)
{
qcril_instance_id_e_type instance_id = qmi_ril_get_process_instance_id();
RIL_CardStatus_v6 ril_card_status;
int app_index;
RIL_Errno res = RIL_E_SUCCESS;
/* 3gpp sim app state */
qcril_card_app_provision_status gw_provision_state;
/* 3gpp2 sim app state */
qcril_card_app_provision_status cdma_provision_state;
QCRIL_LOG_FUNC_ENTRY();
memset(&ril_card_status, 0, sizeof( ril_card_status ));
gw_provision_state = qcril_qmi_prov_get_gw_provision_state();
cdma_provision_state = qcril_qmi_prov_get_cdma_provision_state();
/* retrieve card status info */
if (qcril_uim_direct_get_card_status(instance_id,
&ril_card_status) == RIL_E_SUCCESS)
{
/* Mark 3gpp sim app */
if ((gw_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) ||
(gw_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED))
{
app_index = qcril_qm_prov_retrieve_gw_app_index(&ril_card_status);
if (app_index != QCRIL_INVALID_APP_INDEX)
{
QCRIL_LOG_DEBUG("3gpp app index: %d, 3gpp app state %d",
app_index,
ril_card_status.applications[app_index].app_state);
/* Activate apps irrespective of current app state.
UIM should return success immediately if app is already activated */
if ( ril_card_status.applications[app_index].app_state !=
RIL_APPSTATE_UNKNOWN )
{
qcril_qmi_prov_set_gw_app_index(app_index);
qcril_qmi_prov_set_gw_provision_state(QCRIL_APP_STATUS_PENDING_PROVISIONING);
}
}
}
else
{
QCRIL_LOG_DEBUG("3gpp app already or being provisioned");
}
/* Mark 3gpp2 sim app */
if ((cdma_provision_state == QCRIL_APP_STATUS_DEPROVISIONED) ||
(cdma_provision_state == QCRIL_APP_STATUS_NOT_PROVISIONED))
{
app_index = qcril_qmi_prov_retrieve_cdma_app_index(&ril_card_status);
if (app_index != QCRIL_INVALID_APP_INDEX)
{
QCRIL_LOG_DEBUG("3gpp2 app index: %d, 3gpp2 app state %d",
app_index,
ril_card_status.applications[app_index].app_state);
/* Activate apps irrespective of current app state.
UIM should return success immediately if app is already activated */
if ( ril_card_status.applications[app_index].app_state !=
RIL_APPSTATE_UNKNOWN )
{
qcril_qmi_prov_set_cdma_app_index(app_index);
qcril_qmi_prov_set_cdma_provision_state(QCRIL_APP_STATUS_PENDING_PROVISIONING);
}
}
}
else
{
QCRIL_LOG_DEBUG("3gpp2 app already or being provisioned");
}
}
else
{
res = RIL_E_GENERIC_FAILURE;
QCRIL_LOG_DEBUG("Card status failed to retrieve");
}
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*===========================================================================
qcril_qm_prov_retrieve_gw_app_index
============================================================================*/
/*!
@brief
Retrieve GW app index. If there are multiple gw apps preference
will be give to USIM.
@return
None
*/
/*=========================================================================*/
int qcril_qm_prov_retrieve_gw_app_index
(
RIL_CardStatus_v6 *ril_card_status
)
{
int index = 0;
int usim_index = QCRIL_INVALID_APP_INDEX;
int sim_index = QCRIL_INVALID_APP_INDEX;
RIL_AppStatus *app_status = NULL;
QCRIL_LOG_FUNC_ENTRY();
if (ril_card_status)
{
for (index = 0; index < RIL_CARD_MAX_APPS; index++)
{
app_status = &ril_card_status->applications[index];
if(app_status->app_type == RIL_APPTYPE_USIM)
{
usim_index = index;
QCRIL_LOG_INFO( "USIM APP present index - %d", usim_index );
break;
}
if( (sim_index == -1) && (app_status->app_type == RIL_APPTYPE_SIM) )
{
sim_index = index;
QCRIL_LOG_INFO( "SIM APP present index - %d", sim_index );
}
}
}
if(usim_index != QCRIL_INVALID_APP_INDEX)
{
index = usim_index;
}
else if(sim_index != QCRIL_INVALID_APP_INDEX)
{
index = sim_index;
}
else
{
index = QCRIL_INVALID_APP_INDEX;
}
QCRIL_LOG_INFO( "index - %d", index );
return index;
}
/*===========================================================================
qcril_qmi_prov_retrieve_cdma_app_index
============================================================================*/
/*!
@brief
Retrieve CDMA app index. If multiple CDMA apps are available, preference
would be given to CSIM.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_retrieve_cdma_app_index
(
RIL_CardStatus_v6 *ril_card_status
)
{
int index = 0;
int csim_index = QCRIL_INVALID_APP_INDEX;
int ruim_index = QCRIL_INVALID_APP_INDEX;
RIL_AppStatus *app_status = NULL;
QCRIL_LOG_FUNC_ENTRY();
if (ril_card_status)
{
for (index = 0; index < RIL_CARD_MAX_APPS; index++)
{
app_status = &ril_card_status->applications[index];
if(app_status->app_type == RIL_APPTYPE_CSIM)
{
csim_index = index;
QCRIL_LOG_INFO( "CSIM APP present index - %d", csim_index );
break;
}
if( (ruim_index == -1) && (app_status->app_type == RIL_APPTYPE_RUIM) )
{
ruim_index = index;
QCRIL_LOG_INFO( "RUIM APP present index - %d", ruim_index );
}
}
}
if(csim_index != QCRIL_INVALID_APP_INDEX)
{
index = csim_index;
}
else if(ruim_index != QCRIL_INVALID_APP_INDEX)
{
index = ruim_index;
}
else
{
index = QCRIL_INVALID_APP_INDEX;
}
QCRIL_LOG_INFO( "index - %d", index );
return index;
}
/*===========================================================================
qcril_qmi_prov_subs_activate_followup
============================================================================*/
/*!
@brief
Handler for QCRIL_EVT_QMI_PROV_ACTIVATE_FOLLOW_UP from UIM..
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_subs_activate_followup
(
const qcril_request_params_type *const params_ptr,
qcril_request_return_type *const ret_ptr
)
{
IxErrnoType err_no = E_SUCCESS;
RIL_SelectUiccSub *sub_ptr;
RIL_SubscriptionType sub_num;
qcril_modem_id_e_type modem_id;
qcril_instance_id_e_type instance_id = QCRIL_DEFAULT_INSTANCE_ID;
qcril_provision_info_type *provision_info_ptr;
qcril_qmi_prov_state_type prov_state = QCRIL_QMI_PROV_STATE_NONE;
qcril_reqlist_public_type req_info;
qcril_request_resp_params_type resp;
QCRIL_LOG_FUNC_ENTRY();
QCRIL_NOTUSED(ret_ptr);
modem_id = params_ptr->modem_id;
memset(&resp, NIL, sizeof(resp));
memset(&req_info, NIL, sizeof(req_info));
provision_info_ptr = ( qcril_provision_info_type *) params_ptr->data;
if( provision_info_ptr != NULL )
{
if ( qcril_reqlist_query_by_event( instance_id, modem_id, QCRIL_EVT_CM_ACTIVATE_PROVISION_STATUS, &req_info ) == E_SUCCESS )
{
sub_ptr = &req_info.sub.nas.select_uicc_sub;
if ( ( req_info.request == QCRIL_EVT_RIL_REQUEST_MANUAL_PROVISIONING ) &&
( sub_ptr->act_status == RIL_UICC_SUBSCRIPTION_ACTIVATE ) )
{
if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_FAILURE )
{
QCRIL_LOG_DEBUG( "RID %d, activate sub failure, slot %d, app_index %d, error_code =%d",
instance_id,
sub_ptr->slot,
sub_ptr->app_index,
provision_info_ptr->err_code);
if ( provision_info_ptr->err_code == RIL_E_SUBSCRIPTION_NOT_SUPPORTED )
{
QCRIL_LOG_ERROR( "Incompatible mode preference selected via QMI_NAS_GET_MODE_PREF_REQ " );
}
}
else if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_IN_PROGRESS )
{
QCRIL_LOG_DEBUG( "RID %d, activate sub in progress, slot %d, app_index %d, session_type %d",
instance_id,
sub_ptr->slot,
sub_ptr->app_index,
provision_info_ptr->session_type );
// update session type
err_no = qcril_reqlist_update_sub_id( instance_id,
req_info.t,
provision_info_ptr->session_type );
QCRIL_LOG_INFO( ".. qcril_reqlist_update_sub_id res %d", (int) err_no );
}
else
{
QCRIL_LOG_DEBUG( "RID %d, UIM activate sub success, slot %d, app_index %d, session_type %d",
instance_id,
sub_ptr->slot,
sub_ptr->app_index,
provision_info_ptr->session_type);
switch ( provision_info_ptr->session_type )
{
case QMI_UIM_SESSION_TYPE_TER_GW_PROV:
case QMI_UIM_SESSION_TYPE_TER_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_3:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_3:
sub_num = RIL_SUBSCRIPTION_3;
break;
case QMI_UIM_SESSION_TYPE_SEC_GW_PROV:
case QMI_UIM_SESSION_TYPE_SEC_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_2:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_2:
sub_num = RIL_SUBSCRIPTION_2;
break;
case QMI_UIM_SESSION_TYPE_PRI_GW_PROV:
case QMI_UIM_SESSION_TYPE_PRI_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_1:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_1:
default:
sub_num = RIL_SUBSCRIPTION_1;
break;
}
}
/* In case of prov fail or success check if we have
** any other apps to activate.*/
if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_FAILURE ||
provision_info_ptr->status == QCRIL_PROVISION_STATUS_SUCCESS )
{
qcril_qmi_prov_update_app_provision_status_using_app_index(sub_ptr->app_index,
sub_ptr->act_status,
provision_info_ptr->err_code);
/* Free existing reqlist so that we can send req to UIM
** for another app */
qcril_reqlist_free(QCRIL_DEFAULT_INSTANCE_ID,
(void *)(intptr_t)QCRIL_SUB_PROVISION_INTERNAL_TOKEN);
if ( qcril_qmi_prov_is_any_app_being_provisioned() )
{
qcril_qmi_prov_activate_deactivate_app( req_info.t,
req_info.request,
RIL_UICC_SUBSCRIPTION_ACTIVATE );
}
else
{
prov_state = qcril_qmi_prov_get_prov_state();
/* No pending apps, check if any app provisioned. If so, return SUCCESS.*/
if ( qcril_qmi_prov_is_any_app_provisioned() )
{
qcril_qmi_prov_check_and_send_prov_resp(RIL_E_SUCCESS, prov_state);
}
else
{
/* No pending apps, none of the apps are provisioned.Send failure */
qcril_qmi_prov_update_app_provision_status_using_app_index( sub_ptr->app_index,
sub_ptr->act_status,
RIL_E_GENERIC_FAILURE);
qcril_qmi_prov_check_and_send_prov_resp(RIL_E_GENERIC_FAILURE, prov_state);
}
}
}
}
}
}
else
{
QCRIL_LOG_FATAL("CHECK FAILED");
}
QCRIL_LOG_FUNC_RETURN();
} // qcril_qmi_prov_subs_activate_followup
/*===========================================================================
qcril_qmi_prov_subs_deactivate_followup
============================================================================*/
/*!
@brief
Handler for QCRIL_EVT_QMI_PROV_DEACTIVATE_FOLLOW_UP from UIM..
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_subs_deactivate_followup
(
const qcril_request_params_type *const params_ptr,
qcril_request_return_type *const ret_ptr
)
{
RIL_SelectUiccSub *sub_ptr;
RIL_SubscriptionType sub_num;
qcril_modem_id_e_type modem_id;
qcril_instance_id_e_type instance_id = QCRIL_DEFAULT_INSTANCE_ID;
qcril_provision_info_type *provision_info_ptr;
qcril_qmi_prov_state_type prov_state = QCRIL_QMI_PROV_STATE_NONE;
qcril_reqlist_public_type req_info;
qcril_request_resp_params_type resp;
QCRIL_LOG_FUNC_ENTRY();
QCRIL_NOTUSED(ret_ptr);
modem_id = params_ptr->modem_id;
memset(&resp, NIL, sizeof(resp));
memset(&req_info, NIL, sizeof(req_info));
provision_info_ptr = ( qcril_provision_info_type *) params_ptr->data;
if( provision_info_ptr != NULL )
{
if ( qcril_reqlist_query_by_event( instance_id, modem_id, QCRIL_EVT_CM_DEACTIVATE_PROVISION_STATUS, &req_info ) == E_SUCCESS )
{
sub_ptr = &req_info.sub.nas.select_uicc_sub;
if ( ( req_info.request == QCRIL_EVT_RIL_REQUEST_MANUAL_PROVISIONING ) &&
( sub_ptr->act_status == RIL_UICC_SUBSCRIPTION_DEACTIVATE ) )
{
if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_FAILURE )
{
QCRIL_LOG_DEBUG( "RID %d, UIM deactivate sub failure, slot %d, app_index %d",
instance_id,
sub_ptr->slot,
sub_ptr->app_index);
}
else if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_SUCCESS )
{
QCRIL_LOG_DEBUG( "RID %d, UIM deactivate sub success, slot %d, app_index %d, session_type %d",
instance_id,
sub_ptr->slot,
sub_ptr->app_index,
provision_info_ptr->session_type);
switch ( provision_info_ptr->session_type )
{
case QMI_UIM_SESSION_TYPE_TER_GW_PROV:
case QMI_UIM_SESSION_TYPE_TER_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_3:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_3:
sub_num = RIL_SUBSCRIPTION_3;
break;
case QMI_UIM_SESSION_TYPE_SEC_GW_PROV:
case QMI_UIM_SESSION_TYPE_SEC_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_2:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_2:
sub_num = RIL_SUBSCRIPTION_2;
break;
case QMI_UIM_SESSION_TYPE_PRI_GW_PROV:
case QMI_UIM_SESSION_TYPE_PRI_1X_PROV:
case QMI_UIM_SESSION_TYPE_NON_PROV_SLOT_1:
case QMI_UIM_SESSION_TYPE_CARD_SLOT_1:
default:
sub_num = RIL_SUBSCRIPTION_1;
break;
}
}
if ( provision_info_ptr->status == QCRIL_PROVISION_STATUS_FAILURE ||
provision_info_ptr->status == QCRIL_PROVISION_STATUS_SUCCESS )
{
qcril_qmi_prov_update_app_provision_status_using_app_index( sub_ptr->app_index,
sub_ptr->act_status,
provision_info_ptr->err_code);
/* Free existing reqlist so that we can send req to UIM
** for another app */
qcril_reqlist_free(QCRIL_DEFAULT_INSTANCE_ID,
(void *)(intptr_t)QCRIL_SUB_PROVISION_INTERNAL_TOKEN);
/* In case of deprov fail or success check if we have
** any other apps to deactivate.*/
if ( qcril_qmi_prov_is_any_app_being_deprovisioned() )
{
qcril_qmi_prov_activate_deactivate_app( req_info.t,
req_info.request,
RIL_UICC_SUBSCRIPTION_DEACTIVATE );
}
else
{
prov_state = qcril_qmi_prov_get_prov_state();
/* send sucess if all apps are deprovisioned, failure otherwise.*/
if ( qcril_qmi_prov_all_apps_deprovisioned() )
{
qcril_qmi_prov_check_and_send_prov_resp(RIL_E_SUCCESS, prov_state);
}
else
{
qcril_qmi_prov_check_and_send_prov_resp(RIL_E_GENERIC_FAILURE, prov_state);
}
}
}
}
}
else
{
QCRIL_LOG_DEBUG( "Late Deactivate provision status event" );
}
}
QCRIL_LOG_FUNC_RETURN();
} // qcril_qmi_prov_subs_deactivate_followup
/*===========================================================================
qcril_qmi_prov_reset_prov_pref_info
============================================================================*/
/*!
@brief
Reset provisioning module internal cache.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_reset_prov_pref_info(int reset_state)
{
int slot = qmi_ril_get_sim_slot();
QCRIL_LOG_FUNC_ENTRY();
prov_common_cache.prov_info[slot].gw_app_index = QCRIL_INVALID_APP_INDEX;
prov_common_cache.prov_info[slot].cdma_app_index = QCRIL_INVALID_APP_INDEX;
prov_common_cache.prov_info[slot].user_prov_pref = QCRIL_INVALID_PROV_PREF;
prov_common_cache.prov_info[slot].curr_prov_status = QCRIL_INVALID_PROV_PREF;
prov_common_cache.prov_info[slot].gw_provision_state =
QCRIL_APP_STATUS_NOT_PROVISIONED;
prov_common_cache.prov_info[slot].cdma_provision_state =
QCRIL_APP_STATUS_NOT_PROVISIONED;
memset(prov_common_cache.prov_info[slot].iccid, 0, sizeof(prov_common_cache.prov_info[slot].iccid));
if ( reset_state )
{
prov_common_cache.prov_info[slot].state = QCRIL_QMI_PROV_STATE_NONE;
// Only during init or resuming from SSR need to reset state, clear any pending manual prov requests.
qcril_reqlist_free(QCRIL_DEFAULT_INSTANCE_ID,
(void *)(intptr_t)QCRIL_SUB_PROVISION_INTERNAL_TOKEN);
}
QCRIL_LOG_FUNC_RETURN();
}
/*===========================================================================
qcril_qmi_prov_set_curr_sub_prov_status
============================================================================*/
/*!
@brief
Update curr_sub_prov_status in cache.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_set_curr_sub_prov_status
(
int curr_prov_status
)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].curr_prov_status = curr_prov_status;
}
/*===========================================================================
qcril_qmi_prov_get_curr_sub_prov_status
============================================================================*/
/*!
@brief
Retrieve curr_sub_prov_status from cache.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_curr_sub_prov_status(void)
{
int slot = qmi_ril_get_sim_slot();
int curr_prov_status = QCRIL_INVALID_PROV_PREF;
curr_prov_status = prov_common_cache.prov_info[slot].curr_prov_status;
return curr_prov_status;
}
/*===========================================================================
qcril_qmi_prov_get_user_pref_from_cache
============================================================================*/
/*!
@brief
Retrieve user_pref from cache.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_user_pref_from_cache(void)
{
int slot = qmi_ril_get_sim_slot();
int user_prov_pref = QCRIL_INVALID_PROV_PREF;
user_prov_pref = prov_common_cache.prov_info[slot].user_prov_pref;
return user_prov_pref;
}
/*===========================================================================
qcril_qmi_prov_update_user_pref_cache
============================================================================*/
/*!
@brief
Update user_pref in cache.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_update_user_pref_cache(RIL_UiccSubActStatus new_user_pref)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].user_prov_pref = new_user_pref;
}
/*===========================================================================
qcril_qmi_prov_set_gw_provision_state
============================================================================*/
/*!
@brief
Update gw app provisioning state.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_set_gw_provision_state(qcril_card_app_provision_status prov_state)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].gw_provision_state = prov_state;
}
/*===========================================================================
qcril_qmi_prov_set_cdma_provision_state
============================================================================*/
/*!
@brief
Update cdma app provisioning state.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_set_cdma_provision_state(qcril_card_app_provision_status prov_state)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].cdma_provision_state = prov_state;
}
/*===========================================================================
qcril_qmi_prov_get_gw_provision_state
============================================================================*/
/*!
@brief
retrieve gw app provisioning state from cache.
@return
None
*/
/*=========================================================================*/
qcril_card_app_provision_status qcril_qmi_prov_get_gw_provision_state()
{
int slot = qmi_ril_get_sim_slot();
int prov_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
prov_state = prov_common_cache.prov_info[slot].gw_provision_state;
return prov_state;
}
/*===========================================================================
qcril_qmi_prov_get_cdma_provision_state
============================================================================*/
/*!
@brief
retrieve cdma app provisioning state from cache.
@return
None
*/
/*=========================================================================*/
qcril_card_app_provision_status qcril_qmi_prov_get_cdma_provision_state()
{
int slot = qmi_ril_get_sim_slot();
int prov_state = QCRIL_APP_STATUS_NOT_PROVISIONED;
prov_state = prov_common_cache.prov_info[slot].cdma_provision_state;
return prov_state;
}
/*===========================================================================
qcril_qmi_prov_get_gw_app_index
============================================================================*/
/*!
@brief
retrieve gw app index from cache.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_gw_app_index()
{
int slot = qmi_ril_get_sim_slot();
int app_index = QCRIL_INVALID_APP_INDEX;
app_index = prov_common_cache.prov_info[slot].gw_app_index;
return app_index;
}
/*===========================================================================
qcril_qmi_prov_get_cdma_app_index
============================================================================*/
/*!
@brief
retrieve cdma app index from cache.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_get_cdma_app_index()
{
int slot = qmi_ril_get_sim_slot();
int app_index = QCRIL_INVALID_APP_INDEX;
app_index = prov_common_cache.prov_info[slot].cdma_app_index;
return app_index;
}
/*===========================================================================
qcril_qmi_prov_set_gw_app_index
============================================================================*/
/*!
@brief
update gw app index in cache.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_set_gw_app_index(int app_index)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].gw_app_index = app_index;
}
/*===========================================================================
qcril_qmi_prov_set_cdma_app_index
============================================================================*/
/*!
@brief
update cdma app index in cache.
@return
None
*/
/*=========================================================================*/
int qcril_qmi_prov_set_cdma_app_index(int app_index)
{
int slot = qmi_ril_get_sim_slot();
prov_common_cache.prov_info[slot].cdma_app_index = app_index;
return app_index;
}
/*===========================================================================
qcril_qmi_prov_update_app_provision_status_using_app_index
============================================================================*/
/*!
@brief
Update app provision status.
@return
None
*/
/*=========================================================================*/
void qcril_qmi_prov_update_app_provision_status_using_app_index
(
int index,
RIL_UiccSubActStatus provision_act,
RIL_Errno res
)
{
int slot = qmi_ril_get_sim_slot();
int gw_app_index = QCRIL_INVALID_APP_INDEX;
int cdma_app_index = QCRIL_INVALID_APP_INDEX;
int *app_index_ptr = NULL;
qcril_card_app_provision_status *provision_status_ptr = NULL;
QCRIL_LOG_FUNC_ENTRY();
gw_app_index = qcril_qmi_prov_get_gw_app_index();
cdma_app_index = qcril_qmi_prov_get_cdma_app_index();
QCRIL_LOG_DEBUG("provision_action: %d, index: %d, result: %d",
provision_act, index, res);
if ((gw_app_index != -1) && (gw_app_index == index))
{
provision_status_ptr =
&prov_common_cache.prov_info[slot].gw_provision_state;
app_index_ptr = &prov_common_cache.prov_info[slot].gw_app_index;
QCRIL_LOG_DEBUG("retrieve GW privision status %d",
*provision_status_ptr);
}
else if ((cdma_app_index != -1) && (cdma_app_index == index))
{
provision_status_ptr =
&prov_common_cache.prov_info[slot].cdma_provision_state;
app_index_ptr = &prov_common_cache.prov_info[slot].cdma_app_index;
QCRIL_LOG_DEBUG("retrieve CDMA privision status %d",
*provision_status_ptr);
}
if (provision_status_ptr && app_index_ptr)
{
if (provision_act == RIL_UICC_SUBSCRIPTION_ACTIVATE)
{
if (res != RIL_E_SUCCESS)
{
/* Important Note::Failure to activate will be marked as not_provisioned */
*app_index_ptr = -1;
*provision_status_ptr = QCRIL_APP_STATUS_NOT_PROVISIONED;
}
else
{
if (*provision_status_ptr == QCRIL_APP_STATUS_PENDING_PROVISIONING)
{
*provision_status_ptr = QCRIL_APP_STATUS_PROVISIONING;
}
else if (*provision_status_ptr == QCRIL_APP_STATUS_PROVISIONING)
{
*provision_status_ptr = QCRIL_APP_STATUS_PROVISIONED;
}
}
}
else if (provision_act == RIL_UICC_SUBSCRIPTION_DEACTIVATE)
{
if (res != RIL_E_SUCCESS)
{
/* Important Note::Failure to deactivate will be marked as provisioned
** as we try to deactivate only if app is provisioned earlier. */
*provision_status_ptr = QCRIL_APP_STATUS_PROVISIONED;
}
else
{
if (*provision_status_ptr == QCRIL_APP_STATUS_PENDING_DEPROVISIONING)
{
*provision_status_ptr = QCRIL_APP_STATUS_DEPROVISIONING;
}
else if (*provision_status_ptr == QCRIL_APP_STATUS_DEPROVISIONING)
{
*provision_status_ptr = QCRIL_APP_STATUS_DEPROVISIONED;
}
}
}
/* if any of the app is provisioned mark curr_prov_status as Activated
** else curr_sub_prov_status will remain as invalid.*/
if ( ( prov_common_cache.prov_info[slot].gw_provision_state ==
QCRIL_APP_STATUS_PROVISIONED ) ||
( prov_common_cache.prov_info[slot].cdma_provision_state ==
QCRIL_APP_STATUS_PROVISIONED ) )
{
qcril_qmi_prov_set_curr_sub_prov_status(RIL_UICC_SUBSCRIPTION_ACTIVATE);
}
/* We will hit this if any app is not provisioned, mark status as
** deactivated even if one app is depropvisioned */
else if ( ( prov_common_cache.prov_info[slot].gw_provision_state ==
QCRIL_APP_STATUS_DEPROVISIONED ) ||
( prov_common_cache.prov_info[slot].cdma_provision_state ==
QCRIL_APP_STATUS_DEPROVISIONED ) )
{
qcril_qmi_prov_set_curr_sub_prov_status(RIL_UICC_SUBSCRIPTION_DEACTIVATE);
}
QCRIL_LOG_DEBUG("provision status %d", *provision_status_ptr);
}
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_get_prov_state
===========================================================================*/
/*!
@brief
Get prov state.
@return
None.
*/
/*=========================================================================*/
qcril_qmi_prov_state_type qcril_qmi_prov_get_prov_state(void)
{
int slot = qmi_ril_get_sim_slot();
int state = QCRIL_QMI_PROV_STATE_NONE;
state = prov_common_cache.prov_info[slot].state;
return state;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_get_act_status_from_state
===========================================================================*/
/*!
@brief
Based on state, user preference return appropriate act_status.
@return
None.
*/
/*=========================================================================*/
RIL_UiccSubActStatus qcril_qmi_prov_get_act_status_from_state(int state)
{
int user_prov_pref = QCRIL_INVALID_PROV_PREF;
int act_status = RIL_UICC_SUBSCRIPTION_ACTIVATE;
user_prov_pref = qcril_qmi_prov_get_user_pref_from_cache();
switch(state)
{
case QCRIL_QMI_PROV_STATE_USER_ACTIVATE:
act_status = RIL_UICC_SUBSCRIPTION_ACTIVATE;
break;
case QCRIL_QMI_PROV_STATE_FM_START:
case QCRIL_QMI_PROV_STATE_USER_DEACTIVATE:
act_status = RIL_UICC_SUBSCRIPTION_DEACTIVATE;
break;
/* FM apply/card status changed, decide activate/deactivate
** based on user preference.*/
case QCRIL_QMI_PROV_STATE_FM_APPLY:
case QCRIL_QMI_PROV_STATE_CARD_UP:
act_status = user_prov_pref;
break;
}
return act_status;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_set_prov_state
===========================================================================*/
/*!
@brief
Handle prov state machine.
@return
None.
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_set_prov_state
(
qcril_qmi_prov_state_type state,
qcril_qmi_prov_action_type *prov_action
)
{
int slot = qmi_ril_get_sim_slot();
RIL_Errno res = RIL_E_GENERIC_FAILURE;
qcril_qmi_prov_state_type curr_state = QCRIL_QMI_PROV_STATE_NONE;
QCRIL_LOG_FUNC_ENTRY();
curr_state = qcril_qmi_prov_get_prov_state();
QCRIL_LOG_INFO("Current state - %d, req state - %d", curr_state, state);
do
{
switch( curr_state )
{
case QCRIL_QMI_PROV_STATE_NONE:
prov_common_cache.prov_info[slot].state = state;
res = RIL_E_SUCCESS;
break;
/* Only FM_APPLY/FM_START/NONE are valid transitions from FM_START
FM_START might come when already in FM_START state if flex map
failed on other RILD.*/
case QCRIL_QMI_PROV_STATE_FM_START:
if ( state == QCRIL_QMI_PROV_STATE_FM_APPLY ||
state == QCRIL_QMI_PROV_STATE_NONE ||
state == QCRIL_QMI_PROV_STATE_FM_START )
{
prov_common_cache.prov_info[slot].state = state;
res = RIL_E_SUCCESS;
}
break;
/* Only Valid transition from curr_state is to NONE */
case QCRIL_QMI_PROV_STATE_FM_APPLY:
case QCRIL_QMI_PROV_STATE_USER_ACTIVATE:
case QCRIL_QMI_PROV_STATE_USER_DEACTIVATE:
if ( state == QCRIL_QMI_PROV_STATE_NONE )
{
prov_common_cache.prov_info[slot].state = state;
res = RIL_E_SUCCESS;
}
break;
/* If provisioning currently on going due card UP, defer FM_START request. */
case QCRIL_QMI_PROV_STATE_CARD_UP:
if ( state == QCRIL_QMI_PROV_STATE_NONE )
{
prov_common_cache.prov_info[slot].state = state;
res = RIL_E_SUCCESS;
}
else if ( ( state == QCRIL_QMI_PROV_STATE_FM_START ) && prov_action )
{
*prov_action = QCRIL_QMI_PROV_ACTION_DEFER;
}
break;
default:
QCRIL_LOG_INFO("should not be here curr_state - %d", curr_state);
break;
}
} while(FALSE);
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_evaluate_and_mark_apps
===========================================================================*/
/*!
@brief
Evaluate application to activate/deactivate.
@return
None.
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_evaluate_and_mark_apps(void)
{
int user_prov_pref = QCRIL_INVALID_PROV_PREF;
RIL_Errno res = RIL_E_SUCCESS;
qcril_qmi_prov_state_type curr_state;
QCRIL_LOG_FUNC_ENTRY();
curr_state = qcril_qmi_prov_get_prov_state();
QCRIL_LOG_INFO("Current state - %d", curr_state);
do
{
user_prov_pref = qcril_qmi_prov_get_user_pref_from_cache();
switch(curr_state)
{
case QCRIL_QMI_PROV_STATE_USER_ACTIVATE:
res = qcril_qmi_prov_evaluate_and_mark_apps_to_activate();
break;
case QCRIL_QMI_PROV_STATE_FM_START:
case QCRIL_QMI_PROV_STATE_USER_DEACTIVATE:
res = qcril_qmi_prov_evaluate_and_mark_apps_to_deactivate();
break;
/* FM apply/card status changed, decide activate/deactivate
** based on user preference.*/
case QCRIL_QMI_PROV_STATE_FM_APPLY:
case QCRIL_QMI_PROV_STATE_CARD_UP:
if ( user_prov_pref == RIL_UICC_SUBSCRIPTION_ACTIVATE )
{
res = qcril_qmi_prov_evaluate_and_mark_apps_to_activate();
}
else if ( user_prov_pref == RIL_UICC_SUBSCRIPTION_DEACTIVATE )
{
res = qcril_qmi_prov_evaluate_and_mark_apps_to_deactivate();
}
else
{
QCRIL_LOG_INFO("Invalid user provisioning preference - %d", user_prov_pref);
}
break;
default:
break;
}
} while(FALSE);
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_update_iccid_hndlr
===========================================================================*/
/*!
@brief
Handle QCRIL_EVT_HOOK_SET_SUB_PROVISION_PREFERENCE_REQ
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_update_iccid_hndlr
(
const qcril_request_params_type *const params_ptr,
QCRIL_UNUSED(qcril_request_return_type *const ret_ptr)
)
{
char *iccid_ptr;
int slot = qmi_ril_get_sim_slot();
QCRIL_LOG_FUNC_ENTRY();
iccid_ptr = params_ptr->data;
if ( params_ptr->data != NULL && params_ptr->datalen > 0 )
{
strlcpy( prov_common_cache.prov_info[slot].iccid,
iccid_ptr,
QMI_DMS_UIM_ID_MAX_V01 + 1 );
QCRIL_LOG_INFO("updated iccid - %s", prov_common_cache.prov_info[slot].iccid);
qcril_qmi_nas_fetch_user_prov_pref_from_database();
}
QCRIL_LOG_FUNC_RETURN();
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_get_iccid_from_cache
===========================================================================*/
/*!
@brief
Get iccid from internal cache. iccid will be null terminated string.
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_get_iccid_from_cache(char *iccid)
{
int slot = qmi_ril_get_sim_slot();
if(NULL != iccid)
{
strlcpy(iccid,
prov_common_cache.prov_info[slot].iccid,
QMI_DMS_UIM_ID_MAX_V01 + 1 );
}
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_fill_prov_preference_info
===========================================================================*/
/*!
@brief
Fetach current subscription status, user preference from internal cache.
@return
None.
*/
/*=========================================================================*/
void qcril_qmi_prov_fill_prov_preference_info(RIL_SubProvStatus *payload)
{
if(NULL != payload)
{
memset(payload, 0, sizeof(*payload));
payload->user_preference = qcril_qmi_prov_get_user_pref_from_cache();
payload->current_sub_preference = qcril_qmi_prov_get_curr_sub_prov_status();
}
}
/*=========================================================================
FUNCTION: qcril_qmi_prov_update_db_with_user_pref
===========================================================================*/
/*!
@brief
Update database with current user preference for subscription.
@return
None.
*/
/*=========================================================================*/
RIL_Errno qcril_qmi_prov_update_db_with_user_pref(int user_prov_pref)
{
int prev_userpref = QCRIL_INVALID_PROV_PREF;
char iccid[ QMI_DMS_UIM_ID_MAX_V01 + 1 ];
RIL_Errno res = RIL_E_SUCCESS;
QCRIL_LOG_FUNC_ENTRY();
qcril_qmi_prov_get_iccid_from_cache(iccid);
res = qcril_db_query_user_pref_from_prov_table(iccid,&prev_userpref);
do
{
if ( res != RIL_E_SUCCESS )
{
QCRIL_LOG_INFO("error while querying user preference");
break;
}
if ( prev_userpref == QCRIL_INVALID_PROV_PREF )
{
QCRIL_LOG_INFO("iccid %s not present", iccid);
qcril_db_insert_new_iccid_into_prov_table(iccid,user_prov_pref);
}
else if ( prev_userpref != user_prov_pref )
{
res = qcril_db_update_user_pref_prov_table(iccid,user_prov_pref);
if ( res == RIL_E_SUCCESS )
{
/* update cache as well.*/
qcril_qmi_prov_update_user_pref_cache(user_prov_pref);
QCRIL_LOG_INFO(" iccid - %s prev user pref - %d, new user pref - %d", iccid, prev_userpref, user_prov_pref);
}
}
}while(0);
QCRIL_LOG_FUNC_RETURN_WITH_RET(res);
return res;
}
/*=========================================================================
FUNCTION: qcril_qmi_nas_fetch_user_prov_pref_from_database
===========================================================================*/
/*!
@brief
Fetch user subscription preference from database.
@return
None.
*/
/*=========================================================================*/
int qcril_qmi_nas_fetch_user_prov_pref_from_database(void)
{
int pref = QCRIL_INVALID_PROV_PREF;
char iccid[QMI_DMS_UIM_ID_MAX_V01 + 1];
RIL_Errno res = RIL_E_SUCCESS;
QCRIL_LOG_FUNC_ENTRY();
memset(iccid, NIL,sizeof(iccid));
qcril_qmi_prov_get_iccid_from_cache(iccid);
res = qcril_db_query_user_pref_from_prov_table(iccid,&pref);
QCRIL_LOG_INFO("user preference from db - %d", pref);
if ( pref == QCRIL_INVALID_PROV_PREF )
{
/* for new card, set user preference by default as activate.*/
QCRIL_LOG_INFO("New card inserted... set user preference to activate");
pref = RIL_UICC_SUBSCRIPTION_ACTIVATE;
qcril_qmi_prov_update_db_with_user_pref(RIL_UICC_SUBSCRIPTION_ACTIVATE);
}
qcril_qmi_prov_update_user_pref_cache(pref);
QCRIL_LOG_FUNC_RETURN_WITH_RET(pref);
return pref;
}
| [
"adithya.r02@outlook.com"
] | adithya.r02@outlook.com |
161a6139f0ee23aefb376a2af1b94e807055e91f | a7d700d33d537f45bab2edcf11c3306784eb37fc | /framework_1212/driver/gpmc/module/gpmc.mod.c | f69ae4381d4eeb54a53ea2710efaa22f0237775e | [] | no_license | sunjiangbo/3730 | bf1ceee1865a3ac35efff410b83de82973d5f2ab | f19c3b8f41367da36b52cd4303b9c4f100573206 | refs/heads/master | 2021-01-11T20:21:28.593933 | 2015-01-04T02:00:30 | 2015-01-04T02:00:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,069 | c | #include <linux/module.h>
#include <linux/vermagic.h>
#include <linux/compiler.h>
MODULE_INFO(vermagic, VERMAGIC_STRING);
struct module __this_module
__attribute__((section(".gnu.linkonce.this_module"))) = {
.name = KBUILD_MODNAME,
.init = init_module,
#ifdef CONFIG_MODULE_UNLOAD
.exit = cleanup_module,
#endif
.arch = MODULE_ARCH_INIT,
};
static const struct modversion_info ____versions[]
__used
__attribute__((section("__versions"))) = {
{ 0x796a78cc, "module_layout" },
{ 0x1a9df6cc, "malloc_sizes" },
{ 0xfa2a45e, "__memzero" },
{ 0x20222be4, "cdev_add" },
{ 0x22b61c98, "cdev_init" },
{ 0xbb4f6c53, "kmem_cache_alloc" },
{ 0x29537c9e, "alloc_chrdev_region" },
{ 0xe9ce8b95, "omap_ioremap" },
{ 0xea147363, "printk" },
{ 0x15331242, "omap_iounmap" },
{ 0x7485e15e, "unregister_chrdev_region" },
{ 0x37a0cba, "kfree" },
{ 0x734d612a, "cdev_del" },
{ 0xefd6cf06, "__aeabi_unwind_cpp_pr0" },
};
static const char __module_depends[]
__used
__attribute__((section(".modinfo"))) =
"depends=";
MODULE_INFO(srcversion, "E92295158F5E2F7917E7FA9");
| [
"server@G520"
] | server@G520 |
121290f6378a48ab1b0a61df483452754c1d26d1 | 5d3c93efede09d9d85d18a023e6820a3574fe1f5 | /nexell_riscv/romboot/src/nx_cpuif_regmap.c | df4038d4872b4c2b3afadbd63cc4dc75173e9074 | [] | no_license | delphi123/NXP4330_riscv-bootrom | dc24d22ed4405c42113ddc8e4ba558e47d9d77b1 | 2bc30f70d02246cb5133c0bdb3835cd7bdcd449d | refs/heads/master | 2023-03-21T21:08:41.854732 | 2018-05-18T08:35:12 | 2018-05-18T08:35:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,726 | c | #include <nx_cpuif_regmap.h>
#include <nx_swallow_platform.h>
#if defined(QEMU_RISCV) || defined(SOC_SIM)
#include <nx_qemu_sim_printf.h>
#else
#include <nx_swallow_printf.h>
#endif
void nx_cpuif_reg_write_one(__nx_cpuif_symbol__ symbol, unsigned int regval)
{
unsigned int *reg_addr;
unsigned int reg_val;
volatile unsigned int * reg;
unsigned int reg_writeval;
unsigned int reg_mask;
unsigned int reg_startbit;
unsigned int reg_bitwidth;
unsigned int masked_writeval;
// reg_addr = (unsigned int*)(*symbol.baseaddr + symbol.offset);
reg_addr = (unsigned int*)(symbol.baseaddr + symbol.offset);
reg_startbit = symbol.startbit;
reg_bitwidth = symbol.bitwidth;
reg_writeval = regval << reg_startbit;
reg = (unsigned int*) reg_addr;
if( reg_bitwidth == 32 ) {
reg_val = 0;
} else {
reg_val = *reg;//ReadIODW(reg);
}
reg_mask = reg_bitwidth < 32 ? ((1<<(reg_bitwidth))-1) << reg_startbit : ~0;
masked_writeval = (reg_bitwidth < 32) ? regval & ((1<<(reg_bitwidth))-1) : regval ;
reg_writeval = masked_writeval << reg_startbit;
#if 0//def DEBUG
_dprintf("\n<<bootrom>>[DEBUG]------------------------ ");
_dprintf("\n<<bootrom>>[DEBUG] symbol.baseaddr = 0x%x", symbol.baseaddr );
_dprintf("\n<<bootrom>>[DEBUG] symbol.baseaddr2 = 0x%x", *symbol.baseaddr );
_dprintf("\n<<bootrom>>[DEBUG] symbol.baseaddr3 = 0x%x", symbol.baseaddr+symbol.offset );
_dprintf("\n<<bootrom>>[DEBUG] reg = 0x%x", reg );
_dprintf("\n<<bootrom>>[DEBUG] reg_startbit = 0x%x", reg_startbit );
_dprintf("\n<<bootrom>>[DEBUG] reg_bitwidth = 0x%x", reg_bitwidth );
_dprintf("\n<<bootrom>>[DEBUG] masked_writeval = 0x%x", masked_writeval );
_dprintf("\n<<bootrom>>[DEBUG] reg_writeval = 0x%x", reg_writeval );
_dprintf("\n<<bootrom>>[DEBUG] reg_mask = 0x%x", reg_mask );
_dprintf("\n<<bootrom>>[DEBUG]------------------------");
#endif
reg_val = reg_val & (~reg_mask);
reg_val = reg_val | reg_writeval;
*reg = (unsigned int)reg_val;
// WriteIODW(reg, reg_val);
#if 0//def DEBUG
_dprintf("\n[DEBUG] reg = 0x%x, regval = 0x%x", reg, reg_val );
#endif
}
unsigned int nx_cpuif_reg_read_one(__nx_cpuif_symbol__ symbol, unsigned int * regval )
{
unsigned int * reg_addr;
unsigned int reg_val;
volatile unsigned int * reg;
unsigned int reg_readval;
unsigned int reg_mask;
unsigned int reg_startbit;
unsigned int reg_bitwidth;
//reg_addr = (unsigned int*)(*symbol.baseaddr + symbol.offset);
reg_addr = (unsigned int*)(symbol.baseaddr + symbol.offset);
reg_startbit = symbol.startbit;
reg_bitwidth = symbol.bitwidth;
reg = (unsigned int*) reg_addr;
reg_val = *reg;//ReadIODW(reg);
#if 0
_dprintf("\n[DEBUG] reg_val = 0x%x(%d), reg_addr = 0x%x", reg_val, reg_val, reg_addr);
#endif
reg_mask = reg_bitwidth < 32 ? ((1<<(reg_bitwidth))-1) << reg_startbit : ~0;
reg_readval = (reg_val & reg_mask) >> reg_startbit;
reg_val = reg_readval;
if( regval != NULL ) {
*regval = reg_val;
}
//NX_ASSERT( reg_bitwidth != 0 );
#if 0
_dprintf("\n[DEBUG]------------------------ ");
_dprintf("\n[DEBUG] reg_addr = 0x%x", reg_addr );
_dprintf("\n[DEBUG] reg_startbit = 0x%x", reg_startbit );
_dprintf("\n[DEBUG] reg_bitwidth = 0x%x", reg_bitwidth );
_dprintf("\n[DEBUG] reg_mask = 0x%x", reg_mask );
_dprintf("\n[DEBUG] reg_readval = 0x%x", reg_readval );
_dprintf("\n[DEBUG] reg_val = 0x%x(%d)", reg_val, reg_val);
_dprintf("\n[DEBUG]------------------------");
#endif
return reg_readval;
}
| [
"suker@nexell.co.kr"
] | suker@nexell.co.kr |
e3a5f37f2a7ea6218ad1fd16aa9a1598af99cbb2 | 2c052c996d4267623276a681308bf87ea7388f60 | /src/xen/public/arch-x86/xen-x86_64.h | 064b4aae70135cc671ffdd7a6d0c892149a493be | [
"Apache-2.0"
] | permissive | nanovms/nanos | 17d3ce113b63c4370e40d291b8fd8fb9d943c02d | 9085e091e5250fc58bf036591c8959e05fd7957f | refs/heads/master | 2023-08-25T16:49:14.521701 | 2023-08-25T14:00:54 | 2023-08-25T14:14:13 | 115,159,616 | 2,055 | 131 | Apache-2.0 | 2023-09-14T17:16:19 | 2017-12-23T00:25:34 | C | UTF-8 | C | false | false | 7,975 | h | /******************************************************************************
* xen-x86_64.h
*
* Guest OS interface to x86 64-bit Xen.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Copyright (c) 2004-2006, K A Fraser
*/
#ifndef __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__
#define __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__
/*
* Hypercall interface:
* Input: %rdi, %rsi, %rdx, %r10, %r8, %r9 (arguments 1-6)
* Output: %rax
* Access is via hypercall page (set up by guest loader or via a Xen MSR):
* call hypercall_page + hypercall-number * 32
* Clobbered: argument registers (e.g., 2-arg hypercall clobbers %rdi,%rsi)
*/
/*
* 64-bit segment selectors
* These flat segments are in the Xen-private section of every GDT. Since these
* are also present in the initial GDT, many OSes will be able to avoid
* installing their own GDT.
*/
#define FLAT_RING3_CS32 0xe023 /* GDT index 260 */
#define FLAT_RING3_CS64 0xe033 /* GDT index 261 */
#define FLAT_RING3_DS32 0xe02b /* GDT index 262 */
#define FLAT_RING3_DS64 0x0000 /* NULL selector */
#define FLAT_RING3_SS32 0xe02b /* GDT index 262 */
#define FLAT_RING3_SS64 0xe02b /* GDT index 262 */
#define FLAT_KERNEL_DS64 FLAT_RING3_DS64
#define FLAT_KERNEL_DS32 FLAT_RING3_DS32
#define FLAT_KERNEL_DS FLAT_KERNEL_DS64
#define FLAT_KERNEL_CS64 FLAT_RING3_CS64
#define FLAT_KERNEL_CS32 FLAT_RING3_CS32
#define FLAT_KERNEL_CS FLAT_KERNEL_CS64
#define FLAT_KERNEL_SS64 FLAT_RING3_SS64
#define FLAT_KERNEL_SS32 FLAT_RING3_SS32
#define FLAT_KERNEL_SS FLAT_KERNEL_SS64
#define FLAT_USER_DS64 FLAT_RING3_DS64
#define FLAT_USER_DS32 FLAT_RING3_DS32
#define FLAT_USER_DS FLAT_USER_DS64
#define FLAT_USER_CS64 FLAT_RING3_CS64
#define FLAT_USER_CS32 FLAT_RING3_CS32
#define FLAT_USER_CS FLAT_USER_CS64
#define FLAT_USER_SS64 FLAT_RING3_SS64
#define FLAT_USER_SS32 FLAT_RING3_SS32
#define FLAT_USER_SS FLAT_USER_SS64
#define __HYPERVISOR_VIRT_START 0xFFFF800000000000
#define __HYPERVISOR_VIRT_END 0xFFFF880000000000
#define __MACH2PHYS_VIRT_START 0xFFFF800000000000
#define __MACH2PHYS_VIRT_END 0xFFFF804000000000
#ifndef HYPERVISOR_VIRT_START
#define HYPERVISOR_VIRT_START xen_mk_ulong(__HYPERVISOR_VIRT_START)
#define HYPERVISOR_VIRT_END xen_mk_ulong(__HYPERVISOR_VIRT_END)
#endif
#define MACH2PHYS_VIRT_START xen_mk_ulong(__MACH2PHYS_VIRT_START)
#define MACH2PHYS_VIRT_END xen_mk_ulong(__MACH2PHYS_VIRT_END)
#define MACH2PHYS_NR_ENTRIES ((MACH2PHYS_VIRT_END-MACH2PHYS_VIRT_START)>>3)
#ifndef machine_to_phys_mapping
#define machine_to_phys_mapping ((unsigned long *)HYPERVISOR_VIRT_START)
#endif
/*
* int HYPERVISOR_set_segment_base(unsigned int which, unsigned long base)
* @which == SEGBASE_* ; @base == 64-bit base address
* Returns 0 on success.
*/
#define SEGBASE_FS 0
#define SEGBASE_GS_USER 1
#define SEGBASE_GS_KERNEL 2
#define SEGBASE_GS_USER_SEL 3 /* Set user %gs specified in base[15:0] */
/*
* int HYPERVISOR_iret(void)
* All arguments are on the kernel stack, in the following format.
* Never returns if successful. Current kernel context is lost.
* The saved CS is mapped as follows:
* RING0 -> RING3 kernel mode.
* RING1 -> RING3 kernel mode.
* RING2 -> RING3 kernel mode.
* RING3 -> RING3 user mode.
* However RING0 indicates that the guest kernel should return to iteself
* directly with
* orb $3,1*8(%rsp)
* iretq
* If flags contains VGCF_in_syscall:
* Restore RAX, RIP, RFLAGS, RSP.
* Discard R11, RCX, CS, SS.
* Otherwise:
* Restore RAX, R11, RCX, CS:RIP, RFLAGS, SS:RSP.
* All other registers are saved on hypercall entry and restored to user.
*/
/* Guest exited in SYSCALL context? Return to guest with SYSRET? */
#define _VGCF_in_syscall 8
#define VGCF_in_syscall (1<<_VGCF_in_syscall)
#define VGCF_IN_SYSCALL VGCF_in_syscall
#ifndef __ASSEMBLY__
struct iret_context {
/* Top of stack (%rsp at point of hypercall). */
uint64_t rax, r11, rcx, flags, rip, cs, rflags, rsp, ss;
/* Bottom of iret stack frame. */
};
#if defined(__XEN__) || defined(__XEN_TOOLS__)
/* Anonymous unions include all permissible names (e.g., al/ah/ax/eax/rax). */
#define __DECL_REG_LOHI(which) union { \
uint64_t r ## which ## x; \
uint32_t e ## which ## x; \
uint16_t which ## x; \
struct { \
uint8_t which ## l; \
uint8_t which ## h; \
}; \
}
#define __DECL_REG_LO8(name) union { \
uint64_t r ## name; \
uint32_t e ## name; \
uint16_t name; \
uint8_t name ## l; \
}
#define __DECL_REG_LO16(name) union { \
uint64_t r ## name; \
uint32_t e ## name; \
uint16_t name; \
}
#define __DECL_REG_HI(num) union { \
uint64_t r ## num; \
uint32_t r ## num ## d; \
uint16_t r ## num ## w; \
uint8_t r ## num ## b; \
}
#elif defined(__GNUC__) && !defined(__STRICT_ANSI__)
/* Anonymous union includes both 32- and 64-bit names (e.g., eax/rax). */
#define __DECL_REG(name) union { \
uint64_t r ## name, e ## name; \
uint32_t _e ## name; \
}
#else
/* Non-gcc sources must always use the proper 64-bit name (e.g., rax). */
#define __DECL_REG(name) uint64_t r ## name
#endif
#ifndef __DECL_REG_LOHI
#define __DECL_REG_LOHI(name) __DECL_REG(name ## x)
#define __DECL_REG_LO8 __DECL_REG
#define __DECL_REG_LO16 __DECL_REG
#define __DECL_REG_HI(num) uint64_t r ## num
#endif
struct cpu_user_regs {
__DECL_REG_HI(15);
__DECL_REG_HI(14);
__DECL_REG_HI(13);
__DECL_REG_HI(12);
__DECL_REG_LO8(bp);
__DECL_REG_LOHI(b);
__DECL_REG_HI(11);
__DECL_REG_HI(10);
__DECL_REG_HI(9);
__DECL_REG_HI(8);
__DECL_REG_LOHI(a);
__DECL_REG_LOHI(c);
__DECL_REG_LOHI(d);
__DECL_REG_LO8(si);
__DECL_REG_LO8(di);
uint32_t error_code; /* private */
uint32_t entry_vector; /* private */
__DECL_REG_LO16(ip);
uint16_t cs, _pad0[1];
uint8_t saved_upcall_mask;
uint8_t _pad1[3];
__DECL_REG_LO16(flags); /* rflags.IF == !saved_upcall_mask */
__DECL_REG_LO8(sp);
uint16_t ss, _pad2[3];
uint16_t es, _pad3[3];
uint16_t ds, _pad4[3];
uint16_t fs, _pad5[3]; /* Non-nul => takes precedence over fs_base. */
uint16_t gs, _pad6[3]; /* Non-nul => takes precedence over gs_base_user. */
};
typedef struct cpu_user_regs cpu_user_regs_t;
DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
#undef __DECL_REG
#undef __DECL_REG_LOHI
#undef __DECL_REG_LO8
#undef __DECL_REG_LO16
#undef __DECL_REG_HI
#define xen_pfn_to_cr3(pfn) ((unsigned long)(pfn) << 12)
#define xen_cr3_to_pfn(cr3) ((unsigned long)(cr3) >> 12)
struct arch_vcpu_info {
unsigned long cr2;
unsigned long pad; /* sizeof(vcpu_info_t) == 64 */
};
typedef struct arch_vcpu_info arch_vcpu_info_t;
typedef unsigned long xen_callback_t;
#endif /* !__ASSEMBLY__ */
#endif /* __XEN_PUBLIC_ARCH_X86_XEN_X86_64_H__ */
/*
* Local variables:
* mode: C
* c-file-style: "BSD"
* c-basic-offset: 4
* tab-width: 4
* indent-tabs-mode: nil
* End:
*/
| [
"noreply@github.com"
] | nanovms.noreply@github.com |
cf51b3cea93777cd0503f8e396cea54d7b6da852 | f561d31d91ce0c574afd74f1538d47185f1a6412 | /ASE_BIS/TP8_ASE_FIleSyst/src/if_nfile.c | 6a242564f82ac5a3ad529d8dc9a9b527e146eb49 | [] | no_license | DherJ/Master1 | 7a93d26abacd35aa7dc4790f3b226418d1a6fe40 | 27d78b9344869bf9d888551cb3879ca472c7d683 | refs/heads/master | 2021-01-10T17:06:52.514185 | 2017-02-16T10:17:55 | 2017-02-16T10:17:55 | 37,208,183 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,058 | c | /* ------------------------------
$Id: if_nfile.c,v 1.1 2009/11/16 05:38:07 marquet Exp $
------------------------------------------------------------
Create a new file, read from stdin, return the inumber
Philippe Marquet, Nov 2009
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "ifile.h"
#include "mount.h"
static void
nfile()
{
file_desc_s fd;
unsigned int inumber;
int status;
int c;
inumber = create_ifile(FILE_FILE);
ffatal(inumber, "erreur creation fichier");
printf("%u\n", inumber);
status = open_ifile(&fd, inumber);
ffatal(!status, "erreur ouverture fichier %d", inumber);
while((c=getchar()) != EOF)
writec_ifile(&fd, c);
close_ifile(&fd);
}
static void
usage(const char *prgm)
{
fprintf(stderr, "[%s] usage:\n\t"
"%s\n", prgm, prgm);
exit(EXIT_FAILURE);
}
int
main (int argc, char *argv[])
{
if (argc != 1)
usage(argv[0]);
mount();
nfile();
umount();
exit(EXIT_SUCCESS);
}
| [
"j.dhersin@hotmail.fr"
] | j.dhersin@hotmail.fr |
7e2cdb17e11f8feeae6270ea329478ac5553ec61 | 13bda9c8bdee5f30107ebc456be8aeb6df99d881 | /DUMP/AddResourceComboRow_classes.h | 36ce6faaec3b7c353c49fc9c0b8099588cc9ef6b | [] | no_license | xkp95175333/Icarus-Win64-Shipping | e783576259742a5a26592cc9aead95bc47cd90fc | 910879d96e35a1f271be206182e18ee80c01a88e | refs/heads/main | 2023-07-24T19:38:25.224868 | 2021-09-05T17:50:16 | 2021-09-05T17:50:16 | 403,376,074 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 966 | h | // WidgetBlueprintGeneratedClass AddResourceComboRow.AddResourceComboRow_C
// Size: 0x298 (Inherited: 0x260)
struct UAddResourceComboRow_C : UUserWidget {
struct FPointerToUberGraphFrame UberGraphFrame; // 0x260(0x08)
struct UImage* RowIcon; // 0x268(0x08)
struct UTextBlock* RowText; // 0x270(0x08)
struct FText DisplayName; // 0x278(0x18)
struct FName RowName; // 0x290(0x08)
bool LessThan(struct UObject* Other); // Function AddResourceComboRow.AddResourceComboRow_C.LessThan // (Event|Public|HasOutParms|BlueprintCallable|BlueprintEvent|BlueprintPure|Const) // @ game+0x1a04fd0
void Set Row(struct FName RowName); // Function AddResourceComboRow.AddResourceComboRow_C.Set Row // (BlueprintCallable|BlueprintEvent) // @ game+0x1a04fd0
void ExecuteUbergraph_AddResourceComboRow(int32_t EntryPoint); // Function AddResourceComboRow.AddResourceComboRow_C.ExecuteUbergraph_AddResourceComboRow // (Final|UbergraphFunction|HasDefaults) // @ game+0x1a04fd0
};
| [
"68745798+xkp95175333@users.noreply.github.com"
] | 68745798+xkp95175333@users.noreply.github.com |
ae9dc09d549c6b5aeb8a6da373cef8f7d40b51cb | 17ac0514b4e9a0813f484708a0c64bccb03785b7 | /src/chainparamsseeds.h | 99353bf6831807c0122f60fa2797612ef0f24106 | [
"MIT"
] | permissive | sdavignon/RIFFCash | 42d994d7582c1a2c9fcf6fa08bd93b14bd1bf4c7 | b578239ace232c521b97e9d4336fb8445662c38a | refs/heads/master | 2021-09-03T08:51:15.663122 | 2017-12-03T15:28:02 | 2017-12-03T15:28:02 | 112,027,552 | 0 | 2 | null | 2017-11-26T20:15:01 | 2017-11-25T19:02:38 | C++ | UTF-8 | C | false | false | 22,602 | h | #ifndef BITCOIN_CHAINPARAMSSEEDS_H
#define BITCOIN_CHAINPARAMSSEEDS_H
/**
* List of fixed seed nodes for the riffcash network
* AUTOGENERATED by contrib/seeds/generate-seeds.py
*
* Each line contains a 16-byte IPv6 address and a port.
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
*/
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x27,0x40,0x07}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x2d,0x45,0x0d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0x64,0xf9,0xc5}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xe4,0x07,0x92}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xff,0x5a,0xea}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x1c,0x80,0x41}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0x5e,0x1c,0xb6}, 9335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x17,0xec,0x64,0x0b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xd6,0x36,0xb3}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x18,0xdc,0x9e,0x97}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1b,0x60,0x33,0x0f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0x83,0x14,0x55}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x1f,0xa5,0x32,0x9c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x22,0xc1,0x44,0x0a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x18,0x7c,0xb1}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x3d,0xd1,0x90}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x8f,0x08,0x66}, 28333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0x9d,0xb7,0x10}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x25,0xdd,0xc6,0x39}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2a,0x33,0x0c,0xdc}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2a,0x33,0x99,0x50}, 8332},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x37,0xb0,0x1a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x3f,0x5d,0x4b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xac,0xd3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x17,0x55,0x19}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x20,0x32,0x62}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0xa6,0x81,0xba}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x36,0xcf,0x5b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x37,0x5f,0xe3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x58,0x98,0x8d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x5a,0x78,0x9d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x5d,0x84,0x03}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0xbb,0x10,0xaf}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x07,0x4d,0xb9}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x33,0x0f,0x40,0xa6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x07,0x87,0x45}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0x3f,0x0c,0x6d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x36,0x95,0xce,0x16}, 18891},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x6a,0x10,0x6f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x6a,0x1b,0xdb}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x70,0x0b,0xbc}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0x98,0x36,0x2c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3e,0xe8,0x88,0xf3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3f,0xe0,0x37,0x4a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x3f,0xe7,0xef,0xd4}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x41,0x46,0x13,0x31}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xac,0x68,0x50}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xc4,0x05,0x21}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x44,0x3f,0x08,0x24}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x45,0xaf,0x31,0xe2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x47,0x78,0xbc,0x52}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0x87,0xeb,0xf6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x48,0xb4,0x6b,0xc1}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4a,0x4d,0x50,0x2c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x0c,0xf7,0x2d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0x5c,0x88,0x4b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4c,0xa9,0x39,0x5c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4d,0x4d,0x2e,0xfa}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x1f,0x42,0xaa}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x3a,0x9a,0x16}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x9e,0x84,0x0e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xed,0xeb,0x65}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xed,0xf0,0x66}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x04,0x67,0x30}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x51,0x1b,0x60,0x25}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xc0,0x40,0x88}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x52,0xd0,0x63,0x0d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x4e,0xe6,0x1e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0x53,0x00,0x64}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xa2,0xc4,0xc0}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x53,0xd4,0x61,0x22}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0x32,0xf2,0x88}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xd7,0x50,0x2b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x54,0xea,0x34,0xbe}, 37700},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x15,0x90,0xa3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x15,0x90,0xe2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x19,0x4a,0x94}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x19,0x8a,0x47}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x69,0xc4,0xd1}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0x8f,0x89,0xce}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xc2,0xee,0x82}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x55,0xea,0x96,0xc7}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x56,0x0e,0x8f,0xb0}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0x4f,0x5e,0xdd}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x57,0xec,0x1b,0x9b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x54,0x18,0xce}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0x57,0x4e,0x7e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xc4,0x88,0x1f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xca,0xca,0xdd}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x58,0xd0,0x03,0x52}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x16,0x68,0x30}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x16,0x97,0xd3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0x62,0x8c,0x58}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xd4,0x4b,0x06}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x59,0xfc,0x1c,0x1a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5a,0xb1,0x30,0x68}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x6d,0x70,0x5a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x6d,0x70,0x5e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0x98,0x79,0x44}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xcd,0xd9,0x8e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe2,0x0a,0x5a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xe4,0x9b,0x3f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5b,0xf0,0x8d,0xaf}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0x64,0x33,0x30}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5d,0xbe,0x8c,0xc6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0x1f,0xaa,0x31}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xae,0x65,0x0e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd3,0x8a,0x58}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd5,0x8f,0x0d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0xd5,0xd2,0x8d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x2a,0xf8,0x95}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x60,0x7f,0xaf,0xc2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x51,0x98,0x82}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x61,0x6b,0xbc,0xb1}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x65,0x64,0xae,0x8a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x03,0xbc,0xbd}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x07,0x20,0x28}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x50,0xa8,0x39}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0x52,0x38,0x19}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x67,0xfa,0x04,0x4a}, 41888},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0x23,0x60,0xff}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0x96,0x2d,0xd2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0x9b,0x85,0xe6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xb6,0xeb,0x35}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xc5,0xd8,0xe4}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3b,0x07,0xd6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3b,0x09,0x0e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0x3d,0x66,0x05}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0x6f,0xb2,0xbb}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xa9,0x47,0x11}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6d,0xc9,0xb7,0x7d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x09,0x74,0x44}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x1c,0x3d,0xc9}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x77,0x1c,0x46,0x90}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x79,0x0e,0x9a,0x31}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x79,0x2a,0xb8,0x08}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7b,0x01,0xaa,0x2e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x7c,0xbe,0x0c,0x56}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x82,0xf0,0x16,0xca}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x86,0x77,0xb3,0xea}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8b,0x3b,0xb4,0x0f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8b,0xa2,0x39,0x15}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8c,0xba,0x2a,0x2c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8e,0x04,0xd0,0x20}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8f,0x59,0x6f,0x6f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0x4c,0x28,0x90}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xac,0x47,0x8a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x94,0xfb,0x2c,0x86}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9b,0x04,0x0f,0x34}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9b,0xcf,0x3c,0x30}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x9e,0x81,0xd4,0xfb}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xd5,0xfc,0x2e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa2,0xdd,0x0c,0x74}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa6,0x46,0x5e,0x6a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xa9,0x2c,0x22,0x58}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xab,0x19,0xdd,0x28}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x33,0xb1,0x02}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x4f,0xc4,0xa0}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0x50,0xbe,0x56}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd1,0x2c,0x22}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xff,0xcc,0x7c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xae,0x31,0xf8,0xbc}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x0f,0x9e,0xed}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x14,0x37,0xea}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x9b,0x33,0x36}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0xee,0xe1,0xa8}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb7,0x6f,0x0a,0x43}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb8,0xa4,0x93,0x52}, 21333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x08,0xa5,0x96}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x15,0xdf,0xe7}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x32,0xd5,0x7c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x67,0xf3,0x85}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x6a,0x7a,0xc0}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0x8d,0x18,0x7f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xa3,0x7d,0x43}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb9,0xc2,0x8c,0x9b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xb6,0x6d,0xd8}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0xd6,0x1e,0x8a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbe,0x70,0xf2,0xb2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbf,0x65,0xec,0xde}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x03,0xa5,0x1e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xbb,0x74,0xf2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x21,0xaa,0x7f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x2e,0x50,0x65}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x3a,0xc4,0xd4}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc1,0x92,0x29,0x2e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x18,0xb6,0x1b}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x3f,0x8f,0xc5}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x4f,0x08,0x24}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x4f,0x08,0x25}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc2,0x87,0x58,0x8e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x03,0xfe,0x30}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0x84,0x3d,0x52}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xa6,0x9d,0x61}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xa9,0x8a,0x02}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xe1,0xe6,0x1c}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x30,0xd8,0x31}, 9933},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc6,0x62,0x30,0xc0}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc7,0xcc,0xb9,0xda}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcc,0x6f,0xf1,0xc3}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x29,0xba,0x4e}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x49,0x8e,0xe2}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd1,0x7e,0x6b,0xa6}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd2,0x38,0x3c,0x1a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0x16,0x1d,0x22}, 19262},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0x95,0xa1,0x68}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd3,0x95,0xe0,0xea}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x01,0x65,0x44}, 10333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x2f,0xfc,0x0d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0x5d,0xe2,0x5a}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd4,0xa0,0xed,0x2c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd5,0x88,0x47,0x8f}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd8,0xa4,0x8a,0x0d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x14,0x82,0x48}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd9,0x70,0xfb,0x15}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xda,0xa1,0x2f,0x3d}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdb,0x71,0xf4,0x34}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdb,0x75,0xf8,0x37}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdd,0x8d,0x03,0x0c}, 9333},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xdd,0x8d,0x03,0x1a}, 9333}
};
static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x21,0x6b,0x5c}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0x5c,0x54}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2f,0x5d,0x51,0x54}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x42,0xb2,0xb6,0x23}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x4e,0x2f,0x22,0xe4}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5e,0xb0,0xed,0xa7}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x62,0xea,0x41,0x70}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0x83,0xa1,0xab}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xec,0xd3,0xce}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xf3,0x26,0x22}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6c,0x3d,0xc3,0x97}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8a,0xc5,0xdc,0xd9}, 19335},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xad,0xd1,0x2c,0x22}, 19335}
};
#endif // BITCOIN_CHAINPARAMSSEEDS_H
| [
"kernelpanek+github@gmail.com"
] | kernelpanek+github@gmail.com |
c9659e186b817ed4604bc40784cd826c4a20416d | baa3ca16ece08d8af0b085b58167c0876fb55c96 | /Tercero/REDES 2/practica1/command.c | b4df58c76edd3f59a25577399a7c7cc368148c3b | [] | no_license | ZhijieQ/inf-uam | 851d66b1484a63cdf6e2f35209075abf07bdb830 | 38079fdd5da5bb0ea35fa3265e813e0fe1a3bdd1 | refs/heads/master | 2021-06-01T10:20:44.917316 | 2016-08-23T18:24:12 | 2016-08-23T18:24:12 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 502 | c | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main(){
FILE * f=NULL;
FILE * s=NULL;
char str[] ="- This, a sample string.";
char * pch;
printf("1\n");
f=fopen("commandos", "r");
s=fopen("case.c", "w");
if(f==NULL){
return 0;
}
printf("1\n");
while(fscanf(f,"%s", str)>=0){
printf("1\n");
pch = strtok (str," ,\n\t");
printf("1\n");
while (pch != NULL){
fprintf(s,"case %s:\n\tprintf('%s?');\nbreak;\n",pch,pch);
pch = strtok (NULL, " ,\n\t");
}
}
}
| [
"mariogr_93@hotmail.com"
] | mariogr_93@hotmail.com |
691efa0e998ebed1b8d1dc68ac1f335b84ea9a37 | 38575fb792abc446f1957d589047d3fc77e9edb9 | /study/2.C_and_C++/C/class_clang/C语言/04-第4天(数组、函数)/00-基础代码/08.static.c | 836075317b486ac9adb4e7d258bbc912b2d67c1f | [] | no_license | llb1008x/API | f1a0c3c76c9a6a41485e1a71c475010089e5e4b6 | 45cbf43750ad8a020a08a9227bba6914b090e5a6 | refs/heads/master | 2022-11-03T15:17:23.449072 | 2020-04-30T02:35:27 | 2020-04-30T02:35:27 | 71,621,596 | 2 | 2 | null | 2022-10-04T23:40:49 | 2016-10-22T06:37:07 | C | UTF-8 | C | false | false | 220 | c | #include <stdio.h>
void fun(void)
{
static int f = 1;
int w = 1;
w = w + 2;
f = f + 2;
printf("w=%d,f=%d\n",w,f);
}
int main()
{
int i;
for( i = 0 ; i <5 ;i++)
fun();
return 0;
}
| [
"llb1008x@126.com"
] | llb1008x@126.com |
02e1942f82676568aa679bb09ebf5dc5851a0444 | 10e64f8dca0b596b339169f80c8706edb51eed9f | /linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/share/ti/ti-linalg-tree/packages/ti/linalg/blis/frame/1m/packm/ukernels/bli_packm_ref_cxk_4m.c | 95fb95153f33be50dec6a0b268a1de21d9cb4821 | [
"BSD-3-Clause"
] | permissive | wangy2000/LeezBoard_TI5708 | 264cea03d04402cf14714e35f1ca9efd4a1ef7cb | 1c0e92c5b61de16f8d8aeb86852c9d53ed99ac58 | refs/heads/master | 2020-06-16T22:01:26.340391 | 2019-04-23T13:21:54 | 2019-04-23T13:21:54 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 63,613 | c | /*
BLIS
An object-based framework for developing high-performance BLAS-like
libraries.
Copyright (C) 2014, The University of Texas at Austin
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
- Neither the name of The University of Texas at Austin nor the names
of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "blis.h"
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_2xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_4xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_6xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_8xk_4m )
#ifndef BLIS_ENABLE_C66X_BUILD // these packs are not used in c66x; allows fatser compilation
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_10xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_12xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_14xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_16xk_4m )
#undef GENTFUNCCO
#define GENTFUNCCO( ctype, ctype_r, ch, chr, varname ) \
\
void PASTEMAC(ch,varname)( \
conj_t conja, \
dim_t n, \
void* kappa, \
void* a, inc_t inca, inc_t lda, \
void* p, inc_t is_p, inc_t ldp \
) \
{ \
const inc_t inca2 = 2 * inca; \
const inc_t lda2 = 2 * lda; \
\
ctype* kappa_cast = kappa; \
ctype_r* restrict kappa_r = ( ctype_r* )kappa; \
ctype_r* restrict kappa_i = ( ctype_r* )kappa + 1; \
ctype_r* restrict alpha1_r = ( ctype_r* )a; \
ctype_r* restrict alpha1_i = ( ctype_r* )a + 1; \
ctype_r* restrict pi1_r = ( ctype_r* )p; \
ctype_r* restrict pi1_i = ( ctype_r* )p + is_p; \
\
if ( PASTEMAC(ch,eq1)( *kappa_cast ) ) \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyjris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \
PASTEMAC(ch,copyjris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,copyris)( *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,copyris)( *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \
PASTEMAC(ch,copyris)( *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
else \
{ \
if ( bli_is_conj( conja ) ) \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \
PASTEMAC(ch,scal2jris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
else \
{ \
for ( ; n != 0; --n ) \
{ \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 0*inca2), *(alpha1_i + 0*inca2), *(pi1_r + 0), *(pi1_i + 0) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 1*inca2), *(alpha1_i + 1*inca2), *(pi1_r + 1), *(pi1_i + 1) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 2*inca2), *(alpha1_i + 2*inca2), *(pi1_r + 2), *(pi1_i + 2) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 3*inca2), *(alpha1_i + 3*inca2), *(pi1_r + 3), *(pi1_i + 3) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 4*inca2), *(alpha1_i + 4*inca2), *(pi1_r + 4), *(pi1_i + 4) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 5*inca2), *(alpha1_i + 5*inca2), *(pi1_r + 5), *(pi1_i + 5) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 6*inca2), *(alpha1_i + 6*inca2), *(pi1_r + 6), *(pi1_i + 6) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 7*inca2), *(alpha1_i + 7*inca2), *(pi1_r + 7), *(pi1_i + 7) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 8*inca2), *(alpha1_i + 8*inca2), *(pi1_r + 8), *(pi1_i + 8) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r + 9*inca2), *(alpha1_i + 9*inca2), *(pi1_r + 9), *(pi1_i + 9) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +10*inca2), *(alpha1_i +10*inca2), *(pi1_r +10), *(pi1_i +10) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +11*inca2), *(alpha1_i +11*inca2), *(pi1_r +11), *(pi1_i +11) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +12*inca2), *(alpha1_i +12*inca2), *(pi1_r +12), *(pi1_i +12) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +13*inca2), *(alpha1_i +13*inca2), *(pi1_r +13), *(pi1_i +13) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +14*inca2), *(alpha1_i +14*inca2), *(pi1_r +14), *(pi1_i +14) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +15*inca2), *(alpha1_i +15*inca2), *(pi1_r +15), *(pi1_i +15) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +16*inca2), *(alpha1_i +16*inca2), *(pi1_r +16), *(pi1_i +16) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +17*inca2), *(alpha1_i +17*inca2), *(pi1_r +17), *(pi1_i +17) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +18*inca2), *(alpha1_i +18*inca2), *(pi1_r +18), *(pi1_i +18) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +19*inca2), *(alpha1_i +19*inca2), *(pi1_r +19), *(pi1_i +19) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +20*inca2), *(alpha1_i +20*inca2), *(pi1_r +20), *(pi1_i +20) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +21*inca2), *(alpha1_i +21*inca2), *(pi1_r +21), *(pi1_i +21) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +22*inca2), *(alpha1_i +22*inca2), *(pi1_r +22), *(pi1_i +22) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +23*inca2), *(alpha1_i +23*inca2), *(pi1_r +23), *(pi1_i +23) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +24*inca2), *(alpha1_i +24*inca2), *(pi1_r +24), *(pi1_i +24) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +25*inca2), *(alpha1_i +25*inca2), *(pi1_r +25), *(pi1_i +25) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +26*inca2), *(alpha1_i +26*inca2), *(pi1_r +26), *(pi1_i +26) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +27*inca2), *(alpha1_i +27*inca2), *(pi1_r +27), *(pi1_i +27) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +28*inca2), *(alpha1_i +28*inca2), *(pi1_r +28), *(pi1_i +28) ); \
PASTEMAC(ch,scal2ris)( *kappa_r, *kappa_i, *(alpha1_r +29*inca2), *(alpha1_i +29*inca2), *(pi1_r +29), *(pi1_i +29) ); \
\
alpha1_r += lda2; \
alpha1_i += lda2; \
pi1_r += ldp; \
pi1_i += ldp; \
} \
} \
} \
}
INSERT_GENTFUNCCO_BASIC0( packm_ref_30xk_4m )
#endif
| [
"82796620@qq.com"
] | 82796620@qq.com |
0c8753cefcd427b3aacdbef2c10a8138a5fb924a | cd760d6f8e318941e37c0ffb8566993896606e6e | /.phoronix-test-suite/installed-tests/compilebench/compilebench-0.6/t/native-0/drivers/net/hamradio/mkiss.c | 1358e30346ac042069ceec543ea1431bfd0f2534 | [] | no_license | aorzerep/neb | 3fab34e1ad05cd0c1f2274f4d143664c1ed4368d | 6dda5d3c432f2636973c9a98370056e57fe8e79f | refs/heads/master | 2020-09-08T10:06:34.548290 | 2019-11-12T01:00:41 | 2019-11-12T01:00:41 | 221,099,011 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 24,449 | c | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | [
"root@neb.intranet.highprophil.com"
] | root@neb.intranet.highprophil.com |
229cb78823ca236c54234b213b2546b74092c6a6 | 1cc47f2c0b3295bac56a955a32eb96b319b7cb92 | /Code/AlarmClock/Pods/Headers/Public/RongCloudIMKitWithVoip/RongIMLib/RCUserTypingStatus.h | bb0db653cdfc7b43b1e6b5edcd77fd4662b131da | [] | no_license | limao123/Alarm | 6a03cd05ca724b66ac418febb790c6892e817bbf | c52823f58d4c7a1bd870112b76babe3ded8cea1e | refs/heads/master | 2021-05-30T15:28:09.304396 | 2016-03-23T09:44:27 | 2016-03-23T09:44:27 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 129 | h | ../../../../RongCloudIMKitWithVoip/Rong_Cloud_iOS_IMKit_SDK_v2_4_9_dev_with_voip/RongIMLib.framework/Headers/RCUserTypingStatus.h | [
"397524331@qq.com"
] | 397524331@qq.com |
0764aa0141418d7ed07cadbef2e5eae292fa245c | 119bfeffb9f716a170373d37a32a0eb8d858536b | /46_cycleDetection.c | c05974881721774a79fddce86433f1da7a1acda1 | [] | no_license | Arshadfaizan/aps-codelibrary | a238df70a84ace20ffa734f00b19f472d0c98ee2 | 80a9d7552546252a71ed5964874c3255c584801f | refs/heads/main | 2023-06-04T05:06:45.599007 | 2021-06-24T08:08:01 | 2021-06-24T08:08:01 | 378,590,360 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 238 | c | bool has_cycle(SinglyLinkedListNode* head)
{
SinglyLinkedListNode* p;
SinglyLinkedListNode* q;
p=head;
q=head;
while(p && q && q->next)
{
p=p->next;
q=q->next->next;
if(p==q)
{
return 1;
}
}
| [
"noreply@github.com"
] | Arshadfaizan.noreply@github.com |
021a30a6c90600506cb3fcad47906d2f3b4cfa37 | c0022372af06cd72b599c9bb81e279285bf0af33 | /v4-cokapi/backends/c_cpp/valgrind-3.11.0/none/tests/mips64/load_store_unaligned.c | 60c61916b2a17038cf52d42216a7967d55c933cf | [
"GPL-2.0-only",
"GPL-2.0-or-later",
"GFDL-1.2-only",
"MIT"
] | permissive | diogo55/OnlinePythonTutor | 0d4b112a51a17b7aba4be20da08403f4f3e61f80 | a7120a4257b9c7e509bcf9398877899804dff45b | refs/heads/master | 2021-06-22T20:47:57.544463 | 2021-05-04T19:57:34 | 2021-05-04T19:57:34 | 216,675,450 | 3 | 4 | MIT | 2019-10-21T22:18:44 | 2019-10-21T22:18:43 | null | UTF-8 | C | false | false | 1,263 | c | #include <stdio.h>
#define N 16
#define SOLL 8 /* size of unsigned long long */
unsigned long long memSrc[] = {
0x12345658121f1e1f, 0,
3, -1,
0x232f2e2f56568441, 0x242c2b2b1236548c,
0xffffffff252a2e2b, 0x262d2d2a4521dddd,
0x3f343f3e22222222, 0x3e353d3c41231548,
0x363a3c3b45421212, 0x3b373b3a4545afcb,
0x454f4e4556984525, 0xfffffffffffffffc,
0x474d474c55aaaaaa, 0x4a484a4c65665659
};
unsigned long long memDst[] = {
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
0, 0, 0, 0,
};
int main()
{
#if defined(__mips_hard_float)
int i, index;
unsigned long long outLoad;
for (i = 0; i < N * SOLL; i++) {
outLoad = 0;
__asm__ __volatile__(
"move $t0, %1" "\n\t"
"move $t1, %2" "\n\t"
"luxc1 $f0, $t1($t0)" "\n\t"
"dmfc1 %0, $f0" "\n\t"
"move $t0, %3" "\n\t"
"suxc1 $f0, $t1($t0)" "\n\t"
: "=r" (outLoad)
: "r" (memSrc), "r" (i), "r" (memDst)
: "t0", "t1", "$f0"
);
index = (i / SOLL) % N;
printf("i: %d, memSrc[%d]: 0x%llx, memDst[%d]: 0x%llx, outLoad: 0x%llx\n",
i, index, memSrc[index], index, memDst[index], outLoad);
}
#endif
return 0;
}
| [
"philip@pgbovine.net"
] | philip@pgbovine.net |
ec3885375eb781e96206fe5961d9b8fce3ae2862 | 02a7edf97682e3a3883608a92b4bf47c6826958b | /pdrsrc/dmpl.c | 24c426588c73984bae8a4c518ee40062e73584f6 | [] | no_license | thorhalbert/UltraDesign | ca1756cccde848fa371fa5a3d1091f2a32ef1922 | a790b37f94da57f410f3f9b21d0bae55723e2c1b | refs/heads/master | 2021-06-27T13:52:35.902050 | 2020-12-04T04:06:53 | 2020-12-04T04:06:53 | 191,678,124 | 2 | 2 | null | null | null | null | UTF-8 | C | false | false | 4,066 | c | #include "driversetup.h"
struct plotter_base *PB;
#define DMPLCAP PLFLAG_VECTOR | PLFLAG_CIRCARC | \
PLFLAG_PENSRT | PLFLAG_PHYPEN | PLFLAG_AUTOPN
#define IOS .06350
struct preset_data {
ULONG setflags;
UBYTE *plotname;
UBYTE *comment;
LONG xmin,xmax,ymin,ymax;
STDFLT xres,yres;
UWORD autopens;
#define TOTALPRESETS 7
} dmpl_presets[] = {
{ DMPLCAP, "DMP-40","Houston DMP-40", 0,3700,0,2600, 0.1,0.1, 20},
{ DMPLCAP, "DMP-41","Houston DMP-41", 0,3500,0,2600, 0.1,0.1, 20},
{ DMPLCAP, "DMP-42","Houston DMP-42", 0,3500,0,2600, 0.1,0.1, 20},
{ DMPLCAP, "LP4000-A","LP4000-A", 0,4000,0,3200, IOS,IOS, 20},
{ DMPLCAP, "LP4000-B","LP4000-B", 0,6600,0,4400, IOS,IOS, 20},
{ DMPLCAP, "LP4000-C","LP4000-C", 0,8800,0,6800, IOS,IOS, 20},
{ DMPLCAP, "LP4000-D","LP4000-D", 0,14400,0,9200, IOS,IOS, 20},
} ;
BOOL dmpl_initdriver(inbase)
struct plotter_base *inbase;
{
PB = inbase; /* Set up our context */
PB->MPI->NumPresets = TOTALPRESETS; /* Tell em how many */
return(TRUE);
}
BOOL dmpl_dopreset(presnum)
int presnum;
{
if (presnum<0) return(FALSE);
if (presnum>=TOTALPRESETS) return(FALSE); /* Out of range */
sprintf(PB->MPI->PlotName,"%s",dmpl_presets[presnum].plotname);
sprintf(PB->MPI->Comment,"%s",dmpl_presets[presnum].comment);
PB->MPI->MinCX = dmpl_presets[presnum].xmin;
PB->MPI->MaxCX = dmpl_presets[presnum].xmax;
PB->MPI->MinCY = dmpl_presets[presnum].ymin;
PB->MPI->MaxCY = dmpl_presets[presnum].ymax;
PB->MPI->StepX = dmpl_presets[presnum].xres;
PB->MPI->StepY = dmpl_presets[presnum].yres;
PB->MPI->PlotType = 1; /* Pen plotter */
PB->MPI->PlotFlags = dmpl_presets[presnum].setflags;
PB->MPI->AutoPens = dmpl_presets[presnum].autopens;
return(TRUE);
}
VOID dmpl_stepaction() { return; }
BOOL dmpl_initplot()
{
PB->MPI->PassPerPage = 1; /* Just need one per pen per page */
plotf("\n;:\n"); /* Set to plot mode (ESC0) */
plotf("H\n"); /* Send Device Home */
plotf("L0\n\n"); /* Draw solid lines */
return(TRUE);
}
#define MAXPRES 20
LONG xpres[MAXPRES+2],
ypres[MAXPRES+2];
int pres=0;
LONG lasx,lasy;
VOID _clearpres()
{
int i;
if (pres<=0) return;
plotf("RD");
for (i=0; i<pres; i++) {
if (i==0) plotf("%d,%d",xpres[i],ypres[i]);
else plotf(",%d,%d",xpres[i],ypres[i]);
}
plotf("\n\n");
pres = 0;
}
VOID dmpl_movetopoint(x,y)
LONG x,y;
{
_clearpres();
plotf("AU %d,%d\n\n",x,y); /* Move pen up to x,y */
lasx = x;
lasy = y;
return;
}
VOID dmpl_drawaline(x,y)
LONG x,y;
{
LONG tx,ty;
if (pres>MAXPRES) _clearpres();
tx = x - lasx;
ty = y - lasy;
if (tx==0&&ty==0) return;
lasx = x;
lasy = y;
xpres[pres] = tx;
ypres[pres] = ty;
pres++;
return;
}
VOID dmpl_drawellipse(x,y,rx,ry,ba,ea,er) /* Circle-Arc Only */
LONG x,y,rx,ry;
STDFLT ba,ea,er;
{
UWORD bad,ead;
normalize(ba); /* Fix into normal range */
normalize(ea);
bad = (ba/TWOPI) * 360.0; /* Convert to degrees */
ead = (ea/TWOPI) * 360.0;
if (bad==ead) {
bad = 0;
ead = 360;
}
/* plotf("C%d,%d,%d,%d,%d\n\n",x,y,rx,bad,ead); *//* Draw circle */
return;
}
VOID dmpl_endplot()
{
_clearpres();
plotf("H\n"); /* Home the plotter */
return;
}
VOID dmpl_setuppen(inlogical,inphysical,mountpen,setup)
struct physical_pen *inphysical;
struct logical_pen *inlogical;
int mountpen;
BOOL setup; /* First Initialization Pass? */
{
_clearpres();
if (setup) return; /* Dmpland's don't need this */
if (mountpen>=1) { /* Cannot unload the pen */
plotf("P %d\n\n",mountpen); /* Pick up given pen */
return;
}
return;
}
VOID dmpl_setpenvelocity() { return; }
VOID dmpl_setpenaccel() { return; }
VOID dmpl_expungedriver() { return; }
VOID dmpl_beginpass() /* Only a single pass for a plotter */
{
PB->MPI->MinPX = PB->MPI->MinCX;
PB->MPI->MaxPX = PB->MPI->MaxCX;
PB->MPI->MinPY = PB->MPI->MinCY;
PB->MPI->MaxPY = PB->MPI->MaxCY;
return;
}
| [
"thorhalbert@gmail.com"
] | thorhalbert@gmail.com |
fd7a09733f6f2f9a01b9348ac14a94b5e057999b | 8dd913ba31081e6aff2b48d46db37018e322b458 | /modules/media/mix_vbp/viddec_fw/fw/parser/vbp_utils.h | 7761c261058323da5532e89746a37505c19c3bf1 | [] | no_license | lisevenpro/android_device_motorola_smi | 2e79fe42c50c95e5843fdd26ec261f33eb5dd0c2 | 3b1f76fce4ef2eb49b5eee773fe29f1e0c8f406a | refs/heads/cm-11.0 | 2020-12-11T01:55:12.060686 | 2015-12-25T11:48:41 | 2015-12-25T11:48:41 | 48,893,332 | 1 | 0 | null | 2016-01-02T00:03:22 | 2016-01-02T00:03:22 | null | UTF-8 | C | false | false | 4,168 | h | /* INTEL CONFIDENTIAL
* Copyright (c) 2009 Intel Corporation. All rights reserved.
*
* The source code contained or described herein and all documents
* related to the source code ("Material") are owned by Intel
* Corporation or its suppliers or licensors. Title to the
* Material remains with Intel Corporation or its suppliers and
* licensors. The Material contains trade secrets and proprietary
* and confidential information of Intel or its suppliers and
* licensors. The Material is protected by worldwide copyright and
* trade secret laws and treaty provisions. No part of the Material
* may be used, copied, reproduced, modified, published, uploaded,
* posted, transmitted, distributed, or disclosed in any way without
* Intel's prior express written permission.
*
* No license under any patent, copyright, trade secret or other
* intellectual property right is granted to or conferred upon you
* by disclosure or delivery of the Materials, either expressly, by
* implication, inducement, estoppel or otherwise. Any license
* under such intellectual property rights must be express and
* approved by Intel in writing.
*
*/
#ifndef VBP_UTILS_H
#define VBP_UTILS_H
#include "viddec_parser_ops.h"
#include "viddec_pm_parse.h"
#include "viddec_pm.h"
#include "vbp_trace.h"
#include <stdlib.h>
#define MAGIC_NUMBER 0x0DEADBEEF
#define MAX_WORKLOAD_ITEMS 1000
/* maximum 256 slices per sample buffer */
#define MAX_NUM_SLICES 256
/* maximum two pictures per sample buffer */
#define MAX_NUM_PICTURES 2
#define vbp_malloc(struct_type, n_structs) \
((struct_type *) malloc(sizeof(struct_type) * n_structs))
#define vbp_malloc_set0(struct_type, n_structs) \
((struct_type *) vbp_try_malloc0(sizeof(struct_type) * n_structs))
extern uint32 viddec_parse_sc(void *in, void *pcxt, void *sc_state);
/* rolling counter of sample buffer */
extern uint32 buffer_counter;
typedef struct vbp_context_t vbp_context;
typedef uint32 (*function_init_parser_entries)(vbp_context* cxt);
typedef uint32 (*function_allocate_query_data)(vbp_context* cxt);
typedef uint32 (*function_free_query_data)(vbp_context* cxt);
typedef uint32 (*function_parse_init_data)(vbp_context* cxt);
typedef uint32 (*function_parse_start_code)(vbp_context* cxt);
typedef uint32 (*function_process_parsing_result)(vbp_context* cxt, int i);
typedef uint32 (*function_populate_query_data)(vbp_context* cxt);
#ifdef USE_AVC_SHORT_FORMAT
typedef uint32 (*function_update_data)(vbp_context* cxt, void *newdata, uint32 size);
#endif
struct vbp_context_t
{
/* magic number */
uint32 identifier;
/* parser type, eg, MPEG-2, MPEG-4, H.264, VC1 */
uint32 parser_type;
/* handle to parser (shared object) */
void *fd_parser;
/* parser (shared object) entry points */
viddec_parser_ops_t *parser_ops;
/* parser context */
viddec_pm_cxt_t *parser_cxt;
/* work load */
viddec_workload_t *workload1, *workload2;
/* persistent memory for parser */
uint32 *persist_mem;
/* format specific query data */
void *query_data;
/* parser type specific data*/
void *parser_private;
function_init_parser_entries func_init_parser_entries;
function_allocate_query_data func_allocate_query_data;
function_free_query_data func_free_query_data;
function_parse_init_data func_parse_init_data;
function_parse_start_code func_parse_start_code;
function_process_parsing_result func_process_parsing_result;
function_populate_query_data func_populate_query_data;
#ifdef USE_AVC_SHORT_FORMAT
function_update_data func_update_data;
#endif
};
void* vbp_try_malloc0(uint32 size);
/**
* create VBP context
*/
uint32 vbp_utils_create_context(uint32 parser_type, vbp_context **ppcontext);
/*
* destroy VBP context
*/
uint32 vbp_utils_destroy_context(vbp_context *pcontext);
/*
* parse bitstream
*/
uint32 vbp_utils_parse_buffer(vbp_context *pcontext, uint8 *data, uint32 size, uint8 init_data_flag);
/*
* query parsing result
*/
uint32 vbp_utils_query(vbp_context *pcontext, void **data);
/*
* flush un-parsed bitstream
*/
uint32 vbp_utils_flush(vbp_context *pcontext);
#endif /* VBP_UTILS_H */
| [
"jgrharbers@gmail.com"
] | jgrharbers@gmail.com |
9aecc1db9c12d4fa17b565e506a838959f008cdf | bc7c7a23775a2d6a85c550dedabf2b63f2057587 | /src/fft.h | bd4ea094611059d7e57e2d7e4bd8139df2da8f7e | [] | no_license | kmatheussen/ceres | 4cd0f15de89b41fd30e1cd037b3c2c8bd57919fe | 4ea383b416be1a27f5d60e9d496ff7699a24df2c | refs/heads/master | 2021-01-17T15:08:09.142831 | 2016-06-30T11:42:15 | 2016-06-30T11:42:15 | 2,637,060 | 4 | 0 | null | null | null | null | UTF-8 | C | false | false | 47 | h | void rfft(double x[], int N, Boolean forward);
| [
"k.s.matheussen@notam02.no"
] | k.s.matheussen@notam02.no |
b71a7fec955266926b6b6ea3dc42fbef585599cf | 04cdc91f88a137e2f7d470b0ef713d72f79f9d47 | /AI_Engine_Development/Feature_Tutorials/14-implementing-iir-filter/Part2b/src/C1_o.h | 17a61a242cb46b837d41af6ca8aa6380c25f0bbc | [
"MIT"
] | permissive | Xilinx/Vitis-Tutorials | 80b6945c88406d0669326bb13b222b5a44fcc0c7 | ab39b8482dcbd2264ccb9462910609e714f1d10d | refs/heads/2023.1 | 2023-09-05T11:59:43.272473 | 2023-08-21T16:43:31 | 2023-08-21T16:43:31 | 211,912,254 | 926 | 611 | MIT | 2023-08-03T03:20:33 | 2019-09-30T17:08:51 | C | UTF-8 | C | false | false | 2,650 | h | /*********************************************************************
Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: X11
**********************************************************************/
#ifndef __C1_O_H__
#define __C1_O_H__
// SIMD matrix of coefficients for IIR filter stage 1 (odd columns)
alignas(16) const float C1_o[48] = {
+6.13131088620048836368426e-01, // Ky0_ym1
+1.02858981128450030495536e-01, // Ky1_ym1
-1.04362127575774968346600e-01, // Ky2_ym1
-9.20754440846292404598827e-02, // Ky3_ym1
-2.79560727446042447952301e-02, // Ky4_ym1
+8.00237332214936633589808e-03, // Ky5_ym1
+1.25404896376569655741529e-02, // Ky6_ym1
+5.50374997287241853050066e-03, // Ky7_ym1
+3.26098387533559297413177e-01, // Ky0_xm1
+3.63084563198864618271955e-01, // Ky1_xm1
+1.33570502008116154257777e-01, // Ky2_xm1
-1.72515469379693024698508e-02, // Ky3_xm1
-4.70516570097175429454595e-02, // Ky4_xm1
-2.41379408105894567582173e-02, // Ky5_xm1
-1.95129062473438754168886e-03, // Ky6_xm1
+5.39496867263783257129273e-03, // Ky7_xm1
+0.00000000000000000000000e+00, // Ky0_x1
+1.63143503853170862560873e-01, // Ky1_x1
+4.26126741652343044020057e-01, // Ky2_x1
+3.79865337782927137144640e-01, // Ky3_x1
+1.16544498845832594779992e-01, // Ky4_x1
-3.22730575047724260739912e-02, // Ky5_x1
-5.16125086712464140048517e-02, // Ky6_x1
-2.28324055876728687630717e-02, // Ky7_x1
+0.00000000000000000000000e+00, // Ky0_x3
+0.00000000000000000000000e+00, // Ky1_x3
+0.00000000000000000000000e+00, // Ky2_x3
+1.63143503853170862560873e-01, // Ky3_x3
+4.26126741652343044020057e-01, // Ky4_x3
+3.79865337782927137144640e-01, // Ky5_x3
+1.16544498845832594779992e-01, // Ky6_x3
-3.22730575047724260739912e-02, // Ky7_x3
+0.00000000000000000000000e+00, // Ky0_x5
+0.00000000000000000000000e+00, // Ky1_x5
+0.00000000000000000000000e+00, // Ky2_x5
+0.00000000000000000000000e+00, // Ky3_x5
+0.00000000000000000000000e+00, // Ky4_x5
+1.63143503853170862560873e-01, // Ky5_x5
+4.26126741652343044020057e-01, // Ky6_x5
+3.79865337782927137144640e-01, // Ky7_x5
+0.00000000000000000000000e+00, // Ky0_x7
+0.00000000000000000000000e+00, // Ky1_x7
+0.00000000000000000000000e+00, // Ky2_x7
+0.00000000000000000000000e+00, // Ky3_x7
+0.00000000000000000000000e+00, // Ky4_x7
+0.00000000000000000000000e+00, // Ky5_x7
+0.00000000000000000000000e+00, // Ky6_x7
+1.63143503853170862560873e-01 // Ky7_x7
};
#endif // __C1_O_H__
| [
"do-not-reply@gitenterprise.xilinx.com"
] | do-not-reply@gitenterprise.xilinx.com |
e0dbe1703b0fc5c3a256b66652d9f62f32072fb0 | 2f8261bcfc6416b200309b5969a7a46e29edfc8c | /utils/perl/c/i686-w64-mingw32/include/dssec.h | 98d9a35356b20f66e30ff7109013347df97903ca | [
"LicenseRef-scancode-public-domain-disclaimer"
] | permissive | keenanlang/winepics | d0b385b93b8d7b099b95bf66c608637294da05fc | 5cae5bb9905889ad8694ece05b2b749904d7d39d | refs/heads/master | 2020-04-06T07:01:25.600675 | 2019-03-06T21:44:54 | 2019-03-06T21:44:54 | 42,735,349 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,121 | h | /**
* This file has no copyright assigned and is placed in the Public Domain.
* This file is part of the w64 mingw-runtime package.
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
*/
#ifndef _INC_DSSEC
#define _INC_DSSEC
#include <aclui.h>
#if (_WIN32_WINNT >= 0x0600)
#ifdef __cplusplus
extern "C" {
#endif
typedef HRESULT (WINAPI *PFNREADOBJECTSECURITY)(
LPCWSTR, // Active Directory path of object
SECURITY_INFORMATION, // the security information to read
PSECURITY_DESCRIPTOR*, // the returned security descriptor
LPARAM // context parameter
);
typedef HRESULT (WINAPI *PFNWRITEOBJECTSECURITY)(
LPCWSTR, // Active Directory path of object
SECURITY_INFORMATION, // the security information to write
PSECURITY_DESCRIPTOR, // the security descriptor to write
LPARAM // context parameter
);
#define DSSI_READ_ONLY 0x00000001
#define DSSI_NO_ACCESS_CHECK 0x00000002
#define DSSI_NO_EDIT_SACL 0x00000004
#define DSSI_NO_EDIT_OWNER 0x00000008
#define DSSI_IS_ROOT 0x00000010
#define DSSI_NO_FILTER 0x00000020
#define DSSI_NO_READONLY_MESSAGE 0x00000040
HRESULT WINAPI DSCreateISecurityInfoObject(
LPCWSTR pwszObjectPath,
LPCWSTR pwszObjectClass,
DWORD dwFlags,
LPSECURITYINFO *ppSI,
PFNREADOBJECTSECURITY pfnReadSD,
PFNWRITEOBJECTSECURITY pfnWriteSD,
LPARAM lpContext
);
HRESULT WINAPI DSCreateISecurityInfoObjectEx(
LPCWSTR pwszObjectPath,
LPCWSTR pwszObjectClass,
LPCWSTR pwszServer,
LPCWSTR pwszUserName,
LPCWSTR pwszPassword,
DWORD dwFlags,
LPSECURITYINFO *ppSI,
PFNREADOBJECTSECURITY pfnReadSD,
PFNWRITEOBJECTSECURITY pfnWriteSD,
LPARAM lpContext
);
HRESULT WINAPI DSEditSecurity(
HWND hwndOwner,
LPCWSTR pwszObjectPath,
LPCWSTR pwszObjectClass,
DWORD dwFlags,
LPCWSTR *pwszCaption,
PFNREADOBJECTSECURITY pfnReadSD,
PFNWRITEOBJECTSECURITY pfnWriteSD,
LPARAM lpContext
);
#ifdef __cplusplus
}
#endif
#endif /*(_WIN32_WINNT >= 0x0600)*/
#endif /*_INC_DSSEC*/
| [
"klang@aps.anl.gov"
] | klang@aps.anl.gov |
613cab655fb15a4f95159c991ad819b3894ab83c | 54198d20656219e657a14bd1987c7088a6a36692 | /app/xeyes/EyesP.h | 159d7f32831535ff25d0902c5b1d7407ea80400b | [
"X11"
] | permissive | bitrig/bitrig-xenocara | 4c288d36a512c88aa6e98637a7001522ae2262fc | 689a1c2f5e4b05ee6d5fed4b4cd398186e3d95a7 | refs/heads/master | 2020-12-24T17:36:23.163790 | 2016-11-28T03:12:12 | 2016-11-28T19:05:31 | 4,652,376 | 11 | 8 | null | null | null | null | UTF-8 | C | false | false | 1,284 | h |
#ifndef _EyesP_h
#define _EyesP_h
#include "Eyes.h"
#include <X11/CoreP.h>
#ifdef XRENDER
#include <X11/extensions/Xrender.h>
#endif
#include "transform.h"
#define SEG_BUFF_SIZE 128
/* New fields for the eyes widget instance record */
typedef struct {
Pixel pixel[PART_SHAPE];
GC gc[PART_MAX];
/* start of graph stuff */
int backing_store; /* backing store variety */
Boolean reverse_video; /* swap fg and bg pixels */
Boolean shape_window; /* use SetWindowShapeMask */
int update; /* current timeout index */
TPoint mouse; /* old mouse position */
TPoint pupil[2]; /* pupil position */
Transform t;
Transform maskt;
XtIntervalId interval_id;
Pixmap shape_mask; /* window shape */
#ifdef XRENDER
Boolean render;
Picture picture;
Picture fill[PART_SHAPE];
#endif
Boolean distance;
} EyesPart;
/* Full instance record declaration */
typedef struct _EyesRec {
CorePart core;
EyesPart eyes;
} EyesRec;
/* New fields for the Eyes widget class record */
typedef struct {int dummy;} EyesClassPart;
/* Full class record declaration. */
typedef struct _EyesClassRec {
CoreClassPart core_class;
EyesClassPart eyes_class;
} EyesClassRec;
/* Class pointer. */
extern EyesClassRec eyesClassRec;
#endif /* _EyesP_h */
| [
"matthieu@cvs.openbsd.org"
] | matthieu@cvs.openbsd.org |
e9027d59caadfbb11b0f02e1d4e94240e52a0f63 | fabed1d4c6dc789ce92932fa5275842bd13b37f2 | /src/ft_lstadd.c | 005475ae433b5c1f00b3880d31e1f9d090e58160 | [] | no_license | osokinvo/libft | 0b9d1fdf3690196037ec980b3341f4b6b2eed403 | e38cccdcfc26800d37989016357ca22770030848 | refs/heads/master | 2022-12-06T18:40:52.368142 | 2020-09-02T03:04:02 | 2020-09-02T03:04:02 | 292,161,287 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,064 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstadd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ghusk <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/09/22 11:43:39 by ghusk #+# #+# */
/* Updated: 2019/11/03 18:51:18 by ghusk ### ########.fr */
/* */
/* ************************************************************************** */
#include "list.h"
void ft_lstadd(t_list **alst, t_list *new)
{
t_list *tmp;
if (alst == NULL || new == NULL)
return ;
tmp = *alst;
*alst = new;
new->next = tmp;
}
| [
"ghusk@mi-j3.msk.21-school.ru"
] | ghusk@mi-j3.msk.21-school.ru |
969ef33d2eda245eaa6710397c4984f3a9b44321 | f35759399c46ad912e1477d7cfc7e37a3480448e | /yatk/db/yadb.h | e24440a651087b1b03a3ce65a6b3e8a8220b0172 | [] | no_license | blabos-zz/Random-Head | 32ae40414d9a525aac2489b60bbae13f598c0c1f | 5f2998ce4681044e23b4347f0b90e6bd402210ff | refs/heads/master | 2022-01-26T08:35:21.174444 | 2009-10-29T01:35:05 | 2009-10-29T01:35:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 352 | h | /*
* yadb.h
*
* Created on: Oct 17, 2009
* Author: blabos
*/
#ifndef YADB_H_
#define YADB_H_
#include "pub_types.h"
void yadb_start(char*);
int yadb_load();
int yadb_save();
void yadb_dump();
int yadb_insert(char*, char*);
int yadb_update(char*, char*);
int yadb_delete(char*);
int yadb_select(char*, record_t*);
#endif /* YADB_H_ */
| [
"blabos@blabos.org"
] | blabos@blabos.org |
d0df1c37c1c073a23f202a5de84df0bea787254a | d6ccf5d88d33e22963cf3cc1332f50b7abf3311c | /Aulas/Aula 5/Material - Aula5/tarefa/RX_RS232_BLOCKs/isim/RX_RS232_MAIN_TB_isim_beh.exe.sim/work/a_1098371318_3212880686.c | 5969420121f3004910b0752c6c85aa8fd9fcb827 | [] | no_license | Tungstenio/Curso-VHDL-PUC-Rio-2016.1 | 3e88c260dc687dd678a49b9b4b5bcbf97ac0cba4 | c1cd19f0757a2f10334ffbfa7fb0454ab7c0574f | refs/heads/master | 2021-01-18T21:37:29.623523 | 2016-06-09T15:51:10 | 2016-06-09T15:51:10 | 54,128,644 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 4,579 | c | /**********************************************************************/
/* ____ ____ */
/* / /\/ / */
/* /___/ \ / */
/* \ \ \/ */
/* \ \ Copyright (c) 2003-2009 Xilinx, Inc. */
/* / / All Right Reserved. */
/* /---/ /\ */
/* \ \ / \ */
/* \___\/\___\ */
/***********************************************************************/
/* This file is designed for use with ISim build 0x7708f090 */
#define XSI_HIDE_SYMBOL_SPEC true
#include "xsi.h"
#include <memory.h>
#ifdef __GNUC__
#include <stdlib.h>
#else
#include <malloc.h>
#define alloca _alloca
#endif
static const char *ng0 = "C:/Users/Opto2/Dropbox/Curso de Extensao VHDL/Aulas/Aula5/tarefa/RX_RS232_BLOCKs/ShiftRegisterSP.vhd";
extern char *IEEE_P_2592010699;
static void work_a_1098371318_3212880686_p_0(char *t0)
{
char t21[16];
char t23[16];
unsigned char t1;
char *t2;
unsigned char t3;
char *t4;
char *t5;
unsigned char t6;
unsigned char t7;
char *t8;
unsigned char t9;
unsigned char t10;
char *t11;
unsigned char t12;
unsigned char t13;
char *t14;
unsigned char t15;
char *t16;
unsigned int t17;
unsigned int t18;
unsigned int t19;
char *t20;
char *t22;
char *t24;
char *t25;
int t26;
unsigned int t27;
unsigned char t28;
char *t29;
char *t30;
char *t31;
char *t32;
LAB0: xsi_set_current_line(32, ng0);
t2 = (t0 + 992U);
t3 = xsi_signal_has_event(t2);
if (t3 == 1)
goto LAB5;
LAB6: t1 = (unsigned char)0;
LAB7: if (t1 != 0)
goto LAB2;
LAB4:
LAB3: t2 = (t0 + 3560);
*((int *)t2) = 1;
LAB1: return;
LAB2: xsi_set_current_line(33, ng0);
t4 = (t0 + 1352U);
t8 = *((char **)t4);
t9 = *((unsigned char *)t8);
t10 = (t9 == (unsigned char)3);
if (t10 != 0)
goto LAB8;
LAB10:
LAB9: goto LAB3;
LAB5: t4 = (t0 + 1032U);
t5 = *((char **)t4);
t6 = *((unsigned char *)t5);
t7 = (t6 == (unsigned char)3);
t1 = t7;
goto LAB7;
LAB8: xsi_set_current_line(34, ng0);
t4 = (t0 + 1192U);
t11 = *((char **)t4);
t12 = *((unsigned char *)t11);
t13 = (t12 == (unsigned char)3);
if (t13 != 0)
goto LAB11;
LAB13:
LAB12: goto LAB9;
LAB11: xsi_set_current_line(35, ng0);
t4 = (t0 + 1512U);
t14 = *((char **)t4);
t15 = *((unsigned char *)t14);
t4 = (t0 + 1832U);
t16 = *((char **)t4);
t17 = (7 - 7);
t18 = (t17 * 1U);
t19 = (0 + t18);
t4 = (t16 + t19);
t22 = ((IEEE_P_2592010699) + 4024);
t24 = (t23 + 0U);
t25 = (t24 + 0U);
*((int *)t25) = 7;
t25 = (t24 + 4U);
*((int *)t25) = 1;
t25 = (t24 + 8U);
*((int *)t25) = -1;
t26 = (1 - 7);
t27 = (t26 * -1);
t27 = (t27 + 1);
t25 = (t24 + 12U);
*((unsigned int *)t25) = t27;
t20 = xsi_base_array_concat(t20, t21, t22, (char)99, t15, (char)97, t4, t23, (char)101);
t27 = (1U + 7U);
t28 = (8U != t27);
if (t28 == 1)
goto LAB14;
LAB15: t25 = (t0 + 3656);
t29 = (t25 + 56U);
t30 = *((char **)t29);
t31 = (t30 + 56U);
t32 = *((char **)t31);
memcpy(t32, t20, 8U);
xsi_driver_first_trans_fast(t25);
goto LAB12;
LAB14: xsi_size_not_matching(8U, t27, 0);
goto LAB15;
}
static void work_a_1098371318_3212880686_p_1(char *t0)
{
char *t1;
char *t2;
char *t3;
char *t4;
char *t5;
char *t6;
char *t7;
LAB0: xsi_set_current_line(41, ng0);
LAB3: t1 = (t0 + 1832U);
t2 = *((char **)t1);
t1 = (t0 + 3720);
t3 = (t1 + 56U);
t4 = *((char **)t3);
t5 = (t4 + 56U);
t6 = *((char **)t5);
memcpy(t6, t2, 8U);
xsi_driver_first_trans_fast_port(t1);
LAB2: t7 = (t0 + 3576);
*((int *)t7) = 1;
LAB1: return;
LAB4: goto LAB2;
}
extern void work_a_1098371318_3212880686_init()
{
static char *pe[] = {(void *)work_a_1098371318_3212880686_p_0,(void *)work_a_1098371318_3212880686_p_1};
xsi_register_didat("work_a_1098371318_3212880686", "isim/RX_RS232_MAIN_TB_isim_beh.exe.sim/work/a_1098371318_3212880686.didat");
xsi_register_executes(pe);
}
| [
"gustavo@opto.cetuc.puc-rio.br"
] | gustavo@opto.cetuc.puc-rio.br |
a38edddacdfba7a5d473d451c397a54c492911a2 | 89dbd1e28a59f803e46ed8b796b0d5539436d097 | /app/x11perf/do_blt.c | 4051df52cd34221e587bd2cb642c6216d5156b12 | [
"LicenseRef-scancode-other-permissive",
"HPND"
] | permissive | toddfries/OpenBSD-xenocara-patches | 880f9229fb0caaa99dd82115546989895c74c2de | 96830f4f19cf4ed5cfc1ac3ce40d257545804ade | refs/heads/master | 2020-06-02T17:34:20.126325 | 2014-05-06T12:15:19 | 2014-05-06T12:15:19 | 2,886,545 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 17,604 | c | /*****************************************************************************
Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************************/
#include "x11perf.h"
#include <stdio.h>
#define NUMPOINTS 100
static Pixmap pix;
static XImage *image;
static XPoint points[NUMPOINTS];
static XSegment *segsa, *segsb;
#define NegMod(x, y) ((y) - (((-x)-1) % (7)) - 1)
static void
InitBltLines(void)
{
int i, x, y;
points[0].x = points[0].y = y = 0;
for (i = 1; i != NUMPOINTS/2; i++) {
if (i & 1) {
points[i].x = WIDTH-1;
} else {
points[i].x = 0;
}
y += HEIGHT / (NUMPOINTS/2);
points[i].y = y;
}
x = 0;
for (i = NUMPOINTS/2; i!= NUMPOINTS; i++) {
if (i & 1) {
points[i].y = HEIGHT-1;
} else {
points[i].y = 0;
}
x += WIDTH / (NUMPOINTS/2);
points[i].x = x;
}
}
int
InitScroll(XParms xp, Parms p, int reps)
{
InitBltLines();
XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin);
return reps;
}
void
DoScroll(XParms xp, Parms p, int reps)
{
int i, size, x, y, xorg, yorg, delta;
size = p->special;
xorg = 0; yorg = 0;
x = 0; y = 0;
if (xp->version == VERSION1_2) {
delta = 1;
} else {
/* Version 1.2 only scrolled up by 1 scanline, which made hardware
using page-mode access to VRAM look better on paper than it would
perform in a more realistic scroll. So we've changed to scroll by
the height of the 6x13 fonts. */
delta = 13;
}
for (i = 0; i != reps; i++) {
XCopyArea(xp->d, xp->w, xp->w, xp->fggc, x, y + delta,
size, size, x, y);
y += size;
if (y + size + delta > HEIGHT) {
yorg += delta;
if (yorg >= size || yorg + size + delta > HEIGHT) {
yorg = 0;
xorg++;
if (xorg >= size || xorg + size > WIDTH) {
xorg = 0;
}
}
y = yorg;
x += size;
if (x + size > WIDTH) {
x = xorg;
}
}
CheckAbort ();
}
}
void
MidScroll(XParms xp, Parms p)
{
XClearWindow(xp->d, xp->w);
XDrawLines(xp->d, xp->w, xp->fggc, points, NUMPOINTS, CoordModeOrigin);
}
void
EndScroll(XParms xp, Parms p)
{
}
static void
InitCopyLocations(XParms xp, Parms p, int reps)
{
int x1, y1, x2, y2, size, i;
int xinc, yinc;
int width, height;
/* Try to exercise all alignments of src and destination equally, as well
as all 4 top-to-bottom/bottom-to-top, left-to-right, right-to-left
copying directions. Computation done here just to make sure slow
machines aren't measuring anything but the XCopyArea calls.
*/
size = p->special;
xinc = (size & ~3) + 1;
yinc = xinc + 3;
width = (WIDTH - size) & ~31;
height = (HEIGHT - size) & ~31;
x1 = 0;
y1 = 0;
x2 = width;
y2 = height;
segsa = (XSegment *)malloc(reps * sizeof(XSegment));
segsb = (XSegment *)malloc(reps * sizeof(XSegment));
for (i = 0; i != reps; i++) {
segsa[i].x1 = x1;
segsa[i].y1 = y1;
segsa[i].x2 = x2;
segsa[i].y2 = y2;
/* Move x2, y2, location backward */
x2 -= xinc;
if (x2 < 0) {
x2 = NegMod(x2, width);
y2 -= yinc;
if (y2 < 0) {
y2 = NegMod(y2, height);
}
}
segsb[i].x1 = x1;
segsb[i].y1 = y1;
segsb[i].x2 = x2;
segsb[i].y2 = y2;
/* Move x1, y1 location forward */
x1 += xinc;
if (x1 > width) {
x1 %= 32;
y1 += yinc;
if (y1 > height) {
y1 %= 32;
}
}
} /* end for */
}
int
InitCopyWin(XParms xp, Parms p, int reps)
{
(void) InitScroll(xp, p, reps);
InitCopyLocations(xp, p, reps);
return reps;
}
int
InitCopyPix(XParms xp, Parms p, int reps)
{
GC pixgc;
(void) InitCopyWin(xp, p, reps);
/* Create pixmap to write stuff into, and initialize it */
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, xp->vinfo.depth);
pixgc = XCreateGC(xp->d, pix, 0, NULL);
/* need a gc with GXcopy cos pixmaps contain junk on creation. mmm */
XCopyArea(xp->d, xp->w, pix, pixgc, 0, 0, WIDTH, HEIGHT, 0, 0);
XFreeGC(xp->d, pixgc);
return reps;
}
int
InitGetImage(XParms xp, Parms p, int reps)
{
(void) InitCopyWin(xp, p, reps);
/* Create image to stuff bits into */
image = XGetImage(xp->d, xp->w, 0, 0, WIDTH, HEIGHT, xp->planemask,
p->font==NULL?ZPixmap:XYPixmap);
if(image==NULL){
printf("XGetImage failed\n");
return False;
}
return reps;
}
int
InitPutImage(XParms xp, Parms p, int reps)
{
if(!InitGetImage(xp, p, reps))return False;
XClearWindow(xp->d, xp->w);
return reps;
}
static void
CopyArea(XParms xp, Parms p, int reps, Drawable src, Drawable dst)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XCopyArea(xp->d, src, dst, xp->fggc,
sa->x1, sa->y1, size, size, sa->x2, sa->y2);
XCopyArea(xp->d, src, dst, xp->fggc,
sa->x2, sa->y2, size, size, sa->x1, sa->y1);
XCopyArea(xp->d, src, dst, xp->fggc,
sb->x2, sb->y2, size, size, sb->x1, sb->y1);
XCopyArea(xp->d, src, dst, xp->fggc,
sb->x1, sb->y1, size, size, sb->x2, sb->y2);
CheckAbort ();
}
}
void
DoCopyWinWin(XParms xp, Parms p, int reps)
{
CopyArea(xp, p, reps, xp->w, xp->w);
}
void
DoCopyPixWin(XParms xp, Parms p, int reps)
{
CopyArea(xp, p, reps, pix, xp->w);
}
void
DoCopyWinPix(XParms xp, Parms p, int reps)
{
CopyArea(xp, p, reps, xp->w, pix);
xp->p = pix; /* HardwareSync will now sync on pixmap */
}
void
DoCopyPixPix(XParms xp, Parms p, int reps)
{
CopyArea(xp, p, reps, pix, pix);
xp->p = pix; /* HardwareSync will now sync on pixmap */
}
void
DoGetImage(XParms xp, Parms p, int reps)
{
int i, size;
XSegment *sa, *sb;
int format;
size = p->special;
format = (p->font == NULL) ? ZPixmap : XYPixmap;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XDestroyImage(image);
image = XGetImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
xp->planemask, format);
if (image) XDestroyImage(image);
image = XGetImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
xp->planemask, format);
if (image) XDestroyImage(image);
image = XGetImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
xp->planemask, format);
if (image) XDestroyImage(image);
image = XGetImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
xp->planemask, format);
/*
One might expect XGetSubImage to be slightly faster than XGetImage. Go look
at the code in Xlib. MIT X11R3 ran approximately 30 times slower for a 500x500
rectangle.
(void) XGetSubImage(xp->d, xp->w, sa->x1, sa->y1, size, size,
xp->planemask, ZPixmap, image, sa->x2, sa->y2);
(void) XGetSubImage(xp->d, xp->w, sa->x2, sa->y2, size, size,
xp->planemask, ZPixmap, image, sa->x1, sa->y1);
(void) XGetSubImage(xp->d, xp->w, sb->x2, sb->y2, size, size,
xp->planemask, ZPixmap, image, sb->x2, sb->y2);
(void) XGetSubImage(xp->d, xp->w, sb->x1, sb->y1, size, size,
xp->planemask, ZPixmap, image, sb->x2, sb->y2);
*/
CheckAbort ();
}
}
void
DoPutImage(XParms xp, Parms p, int reps)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XPutImage(xp->d, xp->w, xp->fggc, image,
sa->x1, sa->y1, sa->x2, sa->y2, size, size);
XPutImage(xp->d, xp->w, xp->fggc, image,
sa->x2, sa->y2, sa->x1, sa->y1, size, size);
XPutImage(xp->d, xp->w, xp->fggc, image,
sb->x2, sb->y2, sb->x2, sb->y2, size, size);
XPutImage(xp->d, xp->w, xp->fggc, image,
sb->x1, sb->y1, sb->x2, sb->y2, size, size);
CheckAbort ();
}
}
#ifdef MITSHM
#include <sys/types.h>
#ifndef Lynx
#include <sys/ipc.h>
#include <sys/shm.h>
#else
#include <ipc.h>
#include <shm.h>
#endif
#include <X11/extensions/XShm.h>
static XImage shm_image;
static XShmSegmentInfo shm_info;
static int haderror;
static int (*origerrorhandler)(Display *, XErrorEvent *);
static int
shmerrorhandler(Display *d, XErrorEvent *e)
{
haderror++;
if(e->error_code==BadAccess) {
fprintf(stderr,"failed to attach shared memory\n");
return 0;
} else
return (*origerrorhandler)(d,e);
}
static int
InitShmImage(XParms xp, Parms p, int reps, Bool read_only)
{
int image_size;
if(!InitGetImage(xp, p, reps))return False;
if (!XShmQueryExtension(xp->d)) {
/*
* Clean up here because cleanup function is not called if this
* function fails
*/
if (image)
XDestroyImage(image);
image = NULL;
free(segsa);
free(segsb);
return False;
}
shm_image = *image;
image_size = image->bytes_per_line * image->height;
/* allow XYPixmap choice: */
if(p->font)image_size *= xp->vinfo.depth;
shm_info.shmid = shmget(IPC_PRIVATE, image_size, IPC_CREAT|0700);
if (shm_info.shmid < 0)
{
/*
* Clean up here because cleanup function is not called if this
* function fails
*/
if (image)
XDestroyImage(image);
image = NULL;
free(segsa);
free(segsb);
perror ("shmget");
return False;
}
shm_info.shmaddr = (char *) shmat(shm_info.shmid, NULL, 0);
if (shm_info.shmaddr == ((char *) -1))
{
/*
* Clean up here because cleanup function is not called if this
* function fails
*/
if (image)
XDestroyImage(image);
image = NULL;
free(segsa);
free(segsb);
perror ("shmat");
shmctl (shm_info.shmid, IPC_RMID, NULL);
return False;
}
shm_info.readOnly = read_only;
XSync(xp->d,True);
haderror = False;
origerrorhandler = XSetErrorHandler(shmerrorhandler);
XShmAttach (xp->d, &shm_info);
XSync(xp->d,True); /* wait for error or ok */
XSetErrorHandler(origerrorhandler);
if(haderror){
/*
* Clean up here because cleanup function is not called if this
* function fails
*/
if (image)
XDestroyImage(image);
image = NULL;
free(segsa);
free(segsb);
if(shmdt (shm_info.shmaddr)==-1)
perror("shmdt:");
if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
perror("shmctl rmid:");
return False;
}
shm_image.data = shm_info.shmaddr;
memmove( shm_image.data, image->data, image_size);
shm_image.obdata = (char *) &shm_info;
return reps;
}
int
InitShmPutImage(XParms xp, Parms p, int reps)
{
if (!InitShmImage(xp, p, reps, True)) return False;
XClearWindow(xp->d, xp->w);
return reps;
}
int
InitShmGetImage(XParms xp, Parms p, int reps)
{
return InitShmImage(xp, p, reps, False);
}
void
DoShmPutImage(XParms xp, Parms p, int reps)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
sa->x1, sa->y1, sa->x2, sa->y2, size, size, False);
XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
sa->x2, sa->y2, sa->x1, sa->y1, size, size, False);
XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
sb->x2, sb->y2, sb->x2, sb->y2, size, size, False);
XShmPutImage(xp->d, xp->w, xp->fggc, &shm_image,
sb->x1, sb->y1, sb->x2, sb->y2, size, size, False);
CheckAbort ();
}
}
void
DoShmGetImage(XParms xp, Parms p, int reps)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
shm_image.width = size;
shm_image.height = size;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
/* compute offsets into image data? */
XShmGetImage(xp->d, xp->w, &shm_image, sa->x1, sa->y1, xp->planemask);
XShmGetImage(xp->d, xp->w, &shm_image, sa->x2, sa->y2, xp->planemask);
XShmGetImage(xp->d, xp->w, &shm_image, sb->x2, sb->y2, xp->planemask);
XShmGetImage(xp->d, xp->w, &shm_image, sb->x1, sb->y1, xp->planemask);
CheckAbort ();
}
}
static void
EndShmImage(XParms xp, Parms p)
{
EndGetImage (xp, p);
XShmDetach (xp->d, &shm_info);
XSync(xp->d, False); /* need server to detach so can remove id */
if(shmdt (shm_info.shmaddr)==-1)
perror("shmdt:");
if(shmctl (shm_info.shmid, IPC_RMID, NULL)==-1)
perror("shmctl rmid:");
}
void
EndShmGetImage(XParms xp, Parms p)
{
EndShmImage(xp, p);
}
void
EndShmPutImage(XParms xp, Parms p)
{
EndShmImage(xp, p);
}
#endif
void
MidCopyPix(XParms xp, Parms p)
{
XClearWindow(xp->d, xp->w);
}
void
EndCopyWin(XParms xp, Parms p)
{
EndScroll(xp, p);
free(segsa);
free(segsb);
}
void
EndCopyPix(XParms xp, Parms p)
{
EndCopyWin(xp, p);
XFreePixmap(xp->d, pix);
/*
* Ensure that the next test doesn't try and sync on the pixmap
*/
xp->p = (Pixmap)0;
}
void
EndGetImage(XParms xp, Parms p)
{
EndCopyWin(xp, p);
if (image) XDestroyImage(image);
}
int
InitCopyPlane(XParms xp, Parms p, int reps)
{
XGCValues gcv;
GC pixgc;
InitBltLines();
InitCopyLocations(xp, p, reps);
/* Create pixmap to write stuff into, and initialize it */
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT,
p->font==NULL ? 1 : xp->vinfo.depth);
gcv.graphics_exposures = False;
gcv.foreground = 0;
gcv.background = 1;
pixgc = XCreateGC(xp->d, pix,
GCForeground | GCBackground | GCGraphicsExposures, &gcv);
XFillRectangle(xp->d, pix, pixgc, 0, 0, WIDTH, HEIGHT);
gcv.foreground = 1;
gcv.background = 0;
XChangeGC(xp->d, pixgc, GCForeground | GCBackground, &gcv);
XDrawLines(xp->d, pix, pixgc, points, NUMPOINTS, CoordModeOrigin);
XFreeGC(xp->d, pixgc);
return reps;
}
void
DoCopyPlane(XParms xp, Parms p, int reps)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XCopyPlane(xp->d, pix, xp->w, xp->fggc,
sa->x1, sa->y1, size, size, sa->x2, sa->y2, 1);
XCopyPlane(xp->d, pix, xp->w, xp->fggc,
sa->x2, sa->y2, size, size, sa->x1, sa->y1, 1);
XCopyPlane(xp->d, pix, xp->w, xp->fggc,
sb->x2, sb->y2, size, size, sb->x1, sb->y1, 1);
XCopyPlane(xp->d, pix, xp->w, xp->fggc,
sb->x1, sb->y1, size, size, sb->x2, sb->y2, 1);
CheckAbort ();
}
}
#include <X11/extensions/Xrender.h>
static Picture winPict, pixPict;
int
InitCompositeWin(XParms xp, Parms p, int reps)
{
XRenderPictFormat *format;
(void) InitScroll (xp, p, reps);
InitCopyLocations (xp, p, reps);
format = XRenderFindVisualFormat (xp->d, xp->vinfo.visual);
winPict = XRenderCreatePicture (xp->d, xp->w, format, 0, NULL);
return reps;
}
int
InitCompositePix(XParms xp, Parms p, int reps)
{
XRenderPictFormat *format = NULL;
int depth;
(void) InitCompositeWin (xp, p, reps);
/* Create pixmap to write stuff into, and initialize it */
switch (xp->planemask) {
case PictStandardNative:
depth = xp->vinfo.depth;
format = XRenderFindVisualFormat (xp->d, xp->vinfo.visual);
break;
case PictStandardRGB24:
depth = 24;
break;
case PictStandardARGB32:
depth = 32;
break;
case PictStandardA8:
depth = 8;
break;
case PictStandardA4:
depth = 4;
break;
case PictStandardA1:
depth = 1;
break;
default:
depth = 0;
break;
}
if (!format)
format = XRenderFindStandardFormat (xp->d, xp->planemask);
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, depth);
pixPict = XRenderCreatePicture (xp->d, pix, format, 0, NULL);
XRenderComposite (xp->d, PictOpClear,
winPict, None, pixPict,
0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
#if 1
XRenderComposite (xp->d, PictOpOver,
winPict, None, pixPict,
0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
#endif
return reps;
}
void
EndCompositeWin (XParms xp, Parms p)
{
if (winPict)
{
XRenderFreePicture (xp->d, winPict);
winPict = None;
}
if (pixPict)
{
XRenderFreePicture (xp->d, pixPict);
pixPict = None;
}
}
static void
CompositeArea(XParms xp, Parms p, int reps, Picture src, Picture dst)
{
int i, size;
XSegment *sa, *sb;
size = p->special;
for (sa = segsa, sb = segsb, i = 0; i != reps; i++, sa++, sb++) {
XRenderComposite (xp->d, xp->func,
src, None, dst,
sa->x1, sa->y1, 0, 0,
sa->x2, sa->y2, size, size);
XRenderComposite (xp->d, xp->func,
src, None, dst,
sa->x2, sa->y2, 0, 0, sa->x1, sa->y1, size, size);
XRenderComposite (xp->d, xp->func,
src, None, dst,
sb->x2, sb->y2, 0, 0, sb->x1, sb->y1, size, size);
XRenderComposite (xp->d, xp->func,
src, None, dst,
sb->x1, sb->y1, 0, 0, sb->x2, sb->y2, size, size);
CheckAbort ();
}
}
void
DoCompositeWinWin (XParms xp, Parms p, int reps)
{
CompositeArea (xp, p, reps, winPict, winPict);
}
void
DoCompositePixWin (XParms xp, Parms p, int reps)
{
CompositeArea (xp, p, reps, pixPict, winPict);
}
| [
"todd@fries.net"
] | todd@fries.net |
cd2570c97c2c156a5de99f2e6fcc0394b396ccd5 | 8464296408854cafdcd353544734744a9a59cbcb | /Ex02:process-communication/fork1.c | 53052ed20fcb96d7782c9505665bd2c7075980a5 | [] | no_license | NICKADANS/BUPT-OS-Experiment | 36ba766fa57010228b462e7429a6686e5485bbbd | d9cdd54781ee713c8c5675f2725a525f78a4ca6d | refs/heads/master | 2020-09-05T21:26:42.969488 | 2019-11-15T00:30:47 | 2019-11-15T00:30:47 | 220,218,797 | 2 | 0 | null | null | null | null | UTF-8 | C | false | false | 714 | c | #include <unistd.h>
#include <stdio.h>
#include <wait.h>
#include <stdlib.h>
int main(int argc, char *argv[]){
pid_t fpid = fork();
int num = atoi(argv[1]);
if(fpid < 0 || num == 0){
printf("Error!\n");
return 0;
}
if(fpid == 0){ //子进程
printf("I'm child!\n");
while(num != 1){
printf("%d ", num);
if(num % 2 == 0){
num/=2;
}
else{
num = 3 * num + 1;
}
}
printf("%d\n", num);
printf("child is over!");
}
else{ //父进程
printf("Father is waiting!\n");
wait(NULL);
printf("Bye!\n");
}
return 0;
}
| [
"noreply@github.com"
] | NICKADANS.noreply@github.com |
67b63debf843664c1f6184b6a76bc801685336d7 | cc4b82165da1b2915bdae04bb4dcb36a3d75a4da | /libft/srcs/is/ft_tolower.c | 7e2425298b4fff16743825fbc645c780666153e7 | [] | no_license | vzezzos/TEST_printf | 64014e4a1fff402395db2d0ef89b9cb4b46b03aa | 689be536849248ee95d80f80a2813a9ef91458cd | refs/heads/master | 2021-05-16T08:04:12.822328 | 2017-10-17T17:46:26 | 2017-10-17T17:46:26 | 103,964,875 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 979 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_tolower.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vzezzos <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/13 13:52:43 by vzezzos #+# #+# */
/* Updated: 2017/04/13 14:28:38 by vzezzos ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_tolower(int c)
{
return (ft_isupper(c) ? c += 32 : c);
}
| [
"vicky@Vicky-PC.localdomain"
] | vicky@Vicky-PC.localdomain |
d9f0cb5a53b28c3f21997fa2d8bd11b3463210cb | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/9d91afa4-9f91-4341-9046-af00a26f7731.c | 6cd2d64f127e8ad4cb54c749e13def77680220c2 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 551 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=4;
int j=14;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i%j;
l = l+j;
j = k-k*k;
//variables
/* START VULNERABILITY */
int a;
char b[15];
char c[43];
a = 0;
do {
//random
/* START BUFFER SET */
*((char *)c + a) = *((char *)b + a);
/* END BUFFER SET */
//random
a++;
} while(a < strlen(b));
/* END VULNERABILITY */
printf("%d\n",l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
9392e707aceb81761d872ab6a774674f887ebf27 | fb59dcedeb1aae73e92afebeb6cb2e51b13d5c22 | /net_manager/common/aesCrypto.h | ca181cd4297a68a14879b8795e85e6a70ce5230d | [] | no_license | qrsforever/yxstb | a04a7c7c814b7a5647f9528603bd0c5859406631 | 78bbbae07aa7513adc66d6f18ab04cd7c3ea30d5 | refs/heads/master | 2020-06-18T20:13:38.214225 | 2019-07-11T16:40:14 | 2019-07-11T16:40:14 | 196,431,357 | 0 | 1 | null | 2020-03-08T00:54:09 | 2019-07-11T16:38:29 | C | UTF-8 | C | false | false | 294 | h | #ifndef _aesCrypto_h_
#define _aesCrypto_h_
#ifdef __cplusplus
extern "C" {
#endif
void generateAESkey(unsigned char *key);
int decryptACSCiphertext(const char * input, char * output);
int encryptACSCiphertext(const char * input, char * output);
#ifdef __cplusplus
}
#endif
#endif
| [
"lidong8@le.com"
] | lidong8@le.com |
ad22ac008ebf375a6ced1f8afc8e1bb583f5b468 | 032f087d04d4483c3130fdd053a5c0cd959bf91b | /motif/transform_interface.c | f080fc2651b402b5195a75a7199d0fdf30b282a1 | [] | no_license | Teslos/Viewcasts | 10bb031b359270d0192753255da00b8cdfa9ba40 | 57660077322a1204b717e3e6119b7664921e918c | refs/heads/master | 2016-09-06T08:12:52.422281 | 2010-08-04T08:53:26 | 2010-08-04T08:53:26 | 816,521 | 0 | 4 | null | null | null | null | UTF-8 | C | false | false | 26,970 | c | /* ============================================================= */
/* COLOR3D - OpenGl-Version 0.1 */
/* ============================================================= */
/* */
/* Verfasser: Helmut Vor */
/* Datum : 26.08.96 */
/* Dateiname: transform_interface.c */
/* */
/* Routinenname | Funktion */
/* ------------------------------------------------------------- */
/* Createtransform_interface | */
/* XmForm1_helpCallback | */
/* PB_beenden4_activateCallback | */
/* PB_hilfe5_activateCallback | */
/* ------------------------------------------------------------- */
/* ============================================================= */
/* */
/* Includes : */
/* ========== */
#include <stdio.h>
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>
#include <Xm/Xm.h>
#ifndef _MOTIF_H_
#include "motif.h"
#define _MOTIF_H_
#endif /* _MOTIF_H_ */
#include "color3d.h"
/* */
/* globale Variable : */
/* ================== */
#define true True
#define false False
#include <Xm/Form.h>
#include <Xm/Label.h>
#include <Xm/LabelG.h>
#include <Xm/List.h>
#include <Xm/ArrowB.h>
#include <Xm/PushB.h>
#include <Xm/PushBG.h>
#include <Xm/RowColumn.h>
#include <Xm/Separator.h>
#include <Xm/SeparatoG.h>
#include <Xm/TextF.h>
#include <Xm/ToggleB.h>
#include <Xm/ToggleBG.h>
#include <Xm/ScrolledW.h>
#if !defined(XtSpecificationRelease) || XtSpecificationRelease <= 4
#include <X11/Quarks.h>
#else
extern XrmQuark XtQBool;
extern XrmQuark XtQBoolean;
extern XrmQuark XtQColor;
extern XrmQuark XtQCursor;
extern XrmQuark XtQDimension;
extern XrmQuark XtQDisplay;
extern XrmQuark XtQFile;
extern XrmQuark XtQFont;
extern XrmQuark XtQFontStruct;
extern XrmQuark XtQInt;
extern XrmQuark XtQPixel;
extern XrmQuark XtQPixmap;
extern XrmQuark XtQPointer;
extern XrmQuark XtQPosition;
extern XrmQuark XtQShort;
extern XrmQuark XtQString;
extern XrmQuark XtQUnsignedChar;
extern XrmQuark XtQWindow;
#endif
#undef XtMapWidget
#undef XtUnmapWidget
#define XtMapWidget(widget) XMapWindow(XtDisplay((Widget)(widget)), XtWindow((Widget)(widget)))
#define XtUnmapWidget(widget) XUnmapWindow(XtDisplay((Widget)(widget)), XtWindow((Widget)(widget)))
static Widget S_transform0, XmForm1, L_header2, PB_beenden4, PB_ok41,
PB_hilfe5, Separator06,
TB_zyklus7,
L_anz_zyk8, T_anz_zyk9, AB_anzahl_plus10, AB_anzahl_minus11,
L_winkel12, T_winkel13,
L_achse14, RC_zyklus15,
TB_achsex16, TB_achsey17, TB_achsez18,
Separator120,
TB_spiegeln21, L_spiegeln22,
RC_spiegeln23, TB_ebenexy24, TB_ebenexz25, TB_ebeneyz26,
Separator130,
TB_schneiden31, TB_schneiden_aus29, TB_def_plane,
TB_def_koord32, RC_punkte33,
Separator140, Separator27,
T_punkt1x41, T_punkt1y42, T_punkt1z43,
T_punkt2x44, T_punkt2y45, T_punkt2z46,
T_punkt3x47, T_punkt3y48, T_punkt3z49,
TB_def_nummer32, RC_nummer50, L_koord54,
T_punkt1nr51, T_punkt2nr52, T_punkt3nr53,
L_punkt161, L_punkt262, L_punkt363, L_nummer64, L_discutting,
LS_discutting, LS_discuttingSW, Separator170, TB_zentrieren71;
static float _vtof_(
#if NeedFunctionPrototypes
XtArgVal v)
#else
v)
XtArgVal v;
#endif
{
union { XtArgVal v; float f; } u;
u.v = v;
return(u.f);
}
static XtArgVal _ftov_(
#if NeedFunctionPrototypes
float f)
#else
f)
float f;
#endif
{
union { XtArgVal v; float f; } u;
u.f = f;
return(u.v);
}
#include <Xm/MenuShell.h>
#include <Xm/ScrolledW.h>
static void XmForm1_helpCallback(
#if NeedFunctionPrototypes
Widget widget, XtPointer client_data, XtPointer call_data)
#else
widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
#endif
{
XtCallCallbacks((Widget)PB_hilfe5, (String)"activateCallback", (XtPointer)0);
}
static void PB_beenden4_activateCallback(
#if NeedFunctionPrototypes
Widget widget, XtPointer client_data, XtPointer call_data)
#else
widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
#endif
{
XtPopdown((Widget)S_transform0);
}
static void PB_hilfe5_activateCallback(
#if NeedFunctionPrototypes
Widget widget, XtPointer client_data, XtPointer call_data)
#else
widget, client_data, call_data)
Widget widget;
XtPointer client_data;
XtPointer call_data;
#endif
{
help_handler((int)1020000);
}
Widget
Createtransform_interface(
#if NeedFunctionPrototypes
String name, Widget parent, Arg* user_args, Cardinal num_user_args)
#else
name, parent, user_args, num_user_args)
String name;
Widget parent;
Arg* user_args;
Cardinal num_user_args;
#endif
{
int i;
char temstr[10];
XmString *materials;
materials = (XmString*) malloc(g_geodat.nstoff*(sizeof(char)*10));
if(materials == NULL)
fprintf(stderr, "Error in allocation of cutting list\n");
S_transform0 = XtVaCreatePopupShell(
(name ? name : "S_transform"),
transientShellWidgetClass, parent,
"minWidth", 400, "minHeight", 450,
"x", 20, "y", 150,
(num_user_args > 0 ? user_args[0].name : (String)0),
(num_user_args > 0 ? user_args[0].value : 0),
(num_user_args > 1 ? user_args[1].name : (String)0),
(num_user_args > 1 ? user_args[1].value : 0),
(num_user_args > 2 ? user_args[2].name : (String)0),
(num_user_args > 2 ? user_args[2].value : 0),
(num_user_args > 3 ? user_args[3].name : (String)0),
(num_user_args > 3 ? user_args[3].value : 0),
(num_user_args > 4 ? user_args[4].name : (String)0),
(num_user_args > 4 ? user_args[4].value : 0),
0, 0);
if(num_user_args > 5)
printf("Warning:too many arguments (max is 5: use -coption 6 or 7)\n");
XmForm1 = XtVaCreateManagedWidget(
"XmForm", xmFormWidgetClass,
S_transform0,
"horizontalSpacing", 10,
"verticalSpacing", 10,
0, 0);
PB_beenden4 = XtVaCreateManagedWidget(
"PB_beenden", xmPushButtonGadgetClass,
XmForm1,
XmNleftAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_FORM,
0, 0);
PB_ok41 = XtVaCreateManagedWidget(
"PB_ok", xmPushButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", PB_beenden4,
"bottomAttachment", XmATTACH_FORM,
0, 0);
PB_hilfe5 = XtVaCreateManagedWidget(
"PB_hilfe", xmPushButtonGadgetClass,
XmForm1,
"bottomAttachment", XmATTACH_FORM,
"rightAttachment", XmATTACH_FORM,
0, 0);
/* Widgets fuer zyklische Darstellung --------------------------------- */
TB_zyklus7 = XtVaCreateManagedWidget(
"TB_zyklus", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_FORM,
XtVaTypedArg, "fontList",
XmRString, "*helvetica-bold-r-*-18-*", 25,
0, 0);
L_anz_zyk8 = XtVaCreateManagedWidget(
"L_anz_zyk", xmLabelGadgetClass,
XmForm1,
"topAttachment", XmATTACH_FORM,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_zyklus7,
0, 0);
T_anz_zyk9 = XtVaCreateManagedWidget(
"T_anz_zyk", xmTextFieldWidgetClass,
XmForm1,
XmNcolumns, 2,
XmNvalue, "2",
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", L_anz_zyk8,
"topAttachment", XmATTACH_FORM,
0, 0);
AB_anzahl_plus10 = XtVaCreateManagedWidget(
"AB_anzahl_plus", xmArrowButtonWidgetClass,
XmForm1,
XmNarrowDirection, XmARROW_UP,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", T_anz_zyk9,
"topAttachment", XmATTACH_FORM,
XmNheight, 20,
0, 0);
AB_anzahl_minus11 = XtVaCreateManagedWidget(
"AB_anzahl_minus", xmArrowButtonWidgetClass,
XmForm1,
XmNarrowDirection, XmARROW_DOWN,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", T_anz_zyk9,
"topAttachment", XmATTACH_WIDGET,
"topWidget", AB_anzahl_plus10,
"topOffset", 0,
XmNheight, 20,
0, 0);
L_winkel12 = XtVaCreateManagedWidget(
"L_winkel", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_zyklus7,
"topAttachment", XmATTACH_WIDGET,
"topWidget", T_anz_zyk9,
0, 0);
T_winkel13 = XtVaCreateManagedWidget(
"T_winkel", xmTextFieldWidgetClass,
XmForm1,
XmNcolumns, 5,
XmNvalue, "45.0",
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", L_anz_zyk8,
"topAttachment", XmATTACH_WIDGET,
"topWidget", T_anz_zyk9,
0, 0);
L_achse14 = XtVaCreateManagedWidget(
"L_achse", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_zyklus7,
"topAttachment", XmATTACH_WIDGET,
"topWidget", T_winkel13,
0, 0);
RC_zyklus15 = XtVaCreateManagedWidget(
"RC_zyklus", xmRowColumnWidgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", L_achse14,
"topAttachment", XmATTACH_WIDGET,
"topWidget", T_winkel13,
"radioBehavior", True,
"orientation", XmHORIZONTAL,
"packing", XmPACK_TIGHT,
"borderWidth", 2,
0, 0);
TB_achsex16 = XtVaCreateManagedWidget(
"TB_achsex", xmToggleButtonGadgetClass,
RC_zyklus15,
0, 0);
TB_achsey17 = XtVaCreateManagedWidget(
"TB_achsey", xmToggleButtonGadgetClass,
RC_zyklus15,
0, 0);
TB_achsez18 = XtVaCreateManagedWidget(
"TB_achsez", xmToggleButtonGadgetClass,
RC_zyklus15,
0, 0);
Separator120 = XtVaCreateManagedWidget(
"Separator1", xmSeparatorGadgetClass,
XmForm1,
"separatorType", XmSINGLE_LINE,
"leftAttachment", XmATTACH_FORM,
"rightAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget", RC_zyklus15,
0, 0);
/* Widgets fuer Spiegelung -------------------------------------- */
TB_spiegeln21 = XtVaCreateManagedWidget(
"TB_spiegeln", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget", Separator120,
XtVaTypedArg, "fontList",
XmRString, "*helvetica-bold-r-*-18-*", 25,
0, 0);
L_spiegeln22 = XtVaCreateManagedWidget(
"L_spiegeln", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_spiegeln21,
"topAttachment", XmATTACH_WIDGET,
"topWidget", Separator120,
"topOffset", 15,
0, 0);
RC_spiegeln23 = XtVaCreateManagedWidget(
"RC_spiegeln", xmRowColumnWidgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_spiegeln21,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_spiegeln22,
"radioBehavior", True,
"orientation", XmHORIZONTAL,
"packing", XmPACK_TIGHT,
"borderWidth", 2,
0, 0);
TB_ebenexy24 = XtVaCreateManagedWidget(
"TB_ebenexy", xmToggleButtonGadgetClass,
RC_spiegeln23,
0, 0);
TB_ebenexz25 = XtVaCreateManagedWidget(
"TB_ebenexz", xmToggleButtonGadgetClass,
RC_spiegeln23,
"leftOffset", 15,
0, 0);
TB_ebeneyz26 = XtVaCreateManagedWidget(
"TB_ebeneyz", xmToggleButtonGadgetClass,
RC_spiegeln23,
0, 0);
Separator27 = XtVaCreateManagedWidget(
"Separator1", xmSeparatorGadgetClass,
XmForm1,
"separatorType", XmSINGLE_LINE,
"leftAttachment", XmATTACH_FORM,
"rightAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget", TB_ebeneyz26,
0, 0);
/* Widgets fuer Schnitt -------------------------------------- */
/*
TB_schneiden31 = XtVaCreateManagedWidget(
"TB_schneiden", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget", Separator130,
XtVaTypedArg, "fontList",
XmRString, "*helvetica-bold-r-*-18-*", 25,
0, 0);
TB_schneiden_aus29 = XtVaCreateManagedWidget(
"TB_schneiden_aus", xmToggleButtonGadgetClass,
XmForm1,
"rightAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget", Separator130,
XtVaTypedArg, "fontList",
XmRString, "*helvetica-bold-r-*-18-*", 25,
0, 0);
TB_def_plane = XtVaCreateManagedWidget(
"TB_def_plane", xmToggleButtonGadgetClass,
XmForm1,
XmNleftAttachment, XmATTACH_FORM,
XmNleftOffset, 50,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, TB_schneiden31,
0, 0);
TB_def_koord32 = XtVaCreateManagedWidget(
"TB_def_koord", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"leftOffset", 50,
"topAttachment", XmATTACH_WIDGET,
"topWidget", TB_def_plane,
0, 0);
L_koord54 = XtVaCreateManagedWidget(
"L_koord", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"leftOffset", 100,
"topAttachment", XmATTACH_WIDGET,
"topWidget", TB_def_koord32,
0, 0);
L_punkt161 = XtVaCreateManagedWidget(
"L_punkt1", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_koord54,
"topOffset", 10,
0, 0);
L_punkt262 = XtVaCreateManagedWidget(
"L_punkt2", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_punkt161,
"topOffset", 10,
0, 0);
L_punkt363 = XtVaCreateManagedWidget(
"L_punkt3", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_punkt262,
"topOffset", 10,
0, 0);
RC_punkte33 = XtVaCreateManagedWidget(
"RC_punkte", xmRowColumnWidgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", L_punkt161,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_koord54,
"orientation", XmHORIZONTAL,
XmNpacking, XmPACK_COLUMN,
XmNnumColumns, 3,
"borderWidth", 2,
0, 0);
T_punkt1x41 = XtVaCreateManagedWidget(
"T_punkt1x", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt1y42 = XtVaCreateManagedWidget(
"T_punkt1y", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt1z43 = XtVaCreateManagedWidget(
"T_punkt1z", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt2x44 = XtVaCreateManagedWidget(
"T_punkt2x", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "1.0",
0, 0);
T_punkt2y45 = XtVaCreateManagedWidget(
"T_punkt2y", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt2z46 = XtVaCreateManagedWidget(
"T_punkt2z", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt3x47 = XtVaCreateManagedWidget(
"T_punkt3x", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt3y48 = XtVaCreateManagedWidget(
"T_punkt3y", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "0.0",
0, 0);
T_punkt3z49 = XtVaCreateManagedWidget(
"T_punkt3z", xmTextFieldWidgetClass,
RC_punkte33,
XmNcolumns, 5,
XmNvalue, "1.0",
0, 0);
TB_def_nummer32 = XtVaCreateManagedWidget(
"TB_def_nummer", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"leftOffset", 50,
"topAttachment", XmATTACH_WIDGET,
"topWidget", T_punkt3x47,
0, 0);
L_nummer64 = XtVaCreateManagedWidget(
"L_nummer", xmLabelGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"topAttachment", XmATTACH_WIDGET,
"topWidget", TB_def_nummer32,
0, 0);
RC_nummer50 = XtVaCreateManagedWidget(
"RC_nummer", xmRowColumnWidgetClass,
XmForm1,
"leftAttachment", XmATTACH_WIDGET,
"leftWidget", TB_schneiden31,
"topAttachment", XmATTACH_WIDGET,
"topWidget", L_nummer64,
"orientation", XmHORIZONTAL,
XmNpacking, XmPACK_COLUMN,
"borderWidth", 2,
0, 0);
T_punkt1nr51 = XtVaCreateManagedWidget(
"T_punkt1nr", xmTextFieldWidgetClass,
RC_nummer50,
XmNcolumns, 6,
0, 0);
T_punkt2nr52 = XtVaCreateManagedWidget(
"T_punkt2nr", xmTextFieldWidgetClass,
RC_nummer50,
XmNcolumns, 6,
0, 0);
T_punkt3nr53 = XtVaCreateManagedWidget(
"T_punkt3nr", xmTextFieldWidgetClass,
RC_nummer50,
XmNcolumns, 6,
0, 0);
L_discutting = XtVaCreateManagedWidget(
"L_dis_cutting", xmLabelGadgetClass,
XmForm1,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, TB_schneiden31,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, RC_nummer50,
NULL, 0);
for ( i = 1; i <= g_geodat.nstoff; i++)
{
sprintf(temstr, "%i", i);
materials[i-1] = XmStringCreateLtoR(temstr, XmFONTLIST_DEFAULT_TAG);
}
LS_discutting = XmCreateScrolledList(XmForm1,"LS_dis_cutting",NULL, 0);
XtVaSetValues(LS_discutting,
XmNselectionPolicy, XmBROWSE_SELECT,
XmNlistSizePolicy, XmVARIABLE,
XmNitems, materials,
XmNitemCount, g_geodat.nstoff,
XmNvisibleItemCount, 3,
NULL, 0);
*/
/* get resource from scrolled window */
/*
LS_discuttingSW = XtParent(LS_discutting);
XtVaSetValues(LS_discuttingSW,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, L_discutting,
XmNcolumns, 6,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, RC_nummer50,
NULL, 0);
XtManageChild(LS_discutting);
XtManageChild(LS_discuttingSW);
*/
/*Separator170 = XtVaCreateManagedWidget(
"Separator1", xmSeparatorGadgetClass,
XmForm1,
"separatorType", XmSINGLE_LINE,
"leftAttachment", XmATTACH_FORM,
"rightAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget",LS_discutting,
0, 0);*/
Separator06 = XtVaCreateManagedWidget(
"Separator0", xmSeparatorGadgetClass,
XmForm1,
XmNseparatorType, XmDOUBLE_LINE,
XmNleftAttachment, XmATTACH_FORM,
XmNrightAttachment, XmATTACH_FORM,
XmNbottomAttachment, XmATTACH_WIDGET,
XmNbottomWidget, PB_beenden4,
0, 0);
TB_zentrieren71 = XtVaCreateManagedWidget(
"TB_zentrieren", xmToggleButtonGadgetClass,
XmForm1,
"leftAttachment", XmATTACH_FORM,
"topAttachment", XmATTACH_WIDGET,
"topWidget",Separator27,
"bottomAttachment", XmATTACH_WIDGET,
"bottomWidget", Separator06,
0,0);
XtAddCallback(XmForm1, "helpCallback",
(XtCallbackProc)XmForm1_helpCallback, (XtPointer)0);
XtAddCallback(PB_beenden4, "activateCallback",
(XtCallbackProc)PB_beenden4_activateCallback, (XtPointer)0);
XtAddCallback(PB_beenden4, "activateCallback",
(XtCallbackProc)PB_beenden4_activateCallback, (XtPointer)0);
XtAddCallback(PB_hilfe5, "activateCallback",
(XtCallbackProc)PB_hilfe5_activateCallback, (XtPointer)0);
return(S_transform0);
}
| [
"toniivas@Toni-Ivass-MacBook-Pro.local"
] | toniivas@Toni-Ivass-MacBook-Pro.local |
5678b1aaeb1afdba034b7812152607d64b98eefa | 92cb58fc6a607097add993a4a2ad98588bfdf053 | /0x02-functions_nested_loops/8-24_hours.c | 384d12a28b39e45b1a1407b1afe288989a50a98e | [] | no_license | mirandarevans/holbertonschool-low_level_programming | 7c2679fb1146b1676f4410badba98389f12482fb | 55e7e808a355df8bab2425024d8567c3b0ee8d17 | refs/heads/master | 2021-05-02T17:37:37.677578 | 2018-08-14T19:20:29 | 2018-08-14T19:20:29 | 117,888,025 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 528 | c | #include "holberton.h"
/**
* jack_bauer - prints all minutes of the day
*
* Return: none
*/
void jack_bauer(void)
{
int i;
int j;
for (i = 0; i < 24; i++)
{
for (j = 0; j < 60; j++)
{
if (i < 10)
{
_putchar('0');
_putchar(i + '0');
}
else
{
_putchar(i / 10 + '0');
_putchar(i % 10 + '0');
}
_putchar(':');
if (j < 10)
{
_putchar('0');
_putchar(j + '0');
}
else
{
_putchar(j / 10 + '0');
_putchar(j % 10 + '0');
}
_putchar('\n');
}
}
}
| [
"miranda.r.evans@gmail.com"
] | miranda.r.evans@gmail.com |
77d2f92179fcdb6d1fd5b2d0df2a6602ba9789ac | 2395240ff999b5da641165b11abedc7384c26b93 | /Libraries/SWM181_StdPeriph_Driver/SWM181_can.h | 89a1c782369373aed41dc989bc8b8b612f6d362d | [] | no_license | ghsecuritylab/SWM181xB_RT_Thread | 11c7f20b1f045cb423c171d49bf75d205721c020 | 70706084c04315b540a49c7e8554f0b444c61e09 | refs/heads/master | 2021-02-28T18:32:34.248116 | 2019-01-24T08:52:39 | 2019-01-24T08:52:39 | 245,723,514 | 0 | 0 | null | 2020-03-07T23:50:00 | 2020-03-07T23:49:59 | null | GB18030 | C | false | false | 4,482 | h | #ifndef __SWM181_CAN_H__
#define __SWM181_CAN_H__
#define CAN_FRAME_STD 0
#define CAN_FRAME_EXT 1
typedef struct {
uint8_t Mode; //CAN_MODE_NORMAL、CAN_MODE_LISTEN、CAN_MODE_SELFTEST
uint8_t CAN_BS1; //CAN_BS1_1tq、CAN_BS1_2tq、... ... 、CAN_BS1_16tq
uint8_t CAN_BS2; //CAN_BS2_1tq、CAN_BS2_2tq、... ... 、CAN_BS2_8tq
uint8_t CAN_SJW; //CAN_SJW_1tq、CAN_SJW_2tq、CAN_SJW_3tq、CAN_SJW_4tq
uint32_t Baudrate; //波特率,即位传输速率,取值1--1000000
uint8_t FilterMode; //CAN_FILTER_16b、CAN_FILTER_32b
union {
uint32_t FilterMask32b; //FilterCheck & (~FilterMask) == ID & (~FilterMask)的Message通过过滤
struct { //0 must match 1 don't care
uint16_t FilterMask16b1;
uint16_t FilterMask16b2;
};
};
union {
uint32_t FilterCheck32b;
struct {
uint16_t FilterCheck16b1;
uint16_t FilterCheck16b2;
};
};
uint8_t RXNotEmptyIEn; //接收FIFO非空,有数据可读
uint8_t RXOverflowIEn; //接收FIFO溢出,有数据丢失
uint8_t ArbitrLostIEn; //控制器丢失仲裁变成接收方
uint8_t ErrPassiveIEn; //接收/发送错误计数值达到127
} CAN_InitStructure;
#define CAN_MODE_NORMAL 0 //常规模式
#define CAN_MODE_LISTEN 1 //监听模式
#define CAN_MODE_SELFTEST 2 //自测模式
#define CAN_BS1_1tq 0
#define CAN_BS1_2tq 1
#define CAN_BS1_3tq 2
#define CAN_BS1_4tq 3
#define CAN_BS1_5tq 4
#define CAN_BS1_6tq 5
#define CAN_BS1_7tq 6
#define CAN_BS1_8tq 7
#define CAN_BS1_9tq 8
#define CAN_BS1_10tq 9
#define CAN_BS1_11tq 10
#define CAN_BS1_12tq 11
#define CAN_BS1_13tq 12
#define CAN_BS1_14tq 13
#define CAN_BS1_15tq 14
#define CAN_BS1_16tq 15
#define CAN_BS2_1tq 0
#define CAN_BS2_2tq 1
#define CAN_BS2_3tq 2
#define CAN_BS2_4tq 3
#define CAN_BS2_5tq 4
#define CAN_BS2_6tq 5
#define CAN_BS2_7tq 6
#define CAN_BS2_8tq 7
#define CAN_SJW_1tq 0
#define CAN_SJW_2tq 1
#define CAN_SJW_3tq 2
#define CAN_SJW_4tq 3
#define CAN_FILTER_16b 0 //两个16位过滤器
#define CAN_FILTER_32b 1 //一个32位过滤器
typedef struct {
uint32_t id; //消息ID
uint8_t format; //帧格式:CAN_FRAME_STD、CAN_FRAME_EXT
uint8_t remote; //消息是否为远程帧
uint8_t size; //接收到的数据个数
uint8_t data[8]; //接收到的数据
} CAN_RXMessage;
void CAN_Init(CAN_TypeDef * CANx, CAN_InitStructure * initStruct);
void CAN_Open(CAN_TypeDef * CANx);
void CAN_Close(CAN_TypeDef * CANx);
void CAN_Transmit(CAN_TypeDef * CANx, uint32_t format, uint32_t id, uint8_t data[], uint32_t size, uint32_t once);
void CAN_TransmitRequest(CAN_TypeDef * CANx, uint32_t format, uint32_t id, uint32_t once);
void CAN_Receive(CAN_TypeDef * CANx, CAN_RXMessage *msg);
uint32_t CAN_TXComplete(CAN_TypeDef * CANx);
uint32_t CAN_TXSuccess(CAN_TypeDef * CANx);
void CAN_AbortTransmit(CAN_TypeDef * CANx);
uint32_t CAN_TXBufferReady(CAN_TypeDef * CANx);
uint32_t CAN_RXDataAvailable(CAN_TypeDef * CANx);
void CAN_SetBaudrate(CAN_TypeDef * CANx, uint32_t baudrate, uint32_t CAN_BS1, uint32_t CAN_BS2, uint32_t CAN_SJW);
void CAN_SetFilter32b(CAN_TypeDef * CANx, uint32_t check, uint32_t mask);
void CAN_SetFilter16b(CAN_TypeDef * CANx, uint16_t check1, uint16_t mask1, uint16_t check2, uint16_t mask2);
void CAN_INTRXNotEmptyEn(CAN_TypeDef * CANx);
void CAN_INTRXNotEmptyDis(CAN_TypeDef * CANx);
uint32_t CAN_INTRXNotEmptyStat(CAN_TypeDef * CANx);
void CAN_INTTXBufEmptyEn(CAN_TypeDef * CANx);
void CAN_INTTXBufEmptyDis(CAN_TypeDef * CANx);
uint32_t CAN_INTTXBufEmptyStat(CAN_TypeDef * CANx);
void CAN_INTErrWarningEn(CAN_TypeDef * CANx);
void CAN_INTErrWarningDis(CAN_TypeDef * CANx);
uint32_t CAN_INTErrWarningStat(CAN_TypeDef * CANx);
void CAN_INTRXOverflowEn(CAN_TypeDef * CANx);
void CAN_INTRXOverflowDis(CAN_TypeDef * CANx);
uint32_t CAN_INTRXOverflowStat(CAN_TypeDef * CANx);
void CAN_INTRXOverflowClear(CAN_TypeDef * CANx);
void CAN_INTWakeupEn(CAN_TypeDef * CANx);
void CAN_INTWakeupDis(CAN_TypeDef * CANx);
uint32_t CAN_INTWakeupStat(CAN_TypeDef * CANx);
void CAN_INTErrPassiveEn(CAN_TypeDef * CANx);
void CAN_INTErrPassiveDis(CAN_TypeDef * CANx);
uint32_t CAN_INTErrPassiveStat(CAN_TypeDef * CANx);
void CAN_INTArbitrLostEn(CAN_TypeDef * CANx);
void CAN_INTArbitrLostDis(CAN_TypeDef * CANx);
uint32_t CAN_INTArbitrLostStat(CAN_TypeDef * CANx);
void CAN_INTBusErrorEn(CAN_TypeDef * CANx);
void CAN_INTBusErrorDis(CAN_TypeDef * CANx);
uint32_t CAN_INTBusErrorStat(CAN_TypeDef * CANx);
#endif //__SWM181_CAN_H__
| [
"llizhaohao@163,com"
] | llizhaohao@163,com |
ac64062fcf3cdd88d3e9b66c478d53f7de18d865 | 6a701dc8e8851b49ae2225d0720ff7aca3157177 | /subprojects/packagefiles/lua/src/luabenz.h | 13c2446509d814c4028754522a8f51264fbbe393 | [
"MIT"
] | permissive | mila-iqia/Benzina | f829c75ae6c66b46388eca292596a67d2eda387f | cf898daaa481fa05aeb556eb9d9144e5a0f78638 | refs/heads/master | 2023-08-29T22:42:00.530781 | 2021-09-01T17:36:36 | 2021-09-01T17:36:44 | 302,430,919 | 1 | 0 | MIT | 2020-11-27T22:03:59 | 2020-10-08T18:37:52 | null | UTF-8 | C | false | false | 3,653 | h | /* Include Guards */
#ifndef LUABENZ_H
#define LUABENZ_H
/* Imports */
#include <stdlib.h>
#include <pthread.h>
#include "linenoise.h" /* linenoise */
#include "encodings/utf8.h" /* linenoise UTF-8 support */
/**
* We wish to use linenoise in our build, so make it available.
* We also define the Lua readline macros in terms of linenoise functions.
*/
#define lua_initreadline(L) ((void)L, linenoiseSetMultiLine(1), \
linenoiseHistorySetMaxLen(1000), \
linenoiseSetEncodingFunctions( \
linenoiseUtf8PrevCharLen, \
linenoiseUtf8NextCharLen, \
linenoiseUtf8ReadCode \
))
#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
#define lua_saveline(L,line) ((void)L, linenoiseHistoryAdd(line))
#define lua_freeline(L,b) ((void)L, free(b))
/**
* It is not possible to modify LUA_EXTRASPACE in luaconf.h via compiler args,
* because it is unconditionally defined. However, this is done before the
* #include of LUA_USER_H (which selects this header), so we may #undef it
* here and re-#define it.
*/
#undef LUA_EXTRASPACE
#define LUA_EXTRASPACE (2*sizeof(void*))
/**
* The build of Lua we use is internally pthreaded, so define the internal
* lock-macros to protect the Lua core.
*/
#define lua_lock(L) (pthread_mutex_lock ((pthread_mutex_t*)*(void**)lua_getextraspace((L))))
#define lua_unlock(L) (pthread_mutex_unlock((pthread_mutex_t*)*(void**)lua_getextraspace((L))))
#define luai_userstateopen(L) \
do{ \
lua_State* _L = (L); \
pthread_mutex_t* _p = calloc(sizeof(pthread_mutex_t), 1); \
if(!_p){ \
lua_pushliteral(_L, MEMERRMSG); \
lua_error(L); \
} \
\
if(pthread_mutex_init(_p, NULL) != 0){ \
free(_p); \
lua_pushliteral(_L, "Failed to initialize per-lua_State global lock!"); \
lua_error(L); \
} \
\
*(void**)lua_getextraspace(_L) = (void*)_p; \
}while(0)
#define luai_userstateclose(L) \
do{ \
pthread_mutex_t* _p = *(void**)lua_getextraspace((L)); \
pthread_mutex_unlock(_p); /* luai_userstateclose(L) called w/ lock */ \
pthread_mutex_destroy(_p); \
free(_p); \
}while(0)
#endif
| [
"obilaniu@gmail.com"
] | obilaniu@gmail.com |
eb745610875e4b4d0972a2a63c4dc4533a66f296 | f5dd3338662bc705f018a34cdc943806e7076f0a | /asn1c/SGWChange.c | bb95cce03794f5c3349de6882e572f73fc912f16 | [] | no_license | victron/CDR_file | a16a7aad3db237b20e910ea94776316e3ba04830 | 5b40b523f7319fc785f788dd943af03a71e1555c | refs/heads/master | 2021-01-20T19:57:56.252790 | 2016-08-17T08:50:21 | 2016-08-17T08:50:21 | 65,561,812 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 3,677 | c | /*
* Generated by asn1c-0.9.27 (http://lionet.info/asn1c)
* From ASN.1 module "GPRSChargingDataTypesV1171"
* found in "../GPRSChargingDataTypesV1171_py_asn1c_2.asn"
*/
#include "SGWChange.h"
int
SGWChange_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
asn_app_constraint_failed_f *ctfailcb, void *app_key) {
/* Replace with underlying type checker */
td->check_constraints = asn_DEF_BOOLEAN.check_constraints;
return td->check_constraints(td, sptr, ctfailcb, app_key);
}
/*
* This type is implemented using BOOLEAN,
* so here we adjust the DEF accordingly.
*/
static void
SGWChange_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
td->free_struct = asn_DEF_BOOLEAN.free_struct;
td->print_struct = asn_DEF_BOOLEAN.print_struct;
td->check_constraints = asn_DEF_BOOLEAN.check_constraints;
td->ber_decoder = asn_DEF_BOOLEAN.ber_decoder;
td->der_encoder = asn_DEF_BOOLEAN.der_encoder;
td->xer_decoder = asn_DEF_BOOLEAN.xer_decoder;
td->xer_encoder = asn_DEF_BOOLEAN.xer_encoder;
td->uper_decoder = asn_DEF_BOOLEAN.uper_decoder;
td->uper_encoder = asn_DEF_BOOLEAN.uper_encoder;
if(!td->per_constraints)
td->per_constraints = asn_DEF_BOOLEAN.per_constraints;
td->elements = asn_DEF_BOOLEAN.elements;
td->elements_count = asn_DEF_BOOLEAN.elements_count;
td->specifics = asn_DEF_BOOLEAN.specifics;
}
void
SGWChange_free(asn_TYPE_descriptor_t *td,
void *struct_ptr, int contents_only) {
SGWChange_1_inherit_TYPE_descriptor(td);
td->free_struct(td, struct_ptr, contents_only);
}
int
SGWChange_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
SGWChange_1_inherit_TYPE_descriptor(td);
return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
}
asn_dec_rval_t
SGWChange_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **structure, const void *bufptr, size_t size, int tag_mode) {
SGWChange_1_inherit_TYPE_descriptor(td);
return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
}
asn_enc_rval_t
SGWChange_encode_der(asn_TYPE_descriptor_t *td,
void *structure, int tag_mode, ber_tlv_tag_t tag,
asn_app_consume_bytes_f *cb, void *app_key) {
SGWChange_1_inherit_TYPE_descriptor(td);
return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
}
asn_dec_rval_t
SGWChange_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
void **structure, const char *opt_mname, const void *bufptr, size_t size) {
SGWChange_1_inherit_TYPE_descriptor(td);
return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
}
asn_enc_rval_t
SGWChange_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
int ilevel, enum xer_encoder_flags_e flags,
asn_app_consume_bytes_f *cb, void *app_key) {
SGWChange_1_inherit_TYPE_descriptor(td);
return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
}
static ber_tlv_tag_t asn_DEF_SGWChange_tags_1[] = {
(ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
};
asn_TYPE_descriptor_t asn_DEF_SGWChange = {
"SGWChange",
"SGWChange",
SGWChange_free,
SGWChange_print,
SGWChange_constraint,
SGWChange_decode_ber,
SGWChange_encode_der,
SGWChange_decode_xer,
SGWChange_encode_xer,
0, 0, /* No PER support, use "-gen-PER" to enable */
0, /* Use generic outmost tag fetcher */
asn_DEF_SGWChange_tags_1,
sizeof(asn_DEF_SGWChange_tags_1)
/sizeof(asn_DEF_SGWChange_tags_1[0]), /* 1 */
asn_DEF_SGWChange_tags_1, /* Same as above */
sizeof(asn_DEF_SGWChange_tags_1)
/sizeof(asn_DEF_SGWChange_tags_1[0]), /* 1 */
0, /* No PER visible constraints */
0, 0, /* No members */
0 /* No specifics */
};
| [
"viktor.tsymbalyuk@alcatel-lucent.com"
] | viktor.tsymbalyuk@alcatel-lucent.com |
3eedb6bf3db3f74db610905f1e2de5305f0ad40a | defc6f1557a6bde2819a76efe6612a9d051d2b79 | /ringo_c/protocolRINGO.h | b4be25ebc846590a023d2507417445aca5e90436 | [] | no_license | llabad39/projetreseau | e81c82d14e23ca581498a991aba939a44883b051 | 175affacebd3e83a981bc40149c85e558cbafd10 | refs/heads/master | 2021-01-21T13:48:32.162300 | 2016-05-27T21:44:28 | 2016-05-27T21:44:28 | 54,783,664 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 553 | h | #define M_SIZE_MAX 512 /***< maximum size for a message (octets) */
#include <netdb.h>
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include "protocolTCP.h"
#include "protocolUDP.h"
#include "protocolMulticast.h"
void * tcp(void * _ent);
void * udp(void * _ent);
void * multicast(void * _ent);
void * multicast2(void * _ent);
int r_create(entity *ent);
int r_connect(entity *ent);
int r_duplicate(entity *ent);
int r_quit_ring(entity *ent);
int r_help();
int r_command(entity * ent);
int r_c_help();
| [
"cubouyaka@laposte.net"
] | cubouyaka@laposte.net |
eb12307517a18ca2645f41bfdf281adb91708202 | bbb39450daa397edda1d967b679b6824149548b2 | /DSA LAB/mergesort.c | 36687d7d61e0ac2c822d487db2aa0bfb52fe3b3b | [] | no_license | YeasirAR/Data-Structure | cf80e5c729cae9015b7b550c432dafd9d229a701 | fc54fd21f0b01514380c787bb5a47885e88c1dc3 | refs/heads/master | 2023-08-20T05:49:30.139694 | 2021-10-11T02:44:38 | 2021-10-11T02:44:38 | 404,833,431 | 3 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,055 | c | #include <stdio.h>
#include <stdlib.h>
#define INF 999999
void merge(int A[], int p, int q, int r) {
int n1 = q-p+1;
int n2 = r-q;
int* L = (int*)malloc((n1+1)*sizeof(int));
int* R = (int*)malloc((n2+1)*sizeof(int));
for(int i=0; i<n1; i++) {
L[i] = A[p+i];
}
for(int j=0; j<n2; j++) {
R[j] = A[q+1+j];
}
L[n1] = INF;
R[n2] = INF;
int i=0, j=0;
for(int k=p; k<=r; k++) {
if(L[i] <= R[j]) {
A[k] = L[i];
i++;
}
else {
A[k] = R[j];
j++;
}
}
}
void mergesort(int A[], int p, int r) {
if(p<r) {
int q = (p+r)/2;
mergesort(A, p, q);
mergesort(A, q+1, r);
merge(A, p, q, r);
}
}
void printarr(int A[], int n) {
for(int i=0; i<n; i++) {
printf("%d ", A[i]);
}
printf("\n");
}
int main() {
int arr[] = {11, 35, 52, 27, 78, 33, 7, 19, 21};
int n = 9;
printarr(arr, n);
mergesort(arr, 0, n-1);
printarr(arr, n);
return 0;
}
| [
"yeasirar@gmail.com"
] | yeasirar@gmail.com |
279a281d3638d61710068648db8d5da0336e5c8a | 5c255f911786e984286b1f7a4e6091a68419d049 | /vulnerable_code/c3e67e8f-fac5-453e-abb2-03bfc7047b57.c | eaac850a4496b1aebf1a260c7bca54fd523fc638 | [] | no_license | nmharmon8/Deep-Buffer-Overflow-Detection | 70fe02c8dc75d12e91f5bc4468cf260e490af1a4 | e0c86210c86afb07c8d4abcc957c7f1b252b4eb2 | refs/heads/master | 2021-09-11T19:09:59.944740 | 2018-04-06T16:26:34 | 2018-04-06T16:26:34 | 125,521,331 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 597 | c | #include <string.h>
#include <stdio.h>
int main() {
int i=4;
int j=14;
int k;
int l;
k = 53;
l = 64;
k = i/j;
l = i/j;
l = i/j;
l = i/j;
l = i%j;
l = k-j;
k = l-k*i;
//variables
/* START VULNERABILITY */
int a;
char b[11];
char c[89];
a = 0;
while (( a - 1 ) > -1) {
a--;
//random
/* START BUFFER SET */
*((char *)c + ( a - 1 )) = *((char *)b + ( a - 1 ));
/* END BUFFER SET */
}
/* END VULNERABILITY */
//random
printf("%d%d\n",k,l);
return 0;
}
| [
"nharmon8@gmail.com"
] | nharmon8@gmail.com |
093b9b33a80253d028d204e52d881c5efd6c7e71 | 9258864af99b69ed8f8d5cffdbdf0ede18d63697 | /srcs/ft_printaddress.c | b916bbd9fdb90708a3ee32633e722f44fc5cc26b | [] | no_license | Qespion/ft_printfv2 | 28086e235215067096a5cec9bd40d24ab028ab97 | aae987a01f5f35879ff38d51a555884cc5f0295c | refs/heads/master | 2020-03-17T23:55:44.278495 | 2018-06-02T14:47:30 | 2018-06-02T14:47:30 | 134,068,490 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 2,086 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printaddress.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: oespion <oespion@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/23 18:23:55 by oespion #+# #+# */
/* Updated: 2018/06/02 16:12:42 by oespion ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
void address_width(t_list *p, char *total)
{
int r;
char spaces;
spaces = ' ';
p->zeros && !p->negative ? spaces = '0' : 0;
r = p->width;
total[0] == '\0' ? r-- : 0;
while (r > ft_strlen(total) + 2)
{
ft_putchar(spaces);
r--;
p->nbout++;
}
}
void address_precision(t_list *p, char *total)
{
int r;
r = p->precision;
total[0] == '\0' ? r-- : 0;
while (r > ft_strlen(total))
{
ft_putchar('0');
r--;
p->nbout++;
}
}
void printaddress(t_list *p)
{
uintmax_t adr;
char *total;
adr = (uintmax_t)va_arg(p->ap, void*);
total = ft_convert_base(adr, 16);
total[0] == '\0' ? total = "0" : 0;
if (p->negative)
{
ft_putstr("0x");
address_precision(p, total);
ft_putstr(total[0] == '0' && p->precision == 0 ? "" : total );
address_width(p, total);
}
else
{
!p->zeros ? address_width(p, total) : 0;
ft_putstr("0x");
p->zeros ? address_width(p, total) : 0;
address_precision(p, total);
ft_putstr(total[0] == '0' && p->precision == 0 ? "" : total );
}
total[0] == '\0' ? p->nbout++ : 0;
p->nbout += ft_strlen(total) + 2;
total[0] == '0' && p->precision == 0 ? p->nbout-- : 0;
total[0] != '0' ? ft_strdel(&total) : 0;
}
| [
"q.espion@gmail.com"
] | q.espion@gmail.com |
f0ecdd98582421fdebbdef44d7863c47fd90091b | 0e1d1f87fe7730b62cf57765efefea4de8a169a3 | /srcs/libft/ft_strrchr.c | 384cb442fe5221c7c541c8f477aefa14c035d9f1 | [] | no_license | msamual/ft_printf | 8bb14c33f74b12c4270206ddbdaca12da5c417f6 | e7b337553dd3bd5a3bc63769b239dd3d63d950b2 | refs/heads/main | 2023-07-06T19:09:16.813550 | 2021-08-11T12:53:32 | 2021-08-11T12:53:32 | 394,987,695 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 1,116 | c | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strrchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: msamual <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/10/28 13:34:05 by msamual #+# #+# */
/* Updated: 2020/10/28 13:39:01 by msamual ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strrchr(const char *s, int c)
{
char ch;
char *res;
ch = (char)c;
res = NULL;
while (*s)
{
if (*s == ch)
res = (char *)s;
s++;
}
if (*s == ch)
res = (char *)s;
return (res);
}
| [
"msamual@er-c5.kzn.21-school.ru"
] | msamual@er-c5.kzn.21-school.ru |
870103c544b49a6a2eac63ceaf5f77a7c71efa49 | 3ee3804653cee1be074339d638b7f9f9c9bbeb5f | /Report_Collector_v1.1/read_config.h | 020e3c6745f8a92a904f393618c5d202504e8774 | [] | no_license | ntrtrung/eBATMAN | 9da15c41681551894c267818b642caf1cf8a7608 | e22a46b6e78d220cda72bed991a885accbc3d122 | refs/heads/master | 2021-01-01T15:24:13.859225 | 2015-09-18T11:44:21 | 2015-09-18T11:44:21 | 42,719,458 | 0 | 0 | null | null | null | null | UTF-8 | C | false | false | 259 | h | #ifndef _READ_CONFIG_H_
#define _READ_CONFIG_H_
typedef struct rc_configuration
{
char *rc_interface;
char *setting_file;
char *data_server_list;
char *log_file_path;
}rc_configuration;
int read_config_file(rc_configuration *rc,char *filename);
#endif
| [
"ntrtrung@gmail.com"
] | ntrtrung@gmail.com |
83446ea31f3d3267dbde3e7c71d2a8f5609d1aab | bd1fea86d862456a2ec9f56d57f8948456d55ee6 | /000/073/719/CWE124_Buffer_Underwrite__CWE839_listen_socket_42.c | 64c022c022cc54b017d9e498e350df87b546b1fc | [] | no_license | CU-0xff/juliet-cpp | d62b8485104d8a9160f29213368324c946f38274 | d8586a217bc94cbcfeeec5d39b12d02e9c6045a2 | refs/heads/master | 2021-03-07T15:44:19.446957 | 2020-03-10T12:45:40 | 2020-03-10T12:45:40 | 246,275,244 | 0 | 1 | null | null | null | null | UTF-8 | C | false | false | 8,549 | c | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE124_Buffer_Underwrite__CWE839_listen_socket_42.c
Label Definition File: CWE124_Buffer_Underwrite__CWE839.label.xml
Template File: sources-sinks-42.tmpl.c
*/
/*
* @description
* CWE: 124 Buffer Underwrite
* BadSource: listen_socket Read data using a listen socket (server side)
* GoodSource: Non-negative but less than 10
* Sinks:
* GoodSink: Ensure the array index is valid
* BadSink : Improperly check the array index by not checking the lower bound
* Flow Variant: 42 Data flow: data returned from one function to another in the same source file
*
* */
#include "std_testcase.h"
#ifdef _WIN32
#include <winsock2.h>
#include <windows.h>
#include <direct.h>
#pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */
#define CLOSE_SOCKET closesocket
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define INVALID_SOCKET -1
#define SOCKET_ERROR -1
#define CLOSE_SOCKET close
#define SOCKET int
#endif
#define TCP_PORT 27015
#define LISTEN_BACKLOG 5
#define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2)
#ifndef OMITBAD
static int badSource(int data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
}
void CWE124_Buffer_Underwrite__CWE839_listen_socket_42_bad()
{
int data;
/* Initialize data */
data = -1;
data = badSource(data);
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to access a negative index of the array
* This code does not check to see if the array index is negative */
if (data < 10)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
static int goodG2BSource(int data)
{
/* FIX: Use a value greater than 0, but less than 10 to avoid attempting to
* access an index of the array in the sink that is out-of-bounds */
data = 7;
return data;
}
static void goodG2B()
{
int data;
/* Initialize data */
data = -1;
data = goodG2BSource(data);
{
int i;
int buffer[10] = { 0 };
/* POTENTIAL FLAW: Attempt to access a negative index of the array
* This code does not check to see if the array index is negative */
if (data < 10)
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is negative.");
}
}
}
/* goodB2G uses the BadSource with the GoodSink */
static int goodB2GSource(int data)
{
{
#ifdef _WIN32
WSADATA wsaData;
int wsaDataInit = 0;
#endif
int recvResult;
struct sockaddr_in service;
SOCKET listenSocket = INVALID_SOCKET;
SOCKET acceptSocket = INVALID_SOCKET;
char inputBuffer[CHAR_ARRAY_SIZE];
do
{
#ifdef _WIN32
if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR)
{
break;
}
wsaDataInit = 1;
#endif
/* POTENTIAL FLAW: Read data using a listen socket */
listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listenSocket == INVALID_SOCKET)
{
break;
}
memset(&service, 0, sizeof(service));
service.sin_family = AF_INET;
service.sin_addr.s_addr = INADDR_ANY;
service.sin_port = htons(TCP_PORT);
if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
{
break;
}
if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR)
{
break;
}
acceptSocket = accept(listenSocket, NULL, NULL);
if (acceptSocket == SOCKET_ERROR)
{
break;
}
/* Abort on error or the connection was closed */
recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0);
if (recvResult == SOCKET_ERROR || recvResult == 0)
{
break;
}
/* NUL-terminate the string */
inputBuffer[recvResult] = '\0';
/* Convert to int */
data = atoi(inputBuffer);
}
while (0);
if (listenSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(listenSocket);
}
if (acceptSocket != INVALID_SOCKET)
{
CLOSE_SOCKET(acceptSocket);
}
#ifdef _WIN32
if (wsaDataInit)
{
WSACleanup();
}
#endif
}
return data;
}
static void goodB2G()
{
int data;
/* Initialize data */
data = -1;
data = goodB2GSource(data);
{
int i;
int buffer[10] = { 0 };
/* FIX: Properly validate the array index and prevent a buffer underwrite */
if (data >= 0 && data < (10))
{
buffer[data] = 1;
/* Print the array values */
for(i = 0; i < 10; i++)
{
printIntLine(buffer[i]);
}
}
else
{
printLine("ERROR: Array index is out-of-bounds");
}
}
}
void CWE124_Buffer_Underwrite__CWE839_listen_socket_42_good()
{
goodB2G();
goodG2B();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE124_Buffer_Underwrite__CWE839_listen_socket_42_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE124_Buffer_Underwrite__CWE839_listen_socket_42_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| [
"frank@fischer.com.mt"
] | frank@fischer.com.mt |
e6ef5b4b6222a1836ac03a68d0999e9889eb6f06 | 7e382727fc8637ae21e7fa3573141c6bed3ce8a2 | /ThirdParty/lapack/lapacke/src/lapacke_ctftri.c | c75d3349a4530b54675730f9a72cc51eb6bfa01c | [
"BSD-3-Clause",
"BSD-3-Clause-Open-MPI"
] | permissive | mapgccv/coin | 8cd104d792e636b4b49f986d5c26449136666238 | 28abd74d7c3ea2aee905ed95e2942e77e03e1ada | refs/heads/master | 2020-09-29T05:15:08.724051 | 2019-12-11T18:44:53 | 2019-12-11T18:44:53 | 226,961,054 | 0 | 0 | NOASSERTION | 2019-12-09T20:26:23 | 2019-12-09T20:26:22 | null | UTF-8 | C | false | false | 2,503 | c | /*****************************************************************************
Copyright (c) 2011, Intel Corp.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Intel Corporation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************
* Contents: Native high-level C interface to LAPACK function ctftri
* Author: Intel Corporation
* Generated November, 2011
*****************************************************************************/
#include "lapacke_utils.h"
lapack_int LAPACKE_ctftri( int matrix_order, char transr, char uplo, char diag,
lapack_int n, lapack_complex_float* a )
{
if( matrix_order != LAPACK_COL_MAJOR && matrix_order != LAPACK_ROW_MAJOR ) {
LAPACKE_xerbla( "LAPACKE_ctftri", -1 );
return -1;
}
#ifndef LAPACK_DISABLE_NAN_CHECK
/* Optionally check input matrices for NaNs */
if( LAPACKE_ctf_nancheck( matrix_order, transr, uplo, diag, n, a ) ) {
return -6;
}
#endif
return LAPACKE_ctftri_work( matrix_order, transr, uplo, diag, n, a );
}
| [
"victor.zverovich@gmail.com"
] | victor.zverovich@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.