answer
stringlengths
15
1.25M
<?php namespace Twig\Node\Expression\Test; class_exists('<API key>'); if (\false) { class DefinedTest extends \<API key> { } }
.ui.image { position: relative; display: inline-block; vertical-align: middle; max-width: 100%; background-color: transparent; } img.ui.image { display: block; } .ui.image svg, .ui.image img { display: block; max-width: 100%; height: auto; } .ui.hidden.images, .ui.hidden.image { display: none; } .ui.disabled.images, .ui.disabled.image { cursor: default; opacity: 0.3; } .ui.inline.image, .ui.inline.image svg, .ui.inline.image img { display: inline-block; } .ui.top.aligned.images .image, .ui.top.aligned.image, .ui.top.aligned.image svg, .ui.top.aligned.image img { display: inline-block; vertical-align: top; } .ui.middle.aligned.images .image, .ui.middle.aligned.image, .ui.middle.aligned.image svg, .ui.middle.aligned.image img { display: inline-block; vertical-align: middle; } .ui.bottom.aligned.images .image, .ui.bottom.aligned.image, .ui.bottom.aligned.image svg, .ui.bottom.aligned.image img { display: inline-block; vertical-align: bottom; } .ui.rounded.images .image, .ui.rounded.images img, .ui.rounded.images svg, .ui.rounded.image img, .ui.rounded.image svg, .ui.rounded.image { border-radius: 0.3125em; } .ui.bordered.images .image, .ui.bordered.images img, .ui.bordered.images svg, .ui.bordered.image img, .ui.bordered.image svg, img.ui.bordered.image { border: 1px solid rgba(0, 0, 0, 0.1); } .ui.circular.images, .ui.circular.image { overflow: hidden; } .ui.circular.images .image, .ui.circular.images img, .ui.circular.images svg, .ui.circular.image img, .ui.circular.image svg, .ui.circular.image { border-radius: 500rem; } .ui.fluid.images, .ui.fluid.image, .ui.fluid.images img, .ui.fluid.images svg, .ui.fluid.image svg, .ui.fluid.image img { display: block; width: 100%; height: auto; } .ui.avatar.images .image, .ui.avatar.images img, .ui.avatar.images svg, .ui.avatar.image img, .ui.avatar.image svg, .ui.avatar.image { margin-right: 0.25em; display: inline-block; width: 2.5em; height: 2.5em; border-radius: 500rem; } .ui.floated.image, .ui.floated.images { float: left; margin-right: 1em; margin-bottom: 1em; } .ui.right.floated.images, .ui.right.floated.image { float: right; margin-right: 0em; margin-bottom: 1em; margin-left: 1em; } .ui.floated.images:last-child, .ui.floated.image:last-child { margin-bottom: 0em; } .ui.centered.images, .ui.centered.image { margin-left: auto; margin-right: auto; } .ui.mini.images .image, .ui.mini.images img, .ui.mini.images svg, .ui.mini.image { width: 20px; height: auto; font-size: 0.71428571rem; } .ui.tiny.images .image, .ui.tiny.images img, .ui.tiny.images svg, .ui.tiny.image { width: 80px; height: auto; font-size: 0.85714286rem; } .ui.small.images .image, .ui.small.images img, .ui.small.images svg, .ui.small.image { width: 150px; height: auto; font-size: 0.92857143rem; } .ui.medium.images .image, .ui.medium.images img, .ui.medium.images svg, .ui.medium.image { width: 300px; height: auto; font-size: 1rem; } .ui.large.images .image, .ui.large.images img, .ui.large.images svg, .ui.large.image { width: 450px; height: auto; font-size: 1.14285714rem; } .ui.big.images .image, .ui.big.images img, .ui.big.images svg, .ui.big.image { width: 600px; height: auto; font-size: 1.28571429rem; } .ui.huge.images .image, .ui.huge.images img, .ui.huge.images svg, .ui.huge.image { width: 800px; height: auto; font-size: 1.42857143rem; } .ui.massive.images .image, .ui.massive.images img, .ui.massive.images svg, .ui.massive.image { width: 960px; height: auto; font-size: 1.71428571rem; } .ui.images { font-size: 0em; margin: 0em -0.25rem 0rem; } .ui.images .image, .ui.images img, .ui.images svg { display: inline-block; margin: 0em 0.25rem 0.5rem; }
DELETE FROM pet_aura WHERE guid NOT IN (SELECT id FROM character_pet); DELETE FROM pet_spell WHERE guid NOT IN (SELECT id FROM character_pet); DELETE FROM pet_spell_cooldown WHERE guid NOT IN (SELECT id FROM character_pet);
#define pr_fmt(fmt) "%s: " fmt, __func__ #include <linux/errno.h> #include <linux/kernel.h> #include <linux/kthread.h> #include <linux/memblock.h> #include <linux/bootmem.h> #include <linux/iommu.h> #include <linux/of_address.h> #include <linux/fb.h> #include <linux/mm.h> #include <asm/page.h> #include "mdss_fb.h" #include "mdss_mdp.h" #include "splash.h" #include "<API key>.h" #define INVALID_PIPE_INDEX 0xFFFF #define <API key> 2 static int <API key>(struct msm_fb_data_type *mfd, uint32_t size) { int rc; struct msm_fb_splash_info *sinfo; unsigned long buf_size = size; struct mdss_data_type *mdata; if (!mfd || !size) return -EINVAL; mdata = mfd_to_mdata(mfd); sinfo = &mfd->splash_info; if (!mdata || !mdata->iclient || sinfo->splash_buffer) return -EINVAL; sinfo->ion_handle = ion_alloc(mdata->iclient, size, SZ_4K, ION_HEAP(ION_SYSTEM_HEAP_ID), 0); if (IS_ERR_OR_NULL(sinfo->ion_handle)) { pr_err("ion memory allocation failed\n"); rc = PTR_RET(sinfo->ion_handle); goto end; } rc = ion_map_iommu(mdata->iclient, sinfo->ion_handle, <API key>(<API key>), 0, SZ_4K, 0, &sinfo->iova, &buf_size, 0, 0); if (rc) { pr_err("ion memory map failed\n"); goto imap_err; } sinfo->splash_buffer = ion_map_kernel(mdata->iclient, sinfo->ion_handle); if (IS_ERR_OR_NULL(sinfo->splash_buffer)) { pr_err("ion kernel memory mapping failed\n"); rc = IS_ERR(sinfo->splash_buffer); goto kmap_err; } return rc; kmap_err: ion_unmap_iommu(mdata->iclient, sinfo->ion_handle, <API key>(<API key>), 0); imap_err: ion_free(mdata->iclient, sinfo->ion_handle); end: return rc; } static void <API key>(struct msm_fb_data_type *mfd) { struct msm_fb_splash_info *sinfo; struct mdss_data_type *mdata; if (!mfd) return; sinfo = &mfd->splash_info; mdata = mfd_to_mdata(mfd); if (!mdata || !mdata->iclient || !sinfo->ion_handle) return; ion_unmap_kernel(mdata->iclient, sinfo->ion_handle); ion_unmap_iommu(mdata->iclient, sinfo->ion_handle, <API key>(<API key>), 0); ion_free(mdata->iclient, sinfo->ion_handle); sinfo->splash_buffer = NULL; } static int <API key>(struct msm_fb_data_type *mfd) { struct iommu_domain *domain; struct <API key> *mdp5_data = mfd_to_mdp5_data(mfd); struct mdss_data_type *mdata = mdss_mdp_get_mdata(); int rc, ret; /* * iommu dynamic attach for following conditions. * 1. it is still not attached * 2. MDP hardware version supports the feature * 3. configuration is with valid splash buffer */ if (mdata->mdss_util->iommu_attached() || !mfd->panel_info->cont_splash_enabled || !<API key>(mdp5_data->mdata) || !mdp5_data->splash_mem_addr || !mdp5_data->splash_mem_size) { pr_debug("dynamic attach is not supported\n"); return -EPERM; } domain = <API key>(<API key>( <API key>)); if (!domain) { pr_debug("mdss iommu domain get failed\n"); return -EINVAL; } rc = iommu_map(domain, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size, IOMMU_READ); if (rc) { pr_debug("iommu memory mapping failed rc=%d\n", rc); } else { ret = mdss_iommu_ctrl(1); if (IS_ERR_VALUE(ret)) { pr_err("mdss iommu attach failed\n"); iommu_unmap(domain, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); } else { mfd->splash_info.<API key> = true; } } return rc; } static void <API key>(struct msm_fb_data_type *mfd) { struct iommu_domain *domain; struct <API key> *mdp5_data = mfd_to_mdp5_data(mfd); if (mfd->splash_info.<API key>) { domain = <API key>(<API key>( <API key>)); if (!domain) { pr_err("mdss iommu domain get failed\n"); return; } iommu_unmap(domain, mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdss_iommu_ctrl(0); mfd->splash_info.<API key> = false; } } void <API key>(struct msm_fb_data_type *mfd) { struct msm_fb_splash_info *sinfo; if (!mfd || !mfd->splash_info.<API key>) return; sinfo = &mfd->splash_info; if (sinfo->pipe_ndx[0] != INVALID_PIPE_INDEX) <API key>(mfd, sinfo->pipe_ndx[0]); if (sinfo->pipe_ndx[1] != INVALID_PIPE_INDEX) <API key>(mfd, sinfo->pipe_ndx[1]); sinfo-><API key> = false; } /* * In order to free reseved memory from bootup we are not * able to call the __init free functions, as we could be * passed the init boot sequence. As a reult we need to * free this memory ourselves using the * free_reeserved_page() function. */ void mdss_free_bootmem(u32 mem_addr, u32 size) { unsigned long pfn_start, pfn_end, pfn_idx; pfn_start = mem_addr >> PAGE_SHIFT; pfn_end = (mem_addr + size) >> PAGE_SHIFT; for (pfn_idx = pfn_start; pfn_idx < pfn_end; pfn_idx++) free_reserved_page(pfn_to_page(pfn_idx)); } int <API key>(struct msm_fb_data_type *mfd, bool use_borderfill) { struct <API key> *mdp5_data; struct mdss_mdp_ctl *ctl; int rc = 0; if (!mfd) return -EINVAL; mdp5_data = mfd_to_mdp5_data(mfd); if (!mdp5_data) return -EINVAL; ctl = mdp5_data->ctl; if (!ctl) return -EINVAL; if (mfd->splash_info.<API key> || !mfd->panel_info->cont_splash_enabled) goto end; if (use_borderfill && mdp5_data->handoff) { /* * Set up border-fill on the handed off pipes. * This is needed to ensure that there are no memory * accesses prior to attaching iommu during continuous * splash screen case. However, for command mode * displays, this is not necessary since the panels can * refresh from their internal memory if no data is sent * out on the dsi lanes. */ if (mdp5_data->handoff && ctl && ctl->is_video_mode) { rc = <API key>(ctl, NULL, NULL); if (!IS_ERR_VALUE(rc)) { <API key>(ctl); } else { /* * Since border-fill setup failed, we * need to ensure that we turn off the * MDP timing generator before attaching * iommu */ pr_err("failed to set BF at handoff\n"); mdp5_data->handoff = false; } } } if (rc || mdp5_data->handoff) { /* Add all the handed off pipes to the cleanup list */ <API key>(mfd, <API key>); <API key>(mfd, <API key>); <API key>(mfd, <API key>); } <API key>(ctl, mdp5_data->handoff); if (mdp5_data->splash_mem_addr) { /* Give back the reserved memory to the system */ memblock_free(mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); mdss_free_bootmem(mdp5_data->splash_mem_addr, mdp5_data->splash_mem_size); } <API key>(0); end: return rc; } static struct mdss_mdp_pipe *<API key>( struct msm_fb_data_type *mfd, struct mdp_overlay *req) { struct mdss_mdp_pipe *pipe; int ret; struct mdss_mdp_data *buf; uint32_t image_size = SPLASH_IMAGE_WIDTH * SPLASH_IMAGE_HEIGHT * SPLASH_IMAGE_BPP; ret = <API key>(mfd, req, &pipe, NULL, true); if (ret) return NULL; if (mdss_mdp_pipe_map(pipe)) { pr_err("unable to map base pipe\n"); return NULL; } buf = &pipe->back_buf; buf->p[0].addr = mfd->splash_info.iova; buf->p[0].len = image_size; buf->num_planes = 1; mdss_mdp_pipe_unmap(pipe); return pipe; } static int <API key>(struct msm_fb_data_type *mfd, struct mdss_rect *src_rect, struct mdss_rect *dest_rect) { struct mdss_mdp_pipe *pipe; struct fb_info *fbi; struct mdp_overlay req; struct <API key> *mdp5_data; struct mdss_data_type *mdata; struct mdss_mdp_mixer *mixer; int ret; bool use_single_pipe = false; struct msm_fb_splash_info *sinfo; if (!mfd) return -EINVAL; fbi = mfd->fbi; mdp5_data = mfd_to_mdp5_data(mfd); mdata = mfd_to_mdata(mfd); sinfo = &mfd->splash_info; if (!mdp5_data || !mdp5_data->ctl) return -EINVAL; if (<API key>(&mdp5_data->ov_lock)) return -EINVAL; ret = <API key>(mfd); if (ret) { pr_err("unable to start overlay %d (%d)\n", mfd->index, ret); goto end; } mixer = mdss_mdp_mixer_get(mdp5_data->ctl, <API key>); if (!mixer) { pr_err("unable to retrieve mixer\n"); ret = -EINVAL; goto end; } memset(&req, 0, sizeof(struct mdp_overlay)); /* * use single pipe for * 1. split display disabled * 2. splash image is only on one side of panel * 3. source split is enabled and splash image is within line * buffer boundry */ use_single_pipe = !is_split_lm(mfd) || (is_split_lm(mfd) && ((dest_rect->x + dest_rect->w) < mfd->split_fb_left || dest_rect->x > mfd->split_fb_left)) || (mdata->has_src_split && src_rect->w < min_t(u16, mixer->width, <API key>()) && dest_rect->w < min_t(u16, mixer->width, <API key>())); req.src.width = src_rect->w; if (use_single_pipe) req.src_rect.w = src_rect->w; else req.src_rect.w = min_t(u16, mixer->width, src_rect->w >> 1); req.dst_rect.w = req.src_rect.w; req.src.height = req.dst_rect.h = req.src_rect.h = src_rect->h; req.src.format = SPLASH_IMAGE_FORMAT; req.id = MSMFB_NEW_REQUEST; req.z_order = MDSS_MDP_STAGE_0; req.alpha = 0xff; req.transp_mask = MDP_TRANSP_NOP; req.dst_rect.x = dest_rect->x; req.dst_rect.y = dest_rect->y; pipe = <API key>(mfd, &req); if (!pipe) { pr_err("unable to allocate base pipe\n"); ret = -EINVAL; goto end; } sinfo->pipe_ndx[0] = pipe->ndx; if (!use_single_pipe) { req.id = MSMFB_NEW_REQUEST; req.src_rect.x = src_rect->x + min_t(u16, mixer->width, src_rect->w - req.src_rect.w); req.dst_rect.x = mixer->width; pipe = <API key>(mfd, &req); if (!pipe) { pr_err("unable to allocate right base pipe\n"); <API key>(mfd, sinfo->pipe_ndx[0]); ret = -EINVAL; goto end; } sinfo->pipe_ndx[1] = pipe->ndx; } mutex_unlock(&mdp5_data->ov_lock); ret = mfd->mdp.kickoff_fnc(mfd, NULL); if (ret) { pr_err("error in displaying image\n"); <API key>(mfd, sinfo->pipe_ndx[0] | sinfo->pipe_ndx[1]); } return ret; end: sinfo->pipe_ndx[0] = INVALID_PIPE_INDEX; sinfo->pipe_ndx[1] = INVALID_PIPE_INDEX; mutex_unlock(&mdp5_data->ov_lock); return ret; } static int <API key>(struct msm_fb_data_type *mfd) { int rc = 0; struct fb_info *fbi; uint32_t image_len = SPLASH_IMAGE_WIDTH * SPLASH_IMAGE_HEIGHT * SPLASH_IMAGE_BPP; struct mdss_rect src_rect, dest_rect; struct msm_fb_splash_info *sinfo; if (!mfd || !mfd->fbi) { pr_err("invalid input parameter\n"); rc = -EINVAL; goto end; } fbi = mfd->fbi; sinfo = &mfd->splash_info; if (SPLASH_IMAGE_WIDTH > fbi->var.xres || SPLASH_IMAGE_HEIGHT > fbi->var.yres || SPLASH_IMAGE_BPP > (fbi->var.bits_per_pixel >> 3)) { pr_err("invalid splash parameter configuration\n"); rc = -EINVAL; goto end; } sinfo->pipe_ndx[0] = INVALID_PIPE_INDEX; sinfo->pipe_ndx[1] = INVALID_PIPE_INDEX; src_rect.x = 0; src_rect.y = 0; dest_rect.w = src_rect.w = SPLASH_IMAGE_WIDTH; dest_rect.h = src_rect.h = SPLASH_IMAGE_HEIGHT; dest_rect.x = (fbi->var.xres >> 1) - (SPLASH_IMAGE_WIDTH >> 1); dest_rect.y = (fbi->var.yres >> 1) - (SPLASH_IMAGE_HEIGHT >> 1); rc = <API key>(mfd, image_len); if (rc) { pr_err("splash buffer allocation failed\n"); goto end; } memcpy(sinfo->splash_buffer, splash_bgr888_image, image_len); rc = <API key>(mfd); if (rc) pr_debug("iommu dynamic attach failed\n"); rc = <API key>(mfd, &src_rect, &dest_rect); if (rc) pr_err("splash image display failed\n"); else sinfo-><API key> = true; end: return rc; } static int <API key>(struct notifier_block *self, unsigned long event, void *data) { struct msm_fb_splash_info *sinfo = container_of(self, struct msm_fb_splash_info, notifier); struct msm_fb_data_type *mfd; if (!sinfo) goto done; mfd = container_of(sinfo, struct msm_fb_data_type, splash_info); if (!mfd) goto done; if (event != <API key>) goto done; if (!sinfo->frame_done_count) { <API key>(mfd); <API key>(mfd, false); /* wait for 2 frame done events before releasing memory */ } else if (sinfo->frame_done_count > <API key> && sinfo->splash_thread) { complete(&sinfo->frame_done); sinfo->splash_thread = NULL; } /* increase frame done count after pipes are staged from other client */ if (!sinfo-><API key>) sinfo->frame_done_count++; done: return NOTIFY_OK; } static int <API key>(void *data) { struct msm_fb_data_type *mfd = data; struct <API key> *mdp5_data; int ret = -EINVAL; if (!mfd) { pr_err("invalid input parameter\n"); goto end; } mdp5_data = mfd_to_mdp5_data(mfd); lock_fb_info(mfd->fbi); ret = fb_blank(mfd->fbi, FB_BLANK_UNBLANK); if (ret) { pr_err("can't turn on fb!\n"); goto end; } unlock_fb_info(mfd->fbi); mutex_lock(&mfd->bl_lock); mfd->bl_updated = true; <API key>(mfd, mfd->panel_info->bl_max >> 1); mutex_unlock(&mfd->bl_lock); init_completion(&mfd->splash_info.frame_done); mfd->splash_info.notifier.notifier_call = <API key>; <API key>(mdp5_data->ctl, &mfd->splash_info.notifier); ret = <API key>(mfd); if (ret) { /* * keep thread alive to release dynamically allocated * resources */ pr_err("splash image display failed\n"); } /* wait for second display complete to release splash resources */ ret = <API key>(&mfd->splash_info.frame_done); <API key>(mfd); <API key>(mdp5_data->ctl, &mfd->splash_info.notifier); end: return ret; } static __ref int <API key>(struct msm_fb_data_type *mfd) { struct platform_device *pdev = mfd->pdev; struct <API key> *mdp5_mdata = mfd_to_mdp5_data(mfd); int len = 0, rc = 0; u32 offsets[2]; struct device_node *pnode, *child_node; mfd->splash_info.splash_logo_enabled = <API key>(pdev->dev.of_node, "qcom,<API key>"); of_find_property(pdev->dev.of_node, "qcom,memblock-reserve", &len); if (len) { len = len / sizeof(u32); rc = <API key>(pdev->dev.of_node, "qcom,memblock-reserve", offsets, len); if (rc) { pr_err("error reading mem reserve settings for fb\n"); goto error; } } else { child_node = <API key>(pdev->dev.of_node, "qcom,cont-splash-memory"); if (!child_node) { pr_err("splash mem child node is not present\n"); rc = -EINVAL; goto error; } pnode = of_parse_phandle(child_node, "linux,contiguous-region", 0); if (pnode != NULL) { const u32 *addr; u64 size; addr = of_get_address(pnode, 0, &size, NULL); if (!addr) { pr_err("failed to parse the splash memory address\n"); of_node_put(pnode); rc = -EINVAL; goto error; } offsets[0] = (u32) of_read_ulong(addr, 2); offsets[1] = (u32) size; of_node_put(pnode); } else { pr_err("mem reservation for splash screen fb not present\n"); rc = -EINVAL; goto error; } } if (!<API key>(offsets[0])) { pr_debug("failed to reserve memory for fb splash\n"); rc = -EINVAL; goto error; } mdp5_mdata->splash_mem_addr = offsets[0]; mdp5_mdata->splash_mem_size = offsets[1]; pr_debug("memaddr=%x size=%x\n", mdp5_mdata->splash_mem_addr, mdp5_mdata->splash_mem_size); error: if (!rc && !mfd->panel_info->cont_splash_enabled && mdp5_mdata->splash_mem_addr) { pr_debug("mem reservation not reqd if cont splash disabled\n"); memblock_free(mdp5_mdata->splash_mem_addr, mdp5_mdata->splash_mem_size); mdss_free_bootmem(mdp5_mdata->splash_mem_addr, mdp5_mdata->splash_mem_size); } else if (rc && mfd->panel_info->cont_splash_enabled) { pr_err("no rsvd mem found in DT for splash screen\n"); } else { rc = 0; } return rc; } int <API key>(struct msm_fb_data_type *mfd) { int rc; if (!mfd) { rc = -EINVAL; goto end; } rc = <API key>(mfd); if (rc) { pr_err("splash memory reserve failed\n"); goto end; } if (!mfd->splash_info.splash_logo_enabled) { rc = -EINVAL; goto end; } mfd->splash_info.splash_thread = kthread_run(<API key>, mfd, "mdss_fb_splash"); if (IS_ERR(mfd->splash_info.splash_thread)) { pr_err("unable to start splash thread %d\n", mfd->index); mfd->splash_info.splash_thread = NULL; } end: return rc; }
#include <linux/wait.h> #include <linux/fb.h> #include <linux/delay.h> #include <linux/gpio.h> #include <linux/spi/spi.h> #include <linux/irq.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/lcd.h> #include <linux/backlight.h> #include <linux/module.h> #include "s6e63m0_gamma.h" #define SLEEPMSEC 0x1000 #define ENDDEF 0x2000 #define DEFMASK 0xFF00 #define COMMAND_ONLY 0xFE #define DATA_ONLY 0xFF #define MIN_BRIGHTNESS 0 #define MAX_BRIGHTNESS 10 #define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL) struct s6e63m0 { struct device *dev; struct spi_device *spi; unsigned int power; unsigned int current_brightness; unsigned int gamma_mode; unsigned int gamma_table_count; struct lcd_device *ld; struct backlight_device *bd; struct lcd_platform_data *lcd_pd; }; static const unsigned short <API key>[] = { 0xF8, 0x01, DATA_ONLY, 0x27, DATA_ONLY, 0x27, DATA_ONLY, 0x07, DATA_ONLY, 0x07, DATA_ONLY, 0x54, DATA_ONLY, 0x9f, DATA_ONLY, 0x63, DATA_ONLY, 0x86, DATA_ONLY, 0x1a, DATA_ONLY, 0x33, DATA_ONLY, 0x0d, DATA_ONLY, 0x00, DATA_ONLY, 0x00, ENDDEF, 0x0000 }; static const unsigned short <API key>[] = { 0xf2, 0x02, DATA_ONLY, 0x03, DATA_ONLY, 0x1c, DATA_ONLY, 0x10, DATA_ONLY, 0x10, 0xf7, 0x03, DATA_ONLY, 0x00, DATA_ONLY, 0x00, ENDDEF, 0x0000 }; static const unsigned short SEQ_GAMMA_SETTING[] = { 0xfa, 0x00, DATA_ONLY, 0x18, DATA_ONLY, 0x08, DATA_ONLY, 0x24, DATA_ONLY, 0x64, DATA_ONLY, 0x56, DATA_ONLY, 0x33, DATA_ONLY, 0xb6, DATA_ONLY, 0xba, DATA_ONLY, 0xa8, DATA_ONLY, 0xac, DATA_ONLY, 0xb1, DATA_ONLY, 0x9d, DATA_ONLY, 0xc1, DATA_ONLY, 0xc1, DATA_ONLY, 0xb7, DATA_ONLY, 0x00, DATA_ONLY, 0x9c, DATA_ONLY, 0x00, DATA_ONLY, 0x9f, DATA_ONLY, 0x00, DATA_ONLY, 0xd6, 0xfa, 0x01, ENDDEF, 0x0000 }; static const unsigned short <API key>[] = { 0xf6, 0x00, DATA_ONLY, 0x8c, DATA_ONLY, 0x07, 0xb3, 0xc, 0xb5, 0x2c, DATA_ONLY, 0x12, DATA_ONLY, 0x0c, DATA_ONLY, 0x0a, DATA_ONLY, 0x10, DATA_ONLY, 0x0e, DATA_ONLY, 0x17, DATA_ONLY, 0x13, DATA_ONLY, 0x1f, DATA_ONLY, 0x1a, DATA_ONLY, 0x2a, DATA_ONLY, 0x24, DATA_ONLY, 0x1f, DATA_ONLY, 0x1b, DATA_ONLY, 0x1a, DATA_ONLY, 0x17, DATA_ONLY, 0x2b, DATA_ONLY, 0x26, DATA_ONLY, 0x22, DATA_ONLY, 0x20, DATA_ONLY, 0x3a, DATA_ONLY, 0x34, DATA_ONLY, 0x30, DATA_ONLY, 0x2c, DATA_ONLY, 0x29, DATA_ONLY, 0x26, DATA_ONLY, 0x25, DATA_ONLY, 0x23, DATA_ONLY, 0x21, DATA_ONLY, 0x20, DATA_ONLY, 0x1e, DATA_ONLY, 0x1e, 0xb6, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x11, DATA_ONLY, 0x22, DATA_ONLY, 0x33, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x55, DATA_ONLY, 0x55, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, 0xb7, 0x2c, DATA_ONLY, 0x12, DATA_ONLY, 0x0c, DATA_ONLY, 0x0a, DATA_ONLY, 0x10, DATA_ONLY, 0x0e, DATA_ONLY, 0x17, DATA_ONLY, 0x13, DATA_ONLY, 0x1f, DATA_ONLY, 0x1a, DATA_ONLY, 0x2a, DATA_ONLY, 0x24, DATA_ONLY, 0x1f, DATA_ONLY, 0x1b, DATA_ONLY, 0x1a, DATA_ONLY, 0x17, DATA_ONLY, 0x2b, DATA_ONLY, 0x26, DATA_ONLY, 0x22, DATA_ONLY, 0x20, DATA_ONLY, 0x3a, DATA_ONLY, 0x34, DATA_ONLY, 0x30, DATA_ONLY, 0x2c, DATA_ONLY, 0x29, DATA_ONLY, 0x26, DATA_ONLY, 0x25, DATA_ONLY, 0x23, DATA_ONLY, 0x21, DATA_ONLY, 0x20, DATA_ONLY, 0x1e, DATA_ONLY, 0x1e, 0xb8, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x11, DATA_ONLY, 0x22, DATA_ONLY, 0x33, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x55, DATA_ONLY, 0x55, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, 0xb9, 0x2c, DATA_ONLY, 0x12, DATA_ONLY, 0x0c, DATA_ONLY, 0x0a, DATA_ONLY, 0x10, DATA_ONLY, 0x0e, DATA_ONLY, 0x17, DATA_ONLY, 0x13, DATA_ONLY, 0x1f, DATA_ONLY, 0x1a, DATA_ONLY, 0x2a, DATA_ONLY, 0x24, DATA_ONLY, 0x1f, DATA_ONLY, 0x1b, DATA_ONLY, 0x1a, DATA_ONLY, 0x17, DATA_ONLY, 0x2b, DATA_ONLY, 0x26, DATA_ONLY, 0x22, DATA_ONLY, 0x20, DATA_ONLY, 0x3a, DATA_ONLY, 0x34, DATA_ONLY, 0x30, DATA_ONLY, 0x2c, DATA_ONLY, 0x29, DATA_ONLY, 0x26, DATA_ONLY, 0x25, DATA_ONLY, 0x23, DATA_ONLY, 0x21, DATA_ONLY, 0x20, DATA_ONLY, 0x1e, DATA_ONLY, 0x1e, 0xba, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x11, DATA_ONLY, 0x22, DATA_ONLY, 0x33, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x44, DATA_ONLY, 0x55, DATA_ONLY, 0x55, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, DATA_ONLY, 0x66, 0xc1, 0x4d, DATA_ONLY, 0x96, DATA_ONLY, 0x1d, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x01, DATA_ONLY, 0xdf, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x03, DATA_ONLY, 0x1f, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x00, DATA_ONLY, 0x03, DATA_ONLY, 0x06, DATA_ONLY, 0x09, DATA_ONLY, 0x0d, DATA_ONLY, 0x0f, DATA_ONLY, 0x12, DATA_ONLY, 0x15, DATA_ONLY, 0x18, 0xb2, 0x10, DATA_ONLY, 0x10, DATA_ONLY, 0x0b, DATA_ONLY, 0x05, ENDDEF, 0x0000 }; static const unsigned short SEQ_ACL_ON[] = { /* ACL on */ 0xc0, 0x01, ENDDEF, 0x0000 }; static const unsigned short SEQ_ACL_OFF[] = { /* ACL off */ 0xc0, 0x00, ENDDEF, 0x0000 }; static const unsigned short SEQ_ELVSS_ON[] = { /* ELVSS on */ 0xb1, 0x0b, ENDDEF, 0x0000 }; static const unsigned short SEQ_ELVSS_OFF[] = { /* ELVSS off */ 0xb1, 0x0a, ENDDEF, 0x0000 }; static const unsigned short SEQ_STAND_BY_OFF[] = { 0x11, COMMAND_ONLY, ENDDEF, 0x0000 }; static const unsigned short SEQ_STAND_BY_ON[] = { 0x10, COMMAND_ONLY, ENDDEF, 0x0000 }; static const unsigned short SEQ_DISPLAY_ON[] = { 0x29, COMMAND_ONLY, ENDDEF, 0x0000 }; static int <API key>(struct s6e63m0 *lcd, int addr, int data) { u16 buf[1]; struct spi_message msg; struct spi_transfer xfer = { .len = 2, .tx_buf = buf, }; buf[0] = (addr << 8) | data; spi_message_init(&msg); <API key>(&xfer, &msg); return spi_sync(lcd->spi, &msg); } static int s6e63m0_spi_write(struct s6e63m0 *lcd, unsigned char address, unsigned char command) { int ret = 0; if (address != DATA_ONLY) ret = <API key>(lcd, 0x0, address); if (command != COMMAND_ONLY) ret = <API key>(lcd, 0x1, command); return ret; } static int <API key>(struct s6e63m0 *lcd, const unsigned short *wbuf) { int ret = 0, i = 0; while ((wbuf[i] & DEFMASK) != ENDDEF) { if ((wbuf[i] & DEFMASK) != SLEEPMSEC) { ret = s6e63m0_spi_write(lcd, wbuf[i], wbuf[i+1]); if (ret) break; } else udelay(wbuf[i+1]*1000); i += 2; } return ret; } static int _s6e63m0_gamma_ctl(struct s6e63m0 *lcd, const unsigned int *gamma) { unsigned int i = 0; int ret = 0; /* disable gamma table updating. */ ret = s6e63m0_spi_write(lcd, 0xfa, 0x00); if (ret) { dev_err(lcd->dev, "failed to disable gamma table updating.\n"); goto gamma_err; } for (i = 0 ; i < GAMMA_TABLE_COUNT; i++) { ret = s6e63m0_spi_write(lcd, DATA_ONLY, gamma[i]); if (ret) { dev_err(lcd->dev, "failed to set gamma table.\n"); goto gamma_err; } } /* update gamma table. */ ret = s6e63m0_spi_write(lcd, 0xfa, 0x01); if (ret) dev_err(lcd->dev, "failed to update gamma table.\n"); gamma_err: return ret; } static int s6e63m0_gamma_ctl(struct s6e63m0 *lcd, int gamma) { int ret = 0; ret = _s6e63m0_gamma_ctl(lcd, gamma_table.gamma_22_table[gamma]); return ret; } static int s6e63m0_ldi_init(struct s6e63m0 *lcd) { int ret, i; const unsigned short *init_seq[] = { <API key>, <API key>, SEQ_GAMMA_SETTING, <API key>, SEQ_ACL_ON, SEQ_ELVSS_ON, }; for (i = 0; i < ARRAY_SIZE(init_seq); i++) { ret = <API key>(lcd, init_seq[i]); if (ret) break; } return ret; } static int s6e63m0_ldi_enable(struct s6e63m0 *lcd) { int ret = 0, i; const unsigned short *enable_seq[] = { SEQ_STAND_BY_OFF, SEQ_DISPLAY_ON, }; for (i = 0; i < ARRAY_SIZE(enable_seq); i++) { ret = <API key>(lcd, enable_seq[i]); if (ret) break; } return ret; } static int s6e63m0_ldi_disable(struct s6e63m0 *lcd) { int ret; ret = <API key>(lcd, SEQ_STAND_BY_ON); return ret; } static int s6e63m0_power_on(struct s6e63m0 *lcd) { int ret = 0; struct lcd_platform_data *pd = NULL; struct backlight_device *bd = NULL; pd = lcd->lcd_pd; if (!pd) { dev_err(lcd->dev, "platform data is NULL.\n"); return -EFAULT; } bd = lcd->bd; if (!bd) { dev_err(lcd->dev, "backlight device is NULL.\n"); return -EFAULT; } if (!pd->power_on) { dev_err(lcd->dev, "power_on is NULL.\n"); return -EFAULT; } else { pd->power_on(lcd->ld, 1); mdelay(pd->power_on_delay); } if (!pd->reset) { dev_err(lcd->dev, "reset is NULL.\n"); return -EFAULT; } else { pd->reset(lcd->ld); mdelay(pd->reset_delay); } ret = s6e63m0_ldi_init(lcd); if (ret) { dev_err(lcd->dev, "failed to initialize ldi.\n"); return ret; } ret = s6e63m0_ldi_enable(lcd); if (ret) { dev_err(lcd->dev, "failed to enable ldi.\n"); return ret; } /* set brightness to current value after power on or resume. */ ret = s6e63m0_gamma_ctl(lcd, bd->props.brightness); if (ret) { dev_err(lcd->dev, "lcd gamma setting failed.\n"); return ret; } return 0; } static int s6e63m0_power_off(struct s6e63m0 *lcd) { int ret = 0; struct lcd_platform_data *pd = NULL; pd = lcd->lcd_pd; if (!pd) { dev_err(lcd->dev, "platform data is NULL.\n"); return -EFAULT; } ret = s6e63m0_ldi_disable(lcd); if (ret) { dev_err(lcd->dev, "lcd setting failed.\n"); return -EIO; } mdelay(pd->power_off_delay); if (!pd->power_on) { dev_err(lcd->dev, "power_on is NULL.\n"); return -EFAULT; } else pd->power_on(lcd->ld, 0); return 0; } static int s6e63m0_power(struct s6e63m0 *lcd, int power) { int ret = 0; if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->power)) ret = s6e63m0_power_on(lcd); else if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->power)) ret = s6e63m0_power_off(lcd); if (!ret) lcd->power = power; return ret; } static int s6e63m0_set_power(struct lcd_device *ld, int power) { struct s6e63m0 *lcd = lcd_get_data(ld); if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN && power != FB_BLANK_NORMAL) { dev_err(lcd->dev, "power value should be 0, 1 or 4.\n"); return -EINVAL; } return s6e63m0_power(lcd, power); } static int s6e63m0_get_power(struct lcd_device *ld) { struct s6e63m0 *lcd = lcd_get_data(ld); return lcd->power; } static int <API key>(struct backlight_device *bd) { return bd->props.brightness; } static int <API key>(struct backlight_device *bd) { int ret = 0, brightness = bd->props.brightness; struct s6e63m0 *lcd = bl_get_data(bd); if (brightness < MIN_BRIGHTNESS || brightness > bd->props.max_brightness) { dev_err(&bd->dev, "lcd brightness should be %d to %d.\n", MIN_BRIGHTNESS, MAX_BRIGHTNESS); return -EINVAL; } ret = s6e63m0_gamma_ctl(lcd, bd->props.brightness); if (ret) { dev_err(&bd->dev, "lcd brightness setting failed.\n"); return -EIO; } return ret; } static struct lcd_ops s6e63m0_lcd_ops = { .set_power = s6e63m0_set_power, .get_power = s6e63m0_get_power, }; static const struct backlight_ops <API key> = { .get_brightness = <API key>, .update_status = <API key>, }; static ssize_t <API key>(struct device *dev, struct device_attribute *attr, char *buf) { struct s6e63m0 *lcd = dev_get_drvdata(dev); char temp[10]; switch (lcd->gamma_mode) { case 0: sprintf(temp, "2.2 mode\n"); strcat(buf, temp); break; case 1: sprintf(temp, "1.9 mode\n"); strcat(buf, temp); break; case 2: sprintf(temp, "1.7 mode\n"); strcat(buf, temp); break; default: dev_info(dev, "gamma mode could be 0:2.2, 1:1.9 or 2:1.7)n"); break; } return strlen(buf); } static ssize_t <API key>(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) { struct s6e63m0 *lcd = dev_get_drvdata(dev); struct backlight_device *bd = NULL; int brightness, rc; rc = strict_strtoul(buf, 0, (unsigned long *)&lcd->gamma_mode); if (rc < 0) return rc; bd = lcd->bd; brightness = bd->props.brightness; switch (lcd->gamma_mode) { case 0: _s6e63m0_gamma_ctl(lcd, gamma_table.gamma_22_table[brightness]); break; case 1: _s6e63m0_gamma_ctl(lcd, gamma_table.gamma_19_table[brightness]); break; case 2: _s6e63m0_gamma_ctl(lcd, gamma_table.gamma_17_table[brightness]); break; default: dev_info(dev, "gamma mode could be 0:2.2, 1:1.9 or 2:1.7\n"); _s6e63m0_gamma_ctl(lcd, gamma_table.gamma_22_table[brightness]); break; } return len; } static DEVICE_ATTR(gamma_mode, 0644, <API key>, <API key>); static ssize_t <API key>(struct device *dev, struct device_attribute *attr, char *buf) { struct s6e63m0 *lcd = dev_get_drvdata(dev); char temp[3]; sprintf(temp, "%d\n", lcd->gamma_table_count); strcpy(buf, temp); return strlen(buf); } static DEVICE_ATTR(gamma_table, 0444, <API key>, NULL); static int __devinit s6e63m0_probe(struct spi_device *spi) { int ret = 0; struct s6e63m0 *lcd = NULL; struct lcd_device *ld = NULL; struct backlight_device *bd = NULL; struct <API key> props; lcd = kzalloc(sizeof(struct s6e63m0), GFP_KERNEL); if (!lcd) return -ENOMEM; /* s6e63m0 lcd panel uses 3-wire 9bits SPI Mode. */ spi->bits_per_word = 9; ret = spi_setup(spi); if (ret < 0) { dev_err(&spi->dev, "spi setup failed.\n"); goto out_free_lcd; } lcd->spi = spi; lcd->dev = &spi->dev; lcd->lcd_pd = (struct lcd_platform_data *)spi->dev.platform_data; if (!lcd->lcd_pd) { dev_err(&spi->dev, "platform data is NULL.\n"); goto out_free_lcd; } ld = lcd_device_register("s6e63m0", &spi->dev, lcd, &s6e63m0_lcd_ops); if (IS_ERR(ld)) { ret = PTR_ERR(ld); goto out_free_lcd; } lcd->ld = ld; memset(&props, 0, sizeof(struct <API key>)); props.type = BACKLIGHT_RAW; props.max_brightness = MAX_BRIGHTNESS; bd = <API key>("s6e63m0bl-bl", &spi->dev, lcd, &<API key>, &props); if (IS_ERR(bd)) { ret = PTR_ERR(bd); goto out_lcd_unregister; } bd->props.brightness = MAX_BRIGHTNESS; lcd->bd = bd; /* * it gets gamma table count available so it gets user * know that. */ lcd->gamma_table_count = sizeof(gamma_table) / (MAX_GAMMA_LEVEL * sizeof(int)); ret = device_create_file(&(spi->dev), &dev_attr_gamma_mode); if (ret < 0) dev_err(&(spi->dev), "failed to add sysfs entries\n"); ret = device_create_file(&(spi->dev), &<API key>); if (ret < 0) dev_err(&(spi->dev), "failed to add sysfs entries\n"); /* * if lcd panel was on from bootloader like u-boot then * do not lcd on. */ if (!lcd->lcd_pd->lcd_enabled) { /* * if lcd panel was off from bootloader then * current lcd status is powerdown and then * it enables lcd panel. */ lcd->power = FB_BLANK_POWERDOWN; s6e63m0_power(lcd, FB_BLANK_UNBLANK); } else lcd->power = FB_BLANK_UNBLANK; dev_set_drvdata(&spi->dev, lcd); dev_info(&spi->dev, "s6e63m0 panel driver has been probed.\n"); return 0; out_lcd_unregister: <API key>(ld); out_free_lcd: kfree(lcd); return ret; } static int __devexit s6e63m0_remove(struct spi_device *spi) { struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev); s6e63m0_power(lcd, FB_BLANK_POWERDOWN); device_remove_file(&spi->dev, &<API key>); device_remove_file(&spi->dev, &dev_attr_gamma_mode); <API key>(lcd->bd); <API key>(lcd->ld); kfree(lcd); return 0; } #if defined(CONFIG_PM) static unsigned int before_power; static int s6e63m0_suspend(struct spi_device *spi, pm_message_t mesg) { int ret = 0; struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev); dev_dbg(&spi->dev, "lcd->power = %d\n", lcd->power); before_power = lcd->power; /* * when lcd panel is suspend, lcd panel becomes off * regardless of status. */ ret = s6e63m0_power(lcd, FB_BLANK_POWERDOWN); return ret; } static int s6e63m0_resume(struct spi_device *spi) { int ret = 0; struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev); /* * after suspended, if lcd panel status is FB_BLANK_UNBLANK * (at that time, before_power is FB_BLANK_UNBLANK) then * it changes that status to FB_BLANK_POWERDOWN to get lcd on. */ if (before_power == FB_BLANK_UNBLANK) lcd->power = FB_BLANK_POWERDOWN; dev_dbg(&spi->dev, "before_power = %d\n", before_power); ret = s6e63m0_power(lcd, before_power); return ret; } #else #define s6e63m0_suspend NULL #define s6e63m0_resume NULL #endif /* Power down all displays on reboot, poweroff or halt. */ static void s6e63m0_shutdown(struct spi_device *spi) { struct s6e63m0 *lcd = dev_get_drvdata(&spi->dev); s6e63m0_power(lcd, FB_BLANK_POWERDOWN); } static struct spi_driver s6e63m0_driver = { .driver = { .name = "s6e63m0", .bus = &spi_bus_type, .owner = THIS_MODULE, }, .probe = s6e63m0_probe, .remove = __devexit_p(s6e63m0_remove), .shutdown = s6e63m0_shutdown, .suspend = s6e63m0_suspend, .resume = s6e63m0_resume, }; static int __init s6e63m0_init(void) { return spi_register_driver(&s6e63m0_driver); } static void __exit s6e63m0_exit(void) { <API key>(&s6e63m0_driver); } module_init(s6e63m0_init); module_exit(s6e63m0_exit); MODULE_AUTHOR("InKi Dae <inki.dae@samsung.com>"); MODULE_DESCRIPTION("S6E63M0 LCD Driver"); MODULE_LICENSE("GPL");
<?php namespace Symfony\Component\Console\Tests\Helper; use Symfony\Component\Console\Helper\DialogHelper; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Output\StreamOutput; class DialogHelperTest extends \<API key> { public function testAsk() { $dialog = new DialogHelper(); $dialog->setInputStream($this->getInputStream("\n8AM\n")); $this->assertEquals('2PM', $dialog->ask($this->getOutputStream(), 'What time is it?', '2PM')); $this->assertEquals('8AM', $dialog->ask($output = $this->getOutputStream(), 'What time is it?', '2PM')); rewind($output->getStream()); $this->assertEquals('What time is it?', stream_get_contents($output->getStream())); } public function testAskConfirmation() { $dialog = new DialogHelper(); $dialog->setInputStream($this->getInputStream("\n\n")); $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?')); $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); $dialog->setInputStream($this->getInputStream("y\nyes\n")); $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); $this->assertTrue($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', false)); $dialog->setInputStream($this->getInputStream("n\nno\n")); $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); $this->assertFalse($dialog->askConfirmation($this->getOutputStream(), 'Do you like French fries?', true)); } public function testAskAndValidate() { $dialog = new DialogHelper(); $helperSet = new HelperSet(array(new FormatterHelper())); $dialog->setHelperSet($helperSet); $question ='What color was the white horse of Henry IV?'; $error = 'This is not a color!'; $validator = function ($color) use ($error) { if (!in_array($color, array('white', 'black'))) { throw new \<API key>($error); } return $color; }; $dialog->setInputStream($this->getInputStream("\nblack\n")); $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); $this->assertEquals('black', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); $dialog->setInputStream($this->getInputStream("green\nyellow\norange\n")); try { $this->assertEquals('white', $dialog->askAndValidate($this->getOutputStream(), $question, $validator, 2, 'white')); $this->fail(); } catch (\<API key> $e) { $this->assertEquals($error, $e->getMessage()); } } protected function getInputStream($input) { $stream = fopen('php://memory', 'r+', false); fputs($stream, $input); rewind($stream); return $stream; } protected function getOutputStream() { return new StreamOutput(fopen('php://memory', 'r+', false)); } }
#ifndef _ET61X251_H_ #define _ET61X251_H_ #include <linux/version.h> #include <linux/usb.h> #include <linux/videodev2.h> #include <media/v4l2-common.h> #include <linux/device.h> #include <linux/list.h> #include <linux/spinlock.h> #include <linux/time.h> #include <linux/wait.h> #include <linux/types.h> #include <linux/param.h> #include <linux/rwsem.h> #include <linux/mutex.h> #include <linux/stddef.h> #include <linux/string.h> #include <linux/kref.h> #include "et61x251_sensor.h" #define ET61X251_DEBUG #define <API key> 2 #define <API key> 64 #define <API key> 0 #define <API key> 0 #define ET61X251_MAX_FRAMES 32 #define <API key> 0 #define ET61X251_URBS 2 #define <API key> 7 #define <API key> 13 #define <API key> msecs_to_jiffies(2 * <API key>) #define <API key> 100 #define <API key> 2 static const struct usb_device_id et61x251_id_table[] = { { USB_DEVICE(0x102c, 0x6151), }, { USB_DEVICE(0x102c, 0x6251), }, { USB_DEVICE(0x102c, 0x6253), }, { USB_DEVICE(0x102c, 0x6254), }, { USB_DEVICE(0x102c, 0x6255), }, { USB_DEVICE(0x102c, 0x6256), }, { USB_DEVICE(0x102c, 0x6257), }, { USB_DEVICE(0x102c, 0x6258), }, { USB_DEVICE(0x102c, 0x6259), }, { USB_DEVICE(0x102c, 0x625a), }, { USB_DEVICE(0x102c, 0x625b), }, { USB_DEVICE(0x102c, 0x625c), }, { USB_DEVICE(0x102c, 0x625d), }, { USB_DEVICE(0x102c, 0x625e), }, { USB_DEVICE(0x102c, 0x625f), }, { USB_DEVICE(0x102c, 0x6260), }, { USB_DEVICE(0x102c, 0x6261), }, { USB_DEVICE(0x102c, 0x6262), }, { USB_DEVICE(0x102c, 0x6263), }, { USB_DEVICE(0x102c, 0x6264), }, { USB_DEVICE(0x102c, 0x6265), }, { USB_DEVICE(0x102c, 0x6266), }, { USB_DEVICE(0x102c, 0x6267), }, { USB_DEVICE(0x102c, 0x6268), }, { USB_DEVICE(0x102c, 0x6269), }, { } }; <API key> enum <API key> { F_UNUSED, F_QUEUED, F_GRABBING, F_DONE, F_ERROR, }; struct et61x251_frame_t { void* bufmem; struct v4l2_buffer buf; enum <API key> state; struct list_head frame; unsigned long vma_use_count; }; enum et61x251_dev_state { DEV_INITIALIZED = 0x01, DEV_DISCONNECTED = 0x02, DEV_MISCONFIGURED = 0x04, }; enum et61x251_io_method { IO_NONE, IO_READ, IO_MMAP, }; enum <API key> { STREAM_OFF, STREAM_INTERRUPT, STREAM_ON, }; struct et61x251_sysfs_attr { u8 reg, i2c_reg; }; struct <API key> { u8 force_munmap; u16 frame_timeout; }; static DEFINE_MUTEX(et61x251_sysfs_lock); static DECLARE_RWSEM(et61x251_dev_lock); struct et61x251_device { struct video_device* v4ldev; struct et61x251_sensor sensor; struct usb_device* usbdev; struct urb* urb[ET61X251_URBS]; void* transfer_buffer[ET61X251_URBS]; u8* control_buffer; struct et61x251_frame_t *frame_current, frame[ET61X251_MAX_FRAMES]; struct list_head inqueue, outqueue; u32 frame_count, nbuffers, nreadbuffers; enum et61x251_io_method io; enum <API key> stream; struct <API key> compression; struct et61x251_sysfs_attr sysfs; struct <API key> module_param; struct kref kref; enum et61x251_dev_state state; u8 users; struct completion probe; struct mutex open_mutex, fileop_mutex; spinlock_t queue_lock; wait_queue_head_t wait_open, wait_frame, wait_stream; }; struct et61x251_device* et61x251_match_id(struct et61x251_device* cam, const struct usb_device_id *id) { return usb_match_id(usb_ifnum_to_if(cam->usbdev, 0), id) ? cam : NULL; } void <API key>(struct et61x251_device* cam, const struct et61x251_sensor* sensor) { memcpy(&cam->sensor, sensor, sizeof(struct et61x251_sensor)); } #undef DBG #undef KDBG #ifdef ET61X251_DEBUG # define DBG(level, fmt, args...) \ do { \ if (debug >= (level)) { \ if ((level) == 1) \ dev_err(&cam->usbdev->dev, fmt "\n", ## args); \ else if ((level) == 2) \ dev_info(&cam->usbdev->dev, fmt "\n", ## args); \ else if ((level) >= 3) \ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", \ __FILE__, __func__, __LINE__ , ## args); \ } \ } while (0) # define KDBG(level, fmt, args...) \ do { \ if (debug >= (level)) { \ if ((level) == 1 || (level) == 2) \ pr_info("et61x251: " fmt "\n", ## args); \ else if ((level) == 3) \ pr_debug("sn9c102: [%s:%s:%d] " fmt "\n", __FILE__, \ __func__, __LINE__ , ## args); \ } \ } while (0) # define V4LDBG(level, name, cmd) \ do { \ if (debug >= (level)) \ v4l_print_ioctl(name, cmd); \ } while (0) #else # define DBG(level, fmt, args...) do {;} while(0) # define KDBG(level, fmt, args...) do {;} while(0) # define V4LDBG(level, name, cmd) do {;} while(0) #endif #undef PDBG #define PDBG(fmt, args...) \ dev_info(&cam->usbdev->dev, "[%s:%s:%d] " fmt "\n", __FILE__, __func__, \ __LINE__ , ## args) #undef PDBGG #define PDBGG(fmt, args...) do {;} while(0) /* placeholder */ #endif /* _ET61X251_H_ */
#ifndef __MLX5E_IPSEC_H__ #define __MLX5E_IPSEC_H__ #ifdef <API key> #include <linux/mlx5/device.h> #include <net/xfrm.h> #include <linux/idr.h> #include "accel/ipsec.h" #define <API key> 10 #define <API key> 0x80000000L struct mlx5e_priv; struct <API key> { atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; atomic64_t <API key>; }; struct mlx5e_ipsec_stats { u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 <API key>; u64 ipsec_add_sa_fail; u64 <API key>; u64 ipsec_del_sa_fail; u64 ipsec_cmd_drop; }; struct mlx5e_ipsec { struct mlx5e_priv *en_priv; DECLARE_HASHTABLE(sadb_rx, <API key>); bool no_trailer; spinlock_t sadb_rx_lock; /* Protects sadb_rx and halloc */ struct ida halloc; struct <API key> sw_stats; struct mlx5e_ipsec_stats stats; struct workqueue_struct *wq; }; struct <API key> { u32 esn; u8 trigger: 1; u8 overlap: 1; }; struct <API key> { struct hlist_node hlist; /* Item in SADB_RX hashtable */ struct <API key> esn_state; unsigned int handle; /* Handle in SADB_RX */ struct xfrm_state *x; struct mlx5e_ipsec *ipsec; struct mlx5_accel_esp_xfrm *xfrm; void *hw_context; void (*set_iv_op)(struct sk_buff *skb, struct xfrm_state *x, struct xfrm_offload *xo); }; void <API key>(void); int mlx5e_ipsec_init(struct mlx5e_priv *priv); void mlx5e_ipsec_cleanup(struct mlx5e_priv *priv); void <API key>(struct mlx5e_priv *priv); int <API key>(struct mlx5e_priv *priv); int <API key>(struct mlx5e_priv *priv, uint8_t *data); void <API key>(struct mlx5e_priv *priv); int <API key>(struct mlx5e_priv *priv, u64 *data); struct xfrm_state *<API key>(struct mlx5e_ipsec *dev, unsigned int handle); #else static inline void <API key>(void) { } static inline int mlx5e_ipsec_init(struct mlx5e_priv *priv) { return 0; } static inline void mlx5e_ipsec_cleanup(struct mlx5e_priv *priv) { } static inline void <API key>(struct mlx5e_priv *priv) { } static inline int <API key>(struct mlx5e_priv *priv) { return 0; } static inline int <API key>(struct mlx5e_priv *priv, uint8_t *data) { return 0; } static inline void <API key>(struct mlx5e_priv *priv) { } static inline int <API key>(struct mlx5e_priv *priv, u64 *data) { return 0; } #endif #endif /* __MLX5E_IPSEC_H__ */
/** @file * Logging functions */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #include <assert.h> #include "cpluff.h" #include "defines.h" #include "util.h" #include "internal.h" Contains information about installed loggers typedef struct logger_t { Pointer to logger cp_logger_func_t logger; Pointer to registering plug-in or NULL for the main program cp_plugin_t *plugin; User data pointer void *user_data; Minimum severity cp_log_severity_t min_severity; Selected environment or NULL cp_plugin_env_t *env_selection; } logger_t; /** * Updates the context logging limits. The caller must have locked the * context. */ static void <API key>(cp_context_t *context) { lnode_t *node; int nms = CP_LOG_NONE; node = list_first(context->env->loggers); while (node != NULL) { logger_t *lh = lnode_get(node); if (lh->min_severity < nms) { nms = lh->min_severity; } node = list_next(context->env->loggers, node); } context->env->log_min_severity = nms; } static int comp_logger(const void *p1, const void *p2) { const logger_t *l1 = p1; const logger_t *l2 = p2; return l1->logger != l2->logger; } CP_C_API cp_status_t cp_register_logger(cp_context_t *context, cp_logger_func_t logger, void *user_data, cp_log_severity_t min_severity) { logger_t l; logger_t *lh = NULL; lnode_t *node = NULL; cp_status_t status = CP_OK; CHECK_NOT_NULL(context); CHECK_NOT_NULL(logger); cpi_lock_context(context); <API key>(context, CPI_CF_LOGGER, __func__); do { // Check if logger already exists and allocate new holder if necessary l.logger = logger; if ((node = list_find(context->env->loggers, &l, comp_logger)) == NULL) { lh = malloc(sizeof(logger_t)); node = lnode_create(lh); if (lh == NULL || node == NULL) { status = CP_ERR_RESOURCE; break; } lh->logger = logger; lh->plugin = context->plugin; list_append(context->env->loggers, node); } else { lh = lnode_get(node); } // Initialize or update the logger holder lh->user_data = user_data; lh->min_severity = min_severity; // Update global limits <API key>(context); } while (0); // Report error if (status == CP_ERR_RESOURCE) { cpi_error(context, N_("Logger could not be registered due to insufficient memory.")); } else if (cpi_is_logged(context, CP_LOG_DEBUG)) { char owner[64]; /* TRANSLATORS: %s is the context owner */ cpi_debugf(context, N_("%s registered a logger."), cpi_context_owner(context, owner, sizeof(owner))); } cpi_unlock_context(context); // Release resources on error if (status != CP_OK) { if (node != NULL) { lnode_destroy(node); } if (lh != NULL) { free(lh); } } return status; } CP_C_API void <API key>(cp_context_t *context, cp_logger_func_t logger) { logger_t l; lnode_t *node; CHECK_NOT_NULL(context); CHECK_NOT_NULL(logger); cpi_lock_context(context); <API key>(context, CPI_CF_LOGGER, __func__); l.logger = logger; if ((node = list_find(context->env->loggers, &l, comp_logger)) != NULL) { logger_t *lh = lnode_get(node); list_delete(context->env->loggers, node); lnode_destroy(node); free(lh); <API key>(context); } if (cpi_is_logged(context, CP_LOG_DEBUG)) { char owner[64]; /* TRANSLATORS: %s is the context owner */ cpi_debugf(context, N_("%s unregistered a logger."), cpi_context_owner(context, owner, sizeof(owner))); } cpi_unlock_context(context); } static void do_log(cp_context_t *context, cp_log_severity_t severity, const char *msg) { lnode_t *node; const char *apid = NULL; assert(<API key>(context)); if (context->env-><API key>) { cpi_fatalf(_("Encountered a recursive logging request within a logger invocation.")); } if (context->plugin != NULL) { apid = context->plugin->plugin->identifier; } context->env-><API key>++; node = list_first(context->env->loggers); while (node != NULL) { logger_t *lh = lnode_get(node); if (severity >= lh->min_severity) { lh->logger(severity, msg, apid, lh->user_data); } node = list_next(context->env->loggers, node); } context->env-><API key> } CP_HIDDEN void cpi_log(cp_context_t *context, cp_log_severity_t severity, const char *msg) { assert(context != NULL); assert(msg != NULL); assert(severity >= CP_LOG_DEBUG && severity <= CP_LOG_ERROR); do_log(context, severity, _(msg)); } CP_HIDDEN void cpi_logf(cp_context_t *context, cp_log_severity_t severity, const char *msg, ...) { char buffer[256]; va_list va; assert(context != NULL); assert(msg != NULL); assert(severity >= CP_LOG_DEBUG && severity <= CP_LOG_ERROR); va_start(va, msg); vsnprintf(buffer, sizeof(buffer), _(msg), va); va_end(va); strcpy(buffer + sizeof(buffer)/sizeof(char) - 4, "..."); do_log(context, severity, buffer); } static void <API key>(list_t *list, lnode_t *node, void *plugin) { logger_t *lh = lnode_get(node); if (plugin == NULL || lh->plugin == plugin) { list_delete(list, node); lnode_destroy(node); free(lh); } } CP_HIDDEN void <API key>(list_t *loggers, cp_plugin_t *plugin) { list_process(loggers, plugin, <API key>); } CP_C_API void cp_log(cp_context_t *context, cp_log_severity_t severity, const char *msg) { CHECK_NOT_NULL(context); CHECK_NOT_NULL(msg); cpi_lock_context(context); <API key>(context, CPI_CF_LOGGER, __func__); if (severity < CP_LOG_DEBUG || severity > CP_LOG_ERROR) { cpi_fatalf(_("Illegal severity value in call to %s."), __func__); } if (cpi_is_logged(context, severity)) { do_log(context, severity, msg); } cpi_unlock_context(context); } CP_C_API int cp_is_logged(cp_context_t *context, cp_log_severity_t severity) { int is_logged; CHECK_NOT_NULL(context); cpi_lock_context(context); <API key>(context, CPI_CF_LOGGER, __func__); is_logged = cpi_is_logged(context, severity); cpi_unlock_context(context); return is_logged; }
#import <Bolts/BFURL.h> @interface BFURL (Internal) + (BFURL *)<API key>:(NSURL *)url; @end
#define pr_fmt(fmt) "mvebu-pmsu: " fmt #include <linux/clk.h> #include <linux/cpu_pm.h> #include <linux/cpufreq-dt.h> #include <linux/delay.h> #include <linux/init.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/mbus.h> #include <linux/of_address.h> #include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/pm_opp.h> #include <linux/resource.h> #include <linux/slab.h> #include <linux/smp.h> #include <asm/cacheflush.h> #include <asm/cp15.h> #include <asm/smp_scu.h> #include <asm/smp_plat.h> #include <asm/suspend.h> #include <asm/tlbflush.h> #include "common.h" #define PMSU_BASE_OFFSET 0x100 #define PMSU_REG_SIZE 0x1000 /* PMSU MP registers */ #define <API key>(cpu) ((cpu * 0x100) + 0x104) #define <API key> BIT(18) #define <API key> BIT(16) #define <API key> BIT(20) #define <API key>(cpu) ((cpu * 0x100) + 0x108) #define <API key> BIT(0) #define <API key>(cpu) ((cpu * 0x100) + 0x10c) #define <API key> BIT(16) #define <API key> BIT(17) #define <API key> BIT(20) #define <API key> BIT(21) #define <API key> BIT(22) #define <API key> BIT(24) #define <API key> BIT(25) #define <API key>(cpu) ((cpu * 0x100) + 0x120) #define <API key> BIT(1) #define <API key> BIT(17) #define <API key>(cpu) ((cpu * 0x100) + 0x124) /* PMSU fabric registers */ #define L2C_NFABRIC_PM_CTL 0x4 #define <API key> BIT(20) /* PMSU delay registers */ #define <API key> 0xF04 #define <API key> BIT(1) #define <API key> 0xFFFE #define <API key> 0x64 /* CA9 MPcore SoC Control registers */ #define MPCORE_RESET_CTL 0x64 #define MPCORE_RESET_CTL_L2 BIT(0) #define <API key> BIT(16) #define SRAM_PHYS_BASE 0xFFFF0000 #define BOOTROM_BASE 0xFFF00000 #define BOOTROM_SIZE 0x100000 #define <API key> 0x9 #define <API key> 0x1 extern void <API key>(void); extern void ll_enable_coherency(void); extern void <API key>(void); extern void <API key>(void); static phys_addr_t pmsu_mp_phys_base; static void __iomem *pmsu_mp_base; static void *mvebu_cpu_resume; static const struct of_device_id of_pmsu_table[] = { { .compatible = "marvell,armada-370-pmsu", }, { .compatible = "marvell,armada-370-xp-pmsu", }, { .compatible = "marvell,armada-380-pmsu", }, { /* end of list */ }, }; void <API key>(int hw_cpu, void *boot_addr) { writel(virt_to_phys(boot_addr), pmsu_mp_base + <API key>(hw_cpu)); } extern unsigned char mvebu_boot_wa_start; extern unsigned char mvebu_boot_wa_end; /* * This function sets up the boot address workaround needed for SMP * boot on Armada 375 Z1 and cpuidle on Armada 370. It unmaps the * BootROM Mbus window, and instead remaps a crypto SRAM into which a * custom piece of code is copied to replace the problematic BootROM. */ int <API key>(unsigned int crypto_eng_target, unsigned int <API key>, phys_addr_t resume_addr_reg) { void __iomem *sram_virt_base; u32 code_len = &mvebu_boot_wa_end - &mvebu_boot_wa_start; <API key>(BOOTROM_BASE, BOOTROM_SIZE); <API key>(crypto_eng_target, <API key>, SRAM_PHYS_BASE, SZ_64K); sram_virt_base = ioremap(SRAM_PHYS_BASE, SZ_64K); if (!sram_virt_base) { pr_err("Unable to map SRAM to setup the boot address WA\n"); return -ENOMEM; } memcpy(sram_virt_base, &mvebu_boot_wa_start, code_len); /* * The last word of the code copied in SRAM must contain the * physical base address of the PMSU register. We * intentionally store this address in the native endianness * of the system. */ __raw_writel((unsigned long)resume_addr_reg, sram_virt_base + code_len - 4); iounmap(sram_virt_base); return 0; } static int __init mvebu_v7_pmsu_init(void) { struct device_node *np; struct resource res; int ret = 0; np = <API key>(NULL, of_pmsu_table); if (!np) return 0; pr_info("Initializing Power Management Service Unit\n"); if (<API key>(np, 0, &res)) { pr_err("unable to get resource\n"); ret = -ENOENT; goto out; } if (<API key>(np, "marvell,armada-370-xp-pmsu")) { pr_warn(FW_WARN "deprecated pmsu binding\n"); res.start = res.start - PMSU_BASE_OFFSET; res.end = res.start + PMSU_REG_SIZE - 1; } if (!request_mem_region(res.start, resource_size(&res), np->full_name)) { pr_err("unable to request region\n"); ret = -EBUSY; goto out; } pmsu_mp_phys_base = res.start; pmsu_mp_base = ioremap(res.start, resource_size(&res)); if (!pmsu_mp_base) { pr_err("unable to map registers\n"); release_mem_region(res.start, resource_size(&res)); ret = -ENOMEM; goto out; } out: of_node_put(np); return ret; } static void <API key>(void) { u32 reg; if (pmsu_mp_base == NULL) return; /* Enable L2 & Fabric powerdown in Deep-Idle mode - Fabric */ reg = readl(pmsu_mp_base + L2C_NFABRIC_PM_CTL); reg |= <API key>; writel(reg, pmsu_mp_base + L2C_NFABRIC_PM_CTL); } enum <API key> { PMSU_PREPARE_NORMAL = 0, <API key> = BIT(0), <API key> = BIT(1), }; /* No locking is needed because we only access per-CPU registers */ static int <API key>(unsigned long flags) { unsigned int hw_cpu = cpu_logical_map(smp_processor_id()); u32 reg; if (pmsu_mp_base == NULL) return -EINVAL; /* * Adjust the PMSU configuration to wait for WFI signal, enable * IRQ and FIQ as wakeup events, set wait for snoop queue empty * indication and mask IRQ and FIQ from CPU */ reg = readl(pmsu_mp_base + <API key>(hw_cpu)); reg |= <API key> | <API key> | <API key> | <API key> | <API key> | <API key>; writel(reg, pmsu_mp_base + <API key>(hw_cpu)); reg = readl(pmsu_mp_base + <API key>(hw_cpu)); /* ask HW to power down the L2 Cache if needed */ if (flags & <API key>) reg |= <API key>; /* request power down */ reg |= <API key>; writel(reg, pmsu_mp_base + <API key>(hw_cpu)); if (flags & <API key>) { /* Disable snoop disable by HW - SW is taking care of it */ reg = readl(pmsu_mp_base + <API key>(hw_cpu)); reg |= <API key>; writel(reg, pmsu_mp_base + <API key>(hw_cpu)); } return 0; } int <API key>(unsigned long deepidle) { unsigned long flags = <API key>; int ret; if (deepidle) flags |= <API key>; ret = <API key>(flags); if (ret) return ret; <API key>(all); <API key>(); dsb(); wfi(); /* If we are here, wfi failed. As processors run out of * coherency for some time, tlbs might be stale, so flush them */ local_flush_tlb_all(); ll_enable_coherency(); /* Test the CR_C bit and set it if it was cleared */ asm volatile( "mrc p15, 0, r0, c1, c0, 0 \n\t" "tst r0, %0 \n\t" "orreq r0, r0, #(1 << 2) \n\t" "mcreq p15, 0, r0, c1, c0, 0 \n\t" "isb " : : "Ir" (CR_C) : "r0"); pr_debug("Failed to suspend the system\n"); return 0; } static int <API key>(unsigned long deepidle) { return cpu_suspend(deepidle, <API key>); } int <API key>(unsigned long deepidle) { unsigned long flags = 0; if (deepidle) flags |= <API key>; <API key>(flags); /* * Already flushed cache, but do it again as the outer cache * functions dirty the cache with spinlocks */ <API key>(louis); scu_power_mode(mvebu_get_scu_base(), SCU_PM_POWEROFF); cpu_do_idle(); return 1; } static int <API key>(unsigned long deepidle) { return cpu_suspend(false, <API key>); } /* No locking is needed because we only access per-CPU registers */ void <API key>(void) { unsigned int hw_cpu = cpu_logical_map(smp_processor_id()); u32 reg; if (pmsu_mp_base == NULL) return; /* cancel ask HW to power down the L2 Cache if possible */ reg = readl(pmsu_mp_base + <API key>(hw_cpu)); reg &= ~<API key>; writel(reg, pmsu_mp_base + <API key>(hw_cpu)); /* cancel Enable wakeup events and mask interrupts */ reg = readl(pmsu_mp_base + <API key>(hw_cpu)); reg &= ~(<API key> | <API key>); reg &= ~<API key>; reg &= ~<API key>; reg &= ~(<API key> | <API key>); writel(reg, pmsu_mp_base + <API key>(hw_cpu)); } static int <API key>(struct notifier_block *self, unsigned long action, void *hcpu) { if (action == CPU_PM_ENTER) { unsigned int hw_cpu = cpu_logical_map(smp_processor_id()); <API key>(hw_cpu, mvebu_cpu_resume); } else if (action == CPU_PM_EXIT) { <API key>(); } return NOTIFY_OK; } static struct notifier_block <API key> = { .notifier_call = <API key>, }; static struct platform_device <API key>; static int broken_idle(struct device_node *np) { if (<API key>(np, "broken-idle")) { pr_warn("CPU idle is currently broken: disabling\n"); return 1; } return 0; } static __init int <API key>(void) { struct device_node *np; phys_addr_t redirect_reg; np = <API key>(NULL, NULL, "marvell,coherency-fabric"); if (!np) return -ENODEV; if (broken_idle(np)) goto end; /* * On Armada 370, there is "a slow exit process from the deep * idle state due to heavy L1/L2 cache cleanup operations * performed by the BootROM software". To avoid this, we * replace the restart code of the bootrom by a a simple jump * to the boot address. Then the code located at this boot * address will take care of the initialization. */ redirect_reg = pmsu_mp_phys_base + <API key>(0); <API key>(<API key>, <API key>, redirect_reg); mvebu_cpu_resume = <API key>; <API key>.dev.platform_data = <API key>; <API key>.name = "cpuidle-armada-370"; end: of_node_put(np); return 0; } static __init int <API key>(void) { struct device_node *np; void __iomem *mpsoc_base; u32 reg; pr_warn("CPU idle is currently broken on Armada 38x: disabling\n"); return 0; np = <API key>(NULL, NULL, "marvell,<API key>"); if (!np) return -ENODEV; if (broken_idle(np)) goto end; of_node_put(np); np = <API key>(NULL, NULL, "marvell,<API key>"); if (!np) return -ENODEV; mpsoc_base = of_iomap(np, 0); BUG_ON(!mpsoc_base); /* Set up reset mask when powering down the cpus */ reg = readl(mpsoc_base + MPCORE_RESET_CTL); reg |= MPCORE_RESET_CTL_L2; reg |= <API key>; writel(reg, mpsoc_base + MPCORE_RESET_CTL); iounmap(mpsoc_base); /* Set up delay */ reg = readl(pmsu_mp_base + <API key>); reg &= ~<API key>; reg |= <API key>; reg |= <API key>; writel(reg, pmsu_mp_base + <API key>); mvebu_cpu_resume = <API key>; <API key>.dev.platform_data = <API key>; <API key>.name = "cpuidle-armada-38x"; end: of_node_put(np); return 0; } static __init int <API key>(void) { struct device_node *np; np = <API key>(NULL, NULL, "marvell,coherency-fabric"); if (!np) return -ENODEV; if (broken_idle(np)) goto end; mvebu_cpu_resume = <API key>; <API key>.dev.platform_data = <API key>; <API key>.name = "cpuidle-armada-xp"; end: of_node_put(np); return 0; } static int __init <API key>(void) { struct device_node *np; int ret; np = <API key>(NULL, of_pmsu_table); if (!np) return 0; of_node_put(np); /* * Currently the CPU idle support for Armada 38x is broken, as * the CPU hotplug uses some of the CPU idle functions it is * broken too, so let's disable it */ if (<API key>("marvell,armada380")) { cpu_hotplug_disable(); pr_warn("CPU hotplug support is currently broken on Armada 38x: disabling\n"); } if (<API key>("marvell,armadaxp")) ret = <API key>(); else if (<API key>("marvell,armada370")) ret = <API key>(); else if (<API key>("marvell,armada380")) ret = <API key>(); else return 0; if (ret) return ret; <API key>(); if (<API key>.name) <API key>(&<API key>); <API key>(&<API key>); return 0; } arch_initcall(<API key>); early_initcall(mvebu_v7_pmsu_init); static void <API key>(void *data) { u32 reg; u32 cpu = smp_processor_id(); unsigned long flags; local_irq_save(flags); /* Prepare to enter idle */ reg = readl(pmsu_mp_base + <API key>(cpu)); reg |= <API key> | <API key> | <API key>; writel(reg, pmsu_mp_base + <API key>(cpu)); /* Request the DFS transition */ reg = readl(pmsu_mp_base + <API key>(cpu)); reg |= <API key>; writel(reg, pmsu_mp_base + <API key>(cpu)); /* The fact of entering idle will trigger the DFS transition */ wfi(); /* * We're back from idle, the DFS transition has completed, * clear the idle wait indication. */ reg = readl(pmsu_mp_base + <API key>(cpu)); reg &= ~<API key>; writel(reg, pmsu_mp_base + <API key>(cpu)); local_irq_restore(flags); } int <API key>(int cpu) { unsigned long timeout; int hwcpu = cpu_logical_map(cpu); u32 reg; /* Clear any previous DFS DONE event */ reg = readl(pmsu_mp_base + <API key>(hwcpu)); reg &= ~<API key>; writel(reg, pmsu_mp_base + <API key>(hwcpu)); /* Mask the DFS done interrupt, since we are going to poll */ reg = readl(pmsu_mp_base + <API key>(hwcpu)); reg |= <API key>; writel(reg, pmsu_mp_base + <API key>(hwcpu)); /* Trigger the DFS on the appropriate CPU */ <API key>(cpu, <API key>, NULL, false); /* Poll until the DFS done event is generated */ timeout = jiffies + HZ; while (time_before(jiffies, timeout)) { reg = readl(pmsu_mp_base + <API key>(hwcpu)); if (reg & <API key>) break; udelay(10); } if (time_after(jiffies, timeout)) return -ETIME; /* Restore the DFS mask to its original state */ reg = readl(pmsu_mp_base + <API key>(hwcpu)); reg &= ~<API key>; writel(reg, pmsu_mp_base + <API key>(hwcpu)); return 0; } struct <API key> cpufreq_dt_pd = { .independent_clocks = true, }; static int __init <API key>(void) { struct device_node *np; struct resource res; int ret, cpu; if (!<API key>("marvell,armadaxp")) return 0; /* * In order to have proper cpufreq handling, we need to ensure * that the Device Tree description of the CPU clock includes * the definition of the PMU DFS registers. If not, we do not * register the clock notifier and the cpufreq driver. This * piece of code is only for compatibility with old Device * Trees. */ np = <API key>(NULL, NULL, "marvell,armada-xp-cpu-clock"); if (!np) return 0; ret = <API key>(np, 1, &res); if (ret) { pr_warn(FW_WARN "not enabling cpufreq, deprecated armada-xp-cpu-clock binding\n"); of_node_put(np); return 0; } of_node_put(np); /* * For each CPU, this loop registers the operating points * supported (which are the nominal CPU frequency and half of * it), and registers the clock notifier that will take care * of doing the PMSU part of a frequency transition. */ <API key>(cpu) { struct device *cpu_dev; struct clk *clk; int ret; cpu_dev = get_cpu_device(cpu); if (!cpu_dev) { pr_err("Cannot get CPU %d\n", cpu); continue; } clk = clk_get(cpu_dev, 0); if (IS_ERR(clk)) { pr_err("Cannot get clock for CPU %d\n", cpu); return PTR_ERR(clk); } /* * In case of a failure of dev_pm_opp_add(), we don't * bother with cleaning up the registered OPP (there's * no function to do so), and simply cancel the * registration of the cpufreq device. */ ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk), 0); if (ret) { clk_put(clk); return ret; } ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk) / 2, 0); if (ret) { clk_put(clk); return ret; } } <API key>(NULL, "cpufreq-dt", -1, &cpufreq_dt_pd, sizeof(cpufreq_dt_pd)); return 0; } device_initcall(<API key>);
int f (unsigned bitcount, int mant) { int mask = -1 << bitcount; { if (! (mant & -mask)) goto ab; if (mant & ~mask) goto auf; } ab: return 0; auf: return 1; } main () { if (f (0, -1)) abort (); exit (0); }
!function(r){window.qoopido.register("polyfill/array/indexof",r)}(function(r,o,t,i,n,e,f){"use strict";return Array.prototype.indexOf||(Array.prototype.indexOf=function(r){for(var o=this,t=0;o[t]!==f;++t)if(o[t]===r)return t;return-1}),Array.prototype.indexOf});
<!DOCTYPE html> <html> <head> <title>require.js: After Load</title> <script type="text/javascript" src="doh/runner.js"></script> <script type="text/javascript" src="doh/_browserRunner.js"></script> <script type="text/javascript"> var d, s, head; function goRequire() { //Need a hack to trigger require.pageLoaded() for pre Firefox 3.6 browsers. var ff = parseFloat(navigator.userAgent.split("Firefox/")[1]) || null; if (ff && ff < 3.6) { require.pageLoaded(); } require({ paths: { domReady: "../../domReady/domReady" } }, ["require", "simple", "domReady"], function (require, simple, domReady) { domReady(function() { doh.is("blue", simple.color); //Now test another script getting loaded will see var s = document.createElement("script"); s.src = "afterloadreadystate.js"; s.charset = "utf-8"; head.appendChild(s); }); } ); } function loadRequire() { var readyRegExp = /complete|loaded/; function onScriptLoad(evt) { var node = evt.target || evt.srcElement; if (evt.type === "load" || readyRegExp.test(node.readyState)) { //Clean up script binding, otherwise, Opera in particular //may trigger it again. if (node.removeEventListener) { node.removeEventListener("load", onScriptLoad, false); } else { //Probably IE. node.detachEvent("onreadystatechange", onScriptLoad); } goRequire(); } }; //Create script tag for require.js s = document.createElement("script"); s.src = "../require.js"; s.charset = "utf-8"; //Set up load listener. if (s.addEventListener) { s.addEventListener("load", onScriptLoad, false); } else { //Probably IE. s.attachEvent("onreadystatechange", onScriptLoad); } head = (document.<API key>("head")[0] || document.<API key>("html")[0]); head.appendChild(s); } doh.register( "afterload", [ { name: "afterload", timeout: 5000, runTest: function() { d = new doh.Deferred(); return d; } } ] ); doh.run(); </script> </head> <body onload="loadRequire()"> <h1>require.js: After Load Test</h1> <p>Tests adding require after the page loads, and tests that require.js patches up document.readyState for Firefox less than 3.6.</p> <p>Check console for messages</p> </body> </html>
#ifndef __SOUND_HDA_BEEP_H #define __SOUND_HDA_BEEP_H #include "hda_codec.h" /* beep information */ struct hda_beep { struct input_dev *dev; struct hda_codec *codec; char phys[32]; int tone; hda_nid_t nid; unsigned int enabled:1; unsigned int linear_tone:1; /* linear tone for IDT/STAC codec */ struct work_struct beep_work; /* scheduled task for beep event */ }; #ifdef <API key> int <API key>(struct hda_codec *codec, int nid); void <API key>(struct hda_codec *codec); #else #define <API key>(...) 0 #define <API key>(...) #endif #endif
<?php /** * @file * Contains \Drupal\Tests\views\Unit\Plugin\pager\PagerPluginBaseTest. */ namespace Drupal\Tests\views\Unit\Plugin\pager; use Drupal\Tests\UnitTestCase; use Drupal\Core\Database\StatementInterface; /** * @coversDefaultClass \Drupal\views\Plugin\views\pager\PagerPluginBase * @group views */ class PagerPluginBaseTest extends UnitTestCase { /** * The mock pager plugin instance. * * @var \Drupal\views\Plugin\views\pager\PagerPluginBase|\<API key> */ protected $pager; protected function setUp() { $this->pager = $this->getMockBuilder('Drupal\views\Plugin\views\pager\PagerPluginBase') -><API key>() -><API key>(); $view = $this->getMockBuilder('Drupal\views\ViewExecutable') -><API key>() ->getMock(); $display = $this->getMockBuilder('Drupal\views\Plugin\views\display\DisplayPluginBase') -><API key>() ->getMock(); $options = array( 'items_per_page' => 5, 'offset' => 1, ); $this->pager->init($view, $display, $options); $this->pager->current_page = 1; } /** * Tests the getItemsPerPage() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getItemsPerPage() */ public function testGetItemsPerPage() { $this->assertEquals(5, $this->pager->getItemsPerPage()); } /** * Tests the setItemsPerPage() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setItemsPerPage() */ public function testSetItemsPerPage() { $this->pager->setItemsPerPage(6); $this->assertEquals(6, $this->pager->getItemsPerPage()); } /** * Tests the getOffset() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getOffset() */ public function testGetOffset() { $this->assertEquals(1, $this->pager->getOffset()); } /** * Tests the setOffset() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setOffset() */ public function testSetOffset() { $this->pager->setOffset(2); $this->assertEquals(2, $this->pager->getOffset()); } /** * Tests the getCurrentPage() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getCurrentPage() */ public function testGetCurrentPage() { $this->assertEquals(1, $this->pager->getCurrentPage()); } /** * Tests the setCurrentPage() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::setCurrentPage() */ public function testSetCurrentPage() { $this->pager->setCurrentPage(2); $this->assertEquals(2, $this->pager->getCurrentPage()); // A non numeric number or number below 0 should return 0. $this->pager->setCurrentPage('two'); $this->assertEquals(0, $this->pager->getCurrentPage()); $this->pager->setCurrentPage(-2); $this->assertEquals(0, $this->pager->getCurrentPage()); } /** * Tests the getTotalItems() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getTotalItems() */ public function testGetTotalItems() { // Should return 0 by default. $this->assertEquals(0, $this->pager->getTotalItems()); $this->pager->total_items = 10; $this->assertEquals(10, $this->pager->getTotalItems()); } /** * Tests the getPagerId() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::getPagerId() */ public function testGetPagerId() { // Should return 0 if 'id' is not set. $this->assertEquals(0, $this->pager->getPagerId()); $this->pager->options['id'] = 1; $this->assertEquals(1, $this->pager->getPagerId()); } /** * Tests the usePager() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::usePager() */ public function testUsePager() { $this->assertTrue($this->pager->usePager()); } /** * Tests the useCountQuery() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::useCountQuery() */ public function testUseCountQuery() { $this->assertTrue($this->pager->useCountQuery()); } /** * Tests the usesExposed() method. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::usedExposed() */ public function testUsesExposed() { $this->assertFalse($this->pager->usesExposed()); } /** * Tests the hasMoreRecords() method. * * @dataProvider <API key> * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::hasMoreRecords() */ public function testHasMoreRecords($items_per_page, $total_items, $current_page, $has_more_records) { $this->pager->setItemsPerPage($items_per_page); $this->pager->total_items = $total_items; $this->pager->setCurrentPage($current_page); $this->assertEquals($has_more_records, $this->pager->hasMoreRecords()); } /** * Provides test data for the hasMoreRecord method test. * * @see self::testHasMoreRecords */ public function <API key>() { return array( // No items per page, so there can't be more available records. array(0, 0, 0, FALSE), array(0, 10, 0, FALSE), // The amount of total items equals the items per page, so there is no // next page available. array(5, 5, 0, FALSE), // There is one more item, and we are at the first page. array(5, 6, 0, TRUE), // Now we are on the second page, which has just a single one left. array(5, 6, 1, FALSE), // Increase the total items, so we have some available on the third page. array(5, 12, 1, TRUE) ); } /** * Tests the executeCountQuery method without a set offset. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::executeCountQuery() */ public function <API key>() { $statement = $this->getMock('\Drupal\Tests\views\Unit\Plugin\pager\<API key>'); $statement->expects($this->once()) ->method('fetchField') ->will($this->returnValue(3)); $query = $this->getMockBuilder('\Drupal\Core\Database\Query\Select') -><API key>() ->getMock(); $query->expects($this->once()) ->method('execute') ->will($this->returnValue($statement)); $this->pager->setOffset(0); $this->assertEquals(3, $this->pager->executeCountQuery($query)); } /** * Tests the executeCountQuery method with a set offset. * * @see \Drupal\views\Plugin\views\pager\PagerPluginBase::executeCountQuery() */ public function <API key>() { $statement = $this->getMock('\Drupal\Tests\views\Unit\Plugin\pager\<API key>'); $statement->expects($this->once()) ->method('fetchField') ->will($this->returnValue(3)); $query = $this->getMockBuilder('\Drupal\Core\Database\Query\Select') -><API key>() ->getMock(); $query->expects($this->once()) ->method('execute') ->will($this->returnValue($statement)); $this->pager->setOffset(2); $this->assertEquals(1, $this->pager->executeCountQuery($query)); } } // As StatementInterface extends \Traversable, which though always needs // an additional interface. The Statement class itself can't be mocked because // of its __wakeup function. interface <API key> extends StatementInterface, \Iterator {}
#ifndef <API key> #define <API key> #include <linux/completion.h> #include <linux/usb.h> #include <linux/mutex.h> #include <linux/spinlock.h> #include <linux/uwb.h> #include <linux/usb/wusb.h> #include <linux/usb/wusb-wa.h> struct wusbhc; struct wahc; extern void wa_urb_enqueue_run(struct work_struct *ws); extern void <API key>(struct work_struct *ws); /** * RPipe instance * * @descr's fields are kept in LE, as we need to send it back and * forth. * * @wa is referenced when set * * @segs_available is the number of requests segments that still can * be submitted to the controller without overloading * it. It is initialized to descr->wRequests when * aiming. * * A rpipe supports a max of descr->wRequests at the same time; before * submitting seg_lock has to be taken. If segs_avail > 0, then we can * submit; if not, we have to queue them. */ struct wa_rpipe { struct kref refcnt; struct <API key> descr; struct usb_host_endpoint *ep; struct wahc *wa; spinlock_t seg_lock; struct list_head seg_list; struct list_head list_node; atomic_t segs_available; u8 buffer[1]; /* For reads/writes on USB */ }; enum wa_dti_state { <API key>, <API key> }; enum wa_quirks { /* * The Alereon HWA expects the data frames in isochronous transfer * requests to be concatenated and not sent as separate packets. */ <API key> = 0x01, }; /** * Instance of a HWA Host Controller * * Except where a more specific lock/mutex applies or atomic, all * fields protected by @mutex. * * @wa_descr Can be accessed without locking because it is in * the same area where the device descriptors were * read, so it is guaranteed to exist unmodified while * the device exists. * * Endianess has been converted to CPU's. * * @nep_* can be accessed without locking as its processing is * serialized; we submit a NEP URB and it comes to * hwahc_nep_cb(), which won't issue another URB until it is * done processing it. * * @xfer_list: * * List of active transfers to verify existence from a xfer id * gotten from the xfer result message. Can't use urb->list because * it goes by endpoint, and we don't know the endpoint at the time * when we get the xfer result message. We can't really rely on the * pointer (will have to change for 64 bits) as the xfer id is 32 bits. * * @xfer_delayed_list: List of transfers that need to be started * (with a workqueue, because they were * submitted from an atomic context). * * FIXME: this needs to be layered up: a wusbhc layer (for sharing * commonalities with WHCI), a wa layer (for sharing * commonalities with DWA-RC). */ struct wahc { struct usb_device *usb_dev; struct usb_interface *usb_iface; /* HC to deliver notifications */ union { struct wusbhc *wusb; struct dwahc *dwa; }; const struct <API key> *dto_epd, *dti_epd; const struct usb_wa_descriptor *wa_descr; struct urb *nep_urb; /* Notification EndPoint [lockless] */ struct edc nep_edc; void *nep_buffer; size_t nep_buffer_size; atomic_t notifs_queued; u16 rpipes; unsigned long *rpipe_bm; /* rpipe usage bitmap */ struct list_head rpipe_delayed_list; /* delayed RPIPES. */ spinlock_t rpipe_lock; /* protect rpipe_bm and delayed list */ struct mutex rpipe_mutex; /* assigning resources to endpoints */ /* * dti_state is used to track the state of the dti_urb. When dti_state * is <API key>, <API key> and * dti_isoc_xfer_seg identify which xfer the incoming isoc packet * status refers to. */ enum wa_dti_state dti_state; u32 <API key>; u8 dti_isoc_xfer_seg; struct urb *dti_urb; /* URB for reading xfer results */ struct urb *buf_in_urb; /* URB for reading data in */ struct edc dti_edc; /* DTI error density counter */ void *dti_buf; size_t dti_buf_size; unsigned long dto_in_use; /* protect dto endoint serialization */ s32 status; /* For reading status */ struct list_head xfer_list; struct list_head xfer_delayed_list; struct list_head xfer_errored_list; /* * lock for the above xfer lists. Can be taken while a xfer->lock is * held but not in the reverse order. */ spinlock_t xfer_list_lock; struct work_struct xfer_enqueue_work; struct work_struct xfer_error_work; atomic_t xfer_id_count; kernel_ulong_t quirks; }; extern int wa_create(struct wahc *wa, struct usb_interface *iface, kernel_ulong_t); extern void __wa_destroy(struct wahc *wa); void wa_reset_all(struct wahc *wa); /* Miscellaneous constants */ enum { /** Max number of EPROTO errors we tolerate on the NEP in a * period of time */ HWAHC_EPROTO_MAX = 16, /** Period of time for EPROTO errors (in jiffies) */ HWAHC_EPROTO_PERIOD = 4 * HZ, }; /* Notification endpoint handling */ extern int wa_nep_create(struct wahc *, struct usb_interface *); extern void wa_nep_destroy(struct wahc *); static inline int wa_nep_arm(struct wahc *wa, gfp_t gfp_mask) { struct urb *urb = wa->nep_urb; urb->transfer_buffer = wa->nep_buffer; urb-><API key> = wa->nep_buffer_size; return usb_submit_urb(urb, gfp_mask); } static inline void wa_nep_disarm(struct wahc *wa) { usb_kill_urb(wa->nep_urb); } /* RPipes */ static inline void wa_rpipe_init(struct wahc *wa) { INIT_LIST_HEAD(&wa->rpipe_delayed_list); spin_lock_init(&wa->rpipe_lock); mutex_init(&wa->rpipe_mutex); } static inline void wa_init(struct wahc *wa) { edc_init(&wa->nep_edc); atomic_set(&wa->notifs_queued, 0); wa->dti_state = <API key>; wa_rpipe_init(wa); edc_init(&wa->dti_edc); INIT_LIST_HEAD(&wa->xfer_list); INIT_LIST_HEAD(&wa->xfer_delayed_list); INIT_LIST_HEAD(&wa->xfer_errored_list); spin_lock_init(&wa->xfer_list_lock); INIT_WORK(&wa->xfer_enqueue_work, wa_urb_enqueue_run); INIT_WORK(&wa->xfer_error_work, <API key>); wa->dto_in_use = 0; atomic_set(&wa->xfer_id_count, 1); } /** * Destroy a pipe (when refcount drops to zero) * * Assumes it has been moved to the "QUIESCING" state. */ struct wa_xfer; extern void rpipe_destroy(struct kref *_rpipe); static inline void __rpipe_get(struct wa_rpipe *rpipe) { kref_get(&rpipe->refcnt); } extern int rpipe_get_by_ep(struct wahc *, struct usb_host_endpoint *, struct urb *, gfp_t); static inline void rpipe_put(struct wa_rpipe *rpipe) { kref_put(&rpipe->refcnt, rpipe_destroy); } extern void rpipe_ep_disable(struct wahc *, struct usb_host_endpoint *); extern void <API key>(struct wahc *, struct usb_host_endpoint *); extern int wa_rpipes_create(struct wahc *); extern void wa_rpipes_destroy(struct wahc *); static inline void rpipe_avail_dec(struct wa_rpipe *rpipe) { atomic_dec(&rpipe->segs_available); } /** * Returns true if the rpipe is ready to submit more segments. */ static inline int rpipe_avail_inc(struct wa_rpipe *rpipe) { return atomic_inc_return(&rpipe->segs_available) > 0 && !list_empty(&rpipe->seg_list); } /* Transferring data */ extern int wa_urb_enqueue(struct wahc *, struct usb_host_endpoint *, struct urb *, gfp_t); extern int wa_urb_dequeue(struct wahc *, struct urb *, int); extern void <API key>(struct wahc *, struct wa_notif_hdr *); /* Misc * * FIXME: Refcounting for the actual @hwahc object is not correct; I * mean, this should be refcounting on the HCD underneath, but * it is not. In any case, the semantics for HCD refcounting * are *weird*...on refcount reaching zero it just frees * it...no RC specific function is called...unless I miss * something. * * FIXME: has to go away in favour of a 'struct' hcd based solution */ static inline struct wahc *wa_get(struct wahc *wa) { usb_get_intf(wa->usb_iface); return wa; } static inline void wa_put(struct wahc *wa) { usb_put_intf(wa->usb_iface); } static inline int __wa_feature(struct wahc *wa, unsigned op, u16 feature) { return usb_control_msg(wa->usb_dev, usb_sndctrlpipe(wa->usb_dev, 0), op ? USB_REQ_SET_FEATURE : <API key>, USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE, feature, wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, NULL, 0, <API key>); } static inline int __wa_set_feature(struct wahc *wa, u16 feature) { return __wa_feature(wa, 1, feature); } static inline int __wa_clear_feature(struct wahc *wa, u16 feature) { return __wa_feature(wa, 0, feature); } /** * Return the status of a Wire Adapter * * @wa: Wire Adapter instance * @returns < 0 errno code on error, or status bitmap as described * in WUSB1.0[8.3.1.6]. * * NOTE: need malloc, some arches don't take USB from the stack */ static inline s32 __wa_get_status(struct wahc *wa) { s32 result; result = usb_control_msg( wa->usb_dev, usb_rcvctrlpipe(wa->usb_dev, 0), USB_REQ_GET_STATUS, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, 0, wa->usb_iface->cur_altsetting->desc.bInterfaceNumber, &wa->status, sizeof(wa->status), <API key>); if (result >= 0) result = wa->status; return result; } /** * Waits until the Wire Adapter's status matches @mask/@value * * @wa: Wire Adapter instance. * @returns < 0 errno code on error, otherwise status. * * Loop until the WAs status matches the mask and value (status & mask * == value). Timeout if it doesn't happen. * * FIXME: is there an official specification on how long status * changes can take? */ static inline s32 __wa_wait_status(struct wahc *wa, u32 mask, u32 value) { s32 result; unsigned loops = 10; do { msleep(50); result = __wa_get_status(wa); if ((result & mask) == value) break; if (loops result = -ETIMEDOUT; break; } } while (result >= 0); return result; } /** Command @hwahc to stop, @returns 0 if ok, < 0 errno code on error */ static inline int __wa_stop(struct wahc *wa) { int result; struct device *dev = &wa->usb_iface->dev; result = __wa_clear_feature(wa, WA_ENABLE); if (result < 0 && result != -ENODEV) { dev_err(dev, "error commanding HC to stop: %d\n", result); goto out; } result = __wa_wait_status(wa, WA_ENABLE, 0); if (result < 0 && result != -ENODEV) dev_err(dev, "error waiting for HC to stop: %d\n", result); out: return 0; } #endif /* #ifndef <API key> */
class Whirr < Formula desc "Set of libraries for running cloud services" homepage "https://whirr.apache.org/" url "https://archive.apache.org/dist/whirr/whirr-0.8.2/whirr-0.8.2.tar.gz" sha256 "<SHA256-like>" bottle :unneeded def install libexec.install %w[bin conf lib] bin.write_exec_script libexec/"bin/whirr" end test do system "#{bin}/whirr", "help", "help" end end
<?php namespace Zend\Form\Element; use Zend\Form\Element; class Submit extends Element { /** * Seed attributes * * @var array */ protected $attributes = array( 'type' => 'submit', ); }
<!DOCTYPE html PUBLIC "- <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="functions_7.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><! createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><! document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
#include <linux/errno.h> #include <linux/interrupt.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/param.h> #include <linux/proc_fs.h> #include <linux/sched.h> #include <linux/seq_file.h> #include <linux/spinlock.h> #include <asm/blackfin.h> #include <asm/cacheflush.h> #include <asm/dma.h> #include <asm/uaccess.h> #include <asm/early_printk.h> /* * To make sure we work around 05000119 - we always check DMA_DONE bit, * never the DMA_RUN bit */ struct dma_channel dma_ch[MAX_DMA_CHANNELS]; EXPORT_SYMBOL(dma_ch); static int __init blackfin_dma_init(void) { int i; printk(KERN_INFO "Blackfin DMA Controller\n"); for (i = 0; i < MAX_DMA_CHANNELS; i++) { dma_ch[i].chan_status = DMA_CHANNEL_FREE; dma_ch[i].regs = dma_io_base_addr[i]; mutex_init(&(dma_ch[i].dmalock)); } /* Mark MEMDMA Channel 0 as requested since we're using it internally */ request_dma(CH_MEM_STREAM0_DEST, "Blackfin dma_memcpy"); request_dma(CH_MEM_STREAM0_SRC, "Blackfin dma_memcpy"); #if defined(<API key>) <API key>(<API key>() | DEB1_URGENT | DEB2_URGENT | DEB3_URGENT); #endif return 0; } arch_initcall(blackfin_dma_init); #ifdef CONFIG_PROC_FS static int proc_dma_show(struct seq_file *m, void *v) { int i; for (i = 0; i < MAX_DMA_CHANNELS; ++i) if (dma_ch[i].chan_status != DMA_CHANNEL_FREE) seq_printf(m, "%2d: %s\n", i, dma_ch[i].device_id); return 0; } static int proc_dma_open(struct inode *inode, struct file *file) { return single_open(file, proc_dma_show, NULL); } static const struct file_operations proc_dma_operations = { .open = proc_dma_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; static int __init proc_dma_init(void) { return proc_create("dma", 0, NULL, &proc_dma_operations) != NULL; } late_initcall(proc_dma_init); #endif /** * request_dma - request a DMA channel * * Request the specific DMA channel from the system if it's available. */ int request_dma(unsigned int channel, const char *device_id) { pr_debug("request_dma() : BEGIN \n"); if (device_id == NULL) printk(KERN_WARNING "request_dma(%u): no device_id given\n", channel); #if defined(CONFIG_BF561) && ANOMALY_05000182 if (channel >= <API key> && channel <= <API key>) { if (get_cclk() > 500000000) { printk(KERN_WARNING "Request IMDMA failed due to ANOMALY 05000182\n"); return -EFAULT; } } #endif mutex_lock(&(dma_ch[channel].dmalock)); if ((dma_ch[channel].chan_status == <API key>) || (dma_ch[channel].chan_status == DMA_CHANNEL_ENABLED)) { mutex_unlock(&(dma_ch[channel].dmalock)); pr_debug("DMA CHANNEL IN USE \n"); return -EBUSY; } else { dma_ch[channel].chan_status = <API key>; pr_debug("DMA CHANNEL IS ALLOCATED \n"); } mutex_unlock(&(dma_ch[channel].dmalock)); #ifdef CONFIG_BF54x if (channel >= CH_UART2_RX && channel <= CH_UART3_TX) { unsigned int per_map; per_map = dma_ch[channel].regs->peripheral_map & 0xFFF; if (strncmp(device_id, "BFIN_UART", 9) == 0) dma_ch[channel].regs->peripheral_map = per_map | ((channel - CH_UART2_RX + 0xC)<<12); else dma_ch[channel].regs->peripheral_map = per_map | ((channel - CH_UART2_RX + 0x6)<<12); } #endif dma_ch[channel].device_id = device_id; dma_ch[channel].irq = 0; /* This is to be enabled by putting a restriction - * you have to request DMA, before doing any operations on * descriptor/channel */ pr_debug("request_dma() : END \n"); return 0; } EXPORT_SYMBOL(request_dma); int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data) { BUG_ON(channel >= MAX_DMA_CHANNELS || dma_ch[channel].chan_status == DMA_CHANNEL_FREE); if (callback != NULL) { int ret; unsigned int irq = channel2irq(channel); ret = request_irq(irq, callback, IRQF_DISABLED, dma_ch[channel].device_id, data); if (ret) return ret; dma_ch[channel].irq = irq; dma_ch[channel].data = data; } return 0; } EXPORT_SYMBOL(set_dma_callback); /** * clear_dma_buffer - clear DMA fifos for specified channel * * Set the Buffer Clear bit in the Configuration register of specific DMA * channel. This will stop the descriptor based DMA operation. */ static void clear_dma_buffer(unsigned int channel) { dma_ch[channel].regs->cfg |= RESTART; SSYNC(); dma_ch[channel].regs->cfg &= ~RESTART; } void free_dma(unsigned int channel) { pr_debug("freedma() : BEGIN \n"); BUG_ON(channel >= MAX_DMA_CHANNELS || dma_ch[channel].chan_status == DMA_CHANNEL_FREE); /* Halt the DMA */ disable_dma(channel); clear_dma_buffer(channel); if (dma_ch[channel].irq) free_irq(dma_ch[channel].irq, dma_ch[channel].data); /* Clear the DMA Variable in the Channel */ mutex_lock(&(dma_ch[channel].dmalock)); dma_ch[channel].chan_status = DMA_CHANNEL_FREE; mutex_unlock(&(dma_ch[channel].dmalock)); pr_debug("freedma() : END \n"); } EXPORT_SYMBOL(free_dma); #ifdef CONFIG_PM # ifndef <API key> # define <API key> MAX_DMA_CHANNELS # endif int <API key>(void) { int i; for (i = 0; i < <API key>; ++i) { if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) { printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); return -EBUSY; } dma_ch[i].<API key> = dma_ch[i].regs->peripheral_map; } return 0; } void blackfin_dma_resume(void) { int i; for (i = 0; i < MAX_DMA_CHANNELS; ++i) { dma_ch[i].regs->cfg = 0; if (i < <API key>) dma_ch[i].regs->peripheral_map = dma_ch[i].<API key>; } } #endif /** * <API key> - minimal DMA init * * Setup a few DMA registers so we can safely do DMA transfers early on in * the kernel booting process. Really this just means using dma_memcpy(). */ void __init <API key>(void) { early_shadow_stamp(); <API key>(0); <API key>(0); } void __init early_dma_memcpy(void *pdst, const void *psrc, size_t size) { unsigned long dst = (unsigned long)pdst; unsigned long src = (unsigned long)psrc; struct dma_register *dst_ch, *src_ch; early_shadow_stamp(); /* We assume that everything is 4 byte aligned, so include * a basic sanity check */ BUG_ON(dst % 4); BUG_ON(src % 4); BUG_ON(size % 4); src_ch = 0; /* Find an avalible memDMA channel */ while (1) { if (src_ch == (struct dma_register *)<API key>) { dst_ch = (struct dma_register *)<API key>; src_ch = (struct dma_register *)<API key>; } else { dst_ch = (struct dma_register *)<API key>; src_ch = (struct dma_register *)<API key>; } if (!bfin_read16(&src_ch->cfg)) break; else if (bfin_read16(&dst_ch->irq_status) & DMA_DONE) { bfin_write16(&src_ch->cfg, 0); break; } } /* Force a sync in case a previous config reset on this channel * occurred. This is needed so subsequent writes to DMA registers * are not spuriously lost/corrupted. */ <API key>(); /* Destination */ bfin_write32(&dst_ch->start_addr, dst); bfin_write16(&dst_ch->x_count, size >> 2); bfin_write16(&dst_ch->x_modify, 1 << 2); bfin_write16(&dst_ch->irq_status, DMA_DONE | DMA_ERR); /* Source */ bfin_write32(&src_ch->start_addr, src); bfin_write16(&src_ch->x_count, size >> 2); bfin_write16(&src_ch->x_modify, 1 << 2); bfin_write16(&src_ch->irq_status, DMA_DONE | DMA_ERR); /* Enable */ bfin_write16(&src_ch->cfg, DMAEN | WDSIZE_32); bfin_write16(&dst_ch->cfg, WNR | DI_EN | DMAEN | WDSIZE_32); /* Since we are atomic now, don't use the workaround ssync */ <API key>(); } void __init <API key>(void) { early_shadow_stamp(); while ((<API key>() && !(<API key>() & DMA_DONE)) || (<API key>() && !(<API key>() & DMA_DONE))) continue; <API key>(DMA_DONE | DMA_ERR); <API key>(DMA_DONE | DMA_ERR); /* * Now that DMA is done, we would normally flush cache, but * i/d cache isn't running this early, so we don't bother, * and just clear out the DMA channel for next time */ <API key>(0); <API key>(0); <API key>(0); <API key>(0); <API key>(); } /** * __dma_memcpy - program the MDMA registers * * Actually program MDMA0 and wait for the transfer to finish. Disable IRQs * while programming registers so that everything is fully configured. Wait * for DMA to finish with IRQs enabled. If interrupted, the initial DMA_DONE * check will make sure we don't clobber any existing transfer. */ static void __dma_memcpy(u32 daddr, s16 dmod, u32 saddr, s16 smod, size_t cnt, u32 conf) { static DEFINE_SPINLOCK(mdma_lock); unsigned long flags; spin_lock_irqsave(&mdma_lock, flags); /* Force a sync in case a previous config reset on this channel * occurred. This is needed so subsequent writes to DMA registers * are not spuriously lost/corrupted. Do it under irq lock and * without the anomaly version (because we are atomic already). */ <API key>(); if (<API key>()) while (!(<API key>() & DMA_DONE)) continue; if (conf & DMA2D) { /* For larger bit sizes, we've already divided down cnt so it * is no longer a multiple of 64k. So we have to break down * the limit here so it is a multiple of the incoming size. * There is no limitation here in terms of total size other * than the hardware though as the bits lost in the shift are * made up by MODIFY (== we can hit the whole address space). * X: (2^(16 - 0)) * 1 == (2^(16 - 1)) * 2 == (2^(16 - 2)) * 4 */ u32 shift = abs(dmod) >> 1; size_t ycnt = cnt >> (16 - shift); cnt = 1 << (16 - shift); <API key>(ycnt); <API key>(ycnt); <API key>(dmod); <API key>(smod); } <API key>(daddr); <API key>(cnt); <API key>(dmod); <API key>(DMA_DONE | DMA_ERR); <API key>(saddr); <API key>(cnt); <API key>(smod); <API key>(DMA_DONE | DMA_ERR); <API key>(DMAEN | conf); <API key>(WNR | DI_EN | DMAEN | conf); <API key>(&mdma_lock, flags); SSYNC(); while (!(<API key>() & DMA_DONE)) if (<API key>()) continue; else return; <API key>(DMA_DONE | DMA_ERR); <API key>(0); <API key>(0); } /** * _dma_memcpy - translate C memcpy settings into MDMA settings * * Handle all the high level steps before we touch the MDMA registers. So * handle direction, tweaking of sizes, and formatting of addresses. */ static void *_dma_memcpy(void *pdst, const void *psrc, size_t size) { u32 conf, shift; s16 mod; unsigned long dst = (unsigned long)pdst; unsigned long src = (unsigned long)psrc; if (size == 0) return NULL; if (dst % 4 == 0 && src % 4 == 0 && size % 4 == 0) { conf = WDSIZE_32; shift = 2; } else if (dst % 2 == 0 && src % 2 == 0 && size % 2 == 0) { conf = WDSIZE_16; shift = 1; } else { conf = WDSIZE_8; shift = 0; } /* If the two memory regions have a chance of overlapping, make * sure the memcpy still works as expected. Do this by having the * copy run backwards instead. */ mod = 1 << shift; if (src < dst) { mod *= -1; dst += size + mod; src += size + mod; } size >>= shift; if (size > 0x10000) conf |= DMA2D; __dma_memcpy(dst, mod, src, mod, size, conf); return pdst; } /** * dma_memcpy - DMA memcpy under mutex lock * * Do not check arguments before starting the DMA memcpy. Break the transfer * up into two pieces. The first transfer is in multiples of 64k and the * second transfer is the piece smaller than 64k. */ void *dma_memcpy(void *pdst, const void *psrc, size_t size) { unsigned long dst = (unsigned long)pdst; unsigned long src = (unsigned long)psrc; size_t bulk, rest; if (<API key>(src)) <API key>(src, src + size); if (<API key>(dst)) <API key>(dst, dst + size); bulk = size & ~0xffff; rest = size - bulk; if (bulk) _dma_memcpy(pdst, psrc, bulk); _dma_memcpy(pdst + bulk, psrc + bulk, rest); return pdst; } EXPORT_SYMBOL(dma_memcpy); /** * safe_dma_memcpy - DMA memcpy w/argument checking * * Verify arguments are safe before heading to dma_memcpy(). */ void *safe_dma_memcpy(void *dst, const void *src, size_t size) { if (!access_ok(VERIFY_WRITE, dst, size)) return NULL; if (!access_ok(VERIFY_READ, src, size)) return NULL; return dma_memcpy(dst, src, size); } EXPORT_SYMBOL(safe_dma_memcpy); static void _dma_out(unsigned long addr, unsigned long buf, unsigned short len, u16 size, u16 dma_size) { <API key>(buf, buf + len * size); __dma_memcpy(addr, 0, buf, size, len, dma_size); } static void _dma_in(unsigned long addr, unsigned long buf, unsigned short len, u16 size, u16 dma_size) { <API key>(buf, buf + len * size); __dma_memcpy(buf, size, addr, 0, len, dma_size); } #define MAKE_DMA_IO(io, bwl, isize, dmasize, cnst) \ void dma_##io##s##bwl(unsigned long addr, cnst void *buf, unsigned short len) \ { \ _dma_##io(addr, (unsigned long)buf, len, isize, WDSIZE_##dmasize); \ } \ EXPORT_SYMBOL(dma_##io##s##bwl) MAKE_DMA_IO(out, b, 1, 8, const); MAKE_DMA_IO(in, b, 1, 8, ); MAKE_DMA_IO(out, w, 2, 16, const); MAKE_DMA_IO(in, w, 2, 16, ); MAKE_DMA_IO(out, l, 4, 32, const); MAKE_DMA_IO(in, l, 4, 32, );
#if defined(<API key>) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif #include <linux/module.h> #include <linux/serial.h> #include <linux/console.h> #include <linux/sysrq.h> #include <linux/platform_device.h> #include <linux/tty.h> #include <linux/tty_flip.h> #include <linux/serial_core.h> #include <linux/io.h> #include <linux/of_irq.h> #include <linux/of_address.h> #define <API key> 1 /* * UART Register set (this is not a Standards Compliant IP) * Also each reg is Word aligned, but only 8 bits wide */ #define R_ID0 0 #define R_ID1 4 #define R_ID2 8 #define R_ID3 12 #define R_DATA 16 #define R_STS 20 #define R_BAUDL 24 #define R_BAUDH 28 /* Bits for UART Status Reg (R/W) */ #define RXIENB 0x04 /* Receive Interrupt Enable */ #define TXIENB 0x40 /* Transmit Interrupt Enable */ #define RXEMPTY 0x20 /* Receive FIFO Empty: No char receivede */ #define TXEMPTY 0x80 /* Transmit FIFO Empty, thus char can be written into */ #define RXFULL 0x08 /* Receive FIFO full */ #define RXFULL1 0x10 /* Receive FIFO has space for 1 char (tot space=4) */ #define RXFERR 0x01 /* Frame Error: Stop Bit not detected */ #define RXOERR 0x02 /* OverFlow Err: Char recv but RXFULL still set */ /* Uart bit fiddling helpers: lowest level */ #define RBASE(port, reg) (port->membase + reg) #define UART_REG_SET(u, r, v) writeb((v), RBASE(u, r)) #define UART_REG_GET(u, r) readb(RBASE(u, r)) #define UART_REG_OR(u, r, v) UART_REG_SET(u, r, UART_REG_GET(u, r) | (v)) #define UART_REG_CLR(u, r, v) UART_REG_SET(u, r, UART_REG_GET(u, r) & ~(v)) /* Uart bit fiddling helpers: API level */ #define UART_SET_DATA(uart, val) UART_REG_SET(uart, R_DATA, val) #define UART_GET_DATA(uart) UART_REG_GET(uart, R_DATA) #define UART_SET_BAUDH(uart, val) UART_REG_SET(uart, R_BAUDH, val) #define UART_SET_BAUDL(uart, val) UART_REG_SET(uart, R_BAUDL, val) #define UART_CLR_STATUS(uart, val) UART_REG_CLR(uart, R_STS, val) #define UART_GET_STATUS(uart) UART_REG_GET(uart, R_STS) #define <API key>(uart) UART_REG_CLR(uart, R_STS, RXIENB|TXIENB) #define UART_RX_IRQ_DISABLE(uart) UART_REG_CLR(uart, R_STS, RXIENB) #define UART_TX_IRQ_DISABLE(uart) UART_REG_CLR(uart, R_STS, TXIENB) #define UART_ALL_IRQ_ENABLE(uart) UART_REG_OR(uart, R_STS, RXIENB|TXIENB) #define UART_RX_IRQ_ENABLE(uart) UART_REG_OR(uart, R_STS, RXIENB) #define UART_TX_IRQ_ENABLE(uart) UART_REG_OR(uart, R_STS, TXIENB) #define ARC_SERIAL_DEV_NAME "ttyARC" struct arc_uart_port { struct uart_port port; unsigned long baud; }; #define to_arc_port(uport) container_of(uport, struct arc_uart_port, port) static struct arc_uart_port arc_uart_ports[<API key>]; #ifdef <API key> static struct console arc_console; #endif #define DRIVER_NAME "arc-uart" static struct uart_driver arc_uart_driver = { .owner = THIS_MODULE, .driver_name = DRIVER_NAME, .dev_name = ARC_SERIAL_DEV_NAME, .major = 0, .minor = 0, .nr = <API key>, #ifdef <API key> .cons = &arc_console, #endif }; static void arc_serial_stop_rx(struct uart_port *port) { UART_RX_IRQ_DISABLE(port); } static void arc_serial_stop_tx(struct uart_port *port) { while (!(UART_GET_STATUS(port) & TXEMPTY)) cpu_relax(); UART_TX_IRQ_DISABLE(port); } /* * Return TIOCSER_TEMT when transmitter is not busy. */ static unsigned int arc_serial_tx_empty(struct uart_port *port) { unsigned int stat; stat = UART_GET_STATUS(port); if (stat & TXEMPTY) return TIOCSER_TEMT; return 0; } /* * Driver internal routine, used by both tty(serial core) as well as tx-isr * -Called under spinlock in either cases * -also tty->stopped has already been checked * = by uart_start( ) before calling us * = tx_ist checks that too before calling */ static void arc_serial_tx_chars(struct uart_port *port) { struct circ_buf *xmit = &port->state->xmit; int sent = 0; unsigned char ch; if (unlikely(port->x_char)) { UART_SET_DATA(port, port->x_char); port->icount.tx++; port->x_char = 0; sent = 1; } else if (!uart_circ_empty(xmit)) { ch = xmit->buf[xmit->tail]; xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); port->icount.tx++; while (!(UART_GET_STATUS(port) & TXEMPTY)) cpu_relax(); UART_SET_DATA(port, ch); sent = 1; } /* * If num chars in xmit buffer are too few, ask tty layer for more. * By Hard ISR to schedule processing in software interrupt part */ if (<API key>(xmit) < WAKEUP_CHARS) uart_write_wakeup(port); if (sent) UART_TX_IRQ_ENABLE(port); } /* * port is locked and interrupts are disabled * uart_start( ) calls us under the port spinlock irqsave */ static void arc_serial_start_tx(struct uart_port *port) { arc_serial_tx_chars(port); } static void arc_serial_rx_chars(struct uart_port *port, unsigned int status) { unsigned int ch, flg = 0; /* * UART has 4 deep RX-FIFO. Driver's recongnition of this fact * is very subtle. Here's how ... * Upon getting a RX-Intr, such that RX-EMPTY=0, meaning data available, * driver reads the DATA Reg and keeps doing that in a loop, until * RX-EMPTY=1. Multiple chars being avail, with a single Interrupt, * before RX-EMPTY=0, implies some sort of buffering going on in the * controller, which is indeed the Rx-FIFO. */ do { /* * This could be an Rx Intr for err (no data), * so check err and clear that Intr first */ if (unlikely(status & (RXOERR | RXFERR))) { if (status & RXOERR) { port->icount.overrun++; flg = TTY_OVERRUN; UART_CLR_STATUS(port, RXOERR); } if (status & RXFERR) { port->icount.frame++; flg = TTY_FRAME; UART_CLR_STATUS(port, RXFERR); } } else flg = TTY_NORMAL; if (status & RXEMPTY) continue; ch = UART_GET_DATA(port); port->icount.rx++; if (!(<API key>(port, ch))) uart_insert_char(port, status, RXOERR, ch, flg); spin_unlock(&port->lock); <API key>(&port->state->port); spin_lock(&port->lock); } while (!((status = UART_GET_STATUS(port)) & RXEMPTY)); } /* * A note on the Interrupt handling state machine of this driver * * kernel printk writes funnel thru the console driver framework and in order * to keep things simple as well as efficient, it writes to UART in polled * mode, in one shot, and exits. * * OTOH, Userland output (via tty layer), uses interrupt based writes as there * can be undeterministic delay between char writes. * * Thus Rx-interrupts are always enabled, while tx-interrupts are by default * disabled. * * When tty has some data to send out, serial core calls driver's start_tx * which * -<API key> * -writes-data-to-uart * -enable-tx-intr * * Once data bits are pushed out, controller raises the <API key>. * The first thing Tx ISR does is disable further Tx interrupts (as this could * be the last char to send, before settling down into the quiet polled mode). * It then calls the exact routine used by tty layer write to send out any * more char in tty buffer. In case of sending, it re-enables Tx-intr. In case * of no data, it remains disabled. * This is how the transmit state machine is dynamically switched on/off */ static irqreturn_t arc_serial_isr(int irq, void *dev_id) { struct uart_port *port = dev_id; unsigned int status; status = UART_GET_STATUS(port); /* * Single IRQ for both Rx (data available) Tx (room available) Interrupt * notifications from the UART Controller. * To demultiplex between the two, we check the relevant bits */ if (status & RXIENB) { /* already in ISR, no need of xx_irqsave */ spin_lock(&port->lock); arc_serial_rx_chars(port, status); spin_unlock(&port->lock); } if ((status & TXIENB) && (status & TXEMPTY)) { /* Unconditionally disable further Tx-Interrupts. * will be enabled by tx_chars() if needed. */ UART_TX_IRQ_DISABLE(port); spin_lock(&port->lock); if (!uart_tx_stopped(port)) arc_serial_tx_chars(port); spin_unlock(&port->lock); } return IRQ_HANDLED; } static unsigned int <API key>(struct uart_port *port) { /* * Pretend we have a Modem status reg and following bits are * always set, to satify the serial core state machine * (DSR) Data Set Ready * (CTS) Clear To Send * (CAR) Carrier Detect */ return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; } static void <API key>(struct uart_port *port, unsigned int mctrl) { /* MCR not present */ } static void <API key>(struct uart_port *port, int break_state) { /* ARC UART doesn't support sending Break signal */ } static int arc_serial_startup(struct uart_port *port) { /* Before we hook up the ISR, Disable all UART Interrupts */ <API key>(port); if (request_irq(port->irq, arc_serial_isr, 0, "arc uart rx-tx", port)) { dev_warn(port->dev, "Unable to attach ARC UART intr\n"); return -EBUSY; } UART_RX_IRQ_ENABLE(port); /* Only Rx IRQ enabled to begin with */ return 0; } /* This is not really needed */ static void arc_serial_shutdown(struct uart_port *port) { free_irq(port->irq, port); } static void <API key>(struct uart_port *port, struct ktermios *new, struct ktermios *old) { struct arc_uart_port *uart = to_arc_port(port); unsigned int baud, uartl, uarth, hw_val; unsigned long flags; /* * Use the generic handler so that any specially encoded baud rates * such as SPD_xx flags or "%B0" can be handled * Max Baud I suppose will not be more than current 115K * 4 * Formula for ARC UART is: hw-val = ((CLK/(BAUD*4)) -1) * spread over two 8-bit registers */ baud = uart_get_baud_rate(port, new, old, 0, 460800); hw_val = port->uartclk / (uart->baud * 4) - 1; uartl = hw_val & 0xFF; uarth = (hw_val >> 8) & 0xFF; spin_lock_irqsave(&port->lock, flags); <API key>(port); UART_SET_BAUDL(port, uartl); UART_SET_BAUDH(port, uarth); UART_RX_IRQ_ENABLE(port); /* * UART doesn't support Parity/Hardware Flow Control; * Only supports 8N1 character size */ new->c_cflag &= ~(CMSPAR|CRTSCTS|CSIZE); new->c_cflag |= CS8; if (old) tty_termios_copy_hw(new, old); /* Don't rewrite B0 */ if (<API key>(new)) <API key>(new, baud, baud); uart_update_timeout(port, new->c_cflag, baud); <API key>(&port->lock, flags); } static const char *arc_serial_type(struct uart_port *port) { return port->type == PORT_ARC ? DRIVER_NAME : NULL; } static void <API key>(struct uart_port *port) { } static int <API key>(struct uart_port *port) { return 0; } /* * Verify the new serial_struct (for TIOCSSERIAL). */ static int <API key>(struct uart_port *port, struct serial_struct *ser) { if (port->type != PORT_UNKNOWN && ser->type != PORT_ARC) return -EINVAL; return 0; } /* * Configure/autoconfigure the port. */ static void <API key>(struct uart_port *port, int flags) { if (flags & UART_CONFIG_TYPE) port->type = PORT_ARC; } #ifdef CONFIG_CONSOLE_POLL static void <API key>(struct uart_port *port, unsigned char chr) { while (!(UART_GET_STATUS(port) & TXEMPTY)) cpu_relax(); UART_SET_DATA(port, chr); } static int <API key>(struct uart_port *port) { unsigned char chr; while (!(UART_GET_STATUS(port) & RXEMPTY)) cpu_relax(); chr = UART_GET_DATA(port); return chr; } #endif static struct uart_ops arc_serial_pops = { .tx_empty = arc_serial_tx_empty, .set_mctrl = <API key>, .get_mctrl = <API key>, .stop_tx = arc_serial_stop_tx, .start_tx = arc_serial_start_tx, .stop_rx = arc_serial_stop_rx, .break_ctl = <API key>, .startup = arc_serial_startup, .shutdown = arc_serial_shutdown, .set_termios = <API key>, .type = arc_serial_type, .release_port = <API key>, .request_port = <API key>, .config_port = <API key>, .verify_port = <API key>, #ifdef CONFIG_CONSOLE_POLL .poll_put_char = <API key>, .poll_get_char = <API key>, #endif }; #ifdef <API key> static int <API key>(struct console *co, char *options) { struct uart_port *port; int baud = 115200; int bits = 8; int parity = 'n'; int flow = 'n'; if (co->index < 0 || co->index >= <API key>) return -ENODEV; /* * The uart port backing the console (e.g. ttyARC1) might not have been * init yet. If so, defer the console setup to after the port. */ port = &arc_uart_ports[co->index].port; if (!port->membase) return -ENODEV; if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); /* * Serial core will call port->ops->set_termios( ) * which will set the baud reg */ return uart_set_options(port, co, baud, parity, bits, flow); } static void <API key>(struct uart_port *port, int ch) { while (!(UART_GET_STATUS(port) & TXEMPTY)) cpu_relax(); UART_SET_DATA(port, (unsigned char)ch); } /* * Interrupts are disabled on entering */ static void <API key>(struct console *co, const char *s, unsigned int count) { struct uart_port *port = &arc_uart_ports[co->index].port; unsigned long flags; spin_lock_irqsave(&port->lock, flags); uart_console_write(port, s, count, <API key>); <API key>(&port->lock, flags); } static struct console arc_console = { .name = ARC_SERIAL_DEV_NAME, .write = <API key>, .device = uart_console_device, .setup = <API key>, .flags = CON_PRINTBUFFER, .index = -1, .data = &arc_uart_driver }; static __init void <API key>(struct console *con, const char *s, unsigned int n) { struct earlycon_device *dev = con->data; uart_console_write(&dev->port, s, n, <API key>); } static int __init <API key>(struct earlycon_device *dev, const char *opt) { struct uart_port *port = &dev->port; unsigned int l, h, hw_val; if (!dev->port.membase) return -ENODEV; hw_val = port->uartclk / (dev->baud * 4) - 1; l = hw_val & 0xFF; h = (hw_val >> 8) & 0xFF; UART_SET_BAUDL(port, l); UART_SET_BAUDH(port, h); dev->con->write = <API key>; return 0; } EARLYCON_DECLARE(arc_uart, <API key>); OF_EARLYCON_DECLARE(arc_uart, "snps,arc-uart", <API key>); #endif /* <API key> */ static int arc_serial_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct arc_uart_port *uart; struct uart_port *port; int dev_id; u32 val; /* no device tree device */ if (!np) return -ENODEV; dev_id = of_alias_get_id(np, "serial"); if (dev_id < 0) dev_id = 0; uart = &arc_uart_ports[dev_id]; port = &uart->port; if (<API key>(np, "clock-frequency", &val)) { dev_err(&pdev->dev, "clock-frequency property NOTset\n"); return -EINVAL; } port->uartclk = val; if (<API key>(np, "current-speed", &val)) { dev_err(&pdev->dev, "current-speed property NOT set\n"); return -EINVAL; } uart->baud = val; port->membase = of_iomap(np, 0); if (!port->membase) /* No point of dev_err since UART itself is hosed here */ return -ENXIO; port->irq = <API key>(np, 0); port->dev = &pdev->dev; port->iotype = UPIO_MEM; port->flags = UPF_BOOT_AUTOCONF; port->line = dev_id; port->ops = &arc_serial_pops; port->fifosize = <API key>; /* * uart_insert_char( ) uses it in decideding whether to ignore a * char or not. Explicitly setting it here, removes the subtelty */ port->ignore_status_mask = 0; return uart_add_one_port(&arc_uart_driver, &arc_uart_ports[dev_id].port); } static int arc_serial_remove(struct platform_device *pdev) { /* This will never be called */ return 0; } static const struct of_device_id arc_uart_dt_ids[] = { { .compatible = "snps,arc-uart" }, { /* Sentinel */ } }; MODULE_DEVICE_TABLE(of, arc_uart_dt_ids); static struct platform_driver arc_platform_driver = { .probe = arc_serial_probe, .remove = arc_serial_remove, .driver = { .name = DRIVER_NAME, .of_match_table = arc_uart_dt_ids, }, }; static int __init arc_serial_init(void) { int ret; ret = <API key>(&arc_uart_driver); if (ret) return ret; ret = <API key>(&arc_platform_driver); if (ret) <API key>(&arc_uart_driver); return ret; } static void __exit arc_serial_exit(void) { <API key>(&arc_platform_driver); <API key>(&arc_uart_driver); } module_init(arc_serial_init); module_exit(arc_serial_exit); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:" DRIVER_NAME); MODULE_AUTHOR("Vineet Gupta"); MODULE_DESCRIPTION("ARC(Synopsys) On-Chip(fpga) serial driver");
// <API key>: GPL-2.0 #include <linux/kernel.h> #include <linux/pagewalk.h> #include <linux/swap.h> #include <linux/smp.h> #include <linux/spinlock.h> #include <linux/slab.h> #include <linux/swapops.h> #include <linux/ksm.h> #include <linux/mman.h> #include <linux/pgtable.h> #include <asm/pgalloc.h> #include <asm/gmap.h> #include <asm/tlb.h> #define <API key> 1ULL /** * gmap_alloc - allocate and initialize a guest address space * @limit: maximum address of the gmap address space * * Returns a guest address space structure. */ static struct gmap *gmap_alloc(unsigned long limit) { struct gmap *gmap; struct page *page; unsigned long *table; unsigned long etype, atype; if (limit < _REGION3_SIZE) { limit = _REGION3_SIZE - 1; atype = _ASCE_TYPE_SEGMENT; etype = <API key>; } else if (limit < _REGION2_SIZE) { limit = _REGION2_SIZE - 1; atype = _ASCE_TYPE_REGION3; etype = <API key>; } else if (limit < _REGION1_SIZE) { limit = _REGION1_SIZE - 1; atype = _ASCE_TYPE_REGION2; etype = <API key>; } else { limit = -1UL; atype = _ASCE_TYPE_REGION1; etype = <API key>; } gmap = kzalloc(sizeof(struct gmap), GFP_KERNEL_ACCOUNT); if (!gmap) goto out; INIT_LIST_HEAD(&gmap->crst_list); INIT_LIST_HEAD(&gmap->children); INIT_LIST_HEAD(&gmap->pt_list); INIT_RADIX_TREE(&gmap->guest_to_host, GFP_KERNEL_ACCOUNT); INIT_RADIX_TREE(&gmap->host_to_guest, GFP_ATOMIC | __GFP_ACCOUNT); INIT_RADIX_TREE(&gmap->host_to_rmap, GFP_ATOMIC | __GFP_ACCOUNT); spin_lock_init(&gmap->guest_table_lock); spin_lock_init(&gmap->shadow_lock); refcount_set(&gmap->ref_count, 1); page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) goto out_free; page->index = 0; list_add(&page->lru, &gmap->crst_list); table = (unsigned long *) page_to_phys(page); crst_table_init(table, etype); gmap->table = table; gmap->asce = atype | _ASCE_TABLE_LENGTH | _ASCE_USER_BITS | __pa(table); gmap->asce_end = limit; return gmap; out_free: kfree(gmap); out: return NULL; } /** * gmap_create - create a guest address space * @mm: pointer to the parent mm_struct * @limit: maximum size of the gmap address space * * Returns a guest address space structure. */ struct gmap *gmap_create(struct mm_struct *mm, unsigned long limit) { struct gmap *gmap; unsigned long gmap_asce; gmap = gmap_alloc(limit); if (!gmap) return NULL; gmap->mm = mm; spin_lock(&mm->context.lock); list_add_rcu(&gmap->list, &mm->context.gmap_list); if (list_is_singular(&mm->context.gmap_list)) gmap_asce = gmap->asce; else gmap_asce = -1UL; WRITE_ONCE(mm->context.gmap_asce, gmap_asce); spin_unlock(&mm->context.lock); return gmap; } EXPORT_SYMBOL_GPL(gmap_create); static void gmap_flush_tlb(struct gmap *gmap) { if (MACHINE_HAS_IDTE) __tlb_flush_idte(gmap->asce); else __tlb_flush_global(); } static void <API key>(struct radix_tree_root *root) { struct radix_tree_iter iter; unsigned long indices[16]; unsigned long index; void __rcu **slot; int i, nr; /* A radix tree is freed by deleting all of its entries */ index = 0; do { nr = 0; <API key>(slot, root, &iter, index) { indices[nr] = iter.index; if (++nr == 16) break; } for (i = 0; i < nr; i++) { index = indices[i]; radix_tree_delete(root, index); } } while (nr > 0); } static void <API key>(struct radix_tree_root *root) { struct gmap_rmap *rmap, *rnext, *head; struct radix_tree_iter iter; unsigned long indices[16]; unsigned long index; void __rcu **slot; int i, nr; /* A radix tree is freed by deleting all of its entries */ index = 0; do { nr = 0; <API key>(slot, root, &iter, index) { indices[nr] = iter.index; if (++nr == 16) break; } for (i = 0; i < nr; i++) { index = indices[i]; head = radix_tree_delete(root, index); <API key>(rmap, rnext, head) kfree(rmap); } } while (nr > 0); } /** * gmap_free - free a guest address space * @gmap: pointer to the guest address space structure * * No locks required. There are no references to this gmap anymore. */ static void gmap_free(struct gmap *gmap) { struct page *page, *next; /* Flush tlb of all gmaps (if not already done for shadows) */ if (!(gmap_is_shadow(gmap) && gmap->removed)) gmap_flush_tlb(gmap); /* Free all segment & region tables. */ <API key>(page, next, &gmap->crst_list, lru) __free_pages(page, CRST_ALLOC_ORDER); <API key>(&gmap->guest_to_host); <API key>(&gmap->host_to_guest); /* Free additional data for a shadow gmap */ if (gmap_is_shadow(gmap)) { /* Free all page tables. */ <API key>(page, next, &gmap->pt_list, lru) <API key>(page); <API key>(&gmap->host_to_rmap); /* Release reference to the parent */ gmap_put(gmap->parent); } kfree(gmap); } /** * gmap_get - increase reference counter for guest address space * @gmap: pointer to the guest address space structure * * Returns the gmap pointer */ struct gmap *gmap_get(struct gmap *gmap) { refcount_inc(&gmap->ref_count); return gmap; } EXPORT_SYMBOL_GPL(gmap_get); /** * gmap_put - decrease reference counter for guest address space * @gmap: pointer to the guest address space structure * * If the reference counter reaches zero the guest address space is freed. */ void gmap_put(struct gmap *gmap) { if (<API key>(&gmap->ref_count)) gmap_free(gmap); } EXPORT_SYMBOL_GPL(gmap_put); /** * gmap_remove - remove a guest address space but do not free it yet * @gmap: pointer to the guest address space structure */ void gmap_remove(struct gmap *gmap) { struct gmap *sg, *next; unsigned long gmap_asce; /* Remove all shadow gmaps linked to this gmap */ if (!list_empty(&gmap->children)) { spin_lock(&gmap->shadow_lock); <API key>(sg, next, &gmap->children, list) { list_del(&sg->list); gmap_put(sg); } spin_unlock(&gmap->shadow_lock); } /* Remove gmap from the pre-mm list */ spin_lock(&gmap->mm->context.lock); list_del_rcu(&gmap->list); if (list_empty(&gmap->mm->context.gmap_list)) gmap_asce = 0; else if (list_is_singular(&gmap->mm->context.gmap_list)) gmap_asce = list_first_entry(&gmap->mm->context.gmap_list, struct gmap, list)->asce; else gmap_asce = -1UL; WRITE_ONCE(gmap->mm->context.gmap_asce, gmap_asce); spin_unlock(&gmap->mm->context.lock); synchronize_rcu(); /* Put reference */ gmap_put(gmap); } EXPORT_SYMBOL_GPL(gmap_remove); /** * gmap_enable - switch primary space to the guest address space * @gmap: pointer to the guest address space structure */ void gmap_enable(struct gmap *gmap) { S390_lowcore.gmap = (unsigned long) gmap; } EXPORT_SYMBOL_GPL(gmap_enable); /** * gmap_disable - switch back to the standard primary address space * @gmap: pointer to the guest address space structure */ void gmap_disable(struct gmap *gmap) { S390_lowcore.gmap = 0UL; } EXPORT_SYMBOL_GPL(gmap_disable); /** * gmap_get_enabled - get a pointer to the currently enabled gmap * * Returns a pointer to the currently enabled gmap. 0 if none is enabled. */ struct gmap *gmap_get_enabled(void) { return (struct gmap *) S390_lowcore.gmap; } EXPORT_SYMBOL_GPL(gmap_get_enabled); /* * gmap_alloc_table is assumed to be called with mmap_lock held */ static int gmap_alloc_table(struct gmap *gmap, unsigned long *table, unsigned long init, unsigned long gaddr) { struct page *page; unsigned long *new; /* since we dont free the gmap table until gmap_free we can unlock */ page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) return -ENOMEM; new = (unsigned long *) page_to_phys(page); crst_table_init(new, init); spin_lock(&gmap->guest_table_lock); if (*table & <API key>) { list_add(&page->lru, &gmap->crst_list); *table = (unsigned long) new | <API key> | (*table & <API key>); page->index = gaddr; page = NULL; } spin_unlock(&gmap->guest_table_lock); if (page) __free_pages(page, CRST_ALLOC_ORDER); return 0; } /** * <API key> - find virtual address from segment pointer * @entry: pointer to a segment table entry in the guest address space * * Returns the virtual address in the guest address space for the segment */ static unsigned long <API key>(unsigned long *entry) { struct page *page; unsigned long offset, mask; offset = (unsigned long) entry / sizeof(unsigned long); offset = (offset & (PTRS_PER_PMD - 1)) * PMD_SIZE; mask = ~(PTRS_PER_PMD * sizeof(pmd_t) - 1); page = virt_to_page((void *)((unsigned long) entry & mask)); return page->index + offset; } /** * <API key> - unlink a single segment via a host address * @gmap: pointer to the guest address space structure * @vmaddr: address in the host process address space * * Returns 1 if a TLB flush is required */ static int <API key>(struct gmap *gmap, unsigned long vmaddr) { unsigned long *entry; int flush = 0; BUG_ON(gmap_is_shadow(gmap)); spin_lock(&gmap->guest_table_lock); entry = radix_tree_delete(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); if (entry) { flush = (*entry != <API key>); *entry = <API key>; } spin_unlock(&gmap->guest_table_lock); return flush; } /** * <API key> - unmap a single segment via a guest address * @gmap: pointer to the guest address space structure * @gaddr: address in the guest address space * * Returns 1 if a TLB flush is required */ static int <API key>(struct gmap *gmap, unsigned long gaddr) { unsigned long vmaddr; vmaddr = (unsigned long) radix_tree_delete(&gmap->guest_to_host, gaddr >> PMD_SHIFT); return vmaddr ? <API key>(gmap, vmaddr) : 0; } /** * gmap_unmap_segment - unmap segment from the guest address space * @gmap: pointer to the guest address space structure * @to: address in the guest address space * @len: length of the memory area to unmap * * Returns 0 if the unmap succeeded, -EINVAL if not. */ int gmap_unmap_segment(struct gmap *gmap, unsigned long to, unsigned long len) { unsigned long off; int flush; BUG_ON(gmap_is_shadow(gmap)); if ((to | len) & (PMD_SIZE - 1)) return -EINVAL; if (len == 0 || to + len < to) return -EINVAL; flush = 0; mmap_write_lock(gmap->mm); for (off = 0; off < len; off += PMD_SIZE) flush |= <API key>(gmap, to + off); mmap_write_unlock(gmap->mm); if (flush) gmap_flush_tlb(gmap); return 0; } EXPORT_SYMBOL_GPL(gmap_unmap_segment); /** * gmap_map_segment - map a segment to the guest address space * @gmap: pointer to the guest address space structure * @from: source address in the parent address space * @to: target address in the guest address space * @len: length of the memory area to map * * Returns 0 if the mmap succeeded, -EINVAL or -ENOMEM if not. */ int gmap_map_segment(struct gmap *gmap, unsigned long from, unsigned long to, unsigned long len) { unsigned long off; int flush; BUG_ON(gmap_is_shadow(gmap)); if ((from | to | len) & (PMD_SIZE - 1)) return -EINVAL; if (len == 0 || from + len < from || to + len < to || from + len - 1 > TASK_SIZE_MAX || to + len - 1 > gmap->asce_end) return -EINVAL; flush = 0; mmap_write_lock(gmap->mm); for (off = 0; off < len; off += PMD_SIZE) { /* Remove old translation */ flush |= <API key>(gmap, to + off); /* Store new translation */ if (radix_tree_insert(&gmap->guest_to_host, (to + off) >> PMD_SHIFT, (void *) from + off)) break; } mmap_write_unlock(gmap->mm); if (flush) gmap_flush_tlb(gmap); if (off >= len) return 0; gmap_unmap_segment(gmap, to, len); return -ENOMEM; } EXPORT_SYMBOL_GPL(gmap_map_segment); /** * __gmap_translate - translate a guest address to a user space address * @gmap: pointer to guest mapping meta data structure * @gaddr: guest address * * Returns user space address which corresponds to the guest address or * -EFAULT if no such mapping exists. * This function does not establish potentially missing page table entries. * The mmap_lock of the mm that belongs to the address space must be held * when this function gets called. * * Note: Can also be called for shadow gmaps. */ unsigned long __gmap_translate(struct gmap *gmap, unsigned long gaddr) { unsigned long vmaddr; vmaddr = (unsigned long) radix_tree_lookup(&gmap->guest_to_host, gaddr >> PMD_SHIFT); /* Note: guest_to_host is empty for a shadow gmap */ return vmaddr ? (vmaddr | (gaddr & ~PMD_MASK)) : -EFAULT; } EXPORT_SYMBOL_GPL(__gmap_translate); /** * gmap_translate - translate a guest address to a user space address * @gmap: pointer to guest mapping meta data structure * @gaddr: guest address * * Returns user space address which corresponds to the guest address or * -EFAULT if no such mapping exists. * This function does not establish potentially missing page table entries. */ unsigned long gmap_translate(struct gmap *gmap, unsigned long gaddr) { unsigned long rc; mmap_read_lock(gmap->mm); rc = __gmap_translate(gmap, gaddr); mmap_read_unlock(gmap->mm); return rc; } EXPORT_SYMBOL_GPL(gmap_translate); /** * gmap_unlink - disconnect a page table from the gmap shadow tables * @mm: pointer to the parent mm_struct * @table: pointer to the host page table * @vmaddr: vm address associated with the host page table */ void gmap_unlink(struct mm_struct *mm, unsigned long *table, unsigned long vmaddr) { struct gmap *gmap; int flush; rcu_read_lock(); <API key>(gmap, &mm->context.gmap_list, list) { flush = <API key>(gmap, vmaddr); if (flush) gmap_flush_tlb(gmap); } rcu_read_unlock(); } static void gmap_pmdp_xchg(struct gmap *gmap, pmd_t *old, pmd_t new, unsigned long gaddr); /** * __gmap_link - set up shadow page tables to connect a host to a guest address * @gmap: pointer to guest mapping meta data structure * @gaddr: guest address * @vmaddr: vm address * * Returns 0 on success, -ENOMEM for out of memory conditions, and -EFAULT * if the vm address is already mapped to a different guest segment. * The mmap_lock of the mm that belongs to the address space must be held * when this function gets called. */ int __gmap_link(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr) { struct mm_struct *mm; unsigned long *table; spinlock_t *ptl; pgd_t *pgd; p4d_t *p4d; pud_t *pud; pmd_t *pmd; u64 unprot; int rc; BUG_ON(gmap_is_shadow(gmap)); /* Create higher level tables in the gmap page table */ table = gmap->table; if ((gmap->asce & _ASCE_TYPE_MASK) >= _ASCE_TYPE_REGION1) { table += (gaddr & _REGION1_INDEX) >> _REGION1_SHIFT; if ((*table & <API key>) && gmap_alloc_table(gmap, table, <API key>, gaddr & _REGION1_MASK)) return -ENOMEM; table = (unsigned long *)(*table & <API key>); } if ((gmap->asce & _ASCE_TYPE_MASK) >= _ASCE_TYPE_REGION2) { table += (gaddr & _REGION2_INDEX) >> _REGION2_SHIFT; if ((*table & <API key>) && gmap_alloc_table(gmap, table, <API key>, gaddr & _REGION2_MASK)) return -ENOMEM; table = (unsigned long *)(*table & <API key>); } if ((gmap->asce & _ASCE_TYPE_MASK) >= _ASCE_TYPE_REGION3) { table += (gaddr & _REGION3_INDEX) >> _REGION3_SHIFT; if ((*table & <API key>) && gmap_alloc_table(gmap, table, <API key>, gaddr & _REGION3_MASK)) return -ENOMEM; table = (unsigned long *)(*table & <API key>); } table += (gaddr & _SEGMENT_INDEX) >> _SEGMENT_SHIFT; /* Walk the parent mm page table */ mm = gmap->mm; pgd = pgd_offset(mm, vmaddr); VM_BUG_ON(pgd_none(*pgd)); p4d = p4d_offset(pgd, vmaddr); VM_BUG_ON(p4d_none(*p4d)); pud = pud_offset(p4d, vmaddr); VM_BUG_ON(pud_none(*pud)); /* large puds cannot yet be handled */ if (pud_large(*pud)) return -EFAULT; pmd = pmd_offset(pud, vmaddr); VM_BUG_ON(pmd_none(*pmd)); /* Are we allowed to use huge pages? */ if (pmd_large(*pmd) && !gmap->mm->context.allow_gmap_hpage_1m) return -EFAULT; /* Link gmap segment table entry location to page table. */ rc = radix_tree_preload(GFP_KERNEL_ACCOUNT); if (rc) return rc; ptl = pmd_lock(mm, pmd); spin_lock(&gmap->guest_table_lock); if (*table == <API key>) { rc = radix_tree_insert(&gmap->host_to_guest, vmaddr >> PMD_SHIFT, table); if (!rc) { if (pmd_large(*pmd)) { *table = (pmd_val(*pmd) & <API key>) | <API key>; } else *table = pmd_val(*pmd) & <API key>; } } else if (*table & <API key> && !(pmd_val(*pmd) & <API key>)) { unprot = (u64)*table; unprot &= ~<API key>; unprot |= <API key>; gmap_pmdp_xchg(gmap, (pmd_t *)table, __pmd(unprot), gaddr); } spin_unlock(&gmap->guest_table_lock); spin_unlock(ptl); <API key>(); return rc; } /** * gmap_fault - resolve a fault on a guest address * @gmap: pointer to guest mapping meta data structure * @gaddr: guest address * @fault_flags: flags to pass down to handle_mm_fault() * * Returns 0 on success, -ENOMEM for out of memory conditions, and -EFAULT * if the vm address is already mapped to a different guest segment. */ int gmap_fault(struct gmap *gmap, unsigned long gaddr, unsigned int fault_flags) { unsigned long vmaddr; int rc; bool unlocked; mmap_read_lock(gmap->mm); retry: unlocked = false; vmaddr = __gmap_translate(gmap, gaddr); if (IS_ERR_VALUE(vmaddr)) { rc = vmaddr; goto out_up; } if (fixup_user_fault(gmap->mm, vmaddr, fault_flags, &unlocked)) { rc = -EFAULT; goto out_up; } /* * In the case that fixup_user_fault unlocked the mmap_lock during * faultin redo __gmap_translate to not race with a map/unmap_segment. */ if (unlocked) goto retry; rc = __gmap_link(gmap, gaddr, vmaddr); out_up: mmap_read_unlock(gmap->mm); return rc; } EXPORT_SYMBOL_GPL(gmap_fault); /* * this function is assumed to be called with mmap_lock held */ void __gmap_zap(struct gmap *gmap, unsigned long gaddr) { struct vm_area_struct *vma; unsigned long vmaddr; spinlock_t *ptl; pte_t *ptep; /* Find the vm address for the guest address */ vmaddr = (unsigned long) radix_tree_lookup(&gmap->guest_to_host, gaddr >> PMD_SHIFT); if (vmaddr) { vmaddr |= gaddr & ~PMD_MASK; vma = vma_lookup(gmap->mm, vmaddr); if (!vma || is_vm_hugetlb_page(vma)) return; /* Get pointer to the page table entry */ ptep = get_locked_pte(gmap->mm, vmaddr, &ptl); if (likely(ptep)) { ptep_zap_unused(gmap->mm, vmaddr, ptep, 0); pte_unmap_unlock(ptep, ptl); } } } EXPORT_SYMBOL_GPL(__gmap_zap); void gmap_discard(struct gmap *gmap, unsigned long from, unsigned long to) { unsigned long gaddr, vmaddr, size; struct vm_area_struct *vma; mmap_read_lock(gmap->mm); for (gaddr = from; gaddr < to; gaddr = (gaddr + PMD_SIZE) & PMD_MASK) { /* Find the vm address for the guest address */ vmaddr = (unsigned long) radix_tree_lookup(&gmap->guest_to_host, gaddr >> PMD_SHIFT); if (!vmaddr) continue; vmaddr |= gaddr & ~PMD_MASK; /* Find vma in the parent mm */ vma = find_vma(gmap->mm, vmaddr); if (!vma) continue; /* * We do not discard pages that are backed by * hugetlbfs, so we don't have to refault them. */ if (is_vm_hugetlb_page(vma)) continue; size = min(to - gaddr, PMD_SIZE - (gaddr & ~PMD_MASK)); zap_page_range(vma, vmaddr, size); } mmap_read_unlock(gmap->mm); } EXPORT_SYMBOL_GPL(gmap_discard); static LIST_HEAD(gmap_notifier_list); static DEFINE_SPINLOCK(gmap_notifier_lock); /** * <API key> - register a pte invalidation callback * @nb: pointer to the gmap notifier block */ void <API key>(struct gmap_notifier *nb) { spin_lock(&gmap_notifier_lock); list_add_rcu(&nb->list, &gmap_notifier_list); spin_unlock(&gmap_notifier_lock); } EXPORT_SYMBOL_GPL(<API key>); /** * <API key> - remove a pte invalidation callback * @nb: pointer to the gmap notifier block */ void <API key>(struct gmap_notifier *nb) { spin_lock(&gmap_notifier_lock); list_del_rcu(&nb->list); spin_unlock(&gmap_notifier_lock); synchronize_rcu(); } EXPORT_SYMBOL_GPL(<API key>); /** * gmap_call_notifier - call all registered invalidation callbacks * @gmap: pointer to guest mapping meta data structure * @start: start virtual address in the guest address space * @end: end virtual address in the guest address space */ static void gmap_call_notifier(struct gmap *gmap, unsigned long start, unsigned long end) { struct gmap_notifier *nb; list_for_each_entry(nb, &gmap_notifier_list, list) nb->notifier_call(gmap, start, end); } /** * gmap_table_walk - walk the gmap page tables * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @level: page table level to stop at * * Returns a table entry pointer for the given guest address and @level * @level=0 : returns a pointer to a page table table entry (or NULL) * @level=1 : returns a pointer to a segment table entry (or NULL) * @level=2 : returns a pointer to a region-3 table entry (or NULL) * @level=3 : returns a pointer to a region-2 table entry (or NULL) * @level=4 : returns a pointer to a region-1 table entry (or NULL) * * Returns NULL if the gmap page tables could not be walked to the * requested level. * * Note: Can also be called for shadow gmaps. */ static inline unsigned long *gmap_table_walk(struct gmap *gmap, unsigned long gaddr, int level) { const int asce_type = gmap->asce & _ASCE_TYPE_MASK; unsigned long *table = gmap->table; if (gmap_is_shadow(gmap) && gmap->removed) return NULL; if (WARN_ON_ONCE(level > (asce_type >> 2) + 1)) return NULL; if (asce_type != _ASCE_TYPE_REGION1 && gaddr & (-1UL << (31 + (asce_type >> 2) * 11))) return NULL; switch (asce_type) { case _ASCE_TYPE_REGION1: table += (gaddr & _REGION1_INDEX) >> _REGION1_SHIFT; if (level == 4) break; if (*table & <API key>) return NULL; table = (unsigned long *)(*table & <API key>); fallthrough; case _ASCE_TYPE_REGION2: table += (gaddr & _REGION2_INDEX) >> _REGION2_SHIFT; if (level == 3) break; if (*table & <API key>) return NULL; table = (unsigned long *)(*table & <API key>); fallthrough; case _ASCE_TYPE_REGION3: table += (gaddr & _REGION3_INDEX) >> _REGION3_SHIFT; if (level == 2) break; if (*table & <API key>) return NULL; table = (unsigned long *)(*table & <API key>); fallthrough; case _ASCE_TYPE_SEGMENT: table += (gaddr & _SEGMENT_INDEX) >> _SEGMENT_SHIFT; if (level == 1) break; if (*table & <API key>) return NULL; table = (unsigned long *)(*table & <API key>); table += (gaddr & _PAGE_INDEX) >> _PAGE_SHIFT; } return table; } /** * gmap_pte_op_walk - walk the gmap page table, get the page table lock * and return the pte pointer * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @ptl: pointer to the spinlock pointer * * Returns a pointer to the locked pte for a guest address, or NULL */ static pte_t *gmap_pte_op_walk(struct gmap *gmap, unsigned long gaddr, spinlock_t **ptl) { unsigned long *table; BUG_ON(gmap_is_shadow(gmap)); /* Walk the gmap page table, lock and get pte pointer */ table = gmap_table_walk(gmap, gaddr, 1); /* get segment pointer */ if (!table || *table & <API key>) return NULL; return pte_alloc_map_lock(gmap->mm, (pmd_t *) table, gaddr, ptl); } /** * gmap_pte_op_fixup - force a page in and connect the gmap page table * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @vmaddr: address in the host process address space * @prot: indicates access rights: PROT_NONE, PROT_READ or PROT_WRITE * * Returns 0 if the caller can retry __gmap_translate (might fail again), * -ENOMEM if out of memory and -EFAULT if anything goes wrong while fixing * up or connecting the gmap page table. */ static int gmap_pte_op_fixup(struct gmap *gmap, unsigned long gaddr, unsigned long vmaddr, int prot) { struct mm_struct *mm = gmap->mm; unsigned int fault_flags; bool unlocked = false; BUG_ON(gmap_is_shadow(gmap)); fault_flags = (prot == PROT_WRITE) ? FAULT_FLAG_WRITE : 0; if (fixup_user_fault(mm, vmaddr, fault_flags, &unlocked)) return -EFAULT; if (unlocked) /* lost mmap_lock, caller has to retry __gmap_translate */ return 0; /* Connect the page tables */ return __gmap_link(gmap, gaddr, vmaddr); } /** * gmap_pte_op_end - release the page table lock * @ptl: pointer to the spinlock pointer */ static void gmap_pte_op_end(spinlock_t *ptl) { if (ptl) spin_unlock(ptl); } /** * gmap_pmd_op_walk - walk the gmap tables, get the guest table lock * and return the pmd pointer * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * * Returns a pointer to the pmd for a guest address, or NULL */ static inline pmd_t *gmap_pmd_op_walk(struct gmap *gmap, unsigned long gaddr) { pmd_t *pmdp; BUG_ON(gmap_is_shadow(gmap)); pmdp = (pmd_t *) gmap_table_walk(gmap, gaddr, 1); if (!pmdp) return NULL; /* without huge pages, there is no need to take the table lock */ if (!gmap->mm->context.allow_gmap_hpage_1m) return pmd_none(*pmdp) ? NULL : pmdp; spin_lock(&gmap->guest_table_lock); if (pmd_none(*pmdp)) { spin_unlock(&gmap->guest_table_lock); return NULL; } /* 4k page table entries are locked via the pte (pte_alloc_map_lock). */ if (!pmd_large(*pmdp)) spin_unlock(&gmap->guest_table_lock); return pmdp; } /** * gmap_pmd_op_end - release the guest_table_lock if needed * @gmap: pointer to the guest mapping meta data structure * @pmdp: pointer to the pmd */ static inline void gmap_pmd_op_end(struct gmap *gmap, pmd_t *pmdp) { if (pmd_large(*pmdp)) spin_unlock(&gmap->guest_table_lock); } /* * gmap_protect_pmd - remove access rights to memory and set pmd notification bits * @pmdp: pointer to the pmd to be protected * @prot: indicates access rights: PROT_NONE, PROT_READ or PROT_WRITE * @bits: notification bits to set * * Returns: * 0 if successfully protected * -EAGAIN if a fixup is needed * -EINVAL if unsupported notifier bits have been specified * * Expected to be called with sg->mm->mmap_lock in read and * guest_table_lock held. */ static int gmap_protect_pmd(struct gmap *gmap, unsigned long gaddr, pmd_t *pmdp, int prot, unsigned long bits) { int pmd_i = pmd_val(*pmdp) & <API key>; int pmd_p = pmd_val(*pmdp) & <API key>; pmd_t new = *pmdp; /* Fixup needed */ if ((pmd_i && (prot != PROT_NONE)) || (pmd_p && (prot == PROT_WRITE))) return -EAGAIN; if (prot == PROT_NONE && !pmd_i) { pmd_val(new) |= <API key>; gmap_pmdp_xchg(gmap, pmdp, new, gaddr); } if (prot == PROT_READ && !pmd_p) { pmd_val(new) &= ~<API key>; pmd_val(new) |= <API key>; gmap_pmdp_xchg(gmap, pmdp, new, gaddr); } if (bits & GMAP_NOTIFY_MPROT) pmd_val(*pmdp) |= <API key>; /* Shadow GMAP protection needs split PMDs */ if (bits & GMAP_NOTIFY_SHADOW) return -EINVAL; return 0; } /* * gmap_protect_pte - remove access rights to memory and set pgste bits * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @pmdp: pointer to the pmd associated with the pte * @prot: indicates access rights: PROT_NONE, PROT_READ or PROT_WRITE * @bits: notification bits to set * * Returns 0 if successfully protected, -ENOMEM if out of memory and * -EAGAIN if a fixup is needed. * * Expected to be called with sg->mm->mmap_lock in read */ static int gmap_protect_pte(struct gmap *gmap, unsigned long gaddr, pmd_t *pmdp, int prot, unsigned long bits) { int rc; pte_t *ptep; spinlock_t *ptl = NULL; unsigned long pbits = 0; if (pmd_val(*pmdp) & <API key>) return -EAGAIN; ptep = pte_alloc_map_lock(gmap->mm, pmdp, gaddr, &ptl); if (!ptep) return -ENOMEM; pbits |= (bits & GMAP_NOTIFY_MPROT) ? PGSTE_IN_BIT : 0; pbits |= (bits & GMAP_NOTIFY_SHADOW) ? PGSTE_VSIE_BIT : 0; /* Protect and unlock. */ rc = ptep_force_prot(gmap->mm, gaddr, ptep, prot, pbits); gmap_pte_op_end(ptl); return rc; } /* * gmap_protect_range - remove access rights to memory and set pgste bits * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @len: size of area * @prot: indicates access rights: PROT_NONE, PROT_READ or PROT_WRITE * @bits: pgste notification bits to set * * Returns 0 if successfully protected, -ENOMEM if out of memory and * -EFAULT if gaddr is invalid (or mapping for shadows is missing). * * Called with sg->mm->mmap_lock in read. */ static int gmap_protect_range(struct gmap *gmap, unsigned long gaddr, unsigned long len, int prot, unsigned long bits) { unsigned long vmaddr, dist; pmd_t *pmdp; int rc; BUG_ON(gmap_is_shadow(gmap)); while (len) { rc = -EAGAIN; pmdp = gmap_pmd_op_walk(gmap, gaddr); if (pmdp) { if (!pmd_large(*pmdp)) { rc = gmap_protect_pte(gmap, gaddr, pmdp, prot, bits); if (!rc) { len -= PAGE_SIZE; gaddr += PAGE_SIZE; } } else { rc = gmap_protect_pmd(gmap, gaddr, pmdp, prot, bits); if (!rc) { dist = HPAGE_SIZE - (gaddr & ~HPAGE_MASK); len = len < dist ? 0 : len - dist; gaddr = (gaddr & HPAGE_MASK) + HPAGE_SIZE; } } gmap_pmd_op_end(gmap, pmdp); } if (rc) { if (rc == -EINVAL) return rc; /* -EAGAIN, fixup of userspace mm and gmap */ vmaddr = __gmap_translate(gmap, gaddr); if (IS_ERR_VALUE(vmaddr)) return vmaddr; rc = gmap_pte_op_fixup(gmap, gaddr, vmaddr, prot); if (rc) return rc; } } return 0; } /** * <API key> - change access rights for a range of ptes and * call the notifier if any pte changes again * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @len: size of area * @prot: indicates access rights: PROT_NONE, PROT_READ or PROT_WRITE * * Returns 0 if for each page in the given range a gmap mapping exists, * the new access rights could be set and the notifier could be armed. * If the gmap mapping is missing for one or more pages -EFAULT is * returned. If no memory could be allocated -ENOMEM is returned. * This function establishes missing page table entries. */ int <API key>(struct gmap *gmap, unsigned long gaddr, unsigned long len, int prot) { int rc; if ((gaddr & ~PAGE_MASK) || (len & ~PAGE_MASK) || gmap_is_shadow(gmap)) return -EINVAL; if (!MACHINE_HAS_ESOP && prot == PROT_READ) return -EINVAL; mmap_read_lock(gmap->mm); rc = gmap_protect_range(gmap, gaddr, len, prot, GMAP_NOTIFY_MPROT); mmap_read_unlock(gmap->mm); return rc; } EXPORT_SYMBOL_GPL(<API key>); /** * gmap_read_table - get an unsigned long value from a guest page table using * absolute addressing, without marking the page referenced. * @gmap: pointer to guest mapping meta data structure * @gaddr: virtual address in the guest address space * @val: pointer to the unsigned long value to return * * Returns 0 if the value was read, -ENOMEM if out of memory and -EFAULT * if reading using the virtual address failed. -EINVAL if called on a gmap * shadow. * * Called with gmap->mm->mmap_lock in read. */ int gmap_read_table(struct gmap *gmap, unsigned long gaddr, unsigned long *val) { unsigned long address, vmaddr; spinlock_t *ptl; pte_t *ptep, pte; int rc; if (gmap_is_shadow(gmap)) return -EINVAL; while (1) { rc = -EAGAIN; ptep = gmap_pte_op_walk(gmap, gaddr, &ptl); if (ptep) { pte = *ptep; if (pte_present(pte) && (pte_val(pte) & _PAGE_READ)) { address = pte_val(pte) & PAGE_MASK; address += gaddr & ~PAGE_MASK; *val = *(unsigned long *) address; pte_val(*ptep) |= _PAGE_YOUNG; /* Do *NOT* clear the _PAGE_INVALID bit! */ rc = 0; } gmap_pte_op_end(ptl); } if (!rc) break; vmaddr = __gmap_translate(gmap, gaddr); if (IS_ERR_VALUE(vmaddr)) { rc = vmaddr; break; } rc = gmap_pte_op_fixup(gmap, gaddr, vmaddr, PROT_READ); if (rc) break; } return rc; } EXPORT_SYMBOL_GPL(gmap_read_table); /** * gmap_insert_rmap - add a rmap to the host_to_rmap radix tree * @sg: pointer to the shadow guest address space structure * @vmaddr: vm address associated with the rmap * @rmap: pointer to the rmap structure * * Called with the sg->guest_table_lock */ static inline void gmap_insert_rmap(struct gmap *sg, unsigned long vmaddr, struct gmap_rmap *rmap) { void __rcu **slot; BUG_ON(!gmap_is_shadow(sg)); slot = <API key>(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT); if (slot) { rmap->next = <API key>(slot, &sg->guest_table_lock); <API key>(&sg->host_to_rmap, slot, rmap); } else { rmap->next = NULL; radix_tree_insert(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT, rmap); } } /** * gmap_protect_rmap - restrict access rights to memory (RO) and create an rmap * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow gmap * @paddr: address in the parent guest address space * @len: length of the memory area to protect * * Returns 0 if successfully protected and the rmap was created, -ENOMEM * if out of memory and -EFAULT if paddr is invalid. */ static int gmap_protect_rmap(struct gmap *sg, unsigned long raddr, unsigned long paddr, unsigned long len) { struct gmap *parent; struct gmap_rmap *rmap; unsigned long vmaddr; spinlock_t *ptl; pte_t *ptep; int rc; BUG_ON(!gmap_is_shadow(sg)); parent = sg->parent; while (len) { vmaddr = __gmap_translate(parent, paddr); if (IS_ERR_VALUE(vmaddr)) return vmaddr; rmap = kzalloc(sizeof(*rmap), GFP_KERNEL_ACCOUNT); if (!rmap) return -ENOMEM; rmap->raddr = raddr; rc = radix_tree_preload(GFP_KERNEL_ACCOUNT); if (rc) { kfree(rmap); return rc; } rc = -EAGAIN; ptep = gmap_pte_op_walk(parent, paddr, &ptl); if (ptep) { spin_lock(&sg->guest_table_lock); rc = ptep_force_prot(parent->mm, paddr, ptep, PROT_READ, PGSTE_VSIE_BIT); if (!rc) gmap_insert_rmap(sg, vmaddr, rmap); spin_unlock(&sg->guest_table_lock); gmap_pte_op_end(ptl); } <API key>(); if (rc) { kfree(rmap); rc = gmap_pte_op_fixup(parent, paddr, vmaddr, PROT_READ); if (rc) return rc; continue; } paddr += PAGE_SIZE; len -= PAGE_SIZE; } return 0; } #define _SHADOW_RMAP_MASK 0x7 #define <API key> 0x5 #define <API key> 0x4 #define <API key> 0x3 #define <API key> 0x2 #define <API key> 0x1 /** * gmap_idte_one - invalidate a single region or segment table entry * @asce: region or segment table *origin* + table-type bits * @vaddr: virtual address to identify the table entry to flush * * The invalid bit of a single region or segment table entry is set * and the associated TLB entries depending on the entry are flushed. * The table-type of the @asce identifies the portion of the @vaddr * that is used as the invalidation index. */ static inline void gmap_idte_one(unsigned long asce, unsigned long vaddr) { asm volatile( " .insn rrf,0xb98e0000,%0,%1,0,0" : : "a" (asce), "a" (vaddr) : "cc", "memory"); } /** * gmap_unshadow_page - remove a page from a shadow page table * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * * Called with the sg->guest_table_lock */ static void gmap_unshadow_page(struct gmap *sg, unsigned long raddr) { unsigned long *table; BUG_ON(!gmap_is_shadow(sg)); table = gmap_table_walk(sg, raddr, 0); /* get page table pointer */ if (!table || *table & _PAGE_INVALID) return; gmap_call_notifier(sg, raddr, raddr + _PAGE_SIZE - 1); ptep_unshadow_pte(sg->mm, raddr, (pte_t *) table); } /** * __gmap_unshadow_pgt - remove all entries from a shadow page table * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * @pgt: pointer to the start of a shadow page table * * Called with the sg->guest_table_lock */ static void __gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr, unsigned long *pgt) { int i; BUG_ON(!gmap_is_shadow(sg)); for (i = 0; i < _PAGE_ENTRIES; i++, raddr += _PAGE_SIZE) pgt[i] = _PAGE_INVALID; } /** * gmap_unshadow_pgt - remove a shadow page table from a segment entry * @sg: pointer to the shadow guest address space structure * @raddr: address in the shadow guest address space * * Called with the sg->guest_table_lock */ static void gmap_unshadow_pgt(struct gmap *sg, unsigned long raddr) { unsigned long sto, *ste, *pgt; struct page *page; BUG_ON(!gmap_is_shadow(sg)); ste = gmap_table_walk(sg, raddr, 1); /* get segment pointer */ if (!ste || !(*ste & <API key>)) return; gmap_call_notifier(sg, raddr, raddr + _SEGMENT_SIZE - 1); sto = (unsigned long) (ste - ((raddr & _SEGMENT_INDEX) >> _SEGMENT_SHIFT)); gmap_idte_one(sto | _ASCE_TYPE_SEGMENT, raddr); pgt = (unsigned long *)(*ste & <API key>); *ste = <API key>; __gmap_unshadow_pgt(sg, raddr, pgt); /* Free page table */ page = pfn_to_page(__pa(pgt) >> PAGE_SHIFT); list_del(&page->lru); <API key>(page); } /** * __gmap_unshadow_sgt - remove all entries from a shadow segment table * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * @sgt: pointer to the start of a shadow segment table * * Called with the sg->guest_table_lock */ static void __gmap_unshadow_sgt(struct gmap *sg, unsigned long raddr, unsigned long *sgt) { unsigned long *pgt; struct page *page; int i; BUG_ON(!gmap_is_shadow(sg)); for (i = 0; i < _CRST_ENTRIES; i++, raddr += _SEGMENT_SIZE) { if (!(sgt[i] & <API key>)) continue; pgt = (unsigned long *)(sgt[i] & <API key>); sgt[i] = <API key>; __gmap_unshadow_pgt(sg, raddr, pgt); /* Free page table */ page = pfn_to_page(__pa(pgt) >> PAGE_SHIFT); list_del(&page->lru); <API key>(page); } } /** * gmap_unshadow_sgt - remove a shadow segment table from a region-3 entry * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * * Called with the shadow->guest_table_lock */ static void gmap_unshadow_sgt(struct gmap *sg, unsigned long raddr) { unsigned long r3o, *r3e, *sgt; struct page *page; BUG_ON(!gmap_is_shadow(sg)); r3e = gmap_table_walk(sg, raddr, 2); /* get region-3 pointer */ if (!r3e || !(*r3e & <API key>)) return; gmap_call_notifier(sg, raddr, raddr + _REGION3_SIZE - 1); r3o = (unsigned long) (r3e - ((raddr & _REGION3_INDEX) >> _REGION3_SHIFT)); gmap_idte_one(r3o | _ASCE_TYPE_REGION3, raddr); sgt = (unsigned long *)(*r3e & <API key>); *r3e = <API key>; __gmap_unshadow_sgt(sg, raddr, sgt); /* Free segment table */ page = pfn_to_page(__pa(sgt) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } /** * __gmap_unshadow_r3t - remove all entries from a shadow region-3 table * @sg: pointer to the shadow guest address space structure * @raddr: address in the shadow guest address space * @r3t: pointer to the start of a shadow region-3 table * * Called with the sg->guest_table_lock */ static void __gmap_unshadow_r3t(struct gmap *sg, unsigned long raddr, unsigned long *r3t) { unsigned long *sgt; struct page *page; int i; BUG_ON(!gmap_is_shadow(sg)); for (i = 0; i < _CRST_ENTRIES; i++, raddr += _REGION3_SIZE) { if (!(r3t[i] & <API key>)) continue; sgt = (unsigned long *)(r3t[i] & <API key>); r3t[i] = <API key>; __gmap_unshadow_sgt(sg, raddr, sgt); /* Free segment table */ page = pfn_to_page(__pa(sgt) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } } /** * gmap_unshadow_r3t - remove a shadow region-3 table from a region-2 entry * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * * Called with the sg->guest_table_lock */ static void gmap_unshadow_r3t(struct gmap *sg, unsigned long raddr) { unsigned long r2o, *r2e, *r3t; struct page *page; BUG_ON(!gmap_is_shadow(sg)); r2e = gmap_table_walk(sg, raddr, 3); /* get region-2 pointer */ if (!r2e || !(*r2e & <API key>)) return; gmap_call_notifier(sg, raddr, raddr + _REGION2_SIZE - 1); r2o = (unsigned long) (r2e - ((raddr & _REGION2_INDEX) >> _REGION2_SHIFT)); gmap_idte_one(r2o | _ASCE_TYPE_REGION2, raddr); r3t = (unsigned long *)(*r2e & <API key>); *r2e = <API key>; __gmap_unshadow_r3t(sg, raddr, r3t); /* Free region 3 table */ page = pfn_to_page(__pa(r3t) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } /** * __gmap_unshadow_r2t - remove all entries from a shadow region-2 table * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * @r2t: pointer to the start of a shadow region-2 table * * Called with the sg->guest_table_lock */ static void __gmap_unshadow_r2t(struct gmap *sg, unsigned long raddr, unsigned long *r2t) { unsigned long *r3t; struct page *page; int i; BUG_ON(!gmap_is_shadow(sg)); for (i = 0; i < _CRST_ENTRIES; i++, raddr += _REGION2_SIZE) { if (!(r2t[i] & <API key>)) continue; r3t = (unsigned long *)(r2t[i] & <API key>); r2t[i] = <API key>; __gmap_unshadow_r3t(sg, raddr, r3t); /* Free region 3 table */ page = pfn_to_page(__pa(r3t) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } } /** * gmap_unshadow_r2t - remove a shadow region-2 table from a region-1 entry * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * * Called with the sg->guest_table_lock */ static void gmap_unshadow_r2t(struct gmap *sg, unsigned long raddr) { unsigned long r1o, *r1e, *r2t; struct page *page; BUG_ON(!gmap_is_shadow(sg)); r1e = gmap_table_walk(sg, raddr, 4); /* get region-1 pointer */ if (!r1e || !(*r1e & <API key>)) return; gmap_call_notifier(sg, raddr, raddr + _REGION1_SIZE - 1); r1o = (unsigned long) (r1e - ((raddr & _REGION1_INDEX) >> _REGION1_SHIFT)); gmap_idte_one(r1o | _ASCE_TYPE_REGION1, raddr); r2t = (unsigned long *)(*r1e & <API key>); *r1e = <API key>; __gmap_unshadow_r2t(sg, raddr, r2t); /* Free region 2 table */ page = pfn_to_page(__pa(r2t) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } /** * __gmap_unshadow_r1t - remove all entries from a shadow region-1 table * @sg: pointer to the shadow guest address space structure * @raddr: rmap address in the shadow guest address space * @r1t: pointer to the start of a shadow region-1 table * * Called with the shadow->guest_table_lock */ static void __gmap_unshadow_r1t(struct gmap *sg, unsigned long raddr, unsigned long *r1t) { unsigned long asce, *r2t; struct page *page; int i; BUG_ON(!gmap_is_shadow(sg)); asce = (unsigned long) r1t | _ASCE_TYPE_REGION1; for (i = 0; i < _CRST_ENTRIES; i++, raddr += _REGION1_SIZE) { if (!(r1t[i] & <API key>)) continue; r2t = (unsigned long *)(r1t[i] & <API key>); __gmap_unshadow_r2t(sg, raddr, r2t); /* Clear entry and flush translation r1t -> r2t */ gmap_idte_one(asce, raddr); r1t[i] = <API key>; /* Free region 2 table */ page = pfn_to_page(__pa(r2t) >> PAGE_SHIFT); list_del(&page->lru); __free_pages(page, CRST_ALLOC_ORDER); } } /** * gmap_unshadow - remove a shadow page table completely * @sg: pointer to the shadow guest address space structure * * Called with sg->guest_table_lock */ static void gmap_unshadow(struct gmap *sg) { unsigned long *table; BUG_ON(!gmap_is_shadow(sg)); if (sg->removed) return; sg->removed = 1; gmap_call_notifier(sg, 0, -1UL); gmap_flush_tlb(sg); table = (unsigned long *)(sg->asce & _ASCE_ORIGIN); switch (sg->asce & _ASCE_TYPE_MASK) { case _ASCE_TYPE_REGION1: __gmap_unshadow_r1t(sg, 0, table); break; case _ASCE_TYPE_REGION2: __gmap_unshadow_r2t(sg, 0, table); break; case _ASCE_TYPE_REGION3: __gmap_unshadow_r3t(sg, 0, table); break; case _ASCE_TYPE_SEGMENT: __gmap_unshadow_sgt(sg, 0, table); break; } } /** * gmap_find_shadow - find a specific asce in the list of shadow tables * @parent: pointer to the parent gmap * @asce: ASCE for which the shadow table is created * @edat_level: edat level to be used for the shadow translation * * Returns the pointer to a gmap if a shadow table with the given asce is * already available, ERR_PTR(-EAGAIN) if another one is just being created, * otherwise NULL */ static struct gmap *gmap_find_shadow(struct gmap *parent, unsigned long asce, int edat_level) { struct gmap *sg; list_for_each_entry(sg, &parent->children, list) { if (sg->orig_asce != asce || sg->edat_level != edat_level || sg->removed) continue; if (!sg->initialized) return ERR_PTR(-EAGAIN); refcount_inc(&sg->ref_count); return sg; } return NULL; } /** * gmap_shadow_valid - check if a shadow guest address space matches the * given properties and is still valid * @sg: pointer to the shadow guest address space structure * @asce: ASCE for which the shadow table is requested * @edat_level: edat level to be used for the shadow translation * * Returns 1 if the gmap shadow is still valid and matches the given * properties, the caller can continue using it. Returns 0 otherwise, the * caller has to request a new shadow gmap in this case. * */ int gmap_shadow_valid(struct gmap *sg, unsigned long asce, int edat_level) { if (sg->removed) return 0; return sg->orig_asce == asce && sg->edat_level == edat_level; } EXPORT_SYMBOL_GPL(gmap_shadow_valid); /** * gmap_shadow - create/find a shadow guest address space * @parent: pointer to the parent gmap * @asce: ASCE for which the shadow table is created * @edat_level: edat level to be used for the shadow translation * * The pages of the top level page table referred by the asce parameter * will be set to read-only and marked in the PGSTEs of the kvm process. * The shadow table will be removed automatically on any change to the * PTE mapping for the source table. * * Returns a guest address space structure, ERR_PTR(-ENOMEM) if out of memory, * ERR_PTR(-EAGAIN) if the caller has to retry and ERR_PTR(-EFAULT) if the * parent gmap table could not be protected. */ struct gmap *gmap_shadow(struct gmap *parent, unsigned long asce, int edat_level) { struct gmap *sg, *new; unsigned long limit; int rc; BUG_ON(parent->mm->context.allow_gmap_hpage_1m); BUG_ON(gmap_is_shadow(parent)); spin_lock(&parent->shadow_lock); sg = gmap_find_shadow(parent, asce, edat_level); spin_unlock(&parent->shadow_lock); if (sg) return sg; /* Create a new shadow gmap */ limit = -1UL >> (33 - (((asce & _ASCE_TYPE_MASK) >> 2) * 11)); if (asce & _ASCE_REAL_SPACE) limit = -1UL; new = gmap_alloc(limit); if (!new) return ERR_PTR(-ENOMEM); new->mm = parent->mm; new->parent = gmap_get(parent); new->orig_asce = asce; new->edat_level = edat_level; new->initialized = false; spin_lock(&parent->shadow_lock); /* Recheck if another CPU created the same shadow */ sg = gmap_find_shadow(parent, asce, edat_level); if (sg) { spin_unlock(&parent->shadow_lock); gmap_free(new); return sg; } if (asce & _ASCE_REAL_SPACE) { /* only allow one real-space gmap shadow */ list_for_each_entry(sg, &parent->children, list) { if (sg->orig_asce & _ASCE_REAL_SPACE) { spin_lock(&sg->guest_table_lock); gmap_unshadow(sg); spin_unlock(&sg->guest_table_lock); list_del(&sg->list); gmap_put(sg); break; } } } refcount_set(&new->ref_count, 2); list_add(&new->list, &parent->children); if (asce & _ASCE_REAL_SPACE) { /* nothing to protect, return right away */ new->initialized = true; spin_unlock(&parent->shadow_lock); return new; } spin_unlock(&parent->shadow_lock); /* protect after insertion, so it will get properly invalidated */ mmap_read_lock(parent->mm); rc = gmap_protect_range(parent, asce & _ASCE_ORIGIN, ((asce & _ASCE_TABLE_LENGTH) + 1) * PAGE_SIZE, PROT_READ, GMAP_NOTIFY_SHADOW); mmap_read_unlock(parent->mm); spin_lock(&parent->shadow_lock); new->initialized = true; if (rc) { list_del(&new->list); gmap_free(new); new = ERR_PTR(rc); } spin_unlock(&parent->shadow_lock); return new; } EXPORT_SYMBOL_GPL(gmap_shadow); /** * gmap_shadow_r2t - create an empty shadow region 2 table * @sg: pointer to the shadow guest address space structure * @saddr: faulting address in the shadow gmap * @r2t: parent gmap address of the region 2 table to get shadowed * @fake: r2t references contiguous guest memory block, not a r2t * * The r2t parameter specifies the address of the source table. The * four pages of the source table are made read-only in the parent gmap * address space. A write to the source table area @r2t will automatically * remove the shadow r2 table and all of its decendents. * * Returns 0 if successfully shadowed or already shadowed, -EAGAIN if the * shadow table structure is incomplete, -ENOMEM if out of memory and * -EFAULT if an address in the parent gmap could not be resolved. * * Called with sg->mm->mmap_lock in read. */ int gmap_shadow_r2t(struct gmap *sg, unsigned long saddr, unsigned long r2t, int fake) { unsigned long raddr, origin, offset, len; unsigned long *s_r2t, *table; struct page *page; int rc; BUG_ON(!gmap_is_shadow(sg)); /* Allocate a shadow region second table */ page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) return -ENOMEM; page->index = r2t & <API key>; if (fake) page->index |= <API key>; s_r2t = (unsigned long *) page_to_phys(page); /* Install shadow region second table */ spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 4); /* get region-1 pointer */ if (!table) { rc = -EAGAIN; /* Race with unshadow */ goto out_free; } if (!(*table & <API key>)) { rc = 0; /* Already established */ goto out_free; } else if (*table & <API key>) { rc = -EAGAIN; /* Race with shadow */ goto out_free; } crst_table_init(s_r2t, <API key>); /* mark as invalid as long as the parent table is not protected */ *table = (unsigned long) s_r2t | <API key> | <API key> | <API key>; if (sg->edat_level >= 1) *table |= (r2t & <API key>); list_add(&page->lru, &sg->crst_list); if (fake) { /* nothing to protect for fake tables */ *table &= ~<API key>; spin_unlock(&sg->guest_table_lock); return 0; } spin_unlock(&sg->guest_table_lock); /* Make r2t read-only in parent gmap page table */ raddr = (saddr & _REGION1_MASK) | <API key>; origin = r2t & <API key>; offset = ((r2t & <API key>) >> 6) * PAGE_SIZE; len = ((r2t & <API key>) + 1) * PAGE_SIZE - offset; rc = gmap_protect_rmap(sg, raddr, origin + offset, len); spin_lock(&sg->guest_table_lock); if (!rc) { table = gmap_table_walk(sg, saddr, 4); if (!table || (*table & <API key>) != (unsigned long) s_r2t) rc = -EAGAIN; /* Race with unshadow */ else *table &= ~<API key>; } else { gmap_unshadow_r2t(sg, raddr); } spin_unlock(&sg->guest_table_lock); return rc; out_free: spin_unlock(&sg->guest_table_lock); __free_pages(page, CRST_ALLOC_ORDER); return rc; } EXPORT_SYMBOL_GPL(gmap_shadow_r2t); /** * gmap_shadow_r3t - create a shadow region 3 table * @sg: pointer to the shadow guest address space structure * @saddr: faulting address in the shadow gmap * @r3t: parent gmap address of the region 3 table to get shadowed * @fake: r3t references contiguous guest memory block, not a r3t * * Returns 0 if successfully shadowed or already shadowed, -EAGAIN if the * shadow table structure is incomplete, -ENOMEM if out of memory and * -EFAULT if an address in the parent gmap could not be resolved. * * Called with sg->mm->mmap_lock in read. */ int gmap_shadow_r3t(struct gmap *sg, unsigned long saddr, unsigned long r3t, int fake) { unsigned long raddr, origin, offset, len; unsigned long *s_r3t, *table; struct page *page; int rc; BUG_ON(!gmap_is_shadow(sg)); /* Allocate a shadow region second table */ page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) return -ENOMEM; page->index = r3t & <API key>; if (fake) page->index |= <API key>; s_r3t = (unsigned long *) page_to_phys(page); /* Install shadow region second table */ spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 3); /* get region-2 pointer */ if (!table) { rc = -EAGAIN; /* Race with unshadow */ goto out_free; } if (!(*table & <API key>)) { rc = 0; /* Already established */ goto out_free; } else if (*table & <API key>) { rc = -EAGAIN; /* Race with shadow */ goto out_free; } crst_table_init(s_r3t, <API key>); /* mark as invalid as long as the parent table is not protected */ *table = (unsigned long) s_r3t | <API key> | <API key> | <API key>; if (sg->edat_level >= 1) *table |= (r3t & <API key>); list_add(&page->lru, &sg->crst_list); if (fake) { /* nothing to protect for fake tables */ *table &= ~<API key>; spin_unlock(&sg->guest_table_lock); return 0; } spin_unlock(&sg->guest_table_lock); /* Make r3t read-only in parent gmap page table */ raddr = (saddr & _REGION2_MASK) | <API key>; origin = r3t & <API key>; offset = ((r3t & <API key>) >> 6) * PAGE_SIZE; len = ((r3t & <API key>) + 1) * PAGE_SIZE - offset; rc = gmap_protect_rmap(sg, raddr, origin + offset, len); spin_lock(&sg->guest_table_lock); if (!rc) { table = gmap_table_walk(sg, saddr, 3); if (!table || (*table & <API key>) != (unsigned long) s_r3t) rc = -EAGAIN; /* Race with unshadow */ else *table &= ~<API key>; } else { gmap_unshadow_r3t(sg, raddr); } spin_unlock(&sg->guest_table_lock); return rc; out_free: spin_unlock(&sg->guest_table_lock); __free_pages(page, CRST_ALLOC_ORDER); return rc; } EXPORT_SYMBOL_GPL(gmap_shadow_r3t); /** * gmap_shadow_sgt - create a shadow segment table * @sg: pointer to the shadow guest address space structure * @saddr: faulting address in the shadow gmap * @sgt: parent gmap address of the segment table to get shadowed * @fake: sgt references contiguous guest memory block, not a sgt * * Returns: 0 if successfully shadowed or already shadowed, -EAGAIN if the * shadow table structure is incomplete, -ENOMEM if out of memory and * -EFAULT if an address in the parent gmap could not be resolved. * * Called with sg->mm->mmap_lock in read. */ int gmap_shadow_sgt(struct gmap *sg, unsigned long saddr, unsigned long sgt, int fake) { unsigned long raddr, origin, offset, len; unsigned long *s_sgt, *table; struct page *page; int rc; BUG_ON(!gmap_is_shadow(sg) || (sgt & <API key>)); /* Allocate a shadow segment table */ page = alloc_pages(GFP_KERNEL_ACCOUNT, CRST_ALLOC_ORDER); if (!page) return -ENOMEM; page->index = sgt & <API key>; if (fake) page->index |= <API key>; s_sgt = (unsigned long *) page_to_phys(page); /* Install shadow region second table */ spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 2); /* get region-3 pointer */ if (!table) { rc = -EAGAIN; /* Race with unshadow */ goto out_free; } if (!(*table & <API key>)) { rc = 0; /* Already established */ goto out_free; } else if (*table & <API key>) { rc = -EAGAIN; /* Race with shadow */ goto out_free; } crst_table_init(s_sgt, <API key>); /* mark as invalid as long as the parent table is not protected */ *table = (unsigned long) s_sgt | <API key> | <API key> | <API key>; if (sg->edat_level >= 1) *table |= sgt & <API key>; list_add(&page->lru, &sg->crst_list); if (fake) { /* nothing to protect for fake tables */ *table &= ~<API key>; spin_unlock(&sg->guest_table_lock); return 0; } spin_unlock(&sg->guest_table_lock); /* Make sgt read-only in parent gmap page table */ raddr = (saddr & _REGION3_MASK) | <API key>; origin = sgt & <API key>; offset = ((sgt & <API key>) >> 6) * PAGE_SIZE; len = ((sgt & <API key>) + 1) * PAGE_SIZE - offset; rc = gmap_protect_rmap(sg, raddr, origin + offset, len); spin_lock(&sg->guest_table_lock); if (!rc) { table = gmap_table_walk(sg, saddr, 2); if (!table || (*table & <API key>) != (unsigned long) s_sgt) rc = -EAGAIN; /* Race with unshadow */ else *table &= ~<API key>; } else { gmap_unshadow_sgt(sg, raddr); } spin_unlock(&sg->guest_table_lock); return rc; out_free: spin_unlock(&sg->guest_table_lock); __free_pages(page, CRST_ALLOC_ORDER); return rc; } EXPORT_SYMBOL_GPL(gmap_shadow_sgt); /** * <API key> - find a shadow page table * @sg: pointer to the shadow guest address space structure * @saddr: the address in the shadow aguest address space * @pgt: parent gmap address of the page table to get shadowed * @dat_protection: if the pgtable is marked as protected by dat * @fake: pgt references contiguous guest memory block, not a pgtable * * Returns 0 if the shadow page table was found and -EAGAIN if the page * table was not found. * * Called with sg->mm->mmap_lock in read. */ int <API key>(struct gmap *sg, unsigned long saddr, unsigned long *pgt, int *dat_protection, int *fake) { unsigned long *table; struct page *page; int rc; BUG_ON(!gmap_is_shadow(sg)); spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 1); /* get segment pointer */ if (table && !(*table & <API key>)) { /* Shadow page tables are full pages (pte+pgste) */ page = pfn_to_page(*table >> PAGE_SHIFT); *pgt = page->index & ~<API key>; *dat_protection = !!(*table & <API key>); *fake = !!(page->index & <API key>); rc = 0; } else { rc = -EAGAIN; } spin_unlock(&sg->guest_table_lock); return rc; } EXPORT_SYMBOL_GPL(<API key>); /** * gmap_shadow_pgt - instantiate a shadow page table * @sg: pointer to the shadow guest address space structure * @saddr: faulting address in the shadow gmap * @pgt: parent gmap address of the page table to get shadowed * @fake: pgt references contiguous guest memory block, not a pgtable * * Returns 0 if successfully shadowed or already shadowed, -EAGAIN if the * shadow table structure is incomplete, -ENOMEM if out of memory, * -EFAULT if an address in the parent gmap could not be resolved and * * Called with gmap->mm->mmap_lock in read */ int gmap_shadow_pgt(struct gmap *sg, unsigned long saddr, unsigned long pgt, int fake) { unsigned long raddr, origin; unsigned long *s_pgt, *table; struct page *page; int rc; BUG_ON(!gmap_is_shadow(sg) || (pgt & <API key>)); /* Allocate a shadow page table */ page = <API key>(sg->mm); if (!page) return -ENOMEM; page->index = pgt & <API key>; if (fake) page->index |= <API key>; s_pgt = (unsigned long *) page_to_phys(page); /* Install shadow page table */ spin_lock(&sg->guest_table_lock); table = gmap_table_walk(sg, saddr, 1); /* get segment pointer */ if (!table) { rc = -EAGAIN; /* Race with unshadow */ goto out_free; } if (!(*table & <API key>)) { rc = 0; /* Already established */ goto out_free; } else if (*table & <API key>) { rc = -EAGAIN; /* Race with shadow */ goto out_free; } /* mark as invalid as long as the parent table is not protected */ *table = (unsigned long) s_pgt | _SEGMENT_ENTRY | (pgt & <API key>) | <API key>; list_add(&page->lru, &sg->pt_list); if (fake) { /* nothing to protect for fake tables */ *table &= ~<API key>; spin_unlock(&sg->guest_table_lock); return 0; } spin_unlock(&sg->guest_table_lock); /* Make pgt read-only in parent gmap page table (not the pgste) */ raddr = (saddr & _SEGMENT_MASK) | <API key>; origin = pgt & <API key> & PAGE_MASK; rc = gmap_protect_rmap(sg, raddr, origin, PAGE_SIZE); spin_lock(&sg->guest_table_lock); if (!rc) { table = gmap_table_walk(sg, saddr, 1); if (!table || (*table & <API key>) != (unsigned long) s_pgt) rc = -EAGAIN; /* Race with unshadow */ else *table &= ~<API key>; } else { gmap_unshadow_pgt(sg, raddr); } spin_unlock(&sg->guest_table_lock); return rc; out_free: spin_unlock(&sg->guest_table_lock); <API key>(page); return rc; } EXPORT_SYMBOL_GPL(gmap_shadow_pgt); /** * gmap_shadow_page - create a shadow page mapping * @sg: pointer to the shadow guest address space structure * @saddr: faulting address in the shadow gmap * @pte: pte in parent gmap address space to get shadowed * * Returns 0 if successfully shadowed or already shadowed, -EAGAIN if the * shadow table structure is incomplete, -ENOMEM if out of memory and * -EFAULT if an address in the parent gmap could not be resolved. * * Called with sg->mm->mmap_lock in read. */ int gmap_shadow_page(struct gmap *sg, unsigned long saddr, pte_t pte) { struct gmap *parent; struct gmap_rmap *rmap; unsigned long vmaddr, paddr; spinlock_t *ptl; pte_t *sptep, *tptep; int prot; int rc; BUG_ON(!gmap_is_shadow(sg)); parent = sg->parent; prot = (pte_val(pte) & _PAGE_PROTECT) ? PROT_READ : PROT_WRITE; rmap = kzalloc(sizeof(*rmap), GFP_KERNEL_ACCOUNT); if (!rmap) return -ENOMEM; rmap->raddr = (saddr & PAGE_MASK) | <API key>; while (1) { paddr = pte_val(pte) & PAGE_MASK; vmaddr = __gmap_translate(parent, paddr); if (IS_ERR_VALUE(vmaddr)) { rc = vmaddr; break; } rc = radix_tree_preload(GFP_KERNEL_ACCOUNT); if (rc) break; rc = -EAGAIN; sptep = gmap_pte_op_walk(parent, paddr, &ptl); if (sptep) { spin_lock(&sg->guest_table_lock); /* Get page table pointer */ tptep = (pte_t *) gmap_table_walk(sg, saddr, 0); if (!tptep) { spin_unlock(&sg->guest_table_lock); gmap_pte_op_end(ptl); <API key>(); break; } rc = ptep_shadow_pte(sg->mm, saddr, sptep, tptep, pte); if (rc > 0) { /* Success and a new mapping */ gmap_insert_rmap(sg, vmaddr, rmap); rmap = NULL; rc = 0; } gmap_pte_op_end(ptl); spin_unlock(&sg->guest_table_lock); } <API key>(); if (!rc) break; rc = gmap_pte_op_fixup(parent, paddr, vmaddr, prot); if (rc) break; } kfree(rmap); return rc; } EXPORT_SYMBOL_GPL(gmap_shadow_page); /* * gmap_shadow_notify - handle notifications for shadow gmap * * Called with sg->parent->shadow_lock. */ static void gmap_shadow_notify(struct gmap *sg, unsigned long vmaddr, unsigned long gaddr) { struct gmap_rmap *rmap, *rnext, *head; unsigned long start, end, bits, raddr; BUG_ON(!gmap_is_shadow(sg)); spin_lock(&sg->guest_table_lock); if (sg->removed) { spin_unlock(&sg->guest_table_lock); return; } /* Check for top level table */ start = sg->orig_asce & _ASCE_ORIGIN; end = start + ((sg->orig_asce & _ASCE_TABLE_LENGTH) + 1) * PAGE_SIZE; if (!(sg->orig_asce & _ASCE_REAL_SPACE) && gaddr >= start && gaddr < end) { /* The complete shadow table has to go */ gmap_unshadow(sg); spin_unlock(&sg->guest_table_lock); list_del(&sg->list); gmap_put(sg); return; } /* Remove the page table tree from on specific entry */ head = radix_tree_delete(&sg->host_to_rmap, vmaddr >> PAGE_SHIFT); <API key>(rmap, rnext, head) { bits = rmap->raddr & _SHADOW_RMAP_MASK; raddr = rmap->raddr ^ bits; switch (bits) { case <API key>: gmap_unshadow_r2t(sg, raddr); break; case <API key>: gmap_unshadow_r3t(sg, raddr); break; case <API key>: gmap_unshadow_sgt(sg, raddr); break; case <API key>: gmap_unshadow_pgt(sg, raddr); break; case <API key>: gmap_unshadow_page(sg, raddr); break; } kfree(rmap); } spin_unlock(&sg->guest_table_lock); } /** * ptep_notify - call all invalidation callbacks for a specific pte. * @mm: pointer to the process mm_struct * @vmaddr: virtual address in the process address space * @pte: pointer to the page table entry * @bits: bits from the pgste that caused the notify call * * This function is assumed to be called with the page table lock held * for the pte to notify. */ void ptep_notify(struct mm_struct *mm, unsigned long vmaddr, pte_t *pte, unsigned long bits) { unsigned long offset, gaddr = 0; unsigned long *table; struct gmap *gmap, *sg, *next; offset = ((unsigned long) pte) & (255 * sizeof(pte_t)); offset = offset * (PAGE_SIZE / sizeof(pte_t)); rcu_read_lock(); <API key>(gmap, &mm->context.gmap_list, list) { spin_lock(&gmap->guest_table_lock); table = radix_tree_lookup(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); if (table) gaddr = <API key>(table) + offset; spin_unlock(&gmap->guest_table_lock); if (!table) continue; if (!list_empty(&gmap->children) && (bits & PGSTE_VSIE_BIT)) { spin_lock(&gmap->shadow_lock); <API key>(sg, next, &gmap->children, list) gmap_shadow_notify(sg, vmaddr, gaddr); spin_unlock(&gmap->shadow_lock); } if (bits & PGSTE_IN_BIT) gmap_call_notifier(gmap, gaddr, gaddr + PAGE_SIZE - 1); } rcu_read_unlock(); } EXPORT_SYMBOL_GPL(ptep_notify); static void pmdp_notify_gmap(struct gmap *gmap, pmd_t *pmdp, unsigned long gaddr) { pmd_val(*pmdp) &= ~<API key>; gmap_call_notifier(gmap, gaddr, gaddr + HPAGE_SIZE - 1); } /** * gmap_pmdp_xchg - exchange a gmap pmd with another * @gmap: pointer to the guest address space structure * @pmdp: pointer to the pmd entry * @new: replacement entry * @gaddr: the affected guest address * * This function is assumed to be called with the guest_table_lock * held. */ static void gmap_pmdp_xchg(struct gmap *gmap, pmd_t *pmdp, pmd_t new, unsigned long gaddr) { gaddr &= HPAGE_MASK; pmdp_notify_gmap(gmap, pmdp, gaddr); pmd_val(new) &= ~<API key>; if (<API key>) __pmdp_idte(gaddr, (pmd_t *)pmdp, IDTE_GUEST_ASCE, gmap->asce, IDTE_GLOBAL); else if (MACHINE_HAS_IDTE) __pmdp_idte(gaddr, (pmd_t *)pmdp, 0, 0, IDTE_GLOBAL); else __pmdp_csp(pmdp); *pmdp = new; } static void gmap_pmdp_clear(struct mm_struct *mm, unsigned long vmaddr, int purge) { pmd_t *pmdp; struct gmap *gmap; unsigned long gaddr; rcu_read_lock(); <API key>(gmap, &mm->context.gmap_list, list) { spin_lock(&gmap->guest_table_lock); pmdp = (pmd_t *)radix_tree_delete(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); if (pmdp) { gaddr = <API key>((unsigned long *)pmdp); pmdp_notify_gmap(gmap, pmdp, gaddr); WARN_ON(pmd_val(*pmdp) & ~(<API key> | <API key>)); if (purge) __pmdp_csp(pmdp); pmd_val(*pmdp) = <API key>; } spin_unlock(&gmap->guest_table_lock); } rcu_read_unlock(); } /** * <API key> - invalidate all affected guest pmd entries without * flushing * @mm: pointer to the process mm_struct * @vmaddr: virtual address in the process address space */ void <API key>(struct mm_struct *mm, unsigned long vmaddr) { gmap_pmdp_clear(mm, vmaddr, 0); } EXPORT_SYMBOL_GPL(<API key>); /** * gmap_pmdp_csp - csp all affected guest pmd entries * @mm: pointer to the process mm_struct * @vmaddr: virtual address in the process address space */ void gmap_pmdp_csp(struct mm_struct *mm, unsigned long vmaddr) { gmap_pmdp_clear(mm, vmaddr, 1); } EXPORT_SYMBOL_GPL(gmap_pmdp_csp); /** * <API key> - invalidate and clear a guest pmd entry * @mm: pointer to the process mm_struct * @vmaddr: virtual address in the process address space */ void <API key>(struct mm_struct *mm, unsigned long vmaddr) { unsigned long *entry, gaddr; struct gmap *gmap; pmd_t *pmdp; rcu_read_lock(); <API key>(gmap, &mm->context.gmap_list, list) { spin_lock(&gmap->guest_table_lock); entry = radix_tree_delete(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); if (entry) { pmdp = (pmd_t *)entry; gaddr = <API key>(entry); pmdp_notify_gmap(gmap, pmdp, gaddr); WARN_ON(*entry & ~(<API key> | <API key>)); if (<API key>) __pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE, gmap->asce, IDTE_LOCAL); else if (MACHINE_HAS_IDTE) __pmdp_idte(gaddr, pmdp, 0, 0, IDTE_LOCAL); *entry = <API key>; } spin_unlock(&gmap->guest_table_lock); } rcu_read_unlock(); } EXPORT_SYMBOL_GPL(<API key>); /** * <API key> - invalidate and clear a guest pmd entry * @mm: pointer to the process mm_struct * @vmaddr: virtual address in the process address space */ void <API key>(struct mm_struct *mm, unsigned long vmaddr) { unsigned long *entry, gaddr; struct gmap *gmap; pmd_t *pmdp; rcu_read_lock(); <API key>(gmap, &mm->context.gmap_list, list) { spin_lock(&gmap->guest_table_lock); entry = radix_tree_delete(&gmap->host_to_guest, vmaddr >> PMD_SHIFT); if (entry) { pmdp = (pmd_t *)entry; gaddr = <API key>(entry); pmdp_notify_gmap(gmap, pmdp, gaddr); WARN_ON(*entry & ~(<API key> | <API key>)); if (<API key>) __pmdp_idte(gaddr, pmdp, IDTE_GUEST_ASCE, gmap->asce, IDTE_GLOBAL); else if (MACHINE_HAS_IDTE) __pmdp_idte(gaddr, pmdp, 0, 0, IDTE_GLOBAL); else __pmdp_csp(pmdp); *entry = <API key>; } spin_unlock(&gmap->guest_table_lock); } rcu_read_unlock(); } EXPORT_SYMBOL_GPL(<API key>); /** * <API key> - test and reset segment dirty status * @gmap: pointer to guest address space * @pmdp: pointer to the pmd to be tested * @gaddr: virtual address in the guest address space * * This function is assumed to be called with the guest_table_lock * held. */ static bool <API key>(struct gmap *gmap, pmd_t *pmdp, unsigned long gaddr) { if (pmd_val(*pmdp) & <API key>) return false; /* Already protected memory, which did not change is clean */ if (pmd_val(*pmdp) & <API key> && !(pmd_val(*pmdp) & <API key>)) return false; /* Clear UC indication and reset protection */ pmd_val(*pmdp) &= ~<API key>; gmap_protect_pmd(gmap, gaddr, pmdp, PROT_READ, 0); return true; } /** * <API key> - set bitmap based on dirty status of segment * @gmap: pointer to guest address space * @bitmap: dirty bitmap for this pmd * @gaddr: virtual address in the guest address space * @vmaddr: virtual address in the host address space * * This function is assumed to be called with the guest_table_lock * held. */ void <API key>(struct gmap *gmap, unsigned long bitmap[4], unsigned long gaddr, unsigned long vmaddr) { int i; pmd_t *pmdp; pte_t *ptep; spinlock_t *ptl; pmdp = gmap_pmd_op_walk(gmap, gaddr); if (!pmdp) return; if (pmd_large(*pmdp)) { if (<API key>(gmap, pmdp, gaddr)) bitmap_fill(bitmap, _PAGE_ENTRIES); } else { for (i = 0; i < _PAGE_ENTRIES; i++, vmaddr += PAGE_SIZE) { ptep = pte_alloc_map_lock(gmap->mm, pmdp, vmaddr, &ptl); if (!ptep) continue; if (<API key>(gmap->mm, vmaddr, ptep)) set_bit(i, bitmap); spin_unlock(ptl); } } gmap_pmd_op_end(gmap, pmdp); } EXPORT_SYMBOL_GPL(<API key>); #ifdef <API key> static int <API key>(pmd_t *pmd, unsigned long addr, unsigned long end, struct mm_walk *walk) { struct vm_area_struct *vma = walk->vma; split_huge_pmd(vma, pmd, addr); return 0; } static const struct mm_walk_ops thp_split_walk_ops = { .pmd_entry = <API key>, }; static inline void thp_split_mm(struct mm_struct *mm) { struct vm_area_struct *vma; for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) { vma->vm_flags &= ~VM_HUGEPAGE; vma->vm_flags |= VM_NOHUGEPAGE; walk_page_vma(vma, &thp_split_walk_ops, NULL); } mm->def_flags |= VM_NOHUGEPAGE; } #else static inline void thp_split_mm(struct mm_struct *mm) { } #endif /* <API key> */ /* * Remove all empty zero pages from the mapping for lazy refaulting * - This must be called after mm->context.has_pgste is set, to avoid * future creation of zero pages * - This must be called after THP was enabled */ static int __zap_zero_pages(pmd_t *pmd, unsigned long start, unsigned long end, struct mm_walk *walk) { unsigned long addr; for (addr = start; addr != end; addr += PAGE_SIZE) { pte_t *ptep; spinlock_t *ptl; ptep = pte_offset_map_lock(walk->mm, pmd, addr, &ptl); if (is_zero_pfn(pte_pfn(*ptep))) ptep_xchg_direct(walk->mm, addr, ptep, __pte(_PAGE_INVALID)); pte_unmap_unlock(ptep, ptl); } return 0; } static const struct mm_walk_ops zap_zero_walk_ops = { .pmd_entry = __zap_zero_pages, }; /* * switch on pgstes for its userspace process (for kvm) */ int s390_enable_sie(void) { struct mm_struct *mm = current->mm; /* Do we have pgstes? if yes, we are done */ if (mm_has_pgste(mm)) return 0; /* Fail if the page tables are 2K */ if (!mm_alloc_pgste(mm)) return -EINVAL; mmap_write_lock(mm); mm->context.has_pgste = 1; /* split thp mappings and disable thp for future mappings */ thp_split_mm(mm); walk_page_range(mm, 0, TASK_SIZE, &zap_zero_walk_ops, NULL); mmap_write_unlock(mm); return 0; } EXPORT_SYMBOL_GPL(s390_enable_sie); int <API key>(void) { struct mm_struct *mm = current->mm; struct vm_area_struct *vma; int ret; for (vma = mm->mmap; vma; vma = vma->vm_next) { ret = ksm_madvise(vma, vma->vm_start, vma->vm_end, MADV_UNMERGEABLE, &vma->vm_flags); if (ret) return ret; } mm->def_flags &= ~VM_MERGEABLE; return 0; } EXPORT_SYMBOL_GPL(<API key>); /* * Enable storage key handling from now on and initialize the storage * keys with the default key. */ static int <API key>(pte_t *pte, unsigned long addr, unsigned long next, struct mm_walk *walk) { /* Clear storage key */ ptep_zap_key(walk->mm, addr, pte); return 0; } static int <API key>(pte_t *pte, unsigned long addr, unsigned long hmask, unsigned long next, struct mm_walk *walk) { pmd_t *pmd = (pmd_t *)pte; unsigned long start, end; struct page *page = pmd_page(*pmd); /* * The write check makes sure we do not set a key on shared * memory. This is needed as the walker does not differentiate * between actual guest memory and the process executable or * shared libraries. */ if (pmd_val(*pmd) & <API key> || !(pmd_val(*pmd) & <API key>)) return 0; start = pmd_val(*pmd) & HPAGE_MASK; end = start + HPAGE_SIZE - 1; <API key>(start, end); set_bit(PG_arch_1, &page->flags); return 0; } static const struct mm_walk_ops <API key> = { .hugetlb_entry = <API key>, .pte_entry = <API key>, }; int s390_enable_skey(void) { struct mm_struct *mm = current->mm; int rc = 0; mmap_write_lock(mm); if (mm_uses_skeys(mm)) goto out_up; mm->context.uses_skeys = 1; rc = <API key>(); if (rc) { mm->context.uses_skeys = 0; goto out_up; } walk_page_range(mm, 0, TASK_SIZE, &<API key>, NULL); out_up: mmap_write_unlock(mm); return rc; } EXPORT_SYMBOL_GPL(s390_enable_skey); /* * Reset CMMA state, make all pages stable again. */ static int __s390_reset_cmma(pte_t *pte, unsigned long addr, unsigned long next, struct mm_walk *walk) { ptep_zap_unused(walk->mm, addr, pte, 1); return 0; } static const struct mm_walk_ops reset_cmma_walk_ops = { .pte_entry = __s390_reset_cmma, }; void s390_reset_cmma(struct mm_struct *mm) { mmap_write_lock(mm); walk_page_range(mm, 0, TASK_SIZE, &reset_cmma_walk_ops, NULL); mmap_write_unlock(mm); } EXPORT_SYMBOL_GPL(s390_reset_cmma); /* * make inaccessible pages accessible again */ static int __s390_reset_acc(pte_t *ptep, unsigned long addr, unsigned long next, struct mm_walk *walk) { pte_t pte = READ_ONCE(*ptep); /* There is a reference through the mapping */ if (pte_present(pte)) WARN_ON_ONCE(<API key>(pte_val(pte) & PAGE_MASK)); return 0; } static const struct mm_walk_ops reset_acc_walk_ops = { .pte_entry = __s390_reset_acc, }; #include <linux/sched/mm.h> void s390_reset_acc(struct mm_struct *mm) { if (!mm_is_protected(mm)) return; /* * we might be called during * reset: we walk the pages and clear * close of all kvm file descriptors: we walk the pages and clear * exit of process on fd closure: vma already gone, do nothing */ if (!mmget_not_zero(mm)) return; mmap_read_lock(mm); walk_page_range(mm, 0, TASK_SIZE, &reset_acc_walk_ops, NULL); mmap_read_unlock(mm); mmput(mm); } EXPORT_SYMBOL_GPL(s390_reset_acc);
<?php namespace JMS\DiExtraBundle\Annotation; /** * @Annotation * @Target("METHOD") * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ final class SecurityFunction { /** * @Required * @var string */ public $function; }
.swal2-overlay { background-color: rgba(0, 0, 0, 0.4); position: fixed; left: 0; right: 0; top: 0; bottom: 0; display: none; z-index: 1000; } .swal2-modal { background-color: #fff; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; border-radius: 5px; box-sizing: border-box; text-align: center; position: fixed; left: 50%; top: 50%; margin-top: -200px; max-height: 90%; overflow-x: hidden; overflow-y: auto; display: none; z-index: 2000; } .swal2-modal:focus { outline: none; } .swal2-modal.loading { overflow-y: hidden; } .swal2-modal h2 { color: #575757; font-size: 30px; text-align: center; font-weight: 600; text-transform: none; position: relative; margin: 0; padding: 0; line-height: 60px; display: block; } .swal2-modal hr { height: 10px; color: transparent; border: 0; } .swal2-modal button.styled { color: #fff; border: 0; box-shadow: none; font-size: 17px; font-weight: 500; border-radius: 5px; padding: 10px 32px; margin: 0 5px; cursor: pointer; } .swal2-modal button.styled:focus { outline: none; } .swal2-modal button.styled[disabled] { opacity: .4; cursor: no-drop; } .swal2-modal button.styled.loading { box-sizing: border-box; border: 4px solid transparent; border-color: transparent; width: 40px; height: 40px; padding: 0; margin: -2px 30px; vertical-align: top; background-color: transparent !important; color: transparent; cursor: default; border-radius: 100%; -webkit-animation: rotate-loading 1.5s linear 0s infinite normal; animation: rotate-loading 1.5s linear 0s infinite normal; } .swal2-modal button.styled::-moz-focus-inner { border: 0; } .swal2-modal .swal2-image { margin: 20px auto; } .swal2-modal .swal2-close { font-size: 36px; line-height: 36px; font-family: serif; position: absolute; top: 5px; right: 13px; cursor: pointer; color: #cfcfcf; -webkit-transition: all 0.1s ease; transition: all 0.1s ease; } .swal2-modal .swal2-close:hover { color: #d55; } .swal2-content { font-size: 18px; text-align: center; font-weight: 300; position: relative; float: none; margin: 0; padding: 0; line-height: normal; color: #555; } .swal2-icon { width: 80px; height: 80px; border: 4px solid #808080; border-radius: 50%; margin: 20px auto 30px; padding: 0; position: relative; box-sizing: content-box; cursor: default; -<API key>: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .swal2-icon.swal2-error { border-color: #f27474; } .swal2-icon.swal2-error .x-mark { position: relative; display: block; } .swal2-icon.swal2-error .line { position: absolute; height: 5px; width: 47px; background-color: #f27474; display: block; top: 37px; border-radius: 2px; } .swal2-icon.swal2-error .line.left { -webkit-transform: rotate(45deg); transform: rotate(45deg); left: 17px; } .swal2-icon.swal2-error .line.right { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); right: 16px; } .swal2-icon.swal2-warning { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #f8bb86; border-color: #f8bb86; font-size: 60px; line-height: 80px; text-align: center; } .swal2-icon.swal2-info { font-family: "Open Sans", sans-serif; color: #3fc3ee; border-color: #3fc3ee; font-size: 60px; line-height: 80px; text-align: center; } .swal2-icon.swal2-question { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; color: #c9dae1; border-color: #c9dae1; font-size: 60px; line-height: 80px; text-align: center; } .swal2-icon.swal2-success { border-color: #a5dc86; } .swal2-icon.swal2-success::before, .swal2-icon.swal2-success::after { content: ''; border-radius: 50%; position: absolute; width: 60px; height: 120px; background: #fff; -webkit-transform: rotate(45deg); transform: rotate(45deg); } .swal2-icon.swal2-success::before { border-radius: 120px 0 0 120px; top: -7px; left: -33px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -<API key>: 60px 60px; transform-origin: 60px 60px; } .swal2-icon.swal2-success::after { border-radius: 0 120px 120px 0; top: -11px; left: 30px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); -<API key>: 0 60px; transform-origin: 0 60px; } .swal2-icon.swal2-success .placeholder { width: 80px; height: 80px; border: 4px solid rgba(165, 220, 134, 0.2); border-radius: 50%; box-sizing: content-box; position: absolute; left: -4px; top: -4px; z-index: 2; } .swal2-icon.swal2-success .fix { width: 7px; height: 90px; background-color: #fff; position: absolute; left: 28px; top: 8px; z-index: 1; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } .swal2-icon.swal2-success .line { height: 5px; background-color: #a5dc86; display: block; border-radius: 2px; position: absolute; z-index: 2; } .swal2-icon.swal2-success .line.tip { width: 25px; left: 14px; top: 46px; -webkit-transform: rotate(45deg); transform: rotate(45deg); } .swal2-icon.swal2-success .line.long { width: 47px; right: 8px; top: 38px; -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } .swal2-input, .swal2-textarea { width: 100%; box-sizing: border-box; border-radius: 3px; border: 1px solid #d7d7d7; margin: 20px auto; font-size: 18px; box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.06); -webkit-transition: all 0.3s; transition: all 0.3s; } .swal2-input.error, .swal2-textarea.error { border-color: #f06e57 !important; } .swal2-input:focus, .swal2-textarea:focus { outline: none; box-shadow: 0px 0px 3px #c4e6f5; border: 1px solid #b4dbed; } .swal2-input:focus::-moz-placeholder, .swal2-textarea:focus::-moz-placeholder { -webkit-transition: opacity 0.3s 0.03s ease; transition: opacity 0.3s 0.03s ease; opacity: 0.8; } .swal2-input:focus:-<API key>, .swal2-textarea:focus:-<API key> { -webkit-transition: opacity 0.3s 0.03s ease; transition: opacity 0.3s 0.03s ease; opacity: 0.8; } .swal2-input:focus::-<API key>, .swal2-textarea:focus::-<API key> { -webkit-transition: opacity 0.3s 0.03s ease; transition: opacity 0.3s 0.03s ease; opacity: 0.8; } .swal2-input::-moz-placeholder, .swal2-textarea::-moz-placeholder { color: #bdbdbd; } .swal2-input:-<API key>, .swal2-textarea:-<API key> { color: #bdbdbd; } .swal2-input::-<API key>, .swal2-textarea::-<API key> { color: #bdbdbd; } .swal2-input { height: 43px; padding: 0 12px; } .swal2-textarea { height: 108px; padding: 12px; } .swal2-select { color: #555; font-size: inherit; margin: 20px auto; padding: 5px 10px; min-width: 40%; max-width: 100%; } .swal2-radio { border: 0; margin: 20px auto; } .swal2-radio label:not(:first-child) { margin-left: 20px; } .swal2-radio input, .swal2-radio span { vertical-align: middle; } .swal2-radio input { margin: 0 3px 0 0; } .swal2-checkbox { color: #555; margin: 20px auto; } .swal2-checkbox input, .swal2-checkbox span { vertical-align: middle; } .<API key> { background-color: #f1f1f1; margin: 0 -20px; overflow: hidden; padding: 10px; color: #797979; font-size: 16px; font-weight: 300; } .<API key>::before { content: "!"; display: inline-block; width: 24px; height: 24px; border-radius: 50%; background-color: #ea7d7d; color: white; line-height: 24px; text-align: center; margin-right: 10px; } @-webkit-keyframes showSweetAlert { 0% { -webkit-transform: scale(0.7); transform: scale(0.7); } 45% { -webkit-transform: scale(1.05); transform: scale(1.05); } 80% { -webkit-transform: scale(0.95); transform: scale(0.95); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @keyframes showSweetAlert { 0% { -webkit-transform: scale(0.7); transform: scale(0.7); } 45% { -webkit-transform: scale(1.05); transform: scale(1.05); } 80% { -webkit-transform: scale(0.95); transform: scale(0.95); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @-webkit-keyframes hideSweetAlert { 0% { -webkit-transform: scale(1); transform: scale(1); } 100% { -webkit-transform: scale(0.5); transform: scale(0.5); } } @keyframes hideSweetAlert { 0% { -webkit-transform: scale(1); transform: scale(1); } 100% { -webkit-transform: scale(0.5); transform: scale(0.5); } } .show-swal2 { -webkit-animation: showSweetAlert 0.3s; animation: showSweetAlert 0.3s; } .show-swal2.no-animation { -webkit-animation: none; animation: none; } .hide-swal2 { -webkit-animation: hideSweetAlert 0.2s; animation: hideSweetAlert 0.2s; } .hide-swal2.no-animation { -webkit-animation: none; animation: none; } @-webkit-keyframes animate-success-tip { 0% { width: 0; left: 1px; top: 19px; } 54% { width: 0; left: 1px; top: 19px; } 70% { width: 50px; left: -8px; top: 37px; } 84% { width: 17px; left: 21px; top: 48px; } 100% { width: 25px; left: 14px; top: 45px; } } @keyframes animate-success-tip { 0% { width: 0; left: 1px; top: 19px; } 54% { width: 0; left: 1px; top: 19px; } 70% { width: 50px; left: -8px; top: 37px; } 84% { width: 17px; left: 21px; top: 48px; } 100% { width: 25px; left: 14px; top: 45px; } } @-webkit-keyframes <API key> { 0% { width: 0; right: 46px; top: 54px; } 65% { width: 0; right: 46px; top: 54px; } 84% { width: 55px; right: 0; top: 35px; } 100% { width: 47px; right: 8px; top: 38px; } } @keyframes <API key> { 0% { width: 0; right: 46px; top: 54px; } 65% { width: 0; right: 46px; top: 54px; } 84% { width: 55px; right: 0; top: 35px; } 100% { width: 47px; right: 8px; top: 38px; } } @-webkit-keyframes rotatePlaceholder { 0% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } 5% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } 12% { -webkit-transform: rotate(-405deg); transform: rotate(-405deg); } 100% { -webkit-transform: rotate(-405deg); transform: rotate(-405deg); } } @keyframes rotatePlaceholder { 0% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } 5% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } 12% { -webkit-transform: rotate(-405deg); transform: rotate(-405deg); } 100% { -webkit-transform: rotate(-405deg); transform: rotate(-405deg); } } .animate-success-tip { -webkit-animation: animate-success-tip 0.75s; animation: animate-success-tip 0.75s; } .<API key> { -webkit-animation: <API key> 0.75s; animation: <API key> 0.75s; } .swal2-icon.swal2-success.animate::after { -webkit-animation: rotatePlaceholder 4.25s ease-in; animation: rotatePlaceholder 4.25s ease-in; } @-webkit-keyframes animate-error-icon { 0% { -webkit-transform: rotateX(100deg); transform: rotateX(100deg); opacity: 0; } 100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); opacity: 1; } } @keyframes animate-error-icon { 0% { -webkit-transform: rotateX(100deg); transform: rotateX(100deg); opacity: 0; } 100% { -webkit-transform: rotateX(0deg); transform: rotateX(0deg); opacity: 1; } } .animate-error-icon { -webkit-animation: animate-error-icon 0.5s; animation: animate-error-icon 0.5s; } @-webkit-keyframes animate-x-mark { 0% { -webkit-transform: scale(0.4); transform: scale(0.4); margin-top: 26px; opacity: 0; } 50% { -webkit-transform: scale(0.4); transform: scale(0.4); margin-top: 26px; opacity: 0; } 80% { -webkit-transform: scale(1.15); transform: scale(1.15); margin-top: -6px; } 100% { -webkit-transform: scale(1); transform: scale(1); margin-top: 0; opacity: 1; } } @keyframes animate-x-mark { 0% { -webkit-transform: scale(0.4); transform: scale(0.4); margin-top: 26px; opacity: 0; } 50% { -webkit-transform: scale(0.4); transform: scale(0.4); margin-top: 26px; opacity: 0; } 80% { -webkit-transform: scale(1.15); transform: scale(1.15); margin-top: -6px; } 100% { -webkit-transform: scale(1); transform: scale(1); margin-top: 0; opacity: 1; } } .animate-x-mark { -webkit-animation: animate-x-mark 0.5s; animation: animate-x-mark 0.5s; } @-webkit-keyframes pulse-warning { 0% { border-color: #f8d486; } 100% { border-color: #f8bb86; } } @keyframes pulse-warning { 0% { border-color: #f8d486; } 100% { border-color: #f8bb86; } } .pulse-warning { -webkit-animation: pulse-warning 0.75s infinite alternate; animation: pulse-warning 0.75s infinite alternate; } @-webkit-keyframes rotate-loading { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes rotate-loading { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
#ifndef INITVALS_9003_H #define INITVALS_9003_H /* AR9003 2.0 */ static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0001609c, 0x0dd08f29, 0x0dd08f29, 0x0b283f31, 0x0b283f31}, {0x000160ac, 0xa4653c00, 0xa4653c00, 0x24652800, 0x24652800}, {0x000160b0, 0x03284f3e, 0x03284f3e, 0x05d08f20, 0x05d08f20}, {0x0001610c, 0x08000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016140, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, {0x0001650c, 0x08000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016540, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, {0x0001690c, 0x08000000, 0x00000000, 0x00000000, 0x00000000}, {0x00016940, 0x10804008, 0x10804008, 0x50804008, 0x50804008}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402}, {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404}, {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861}, {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81}, {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83}, {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84}, {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3}, {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5}, {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9}, {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb}, {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, {0x0000a598, 0x21820220, 0x21820220, 0x16800402, 0x16800402}, {0x0000a59c, 0x27820223, 0x27820223, 0x19800404, 0x19800404}, {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, {0x0000a5c4, 0x5382266c, 0x5382266c, 0x3f801861, 0x3f801861}, {0x0000a5c8, 0x5782286c, 0x5782286c, 0x43801a81, 0x43801a81}, {0x0000a5cc, 0x5c84286b, 0x5c84286b, 0x47801a83, 0x47801a83}, {0x0000a5d0, 0x61842a6c, 0x61842a6c, 0x4a801c84, 0x4a801c84}, {0x0000a5d4, 0x66862a6c, 0x66862a6c, 0x4e801ce3, 0x4e801ce3}, {0x0000a5d8, 0x6b862e6c, 0x6b862e6c, 0x52801ce5, 0x52801ce5}, {0x0000a5dc, 0x7086308c, 0x7086308c, 0x56801ce9, 0x56801ce9}, {0x0000a5e0, 0x738a308a, 0x738a308a, 0x5a801ceb, 0x5a801ceb}, {0x0000a5e4, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5e8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5ec, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f0, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f4, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016048, 0x62480001, 0x62480001, 0x62480001, 0x62480001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016448, 0x62480001, 0x62480001, 0x62480001, 0x62480001}, {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016848, 0x62480001, 0x62480001, 0x62480001, 0x62480001}, {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, }; static const u32 <API key>[][3] = { /* Addr 5G_HT20 5G_HT40 */ {0x00001030, 0x00000268, 0x000004d0}, {0x00001070, 0x0000018c, 0x00000318}, {0x000010b0, 0x00000fd0, 0x00001fa0}, {0x00008014, 0x044c044c, 0x08980898}, {0x0000801c, 0x148ec02b, 0x148ec057}, {0x00008318, 0x000044c0, 0x00008980}, {0x00009e00, 0x03721821, 0x03721821}, {0x0000a230, 0x0000000b, 0x00000016}, {0x0000a254, 0x00000898, 0x00001130}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00016000, 0x36db6db6}, {0x00016004, 0x6db6db40}, {0x00016008, 0x73f00000}, {0x0001600c, 0x00000000}, {0x00016040, 0x7f80fff8}, {0x0001604c, 0x76d005b5}, {0x00016050, 0x556cf031}, {0x00016054, 0x13449440}, {0x00016058, 0x0c51c92c}, {0x0001605c, 0x3db7fffc}, {0x00016060, 0xfffffffc}, {0x00016064, 0x000f0278}, {0x0001606c, 0x6db60000}, {0x00016080, 0x00000000}, {0x00016084, 0x0e48048c}, {0x00016088, 0x54214514}, {0x0001608c, 0x119f481e}, {0x00016090, 0x24926490}, {0x00016098, 0xd2888888}, {0x000160a0, 0x0a108ffe}, {0x000160a4, 0x812fc370}, {0x000160a8, 0x423c8000}, {0x000160b4, 0x92480080}, {0x000160c0, 0x00adb6d0}, {0x000160c4, 0x6db6db60}, {0x000160c8, 0x6db6db6c}, {0x000160cc, 0x01e6c000}, {0x00016100, 0x3fffbe01}, {0x00016104, 0xfff80000}, {0x00016108, 0x00080010}, {0x00016144, 0x02084080}, {0x00016148, 0x00000000}, {0x00016280, 0x058a0001}, {0x00016284, 0x3d840208}, {0x00016288, 0x05a20408}, {0x0001628c, 0x00038c07}, {0x00016290, 0x40000004}, {0x00016294, 0x458aa14f}, {0x00016380, 0x00000000}, {0x00016384, 0x00000000}, {0x00016388, 0x00800700}, {0x0001638c, 0x00800700}, {0x00016390, 0x00800700}, {0x00016394, 0x00000000}, {0x00016398, 0x00000000}, {0x0001639c, 0x00000000}, {0x000163a0, 0x00000001}, {0x000163a4, 0x00000001}, {0x000163a8, 0x00000000}, {0x000163ac, 0x00000000}, {0x000163b0, 0x00000000}, {0x000163b4, 0x00000000}, {0x000163b8, 0x00000000}, {0x000163bc, 0x00000000}, {0x000163c0, 0x000000a0}, {0x000163c4, 0x000c0000}, {0x000163c8, 0x14021402}, {0x000163cc, 0x00001402}, {0x000163d0, 0x00000000}, {0x000163d4, 0x00000000}, {0x00016400, 0x36db6db6}, {0x00016404, 0x6db6db40}, {0x00016408, 0x73f00000}, {0x0001640c, 0x00000000}, {0x00016440, 0x7f80fff8}, {0x0001644c, 0x76d005b5}, {0x00016450, 0x556cf031}, {0x00016454, 0x13449440}, {0x00016458, 0x0c51c92c}, {0x0001645c, 0x3db7fffc}, {0x00016460, 0xfffffffc}, {0x00016464, 0x000f0278}, {0x0001646c, 0x6db60000}, {0x00016500, 0x3fffbe01}, {0x00016504, 0xfff80000}, {0x00016508, 0x00080010}, {0x00016544, 0x02084080}, {0x00016548, 0x00000000}, {0x00016780, 0x00000000}, {0x00016784, 0x00000000}, {0x00016788, 0x00800700}, {0x0001678c, 0x00800700}, {0x00016790, 0x00800700}, {0x00016794, 0x00000000}, {0x00016798, 0x00000000}, {0x0001679c, 0x00000000}, {0x000167a0, 0x00000001}, {0x000167a4, 0x00000001}, {0x000167a8, 0x00000000}, {0x000167ac, 0x00000000}, {0x000167b0, 0x00000000}, {0x000167b4, 0x00000000}, {0x000167b8, 0x00000000}, {0x000167bc, 0x00000000}, {0x000167c0, 0x000000a0}, {0x000167c4, 0x000c0000}, {0x000167c8, 0x14021402}, {0x000167cc, 0x00001402}, {0x000167d0, 0x00000000}, {0x000167d4, 0x00000000}, {0x00016800, 0x36db6db6}, {0x00016804, 0x6db6db40}, {0x00016808, 0x73f00000}, {0x0001680c, 0x00000000}, {0x00016840, 0x7f80fff8}, {0x0001684c, 0x76d005b5}, {0x00016850, 0x556cf031}, {0x00016854, 0x13449440}, {0x00016858, 0x0c51c92c}, {0x0001685c, 0x3db7fffc}, {0x00016860, 0xfffffffc}, {0x00016864, 0x000f0278}, {0x0001686c, 0x6db60000}, {0x00016900, 0x3fffbe01}, {0x00016904, 0xfff80000}, {0x00016908, 0x00080010}, {0x00016944, 0x02084080}, {0x00016948, 0x00000000}, {0x00016b80, 0x00000000}, {0x00016b84, 0x00000000}, {0x00016b88, 0x00800700}, {0x00016b8c, 0x00800700}, {0x00016b90, 0x00800700}, {0x00016b94, 0x00000000}, {0x00016b98, 0x00000000}, {0x00016b9c, 0x00000000}, {0x00016ba0, 0x00000001}, {0x00016ba4, 0x00000001}, {0x00016ba8, 0x00000000}, {0x00016bac, 0x00000000}, {0x00016bb0, 0x00000000}, {0x00016bb4, 0x00000000}, {0x00016bb8, 0x00000000}, {0x00016bbc, 0x00000000}, {0x00016bc0, 0x000000a0}, {0x00016bc4, 0x000c0000}, {0x00016bc8, 0x14021402}, {0x00016bcc, 0x00001402}, {0x00016bd0, 0x00000000}, {0x00016bd4, 0x00000000}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x0000a000, 0x02000101}, {0x0000a004, 0x02000102}, {0x0000a008, 0x02000103}, {0x0000a00c, 0x02000104}, {0x0000a010, 0x02000200}, {0x0000a014, 0x02000201}, {0x0000a018, 0x02000202}, {0x0000a01c, 0x02000203}, {0x0000a020, 0x02000204}, {0x0000a024, 0x02000205}, {0x0000a028, 0x02000208}, {0x0000a02c, 0x02000302}, {0x0000a030, 0x02000303}, {0x0000a034, 0x02000304}, {0x0000a038, 0x02000400}, {0x0000a03c, 0x02010300}, {0x0000a040, 0x02010301}, {0x0000a044, 0x02010302}, {0x0000a048, 0x02000500}, {0x0000a04c, 0x02010400}, {0x0000a050, 0x02020300}, {0x0000a054, 0x02020301}, {0x0000a058, 0x02020302}, {0x0000a05c, 0x02020303}, {0x0000a060, 0x02020400}, {0x0000a064, 0x02030300}, {0x0000a068, 0x02030301}, {0x0000a06c, 0x02030302}, {0x0000a070, 0x02030303}, {0x0000a074, 0x02030400}, {0x0000a078, 0x02040300}, {0x0000a07c, 0x02040301}, {0x0000a080, 0x02040302}, {0x0000a084, 0x02040303}, {0x0000a088, 0x02030500}, {0x0000a08c, 0x02040400}, {0x0000a090, 0x02050203}, {0x0000a094, 0x02050204}, {0x0000a098, 0x02050205}, {0x0000a09c, 0x02040500}, {0x0000a0a0, 0x02050301}, {0x0000a0a4, 0x02050302}, {0x0000a0a8, 0x02050303}, {0x0000a0ac, 0x02050400}, {0x0000a0b0, 0x02050401}, {0x0000a0b4, 0x02050402}, {0x0000a0b8, 0x02050403}, {0x0000a0bc, 0x02050500}, {0x0000a0c0, 0x02050501}, {0x0000a0c4, 0x02050502}, {0x0000a0c8, 0x02050503}, {0x0000a0cc, 0x02050504}, {0x0000a0d0, 0x02050600}, {0x0000a0d4, 0x02050601}, {0x0000a0d8, 0x02050602}, {0x0000a0dc, 0x02050603}, {0x0000a0e0, 0x02050604}, {0x0000a0e4, 0x02050700}, {0x0000a0e8, 0x02050701}, {0x0000a0ec, 0x02050702}, {0x0000a0f0, 0x02050703}, {0x0000a0f4, 0x02050704}, {0x0000a0f8, 0x02050705}, {0x0000a0fc, 0x02050708}, {0x0000a100, 0x02050709}, {0x0000a104, 0x0205070a}, {0x0000a108, 0x0205070b}, {0x0000a10c, 0x0205070c}, {0x0000a110, 0x0205070d}, {0x0000a114, 0x02050710}, {0x0000a118, 0x02050711}, {0x0000a11c, 0x02050712}, {0x0000a120, 0x02050713}, {0x0000a124, 0x02050714}, {0x0000a128, 0x02050715}, {0x0000a12c, 0x02050730}, {0x0000a130, 0x02050731}, {0x0000a134, 0x02050732}, {0x0000a138, 0x02050733}, {0x0000a13c, 0x02050734}, {0x0000a140, 0x02050735}, {0x0000a144, 0x02050750}, {0x0000a148, 0x02050751}, {0x0000a14c, 0x02050752}, {0x0000a150, 0x02050753}, {0x0000a154, 0x02050754}, {0x0000a158, 0x02050755}, {0x0000a15c, 0x02050770}, {0x0000a160, 0x02050771}, {0x0000a164, 0x02050772}, {0x0000a168, 0x02050773}, {0x0000a16c, 0x02050774}, {0x0000a170, 0x02050775}, {0x0000a174, 0x00000776}, {0x0000a178, 0x00000776}, {0x0000a17c, 0x00000776}, {0x0000a180, 0x00000776}, {0x0000a184, 0x00000776}, {0x0000a188, 0x00000776}, {0x0000a18c, 0x00000776}, {0x0000a190, 0x00000776}, {0x0000a194, 0x00000776}, {0x0000a198, 0x00000776}, {0x0000a19c, 0x00000776}, {0x0000a1a0, 0x00000776}, {0x0000a1a4, 0x00000776}, {0x0000a1a8, 0x00000776}, {0x0000a1ac, 0x00000776}, {0x0000a1b0, 0x00000776}, {0x0000a1b4, 0x00000776}, {0x0000a1b8, 0x00000776}, {0x0000a1bc, 0x00000776}, {0x0000a1c0, 0x00000776}, {0x0000a1c4, 0x00000776}, {0x0000a1c8, 0x00000776}, {0x0000a1cc, 0x00000776}, {0x0000a1d0, 0x00000776}, {0x0000a1d4, 0x00000776}, {0x0000a1d8, 0x00000776}, {0x0000a1dc, 0x00000776}, {0x0000a1e0, 0x00000776}, {0x0000a1e4, 0x00000776}, {0x0000a1e8, 0x00000776}, {0x0000a1ec, 0x00000776}, {0x0000a1f0, 0x00000776}, {0x0000a1f4, 0x00000776}, {0x0000a1f8, 0x00000776}, {0x0000a1fc, 0x00000776}, {0x0000b000, 0x02000101}, {0x0000b004, 0x02000102}, {0x0000b008, 0x02000103}, {0x0000b00c, 0x02000104}, {0x0000b010, 0x02000200}, {0x0000b014, 0x02000201}, {0x0000b018, 0x02000202}, {0x0000b01c, 0x02000203}, {0x0000b020, 0x02000204}, {0x0000b024, 0x02000205}, {0x0000b028, 0x02000208}, {0x0000b02c, 0x02000302}, {0x0000b030, 0x02000303}, {0x0000b034, 0x02000304}, {0x0000b038, 0x02000400}, {0x0000b03c, 0x02010300}, {0x0000b040, 0x02010301}, {0x0000b044, 0x02010302}, {0x0000b048, 0x02000500}, {0x0000b04c, 0x02010400}, {0x0000b050, 0x02020300}, {0x0000b054, 0x02020301}, {0x0000b058, 0x02020302}, {0x0000b05c, 0x02020303}, {0x0000b060, 0x02020400}, {0x0000b064, 0x02030300}, {0x0000b068, 0x02030301}, {0x0000b06c, 0x02030302}, {0x0000b070, 0x02030303}, {0x0000b074, 0x02030400}, {0x0000b078, 0x02040300}, {0x0000b07c, 0x02040301}, {0x0000b080, 0x02040302}, {0x0000b084, 0x02040303}, {0x0000b088, 0x02030500}, {0x0000b08c, 0x02040400}, {0x0000b090, 0x02050203}, {0x0000b094, 0x02050204}, {0x0000b098, 0x02050205}, {0x0000b09c, 0x02040500}, {0x0000b0a0, 0x02050301}, {0x0000b0a4, 0x02050302}, {0x0000b0a8, 0x02050303}, {0x0000b0ac, 0x02050400}, {0x0000b0b0, 0x02050401}, {0x0000b0b4, 0x02050402}, {0x0000b0b8, 0x02050403}, {0x0000b0bc, 0x02050500}, {0x0000b0c0, 0x02050501}, {0x0000b0c4, 0x02050502}, {0x0000b0c8, 0x02050503}, {0x0000b0cc, 0x02050504}, {0x0000b0d0, 0x02050600}, {0x0000b0d4, 0x02050601}, {0x0000b0d8, 0x02050602}, {0x0000b0dc, 0x02050603}, {0x0000b0e0, 0x02050604}, {0x0000b0e4, 0x02050700}, {0x0000b0e8, 0x02050701}, {0x0000b0ec, 0x02050702}, {0x0000b0f0, 0x02050703}, {0x0000b0f4, 0x02050704}, {0x0000b0f8, 0x02050705}, {0x0000b0fc, 0x02050708}, {0x0000b100, 0x02050709}, {0x0000b104, 0x0205070a}, {0x0000b108, 0x0205070b}, {0x0000b10c, 0x0205070c}, {0x0000b110, 0x0205070d}, {0x0000b114, 0x02050710}, {0x0000b118, 0x02050711}, {0x0000b11c, 0x02050712}, {0x0000b120, 0x02050713}, {0x0000b124, 0x02050714}, {0x0000b128, 0x02050715}, {0x0000b12c, 0x02050730}, {0x0000b130, 0x02050731}, {0x0000b134, 0x02050732}, {0x0000b138, 0x02050733}, {0x0000b13c, 0x02050734}, {0x0000b140, 0x02050735}, {0x0000b144, 0x02050750}, {0x0000b148, 0x02050751}, {0x0000b14c, 0x02050752}, {0x0000b150, 0x02050753}, {0x0000b154, 0x02050754}, {0x0000b158, 0x02050755}, {0x0000b15c, 0x02050770}, {0x0000b160, 0x02050771}, {0x0000b164, 0x02050772}, {0x0000b168, 0x02050773}, {0x0000b16c, 0x02050774}, {0x0000b170, 0x02050775}, {0x0000b174, 0x00000776}, {0x0000b178, 0x00000776}, {0x0000b17c, 0x00000776}, {0x0000b180, 0x00000776}, {0x0000b184, 0x00000776}, {0x0000b188, 0x00000776}, {0x0000b18c, 0x00000776}, {0x0000b190, 0x00000776}, {0x0000b194, 0x00000776}, {0x0000b198, 0x00000776}, {0x0000b19c, 0x00000776}, {0x0000b1a0, 0x00000776}, {0x0000b1a4, 0x00000776}, {0x0000b1a8, 0x00000776}, {0x0000b1ac, 0x00000776}, {0x0000b1b0, 0x00000776}, {0x0000b1b4, 0x00000776}, {0x0000b1b8, 0x00000776}, {0x0000b1bc, 0x00000776}, {0x0000b1c0, 0x00000776}, {0x0000b1c4, 0x00000776}, {0x0000b1c8, 0x00000776}, {0x0000b1cc, 0x00000776}, {0x0000b1d0, 0x00000776}, {0x0000b1d4, 0x00000776}, {0x0000b1d8, 0x00000776}, {0x0000b1dc, 0x00000776}, {0x0000b1e0, 0x00000776}, {0x0000b1e4, 0x00000776}, {0x0000b1e8, 0x00000776}, {0x0000b1ec, 0x00000776}, {0x0000b1f0, 0x00000776}, {0x0000b1f4, 0x00000776}, {0x0000b1f8, 0x00000776}, {0x0000b1fc, 0x00000776}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160}, {0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c}, {0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38}, {0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00}, {0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b}, {0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810}, {0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a}, {0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00007010, 0x00000023, 0x00000023, 0x00000023, 0x00000023}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00007800, 0x00040000}, {0x00007804, 0xdb005012}, {0x00007808, 0x04924914}, {0x0000780c, 0x21084210}, {0x00007810, 0x6d801300}, {0x00007814, 0x0019beff}, {0x00007818, 0x07e41000}, {0x0000781c, 0x00392000}, {0x00007820, 0x92592480}, {0x00007824, 0x00040000}, {0x00007828, 0xdb005012}, {0x0000782c, 0x04924914}, {0x00007830, 0x21084210}, {0x00007834, 0x6d801300}, {0x00007838, 0x0019beff}, {0x0000783c, 0x07e40000}, {0x00007840, 0x00392000}, {0x00007844, 0x92592480}, {0x00007848, 0x00100000}, {0x0000784c, 0x773f0567}, {0x00007850, 0x54214514}, {0x00007854, 0x12035828}, {0x00007858, 0x92592692}, {0x0000785c, 0x00000000}, {0x00007860, 0x56400000}, {0x00007864, 0x0a8e370e}, {0x00007868, 0xc0102850}, {0x0000786c, 0x812d4000}, {0x00007870, 0x807ec400}, {0x00007874, 0x001b6db0}, {0x00007878, 0x00376b63}, {0x0000787c, 0x06db6db6}, {0x00007880, 0x006d8000}, {0x00007884, 0xffeffffe}, {0x00007888, 0xffeffffe}, {0x0000788c, 0x00010000}, {0x00007890, 0x02060aeb}, {0x00007894, 0x5a108000}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x00009810, 0xd00a8005, 0xd00a8005, 0xd00a8011, 0xd00a8011}, {0x00009820, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e}, {0x00009824, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0}, {0x00009828, 0x06903081, 0x06903081, 0x06903881, 0x06903881}, {0x0000982c, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4}, {0x00009830, 0x0000059c, 0x0000059c, 0x0000119c, 0x0000119c}, {0x00009c00, 0x00000044, 0x000000c4, 0x000000c4, 0x00000044}, {0x00009e00, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0}, {0x00009e04, 0x00802020, 0x00802020, 0x00802020, 0x00802020}, {0x00009e0c, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2}, {0x00009e10, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e}, {0x00009e14, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e}, {0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c}, {0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce}, {0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021}, {0x00009e44, 0x02321e27, 0x02321e27, 0x02291e27, 0x02291e27}, {0x00009e48, 0x5030201a, 0x5030201a, 0x50302012, 0x50302012}, {0x00009fc8, 0x0003f000, 0x0003f000, 0x0001a000, 0x0001a000}, {0x0000a204, 0x000037c0, 0x000037c4, 0x000037c4, 0x000037c0}, {0x0000a208, 0x00000104, 0x00000104, 0x00000004, 0x00000004}, {0x0000a230, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b}, {0x0000a238, 0xffb81018, 0xffb81018, 0xffb81018, 0xffb81018}, {0x0000a250, 0x00000000, 0x00000000, 0x00000210, 0x00000108}, {0x0000a254, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898}, {0x0000a258, 0x02020002, 0x02020002, 0x02020002, 0x02020002}, {0x0000a25c, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e}, {0x0000a260, 0x0a021501, 0x0a021501, 0x3a021501, 0x3a021501}, {0x0000a264, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e}, {0x0000a280, 0x00000007, 0x00000007, 0x0000000b, 0x0000000b}, {0x0000a284, 0x00000000, 0x00000000, 0x00000150, 0x00000150}, {0x0000a288, 0x00000110, 0x00000110, 0x00000110, 0x00000110}, {0x0000a28c, 0x00022222, 0x00022222, 0x00022222, 0x00022222}, {0x0000a2c4, 0x00158d18, 0x00158d18, 0x00158d18, 0x00158d18}, {0x0000a2d0, 0x00071981, 0x00071981, 0x00071981, 0x00071982}, {0x0000a2d8, 0xf999a83a, 0xf999a83a, 0xf999a83a, 0xf999a83a}, {0x0000a358, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000ae04, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, {0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, {0x0000b284, 0x00000000, 0x00000000, 0x00000150, 0x00000150}, {0x0000b830, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000be04, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, {0x0000be18, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000be1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c}, {0x0000be20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce}, {0x0000c284, 0x00000000, 0x00000000, 0x00000150, 0x00000150}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00009800, 0xafe68e30}, {0x00009804, 0xfd14e000}, {0x00009808, 0x9c0a9f6b}, {0x0000980c, 0x04900000}, {0x00009814, 0x9280c00a}, {0x00009818, 0x00000000}, {0x0000981c, 0x00020028}, {0x00009834, 0x5f3ca3de}, {0x00009838, 0x0108ecff}, {0x0000983c, 0x14750600}, {0x00009880, 0x201fff00}, {0x00009884, 0x00001042}, {0x000098a4, 0x00200400}, {0x000098b0, 0x52440bbe}, {0x000098d0, 0x004b6a8e}, {0x000098d4, 0x00000820}, {0x000098dc, 0x00000000}, {0x000098f0, 0x00000000}, {0x000098f4, 0x00000000}, {0x00009c04, 0xff55ff55}, {0x00009c08, 0x0320ff55}, {0x00009c0c, 0x00000000}, {0x00009c10, 0x00000000}, {0x00009c14, 0x00046384}, {0x00009c18, 0x05b6b440}, {0x00009c1c, 0x00b6b440}, {0x00009d00, 0xc080a333}, {0x00009d04, 0x40206c10}, {0x00009d08, 0x009c4060}, {0x00009d0c, 0x9883800a}, {0x00009d10, 0x01834061}, {0x00009d14, 0x00c0040b}, {0x00009d18, 0x00000000}, {0x00009e08, 0x0038230c}, {0x00009e24, 0x990bb515}, {0x00009e28, 0x0c6f0000}, {0x00009e30, 0x06336f77}, {0x00009e34, 0x6af6532f}, {0x00009e38, 0x0cc80c00}, {0x00009e3c, 0xcf946222}, {0x00009e40, 0x0d261820}, {0x00009e4c, 0x00001004}, {0x00009e50, 0x00ff03f1}, {0x00009e54, 0x00000000}, {0x00009fc0, 0x803e4788}, {0x00009fc4, 0x0001efb5}, {0x00009fcc, 0x40000014}, {0x00009fd0, 0x01193b93}, {0x0000a20c, 0x00000000}, {0x0000a220, 0x00000000}, {0x0000a224, 0x00000000}, {0x0000a228, 0x10002310}, {0x0000a22c, 0x01036a1e}, {0x0000a234, 0x10000fff}, {0x0000a23c, 0x00000000}, {0x0000a244, 0x0c000000}, {0x0000a2a0, 0x00000001}, {0x0000a2c0, 0x00000001}, {0x0000a2c8, 0x00000000}, {0x0000a2cc, 0x18c43433}, {0x0000a2d4, 0x00000000}, {0x0000a2dc, 0x00000000}, {0x0000a2e0, 0x00000000}, {0x0000a2e4, 0x00000000}, {0x0000a2e8, 0x00000000}, {0x0000a2ec, 0x00000000}, {0x0000a2f0, 0x00000000}, {0x0000a2f4, 0x00000000}, {0x0000a2f8, 0x00000000}, {0x0000a344, 0x00000000}, {0x0000a34c, 0x00000000}, {0x0000a350, 0x0000a000}, {0x0000a364, 0x00000000}, {0x0000a370, 0x00000000}, {0x0000a390, 0x00000001}, {0x0000a394, 0x00000444}, {0x0000a398, 0x001f0e0f}, {0x0000a39c, 0x0075393f}, {0x0000a3a0, 0xb79f6427}, {0x0000a3a4, 0x00000000}, {0x0000a3a8, 0xaaaaaaaa}, {0x0000a3ac, 0x3c466478}, {0x0000a3c0, 0x20202020}, {0x0000a3c4, 0x22222220}, {0x0000a3c8, 0x20200020}, {0x0000a3cc, 0x20202020}, {0x0000a3d0, 0x20202020}, {0x0000a3d4, 0x20202020}, {0x0000a3d8, 0x20202020}, {0x0000a3dc, 0x20202020}, {0x0000a3e0, 0x20202020}, {0x0000a3e4, 0x20202020}, {0x0000a3e8, 0x20202020}, {0x0000a3ec, 0x20202020}, {0x0000a3f0, 0x00000000}, {0x0000a3f4, 0x00000246}, {0x0000a3f8, 0x0cdbd380}, {0x0000a3fc, 0x000f0f01}, {0x0000a400, 0x8fa91f01}, {0x0000a404, 0x00000000}, {0x0000a408, 0x0e79e5c6}, {0x0000a40c, 0x00820820}, {0x0000a414, 0x1ce739ce}, {0x0000a418, 0x2d001dce}, {0x0000a41c, 0x1ce739ce}, {0x0000a420, 0x000001ce}, {0x0000a424, 0x1ce739ce}, {0x0000a428, 0x000001ce}, {0x0000a42c, 0x1ce739ce}, {0x0000a430, 0x1ce739ce}, {0x0000a434, 0x00000000}, {0x0000a438, 0x00001801}, {0x0000a43c, 0x00000000}, {0x0000a440, 0x00000000}, {0x0000a444, 0x00000000}, {0x0000a448, 0x04000080}, {0x0000a44c, 0x00000001}, {0x0000a450, 0x00010000}, {0x0000a458, 0x00000000}, {0x0000a600, 0x00000000}, {0x0000a604, 0x00000000}, {0x0000a608, 0x00000000}, {0x0000a60c, 0x00000000}, {0x0000a610, 0x00000000}, {0x0000a614, 0x00000000}, {0x0000a618, 0x00000000}, {0x0000a61c, 0x00000000}, {0x0000a620, 0x00000000}, {0x0000a624, 0x00000000}, {0x0000a628, 0x00000000}, {0x0000a62c, 0x00000000}, {0x0000a630, 0x00000000}, {0x0000a634, 0x00000000}, {0x0000a638, 0x00000000}, {0x0000a63c, 0x00000000}, {0x0000a640, 0x00000000}, {0x0000a644, 0x3fad9d74}, {0x0000a648, 0x0048060a}, {0x0000a64c, 0x00000637}, {0x0000a670, 0x03020100}, {0x0000a674, 0x09080504}, {0x0000a678, 0x0d0c0b0a}, {0x0000a67c, 0x13121110}, {0x0000a680, 0x31301514}, {0x0000a684, 0x35343332}, {0x0000a688, 0x00000036}, {0x0000a690, 0x00000838}, {0x0000a7c0, 0x00000000}, {0x0000a7c4, 0xfffffffc}, {0x0000a7c8, 0x00000000}, {0x0000a7cc, 0x00000000}, {0x0000a7d0, 0x00000000}, {0x0000a7d4, 0x00000004}, {0x0000a7dc, 0x00000001}, {0x0000a8d0, 0x004b6a8e}, {0x0000a8d4, 0x00000820}, {0x0000a8dc, 0x00000000}, {0x0000a8f0, 0x00000000}, {0x0000a8f4, 0x00000000}, {0x0000b2d0, 0x00000080}, {0x0000b2d4, 0x00000000}, {0x0000b2dc, 0x00000000}, {0x0000b2e0, 0x00000000}, {0x0000b2e4, 0x00000000}, {0x0000b2e8, 0x00000000}, {0x0000b2ec, 0x00000000}, {0x0000b2f0, 0x00000000}, {0x0000b2f4, 0x00000000}, {0x0000b2f8, 0x00000000}, {0x0000b408, 0x0e79e5c0}, {0x0000b40c, 0x00820820}, {0x0000b420, 0x00000000}, {0x0000b8d0, 0x004b6a8e}, {0x0000b8d4, 0x00000820}, {0x0000b8dc, 0x00000000}, {0x0000b8f0, 0x00000000}, {0x0000b8f4, 0x00000000}, {0x0000c2d0, 0x00000080}, {0x0000c2d4, 0x00000000}, {0x0000c2dc, 0x00000000}, {0x0000c2e0, 0x00000000}, {0x0000c2e4, 0x00000000}, {0x0000c2e8, 0x00000000}, {0x0000c2ec, 0x00000000}, {0x0000c2f0, 0x00000000}, {0x0000c2f4, 0x00000000}, {0x0000c2f8, 0x00000000}, {0x0000c408, 0x0e79e5c0}, {0x0000c40c, 0x00820820}, {0x0000c420, 0x00000000}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20}, {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22}, {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24}, {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640}, {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660}, {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861}, {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81}, {0x0000a54c, 0x59025eb5, 0x59025eb5, 0x42001a83, 0x42001a83}, {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84}, {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3}, {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000}, {0x0000a584, 0x06802223, 0x06802223, 0x04800002, 0x04800002}, {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, {0x0000a5b0, 0x34825643, 0x34825643, 0x2a800e20, 0x2a800e20}, {0x0000a5b4, 0x38825a44, 0x38825a44, 0x2e800e22, 0x2e800e22}, {0x0000a5b8, 0x3b825e45, 0x3b825e45, 0x31800e24, 0x31800e24}, {0x0000a5bc, 0x41825e4a, 0x41825e4a, 0x34801640, 0x34801640}, {0x0000a5c0, 0x48825e6c, 0x48825e6c, 0x38801660, 0x38801660}, {0x0000a5c4, 0x4e825e8e, 0x4e825e8e, 0x3b801861, 0x3b801861}, {0x0000a5c8, 0x53825eb2, 0x53825eb2, 0x3e801a81, 0x3e801a81}, {0x0000a5cc, 0x59825eb5, 0x59825eb5, 0x42801a83, 0x42801a83}, {0x0000a5d0, 0x5f825ef6, 0x5f825ef6, 0x44801c84, 0x44801c84}, {0x0000a5d4, 0x62825f56, 0x62825f56, 0x48801ce3, 0x48801ce3}, {0x0000a5d8, 0x66827f56, 0x66827f56, 0x4c801ce5, 0x4c801ce5}, {0x0000a5dc, 0x6a829f56, 0x6a829f56, 0x50801ce9, 0x50801ce9}, {0x0000a5e0, 0x70849f56, 0x70849f56, 0x54801ceb, 0x54801ceb}, {0x0000a5e4, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5e8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5ec, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f0, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f4, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x00016044, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, {0x00016048, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, {0x00016068, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, {0x00016444, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, {0x00016448, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, {0x00016468, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, {0x00016844, 0x056db2e6, 0x056db2e6, 0x056db2e6, 0x056db2e6}, {0x00016848, 0xae480001, 0xae480001, 0xae480001, 0xae480001}, {0x00016868, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c, 0x6eb6db6c}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, {0x0000a500, 0x00002220, 0x00002220, 0x00000000, 0x00000000}, {0x0000a504, 0x06002223, 0x06002223, 0x04000002, 0x04000002}, {0x0000a508, 0x0a022220, 0x0a022220, 0x08000004, 0x08000004}, {0x0000a50c, 0x0f022223, 0x0f022223, 0x0b000200, 0x0b000200}, {0x0000a510, 0x14022620, 0x14022620, 0x0f000202, 0x0f000202}, {0x0000a514, 0x18022622, 0x18022622, 0x11000400, 0x11000400}, {0x0000a518, 0x1b022822, 0x1b022822, 0x15000402, 0x15000402}, {0x0000a51c, 0x20022842, 0x20022842, 0x19000404, 0x19000404}, {0x0000a520, 0x22022c41, 0x22022c41, 0x1b000603, 0x1b000603}, {0x0000a524, 0x28023042, 0x28023042, 0x1f000a02, 0x1f000a02}, {0x0000a528, 0x2c023044, 0x2c023044, 0x23000a04, 0x23000a04}, {0x0000a52c, 0x2f023644, 0x2f023644, 0x26000a20, 0x26000a20}, {0x0000a530, 0x34025643, 0x34025643, 0x2a000e20, 0x2a000e20}, {0x0000a534, 0x38025a44, 0x38025a44, 0x2e000e22, 0x2e000e22}, {0x0000a538, 0x3b025e45, 0x3b025e45, 0x31000e24, 0x31000e24}, {0x0000a53c, 0x41025e4a, 0x41025e4a, 0x34001640, 0x34001640}, {0x0000a540, 0x48025e6c, 0x48025e6c, 0x38001660, 0x38001660}, {0x0000a544, 0x4e025e8e, 0x4e025e8e, 0x3b001861, 0x3b001861}, {0x0000a548, 0x53025eb2, 0x53025eb2, 0x3e001a81, 0x3e001a81}, {0x0000a54c, 0x59025eb5, 0x59025eb5, 0x42001a83, 0x42001a83}, {0x0000a550, 0x5f025ef6, 0x5f025ef6, 0x44001c84, 0x44001c84}, {0x0000a554, 0x62025f56, 0x62025f56, 0x48001ce3, 0x48001ce3}, {0x0000a558, 0x66027f56, 0x66027f56, 0x4c001ce5, 0x4c001ce5}, {0x0000a55c, 0x6a029f56, 0x6a029f56, 0x50001ce9, 0x50001ce9}, {0x0000a560, 0x70049f56, 0x70049f56, 0x54001ceb, 0x54001ceb}, {0x0000a564, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a568, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a56c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a570, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a574, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a578, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a57c, 0x7504ff56, 0x7504ff56, 0x56001eec, 0x56001eec}, {0x0000a580, 0x00802220, 0x00802220, 0x00800000, 0x00800000}, {0x0000a584, 0x06802223, 0x06802223, 0x04800002, 0x04800002}, {0x0000a588, 0x0a822220, 0x0a822220, 0x08800004, 0x08800004}, {0x0000a58c, 0x0f822223, 0x0f822223, 0x0b800200, 0x0b800200}, {0x0000a590, 0x14822620, 0x14822620, 0x0f800202, 0x0f800202}, {0x0000a594, 0x18822622, 0x18822622, 0x11800400, 0x11800400}, {0x0000a598, 0x1b822822, 0x1b822822, 0x15800402, 0x15800402}, {0x0000a59c, 0x20822842, 0x20822842, 0x19800404, 0x19800404}, {0x0000a5a0, 0x22822c41, 0x22822c41, 0x1b800603, 0x1b800603}, {0x0000a5a4, 0x28823042, 0x28823042, 0x1f800a02, 0x1f800a02}, {0x0000a5a8, 0x2c823044, 0x2c823044, 0x23800a04, 0x23800a04}, {0x0000a5ac, 0x2f823644, 0x2f823644, 0x26800a20, 0x26800a20}, {0x0000a5b0, 0x34825643, 0x34825643, 0x2a800e20, 0x2a800e20}, {0x0000a5b4, 0x38825a44, 0x38825a44, 0x2e800e22, 0x2e800e22}, {0x0000a5b8, 0x3b825e45, 0x3b825e45, 0x31800e24, 0x31800e24}, {0x0000a5bc, 0x41825e4a, 0x41825e4a, 0x34801640, 0x34801640}, {0x0000a5c0, 0x48825e6c, 0x48825e6c, 0x38801660, 0x38801660}, {0x0000a5c4, 0x4e825e8e, 0x4e825e8e, 0x3b801861, 0x3b801861}, {0x0000a5c8, 0x53825eb2, 0x53825eb2, 0x3e801a81, 0x3e801a81}, {0x0000a5cc, 0x59825eb5, 0x59825eb5, 0x42801a83, 0x42801a83}, {0x0000a5d0, 0x5f825ef6, 0x5f825ef6, 0x44801c84, 0x44801c84}, {0x0000a5d4, 0x62825f56, 0x62825f56, 0x48801ce3, 0x48801ce3}, {0x0000a5d8, 0x66827f56, 0x66827f56, 0x4c801ce5, 0x4c801ce5}, {0x0000a5dc, 0x6a829f56, 0x6a829f56, 0x50801ce9, 0x50801ce9}, {0x0000a5e0, 0x70849f56, 0x70849f56, 0x54801ceb, 0x54801ceb}, {0x0000a5e4, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5e8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5ec, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f0, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f4, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5f8, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x0000a5fc, 0x7584ff56, 0x7584ff56, 0x56801eec, 0x56801eec}, {0x00016044, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, {0x00016048, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016444, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, {0x00016448, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001}, {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016844, 0x056db2e4, 0x056db2e4, 0x056db2e4, 0x056db2e4}, {0x00016848, 0x8e480001, 0x8e480001, 0x8e480001, 0x8e480001}, {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x0000a000, 0x00010000}, {0x0000a004, 0x00030002}, {0x0000a008, 0x00050004}, {0x0000a00c, 0x00810080}, {0x0000a010, 0x00830082}, {0x0000a014, 0x01810180}, {0x0000a018, 0x01830182}, {0x0000a01c, 0x01850184}, {0x0000a020, 0x01890188}, {0x0000a024, 0x018b018a}, {0x0000a028, 0x018d018c}, {0x0000a02c, 0x01910190}, {0x0000a030, 0x01930192}, {0x0000a034, 0x01950194}, {0x0000a038, 0x038a0196}, {0x0000a03c, 0x038c038b}, {0x0000a040, 0x0390038d}, {0x0000a044, 0x03920391}, {0x0000a048, 0x03940393}, {0x0000a04c, 0x03960395}, {0x0000a050, 0x00000000}, {0x0000a054, 0x00000000}, {0x0000a058, 0x00000000}, {0x0000a05c, 0x00000000}, {0x0000a060, 0x00000000}, {0x0000a064, 0x00000000}, {0x0000a068, 0x00000000}, {0x0000a06c, 0x00000000}, {0x0000a070, 0x00000000}, {0x0000a074, 0x00000000}, {0x0000a078, 0x00000000}, {0x0000a07c, 0x00000000}, {0x0000a080, 0x22222229}, {0x0000a084, 0x1d1d1d1d}, {0x0000a088, 0x1d1d1d1d}, {0x0000a08c, 0x1d1d1d1d}, {0x0000a090, 0x171d1d1d}, {0x0000a094, 0x11111717}, {0x0000a098, 0x00030311}, {0x0000a09c, 0x00000000}, {0x0000a0a0, 0x00000000}, {0x0000a0a4, 0x00000000}, {0x0000a0a8, 0x00000000}, {0x0000a0ac, 0x00000000}, {0x0000a0b0, 0x00000000}, {0x0000a0b4, 0x00000000}, {0x0000a0b8, 0x00000000}, {0x0000a0bc, 0x00000000}, {0x0000a0c0, 0x001f0000}, {0x0000a0c4, 0x01000101}, {0x0000a0c8, 0x011e011f}, {0x0000a0cc, 0x011c011d}, {0x0000a0d0, 0x02030204}, {0x0000a0d4, 0x02010202}, {0x0000a0d8, 0x021f0200}, {0x0000a0dc, 0x0302021e}, {0x0000a0e0, 0x03000301}, {0x0000a0e4, 0x031e031f}, {0x0000a0e8, 0x0402031d}, {0x0000a0ec, 0x04000401}, {0x0000a0f0, 0x041e041f}, {0x0000a0f4, 0x0502041d}, {0x0000a0f8, 0x05000501}, {0x0000a0fc, 0x051e051f}, {0x0000a100, 0x06010602}, {0x0000a104, 0x061f0600}, {0x0000a108, 0x061d061e}, {0x0000a10c, 0x07020703}, {0x0000a110, 0x07000701}, {0x0000a114, 0x00000000}, {0x0000a118, 0x00000000}, {0x0000a11c, 0x00000000}, {0x0000a120, 0x00000000}, {0x0000a124, 0x00000000}, {0x0000a128, 0x00000000}, {0x0000a12c, 0x00000000}, {0x0000a130, 0x00000000}, {0x0000a134, 0x00000000}, {0x0000a138, 0x00000000}, {0x0000a13c, 0x00000000}, {0x0000a140, 0x001f0000}, {0x0000a144, 0x01000101}, {0x0000a148, 0x011e011f}, {0x0000a14c, 0x011c011d}, {0x0000a150, 0x02030204}, {0x0000a154, 0x02010202}, {0x0000a158, 0x021f0200}, {0x0000a15c, 0x0302021e}, {0x0000a160, 0x03000301}, {0x0000a164, 0x031e031f}, {0x0000a168, 0x0402031d}, {0x0000a16c, 0x04000401}, {0x0000a170, 0x041e041f}, {0x0000a174, 0x0502041d}, {0x0000a178, 0x05000501}, {0x0000a17c, 0x051e051f}, {0x0000a180, 0x06010602}, {0x0000a184, 0x061f0600}, {0x0000a188, 0x061d061e}, {0x0000a18c, 0x07020703}, {0x0000a190, 0x07000701}, {0x0000a194, 0x00000000}, {0x0000a198, 0x00000000}, {0x0000a19c, 0x00000000}, {0x0000a1a0, 0x00000000}, {0x0000a1a4, 0x00000000}, {0x0000a1a8, 0x00000000}, {0x0000a1ac, 0x00000000}, {0x0000a1b0, 0x00000000}, {0x0000a1b4, 0x00000000}, {0x0000a1b8, 0x00000000}, {0x0000a1bc, 0x00000000}, {0x0000a1c0, 0x00000000}, {0x0000a1c4, 0x00000000}, {0x0000a1c8, 0x00000000}, {0x0000a1cc, 0x00000000}, {0x0000a1d0, 0x00000000}, {0x0000a1d4, 0x00000000}, {0x0000a1d8, 0x00000000}, {0x0000a1dc, 0x00000000}, {0x0000a1e0, 0x00000000}, {0x0000a1e4, 0x00000000}, {0x0000a1e8, 0x00000000}, {0x0000a1ec, 0x00000000}, {0x0000a1f0, 0x00000396}, {0x0000a1f4, 0x00000396}, {0x0000a1f8, 0x00000396}, {0x0000a1fc, 0x00000196}, {0x0000b000, 0x00010000}, {0x0000b004, 0x00030002}, {0x0000b008, 0x00050004}, {0x0000b00c, 0x00810080}, {0x0000b010, 0x00830082}, {0x0000b014, 0x01810180}, {0x0000b018, 0x01830182}, {0x0000b01c, 0x01850184}, {0x0000b020, 0x02810280}, {0x0000b024, 0x02830282}, {0x0000b028, 0x02850284}, {0x0000b02c, 0x02890288}, {0x0000b030, 0x028b028a}, {0x0000b034, 0x0388028c}, {0x0000b038, 0x038a0389}, {0x0000b03c, 0x038c038b}, {0x0000b040, 0x0390038d}, {0x0000b044, 0x03920391}, {0x0000b048, 0x03940393}, {0x0000b04c, 0x03960395}, {0x0000b050, 0x00000000}, {0x0000b054, 0x00000000}, {0x0000b058, 0x00000000}, {0x0000b05c, 0x00000000}, {0x0000b060, 0x00000000}, {0x0000b064, 0x00000000}, {0x0000b068, 0x00000000}, {0x0000b06c, 0x00000000}, {0x0000b070, 0x00000000}, {0x0000b074, 0x00000000}, {0x0000b078, 0x00000000}, {0x0000b07c, 0x00000000}, {0x0000b080, 0x32323232}, {0x0000b084, 0x2f2f3232}, {0x0000b088, 0x23282a2d}, {0x0000b08c, 0x1c1e2123}, {0x0000b090, 0x14171919}, {0x0000b094, 0x0e0e1214}, {0x0000b098, 0x03050707}, {0x0000b09c, 0x00030303}, {0x0000b0a0, 0x00000000}, {0x0000b0a4, 0x00000000}, {0x0000b0a8, 0x00000000}, {0x0000b0ac, 0x00000000}, {0x0000b0b0, 0x00000000}, {0x0000b0b4, 0x00000000}, {0x0000b0b8, 0x00000000}, {0x0000b0bc, 0x00000000}, {0x0000b0c0, 0x003f0020}, {0x0000b0c4, 0x00400041}, {0x0000b0c8, 0x0140005f}, {0x0000b0cc, 0x0160015f}, {0x0000b0d0, 0x017e017f}, {0x0000b0d4, 0x02410242}, {0x0000b0d8, 0x025f0240}, {0x0000b0dc, 0x027f0260}, {0x0000b0e0, 0x0341027e}, {0x0000b0e4, 0x035f0340}, {0x0000b0e8, 0x037f0360}, {0x0000b0ec, 0x04400441}, {0x0000b0f0, 0x0460045f}, {0x0000b0f4, 0x0541047f}, {0x0000b0f8, 0x055f0540}, {0x0000b0fc, 0x057f0560}, {0x0000b100, 0x06400641}, {0x0000b104, 0x0660065f}, {0x0000b108, 0x067e067f}, {0x0000b10c, 0x07410742}, {0x0000b110, 0x075f0740}, {0x0000b114, 0x077f0760}, {0x0000b118, 0x07800781}, {0x0000b11c, 0x07a0079f}, {0x0000b120, 0x07c107bf}, {0x0000b124, 0x000007c0}, {0x0000b128, 0x00000000}, {0x0000b12c, 0x00000000}, {0x0000b130, 0x00000000}, {0x0000b134, 0x00000000}, {0x0000b138, 0x00000000}, {0x0000b13c, 0x00000000}, {0x0000b140, 0x003f0020}, {0x0000b144, 0x00400041}, {0x0000b148, 0x0140005f}, {0x0000b14c, 0x0160015f}, {0x0000b150, 0x017e017f}, {0x0000b154, 0x02410242}, {0x0000b158, 0x025f0240}, {0x0000b15c, 0x027f0260}, {0x0000b160, 0x0341027e}, {0x0000b164, 0x035f0340}, {0x0000b168, 0x037f0360}, {0x0000b16c, 0x04400441}, {0x0000b170, 0x0460045f}, {0x0000b174, 0x0541047f}, {0x0000b178, 0x055f0540}, {0x0000b17c, 0x057f0560}, {0x0000b180, 0x06400641}, {0x0000b184, 0x0660065f}, {0x0000b188, 0x067e067f}, {0x0000b18c, 0x07410742}, {0x0000b190, 0x075f0740}, {0x0000b194, 0x077f0760}, {0x0000b198, 0x07800781}, {0x0000b19c, 0x07a0079f}, {0x0000b1a0, 0x07c107bf}, {0x0000b1a4, 0x000007c0}, {0x0000b1a8, 0x00000000}, {0x0000b1ac, 0x00000000}, {0x0000b1b0, 0x00000000}, {0x0000b1b4, 0x00000000}, {0x0000b1b8, 0x00000000}, {0x0000b1bc, 0x00000000}, {0x0000b1c0, 0x00000000}, {0x0000b1c4, 0x00000000}, {0x0000b1c8, 0x00000000}, {0x0000b1cc, 0x00000000}, {0x0000b1d0, 0x00000000}, {0x0000b1d4, 0x00000000}, {0x0000b1d8, 0x00000000}, {0x0000b1dc, 0x00000000}, {0x0000b1e0, 0x00000000}, {0x0000b1e4, 0x00000000}, {0x0000b1e8, 0x00000000}, {0x0000b1ec, 0x00000000}, {0x0000b1f0, 0x00000396}, {0x0000b1f4, 0x00000396}, {0x0000b1f8, 0x00000396}, {0x0000b1fc, 0x00000196}, }; static const u32 <API key>[][5] = { /* Addr 5G_HT20 5G_HT40 2G_HT40 2G_HT20 */ {0x0000a410, 0x000050d9, 0x000050d9, 0x000050d9, 0x000050d9}, {0x0000a500, 0x00000000, 0x00000000, 0x00000000, 0x00000000}, {0x0000a504, 0x06000003, 0x06000003, 0x04000002, 0x04000002}, {0x0000a508, 0x0a000020, 0x0a000020, 0x08000004, 0x08000004}, {0x0000a50c, 0x10000023, 0x10000023, 0x0b000200, 0x0b000200}, {0x0000a510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202}, {0x0000a514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400}, {0x0000a518, 0x21020220, 0x21020220, 0x16000402, 0x16000402}, {0x0000a51c, 0x27020223, 0x27020223, 0x19000404, 0x19000404}, {0x0000a520, 0x2b022220, 0x2b022220, 0x1c000603, 0x1c000603}, {0x0000a524, 0x2f022222, 0x2f022222, 0x21000a02, 0x21000a02}, {0x0000a528, 0x34022225, 0x34022225, 0x25000a04, 0x25000a04}, {0x0000a52c, 0x3a02222a, 0x3a02222a, 0x28000a20, 0x28000a20}, {0x0000a530, 0x3e02222c, 0x3e02222c, 0x2c000e20, 0x2c000e20}, {0x0000a534, 0x4202242a, 0x4202242a, 0x30000e22, 0x30000e22}, {0x0000a538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24}, {0x0000a53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640}, {0x0000a540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660}, {0x0000a544, 0x5302266c, 0x5302266c, 0x3f001861, 0x3f001861}, {0x0000a548, 0x5702286c, 0x5702286c, 0x43001a81, 0x43001a81}, {0x0000a54c, 0x5c04286b, 0x5c04286b, 0x47001a83, 0x47001a83}, {0x0000a550, 0x61042a6c, 0x61042a6c, 0x4a001c84, 0x4a001c84}, {0x0000a554, 0x66062a6c, 0x66062a6c, 0x4e001ce3, 0x4e001ce3}, {0x0000a558, 0x6b062e6c, 0x6b062e6c, 0x52001ce5, 0x52001ce5}, {0x0000a55c, 0x7006308c, 0x7006308c, 0x56001ce9, 0x56001ce9}, {0x0000a560, 0x730a308a, 0x730a308a, 0x5a001ceb, 0x5a001ceb}, {0x0000a564, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a568, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a56c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a570, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a574, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a578, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a57c, 0x770a308c, 0x770a308c, 0x5d001eec, 0x5d001eec}, {0x0000a580, 0x00800000, 0x00800000, 0x00800000, 0x00800000}, {0x0000a584, 0x06800003, 0x06800003, 0x04800002, 0x04800002}, {0x0000a588, 0x0a800020, 0x0a800020, 0x08800004, 0x08800004}, {0x0000a58c, 0x10800023, 0x10800023, 0x0b800200, 0x0b800200}, {0x0000a590, 0x16800220, 0x16800220, 0x0f800202, 0x0f800202}, {0x0000a594, 0x1c800223, 0x1c800223, 0x12800400, 0x12800400}, {0x0000a598, 0x21820220, 0x21820220, 0x16800402, 0x16800402}, {0x0000a59c, 0x27820223, 0x27820223, 0x19800404, 0x19800404}, {0x0000a5a0, 0x2b822220, 0x2b822220, 0x1c800603, 0x1c800603}, {0x0000a5a4, 0x2f822222, 0x2f822222, 0x21800a02, 0x21800a02}, {0x0000a5a8, 0x34822225, 0x34822225, 0x25800a04, 0x25800a04}, {0x0000a5ac, 0x3a82222a, 0x3a82222a, 0x28800a20, 0x28800a20}, {0x0000a5b0, 0x3e82222c, 0x3e82222c, 0x2c800e20, 0x2c800e20}, {0x0000a5b4, 0x4282242a, 0x4282242a, 0x30800e22, 0x30800e22}, {0x0000a5b8, 0x4782244a, 0x4782244a, 0x34800e24, 0x34800e24}, {0x0000a5bc, 0x4b82244c, 0x4b82244c, 0x38801640, 0x38801640}, {0x0000a5c0, 0x4e82246c, 0x4e82246c, 0x3c801660, 0x3c801660}, {0x0000a5c4, 0x5382266c, 0x5382266c, 0x3f801861, 0x3f801861}, {0x0000a5c8, 0x5782286c, 0x5782286c, 0x43801a81, 0x43801a81}, {0x0000a5cc, 0x5c84286b, 0x5c84286b, 0x47801a83, 0x47801a83}, {0x0000a5d0, 0x61842a6c, 0x61842a6c, 0x4a801c84, 0x4a801c84}, {0x0000a5d4, 0x66862a6c, 0x66862a6c, 0x4e801ce3, 0x4e801ce3}, {0x0000a5d8, 0x6b862e6c, 0x6b862e6c, 0x52801ce5, 0x52801ce5}, {0x0000a5dc, 0x7086308c, 0x7086308c, 0x56801ce9, 0x56801ce9}, {0x0000a5e0, 0x738a308a, 0x738a308a, 0x5a801ceb, 0x5a801ceb}, {0x0000a5e4, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5e8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5ec, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f0, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f4, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5f8, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x0000a5fc, 0x778a308c, 0x778a308c, 0x5d801eec, 0x5d801eec}, {0x00016044, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016048, 0x64000001, 0x64000001, 0x64000001, 0x64000001}, {0x00016068, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016444, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016448, 0x64000001, 0x64000001, 0x64000001, 0x64000001}, {0x00016468, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, {0x00016844, 0x012492d4, 0x012492d4, 0x012492d4, 0x012492d4}, {0x00016848, 0x64000001, 0x64000001, 0x64000001, 0x64000001}, {0x00016868, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c, 0x6db6db6c}, }; static const u32 ar9300_2p0_mac_core[][2] = { /* Addr allmodes */ {0x00000008, 0x00000000}, {0x00000030, 0x00020085}, {0x00000034, 0x00000005}, {0x00000040, 0x00000000}, {0x00000044, 0x00000000}, {0x00000048, 0x00000008}, {0x0000004c, 0x00000010}, {0x00000050, 0x00000000}, {0x00001040, 0x002ffc0f}, {0x00001044, 0x002ffc0f}, {0x00001048, 0x002ffc0f}, {0x0000104c, 0x002ffc0f}, {0x00001050, 0x002ffc0f}, {0x00001054, 0x002ffc0f}, {0x00001058, 0x002ffc0f}, {0x0000105c, 0x002ffc0f}, {0x00001060, 0x002ffc0f}, {0x00001064, 0x002ffc0f}, {0x000010f0, 0x00000100}, {0x00001270, 0x00000000}, {0x000012b0, 0x00000000}, {0x000012f0, 0x00000000}, {0x0000143c, 0x00000000}, {0x0000147c, 0x00000000}, {0x00008000, 0x00000000}, {0x00008004, 0x00000000}, {0x00008008, 0x00000000}, {0x0000800c, 0x00000000}, {0x00008018, 0x00000000}, {0x00008020, 0x00000000}, {0x00008038, 0x00000000}, {0x0000803c, 0x00000000}, {0x00008040, 0x00000000}, {0x00008044, 0x00000000}, {0x00008048, 0x00000000}, {0x0000804c, 0xffffffff}, {0x00008054, 0x00000000}, {0x00008058, 0x00000000}, {0x0000805c, 0x000fc78f}, {0x00008060, 0x0000000f}, {0x00008064, 0x00000000}, {0x00008070, 0x00000310}, {0x00008074, 0x00000020}, {0x00008078, 0x00000000}, {0x0000809c, 0x0000000f}, {0x000080a0, 0x00000000}, {0x000080a4, 0x02ff0000}, {0x000080a8, 0x0e070605}, {0x000080ac, 0x0000000d}, {0x000080b0, 0x00000000}, {0x000080b4, 0x00000000}, {0x000080b8, 0x00000000}, {0x000080bc, 0x00000000}, {0x000080c0, 0x2a800000}, {0x000080c4, 0x06900168}, {0x000080c8, 0x13881c20}, {0x000080cc, 0x01f40000}, {0x000080d0, 0x00252500}, {0x000080d4, 0x00a00000}, {0x000080d8, 0x00400000}, {0x000080dc, 0x00000000}, {0x000080e0, 0xffffffff}, {0x000080e4, 0x0000ffff}, {0x000080e8, 0x3f3f3f3f}, {0x000080ec, 0x00000000}, {0x000080f0, 0x00000000}, {0x000080f4, 0x00000000}, {0x000080fc, 0x00020000}, {0x00008100, 0x00000000}, {0x00008108, 0x00000052}, {0x0000810c, 0x00000000}, {0x00008110, 0x00000000}, {0x00008114, 0x000007ff}, {0x00008118, 0x000000aa}, {0x0000811c, 0x00003210}, {0x00008124, 0x00000000}, {0x00008128, 0x00000000}, {0x0000812c, 0x00000000}, {0x00008130, 0x00000000}, {0x00008134, 0x00000000}, {0x00008138, 0x00000000}, {0x0000813c, 0x0000ffff}, {0x00008144, 0xffffffff}, {0x00008168, 0x00000000}, {0x0000816c, 0x00000000}, {0x00008170, 0x18486200}, {0x00008174, 0x33332210}, {0x00008178, 0x00000000}, {0x0000817c, 0x00020000}, {0x000081c0, 0x00000000}, {0x000081c4, 0x33332210}, {0x000081c8, 0x00000000}, {0x000081cc, 0x00000000}, {0x000081d4, 0x00000000}, {0x000081ec, 0x00000000}, {0x000081f0, 0x00000000}, {0x000081f4, 0x00000000}, {0x000081f8, 0x00000000}, {0x000081fc, 0x00000000}, {0x00008240, 0x00100000}, {0x00008244, 0x0010f424}, {0x00008248, 0x00000800}, {0x0000824c, 0x0001e848}, {0x00008250, 0x00000000}, {0x00008254, 0x00000000}, {0x00008258, 0x00000000}, {0x0000825c, 0x40000000}, {0x00008260, 0x00080922}, {0x00008264, 0x98a00010}, {0x00008268, 0xffffffff}, {0x0000826c, 0x0000ffff}, {0x00008270, 0x00000000}, {0x00008274, 0x40000000}, {0x00008278, 0x003e4180}, {0x0000827c, 0x00000004}, {0x00008284, 0x0000002c}, {0x00008288, 0x0000002c}, {0x0000828c, 0x000000ff}, {0x00008294, 0x00000000}, {0x00008298, 0x00000000}, {0x0000829c, 0x00000000}, {0x00008300, 0x00000140}, {0x00008314, 0x00000000}, {0x0000831c, 0x0000010d}, {0x00008328, 0x00000000}, {0x0000832c, 0x00000007}, {0x00008330, 0x00000302}, {0x00008334, 0x00000700}, {0x00008338, 0x00ff0000}, {0x0000833c, 0x02400000}, {0x00008340, 0x000107ff}, {0x00008344, 0xaa48105b}, {0x00008348, 0x008f0000}, {0x0000835c, 0x00000000}, {0x00008360, 0xffffffff}, {0x00008364, 0xffffffff}, {0x00008368, 0x00000000}, {0x00008370, 0x00000000}, {0x00008374, 0x000000ff}, {0x00008378, 0x00000000}, {0x0000837c, 0x00000000}, {0x00008380, 0xffffffff}, {0x00008384, 0xffffffff}, {0x00008390, 0xffffffff}, {0x00008394, 0xffffffff}, {0x00008398, 0x00000000}, {0x0000839c, 0x00000000}, {0x000083a0, 0x00000000}, {0x000083a4, 0x0000fa14}, {0x000083a8, 0x000f0c00}, {0x000083ac, 0x33332210}, {0x000083b0, 0x33332210}, {0x000083b4, 0x33332210}, {0x000083b8, 0x33332210}, {0x000083bc, 0x00000000}, {0x000083c0, 0x00000000}, {0x000083c4, 0x00000000}, {0x000083c8, 0x00000000}, {0x000083cc, 0x00000200}, {0x000083d0, 0x000301ff}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x0000a000, 0x00010000}, {0x0000a004, 0x00030002}, {0x0000a008, 0x00050004}, {0x0000a00c, 0x00810080}, {0x0000a010, 0x00830082}, {0x0000a014, 0x01810180}, {0x0000a018, 0x01830182}, {0x0000a01c, 0x01850184}, {0x0000a020, 0x01890188}, {0x0000a024, 0x018b018a}, {0x0000a028, 0x018d018c}, {0x0000a02c, 0x03820190}, {0x0000a030, 0x03840383}, {0x0000a034, 0x03880385}, {0x0000a038, 0x038a0389}, {0x0000a03c, 0x038c038b}, {0x0000a040, 0x0390038d}, {0x0000a044, 0x03920391}, {0x0000a048, 0x03940393}, {0x0000a04c, 0x03960395}, {0x0000a050, 0x00000000}, {0x0000a054, 0x00000000}, {0x0000a058, 0x00000000}, {0x0000a05c, 0x00000000}, {0x0000a060, 0x00000000}, {0x0000a064, 0x00000000}, {0x0000a068, 0x00000000}, {0x0000a06c, 0x00000000}, {0x0000a070, 0x00000000}, {0x0000a074, 0x00000000}, {0x0000a078, 0x00000000}, {0x0000a07c, 0x00000000}, {0x0000a080, 0x29292929}, {0x0000a084, 0x29292929}, {0x0000a088, 0x29292929}, {0x0000a08c, 0x29292929}, {0x0000a090, 0x22292929}, {0x0000a094, 0x1d1d2222}, {0x0000a098, 0x0c111117}, {0x0000a09c, 0x00030303}, {0x0000a0a0, 0x00000000}, {0x0000a0a4, 0x00000000}, {0x0000a0a8, 0x00000000}, {0x0000a0ac, 0x00000000}, {0x0000a0b0, 0x00000000}, {0x0000a0b4, 0x00000000}, {0x0000a0b8, 0x00000000}, {0x0000a0bc, 0x00000000}, {0x0000a0c0, 0x001f0000}, {0x0000a0c4, 0x01000101}, {0x0000a0c8, 0x011e011f}, {0x0000a0cc, 0x011c011d}, {0x0000a0d0, 0x02030204}, {0x0000a0d4, 0x02010202}, {0x0000a0d8, 0x021f0200}, {0x0000a0dc, 0x0302021e}, {0x0000a0e0, 0x03000301}, {0x0000a0e4, 0x031e031f}, {0x0000a0e8, 0x0402031d}, {0x0000a0ec, 0x04000401}, {0x0000a0f0, 0x041e041f}, {0x0000a0f4, 0x0502041d}, {0x0000a0f8, 0x05000501}, {0x0000a0fc, 0x051e051f}, {0x0000a100, 0x06010602}, {0x0000a104, 0x061f0600}, {0x0000a108, 0x061d061e}, {0x0000a10c, 0x07020703}, {0x0000a110, 0x07000701}, {0x0000a114, 0x00000000}, {0x0000a118, 0x00000000}, {0x0000a11c, 0x00000000}, {0x0000a120, 0x00000000}, {0x0000a124, 0x00000000}, {0x0000a128, 0x00000000}, {0x0000a12c, 0x00000000}, {0x0000a130, 0x00000000}, {0x0000a134, 0x00000000}, {0x0000a138, 0x00000000}, {0x0000a13c, 0x00000000}, {0x0000a140, 0x001f0000}, {0x0000a144, 0x01000101}, {0x0000a148, 0x011e011f}, {0x0000a14c, 0x011c011d}, {0x0000a150, 0x02030204}, {0x0000a154, 0x02010202}, {0x0000a158, 0x021f0200}, {0x0000a15c, 0x0302021e}, {0x0000a160, 0x03000301}, {0x0000a164, 0x031e031f}, {0x0000a168, 0x0402031d}, {0x0000a16c, 0x04000401}, {0x0000a170, 0x041e041f}, {0x0000a174, 0x0502041d}, {0x0000a178, 0x05000501}, {0x0000a17c, 0x051e051f}, {0x0000a180, 0x06010602}, {0x0000a184, 0x061f0600}, {0x0000a188, 0x061d061e}, {0x0000a18c, 0x07020703}, {0x0000a190, 0x07000701}, {0x0000a194, 0x00000000}, {0x0000a198, 0x00000000}, {0x0000a19c, 0x00000000}, {0x0000a1a0, 0x00000000}, {0x0000a1a4, 0x00000000}, {0x0000a1a8, 0x00000000}, {0x0000a1ac, 0x00000000}, {0x0000a1b0, 0x00000000}, {0x0000a1b4, 0x00000000}, {0x0000a1b8, 0x00000000}, {0x0000a1bc, 0x00000000}, {0x0000a1c0, 0x00000000}, {0x0000a1c4, 0x00000000}, {0x0000a1c8, 0x00000000}, {0x0000a1cc, 0x00000000}, {0x0000a1d0, 0x00000000}, {0x0000a1d4, 0x00000000}, {0x0000a1d8, 0x00000000}, {0x0000a1dc, 0x00000000}, {0x0000a1e0, 0x00000000}, {0x0000a1e4, 0x00000000}, {0x0000a1e8, 0x00000000}, {0x0000a1ec, 0x00000000}, {0x0000a1f0, 0x00000396}, {0x0000a1f4, 0x00000396}, {0x0000a1f8, 0x00000396}, {0x0000a1fc, 0x00000196}, {0x0000b000, 0x00010000}, {0x0000b004, 0x00030002}, {0x0000b008, 0x00050004}, {0x0000b00c, 0x00810080}, {0x0000b010, 0x00830082}, {0x0000b014, 0x01810180}, {0x0000b018, 0x01830182}, {0x0000b01c, 0x01850184}, {0x0000b020, 0x02810280}, {0x0000b024, 0x02830282}, {0x0000b028, 0x02850284}, {0x0000b02c, 0x02890288}, {0x0000b030, 0x028b028a}, {0x0000b034, 0x0388028c}, {0x0000b038, 0x038a0389}, {0x0000b03c, 0x038c038b}, {0x0000b040, 0x0390038d}, {0x0000b044, 0x03920391}, {0x0000b048, 0x03940393}, {0x0000b04c, 0x03960395}, {0x0000b050, 0x00000000}, {0x0000b054, 0x00000000}, {0x0000b058, 0x00000000}, {0x0000b05c, 0x00000000}, {0x0000b060, 0x00000000}, {0x0000b064, 0x00000000}, {0x0000b068, 0x00000000}, {0x0000b06c, 0x00000000}, {0x0000b070, 0x00000000}, {0x0000b074, 0x00000000}, {0x0000b078, 0x00000000}, {0x0000b07c, 0x00000000}, {0x0000b080, 0x32323232}, {0x0000b084, 0x2f2f3232}, {0x0000b088, 0x23282a2d}, {0x0000b08c, 0x1c1e2123}, {0x0000b090, 0x14171919}, {0x0000b094, 0x0e0e1214}, {0x0000b098, 0x03050707}, {0x0000b09c, 0x00030303}, {0x0000b0a0, 0x00000000}, {0x0000b0a4, 0x00000000}, {0x0000b0a8, 0x00000000}, {0x0000b0ac, 0x00000000}, {0x0000b0b0, 0x00000000}, {0x0000b0b4, 0x00000000}, {0x0000b0b8, 0x00000000}, {0x0000b0bc, 0x00000000}, {0x0000b0c0, 0x003f0020}, {0x0000b0c4, 0x00400041}, {0x0000b0c8, 0x0140005f}, {0x0000b0cc, 0x0160015f}, {0x0000b0d0, 0x017e017f}, {0x0000b0d4, 0x02410242}, {0x0000b0d8, 0x025f0240}, {0x0000b0dc, 0x027f0260}, {0x0000b0e0, 0x0341027e}, {0x0000b0e4, 0x035f0340}, {0x0000b0e8, 0x037f0360}, {0x0000b0ec, 0x04400441}, {0x0000b0f0, 0x0460045f}, {0x0000b0f4, 0x0541047f}, {0x0000b0f8, 0x055f0540}, {0x0000b0fc, 0x057f0560}, {0x0000b100, 0x06400641}, {0x0000b104, 0x0660065f}, {0x0000b108, 0x067e067f}, {0x0000b10c, 0x07410742}, {0x0000b110, 0x075f0740}, {0x0000b114, 0x077f0760}, {0x0000b118, 0x07800781}, {0x0000b11c, 0x07a0079f}, {0x0000b120, 0x07c107bf}, {0x0000b124, 0x000007c0}, {0x0000b128, 0x00000000}, {0x0000b12c, 0x00000000}, {0x0000b130, 0x00000000}, {0x0000b134, 0x00000000}, {0x0000b138, 0x00000000}, {0x0000b13c, 0x00000000}, {0x0000b140, 0x003f0020}, {0x0000b144, 0x00400041}, {0x0000b148, 0x0140005f}, {0x0000b14c, 0x0160015f}, {0x0000b150, 0x017e017f}, {0x0000b154, 0x02410242}, {0x0000b158, 0x025f0240}, {0x0000b15c, 0x027f0260}, {0x0000b160, 0x0341027e}, {0x0000b164, 0x035f0340}, {0x0000b168, 0x037f0360}, {0x0000b16c, 0x04400441}, {0x0000b170, 0x0460045f}, {0x0000b174, 0x0541047f}, {0x0000b178, 0x055f0540}, {0x0000b17c, 0x057f0560}, {0x0000b180, 0x06400641}, {0x0000b184, 0x0660065f}, {0x0000b188, 0x067e067f}, {0x0000b18c, 0x07410742}, {0x0000b190, 0x075f0740}, {0x0000b194, 0x077f0760}, {0x0000b198, 0x07800781}, {0x0000b19c, 0x07a0079f}, {0x0000b1a0, 0x07c107bf}, {0x0000b1a4, 0x000007c0}, {0x0000b1a8, 0x00000000}, {0x0000b1ac, 0x00000000}, {0x0000b1b0, 0x00000000}, {0x0000b1b4, 0x00000000}, {0x0000b1b8, 0x00000000}, {0x0000b1bc, 0x00000000}, {0x0000b1c0, 0x00000000}, {0x0000b1c4, 0x00000000}, {0x0000b1c8, 0x00000000}, {0x0000b1cc, 0x00000000}, {0x0000b1d0, 0x00000000}, {0x0000b1d4, 0x00000000}, {0x0000b1d8, 0x00000000}, {0x0000b1dc, 0x00000000}, {0x0000b1e0, 0x00000000}, {0x0000b1e4, 0x00000000}, {0x0000b1e8, 0x00000000}, {0x0000b1ec, 0x00000000}, {0x0000b1f0, 0x00000396}, {0x0000b1f4, 0x00000396}, {0x0000b1f8, 0x00000396}, {0x0000b1fc, 0x00000196}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x000040a4, 0x00a0c1c9}, {0x00007008, 0x00000000}, {0x00007020, 0x00000000}, {0x00007034, 0x00000002}, {0x00007038, 0x000004c2}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00004040, 0x08212e5e}, {0x00004040, 0x0008003b}, {0x00004044, 0x00000000}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00004040, 0x08253e5e}, {0x00004040, 0x0008003b}, {0x00004044, 0x00000000}, }; static const u32 <API key>[][2] = { /* Addr allmodes */ {0x00004040, 0x08213e5e}, {0x00004040, 0x0008003b}, {0x00004044, 0x00000000}, }; #endif /* INITVALS_9003_H */
#include <linux/clkdev.h> /* Map io */ extern void __init at91rm9200_map_io(void); extern void __init at91sam9260_map_io(void); extern void __init at91sam9261_map_io(void); extern void __init at91sam9263_map_io(void); extern void __init at91sam9rl_map_io(void); extern void __init at91sam9g45_map_io(void); extern void __init at91x40_map_io(void); extern void __init at91cap9_map_io(void); /* Processors */ extern void __init at91rm9200_set_type(int type); extern void __init <API key>(unsigned long main_clock); extern void __init <API key>(unsigned long main_clock); extern void __init <API key>(unsigned long main_clock); extern void __init <API key>(unsigned long main_clock); extern void __init <API key>(unsigned long main_clock); extern void __init <API key>(unsigned long main_clock); extern void __init at91x40_initialize(unsigned long main_clock); extern void __init at91cap9_initialize(unsigned long main_clock); /* Interrupts */ extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init <API key>(unsigned int priority[]); extern void __init at91_aic_init(unsigned int priority[]); /* Timer */ struct sys_timer; extern struct sys_timer at91rm9200_timer; extern struct sys_timer at91sam926x_timer; extern struct sys_timer at91x40_timer; /* Clocks */ extern int __init at91_clock_init(unsigned long main_clock); /* * function to specify the clock of the default console. As we do not * use the device/driver bus, the dev_name is not intialize. So we need * to link the clock to a specific con_id only "usart" */ extern void __init <API key>(int id); extern void __init <API key>(int id); extern void __init <API key>(int id); extern void __init <API key>(int id); extern void __init <API key>(int id); extern void __init <API key>(int id); extern void __init <API key>(int id); struct device; /* Power Management */ extern void at91_irq_suspend(void); extern void at91_irq_resume(void); /* reset */ extern void at91sam9_alt_reset(void); /* GPIO */ #define AT91RM9200_PQFP 3 /* AT91RM9200 PQFP package has 3 banks */ #define AT91RM9200_BGA 4 /* AT91RM9200 BGA package has 4 banks */ struct at91_gpio_bank { unsigned short id; /* peripheral ID */ unsigned long offset; /* offset from system peripheral base */ struct clk *clock; /* associated clock */ }; extern void __init at91_gpio_init(struct at91_gpio_bank *, int nr_banks); extern void __init at91_gpio_irq_setup(void); extern void (*at91_arch_reset)(void); extern int at91_extern_irq;
<!DOCTYPE html> <meta charset=utf-8> <title>invalid cite: scheme-ftp-no-slash</title> <ins cite="ftp:example.com/"></ins>
#ifndef __PERF_THREAD_MAP_H #define __PERF_THREAD_MAP_H #include <sys/types.h> #include <stdio.h> struct thread_map { int nr; pid_t map[]; }; struct thread_map *<API key>(void); struct thread_map *<API key>(pid_t pid); struct thread_map *<API key>(pid_t tid); struct thread_map *<API key>(uid_t uid); struct thread_map *thread_map__new(pid_t pid, pid_t tid, uid_t uid); struct thread_map *thread_map__new_str(const char *pid, const char *tid, uid_t uid); void thread_map__delete(struct thread_map *threads); size_t thread_map__fprintf(struct thread_map *threads, FILE *fp); static inline int thread_map__nr(struct thread_map *threads) { return threads ? threads->nr : 1; } #endif /* __PERF_THREAD_MAP_H */
#ifndef _WORKER__H_ #define _WORKER__H_ #include "metha.h" #include "crawler.h" #include "attr.h" #include "filetype.h" #include "urlengine.h" #include "io.h" #ifdef inl_ #undef inl_ #endif #define inl_ static inline enum { LM_WORKER_MSG_NONE, LM_WORKER_MSG_STOP, LM_WORKER_MSG_PAUSE, <API key>, }; enum { <API key>, <API key>, <API key>, }; /* used when workers share URL information */ typedef struct worker_info { crawler_t *cr; uehandle_t *ue_h; int depth; } worker_info_t; typedef struct worker { metha_t *m; crawler_t *crawler; uehandle_t *ue_h; iohandle_t *io_h; int argc; const char **argv; int state; int message; int redirects; /* statistics */ int num_discarded_urls; /* attribute list used for all urls matching a filetype */ attr_list_t attributes; pthread_t thr; pthread_mutex_t lock; /* lock access to 'state' and 'message' */ pthread_cond_t wakeup_cond; } worker_t; M_CODE lm_fork_worker(metha_t *m, crawler_t *c, uehandle_t *ue_h, int argc, const char **argv); void lm_worker_free(worker_t *w); M_CODE lm_worker_run_once(worker_t *w); M_CODE <API key>(worker_t *w, crawler_t *c); #endif
package ftp import ( "bytes" "io/ioutil" "net/textproto" "testing" "time" ) const ( testData = "Just some text" testDir = "mydir" ) func TestConnPASV(t *testing.T) { testConn(t, true) } func TestConnEPSV(t *testing.T) { testConn(t, false) } func testConn(t *testing.T, disableEPSV bool) { if testing.Short() { t.Skip("skipping test in short mode.") } c, err := DialTimeout("localhost:21", 5*time.Second) if err != nil { t.Fatal(err) } if disableEPSV { delete(c.features, "EPSV") c.disableEPSV = true } err = c.Login("anonymous", "anonymous") if err != nil { t.Fatal(err) } err = c.NoOp() if err != nil { t.Error(err) } err = c.ChangeDir("incoming") if err != nil { t.Error(err) } data := bytes.NewBufferString(testData) err = c.Stor("test", data) if err != nil { t.Error(err) } _, err = c.List(".") if err != nil { t.Error(err) } err = c.Rename("test", "tset") if err != nil { t.Error(err) } r, err := c.Retr("tset") if err != nil { t.Error(err) } else { buf, err := ioutil.ReadAll(r) if err != nil { t.Error(err) } if string(buf) != testData { t.Errorf("'%s'", buf) } r.Close() } r, err = c.RetrFrom("tset", 5) if err != nil { t.Error(err) } else { buf, err := ioutil.ReadAll(r) if err != nil { t.Error(err) } expected := testData[5:] if string(buf) != expected { t.Errorf("read %q, expected %q", buf, expected) } r.Close() } err = c.Delete("tset") if err != nil { t.Error(err) } err = c.MakeDir(testDir) if err != nil { t.Error(err) } err = c.ChangeDir(testDir) if err != nil { t.Error(err) } dir, err := c.CurrentDir() if err != nil { t.Error(err) } else { if dir != "/incoming/"+testDir { t.Error("Wrong dir: " + dir) } } err = c.ChangeDirToParent() if err != nil { t.Error(err) } entries, err := c.NameList("/") if err != nil { t.Error(err) } if len(entries) != 1 || entries[0] != "/incoming" { t.Errorf("Unexpected entries: %v", entries) } err = c.RemoveDir(testDir) if err != nil { t.Error(err) } err = c.Logout() if err != nil { if protoErr := err.(*textproto.Error); protoErr != nil { if protoErr.Code != <API key> { t.Error(err) } } else { t.Error(err) } } c.Quit() err = c.NoOp() if err == nil { t.Error("Expected error") } } func TestConnIPv6(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode.") } c, err := DialTimeout("[::1]:21", 5*time.Second) if err != nil { t.Fatal(err) } err = c.Login("anonymous", "anonymous") if err != nil { t.Fatal(err) } _, err = c.List(".") if err != nil { t.Error(err) } c.Quit() } // TestConnect tests the legacy Connect function func TestConnect(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode.") } c, err := Connect("localhost:21") if err != nil { t.Fatal(err) } c.Quit() } func TestTimeout(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode.") } c, err := DialTimeout("localhost:2121", 1*time.Second) if err == nil { t.Fatal("expected timeout, got nil error") c.Quit() } } func TestWrongLogin(t *testing.T) { if testing.Short() { t.Skip("skipping test in short mode.") } c, err := DialTimeout("localhost:21", 5*time.Second) if err != nil { t.Fatal(err) } defer c.Quit() err = c.Login("zoo2Shia", "fei5Yix9") if err == nil { t.Fatal("expected error, got nil") } }
const test = require('tape') const sinon = require('sinon') const helpers = require('../test/helpers') const bindFunc = helpers.bindFunc const MockCrock = require('../test/MockCrock') const curry = require('./curry') const compose = curry(require('./compose')) const isFunction = require('./isFunction') const isObject = require('./isObject') const isSameType = require('./isSameType') const isString = require('./isString') const unit = require('./_unit') const fl = require('./flNames') const identity = x => x const merge = fn => m => m.merge(fn) const constant = x => () => x const Pair = require('./Pair') test('Pair core', t => { const m = bindFunc(Pair) const x = Pair(0, 0) t.ok(isFunction(Pair), 'is a function') t.ok(isObject(x), 'returns an object') t.equals(Pair(0, 0).constructor, Pair, 'provides TypeRep on constructor') t.ok(isFunction(Pair.type), 'provides a type function') t.ok(isString(Pair['@@type']), 'provides a @@type string') const err = /Pair: Must provide a first and second value/ t.throws(m(), err, 'throws with no parameters') t.throws(m(1), err, 'throws with one parameter') t.end() }) test('Pair fantasy-land api', t => { const m = Pair(3, 3) t.ok(isFunction(m[fl.equals]), 'provides equals method on instance') t.ok(isFunction(m[fl.concat]), 'provides concat method on instance') t.ok(isFunction(m[fl.map]), 'provides map method on instance') t.ok(isFunction(m[fl.bimap]), 'provides bimap method on instance') t.ok(isFunction(m[fl.chain]), 'provides chain method on instance') t.ok(isFunction(m[fl.extend]), 'provides extend method on instance') t.end() }) test('Pair @@implements', t => { const f = Pair['@@implements'] t.equal(f('ap'), true, 'implements ap func') t.equal(f('bimap'), true, 'implements bimap func') t.equal(f('chain'), true, 'implements chain func') t.equal(f('concat'), true, 'implements concat func') t.equal(f('equals'), true, 'implements equals func') t.equal(f('extend'), true, 'implements extend func') t.equal(f('map'), true, 'implements map func') t.equal(f('traverse'), true, 'implements traverse func') t.end() }) test('Pair inspect', t => { const m = Pair(0, 'nice') t.ok(isFunction(m.inspect), 'provides an inpsect function') t.equal(m.inspect, m.toString, 'toString is the same function as inspect') t.equal(m.inspect(), 'Pair( 0, "nice" )', 'returns inspect string') t.end() }) test('Pair type', t => { const p = Pair(0, 0) t.ok(isFunction(p.type), 'is a function') t.equal(p.type, Pair.type, 'static and instance versions are the same') t.equal(p.type(), 'Pair', 'type returns Pair') t.end() }) test('Pair @@type', t => { const p = Pair(0, 0) t.equal(p['@@type'], Pair['@@type'], 'static and instance versions are the same') t.equal(p['@@type'], 'crocks/Pair@4', 'type returns crocks/Pair@4') t.end() }) test('Pair fst', t => { const p = Pair(34, false) t.ok(isFunction(p.fst), 'provides a fst function') t.same(p.fst(), 34, 'proivdes the first value') t.end() }) test('Pair snd', t => { const p = Pair([ 1, 2 ], { nice: true }) t.ok(isFunction(p.snd), 'provides a snd function') t.same(p.snd(), { nice: true }, 'proivdes the second value') t.end() }) test('Pair toArray', t => { const p = Pair(34, 'string') t.ok(isFunction(p.toArray), 'provides a toArray function') t.same(p.toArray(), [ 34, 'string' ], 'returns an array with the Pairs values') t.end() }) test('Pair merge', t => { const p = Pair(1, 20) t.ok(isFunction(p.merge), 'provides a merge function') const merge = bindFunc(p.merge) const err = /Pair\.merge: Argument must be a binary Function/ t.throws(merge(undefined), err, 'throws with undefined') t.throws(merge(null), err, 'throws with null') t.throws(merge(0), err, 'throws with falsey number') t.throws(merge(1), err, 'throws with truthy number') t.throws(merge(''), err, 'throws with falsey string') t.throws(merge('string'), err, 'throws with truthy string') t.throws(merge(false), err, 'throws with false') t.throws(merge(true), err, 'throws with true') t.throws(merge([]), err, 'throws with an array') t.throws(merge({}), err, 'throws with object') t.doesNotThrow(merge(unit), 'allows a function') const fn = sinon.spy((x, y) => x + y) const res = p.merge(fn) t.ok(fn.returned(res), 'provides the result of the passed in function') t.ok(fn.calledWith(p.fst(), p.snd()), 'pass the fst value to first argument and snd to second') t.end() }) test('Pair equals functionality', t => { const a = Pair(0, 45) const b = Pair(0, 45) const c = Pair(1, 'space kitten') const value = 'yep' const nonPair = { type: 'Pair...Not' } t.equal(a.equals(c), false, 'returns false when 2 Pairs are not equal') t.equal(a.equals(b), true, 'returns true when 2 Pairs are equal') t.equal(a.equals(value), false, 'returns false when passed a simple value') t.equal(a.equals(nonPair), false, 'returns false when passed a non-Pair') t.end() }) test('Pair equals properties (Setoid)', t => { const a = Pair(0, 'like') const b = Pair(0, 'like') const c = Pair(1, 'rainbow') const d = Pair(0, 'dislike') t.ok(isFunction(Pair(0, 0).equals), 'provides an equals function') t.equal(a.equals(a), true, 'reflexivity') t.equal(a.equals(b), b.equals(a), 'symmetry (equal)') t.equal(a.equals(c), c.equals(a), 'symmetry (!equal)') t.equal(a.equals(b) && b.equals(d), a.equals(d), 'transitivity') t.end() }) test('Pair concat errors', t => { const bad = bindFunc(Pair(0, 0).concat) const good = bindFunc(Pair([], 'string').concat) const noPair = /Pair\.concat: Argument must be a Pair/ t.throws(good([]), noPair, 'throws when Non-Pair passed') const err = /Pair\.concat: Both Pairs must contain Semigroups of the same type/ t.throws(bad(Pair([], [])), err, 'throws when left Pair does not contain Semigroups') t.throws(good(Pair(0, 0)), err, 'throws when right Pair does not contain Semigroups') t.end() }) test('Pair concat fantasy-land errors', t => { const bad = bindFunc(Pair(0, 0)[fl.concat]) const good = bindFunc(Pair([], 'string')[fl.concat]) const noPair = /Pair\.fantasy-land\/concat: Argument must be a Pair/ t.throws(good([]), noPair, 'throws when Non-Pair passed') const err = /Pair\.fantasy-land\/concat: Both Pairs must contain Semigroups of the same type/ t.throws(bad(Pair([], [])), err, 'throws when left Pair does not contain Semigroups') t.throws(good(Pair(0, 0)), err, 'throws when right Pair does not contain Semigroups') t.end() }) test('Pair concat functionality', t => { const m = Pair([ 1 ], '1') const n = Pair([ 2 ], '2') t.same(m.concat(n).fst(), [ 1, 2 ], 'combines the first Semigroups') t.same(m.concat(n).snd(), '12', 'combines the second Semigroups') t.end() }) test('Pair concat properties (Semigroup)', t => { const extract = merge((x, y) => [ x, y ]) const a = Pair([ 1 ], '1') const b = Pair([ 2 ], '2') const c = Pair([ 3 ], '3') const left = a.concat(b).concat(c) const right = a.concat(b.concat(c)) t.ok(isFunction(Pair(0, 0).concat), 'is a function') t.same(extract(left), extract(right), 'associativity') t.equal(a.concat(b).type(), a.type(), 'returns Semigroup of the same type') t.end() }) test('Pair swap', t => { const fn = bindFunc(Pair(0, 0).swap) const err = /Pair\.swap: Both arguments must be Functions/ t.throws(fn(null, unit), err, 'throws with null in left') t.throws(fn(undefined, unit), err, 'throws with undefined in left') t.throws(fn(0, unit), err, 'throws with falsey number in left') t.throws(fn(1, unit), err, 'throws with truthy number in left') t.throws(fn('', unit), err, 'throws with falsey string in left') t.throws(fn('string', unit), err, 'throws with truthy string in left') t.throws(fn(false, unit), err, 'throws with false in left') t.throws(fn(true, unit), err, 'throws with true in left') t.throws(fn({}, unit), err, 'throws with object in left') t.throws(fn([], unit), err, 'throws with array in left') t.throws(fn(unit, null), err, 'throws with null in right') t.throws(fn(unit, undefined), err, 'throws with undefined in right') t.throws(fn(unit, 0), err, 'throws with falsey number in right') t.throws(fn(unit, 1), err, 'throws with truthy number in right') t.throws(fn(unit, ''), err, 'throws with falsey string in right') t.throws(fn(unit, false), err, 'throws with false in right') t.throws(fn(unit, true), err, 'throws with true in right') t.throws(fn(unit, {}), err, 'throws with object in right') t.throws(fn(unit, []), err, 'throws with array in right') const f = x => `was ${x}` const l = Pair('left', 'right').swap(f, f) t.ok(l.equals(Pair('was right', 'was left')),'returns a pair with swapped, mapped values') t.end() }) test('Pair map errors', t => { const map = bindFunc(Pair(0, 'gibbles').map) const err = /Pair\.map: Argument must be a Function/ t.throws(map(undefined), err, 'throws with undefined') t.throws(map(null), err, 'throws with null') t.throws(map(0), err, 'throws with falsey number') t.throws(map(1), err, 'throws with truthy number') t.throws(map(''), err, 'throws with falsey string') t.throws(map('string'), err, 'throws with truthy string') t.throws(map(false), err, 'throws with false') t.throws(map(true), err, 'throws with true') t.throws(map([]), err, 'throws with an array') t.throws(map({}), err, 'throws with object') t.doesNotThrow(map(unit), 'allows a function') t.end() }) test('Pair map fantasy-land errors', t => { const map = bindFunc(Pair(0, 'gibbles')[fl.map]) const err = /Pair\.fantasy-land\/map: Argument must be a Function/ t.throws(map(undefined), err, 'throws with undefined') t.throws(map(null), err, 'throws with null') t.throws(map(0), err, 'throws with falsey number') t.throws(map(1), err, 'throws with truthy number') t.throws(map(''), err, 'throws with falsey string') t.throws(map('string'), err, 'throws with truthy string') t.throws(map(false), err, 'throws with false') t.throws(map(true), err, 'throws with true') t.throws(map([]), err, 'throws with an array') t.throws(map({}), err, 'throws with object') t.doesNotThrow(map(unit), 'allows a function') t.end() }) test('Pair map functionality', t => { const m = Pair(5, 45) const n = m.map(x => x + 5) t.equal(m.map(identity).type(), 'Pair', 'returns a Pair') t.equal(n.fst(), 5, 'Does not modify first value') t.equal(n.snd(), 50, 'applies function to second value') t.end() }) test('Pair map properties (Functor)', t => { const extract = merge((x, y) => [ x, y ]) const f = x => x + 2 const g = x => x * 2 t.ok(isFunction(Pair(0, 0).map), 'provides a map function') t.same(extract(Pair(0, 45).map(identity)), [ 0, 45 ], 'identity') t.same( extract(Pair(50, 22).map(x => f(g(x)))), extract(Pair(50, 22).map(g).map(f)), 'composition' ) t.end() }) test('Pair bimap errors', t => { const bimap = bindFunc(Pair(0, 'gibbles').bimap) const err = /Pair\.bimap: Both arguments must be Functions/ t.throws(bimap(undefined, unit), err, 'throws with undefined in first argument') t.throws(bimap(null, unit), err, 'throws with null in first argument') t.throws(bimap(0, unit), err, 'throws with falsey number in first argument') t.throws(bimap(1, unit), err, 'throws with truthy number in first argument') t.throws(bimap('', unit), err, 'throws with falsey string in first argument') t.throws(bimap('string', unit), err, 'throws with truthy string in first argument') t.throws(bimap(false, unit), err, 'throws with false in first argument') t.throws(bimap(true, unit), err, 'throws with true in first argument') t.throws(bimap([], unit), err, 'throws with an array in first argument') t.throws(bimap({}, unit), err, 'throws with object in first argument') t.throws(bimap(unit, undefined), err, 'throws with undefined in second argument') t.throws(bimap(unit, null), err, 'throws with null in second argument') t.throws(bimap(unit, 0), err, 'throws with falsey number in second argument') t.throws(bimap(unit, 1), err, 'throws with truthy number in second argument') t.throws(bimap(unit, ''), err, 'throws with falsey string in second argument') t.throws(bimap(unit, 'string'), err, 'throws with truthy string in second argument') t.throws(bimap(unit, false), err, 'throws with false in second argument') t.throws(bimap(unit, true), err, 'throws with true in second argument') t.throws(bimap(unit, []), err, 'throws with an array in second argument') t.throws(bimap(unit, {}), err, 'throws with object in second argument') t.doesNotThrow(bimap(unit, unit), 'allows functions') t.end() }) test('Pair bimap fantasy-land errors', t => { const bimap = bindFunc(Pair(0, 'gibbles')[fl.bimap]) const err = /Pair\.fantasy-land\/bimap: Both arguments must be Functions/ t.throws(bimap(undefined, unit), err, 'throws with undefined in first argument') t.throws(bimap(null, unit), err, 'throws with null in first argument') t.throws(bimap(0, unit), err, 'throws with falsey number in first argument') t.throws(bimap(1, unit), err, 'throws with truthy number in first argument') t.throws(bimap('', unit), err, 'throws with falsey string in first argument') t.throws(bimap('string', unit), err, 'throws with truthy string in first argument') t.throws(bimap(false, unit), err, 'throws with false in first argument') t.throws(bimap(true, unit), err, 'throws with true in first argument') t.throws(bimap([], unit), err, 'throws with an array in first argument') t.throws(bimap({}, unit), err, 'throws with object in first argument') t.throws(bimap(unit, undefined), err, 'throws with undefined in second argument') t.throws(bimap(unit, null), err, 'throws with null in second argument') t.throws(bimap(unit, 0), err, 'throws with falsey number in second argument') t.throws(bimap(unit, 1), err, 'throws with truthy number in second argument') t.throws(bimap(unit, ''), err, 'throws with falsey string in second argument') t.throws(bimap(unit, 'string'), err, 'throws with truthy string in second argument') t.throws(bimap(unit, false), err, 'throws with false in second argument') t.throws(bimap(unit, true), err, 'throws with true in second argument') t.throws(bimap(unit, []), err, 'throws with an array in second argument') t.throws(bimap(unit, {}), err, 'throws with object in second argument') t.doesNotThrow(bimap(unit, unit), 'allows functions') t.end() }) test('Pair bimap functionality', t => { const add5 = x => x + 5 const add7 = x => x + 7 const m = Pair(5, 48) const n = m.bimap(add5, add7) t.equal(m.bimap(identity, identity).type(), 'Pair', 'returns a Pair') t.equal(n.fst(), 10, 'applies the first function to the first value') t.equal(n.snd(), 55, 'applies the second function to second value') t.end() }) test('Pair bimap properties (Bifunctor)', t => { const extract = merge((x, y) => [ x, y ]) const f1 = x => x + 2 const f2 = x => x + 5 const g1 = x => x * 2 const g2 = x => x * 5 t.ok(isFunction(Pair(0, 0).bimap), 'provides a bimap function') t.same(extract(Pair(0, 45).bimap(identity, identity)), [ 0, 45 ], 'identity') t.same( extract(Pair(50, 22).bimap(x => f1(g1(x)), x => f2(g2(x)))), extract(Pair(50, 22).bimap(g1, g2).bimap(f1, f2)), 'composition' ) t.end() }) test('Pair ap errors', t => { const m = { type: () => 'Pair...Not' } const ap = bindFunc((l, r) => l.ap(r)) const err = /Pair\.ap: Argument must be a Pair/ t.throws(ap(Pair([], unit), undefined), err, 'throws with undefined') t.throws(ap(Pair([], unit), null), err, 'throws with null') t.throws(ap(Pair([], unit), 0), err, 'throws with falsey number') t.throws(ap(Pair([], unit), 1), err, 'throws with truthy number') t.throws(ap(Pair([], unit), ''), err, 'throws with falsey string') t.throws(ap(Pair([], unit), 'string'), err, 'throws with truthy string') t.throws(ap(Pair([], unit), false), err, 'throws with false') t.throws(ap(Pair([], unit), true), err, 'throws with true') t.throws(ap(Pair([], unit), []), err, 'throws with an array') t.throws(ap(Pair([], unit), {}), err, 'throws with an object') t.throws(ap(Pair([], unit), m), err, 'throws when non-Pair') const noSemi = /Pair\.ap: First values must be Semigroups of the same type/ t.throws(ap(Pair(undefined, unit), Pair([], true)), noSemi, 'throws if wrapped first value is undefined') t.throws(ap(Pair(null, unit), Pair([], true)), noSemi, 'throws if wrapped first value is null') t.throws(ap(Pair(0, unit), Pair([], true)), noSemi, 'throws if wrapped first value is a falsey number') t.throws(ap(Pair(1, unit), Pair([], true)), noSemi, 'throws if wrapped first value is a truthy number') t.throws(ap(Pair(false, unit), Pair([], true)), noSemi, 'throws if wrapped first value is false') t.throws(ap(Pair(true, unit), Pair([], true)), noSemi, 'throws if wrapped first value is true') t.throws(ap(Pair({}, unit), Pair([], true)), noSemi, 'throws if wrapped first value is an object') t.throws(ap(Pair(unit, unit), Pair([], true)), noSemi, 'throws if wrapped first value is a function') t.throws(ap(Pair([], unit), Pair(undefined, 0)), noSemi, 'throws when first of passed value is undefined') t.throws(ap(Pair([], unit), Pair(null, 0)), noSemi, 'throws when first of passed value is null') t.throws(ap(Pair([], unit), Pair(0, 0)), noSemi, 'throws when first of passed value is a falsey number') t.throws(ap(Pair([], unit), Pair(1, 0)), noSemi, 'throws when first of passed value is a truthy number') t.throws(ap(Pair([], unit), Pair(false, 0)), noSemi, 'throws when first of passed value is false') t.throws(ap(Pair([], unit), Pair(true, 0)), noSemi, 'throws when first of passed value is true') t.throws(ap(Pair([], unit), Pair({}, 0)), noSemi, 'throws when first of passed value is an object') const noFunc = /Pair\.ap: Second value must be a Function/ t.throws(ap(Pair([], undefined), Pair([], 0)), noFunc, 'throws when second wrapped value is undefined') t.throws(ap(Pair([], null), Pair([], 0)), noFunc, 'throws when second wrapped value is null') t.throws(ap(Pair([], 0), Pair([], 0)), noFunc, 'throws when second wrapped value is a falsey number') t.throws(ap(Pair([], 1), Pair([], 0)), noFunc, 'throws when second wrapped value is a truthy number') t.throws(ap(Pair([], ''), Pair([], 0)), noFunc, 'throws when second wrapped value is a falsey string') t.throws(ap(Pair([], 'string'), Pair([], 0)), noFunc, 'throws when second wrapped value is a truthy string') t.throws(ap(Pair([], false), Pair([], 0)), noFunc, 'throws when second wrapped value is false') t.throws(ap(Pair([], true), Pair([], 0)), noFunc, 'throws when second wrapped value is true') t.throws(ap(Pair([], []), Pair([], 0)), noFunc, 'throws when second wrapped value is an array') t.throws(ap(Pair([], {}), Pair([], 0)), noFunc, 'throws when second wrapped value is an object') t.doesNotThrow(ap(Pair([], identity), Pair([], 22)), 'allows a Pair') t.end() }) test('Pair ap properties (Apply)', t => { const extract = merge((x, y) => [ x, y ]) const m = Pair([ 'm' ], identity) const a = m.map(compose).ap(m).ap(m) const b = m.ap(m.ap(m)) t.ok(isFunction(Pair(0, 0).ap), 'provides an ap function') t.ok(isFunction(Pair(0, 0).map), 'implements the Functor spec') t.same( extract(a.ap(Pair([ 'n' ], 3))), extract(b.ap(Pair([ 'n' ], 3))), 'composition' ) t.end() }) test('Pair chain errors', t => { const badChain = bindFunc(Pair(0, 0).chain) const chain = bindFunc(Pair([], 0).chain) const badFn = () => Pair(0, 0) const fn = () => Pair([], 0) const noSemi = /Pair\.chain: First values must be Semigroups of the same type/ t.throws(badChain(unit), noSemi, 'throws if wrapped first value is not a Semigroup') t.throws(chain(badFn), noSemi, 'throws if monadic function returns a Pair with a non-Semigroup as first value') const noPair = /Pair\.chain: Function must return a Pair/ t.throws(chain(unit), noPair, 'throws with non-Pair returning function') const err = /Pair\.chain: Argument must be a Function/ t.throws(chain(undefined), err, 'throws with undefined') t.throws(chain(null), err, 'throws with null') t.throws(chain(0), err, 'throws with falsey number') t.throws(chain(1), err, 'throws with truthy number') t.throws(chain(''), err, 'throws with falsey string') t.throws(chain('string'), err, 'throws with truthy string') t.throws(chain(false), err, 'throws with false') t.throws(chain(true), err, 'throws with true') t.throws(chain([]), err, 'throws with an array') t.throws(chain({}), err, 'throws with an object') t.doesNotThrow(chain(fn), 'allows Pair returning function') t.end() }) test('Pair chain fantasy-land errors', t => { const badChain = bindFunc(Pair(0, 0)[fl.chain]) const chain = bindFunc(Pair([], 0)[fl.chain]) const badFn = () => Pair(0, 0) const fn = () => Pair([], 0) const noSemi = /Pair\.fantasy-land\/chain: First values must be Semigroups of the same type/ t.throws(badChain(unit), noSemi, 'throws if wrapped first value is not a Semigroup') t.throws(chain(badFn), noSemi, 'throws if monadic function returns a Pair with a non-Semigroup as first value') const noPair = /Pair\.fantasy-land\/chain: Function must return a Pair/ t.throws(chain(unit), noPair, 'throws with non-Pair returning function') const err = /Pair\.fantasy-land\/chain: Argument must be a Function/ t.throws(chain(undefined), err, 'throws with undefined') t.throws(chain(null), err, 'throws with null') t.throws(chain(0), err, 'throws with falsey number') t.throws(chain(1), err, 'throws with truthy number') t.throws(chain(''), err, 'throws with falsey string') t.throws(chain('string'), err, 'throws with truthy string') t.throws(chain(false), err, 'throws with false') t.throws(chain(true), err, 'throws with true') t.throws(chain([]), err, 'throws with an array') t.throws(chain({}), err, 'throws with an object') t.doesNotThrow(chain(fn), 'allows Pair returning function') t.end() }) test('Pair chain properties (Chain)', t => { const extract = merge((x, y) => [ x, y ]) t.ok(isFunction(Pair([], 0).chain), 'provides a chain function') t.ok(isFunction(Pair([], 0).ap), 'implements the Apply spec') const f = x => Pair([ 'f' ], x + 2) const g = x => Pair([ 'g' ], x + 10) const a = x => Pair([ 'a' ], x).chain(f).chain(g) const b = x => Pair([ 'a' ], x).chain(y => f(y).chain(g)) t.same(extract(a(10)), extract(b(10)), 'assosiativity') t.end() }) test('Pair sequence errors', t => { const seq = bindFunc(Pair([], MockCrock({ something: true })).sequence) const seqBad = bindFunc(Pair([], '').sequence) const err = /Pair\.sequence: Argument must be an Applicative TypeRep or a Function that returns an Apply/ t.throws(seq(undefined), err, 'throws with undefined') t.throws(seq(null), err, 'throws with null') t.throws(seq(0), err, 'throws falsey with number') t.throws(seq(1), err, 'throws truthy with number') t.throws(seq(''), err, 'throws falsey with string') t.throws(seq('string'), err, 'throws with truthy string') t.throws(seq(false), err, 'throws with false') t.throws(seq(true), err, 'throws with true') t.throws(seq([]), err, 'throws with an array') t.throws(seq({}), err, 'throws with an object') const noAp = /Pair\.sequence: Must wrap an Apply in the second/ t.throws(seqBad(unit), noAp, 'wrapping non-Apply throws') t.end() }) test('Pair sequence with Apply function', t => { const x = 'nice-show' const fn = x => MockCrock(x) const s = Pair([], MockCrock(x)).sequence(fn) t.ok(isSameType(MockCrock, s), 'Provides an outer type of MockCrock') t.ok(isSameType(Pair, s.valueOf()), 'Provides an inner type of Pair') t.same(s.valueOf().snd(), x, 'Pair contains original inner value') const ar = x => [ x ] const arS = Pair([], [ x ]).sequence(ar) t.ok(isSameType(Array, arS), 'Provides an outer type of Array') t.ok(isSameType(Pair, arS[0]), 'Provides an inner type of Pair') t.same(arS[0].snd(), x, 'Pair contains original inner value') t.end() }) test('Pair sequence with Applicative TypeRep', t => { const x = 'nice-show' const s = Pair([], MockCrock(x)).sequence(MockCrock) t.ok(isSameType(MockCrock, s), 'Provides an outer type of MockCrock') t.ok(isSameType(Pair, s.valueOf()), 'Provides an inner type of Pair') t.same(s.valueOf().snd(), x, 'Pair contains original inner value') const arS = Pair([], [ x ]).sequence(Array) t.ok(isSameType(Array, arS), 'Provides an outer type of Array') t.ok(isSameType(Pair, arS[0]), 'Provides an inner type of Pair') t.same(arS[0].snd(), x, 'Pair contains original inner value') t.end() }) test('Pair traverse errors', t => { const traverse = bindFunc(Pair([], 0).traverse) const err = /Pair\.traverse: First argument must be an Applicative TypeRep or a Function that returns an Apply/ t.throws(traverse(undefined, MockCrock), err, 'throws with undefined in first argument') t.throws(traverse(null, MockCrock), err, 'throws with null in first argument') t.throws(traverse(0, MockCrock), err, 'throws falsey with number in first argument') t.throws(traverse(1, MockCrock), err, 'throws truthy with number in first argument') t.throws(traverse('', MockCrock), err, 'throws falsey with string in first argument') t.throws(traverse('string', MockCrock), err, 'throws with truthy string in first argument') t.throws(traverse(false, MockCrock), err, 'throws with false in first argument') t.throws(traverse(true, MockCrock), err, 'throws with true in first argument') t.throws(traverse([], MockCrock), err, 'throws with an array in first argument') t.throws(traverse({}, MockCrock), err, 'throws with an object in first argument') const last = /Pair\.traverse: Second argument must be a Function that returns an Apply/ t.throws(traverse(MockCrock, undefined), last, 'throws with undefined in second argument') t.throws(traverse(MockCrock, null), last, 'throws with null in second argument') t.throws(traverse(MockCrock, 0), last, 'throws falsey with number in second argument') t.throws(traverse(MockCrock, 1), last, 'throws truthy with number in second argument') t.throws(traverse(MockCrock, ''), last, 'throws falsey with string in second argument') t.throws(traverse(MockCrock, 'string'), last, 'throws with truthy string in second argument') t.throws(traverse(MockCrock, false), last, 'throws with false in second argument') t.throws(traverse(MockCrock, true), last, 'throws with true in second argument') t.throws(traverse(MockCrock, []), last, 'throws with an array in second argument') t.throws(traverse(MockCrock, {}), last, 'throws with an object in second argument') const noAp = /Pair\.traverse: Both functions must return an Apply of the same type/ t.throws(traverse(unit, unit), noAp, 'throws when first function does not return an Applicative') t.end() }) test('Pair traverse with Apply function', t => { const x = 'green' const res = 'result' const f = x => MockCrock(x) const fn = m => constant(m(res)) const p = Pair([], x).traverse(f, fn(MockCrock)) t.ok(isSameType(MockCrock, p), 'Provides an outer type of MockCrock') t.ok(isSameType(Pair, p.valueOf()), 'Provides an inner type of Pair') t.equal(p.valueOf().snd(), res, 'Pair contains transformed value') const ar = x => [ x ] const arS = Pair([], x).traverse(ar, fn(ar)) t.ok(isSameType(Array, arS), 'Provides an outer type of Array') t.ok(isSameType(Pair, arS[0]), 'Provides an inner type of Pair') t.same(arS[0].snd(), res, 'Pair contains transformed value') t.end() }) test('Pair traverse with Applicative TypeRep', t => { const x = 'blue' const res = 'result' const fn = m => constant(m(res)) const p = Pair([], x).traverse(MockCrock, fn(MockCrock)) t.ok(isSameType(MockCrock, p), 'Provides an outer type of MockCrock') t.ok(isSameType(Pair, p.valueOf()), 'Provides an inner type of Pair') t.equal(p.valueOf().snd(), res, 'Pair contains transformed value') const ar = x => [ x ] const arS = Pair([], x).traverse(Array, fn(ar)) t.ok(isSameType(Array, arS), 'Provides an outer type of Array') t.ok(isSameType(Pair, arS[0]), 'Provides an inner type of Pair') t.same(arS[0].snd(), res, 'Pair contains transformed value') t.end() }) test('Pair extend errors', t => { const extend = bindFunc(Pair(0, 'gibbles').extend) const err = /Pair\.extend: Argument must be a Function/ t.throws(extend(undefined), err, 'throws with undefined') t.throws(extend(null), err, 'throws with null') t.throws(extend(0), err, 'throws with falsey number') t.throws(extend(1), err, 'throws with truthy number') t.throws(extend(''), err, 'throws with falsey string') t.throws(extend('string'), err, 'throws with truthy string') t.throws(extend(false), err, 'throws with false') t.throws(extend(true), err, 'throws with true') t.throws(extend([]), err, 'throws with an array') t.throws(extend({}), err, 'throws with object') t.doesNotThrow(extend(unit), 'allows a function') t.end() }) test('Pair extend fantasy-land errors', t => { const extend = bindFunc(Pair(0, 'gibbles')[fl.extend]) const err = /Pair.fantasy-land\/extend: Argument must be a Function/ t.throws(extend(undefined), err, 'throws with undefined') t.throws(extend(null), err, 'throws with null') t.throws(extend(0), err, 'throws with falsey number') t.throws(extend(1), err, 'throws with truthy number') t.throws(extend(''), err, 'throws with falsey string') t.throws(extend('string'), err, 'throws with truthy string') t.throws(extend(false), err, 'throws with false') t.throws(extend(true), err, 'throws with true') t.throws(extend([]), err, 'throws with an array') t.throws(extend({}), err, 'throws with object') t.doesNotThrow(extend(unit), 'allows a function') t.end() }) test('Pair extend properties (Extend)', t => { const m = Pair(0, 23) const f = p => p.snd() + 30 const g = p => p.snd() * 3 const left = m.extend(g).extend(f) const right = m.extend(w => f(w.extend(g))) t.ok(left.equals(right), 'composition') t.end() })
using System; using Microsoft.Extensions.CommandLineUtils; using PocketBookSync.Commands; namespace PocketBookSync { public class Program { public static int Main(string[] args) { var <API key> = new <API key>(false); var addCommand = new AddCommand(); var deleteCommand = new <API key>(); var listCommand = new ListAccountsCommand(); var syncAllCommand = new SyncAllCommand(); var syncAccountCommand = new SyncAccountCommand(); var configCommand = new ConfigCommand(); addCommand.Build(<API key>); deleteCommand.Build(<API key>); listCommand.Build(<API key>); syncAllCommand.Build(<API key>); syncAccountCommand.Build(<API key>); configCommand.Build(<API key>); <API key>.HelpOption("-? | -h | --help"); <API key>.OnExecute(() => { <API key>.ShowHelp(); return 0; }); try { try { <API key>.Execute(args); } catch (AggregateException ae) { throw ae.Flatten().InnerException; } } catch (<API key> ex) { Console.WriteLine(ex.Message); return 1; } catch (AppException ex) { Console.WriteLine(ex.Message); return 1; } catch (Exception ex) { Console.WriteLine($"Unhandled exception: {ex.Message}"); return 1; } return 0; } } }
-- | A primitive expression is an expression where the non-leaves are -- primitive operators. Our representation does not guarantee that -- the expression is type-correct. module Futhark.Analysis.PrimExp ( PrimExp (..) , evalPrimExp , primExpType , coerceIntPrimExp , module Futhark.Representation.Primitive ) where import Control.Applicative import Data.Foldable import Data.Traversable import Prelude import Futhark.Representation.AST.Attributes.Names import Futhark.Representation.Primitive import Futhark.Util.IntegralExp import Futhark.Util.Pretty -- | A primitive expression parametrised over the representation of free variables. data PrimExp v = LeafExp v PrimType | ValueExp PrimValue | BinOpExp BinOp (PrimExp v) (PrimExp v) | CmpOpExp CmpOp (PrimExp v) (PrimExp v) | UnOpExp UnOp (PrimExp v) | ConvOpExp ConvOp (PrimExp v) deriving (Ord, Show) -- The Eq instance upcoerces all integer constants to their largest -- type before comparing for equality. This is technically not a good -- idea, but solves annoying problems related to the Num instance -- always producing Int64s. instance Eq v => Eq (PrimExp v) where LeafExp x xt == LeafExp y yt = x == y && xt == yt ValueExp (IntValue x) == ValueExp (IntValue y) = intToInt64 x == intToInt64 y BinOpExp xop x1 x2 == BinOpExp yop y1 y2 = xop == yop && x1 == y1 && x2 == y2 CmpOpExp xop x1 x2 == CmpOpExp yop y1 y2 = xop == yop && x1 == y1 && x2 == y2 UnOpExp xop x == UnOpExp yop y = xop == yop && x == y ConvOpExp xop x == ConvOpExp yop y = xop == yop && x == y _ == _ = False instance Functor PrimExp where fmap = fmapDefault instance Foldable PrimExp where foldMap = foldMapDefault instance Traversable PrimExp where traverse f (LeafExp v t) = LeafExp <$> f v <*> pure t traverse _ (ValueExp v) = pure $ ValueExp v traverse f (BinOpExp op x y) = BinOpExp op <$> traverse f x <*> traverse f y traverse f (CmpOpExp op x y) = CmpOpExp op <$> traverse f x <*> traverse f y traverse f (ConvOpExp op x) = ConvOpExp op <$> traverse f x traverse f (UnOpExp op x) = UnOpExp op <$> traverse f x instance FreeIn v => FreeIn (PrimExp v) where freeIn = foldMap freeIn -- The Num instance performs a little bit of magic: whenever an -- expression and a constant is combined with a binary operator, the -- type of the constant may be changed to be the type of the -- expression, if they are not already the same. This permits us to -- write e.g. @x * 4@, where @x@ is an arbitrary PrimExp, and have the -- @4@ converted to the proper primitive type. We also support -- converting integers to floating point values, but not the other way -- around. All numeric instances assume unsigned integers for such -- conversions. -- We also perform simple constant folding, in particular to reduce -- expressions to constants so that the above works. However, it is -- still a bit of a hack. instance Pretty v => Num (PrimExp v) where x + y | zeroIshExp x = y | zeroIshExp y = x | IntType t <- primExpType x, Just z <- constFold (doBinOp $ Add t) x y = z | FloatType t <- primExpType x, Just z <- constFold (doBinOp $ FAdd t) x y = z | Just z <- msum [asIntOp Add x y, asFloatOp FAdd x y] = z | otherwise = numBad "+" (x,y) x - y | zeroIshExp y = x | IntType t <- primExpType x, Just z <- constFold (doBinOp $ Sub t) x y = z | FloatType t <- primExpType x, Just z <- constFold (doBinOp $ FSub t) x y = z | Just z <- msum [asIntOp Sub x y, asFloatOp FSub x y] = z | otherwise = numBad "-" (x,y) x * y | zeroIshExp x = x | zeroIshExp y = y | oneIshExp x = y | oneIshExp y = x | IntType t <- primExpType x, Just z <- constFold (doBinOp $ Mul t) x y = z | FloatType t <- primExpType x, Just z <- constFold (doBinOp $ FMul t) x y = z | Just z <- msum [asIntOp Mul x y, asFloatOp FMul x y] = z | otherwise = numBad "*" (x,y) abs x | IntType t <- primExpType x = UnOpExp (Abs t) x | FloatType t <- primExpType x = UnOpExp (FAbs t) x | otherwise = numBad "abs" x signum x | IntType t <- primExpType x = UnOpExp (SSignum t) x | otherwise = numBad "signum" x fromInteger = ValueExp . IntValue . Int64Value . fromInteger instance Pretty v => IntegralExp (PrimExp v) where x `div` y | oneIshExp y = x | Just z <- msum [asIntOp SDiv x y, asFloatOp FDiv x y] = z | otherwise = numBad "div" (x,y) x `mod` y | Just z <- msum [asIntOp SMod x y] = z | otherwise = numBad "mod" (x,y) x `quot` y | oneIshExp y = x | Just z <- msum [asIntOp SQuot x y] = z | otherwise = numBad "quot" (x,y) x `rem` y | Just z <- msum [asIntOp SRem x y] = z | otherwise = numBad "rem" (x,y) asIntOp :: (IntType -> BinOp) -> PrimExp v -> PrimExp v -> Maybe (PrimExp v) asIntOp f x y | IntType t <- primExpType x, Just y' <- asIntExp t y = Just $ BinOpExp (f t) x y' | IntType t <- primExpType y, Just x' <- asIntExp t x = Just $ BinOpExp (f t) x' y | otherwise = Nothing asIntExp :: IntType -> PrimExp v -> Maybe (PrimExp v) asIntExp t e | primExpType e == IntType t = Just e asIntExp t (ValueExp (IntValue v)) = Just $ ValueExp $ IntValue $ doSExt v t asIntExp _ _ = Nothing asFloatOp :: (FloatType -> BinOp) -> PrimExp v -> PrimExp v -> Maybe (PrimExp v) asFloatOp f x y | FloatType t <- primExpType x, Just y' <- asFloatExp t y = Just $ BinOpExp (f t) x y' | FloatType t <- primExpType y, Just x' <- asFloatExp t x = Just $ BinOpExp (f t) x' y | otherwise = Nothing asFloatExp :: FloatType -> PrimExp v -> Maybe (PrimExp v) asFloatExp t e | primExpType e == FloatType t = Just e asFloatExp t (ValueExp (FloatValue v)) = Just $ ValueExp $ FloatValue $ doFPConv v t asFloatExp t (ValueExp (IntValue v)) = Just $ ValueExp $ FloatValue $ doSIToFP v t asFloatExp _ _ = Nothing constFold :: (PrimValue -> PrimValue -> Maybe PrimValue) -> PrimExp v -> PrimExp v -> Maybe (PrimExp v) constFold f x y = do x' <- valueExp x y' <- valueExp y ValueExp <$> f x' y' numBad :: Pretty a => String -> a -> b numBad s x = error $ "Invalid argument to PrimExp method " ++ s ++ ": " ++ pretty x -- | Evaluate a 'PrimExp' in the given monad. Invokes 'fail' on type -- errors. evalPrimExp :: (Pretty v, Monad m) => (v -> m PrimValue) -> PrimExp v -> m PrimValue evalPrimExp f (LeafExp v _) = f v evalPrimExp _ (ValueExp v) = return v evalPrimExp f (BinOpExp op x y) = do x' <- evalPrimExp f x y' <- evalPrimExp f y maybe (evalBad op (x,y)) return $ doBinOp op x' y' evalPrimExp f (CmpOpExp op x y) = do x' <- evalPrimExp f x y' <- evalPrimExp f y maybe (evalBad op (x,y)) (return . BoolValue) $ doCmpOp op x' y' evalPrimExp f (UnOpExp op x) = do x' <- evalPrimExp f x maybe (evalBad op x) return $ doUnOp op x' evalPrimExp f (ConvOpExp op x) = do x' <- evalPrimExp f x maybe (evalBad op x) return $ doConvOp op x' evalBad :: (Pretty a, Pretty b, Monad m) => a -> b -> m c evalBad op arg = fail $ "evalPrimExp: Type error when applying " ++ pretty op ++ " to " ++ pretty arg -- | The type of values returned by a 'PrimExp'. This function -- returning does not imply that the 'PrimExp' is type-correct. primExpType :: PrimExp v -> PrimType primExpType (LeafExp _ t) = t primExpType (ValueExp v) = primValueType v primExpType (BinOpExp op _ _) = binOpType op primExpType CmpOpExp{} = Bool primExpType (UnOpExp op _) = unOpType op primExpType (ConvOpExp op _) = snd $ convOpType op -- | Is the expression a constant zero of some sort? zeroIshExp :: PrimExp v -> Bool zeroIshExp (ValueExp v) = zeroIsh v zeroIshExp _ = False -- | Is the expression a constant one of some sort? oneIshExp :: PrimExp v -> Bool oneIshExp (ValueExp v) = oneIsh v oneIshExp _ = False -- | Is the expression a constant value? valueExp :: PrimExp v -> Maybe PrimValue valueExp (ValueExp v) = Just v valueExp _ = Nothing -- | If the given 'PrimExp' is a constant of the wrong integer type, -- coerce it to the given integer type. This is a workaround for an -- issue in the 'Num' instance. coerceIntPrimExp :: IntType -> PrimExp v -> PrimExp v coerceIntPrimExp t (ValueExp (IntValue v)) = ValueExp $ IntValue $ doSExt v t coerceIntPrimExp _ e = e -- Prettyprinting instances instance Pretty v => Pretty (PrimExp v) where ppr (LeafExp v _) = ppr v ppr (ValueExp v) = ppr v ppr (BinOpExp op x y) = ppr op <+> parens (ppr x) <+> parens (ppr y) ppr (CmpOpExp op x y) = ppr op <+> parens (ppr x) <+> parens (ppr y) ppr (ConvOpExp op x) = ppr op <+> parens (ppr x) ppr (UnOpExp op x) = ppr op <+> parens (ppr x)
'use strict'; var supertest = require('supertest'); var _app = require('../server/express_app'); var app = supertest(_app); var assert = require('assert-diff'); var ws = require('ws'); var route = new (require('events').EventEmitter); var fixtures = require('./fixtures')._payments; var RL = require('ripple-lib'); var remote = require('../server/api').remote; var testutils = { }; // check if obj has keys testutils.hasKeys = function(obj, keys) { var list = Object.keys(obj); var hasAllKeys = true; var missing = {}; keys.forEach(function(key) { if (list.indexOf(key) === -1) { hasAllKeys = false; missing[key] = true; } }); return {hasAllKeys: hasAllKeys, missing: missing}; }; // used to mark the orderings and count of incoming rippled function OrderList(list) { // list = [{command:<command>}, ... ] var _list = list; var idx = 0; this.isMock = true; this.create = function(__list) { _list = __list; idx = 0; }; this.mark = function(command) { if ((_list[idx]) && (_list[idx].command === command)) { idx++; } else { throw new Error('out of order rippled command', command); } }; this.test = function() { if (this.isMock) { return idx === _list.length; } return true; }; this.reset = function() { _list = []; idx = 0; }; } var orderlist = new OrderList(); /** * Payment tests * This file, _payment-test.js describes tests in a different format from * other other tests * * If you consider making changes to a test in this file, consider moving the * tests over to payment-test.js and adopting the structure we have for the * other tests * * New tests should not be added in the structure laid out here, but in the * structure we use in the other test files. */ suite('payments', function() { var rippled; suiteSetup(function(done) { var self = this; self.remote = remote; rippled = new ws.Server({port: 5150}); route.on('ping', fixtures.ping); route.on('subscribe', fixtures.subscribe); route.on('response', fixtures.response); route.on('server_info', fixtures.server_info); route.on('account_info', fixtures.account_info); route.on('ripple_path_find', fixtures.ripple_path_find); route.on('account_lines', fixtures.account_lines); route.on('submit', fixtures.submit); route.on('tx', fixtures.tx); rippled.on('connection', fixtures.connection.bind({route: route})); self.remote.once('connect', function() { self.remote.getServer().once('ledger_closed', function() { // proceed to the tests, api is ready done(); }); self.remote.getServer().emit('message', fixtures.sample_ledger); }); self.remote._servers = [ ]; self.remote.addServer('ws://localhost:5150'); self.remote.connect(); }); suiteTeardown(function(done) { var self = this; self.remote.once('disconnect', function() { rippled.close(); done(); }); self.remote.disconnect(); }); var store = {}; test('Pathfinding:XRP', function(done) { // genesis initially gives Alice 429 XRP orderlist.create([{command: 'ripple_path_find'}]); function incoming(data) { delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: '429000000' }); orderlist.mark('ripple_path_find'); } route.once('ripple_path_find', incoming); app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.alice.address + '/429+XRP') .end(function(err, resp) { if (err) { throw err; } assert.strictEqual(resp.body.success, true); var keyresp = testutils.hasKeys(resp.body, ['payments', 'success']); assert.equal(keyresp.hasAllKeys, true); store.<API key> = { 'secret': fixtures.accounts.genesis.secret, 'client_resource_id': 'foobar24', 'payment': resp.body.payments[0] }; assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); test('Posting XRP from genesis to alice', function(done) { function _subscribe(data) { delete data.id; assert.deepEqual(data, { command: 'subscribe', accounts: ['<API key>'] }); orderlist.mark('subscribe'); } function _accountinfo(data) { delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>' }); orderlist.mark('account_info'); } function _submit(data) { delete data.id; var so = new RL.SerializedObject(data.tx_blob).to_json(); delete so.TxnSignature; // sigs won't match ever assert.deepEqual(so, { TransactionType: 'Payment', Flags: 2147483648, Sequence: 1, LastLedgerSequence: 8804619, Amount: '429000000', Fee: '12', SigningPubKey: '<API key>', Account: '<API key>', Destination: '<API key>' }); orderlist.mark('submit'); } orderlist.create([ {command: 'subscribe'}, {command: 'account_info'}, {command: 'submit'} ]); route.once('subscribe', _subscribe); route.once('account_info', _accountinfo); route.once('submit', _submit); // actually post a XRP payment of 429 from genesis to alice app.post('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments') .send(store.<API key>) .expect(function(resp) { assert.strictEqual(resp.body.success, true); var keys = Object.keys(fixtures.<API key>); assert.equal(testutils.hasKeys(resp.body, keys).hasAllKeys, true); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); test('check amount alice has', function(done) { // we check that alice has 429 XRP orderlist.create([ {command: 'account_info'}, {command: 'account_lines'} ]); function _account_info(data) { delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>', ledger_index: 'validated' }); orderlist.mark('account_info'); } function _account_lines(data) { delete data.id; assert.deepEqual(data, { command: 'account_lines', account: '<API key>', ledger_index: 'validated', limit: 200 }); orderlist.mark('account_lines'); } route.once('account_info', _account_info); route.once('account_lines', _account_lines); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/balances') .end(function(err, resp) { if (err) { throw err; } assert.equal(resp.body.balances[0].value, 429); assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); test('Pathfinding: from alice to bob XRP', function(done) { // Now alice gives bob 1 drop XRP orderlist.create([ {command: 'ripple_path_find'}, {command: 'account_info'} ]); function _ripple_path_find(data) { orderlist.mark('ripple_path_find'); delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: '1' }); } function _account_info(data) { orderlist.mark('account_info'); delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>' }); } route.once('ripple_path_find', _ripple_path_find); route.once('account_info', _account_info); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/payments/paths/' + fixtures.accounts.bob.address + '/0.000001+XRP') .end(function(err, resp) { if (err) { throw err; } assert.strictEqual(resp.body.success, true); var keyresp = testutils.hasKeys(resp.body, ['payments', 'success']); assert.equal(keyresp.hasAllKeys, true); store.paymentAliceToBob = { 'secret': fixtures.accounts.alice.secret, 'client_resource_id': 'foobar25', 'payment': resp.body.payments[0] }; assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); test('discover the reserve_base_xrp', function(done) { function _server_info(data) { orderlist.mark('server_info'); delete data.id; assert.deepEqual(data, { command: 'server_info' }); } route.once('server_info', _server_info); orderlist.create([{command: 'server_info'}]); app.get('/v1/server') .end(function(err, resp) { if (err) { throw err; } store.reserve_base_xrp = resp.body.<API key> .validated_ledger.reserve_base_xrp; assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); test('Pathfinding: from alice to bob XRP', function(done) { // Now alice gives bob exactly the reserve_base_xrp XRP orderlist.create([ {command: 'ripple_path_find'}, {command: 'account_info'} ]); function _ripple_path_find(data) { orderlist.mark('ripple_path_find'); delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: (store.reserve_base_xrp * 1000000).toString() }); } function _account_info(data) { orderlist.mark('account_info'); delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>' }); } route.once('ripple_path_find', _ripple_path_find); route.once('account_info', _account_info); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/payments/paths/' + fixtures.accounts.bob.address + '/' + store.reserve_base_xrp + '+XRP') .end(function(err, resp) { if (err) { throw err; } assert.strictEqual(resp.body.success, true); var keyresp = testutils.hasKeys(resp.body, ['payments', 'success']); assert.equal(keyresp.hasAllKeys, true); store.paymentAliceToBob = { 'secret': fixtures.accounts.alice.secret, 'client_resource_id': 'foobar26', 'payment': resp.body.payments[0] }; assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); test('send bob reserve_base_xrp XRP from Alice to bob', function(done) { // sending bob reserve_base_xrp XRP from alice orderlist.create([{command: 'submit'}]); function _submit(data) { var so = new RL.SerializedObject(data.tx_blob).to_json(); orderlist.mark('submit'); delete so.TxnSignature; assert.deepEqual(so, { TransactionType: 'Payment', Flags: 2147483648, Sequence: 1, LastLedgerSequence: 8804619, Amount: (store.reserve_base_xrp * 1000000).toString(), Fee: '12', SigningPubKey: '<API key>', Account: '<API key>', Destination: '<API key>' }); } route.once('submit', _submit); app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentAliceToBob) .expect(function(resp) { assert.deepEqual(resp.body, { success: true, client_resource_id: 'foobar26', status_url: 'http://127.0.0.1:5990/v1/accounts/' + fixtures.accounts.alice.address + '/payments/foobar26' }); store.status_url = '/v1/accounts/' + fixtures.accounts.alice.address + '/payments/foobar26'; assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); // confirm payment via client resource ID test('check status url of the reserve_base_xrp transfer from alice to bob', function(done) { orderlist.create([{command: 'tx'}]); function _tx(data) { delete data.id; delete data.transaction; assert.deepEqual(data, {command: 'tx', binary: true}); orderlist.mark('tx'); } route.once('tx', _tx); app.get(store.status_url) .expect(function(resp) { assert.equal(resp.status, 200); assert.equal(resp.body.success, true); var payment = resp.body.payment; var statusPayment = { source_account: '<API key>', source_tag: '', source_amount: {value: '200', currency: 'XRP', issuer: ''}, source_slippage: '0', destination_account: '<API key>', destination_tag: '', destination_amount: {value: '200', currency: 'XRP', issuer: ''}, invoice_id: '', paths: '[]', no_direct_ripple: false, partial_payment: false, direction: 'outgoing', timestamp: '', fee: '0.000012', <API key>: [], <API key>: [] }; store.hash = resp.body.hash; var keys = Object.keys(statusPayment); for (var i = 0; i < keys.length; i++) { var key = keys[i]; assert.deepEqual(payment[key], statusPayment[key]); } assert.equal(resp.body.hash, '<API key>'); assert.equal(resp.body.ledger, 'undefined'); assert.equal(resp.body.state, 'pending'); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); test('confirm payment via transaction hash', function(done) { orderlist.create([{command: 'tx'}]); function _tx() { orderlist.mark('tx'); } route.once('tx', _tx); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/payments/' + store.hash) .expect(function(resp) { assert.equal(resp.status, 200); assert.equal(resp.body.success, true); var payment = resp.body.payment; var statusPayment = { source_account: '<API key>', source_tag: '', source_amount: {value: '200', currency: 'XRP', issuer: ''}, source_slippage: '0', destination_account: '<API key>', destination_tag: '', destination_amount: {value: '200', currency: 'XRP', issuer: ''}, invoice_id: '', paths: '[]', no_direct_ripple: false, partial_payment: false, direction: 'outgoing', timestamp: '', fee: '0.000012', <API key>: [], <API key>: [] }; var keys = Object.keys(statusPayment); for (var i = 0; i < keys.length; i++) { var key = keys[i]; assert.deepEqual(payment[key], statusPayment[key]); } assert.equal(resp.body.hash, '<API key>'); assert.equal(resp.body.ledger, 'undefined'); assert.equal(resp.body.state, 'pending'); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); test('check amount bob has', function(done) { orderlist.create([ {command: 'account_info'}, {command: 'account_lines'} ]); function _account_info(data) { delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>', ledger_index: 'validated' }); orderlist.mark('account_info'); } function _account_lines(data) { delete data.id; assert.deepEqual(data, { command: 'account_lines', account: '<API key>', ledger_index: 'validated', limit: 200 }); orderlist.mark('account_lines'); } route.once('account_info', _account_info); route.once('account_lines', _account_lines); app.get('/v1/accounts/' + fixtures.accounts.bob.address + '/balances') .end(function(err, resp) { if (err) { throw err; } var balance = resp.body.balances[0]; // change all instances of 200 with reserve base xrp assert.equal(balance.value, '200'); store.bob_balance = balance.value; assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); // bob should try to send all money back to alice test('try to send all of bobs money to alice below reserve', function(done) { orderlist.create([ {command: 'ripple_path_find'}, {command: 'account_info'} ]); function _ripple_path_find(data) { orderlist.mark('ripple_path_find'); delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: '200000000' }); } function _account_info(data) { orderlist.mark('account_info'); delete data.id; assert.deepEqual(data, { command: 'account_info', account: '<API key>' }); } route.once('ripple_path_find', _ripple_path_find); route.once('account_info', _account_info); var sendamount = store.bob_balance; app.get('/v1/accounts/' + fixtures.accounts.bob.address + '/payments/paths/' + fixtures.accounts.alice.address + '/' + sendamount + '+XRP') .end(function(err, resp) { if (err) { throw err; } assert.equal(404, resp.status); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: 'restNOT_FOUND', message: 'No paths found. Please ensure that the source_account has ' + 'sufficient funds to execute the payment. If it does there may ' + 'be insufficient liquidity in the network to execute this ' + 'payment right now' }); assert.equal(orderlist.test(), true); orderlist.reset(); done(); }); }); // TODO: bob should try to send all money back to alice test.skip('try to send 95% of bobs money to alice below reserve', function(done) { var sendamount = store.bob_balance * 0.95; app.get('/v1/accounts/' + fixtures.accounts.bob.address + '/payments/paths/' + fixtures.accounts.alice.address + '/' + sendamount + '+XRP') .end(function(err, resp) { if (err) { throw err; } assert.equal(404, resp.status); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: 'No paths found', message: 'Please ensure that the source_account has sufficient ' + 'funds to execute the payment. If it does there may be ' + 'insufficient liquidity in the network to execute this payment ' + 'right now' }); done(); }); }); // have alice send bob 10 USD/alice test('alice sends bob 10USD/alice without trust', function(done) { orderlist.create([ {command: 'ripple_path_find'} ]); function _ripple_path_find(data) { orderlist.mark('ripple_path_find'); delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: { value: '10', currency: 'USD', issuer: '<API key>' } }); } route.once('ripple_path_find', _ripple_path_find); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/payments/paths/' + fixtures.accounts.bob.address + '/10+USD+' + fixtures.accounts.alice.address) .expect(function(resp) { assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: 'restNOT_FOUND', message: 'No paths found. The destination_account does not accept ' + 'USD, they only accept: XRP' }); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); test.skip('grant a trustline of 10 usd towards alice', function(done) { orderlist.create([ {command: 'subscribe'}, {command: 'account_info'}, {command: 'submit'} ]); function _subscribe(data) { orderlist.mark('subscribe'); delete data.id; assert.deepEqual(data, { command: 'subscribe', accounts: ['<API key>'] }); } function _account_info(data) { delete data.id; orderlist.mark('account_info'); assert.deepEqual(data, { command: 'account_info', account: '<API key>' }); } function _submit(data) { orderlist.mark('submit'); var so = new RL.SerializedObject(data.tx_blob).to_json(); delete so.TxnSignature; // sigs won't match ever assert.deepEqual(so, { Flags: 2147483648, TransactionType: 'TrustSet', Account: '<API key>', LimitAmount: { value: '10', currency: 'USD', issuer: '<API key>' }, Sequence: 1, SigningPubKey: '<API key>', Fee: '12', LastLedgerSequence: 8804624 }); } route.once('subscribe', _subscribe); route.once('account_info', _account_info); route.once('submit', _submit); app.post('/v1/accounts/' + fixtures.accounts.bob.address + '/trustlines') .send({ 'secret': fixtures.accounts.bob.secret, 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.alice.address, 'allows_rippling': false } }) .expect(function(resp) { assert.strictEqual(typeof resp.body.trustline.hash, 'string'); assert.strictEqual(typeof resp.body.trustline.hash, 'string'); delete resp.body.trustline.hash; delete resp.body.trustline.ledger; assert.deepEqual(resp.body, { 'success': true, 'trustline': { 'account': '<API key>', 'limit': '10', 'currency': 'USD', 'counterparty': '<API key>', '<API key>': true, '<API key>': false, 'state': 'pending' } }); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); // have alice send bob 10 USD/alice test('get path for alice to bob 10USD/alice with trust', function(done) { orderlist.create([ {command: 'ripple_path_find'} ]); function _ripple_path_find(data) { delete data.id; assert.deepEqual(data, { command: 'ripple_path_find', source_account: '<API key>', destination_account: '<API key>', destination_amount: { value: '10', currency: 'USD', issuer: '<API key>' } }); orderlist.mark('ripple_path_find'); } route.once('ripple_path_find', _ripple_path_find); app.get('/v1/accounts/' + fixtures.accounts.alice.address + '/payments/paths/' + fixtures.accounts.bob.address + '/10+USD+' + fixtures.accounts.alice.address) .expect(function(resp) { assert.deepEqual(resp.body, { success: true, payments: [ { source_account: '<API key>', source_tag: '', source_amount: { value: '10', currency: 'USD', issuer: '' }, source_slippage: '0', destination_account: '<API key>', destination_tag: '', destination_amount: { value: '10', currency: 'USD', issuer: '<API key>' }, invoice_id: '', paths: '[]', partial_payment: false, no_direct_ripple: false } ] }); assert.equal(orderlist.test(), true); orderlist.reset(); }) .end(done); }); /** * The tests below don't test the input for rippled * These should be rewritten in the payments.js class */ test('path find populate carol with missing sum', function(done) { app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.carol.address + '/+XRP') .end(function(err, resp) { if (err) { throw err; } assert.equal(resp.status, 400); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Invalid parameter: destination_amount. Must be an amount ' + 'string in the form value+currency+issuer' }); done(); }); }); test('path find populate carol with missing currency', function(done) { app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.carol.address + '/400') .end(function(err, resp) { if (err) { throw err; } assert.equal(resp.status, 400); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Invalid parameter: destination_amount. Must be an amount ' + 'string in the form value+currency+issuer' }); done(); }); }); test('path find populate carol with all missing endpoint value', function(done) { app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.carol.address + '/') .expect(function(resp) { assert.equal(resp.status, 404); }) .end(done); }); test('path find populate carol with 400', function(done) { app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.carol.address + '/400+XRP') .end(function(err, resp) { if (err) { throw err; } store.<API key> = { 'secret': fixtures.accounts.genesis.secret, 'client_resource_id': 'asdfg', 'payment': resp.body.payments[0] }; done(); }); }); test('Posting XRP from genesis to carol', function(done) { app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.<API key>) .end(function(err) { if (err) { throw err; } done(); }); }); // miss the client resource id test('path find populate dan with 600', function(done) { app.get('/v1/accounts/' + fixtures.accounts.genesis.address + '/payments/paths/' + fixtures.accounts.dan.address + '/600+XRP') .end(function(err, resp) { if (err) { throw err; } store.paymentGenesisToDan = { 'secret': fixtures.accounts.genesis.secret, 'payment': resp.body.payments[0] }; done(); }); }); test('Posting XRP from genesis to dan with missing client resource id', function(done) { app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentGenesisToDan) .end(function(err, resp) { if (err) { throw err; } assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Parameter missing: client_resource_id' }); done(); }); }); test('Posting XRP from genesis to dan with empty client resource id', function(done) { store.paymentGenesisToDan.client_resource_id = ''; app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentGenesisToDan) .end(function(err, resp) { if (err) { throw err; } assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Invalid parameter: client_resource_id. Must be a string ' + 'of ASCII-printable characters. Note that 256-bit hex strings ' + 'are disallowed because of the potential confusion with ' + 'transaction hashes.' }); done(); }); }); test('Posting XRP from genesis to dan with valid client resource id', function(done) { store.paymentGenesisToDan.client_resource_id = 'qwerty'; app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentGenesisToDan) .end(function(err, resp) { if (err) { throw err; } assert.deepEqual(resp.body, { success: true, client_resource_id: 'qwerty', status_url: 'http://127.0.0.1:5990/v1/accounts/' + '<API key>/payments/qwerty' }); done(); }); }); test('Double posting XRP from genesis to dan with valid client resource id', function(done) { store.paymentGenesisToDan.client_resource_id = 'qwerty'; app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentGenesisToDan) .expect(function(resp) { assert.equal(resp.status, 500); assert.deepEqual(resp.body, { 'success': false, 'error_type': 'server', 'error': '<API key>', 'message': 'Duplicate Transaction. A record already exists in the ' + 'database for a transaction of this type with the same ' + 'client_resource_id. If this was not an accidental resubmission ' + 'please submit the transaction again with a unique ' + 'client_resource_id' }); }) .end(done); }); test.skip('dan grants a trustline of 10 usd towards carol but uses carols ' + 'address in the accounts setting', function(done) { // mocha is NOT overriding the timeout contrary to documentation this.timeout(1000); app.post('/v1/accounts/' + fixtures.accounts.carol.address + '/trustlines') .send({ 'secret': fixtures.accounts.dan.secret, 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.carol.address, 'allows_rippling': false } }) .expect(function(resp) { assert.deepEqual(resp.body, { success: false, error_type: 'transaction', error: 'Invalid secret' }); }) .end(done); }); test.skip('dan grants a trustline of 10 usd towards carol and uses correct ' + 'address in the accounts setting but no secret', function(done) { app.post('/v1/accounts/' + fixtures.accounts.dan.address + '/trustlines') .send({ 'secret': '', 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.carol.address, 'allows_rippling': false } }) .expect(function(resp) { assert.equal(resp.status, 400); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Parameter missing: secret' }); }) .end(done); }); test.skip('dan grants a trustline of 10 usd towards carol and uses correct ' + 'address in the accounts setting but incorrect secret', function(done) { app.post('/v1/accounts/' + fixtures.accounts.dan.address + '/trustlines') .send({ 'secret': fixtures.accounts.carol.secret, 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.carol.address, 'allows_rippling': false } }) .expect(function(resp) { assert.deepEqual(resp.body, { success: false, error_type: 'transaction', error: 'Invalid secret' }); }) .end(done); }); test.skip('dan grants a trustline of 10 usd towards carol and uses correct ' + 'address in the accounts setting', function(done) { app.post('/v1/accounts/' + fixtures.accounts.dan.address + '/trustlines') .send({ 'secret': fixtures.accounts.dan.secret, 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.carol.address, 'allows_rippling': false } }) .expect(function(resp) { assert.equal(resp.status, 201); assert.strictEqual(typeof resp.body.hash, 'string'); assert.strictEqual(typeof resp.body.ledger, 'string'); delete resp.body.hash; delete resp.body.ledger; assert.deepEqual(resp.body, { 'success': true, 'trustline': { 'account': '<API key>', 'limit': '10', 'currency': 'USD', 'counterparty': '<API key>', '<API key>': true, '<API key>': false }, 'state': 'pending' }); }) .end(done); }); test.skip('dan grants an additional trustline of 10 usd towards carol and ' + 'uses correct address in the accounts setting', function(done) { app.post('/v1/accounts/' + fixtures.accounts.dan.address + '/trustlines') .send({ 'secret': fixtures.accounts.dan.secret, 'trustline': { 'limit': '10', 'currency': 'USD', 'counterparty': fixtures.accounts.carol.address, 'allows_rippling': false } }) .expect(function(resp) { assert.equal(resp.status, 201); assert.strictEqual(typeof resp.body.hash, 'string'); assert.strictEqual(typeof resp.body.ledger, 'string'); delete resp.body.hash; delete resp.body.ledger; assert.deepEqual(resp.body, { 'success': true, 'trustline': { 'account': '<API key>', 'limit': '10', 'currency': 'USD', 'counterparty': '<API key>', '<API key>': true, '<API key>': false }, 'state': 'pending' }); }) .end(done); }); test('get path for carol to dan 10USD/carol with trust', function(done) { app.get('/v1/accounts/' + fixtures.accounts.carol.address + '/payments/paths/' + fixtures.accounts.dan.address + '/10+USD+' + fixtures.accounts.carol.address) .end(function(err, resp) { if (err) { throw err; } store.paymentCarolToDan = { secret: 'asdfkje', client_resource_id: 'abc', payment: resp.body.payments[0] }; done(); }); }); test.skip('Posting 10USD from carol to dan with valid client resource id ' + 'but incorrect secret', function(done) { app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentCarolToDan) .expect(function(resp) { assert.deepEqual(resp.body, { success: false, error_type: 'transaction', error: 'Invalid secret' }); }) .end(done); }); test('Posting 10USD from carol to dan with valid client resource id and ' + 'correct secret but missing fields on payment object', function(done) { store.paymentCarolToDan.secret = fixtures.accounts.carol.secret; store.value = store.paymentCarolToDan.payment.destination_amount.value; delete store.paymentCarolToDan.payment.destination_amount.value; app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentCarolToDan) .expect(function(resp) { assert.equal(resp.status, 400); assert.deepEqual(resp.body, { success: false, error_type: 'invalid_request', error: '<API key>', message: 'Invalid parameter: destination_amount. Must be a valid ' + 'Amount object' }); }) .end(done); }); test('Posting 10USD from carol to dan with valid client resource id ' + 'and correct secret', function(done) { store.paymentCarolToDan.payment.destination_amount.value = store.value; store.paymentCarolToDan.secret = fixtures.accounts.carol.secret; store.paymentCarolToDan.client_resource_id = 'abc'; app.post('/v1/accounts/' + fixtures.accounts.alice.address + '/payments') .send(store.paymentCarolToDan) .expect(function(resp) { assert.equal(resp.status, 200); assert.deepEqual(resp.body, { success: true, client_resource_id: 'abc', status_url: 'http://127.0.0.1:5990/v1/accounts/' + '<API key>/payments/abc' }); }) .end(done); }); });
package wav import ( "io/ioutil" "math" "testing" "gotest.tools/assert" ) func TestRead(t *testing.T) { blockAlign := 4 file, err := fixtureFile("a.wav") if err != nil { t.Fatalf("Failed to open fixture file") } reader := NewReader(file) fmt, err := reader.Format() if err != nil { t.Fatal(err) } assert.Equal(t, AudioFormatPCM, int(fmt.AudioFormat)) assert.Equal(t, 2, int(fmt.NumChannels)) assert.Equal(t, 44100, int(fmt.SampleRate)) assert.Equal(t, 44100*4, int(fmt.ByteRate)) assert.Equal(t, blockAlign, int(fmt.BlockAlign)) assert.Equal(t, 16, int(fmt.BitsPerSample)) duration, err := reader.Duration() if err != nil { t.Fatal(err) } assert.Equal(t, "1.381496598s", duration.String()) samples, err := reader.ReadSamples(1) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(samples)) sample := samples[0] assert.Equal(t, 318, reader.IntValue(sample, 0)) assert.Equal(t, 289, reader.IntValue(sample, 1)) assert.Assert(t, math.Abs(reader.FloatValue(sample, 0)-0.009705) <= 0.0001) assert.Assert(t, math.Abs(reader.FloatValue(sample, 1)-0.008820) <= 0.0001) bytes, err := ioutil.ReadAll(reader) if err != nil { t.Fatal(err) } assert.Equal(t, len(bytes), int(reader.WavData.Size)-(1*blockAlign)) t.Logf("Data size: %d", len(bytes)) } func TestReadMulaw(t *testing.T) { blockAlign := 1 file, err := fixtureFile("mulaw.wav") if err != nil { t.Fatalf("Failed to open fixture file") } reader := NewReader(file) fmt, err := reader.Format() if err != nil { t.Fatal(err) } assert.Equal(t, AudioFormatMULaw, int(fmt.AudioFormat)) assert.Equal(t, 1, int(fmt.NumChannels)) assert.Equal(t, 8000, int(fmt.SampleRate)) assert.Equal(t, 8000, int(fmt.ByteRate)) assert.Equal(t, blockAlign, int(fmt.BlockAlign)) assert.Equal(t, 8, int(fmt.BitsPerSample)) duration, err := reader.Duration() if err != nil { t.Fatal(err) } assert.Equal(t, "4.59125s", duration.String()) samples, err := reader.ReadSamples(1) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(samples)) bytes, err := ioutil.ReadAll(reader) if err != nil { t.Fatal(err) } assert.Equal(t, len(bytes), int(reader.WavData.Size)-(1*blockAlign)) t.Logf("Data size: %d", len(bytes)) } func TestReadAlaw(t *testing.T) { blockAlign := 1 file, err := fixtureFile("alaw.wav") if err != nil { t.Fatalf("Failed to open fixture file") } reader := NewReader(file) fmt, err := reader.Format() if err != nil { t.Fatal(err) } assert.Equal(t, AudioFormatALaw, int(fmt.AudioFormat)) assert.Equal(t, 1, int(fmt.NumChannels)) assert.Equal(t, 8000, int(fmt.SampleRate)) assert.Equal(t, 8000, int(fmt.ByteRate)) assert.Equal(t, blockAlign, int(fmt.BlockAlign)) assert.Equal(t, 8, int(fmt.BitsPerSample)) duration, err := reader.Duration() if err != nil { t.Fatal(err) } assert.Equal(t, "4.59125s", duration.String()) samples, err := reader.ReadSamples(1) if err != nil { t.Fatal(err) } assert.Equal(t, 1, len(samples)) bytes, err := ioutil.ReadAll(reader) if err != nil { t.Fatal(err) } assert.Equal(t, len(bytes), int(reader.WavData.Size)-(1*blockAlign)) t.Logf("Data size: %d", len(bytes)) }
/** * @file ToDo List Item Component * @module todo/components/list/item * @author Bohdan Lubenets <bogdan.lubenets@dev-pro.net> */ import React, { PropTypes } from 'react'; import Paper from 'material-ui/Paper'; import Checkbox from 'material-ui/Checkbox'; import <API key> from 'material-ui/<API key>'; import NavigationClose from 'material-ui/svg-icons/navigation/close'; import { green50 } from 'material-ui/styles/colors'; /** * @classdesc ToDo List Item Component * @param {module:todo/components/list/item~<API key>} props * @constructor */ const ToDoListItem = (props) => ( <Paper style={{ padding: '10px', backgroundColor: props.isDone ? green50 : 'white' }}> <Checkbox label={props.text} checked={props.isDone} onCheck={props.onToggle} style={{ width: '90%', marginRight: '15px', display: 'inline-block' }} /> <<API key> mini={true} onClick={props.onRemove}> <NavigationClose /> </<API key>> </Paper> ); /** * ToDoListItem properties description * @type {{text: *, isDone: *, onToggle: *, onRemove: *}} */ ToDoListItem.propTypes = { text: PropTypes.string.isRequired, isDone: PropTypes.bool.isRequired, onToggle: PropTypes.func.isRequired, onRemove: PropTypes.func.isRequired, }; export default ToDoListItem; /** * ToDoListItem properties * @typedef {Object} <API key> * @property {string} text - ToDoListItem text * @property {boolean} isDone - ToDoListItem done state * @property {module:todo/components/list~<API key>} onToggle * @property {module:todo/components/list~<API key>} onRemove */
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using BigtableNet.Common.<API key>; using Newtonsoft.Json; namespace BigtableNet.Common { public static class Extensions { internal static readonly <API key> SerializerSettings; static Extensions() { SerializerSettings = new <API key> { ContractResolver = new <API key>() }; } public static void Save(this <API key> config, string fileWithPath) { config.SaveAsync(fileWithPath).Wait(); } public static async Task SaveAsync(this <API key> config, string fileWithPath) { using (TextWriter writer = new StreamWriter(File.OpenWrite(fileWithPath))) { var text = JsonConvert.SerializeObject(config, SerializerSettings); await writer.WriteAsync(text); } } } }
{% extends "base.html" %} {% import "bootstrap/wtf.html" as wtf %} {% import "main/_macros.html" as macros %} {% block title %} - {% endblock %} {% block page_content %} <section id="top" class="two"> <div class="container"> <header> <div> <form method="POST" action="{{ url_for('main.cloud', type=_type, order='name', path=_path, key=key, direction='front', _external=True) }}"> {{ form.hidden_tag() }} {{ form.key(class="form-control", placeholder="") }} </form> </div> <br/> <div style="text-align:right"> <a href="{{ url_for('main.cloud', type=_type, order='name', path=_path, key='', direction='front', _external=True) }}"> {% if key != '' %} <button type="button" class="btn btn-success"></button> {% endif %} </a> <a href="{{ url_for('main.upload', path=_path, _external=True) }}"> <button type="button" class="btn btn-success"></button> </a> <a href="{{ url_for('main.newfolder', path=_path, _external=True) }}"> <button type="button" class="btn btn-success"></button> </a> <div class="btn-group"> <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> {% if _type == 'video' %} {% elif _type == 'music' %} {% elif _type == 'photo' %} {% elif _type == 'document' %} {% elif _type == 'compress' %} {% else %} {% endif %} </button> <div class="dropdown-menu"> <a class="dropdown-item" href="{{ url_for('main.cloud', type='all',direction=_direction, order=_order, key=key, _external=True) }}"></a> <a class="dropdown-item" href="{{ url_for('main.cloud', type='music', direction=_direction, order=_order, key=key, _external=True) }}"></a> <a class="dropdown-item" href="{{ url_for('main.cloud', type='video', direction=_direction, order=_order, key=key, _external=True) }}"></a> <a class="dropdown-item" href="{{ url_for('main.cloud', type='photo', direction=_direction, order=_order, key=key, _external=True) }}"></a> <a class="dropdown-item" href="{{ url_for('main.cloud', type='document', direction=_direction, order=_order, key=key, _external=True) }}"></a> <a class="dropdown-item" href="{{ url_for('main.cloud', type='compress', direction=_direction, order=_order, key=key, _external=True) }}"></a> <div class="dropdown-divider"></div> {% if _direction == "front" %} <a class="dropdown-item" href="{{ url_for('main.cloud', type=_type, order='time', path=_path, key=key, direction='reverse', _external=True) }}"></a> {% else %} <a class="dropdown-item" href="{{ url_for('main.cloud', type=_type, order='time', path=_path, key=key, direction='front', _external=True) }}"></a> {% endif %} {% if _direction == "front" %} <a class="dropdown-item" href="{{ url_for('main.cloud', type=_type, order='name', path=_path, key=key, direction='reverse', _external=True) }}"></a> {% else %} <a class="dropdown-item" href="{{ url_for('main.cloud', type=_type, order='name', path=_path, key=key, direction='front', _external=True) }}"></a> {% endif %} </div> </div> </div> {% if _type == "all" %} <div style="text-align:left"> <div class="link-block"> {% for __path, _pathView in pathlists %} <a class="link-item" href="{{ url_for('main.cloud', path=__path, order=_order, direction=_direction, _external=True) }}"> {{ _pathView }}</a> {% endfor %} </div> </div> {% endif %} <div style="text-align:center"> {% if files %} {% include 'main/cloud/_ownfiles.html' %} {% else %} {% if key == '' %} <h3 class="text-warning"></h3> {% else %} <h3 class="text-warning"></h3> {% endif %} {% endif %} </div> {% if pagination %} <div class="pagination"> {{ macros.pagination_widget(pagination, 'main.cloud', key=key, type=_type, order=_order, direction=_direction) }} </div> {% endif %} </header> </div> </section> {% endblock %} {% block scripts %} {{ super() }} {{ pagedown.include_pagedown() }} {% endblock %}
package org.apollo.service; /** * A listener which listens for {@link Service} events. * * <p> * This is a functional interface whose functional method is {@link #execute()} * * @author Ryley Kimmel <ryley.kimmel@live.com> */ @FunctionalInterface public interface ServiceListener { /** * Executes this service event. */ void execute(); }
const {createRobot} = require('probot') const app = require('..') describe('app', () => { let robot let github let context = { event: 'issues', payload: require(`./fixtures/webhook/comment.created`) } const configure = async (content, ctx) => { github.repos.getContent.mockImplementation(params => Promise.resolve({ data: { content: Buffer .from(typeof content === 'function' ? content(params) : content) .toString('base64') } })) robot.auth = () => Promise.resolve(github) await robot.receive(ctx || context) } beforeEach(() => { robot = createRobot() app(robot) github = { repos: { getContent: jest.fn().mockReturnValue(Promise.resolve({})) }, issues: { createComment: jest.fn(), edit: jest.fn() } } }) describe('reply to new issue with a comment', () => { it('posts a comment', async () => { await configure(` on("issues") .comment("Hello World!"); `) expect(github.issues.createComment).toHaveBeenCalled() }) }) describe('on an event with a different action', () => { it('does not perform behavior', async () => { await configure(` on("issues.labeled") .comment("Hello World!"); `) expect(github.issues.createComment).<API key>(0) }) }) describe('filter', () => { const context = { event: 'issues', payload: require(`./fixtures/webhook/issues.labeled`) } it('calls action when condition matches', async () => { await configure(` on("issues.labeled") .filter((e) => e.payload.label.name == "bug") .close(); `, context) expect(github.issues.edit).toHaveBeenCalled() }) it('does not call action when conditions do not match', async () => { await configure(` on("issues.labeled") .filter((e) => e.payload.label.name == "foobar") .close(); `, context) expect(github.issues.edit).<API key>(0) }) }) describe('include', () => { it('includes a file in the local repository', async () => { await configure(params => { if (params.path === '.github/triage.js') { return 'on("issues").comment("Hello!");' } return 'include(".github/triage.js");' }) expect(github.repos.getContent).<API key>({ owner: 'bkeepers-inc', repo: 'test', path: '.github/triage.js' }) }) it('executes included rules', async () => { await configure(params => { if (params.path === '.github/triage.js') { return 'on("issues").comment("Hello!");' } return 'include(".github/triage.js");' }) expect(github.issues.createComment).toHaveBeenCalled() }) it('includes files relative to included repository', async () => { await configure(params => { if (params.path === 'script-a.js') { return 'include("script-b.js")' } if (params.path === 'script-b.js') { return '' } return ` include("other/repo:script-a.js"); include("another/repo:script-a.js"); include("script-b.js"); ` }) expect(github.repos.getContent).<API key>(1 + 3 + 2) expect(github.repos.getContent).<API key>({ owner: 'other', repo: 'repo', path: 'script-b.js' }) expect(github.repos.getContent).<API key>({ owner: 'another', repo: 'repo', path: 'script-b.js' }) expect(github.repos.getContent).<API key>({ owner: 'bkeepers-inc', repo: 'test', path: 'script-b.js' }) }) }) describe('contents', () => { it('gets content from repo', async () => { await configure(params => { if (params.path === '.github/<API key>') { return 'file contents' } return 'on("issues").comment(contents(".github/<API key>"));' }) expect(github.issues.createComment).<API key>({ owner: 'bkeepers-inc', repo: 'test', number: context.payload.issue.number, body: 'file contents' }) }) it('gets contents relative to included repository', async () => { await configure(params => { if (params.path === 'script-a.js') { return 'on("issues").comment(contents("content.md"));' } if (params.path === 'content.md') { return '' } return 'include("other/repo:script-a.js");' }) expect(github.repos.getContent).<API key>({ owner: 'other', repo: 'repo', path: 'content.md' }) }) it('gets multiple contents without mismatching source parameters', async () => { await configure(params => { if (params.path === 'content.md' || params.path === 'label.md') { return '' } return ` on("issues") .comment(contents("other/repo:content.md")) .comment(contents("label.md")); ` }) expect(github.repos.getContent).<API key>({ owner: 'other', repo: 'repo', path: 'content.md' }) expect(github.repos.getContent).<API key>({ owner: 'bkeepers-inc', repo: 'test', path: 'label.md' }) }) }) })
//-*- mode: c++ -*-//////////////////////////////////////////////////////////// // Simon Pratt // // FILE: heap_sort.h // // MODULE: Sort // // PURPOSE: Provides an implementation of heap sort. // // NOTES: None. // // Public Methods: // #ifndef HEAP_SORT_H #define HEAP_SORT_H void heap_sort(PSTPoint* array, int npoints); void heap_sort(PSTPoint* array, int begin, int end); #endif
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.08.21 at 12:22:14 PM CDT package com.mastercard.mcwallet.sdk.xml.switchapiservices; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ShoppingCartResults", propOrder = { "oAuthToken", "extensionPoint", "shoppingCart" }) public class ShoppingCartResults { @XmlElement(name = "OAuthToken", required = true) protected String oAuthToken; @XmlElement(name = "ExtensionPoint") protected ExtensionPoint extensionPoint; @XmlElement(name = "ShoppingCart", required = true) protected ShoppingCart shoppingCart; /** * Gets the value of the oAuthToken property. * * @return * possible object is * {@link String } * */ public String getOAuthToken() { return oAuthToken; } /** * Sets the value of the oAuthToken property. * * @param value * allowed object is * {@link String } * */ public void setOAuthToken(String value) { this.oAuthToken = value; } /** * Gets the value of the extensionPoint property. * * @return * possible object is * {@link ExtensionPoint } * */ public ExtensionPoint getExtensionPoint() { return extensionPoint; } /** * Sets the value of the extensionPoint property. * * @param value * allowed object is * {@link ExtensionPoint } * */ public void setExtensionPoint(ExtensionPoint value) { this.extensionPoint = value; } /** * Gets the value of the shoppingCart property. * * @return * possible object is * {@link ShoppingCart } * */ public ShoppingCart getShoppingCart() { return shoppingCart; } /** * Sets the value of the shoppingCart property. * * @param value * allowed object is * {@link ShoppingCart } * */ public void setShoppingCart(ShoppingCart value) { this.shoppingCart = value; } }
/* vim: set ts=2 sw=2 expandtab : */ var Strategy = require('./strategy'); module.exports.Strategy = Strategy;
#ifndef <API key> #define <API key> \file R2LightShaderMain.h \brief The main function that all deferred light shaders must implement. #include "<API key>.h" #include "R2LightOutput.h" Calculate light values for the current light, based on the current contents of the G-buffer. @param surface Reconstructed surface data taken from the G-Buffer @return Calculated light values R2_light_output_t <API key> ( const <API key> surface ); #endif // <API key>
/* $OpenBSD: vmparam.h,v 1.10 2014/07/13 15:48:32 miod Exp $ */ /* public domain */ #ifndef _MACHINE_VMPARAM_H_ #define _MACHINE_VMPARAM_H_ #define VM_PHYSSEG_MAX 32 /* Max number of physical memory segments */ #include <mips64/vmparam.h> #endif /* _MACHINE_VMPARAM_H_ */
#!/usr/bin/env python #coding: utf-8 import sys import time import numpy as np import random import rospy import tf from geometry_msgs.msg import PointStamped from std_msgs.msg import String, Empty, Header from learningSignals.agents import Drqn pub_action = rospy.Publisher('action', String, queue_size = 1) # for training: pub_scores = rospy.Publisher('scores', String, queue_size = 1) pub_hiddens = rospy.Publisher('hiddens', String, queue_size = 1) agent = Drqn(input_size=3, nb_action=2, gamma=0.9) stop = False signal = [0,0,0] reward = 0 key = 0 received_signal = False received_reward = True def onExit(msg): global stop stop = True def onReceiveSignal(msg): global signal global received_signal signal_msg = str(msg.data) new_signal = [float(i) for i in signal_msg.split('_')] if new_signal!=signal: received_signal = True rospy.loginfo('signal: '+str(new_signal)) signal = new_signal def onReceiveReward(msg): global reward global key global received_reward reward_msg = str(msg.data) new_reward, new_key = float(reward_msg.split('_')[0]), float(reward_msg.split('_')[1]) #rospy.loginfo('new_key: '+str(new_key)) #rospy.loginfo('key: '+str(key)) if new_key!=key: reward = new_reward key = new_key received_reward = True rospy.loginfo('reward: '+str(reward)) if __name__=="__main__": rospy.init_node("brain") while not stop: rospy.Subscriber('exit_topic', String, onExit) rospy.Subscriber('signal', String, onReceiveSignal) rospy.Subscriber('reward', String, onReceiveReward) if received_signal:#received_reward and received_signal: #rospy.loginfo('update !') action = agent.update(reward, signal) #rospy.loginfo('action: '+str(action)) msg = String() msg.data = str(action)+'_'+str(np.random.rand()) pub_action.publish(msg) received_signal = False received_reward = False #for training: msg_scores = String(); msg_hiddens = String() msg_scores.data = str(agent.scores*100) msg_hiddens.data = str(agent.last_hidden*100) pub_scores.publish(msg_scores) pub_hiddens.publish(msg_hiddens) rospy.sleep(0.3) rospy.spin()
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from finitio.types import SetType, BuiltinType, Type builtin_string = BuiltinType(str) class TestSetTypeLow(unittest.TestCase): class HighType(Type): def low(self): return builtin_string subject = SetType(HighType("")) def test_equals_itself(self): expected = SetType(builtin_string) self.assertEqual(self.subject.low(), expected) if __name__ == '__main__': import sys sys.exit(unittest.main())
package com.j256.ormlite.jdbc.examples.datapersister; import org.joda.time.DateTime; import com.j256.ormlite.field.<API key>; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.field.FieldType; import com.j256.ormlite.field.SqlType; import com.j256.ormlite.field.types.DateTimeType; /** * A custom persister that is able to store the Joda {@link DateTime} class in the database as epoch-millis long * integer. This overrides the {@link DateTimeType} which uses reflection instead. This should run faster. * * This can be specified using {@link DatabaseField#persisterClass()} or registered with * {@link <API key>#<API key>(com.j256.ormlite.field.DataPersister...)}. * * @author graywatson */ public class DateTimePersister extends DateTimeType { private static final DateTimePersister singleTon = new DateTimePersister(); private DateTimePersister() { super(SqlType.LONG, new Class<?>[] { DateTime.class }); } public static DateTimePersister getSingleton() { return singleTon; } @Override public Object javaToSqlArg(FieldType fieldType, Object javaObject) { DateTime dateTime = (DateTime) javaObject; if (dateTime == null) { return null; } else { return dateTime.getMillis(); } } @Override public Object sqlArgToJava(FieldType fieldType, Object sqlArg, int columnPos) { return new DateTime((Long) sqlArg); } }
#include <algorithm> #include <iostream> #include <iterator> #include "cells.h" #include "design_utils.h" #include "log.h" #include "util.h" <API key> static void make_dummy_alu(Context *ctx, int alu_idx, CellInfo *ci, CellInfo *packed_head, std::vector<std::unique_ptr<CellInfo>> &new_cells) { if ((alu_idx % 2) == 0) { return; } std::unique_ptr<CellInfo> dummy = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_DUMMY_ALULC"); if (ctx->verbose) { log_info("packed dummy ALU %s.\n", ctx->nameOf(dummy.get())); } dummy->params[id_ALU_MODE] = std::string("C2L"); // add to cluster dummy->cluster = packed_head->name; dummy->constr_z = alu_idx % 6; dummy->constr_x = alu_idx / 6; dummy->constr_y = 0; packed_head->constr_children.push_back(dummy.get()); new_cells.push_back(std::move(dummy)); } // replace ALU with LUT static void pack_alus(Context *ctx) { log_info("Packing ALUs..\n"); // cell name, CIN net name pool<std::pair<IdString, IdString>> alu_heads; // collect heads for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_alu(ctx, ci)) { NetInfo *cin = ci->ports.at(id_CIN).net; CellInfo *cin_ci = cin->driver.cell; if (cin == nullptr || cin_ci == nullptr) { log_error("CIN disconnected at ALU:%s\n", ctx->nameOf(ci)); continue; } if (!is_alu(ctx, cin_ci) || cin->users.entries() > 1) { if (ctx->verbose) { log_info("ALU head found %s. CIN net is %s\n", ctx->nameOf(ci), ctx->nameOf(cin)); } alu_heads.insert(std::make_pair(ci->name, cin->name)); } } } pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &head : alu_heads) { CellInfo *ci = ctx->cells[head.first].get(); IdString cin_netId = head.second; if (ctx->verbose) { log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); } std::unique_ptr<CellInfo> packed_head = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_HEAD_ALULC"); // Head is always SLICE0 packed_head->constr_z = 0; packed_head->constr_abs_z = true; if (ctx->verbose) { log_info("packed ALU head into %s. CIN net is %s\n", ctx->nameOf(packed_head.get()), ctx->nameOf(cin_netId)); } packed_head->connectPort(id_C, ctx->nets[ctx->id("$PACKER_VCC_NET")].get()); if (cin_netId == ctx->id("$PACKER_GND_NET")) { // CIN = 0 packed_head->params[id_ALU_MODE] = std::string("C2L"); } else { if (cin_netId == ctx->id("$PACKER_VCC_NET")) { // CIN = 1 packed_head->params[id_ALU_MODE] = std::string("ONE2C"); } else { // CIN from logic packed_head->connectPort(id_B, ctx->nets[cin_netId].get()); packed_head->connectPort(id_D, ctx->nets[cin_netId].get()); packed_head->params[id_ALU_MODE] = std::string("0"); // ADD } } int alu_idx = 1; do { // go through the ALU chain auto alu_bel = ci->attrs.find(id_BEL); if (alu_bel != ci->attrs.end()) { log_error("ALU %s placement restrictions are not supported.\n", ctx->nameOf(ci)); return; } // remove cell packed_cells.insert(ci->name); // CIN/COUT are hardwired, delete ci->disconnectPort(id_CIN); NetInfo *cout = ci->ports.at(id_COUT).net; ci->disconnectPort(id_COUT); std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_ALULC"); if (ctx->verbose) { log_info("packed ALU into %s. COUT net is %s\n", ctx->nameOf(packed.get()), ctx->nameOf(cout)); } int mode = int_or_default(ci->params, id_ALU_MODE); packed->params[id_ALU_MODE] = mode; if (mode == 9) { // MULT packed->connectPort(id_C, ctx->nets[ctx->id("$PACKER_GND_NET")].get()); } else { packed->connectPort(id_C, ctx->nets[ctx->id("$PACKER_VCC_NET")].get()); } // add to cluster packed->cluster = packed_head->name; packed->constr_z = alu_idx % 6; packed->constr_x = alu_idx / 6; packed->constr_y = 0; packed_head->constr_children.push_back(packed.get()); ++alu_idx; // connect all remainig ports ci->movePortTo(id_SUM, packed.get(), id_F); switch (mode) { case 0: // ADD ci->movePortTo(id_I0, packed.get(), id_B); ci->movePortTo(id_I1, packed.get(), id_D); break; case 1: // SUB ci->movePortTo(id_I0, packed.get(), id_A); ci->movePortTo(id_I1, packed.get(), id_D); break; case 5: ci->movePortTo(id_I0, packed.get(), id_A); ci->movePortTo(id_I1, packed.get(), id_B); break; case 9: // MULT ci->movePortTo(id_I0, packed.get(), id_A); ci->movePortTo(id_I1, packed.get(), id_B); packed->disconnectPort(id_D); packed->connectPort(id_D, ctx->nets[ctx->id("$PACKER_VCC_NET")].get()); break; default: ci->movePortTo(id_I0, packed.get(), id_A); ci->movePortTo(id_I1, packed.get(), id_B); ci->movePortTo(id_I3, packed.get(), id_D); } new_cells.push_back(std::move(packed)); if (cout != nullptr && cout->users.entries() > 0) { // if COUT used by logic if ((cout->users.entries() > 1) || (!is_alu(ctx, (*cout->users.begin()).cell))) { if (ctx->verbose) { log_info("COUT is used by logic\n"); } // make gate C->logic std::unique_ptr<CellInfo> packed_tail = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_TAIL_ALULC"); if (ctx->verbose) { log_info("packed ALU tail into %s. COUT net is %s\n", ctx->nameOf(packed_tail.get()), ctx->nameOf(cout)); } packed_tail->params[id_ALU_MODE] = std::string("C2L"); packed_tail->connectPort(id_F, cout); // add to cluster packed_tail->cluster = packed_head->name; packed_tail->constr_z = alu_idx % 6; packed_tail->constr_x = alu_idx / 6; packed_tail->constr_y = 0; ++alu_idx; packed_head->constr_children.push_back(packed_tail.get()); new_cells.push_back(std::move(packed_tail)); make_dummy_alu(ctx, alu_idx, ci, packed_head.get(), new_cells); break; } // next ALU ci = (*cout->users.begin()).cell; // if ALU is too big if (alu_idx == (ctx->gridDimX - 2) * 6 - 1) { log_error("ALU %s is the %dth in the chain. Such long chains are not supported.\n", ctx->nameOf(ci), alu_idx); break; } } else { // COUT is unused if (ctx->verbose) { log_info("cell is the ALU tail. Index is %d\n", alu_idx); } make_dummy_alu(ctx, alu_idx, ci, packed_head.get(), new_cells); break; } } while (1); // add head to the cluster packed_head->cluster = packed_head->name; new_cells.push_back(std::move(packed_head)); } // actual delete, erase and move cells/nets for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // pack MUX2_LUT5 static void pack_mux2_lut5(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { if (bool_or_default(ci->attrs, id_SINGLE_INPUT_MUX)) { // find the muxed LUT NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *lut1 = net_driven_by(ctx, i1, is_lut, id_F); if (lut1 == nullptr) { log_error("MUX2_LUT5 '%s' port I1 isn't connected to the LUT\n", ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached lut1 %s\n", ctx->nameOf(lut1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(id_BEL); auto lut1_bel = lut1->attrs.find(id_BEL); if (lut1_bel != lut1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT5 '%s' placement restrictions are not supported yet\n", ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_GW_MUX2_LUT5, ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; lut1->cluster = packed->name; lut1->constr_z = -ctx->mux_0_z + 1; packed->constr_children.clear(); // reconnect MUX ports ci->movePortTo(id_O, packed.get(), id_OF); ci->movePortTo(id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } else { // find the muxed LUTs NetInfo *i0 = ci->ports.at(id_I0).net; NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *lut0 = net_driven_by(ctx, i0, is_lut, id_F); CellInfo *lut1 = net_driven_by(ctx, i1, is_lut, id_F); if (lut0 == nullptr || lut1 == nullptr) { log_error("MUX2_LUT5 '%s' port I0 or I1 isn't connected to the LUT\n", ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached lut0 %s\n", ctx->nameOf(lut0)); log_info("found attached lut1 %s\n", ctx->nameOf(lut1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(id_BEL); auto lut0_bel = lut0->attrs.find(id_BEL); auto lut1_bel = lut1->attrs.find(id_BEL); if (lut0_bel != lut0->attrs.end() || lut1_bel != lut1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT5 '%s' placement restrictions are not supported yet\n", ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_GW_MUX2_LUT5, ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; lut0->cluster = packed->name; lut0->constr_z = -ctx->mux_0_z; lut1->cluster = packed->name; lut1->constr_z = -ctx->mux_0_z + 1; packed->constr_children.clear(); // reconnect MUX ports ci->movePortTo(id_O, packed.get(), id_OF); ci->movePortTo(id_S0, packed.get(), id_SEL); ci->movePortTo(id_I0, packed.get(), id_I0); ci->movePortTo(id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } } // Common MUX2 packing routine static void pack_mux2_lut(Context *ctx, CellInfo *ci, bool (*pred)(const BaseCtx *, const CellInfo *), char const type_suffix, IdString const type_id, int const x[2], int const z[2], pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { // find the muxed LUTs NetInfo *i0 = ci->ports.at(id_I0).net; NetInfo *i1 = ci->ports.at(id_I1).net; CellInfo *mux0 = net_driven_by(ctx, i0, pred, id_OF); CellInfo *mux1 = net_driven_by(ctx, i1, pred, id_OF); if (mux0 == nullptr || mux1 == nullptr) { log_error("MUX2_LUT%c '%s' port I0 or I1 isn't connected to the MUX\n", type_suffix, ctx->nameOf(ci)); return; } if (ctx->verbose) { log_info("found attached mux0 %s\n", ctx->nameOf(mux0)); log_info("found attached mux1 %s\n", ctx->nameOf(mux1)); } // XXX enable the placement constraints auto mux_bel = ci->attrs.find(id_BEL); auto mux0_bel = mux0->attrs.find(id_BEL); auto mux1_bel = mux1->attrs.find(id_BEL); if (mux0_bel != mux0->attrs.end() || mux1_bel != mux1->attrs.end() || mux_bel != ci->attrs.end()) { log_error("MUX2_LUT%c '%s' placement restrictions are not supported yet\n", type_suffix, ctx->nameOf(ci)); return; } std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, type_id, ci->name.str(ctx) + "_LC"); if (ctx->verbose) { log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); } // mux is the cluster root packed->cluster = packed->name; mux0->cluster = packed->name; mux0->constr_x = x[0]; mux0->constr_y = 0; mux0->constr_z = z[0]; for (auto &child : mux0->constr_children) { child->cluster = packed->name; child->constr_x += mux0->constr_x; child->constr_z += mux0->constr_z; packed->constr_children.push_back(child); } mux0->constr_children.clear(); mux1->cluster = packed->name; mux1->constr_x = x[1]; mux0->constr_y = 0; mux1->constr_z = z[1]; for (auto &child : mux1->constr_children) { child->cluster = packed->name; child->constr_x += mux1->constr_x; child->constr_z += mux1->constr_z; packed->constr_children.push_back(child); } mux1->constr_children.clear(); packed->constr_children.push_back(mux0); packed->constr_children.push_back(mux1); // reconnect MUX ports ci->movePortTo(id_O, packed.get(), id_OF); ci->movePortTo(id_S0, packed.get(), id_SEL); ci->movePortTo(id_I0, packed.get(), id_I0); ci->movePortTo(id_I1, packed.get(), id_I1); // remove cells packed_cells.insert(ci->name); // new MUX cell new_cells.push_back(std::move(packed)); } // pack MUX2_LUT6 static void pack_mux2_lut6(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {0, 0}; static int z[] = {+1, -1}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut5, '6', id_GW_MUX2_LUT6, x, z, packed_cells, delete_nets, new_cells); } // pack MUX2_LUT7 static void pack_mux2_lut7(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {0, 0}; static int z[] = {+2, -2}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut6, '7', id_GW_MUX2_LUT7, x, z, packed_cells, delete_nets, new_cells); } // pack MUX2_LUT8 static void pack_mux2_lut8(Context *ctx, CellInfo *ci, pool<IdString> &packed_cells, pool<IdString> &delete_nets, std::vector<std::unique_ptr<CellInfo>> &new_cells) { static int x[] = {1, 0}; static int z[] = {-4, -4}; pack_mux2_lut(ctx, ci, is_gw_mux2_lut7, '8', id_GW_MUX2_LUT8, x, z, packed_cells, delete_nets, new_cells); } // Pack wide LUTs static void pack_wideluts(Context *ctx) { log_info("Packing wide LUTs..\n"); pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; pool<IdString> mux2lut6; pool<IdString> mux2lut7; pool<IdString> mux2lut8; // do MUX2_LUT5 and collect LUT6/7/8 log_info("Packing LUT5s..\n"); for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) { log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); } if (is_widelut(ctx, ci)) { if (is_mux2_lut5(ctx, ci)) { pack_mux2_lut5(ctx, ci, packed_cells, delete_nets, new_cells); } else { if (is_mux2_lut6(ctx, ci)) { mux2lut6.insert(ci->name); } else { if (is_mux2_lut7(ctx, ci)) { mux2lut7.insert(ci->name); } else { if (is_mux2_lut8(ctx, ci)) { mux2lut8.insert(ci->name); } } } } } } // do MUX_LUT6 log_info("Packing LUT6s..\n"); for (auto &cell_name : mux2lut6) { pack_mux2_lut6(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // do MUX_LUT7 log_info("Packing LUT7s..\n"); for (auto &cell_name : mux2lut7) { pack_mux2_lut7(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // do MUX_LUT8 log_info("Packing LUT8s..\n"); for (auto &cell_name : mux2lut8) { pack_mux2_lut8(ctx, ctx->cells[cell_name].get(), packed_cells, delete_nets, new_cells); } // actual delete, erase and move cells/nets for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Pack LUTs and LUT-FF pairs static void pack_lut_lutffs(Context *ctx) { log_info("Packing LUT-FFs..\n"); pool<IdString> packed_cells; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); if (is_lut(ctx, ci)) { std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_LC"); for (auto &attr : ci->attrs) packed->attrs[attr.first] = attr.second; packed_cells.insert(ci->name); if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); // See if we can pack into a DFF // TODO: LUT cascade NetInfo *o = ci->ports.at(id_F).net; CellInfo *dff = net_only_drives(ctx, o, is_ff, id_D, true); auto lut_bel = ci->attrs.find(id_BEL); bool packed_dff = false; if (dff) { if (ctx->verbose) log_info("found attached dff %s\n", ctx->nameOf(dff)); auto dff_bel = dff->attrs.find(id_BEL); if (lut_bel != ci->attrs.end() && dff_bel != dff->attrs.end() && lut_bel->second != dff_bel->second) { // Locations don't match, can't pack } else { lut_to_lc(ctx, ci, packed.get(), false); dff_to_lc(ctx, dff, packed.get(), false); ctx->nets.erase(o->name); if (dff_bel != dff->attrs.end()) packed->attrs[id_BEL] = dff_bel->second; packed_cells.insert(dff->name); if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(dff), ctx->nameOf(packed.get())); packed_dff = true; } } if (!packed_dff) { lut_to_lc(ctx, ci, packed.get(), true); } new_cells.push_back(std::move(packed)); } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Pack FFs not packed as LUTFFs static void pack_nonlut_ffs(Context *ctx) { log_info("Packing non-LUT FFs..\n"); pool<IdString> packed_cells; std::vector<std::unique_ptr<CellInfo>> new_cells; for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (is_ff(ctx, ci)) { std::unique_ptr<CellInfo> packed = create_generic_cell(ctx, id_SLICE, ci->name.str(ctx) + "_DFFLC"); for (auto &attr : ci->attrs) packed->attrs[attr.first] = attr.second; if (ctx->verbose) log_info("packed cell %s into %s\n", ctx->nameOf(ci), ctx->nameOf(packed.get())); packed_cells.insert(ci->name); dff_to_lc(ctx, ci, packed.get(), true); new_cells.push_back(std::move(packed)); } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Merge a net into a constant net static void set_net_constant(const Context *ctx, NetInfo *orig, NetInfo *constnet, bool constval) { orig->driver.cell = nullptr; for (auto user : orig->users) { if (user.cell != nullptr) { CellInfo *uc = user.cell; if (ctx->verbose) log_info("%s user %s\n", ctx->nameOf(orig), ctx->nameOf(uc)); if ((is_lut(ctx, uc) || is_lc(ctx, uc)) && (user.port.str(ctx).at(0) == 'I') && !constval) { uc->ports[user.port].net = nullptr; uc->ports[user.port].user_idx = {}; } else { uc->ports[user.port].net = constnet; uc->ports[user.port].user_idx = constnet->users.add(user); } } } orig->users.clear(); } // Pack constants (simple implementation) static void pack_constants(Context *ctx) { log_info("Packing constants..\n"); std::unique_ptr<CellInfo> gnd_cell = create_generic_cell(ctx, id_SLICE, "$PACKER_GND"); gnd_cell->params[id_INIT] = Property(0, 1 << 4); auto gnd_net = std::make_unique<NetInfo>(ctx->id("$PACKER_GND_NET")); gnd_net->driver.cell = gnd_cell.get(); gnd_net->driver.port = id_F; gnd_cell->ports.at(id_F).net = gnd_net.get(); std::unique_ptr<CellInfo> vcc_cell = create_generic_cell(ctx, id_SLICE, "$PACKER_VCC"); // Fill with 1s vcc_cell->params[id_INIT] = Property(Property::S1).extract(0, (1 << 4), Property::S1); auto vcc_net = std::make_unique<NetInfo>(ctx->id("$PACKER_VCC_NET")); vcc_net->driver.cell = vcc_cell.get(); vcc_net->driver.port = id_F; vcc_cell->ports.at(id_F).net = vcc_net.get(); std::vector<IdString> dead_nets; bool gnd_used = true; // XXX May be needed for simplified IO for (auto &net : ctx->nets) { NetInfo *ni = net.second.get(); if (ni->driver.cell != nullptr && ni->driver.cell->type == id_GND) { IdString drv_cell = ni->driver.cell->name; set_net_constant(ctx, ni, gnd_net.get(), false); gnd_used = true; dead_nets.push_back(net.first); ctx->cells.erase(drv_cell); } else if (ni->driver.cell != nullptr && ni->driver.cell->type == id_VCC) { IdString drv_cell = ni->driver.cell->name; set_net_constant(ctx, ni, vcc_net.get(), true); dead_nets.push_back(net.first); ctx->cells.erase(drv_cell); } } if (gnd_used) { ctx->cells[gnd_cell->name] = std::move(gnd_cell); ctx->nets[gnd_net->name] = std::move(gnd_net); } // never used?) ctx->cells[vcc_cell->name] = std::move(vcc_cell); ctx->nets[vcc_net->name] = std::move(vcc_net); for (auto dn : dead_nets) { ctx->nets.erase(dn); } } static bool is_nextpnr_iob(const Context *ctx, CellInfo *cell) { return cell->type == ctx->id("$nextpnr_ibuf") || cell->type == ctx->id("$nextpnr_obuf") || cell->type == ctx->id("$nextpnr_iobuf"); } static bool is_gowin_iob(const Context *ctx, const CellInfo *cell) { switch (cell->type.index) { case ID_IBUF: case ID_OBUF: case ID_IOBUF: case ID_TBUF: return true; default: return false; } } static bool is_gowin_diff_iob(const Context *ctx, const CellInfo *cell) { switch (cell->type.index) { case ID_TLVDS_OBUF: return true; default: return false; } } static bool is_iob(const Context *ctx, const CellInfo *cell) { return (cell->type.index == ID_IOB); } // Pack differential IO buffers static void pack_diff_io(Context *ctx) { pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; log_info("Packing diff IOs..\n"); for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); if (is_gowin_diff_iob(ctx, ci)) { CellInfo *iob_p = nullptr; CellInfo *iob_n = nullptr; switch (ci->type.index) { case ID_TLVDS_OBUF: { iob_p = net_only_drives(ctx, ci->ports.at(id_O).net, is_iob, id_I); iob_n = net_only_drives(ctx, ci->ports.at(id_OB).net, is_iob, id_I); NPNR_ASSERT(iob_p != nullptr); NPNR_ASSERT(iob_n != nullptr); auto iob_p_bel_a = iob_p->attrs.find(id_BEL); if (iob_p_bel_a == ci->attrs.end()) { log_error("LVDS '%s' must be restricted.\n", ctx->nameOf(ci)); continue; } BelId iob_p_bel = ctx->getBelByNameStr(iob_p_bel_a->second.as_string()); Loc loc_p = ctx->getBelLocation(iob_p_bel); if (loc_p.z != 0) { log_error("LVDS '%s' positive pin is not A.\n", ctx->nameOf(ci)); continue; } // restrict the N buffer loc_p.z = 1; iob_n->attrs[id_BEL] = ctx->getBelName(ctx->getBelByLocation(loc_p)).str(ctx); // mark IOBs as part of DS pair iob_n->attrs[id_DIFF] = std::string("N"); iob_n->attrs[id_DIFF_TYPE] = std::string("TLVDS_OBUF"); iob_p->attrs[id_DIFF] = std::string("P"); iob_p->attrs[id_DIFF_TYPE] = std::string("TLVDS_OBUF"); // disconnect N input: it is wired internally delete_nets.insert(iob_n->ports.at(id_I).net->name); iob_n->disconnectPort(id_I); ci->disconnectPort(id_OB); // disconnect P output delete_nets.insert(ci->ports.at(id_O).net->name); ci->disconnectPort(id_O); // connect TLVDS input to P input ci->movePortTo(id_I, iob_p, id_I); packed_cells.insert(ci->name); } break; default: break; } } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Pack IO buffers static void pack_io(Context *ctx) { pool<IdString> packed_cells; pool<IdString> delete_nets; std::vector<std::unique_ptr<CellInfo>> new_cells; log_info("Packing IOs..\n"); for (auto &cell : ctx->cells) { CellInfo *ci = cell.second.get(); if (ctx->verbose) log_info("cell '%s' is of type '%s'\n", ctx->nameOf(ci), ci->type.c_str(ctx)); if (is_gowin_iob(ctx, ci)) { CellInfo *iob = nullptr; switch (ci->type.index) { case ID_IBUF: iob = net_driven_by(ctx, ci->ports.at(id_I).net, is_nextpnr_iob, id_O); break; case ID_OBUF: iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I); break; case ID_IOBUF: iob = net_driven_by(ctx, ci->ports.at(id_IO).net, is_nextpnr_iob, id_O); break; case ID_TBUF: iob = net_only_drives(ctx, ci->ports.at(id_O).net, is_nextpnr_iob, id_I); break; default: break; } if (iob != nullptr) { // delete the $nexpnr_[io]buf for (auto &p : iob->ports) { IdString netname = p.second.net->name; iob->disconnectPort(p.first); delete_nets.insert(netname); } packed_cells.insert(iob->name); } // what type to create IdString new_cell_type = id_IOB; std::string constr_bel_name = std::string(""); // check whether the given IO is limited to simplified IO cells auto constr_bel = ci->attrs.find(id_BEL); if (constr_bel != ci->attrs.end()) { constr_bel_name = constr_bel->second.as_string(); } constr_bel = iob->attrs.find(id_BEL); if (constr_bel != iob->attrs.end()) { constr_bel_name = constr_bel->second.as_string(); } if (!constr_bel_name.empty()) { BelId constr_bel = ctx->getBelByNameStr(constr_bel_name); if (constr_bel != BelId()) { new_cell_type = ctx->bels[constr_bel].type; } } // Create a IOB buffer std::unique_ptr<CellInfo> ice_cell = create_generic_cell(ctx, new_cell_type, ci->name.str(ctx) + "$iob"); gwio_to_iob(ctx, ci, ice_cell.get(), packed_cells); new_cells.push_back(std::move(ice_cell)); auto gwiob = new_cells.back().get(); packed_cells.insert(ci->name); if (iob != nullptr) { // in Gowin .CST port attributes take precedence over cell attributes. // first copy cell attrs related to IO for (auto &attr : ci->attrs) { if (attr.first == IdString(ID_BEL) || attr.first.str(ctx)[0] == '&') { gwiob->setAttr(attr.first, attr.second); } } // rewrite attributes from the port for (auto &attr : iob->attrs) { gwiob->setAttr(attr.first, attr.second); } } } } for (auto pcell : packed_cells) { ctx->cells.erase(pcell); } for (auto dnet : delete_nets) { ctx->nets.erase(dnet); } for (auto &ncell : new_cells) { ctx->cells[ncell->name] = std::move(ncell); } } // Main pack function bool Arch::pack() { Context *ctx = getCtx(); try { log_break(); pack_constants(ctx); pack_io(ctx); pack_diff_io(ctx); pack_wideluts(ctx); pack_alus(ctx); pack_lut_lutffs(ctx); pack_nonlut_ffs(ctx); ctx->settings[id_pack] = 1; ctx->assignArchInfo(); log_info("Checksum: 0x%08x\n", ctx->checksum()); return true; } catch (<API key>) { return false; } } <API key>
#include "wmanager.h" #include <natio.h> uint8_t *screen; size_t screen_width, screen_height; void update_screen(int x1, int y1, int x2, int y2) { struct window_t *window; char buffer[32]; if (x1 < 0) x1 = 0; if (y1 < 0) y1 = 0; if (x2 > (int) screen_width) x2 = screen_width; if (y2 > (int) screen_height) y2 = screen_height; for (int x = x1; x < x2; x++) { for (int y = y1; y < y2; y++) { for (int c = 0; c < 3; c++) { screen[(x + y * screen_width) * 4 + c] = 0; } screen[(x + y * screen_width) * 4 + 3] = 0xff; } } for (window = windows; window; window = window->next) { draw_window(window, x1, y1, x2, y2); } draw_cursor(x1, y1, x2, y2); sprintf(buffer, "syncrect %i %i %i %i", x1, y1, x2 - x1, y2 - y1); rcall(vgafd, buffer); } void blit_bitmap(const uint8_t *bitmap, int tox, int toy, size_t width, size_t height, int x1, int y1, int x2, int y2) { for (size_t x = tox >= x1 ? tox : x1; x < tox + width && x < (size_t) x2; x++) { for (size_t y = toy >= y1 ? toy : y1; y < toy + height && y < (size_t) y2; y++) { size_t screen_index = (x + y * screen_width) * 4; size_t bitmap_index = ((x - tox) + (y - toy) * width) * 4; double alpha = bitmap[bitmap_index + 3] / 255.0; for (int c = 0; c < 3; c++) { screen[screen_index + c] = (1 - alpha) * screen[screen_index + c] + alpha * bitmap[bitmap_index + c]; } } } }
const requireDir = require('require-dir') module.exports = { templates: requireDir('./templates'), spec: requireDir('./spec'), dict: requireDir('./dict') }
#include <fstream> #include <sstream> #include <arpa/inet.h> #include <utime.h> #include "DBFileSource.hpp" #include "../common/PostgresUtils.hpp" #include "../common/FormattedException.hpp" #define <API key> #include <boost/filesystem.hpp> #include <boost/format.hpp> #include "common/RC2Utils.hpp" #include "RC2Logging.h" using namespace std; using boost::format; namespace fs = boost::filesystem; class RC2::DBFileSource::Impl { public: long wspaceId_; string workingDir_; }; RC2::DBFileSource::DBFileSource() : _impl(new Impl()) { } RC2::DBFileSource::~DBFileSource() { } void RC2::DBFileSource::initializeSource(std::shared_ptr<PGDBConnection> connection, long wsid) { dbcon_ = connection; _impl->wspaceId_ = wsid; //verify workspace exists in database ostringstream query; query << "select id,name from rcworkspace where id = " << wsid; DBResult res = connection->executeQuery(query.str()); if (res.rowsReturned() < 1) throw std::runtime_error((format("invalid workspace id: %1%") % wsid).str()); } void RC2::DBFileSource::setWorkingDir(string workingDir) { _impl->workingDir_ = workingDir; } bool RC2::DBFileSource::loadRData() { string filepath = _impl->workingDir_ + "/.RData"; ostringstream query; query << "select bindata from rcworkspacedata where id = " << _impl->wspaceId_; LOG(INFO) << "load:" << query.str() << std::endl; DBResult res = dbcon_->executeQuery(query.str(), 0, NULL, NULL, NULL, NULL, 1); // ExecStatusType rc = PQresultStatus(res); if (res.dataReturned()) { int datalen = res.getLength(0, 0); if (datalen > 0) { char *data = res.getValue(0, 0); ofstream rdata; rdata.open(filepath, ios::out | ios::trunc | ios::binary); rdata.write(data, datalen); rdata.close(); LOG(INFO) << ".RData loaded" << std::endl; return true; } } LOG(INFO) << ".RData not loaded" << std::endl; return false; } void RC2::DBFileSource::saveRData() { size_t newSize=0; string filePath = _impl->workingDir_ + "/.RData"; if (!fs::exists(filePath)) { LOG(INFO) << "no .RData file to save" << std::endl; return; } unique_ptr<char[]> data = ReadFileBlob(filePath, newSize); DBTransaction trans = dbcon_->startTransaction(); DBResult lockRes = dbcon_->executeQuery("lock table rcworkspacedata in access exclusive mode"); if (!lockRes.commandOK()) { LOG(WARNING) << "saveRData failed to get lock on table" << std::endl; return; } ostringstream query; query << "update rcworkspacedata set bindata = $1::bytea where id = " << _impl->wspaceId_; int pformats[] = {1}; int pSizes[] = {(int)newSize}; const char *params[] = {data.get()}; DBResult res = dbcon_->executeQuery(query.str(), 1, NULL, params, pSizes, pformats, 1); if (!res.commandOK()) { throw FormattedException("failed to update rcworkspacedata %ld: %s", _impl->wspaceId_, res.errorMessage()); } if (res.rowsAffected() < 1) { ostringstream iquery; iquery << "insert into rcworkspacedata (id,bindata) values (" << _impl->wspaceId_ << ", $1::bytea)"; DBResult iRes = dbcon_->executeQuery(iquery.str(), 1, NULL, params, pSizes, pformats, 1); if (!iRes.commandOK()) { throw FormattedException("failed to insert rcworkspacedata %ld:%s", _impl->wspaceId_, iRes.errorMessage()); } } DBResult commitRes(trans.commit()); if (!commitRes.commandOK()) { throw FormattedException("failed to commit save rdata"); } } void RC2::DBFileSource::loadFiles(const char *whereClause) { ostringstream query; query << "select f.id::int4, f.version::int4, f.name, extract('epoch' from f.lastmodified)::int4, " "d.bindata from rcfile f join rcfiledata d on f.id = d.id " << whereClause; DBResult res = dbcon_->executeQuery(query.str(), 0, NULL, NULL, NULL, NULL); if (res.dataReturned()) { int numfiles = res.rowsReturned(); for (int i=0; i < numfiles; i++) { uint32_t pid=0, pver=0, lastmod=0; string pname; char *ptr; ptr = res.getValue(i, 0); pid = ntohl(*(uint32_t*)ptr); ptr = res.getValue(i, 1); pver = ntohl(*(uint32_t*)ptr); pname = res.getValue(i, 2); ptr = res.getValue(i, 3); lastmod = ntohl(*(uint32_t*)ptr); int datalen = res.getLength(i, 4); char *data = res.getValue(i, 4); DBFileInfoPtr filePtr; if (filesById_.count(pid) > 0) { filePtr = filesById_.at(pid); filePtr->version = pver; filePtr->name = pname; } else { filePtr = DBFileInfoPtr(new DBFileInfo(pid, pver, pname)); filesById_.insert(map<long,DBFileInfoPtr>::value_type(pid, filePtr)); } //write data to disk fs::path filepath(_impl->workingDir_); filepath /= pname; ofstream filest; filest.open(filepath.string(), ios::out | ios::trunc | ios::binary); filest.write(data, datalen); filest.close(); //set modification time struct utimbuf modbuf; modbuf.actime = modbuf.modtime = lastmod; utime(filepath.c_str(), &modbuf); } } else { LOG(WARNING) << "sql error: " << res.errorMessage() << endl; } } void RC2::DBFileSource::<API key>(long fileId, long wspaceId) { if (_impl->wspaceId_ != wspaceId) return; //skip this file ostringstream where; where << "where f.id = " << fileId; loadFiles(where.str().c_str()); } void RC2::DBFileSource::removeLocalFile(long fileId) { DBFileInfoPtr finfo = filesById_[fileId]; fs::path fpath(_impl->workingDir_); fpath /= finfo->path; fs::remove(fpath); filesById_.erase(fileId); // filesByWatchDesc_.erase(fileId); } long RC2::DBFileSource::insertDBFile(string fname) { string filePath = _impl->workingDir_ + "/" + fname; LOG(INFO) << "insertDBFile(" << fname << ")" << endl; DBTransaction trans = dbcon_->startTransaction(); long fileId = dbcon_->longFromQuery("select nextval('rcfile_seq'::regclass)"); DBFileInfoPtr fobj(new DBFileInfo(fileId, 1, fname)); if (stat(filePath.c_str(), &fobj->sb) == -1) throw runtime_error((format("stat failed for insert %s") % filePath).str()); time_t modTime = fobj->sb.st_mtime; size_t newSize=0; unique_ptr<char[]> data = ReadFileBlob(filePath, newSize); string escapedName; dbcon_->escapeLiteral(fname, escapedName); ostringstream query; query << "insert into rcfile (id, version, wspaceid" << ",name,filesize,lastmodified) values (" << fileId << ", 1, " << _impl->wspaceId_ << "," << escapedName << "," << newSize << ", to_timestamp(" << modTime << "))"; DBResult res1 = dbcon_->executeQuery(query.str()); if (!res1.commandOK()) { LOG(INFO) << "insert dbfile failed: " << res1.errorMessage() << endl; throw FormattedException("failed to insert file %s: %s", fname.c_str(), res1.errorMessage()); } query.clear(); query.str(""); query << "insert into rcfiledata (id, bindata) values (" << fileId << ", $1::bytea)"; int pformats[] = {1}; int pSizes[] = {(int)newSize}; const char *params[1] = {data.get()}; DBResult res2 = dbcon_->executeQuery(query.str(), 1, NULL, params, pSizes, pformats, 1); if (!res2.commandOK()) { LOG(INFO) << "executing query:" << query.str() << endl; LOG(INFO) << "insert dbfiledata failed: " << res2.errorMessage() << endl; throw FormattedException("failed to insert file %s: %s", fname.c_str(), res2.errorMessage()); } DBResult commitRes(trans.commit()); if (!commitRes.commandOK()) { throw FormattedException("failed to commit file inserts %s: %s", fname.c_str(), commitRes.errorMessage()); } //need to insert fobj filesById_.insert(map<long,DBFileInfoPtr>::value_type(fileId, fobj)); return fileId; } void RC2::DBFileSource::updateDBFile(DBFileInfoPtr fobj) { LOG(INFO) << "update file:" << fobj->name << endl; int newVersion = fobj->version + 1; string filePath = _impl->workingDir_ + "/" + fobj->path; if (stat(filePath.c_str(), &fobj->sb) == -1) throw runtime_error((format("stat failed for update %s") % fobj->name).str()); time_t newMod = fobj->sb.st_mtime; size_t newSize=0; unique_ptr<char[]> data = ReadFileBlob(filePath, newSize); DBTransaction trans = dbcon_->startTransaction(); ostringstream query; query << "update rcfile set version = " << newVersion << ", lastmodified = to_timestamp(" << newMod << "), filesize = " << newSize << " where id = " << fobj->id; LOG(INFO) << "executing " << query.str() << endl; DBResult res1 = dbcon_->executeQuery(query.str()); if (!res1.commandOK()) { throw FormattedException("failed to update file %ld: %s", fobj->id, res1.errorMessage()); } query.clear(); query.str(""); query << "update rcfiledata set bindata = $1::bytea where id = " << fobj->id; int pformats[] = {1}; int pSizes[] = {(int)newSize}; const char *params[] = {data.get()}; DBResult res2 = dbcon_->executeQuery(query.str(), 1, NULL, params, pSizes, pformats); if (!res2.commandOK()) { throw FormattedException("failed to update file %ld: %s", fobj->id, res2.errorMessage()); } DBResult commitRes(trans.commit()); if (!commitRes.commandOK()) { throw FormattedException("failed to commit file updates %ld: %s", fobj->id, commitRes.errorMessage()); } fobj->version = newVersion; } void RC2::DBFileSource::removeDBFile(DBFileInfoPtr fobj) { ostringstream query; query << "delete from rcfile where id = " << fobj->id; DBResult res = dbcon_->executeQuery(query.str()); if (res.commandOK()) { filesById_.erase(fobj->id); } else { LOG(WARNING) << "sql error delting file " << fobj->id << ":" << res.errorMessage() << endl; } }
const easingOptions = { // no easing, no acceleration linear: function(t) { return t; }, // accelerating from zero velocity easeInQuad: function(t) { return t * t; }, // decelerating to zero velocity easeOutQuad: function(t) { return t * (2 - t); }, // acceleration until halfway, then deceleration easeInOutQuad: function(t) { return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t; }, // accelerating from zero velocity easeInCubic: function(t) { return t * t * t; }, // decelerating to zero velocity easeOutCubic: function(t) { return --t * t * t + 1; }, // acceleration until halfway, then deceleration easeInOutCubic: function(t) { return t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1; }, // accelerating from zero velocity easeInQuart: function(t) { return t * t * t * t; }, // decelerating to zero velocity easeOutQuart: function(t) { return 1 - --t * t * t * t; }, // acceleration until halfway, then deceleration easeInOutQuart: function(t) { return t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t; }, // accelerating from zero velocity easeInQuint: function(t) { return t * t * t * t * t; }, // decelerating to zero velocity easeOutQuint: function(t) { return 1 + --t * t * t * t * t; }, // acceleration until halfway, then deceleration easeInOutQuint: function(t) { return t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t; }, }; export default easingOptions;
/* eslint no-shadow:[0] */ import test from 'tape'; import MapboxDraw from '../index'; import modes from '../src/modes/index'; import <API key> from './fixtures/style_with_sources.json'; test('Options test', (t) => { t.test('no options', (t) => { const Draw = new MapboxDraw(); const defaultOptions = { defaultMode: 'simple_select', modes, touchEnabled: true, keybindings: true, clickBuffer: 2, touchBuffer: 25, <API key>: true, boxSelect: true, userProperties: false, styles: Draw.options.styles, controls: { point: true, line_string: true, polygon: true, trash: true, combine_features: true, uncombine_features: true } }; t.deepEquals(defaultOptions, Draw.options); t.deepEquals(<API key>, Draw.options.styles); t.end(); }); t.test('use custom clickBuffer', (t) => { const Draw = new MapboxDraw({ clickBuffer: 10 }); const defaultOptions = { defaultMode: 'simple_select', modes, keybindings: true, touchEnabled: true, clickBuffer: 10, touchBuffer: 25, boxSelect: true, <API key>: true, styles: Draw.options.styles, userProperties: false, controls: { point: true, line_string: true, polygon: true, trash: true, combine_features: true, uncombine_features: true } }; t.deepEquals(defaultOptions, Draw.options); t.end(); }); t.test('hide all controls', (t) => { const Draw = new MapboxDraw({<API key>: false}); const defaultOptions = { defaultMode: 'simple_select', modes, keybindings: true, touchEnabled: true, clickBuffer: 2, touchBuffer: 25, boxSelect: true, <API key>: false, userProperties: false, styles: Draw.options.styles, controls: { point: false, line_string: false, polygon: false, trash: false, combine_features: false, uncombine_features: false } }; t.deepEquals(defaultOptions, Draw.options); t.end(); }); t.test('hide controls but show point', (t) => { const Draw = new MapboxDraw({<API key>: false, controls: {point:true}}); const defaultOptions = { defaultMode: 'simple_select', modes, keybindings: true, touchEnabled: true, <API key>: false, clickBuffer: 2, touchBuffer: 25, boxSelect: true, userProperties: false, styles: Draw.options.styles, controls: { point: true, line_string: false, polygon: false, trash: false, combine_features: false, uncombine_features: false } }; t.deepEquals(defaultOptions, Draw.options); t.end(); }); t.test('hide only point control', (t) => { const Draw = new MapboxDraw({ controls: {point:false}}); const defaultOptions = { defaultMode: 'simple_select', modes, keybindings: true, touchEnabled: true, <API key>: true, touchBuffer: 25, clickBuffer: 2, userProperties: false, boxSelect: true, styles: Draw.options.styles, controls: { point: false, line_string: true, polygon: true, trash: true, combine_features: true, uncombine_features: true } }; t.deepEquals(defaultOptions, Draw.options); t.end(); }); t.test('disable touch interaction', (t) => { const Draw = new MapboxDraw({ touchEnabled: false }); const defaultOptions = { defaultMode: 'simple_select', modes, touchEnabled: false, keybindings: true, clickBuffer: 2, touchBuffer: 25, <API key>: true, userProperties: false, boxSelect: true, styles: Draw.options.styles, controls: { point: true, line_string: true, polygon: true, trash: true, combine_features: true, uncombine_features: true } }; t.deepEquals(defaultOptions, Draw.options); t.deepEquals(<API key>, Draw.options.styles); t.end(); }); t.test('custom styles', (t) => { const Draw = new MapboxDraw({styles: [{ 'id': 'custom-polygon', 'type': 'fill', 'filter': ['all', ['==', '$type', 'Polygon']], 'paint': { 'fill-color': '#fff' } }, { 'id': 'custom-point', 'type': 'circle', 'filter': ['all', ['==', '$type', 'Point']], 'paint': { 'circle-color': '#fff' } }]}); const styles = [ { 'id': 'custom-polygon.cold', 'source': 'mapbox-gl-draw-cold', 'type': 'fill', 'filter': ['all', ['==', '$type', 'Polygon']], 'paint': { 'fill-color': '#fff' } }, { 'id': 'custom-point.cold', 'source': 'mapbox-gl-draw-cold', 'type': 'circle', 'filter': ['all', ['==', '$type', 'Point']], 'paint': { 'circle-color': '#fff' } }, { 'id': 'custom-polygon.hot', 'source': 'mapbox-gl-draw-hot', 'type': 'fill', 'filter': ['all', ['==', '$type', 'Polygon']], 'paint': { 'fill-color': '#fff' } }, { 'id': 'custom-point.hot', 'source': 'mapbox-gl-draw-hot', 'type': 'circle', 'filter': ['all', ['==', '$type', 'Point']], 'paint': { 'circle-color': '#fff' } } ]; t.deepEquals(styles, Draw.options.styles); t.end(); }); });
describe('iD.operationStraighten', function () { var fakeContext; var graph; // Set up the fake context fakeContext = {}; fakeContext.graph = function () { return graph; }; fakeContext.<API key> = function () { return false; }; describe('#available', function () { beforeEach(function () { // w1 - way with 2 nodes // w1-2 - way with 2 nodes connected to w1 // w2 - way with 3 nodes connected to w1 // w3 - way with 3 nodes connected to w2 // w4 - way with 3 nodes connected to w3 // w5 - way with 4 nodes not connected to any other nodes graph = iD.coreGraph([ iD.osmNode({ id: 'n1', type: 'node' }), iD.osmNode({ id: 'n2', type: 'node' }), iD.osmNode({ id: 'n2-1', type: 'node' }), iD.osmNode({ id: 'n3', type: 'node' }), iD.osmNode({ id: 'n4', type: 'node' }), iD.osmNode({ id: 'n5', type: 'node' }), iD.osmNode({ id: 'n6', type: 'node' }), iD.osmNode({ id: 'n7', type: 'node' }), iD.osmNode({ id: 'n8', type: 'node' }), iD.osmNode({ id: 'n9', type: 'node' }), iD.osmNode({ id: 'n10', type: 'node' }), iD.osmNode({ id: 'n11', type: 'node' }), iD.osmNode({ id: 'n12', type: 'node' }), iD.osmNode({ id: 'n13', type: 'node' }), iD.osmWay({ id: 'w1', nodes: ['n1', 'n2'] }), iD.osmWay({ id: 'w1-2', nodes: ['n2', 'n2-1'] }), iD.osmWay({ id: 'w2', nodes: ['n2', 'n3', 'n4'] }), iD.osmWay({ id: 'w2-2', nodes: ['n4', 'n13', 'n2'] }), // w-2 reversed iD.osmWay({ id: 'w3', nodes: ['n4', 'n5', 'n6'] }), iD.osmWay({ id: 'w4', nodes: ['n6', 'n7', 'n8'] }), iD.osmWay({ id: 'w5', nodes: ['n9', 'n10', 'n11', 'n12'] }), ]); }); it('is not available for no selected ids', function () { var result = iD.operationStraighten([], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is not available for way with only 2 nodes', function () { var result = iD.operationStraighten(['w1'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is available for way with only 2 nodes connected to another 2-node way', function () { var result = iD.operationStraighten(['w1', 'w1-2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is not available for unknown selected id', function () { var result = iD.operationStraighten(['w0'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is not available for non-continuous ways', function () { var result = iD.operationStraighten(['w2', 'w4'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is available for selected way with more than 2 nodes', function () { var result = iD.operationStraighten(['w2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for selected, ordered, continuous ways', function () { var result = iD.operationStraighten(['w1', 'w2', 'w3'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for selected, un-ordered, continuous ways', function () { var result = iD.operationStraighten(['w1', 'w3', 'w2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for selected, continuous ways with different way-directions', function () { var result = iD.operationStraighten(['w1', 'w3', 'w2-2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for 2 selected nodes in the same way, more than one node apart', function () { var result = iD.operationStraighten(['w5', 'n9', 'n11'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for 2 selected nodes in adjacent ways, more than one node apart', function () { var result = iD.operationStraighten(['w2', 'w3', 'n5', 'n3'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for 2 selected nodes in non-adjacent ways, providing inbetween ways are selected', function () { var result = iD.operationStraighten(['n2', 'n7', 'w4', 'w1', 'w3', 'w2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is available for 2 selected nodes in non-adjacent, <API key> ways, providing inbetween ways are selected', function () { var result = iD.operationStraighten(['n2', 'n7', 'w4', 'w1', 'w3', 'w2-2'], fakeContext.graph()).available(); expect(result).to.be.ok; }); it('is not available for nodes not on selected ways', function () { var result = iD.operationStraighten(['w5', 'n4', 'n11'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is not available for one selected node', function () { var result = iD.operationStraighten(['w5', 'n9'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); it('is not available for more than two selected nodes', function () { var result = iD.operationStraighten(['w5', 'n9', 'n11', 'n12'], fakeContext.graph()).available(); expect(result).to.be.not.ok; }); }); });
# -*- coding: utf-8 -*- import inlineplz.linters.jsonlint as jsonlint def test_jsonlint(): input = [ ("21.json", "21.json: line 1, col 25, found: ',' - expected: ':'."), ( "25.json", "25.json: line 1, col 1, found: 'INVALID' - expected: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', ']'.", ), ( "23.json", "23.json: line 1, col 13, found: 'INVALID' - expected: 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['.", ), ] messages = sorted(list(jsonlint.JSONLintParser().parse(input))) assert messages[0][2] == "21.json: line 1, col 25, found: ',' - expected: ':'." assert messages[0][1] == 1 assert messages[0][0] == "21.json"
## UNMAINTAINED This was an attempt at creating a sensible API for Linux Mint's MDM's HTML greeter. However, since Linux Mint has since abandoned MDM in favor of LightDM, this project has lost its purpose. The ideas of this project are based on experience collected in the [MDModern](https://github.com/philer/MDModern) theme.
#$LOAD_PATH << File.join(File.expand_path(File.dirname(__FILE__) , '..', 'lib') require 'extractor' describe Extractor do before(:each) do @html = Extractor.new(File.new('./spec/fixtures/first.html')) end context "when extracting html content" do context "dealing with head title" do before(:each) do @title = @html.title end it "should extract words frequency" do @title[:frequency].should include('my' => 2, 'first' => 2, 'title' => 2) end it "should extract words count" do @title[:word_count].should eq(6) end it "should extract words char size" do @title[:char_count].should eq(29) end end context "when dealing with images" do before(:each) do @images = @html.images end it "should retrieve number of images in page" do @images[:count].should eq(4) end it "should retrieve images with alt attribute" do @images[:alt_count].should eq(3) end end context "when dealing with meta keywords" do before(:each) do @keywords = @html.keywords end it "should extract words frequency" do @keywords[:frequency].should include('my' => 2, 'keywords' => 2) end it "should extract words count" do @keywords[:word_count].should eq(4) end it "should extract words char size" do @keywords[:char_count].should eq(24) end end context "when dealing with meta description" do before(:each) do @description = @html.description end it "should extract words frequency" do @description[:frequency].should include('my' => 2, 'description' => 2) end it "should extract words count" do @description[:word_count].should eq(4) end it "should extract words char size" do @description[:char_count].should eq(30) end end it "should extract javascript char size" do @html.js_size.should eq(130); end it "should extract h1 tags correctly" do @html.h1_tags.should include('my' => 2, 'first' => 2, 'heading' => 2) end it "should extract h2 tags correctly" do @html.h2_tags.should include('my' => 1, 'second' => 1, 'heading' => 1) end it "should extract h3 tags correctly" do @html.h3_tags.should include('my' => 1, 'third' => 1, 'heading' => 1) end it "should extract links content correctly" do @html.links.should include('my' => 2, 'first' => 1, 'second' => 1, 'link' => 2) end context "when dealing with page content" do before(:each) do @page = @html.page end it "should extract words frequency" do @page[:frequency].should include('my' => 9, 'first' => 6) end it "should not include words inside script tags" do @page[:frequency].should_not include('console') end it "should extract word count" do @page[:word_count].should eq(27) end it "should extract text count" do @page[:char_count][:text].should eq(226) end it "should extract byte count" do @page[:char_count][:byte].should eq(1358) end end end end
package application; class <API key> { public static <API key> createChain(Auction auction){ return new <API key>(auction, new <API key>(auction, new <API key>(auction, new <API key>(auction, new LogCarSaleProcessor(auction, new <API key>(auction, new <API key>(auction, new NoOpProcessor(auction)))))))); } }
using Avalonia; using Avalonia.Controls; using Avalonia.Markup.Xaml; namespace MangaReader.Avalonia.View { public class MangaProperties : UserControl { public MangaProperties() { this.InitializeComponent(); } private void InitializeComponent() { AvaloniaXamlLoader.Load(this); } } }
@extends('layouts.base') @section('content') {{--@include('partials.page-header')--}} @if (!have_posts()) <div class="alert alert-warning"> {{ __('Sorry, no results were found.', 'sage') }} </div> {!! get_search_form(false) !!} @endif @while (have_posts()) @php(the_post()) @include ('partials.content-'.(get_post_type() !== 'post' ? get_post_type() : get_post_format())) @endwhile {!! <API key>() !!} @endsection
<?php namespace Sbts\Bundle\ProjectBundle\Security\Authorization\Voter; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\User\UserInterface; use Sbts\Bundle\ProjectBundle\Entity\Project; use Sbts\Bundle\UserBundle\Entity\User; class ProjectVoter implements VoterInterface { const VIEW = 'view'; const EDIT = 'edit'; const CREATE = 'create'; const DELETE = 'delete'; /** * @param string $attribute * * @return bool */ public function supportsAttribute($attribute) { return in_array($attribute, [ self::VIEW, self::EDIT, self::CREATE, self::DELETE, ]); } /** * @param string|Project $project * * @return bool */ public function supportsClass($project) { $class = $project; if (!is_string($project)) { $class = get_class($project); } $supportedClass = 'Sbts\Bundle\ProjectBundle\Entity\Project'; return $supportedClass === $class || is_subclass_of($class, $supportedClass); } /** * @param TokenInterface $token * @param Project|string $project * @param array $attributes * * @return int */ public function vote(TokenInterface $token, $project, array $attributes) { // check if class of this object is supported by this voter if (!$this->supportsClass($project)) { return VoterInterface::ACCESS_ABSTAIN; } // check if the voter is used correct, only allow one attribute // this isn't a requirement, it's just one easy way for you to // design your voter if (1 !== count($attributes)) { throw new \<API key>('Only one attribute is allowed for VIEW, EDIT or CREATE'); } // set the attribute to check against $attribute = $attributes[0]; // check if the given attribute is covered by this voter if (!$this->supportsAttribute($attribute)) { return VoterInterface::ACCESS_ABSTAIN; } // get current logged in user /** @var User $user */ $user = $token->getUser(); // make sure there is a user object (i.e. that the user is logged in) if (!$user instanceof UserInterface) { return VoterInterface::ACCESS_DENIED; } switch ($attribute) { case self::VIEW: if ($this->userCanViewProject($user, $project)) { return VoterInterface::ACCESS_GRANTED; } break; case self::CREATE: case self::EDIT: if ($this->userCanEditProject($user)) { return VoterInterface::ACCESS_GRANTED; } break; case self::DELETE: if ($user->hasRole('ROLE_ADMIN')) { return VoterInterface::ACCESS_GRANTED; } break; } return VoterInterface::ACCESS_DENIED; } /** * @param User $user * @param Project $project * * @return bool */ public function userCanViewProject($user, $project) { return $user->hasRole('ROLE_ADMIN') or $user->hasRole('ROLE_MANAGER') or $project->getUsers()->contains($user); } /** * @param User $user * @return bool */ public function userCanEditProject($user) { return $user->hasRole('ROLE_ADMIN') or $user->hasRole('ROLE_MANAGER'); } }
// jshint -W001 "use strict"; // Identifiers provided by the ECMAScript standard. exports.reservedVars = { arguments : false, NaN : false }; exports.ecmaIdentifiers = { 3: { Array : false, Boolean : false, Date : false, decodeURI : false, decodeURIComponent : false, encodeURI : false, encodeURIComponent : false, Error : false, "eval" : false, EvalError : false, Function : false, hasOwnProperty : false, isFinite : false, isNaN : false, Math : false, Number : false, Object : false, parseInt : false, parseFloat : false, RangeError : false, ReferenceError : false, RegExp : false, String : false, SyntaxError : false, TypeError : false, URIError : false }, 5: { JSON : false }, 6: { ArrayBuffer : false, DataView : false, Float32Array : false, Float64Array : false, Int8Array : false, Int16Array : false, Int32Array : false, Map : false, Promise : false, Proxy : false, Reflect : false, Set : false, Symbol : false, Uint8Array : false, Uint16Array : false, Uint32Array : false, Uint8ClampledArray : false, WeakMap : false, WeakSet : false } }; // Global variables commonly provided by a web browser environment. exports.browser = { Audio : false, Blob : false, addEventListener : false, applicationCache : false, atob : false, blur : false, btoa : false, <API key> : false, CanvasGradient : false, CanvasPattern : false, <API key>: false, CSS : false, clearInterval : false, clearTimeout : false, close : false, closed : false, Comment : false, CompositionEvent : false, CustomEvent : false, DOMParser : false, defaultStatus : false, Document : false, document : false, DocumentFragment : false, Element : false, ElementTimeControl : false, Event : false, event : false, fetch : false, File : false, FileList : false, FileReader : false, FormData : false, focus : false, frames : false, getComputedStyle : false, HTMLElement : false, HTMLAnchorElement : false, HTMLBaseElement : false, <API key>: false, HTMLBodyElement : false, HTMLBRElement : false, HTMLButtonElement : false, HTMLCanvasElement : false, HTMLCollection : false, <API key> : false, HTMLDivElement : false, HTMLDListElement : false, HTMLFieldSetElement : false, HTMLFontElement : false, HTMLFormElement : false, HTMLFrameElement : false, HTMLFrameSetElement : false, HTMLHeadElement : false, HTMLHeadingElement : false, HTMLHRElement : false, HTMLHtmlElement : false, HTMLIFrameElement : false, HTMLImageElement : false, HTMLInputElement : false, HTMLIsIndexElement : false, HTMLLabelElement : false, HTMLLayerElement : false, HTMLLegendElement : false, HTMLLIElement : false, HTMLLinkElement : false, HTMLMapElement : false, HTMLMenuElement : false, HTMLMetaElement : false, HTMLModElement : false, HTMLObjectElement : false, HTMLOListElement : false, HTMLOptGroupElement : false, HTMLOptionElement : false, <API key> : false, HTMLParamElement : false, HTMLPreElement : false, HTMLQuoteElement : false, HTMLScriptElement : false, HTMLSelectElement : false, HTMLStyleElement : false, <API key>: false, <API key> : false, HTMLTableColElement : false, HTMLTableElement : false, HTMLTableRowElement : false, <API key>: false, HTMLTemplateElement : false, HTMLTextAreaElement : false, HTMLTitleElement : false, HTMLUListElement : false, HTMLVideoElement : false, history : false, Image : false, Intl : false, length : false, localStorage : false, location : false, matchMedia : false, MessageChannel : false, MessageEvent : false, MessagePort : false, MouseEvent : false, moveBy : false, moveTo : false, MutationObserver : false, name : false, Node : false, NodeFilter : false, NodeList : false, Notification : false, navigator : false, onbeforeunload : true, onblur : true, onerror : true, onfocus : true, onload : true, onresize : true, onunload : true, open : false, openDatabase : false, opener : false, Option : false, parent : false, performance : false, print : false, Range : false, <API key> : false, removeEventListener : false, resizeBy : false, resizeTo : false, screen : false, scroll : false, scrollBy : false, scrollTo : false, sessionStorage : false, setInterval : false, setTimeout : false, SharedWorker : false, status : false, SVGAElement : false, <API key>: false, SVGAltGlyphElement : false, <API key>: false, SVGAngle : false, <API key>: false, SVGAnimateElement : false, <API key>: false, <API key>: false, SVGAnimatedAngle : false, SVGAnimatedBoolean : false, <API key>: false, SVGAnimatedInteger : false, SVGAnimatedLength : false, <API key>: false, SVGAnimatedNumber : false, <API key>: false, SVGAnimatedPathData : false, SVGAnimatedPoints : false, <API key>: false, SVGAnimatedRect : false, SVGAnimatedString : false, <API key>: false, SVGAnimationElement : false, SVGCSSRule : false, SVGCircleElement : false, SVGClipPathElement : false, SVGColor : false, <API key>: false, SVGColorProfileRule : false, <API key>: false, SVGCursorElement : false, SVGDefsElement : false, SVGDescElement : false, SVGDocument : false, SVGElement : false, SVGElementInstance : false, <API key>: false, SVGEllipseElement : false, <API key>: false, SVGFEBlendElement : false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, SVGFEFloodElement : false, SVGFEFuncAElement : false, SVGFEFuncBElement : false, SVGFEFuncGElement : false, SVGFEFuncRElement : false, <API key>: false, SVGFEImageElement : false, SVGFEMergeElement : false, <API key>: false, <API key>: false, SVGFEOffsetElement : false, <API key>: false, <API key>: false, <API key>: false, SVGFETileElement : false, <API key>: false, SVGFilterElement : false, <API key>: false, SVGFitToViewBox : false, SVGFontElement : false, SVGFontFaceElement : false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, SVGGElement : false, SVGGlyphElement : false, SVGGlyphRefElement : false, SVGGradientElement : false, SVGHKernElement : false, SVGICCColor : false, SVGImageElement : false, SVGLangSpace : false, SVGLength : false, SVGLengthList : false, SVGLineElement : false, <API key>: false, SVGLocatable : false, SVGMPathElement : false, SVGMarkerElement : false, SVGMaskElement : false, SVGMatrix : false, SVGMetadataElement : false, <API key>: false, SVGNumber : false, SVGNumberList : false, SVGPaint : false, SVGPathElement : false, SVGPathSeg : false, SVGPathSegArcAbs : false, SVGPathSegArcRel : false, SVGPathSegClosePath : false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, <API key>: false, SVGPathSegLinetoAbs : false, <API key>: false, <API key>: false, SVGPathSegLinetoRel : false, <API key>: false, <API key>: false, SVGPathSegList : false, SVGPathSegMovetoAbs : false, SVGPathSegMovetoRel : false, SVGPatternElement : false, SVGPoint : false, SVGPointList : false, SVGPolygonElement : false, SVGPolylineElement : false, <API key>: false, <API key>: false, SVGRect : false, SVGRectElement : false, SVGRenderingIntent : false, SVGSVGElement : false, SVGScriptElement : false, SVGSetElement : false, SVGStopElement : false, SVGStringList : false, SVGStylable : false, SVGStyleElement : false, SVGSwitchElement : false, SVGSymbolElement : false, SVGTRefElement : false, SVGTSpanElement : false, SVGTests : false, <API key>: false, SVGTextElement : false, SVGTextPathElement : false, <API key>: false, SVGTitleElement : false, SVGTransform : false, SVGTransformList : false, SVGTransformable : false, SVGURIReference : false, SVGUnitTypes : false, SVGUseElement : false, SVGVKernElement : false, SVGViewElement : false, SVGViewSpec : false, SVGZoomAndPan : false, Text : false, TextDecoder : false, TextEncoder : false, TimeEvent : false, top : false, URL : false, WebGLActiveInfo : false, WebGLBuffer : false, WebGLContextEvent : false, WebGLFramebuffer : false, WebGLProgram : false, WebGLRenderbuffer : false, <API key>: false, WebGLShader : false, <API key>: false, WebGLTexture : false, <API key> : false, WebSocket : false, window : false, Window : false, Worker : false, XDomainRequest : false, XMLHttpRequest : false, XMLSerializer : false, XPathEvaluator : false, XPathException : false, XPathExpression : false, XPathNamespace : false, XPathNSResolver : false, XPathResult : false }; exports.devel = { alert : false, confirm: false, console: false, Debug : false, opera : false, prompt : false }; exports.worker = { importScripts : true, postMessage : true, self : true, FileReaderSync : true }; // Widely adopted global names that are not part of ECMAScript standard exports.nonstandard = { escape : false, unescape: false }; // Globals provided by popular JavaScript environments. exports.couch = { "require" : false, respond : false, getRow : false, emit : false, send : false, start : false, sum : false, log : false, exports : false, module : false, provides : false }; exports.node = { __filename : false, __dirname : false, GLOBAL : false, global : false, module : false, require : false, // These globals are writeable because Node allows the following // usage pattern: var Buffer = require("buffer").Buffer; Buffer : true, console : true, exports : true, process : true, setTimeout : true, clearTimeout : true, setInterval : true, clearInterval : true, setImmediate : true, // v0.9.1+ clearImmediate: true // v0.9.1+ }; exports.browserify = { __filename : false, __dirname : false, global : false, module : false, require : false, Buffer : true, exports : true, process : true }; exports.phantom = { phantom : true, require : true, WebPage : true, console : true, // in examples, but undocumented exports : true // v1.7+ }; exports.qunit = { asyncTest : false, deepEqual : false, equal : false, expect : false, module : false, notDeepEqual : false, notEqual : false, notOk : false, notPropEqual : false, notStrictEqual : false, ok : false, propEqual : false, QUnit : false, raises : false, start : false, stop : false, strictEqual : false, test : false, "throws" : false }; exports.rhino = { defineClass : false, deserialize : false, gc : false, help : false, importClass : false, importPackage: false, "java" : false, load : false, loadClass : false, Packages : false, print : false, quit : false, readFile : false, readUrl : false, runCommand : false, seal : false, serialize : false, spawn : false, sync : false, toint32 : false, version : false }; exports.shelljs = { target : false, echo : false, exit : false, cd : false, pwd : false, ls : false, find : false, cp : false, rm : false, mv : false, mkdir : false, test : false, cat : false, sed : false, grep : false, which : false, dirs : false, pushd : false, popd : false, env : false, exec : false, chmod : false, config : false, error : false, tempdir : false }; exports.typed = { ArrayBuffer : false, ArrayBufferView : false, DataView : false, Float32Array : false, Float64Array : false, Int16Array : false, Int32Array : false, Int8Array : false, Uint16Array : false, Uint32Array : false, Uint8Array : false, Uint8ClampedArray : false }; exports.wsh = { ActiveXObject : true, Enumerator : true, GetObject : true, ScriptEngine : true, <API key> : true, <API key> : true, <API key> : true, VBArray : true, WSH : true, WScript : true, XDomainRequest : true }; // Globals provided by popular JavaScript libraries. exports.dojo = { dojo : false, dijit : false, dojox : false, define : false, "require": false }; exports.jquery = { "$" : false, jQuery : false }; exports.mootools = { "$" : false, "$$" : false, Asset : false, Browser : false, Chain : false, Class : false, Color : false, Cookie : false, Core : false, Document : false, DomReady : false, DOMEvent : false, DOMReady : false, Drag : false, Element : false, Elements : false, Event : false, Events : false, Fx : false, Group : false, Hash : false, HtmlTable : false, IFrame : false, IframeShim : false, InputValidator: false, instanceOf : false, Keyboard : false, Locale : false, Mask : false, MooTools : false, Native : false, Options : false, OverText : false, Request : false, Scroller : false, Slick : false, Slider : false, Sortables : false, Spinner : false, Swiff : false, Tips : false, Type : false, typeOf : false, URI : false, Window : false }; exports.prototypejs = { "$" : false, "$$" : false, "$A" : false, "$F" : false, "$H" : false, "$R" : false, "$break" : false, "$continue" : false, "$w" : false, Abstract : false, Ajax : false, Class : false, Enumerable : false, Element : false, Event : false, Field : false, Form : false, Hash : false, Insertion : false, ObjectRange : false, PeriodicalExecuter: false, Position : false, Prototype : false, Selector : false, Template : false, Toggle : false, Try : false, Autocompleter : false, Builder : false, Control : false, Draggable : false, Draggables : false, Droppables : false, Effect : false, Sortable : false, SortableObserver : false, Sound : false, Scriptaculous : false }; exports.yui = { YUI : false, Y : false, YUI_config: false }; exports.mocha = { // Global (for config etc.) mocha : false, // BDD describe : false, xdescribe : false, it : false, xit : false, context : false, xcontext : false, before : false, after : false, beforeEach : false, afterEach : false, // TDD suite : false, test : false, setup : false, teardown : false, suiteSetup : false, suiteTeardown : false }; exports.jasmine = { jasmine : false, describe : false, xdescribe : false, it : false, xit : false, beforeEach : false, afterEach : false, setFixtures : false, loadFixtures: false, spyOn : false, expect : false, // Jasmine 1.3 runs : false, waitsFor : false, waits : false, // Jasmine 2.1 beforeAll : false, afterAll : false, fail : false, fdescribe : false, fit : false, pending : false };
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> #pragma once #include <windows.h> #include <ppltasks.h> #include <concrt.h> #include <collection.h> #include <windows.devices.alljoyn.interop.h> #include <map> #include <alljoyn_c/busattachment.h> #include <alljoyn_c/dbusstddefines.h> #include <alljoyn_c/AboutData.h> #include <alljoyn_c/AboutObj.h> #include <alljoyn_c/<API key>.h> #include "AllJoynHelpers.h" #include "<API key>.h" #define PROJECT_NAMESPACE org::OpenT2T::Sample::SuperPopular::Lamp #include "LampStructures.h" #include "<API key>.h" #include "LampMethodResults.h" #include "LampEventArgs.h" #include "ILampService.h" #include "LampSignals.h" #include "LampProducer.h" #include "LampWatcher.h" #include "LampConsumer.h" #include "<API key>.h" #include "<API key>.h"
/** * Main application routes */ 'use strict'; var errors = require('./components/errors'); module.exports = function(app) { // Insert routes below app.use('/api/pocket', require('./api/pocket')); app.use('/api/nytimes', require('./api/nytimes')); app.use('/api/things', require('./api/thing')); app.use('/api/users', require('./api/user')); app.use('/auth', require('./auth')); // All undefined asset or api routes should return a 404
<?php include_once "./dbconn.php"; if (isset($_GET['server'])) { $server = $_GET['server']; $tables = $_GET['table']; } else { echo "Not allowed."; exit(); } // List of columns function createTableHeaders($dataArray) { echo "<tr>\r\n"; foreach ($dataArray as $data) { echo "<th>" . $data . "</th>"; } echo "</tr>\r\n"; } //The database, the table in the database and the list of columns function loadFromDatabase($database, $table, $dataArray) { $sql = "SELECT * FROM ${table} WHERE _id = '{$_GET['server']}'"; $query = $database->query($sql); while($row = $query->fetchArray(SQLITE3_ASSOC)){ echo "<tr id=$table>\r\n"; foreach ($dataArray as $data) { echo "<td>". $row[$data] . "</td> \r\n"; } echo "</tr>\r\n"; } } ?> <!DOCTYPE HTML> <html> <head> <title><?php echo $server; ?></title> <link rel="stylesheet" href="./main.css"> </head> <body> <table> <?php // Headers and values to load from db $serversList = array("_id", "Hostname", "IPAddress", "OS", "Installed", "Date"); // Create table createTableHeaders($serversList); loadFromDatabase($db, $tables, $serversList); ?> </table> </body> </html> <?php $db->close(); ?>
#include "sendcoinsentry.h" #include "ui_sendcoinsentry.h" #include "guiutil.h" #include "bitcoinunits.h" #include "addressbookpage.h" #include "walletmodel.h" #include "optionsmodel.h" #include "addresstablemodel.h" #include <QApplication> #include <QClipboard> SendCoinsEntry::SendCoinsEntry(QWidget *parent) : QFrame(parent), ui(new Ui::SendCoinsEntry), model(0) { ui->setupUi(this); #ifdef Q_WS_MAC ui->payToLayout->setSpacing(4); #endif #if QT_VERSION >= 0x040700 /* Do not move this to the XML file, Qt before 4.7 will choke on it */ ui->addAsLabel->setPlaceholderText(tr("Enter a label for this address to add it to your address book")); ui->payTo->setPlaceholderText(tr("Enter a TittieCoin address (e.g. <API key>)")); #endif setFocusPolicy(Qt::TabFocus); setFocusProxy(ui->payTo); GUIUtil::setupAddressWidget(ui->payTo, this); } SendCoinsEntry::~SendCoinsEntry() { delete ui; } void SendCoinsEntry::<API key>() { // Paste text from clipboard into recipient field ui->payTo->setText(QApplication::clipboard()->text()); } void SendCoinsEntry::<API key>() { if(!model) return; AddressBookPage dlg(AddressBookPage::ForSending, AddressBookPage::SendingTab, this); dlg.setModel(model-><API key>()); if(dlg.exec()) { ui->payTo->setText(dlg.getReturnValue()); ui->payAmount->setFocus(); } } void SendCoinsEntry::<API key>(const QString &address) { if(!model) return; // Fill in label from address book, if address has an associated label QString associatedLabel = model-><API key>()->labelForAddress(address); if(!associatedLabel.isEmpty()) ui->addAsLabel->setText(associatedLabel); } void SendCoinsEntry::setModel(WalletModel *model) { this->model = model; if(model && model->getOptionsModel()) connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); clear(); } void SendCoinsEntry::setRemoveEnabled(bool enabled) { ui->deleteButton->setEnabled(enabled); } void SendCoinsEntry::clear() { ui->payTo->clear(); ui->addAsLabel->clear(); ui->payAmount->clear(); ui->payTo->setFocus(); // update the display unit, to not use the default ("BTC") updateDisplayUnit(); } void SendCoinsEntry::<API key>() { emit removeEntry(this); } bool SendCoinsEntry::validate() { // Check input validity bool retval = true; if(!ui->payAmount->validate()) { retval = false; } else { if(ui->payAmount->value() <= 0) { // Cannot send 0 coins or less ui->payAmount->setValid(false); retval = false; } } if(!ui->payTo->hasAcceptableInput() || (model && !model->validateAddress(ui->payTo->text()))) { ui->payTo->setValid(false); retval = false; } return retval; } SendCoinsRecipient SendCoinsEntry::getValue() { SendCoinsRecipient rv; rv.address = ui->payTo->text(); rv.label = ui->addAsLabel->text(); rv.amount = ui->payAmount->value(); return rv; } QWidget *SendCoinsEntry::setupTabChain(QWidget *prev) { QWidget::setTabOrder(prev, ui->payTo); QWidget::setTabOrder(ui->payTo, ui->addressBookButton); QWidget::setTabOrder(ui->addressBookButton, ui->pasteButton); QWidget::setTabOrder(ui->pasteButton, ui->deleteButton); QWidget::setTabOrder(ui->deleteButton, ui->addAsLabel); return ui->payAmount->setupTabChain(ui->addAsLabel); } void SendCoinsEntry::setValue(const SendCoinsRecipient &value) { ui->payTo->setText(value.address); ui->addAsLabel->setText(value.label); ui->payAmount->setValue(value.amount); } bool SendCoinsEntry::isClear() { return ui->payTo->text().isEmpty(); } void SendCoinsEntry::setFocus() { ui->payTo->setFocus(); } void SendCoinsEntry::updateDisplayUnit() { if(model && model->getOptionsModel()) { // Update payAmount with the current unit ui->payAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit()); } }
package main import ( "database/sql" "fmt" "log" "os" _ "github.com/mattn/go-oci8" ) func main() { db, err := sql.Open("oci8", getDSN()) if err != nil { log.Fatal(err) } _, err = db.Exec(` CREATE OR REPLACE FUNCTION MY_SUM ( P_NUM1 IN NUMBER, P_NUM2 IN NUMBER ) RETURN NUMBER IS R_NUM NUMBER(2) DEFAULT 0; BEGIN FOR i IN 1..P_NUM2 LOOP R_NUM := R_NUM + P_NUM1; END LOOP; RETURN R_NUM; END; `) if err != nil { log.Fatal(err) } rows, err := db.Query("select MY_SUM(5,6) from dual") if err != nil { log.Fatal(err) } for rows.Next() { var i int err = rows.Scan(&i) if err != nil { log.Fatal(err) } println(i) } } func getDSN() string { var dsn string if len(os.Args) > 1 { dsn = os.Args[1] if dsn != "" { return dsn } } dsn = os.Getenv("<API key>") if dsn != "" { return dsn } fmt.Fprintln(os.Stderr, `Please specifiy connection parameter in <API key> environment variable, or as the first argument! (The format is user/password@host:port/sid)`) return "scott/tiger@XE" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sk" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About BingoCoin</source> <translation>O BingoCoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;BingoCoin&lt;/b&gt; version</source> <translation>Verzia &lt;b&gt;BingoCoin&lt;/b&gt;</translation> </message> <message> <location line="+41"/> <source>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The BingoCoin developers</source> <translation>Copyright © 2009-2014 The Bitcoin developers Copyright © 2012-2014 The NovaCoin developers Copyright © 2014 The BingoCoin developers</translation> </message> <message> <location line="+15"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or &lt;a href=&quot;http: This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (&lt;a href=&quot;https: <translation> Toto je experimentálny softvér. Distribuovaný pod softvérovou licenciou MIT/X11, viď priložený súbor COPYING alebo &lt;a href=&quot;http: Tento produkt obsahuje softvér vyvinutý projektom OpenSSL Project pre použitie v sade OpenSSL Toolkit (&lt;a href=&quot;https: </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Adresár</translation> </message> <message> <location line="+22"/> <source>Double-click to edit address or label</source> <translation>Dvojklikom editovať adresu alebo popis</translation> </message> <message> <location line="+24"/> <source>Create a new address</source> <translation>Vytvoriť novú adresu</translation> </message> <message> <location line="+10"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Kopírovať práve zvolenú adresu do systémovej schránky</translation> </message> <message> <location line="-7"/> <source>&amp;New Address</source> <translation>&amp;Nová adresa</translation> </message> <message> <location line="-43"/> <source>These are your BingoCoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Toto sú vaše BingoCoin adresy pre príjem platieb. Možno budete chcieť dať inú každému odosielateľovi, aby ste mohli sledovať, kto Vám platí.</translation> </message> <message> <location line="+53"/> <source>&amp;Copy Address</source> <translation>&amp;Kopírovať adresu</translation> </message> <message> <location line="+7"/> <source>Show &amp;QR Code</source> <translation>Ukáž &amp;QR kód</translation> </message> <message> <location line="+7"/> <source>Sign a message to prove you own a BingoCoin address</source> <translation>Podpísať správu ako dôkaz, že vlastníte túto BingoCoin adresu</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Podpísať &amp;správu</translation> </message> <message> <location line="+17"/> <source>Delete the currently selected address from the list</source> <translation>Vymazať aktuálne vybranú adresu zo zoznamu</translation> </message> <message> <location line="-10"/> <source>Verify a message to ensure it was signed with a specified BingoCoin address</source> <translation>Overte správu, aby ste zabezpečili, že bola podpísaná s určitou BingoCoin adresou</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Overte správu</translation> </message> <message> <location line="+10"/> <source>&amp;Delete</source> <translation>&amp;Zmazať</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+65"/> <source>Copy &amp;Label</source> <translation>Kopírovať &amp;Popis</translation> </message> <message> <location line="+2"/> <source>&amp;Edit</source> <translation>&amp;Upraviť</translation> </message> <message> <location line="+250"/> <source>Export Address Book Data</source> <translation>Exportovať dáta z adresára</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Čiarkou oddelený súbor (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Chyba pri exporte</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Nie je možné zapísať do súboru %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+145"/> <source>Label</source> <translation>Popis</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(bez popisu)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Dialóg hesla</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Zadajte heslo</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nové heslo</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Zopakujte nové heslo</translation> </message> <message> <location line="+33"/> <source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source> <translation>Slúži na vypnutie trivial sendmoney keď je ohrozený OS účet. Neposkytuje žiadnu skutočnú istotu.</translation> </message> <message> <location line="+3"/> <source>For staking only</source> <translation>Len pre stávkovanie</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+38"/> <source>Encrypt wallet</source> <translation>Zašifrovať peňaženku</translation> </message> <message> <location line="+7"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>Táto operácia potrebuje heslo k vašej peňaženke aby ju mohla odomknúť.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Odomknúť peňaženku</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>Táto operácia potrebuje heslo k vašej peňaženke na dešifrovanie peňaženky.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Dešifrovať peňaženku</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Zmena hesla</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Zadajte staré a nové heslo k peňaženke.</translation> </message> <message> <location line="+45"/> <source>Confirm wallet encryption</source> <translation>Potvrďte zašifrovanie peňaženky</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR COINS&lt;/b&gt;!</source> <translation>Upozornenie: Ak zašifrujete vašu peňaženku a stratíte prístupové heslo, potom &lt;b&gt;prídete o všetky svoje MINCE&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Ste si istí, že si želáte zašifrovať peňaženku?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>DÔLEŽITÉ: Všetky predchádzajúce zálohy vašej peňaženky, ktoré ste vykonali by mali byť nahradené novo vytvorenou, zašifrovanou peňaženkou. Z bezpečnostných dôvodov bude predchádzajúca záloha nezašifrovanej peňaženky k ničomu, akonáhle začnete používať novú, zašifrovanú peňaženku.</translation> </message> <message> <location line="+103"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Upozornenie: Máte zapnutý Caps Lock!</translation> </message> <message> <location line="-133"/> <location line="+60"/> <source>Wallet encrypted</source> <translation>Peňaženka zašifrovaná</translation> </message> <message> <location line="-140"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;ten or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Zadajte nové heslo k peňaženke.&lt;br/&gt;Prosím použite heslo s dĺžkou &lt;b&gt;desať alebo viac náhodných znakov&lt;/b&gt;, prípadne &lt;b&gt;osem alebo viac slov&lt;/b&gt;.</translation> </message> <message> <location line="+82"/> <source>BingoCoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source> <translation>BingoCoin sa teraz zavrie aby dokončil proces zašifrovania. Nezabudnite, že zašifrovanie vašej peňaženky nemôže plne chrániť vaše mince pred krádežou malwarom, ktorý napadol váš počítač.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+44"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>Šifrovanie peňaženky zlyhalo</translation> </message> <message> <location line="-56"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>Šifrovanie peňaženky zlyhalo kôli internej chybe. Vaša peňaženka nebola zašifrovaná.</translation> </message> <message> <location line="+7"/> <location line="+50"/> <source>The supplied passphrases do not match.</source> <translation>Zadané heslá nesúhlasia.</translation> </message> <message> <location line="-38"/> <source>Wallet unlock failed</source> <translation>Odomykanie peňaženky zlyhalo</translation> </message> <message> <location line="+1"/> <location line="+12"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>Zadané heslo pre dešifrovanie peňaženky bolo nesprávne.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>Zlyhalo šifrovanie peňaženky.</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>Heslo k peňaženke bolo úspešne zmenené.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+297"/> <source>Sign &amp;message...</source> <translation>Podpísať &amp;správu...</translation> </message> <message> <location line="-64"/> <source>Show general overview of wallet</source> <translation>Zobraziť celkový prehľad o peňaženke</translation> </message> <message> <location line="+17"/> <source>&amp;Transactions</source> <translation>&amp;Transakcie</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Prechádzať históriu transakcií</translation> </message> <message> <location line="+5"/> <source>&amp;Address Book</source> <translation>&amp;Adresár</translation> </message> <message> <location line="+1"/> <source>Edit the list of stored addresses and labels</source> <translation>Úprava zoznamu uložených adries a popisov</translation> </message> <message> <location line="-18"/> <source>Show the list of addresses for receiving payments</source> <translation>Zobraziť zoznam adries pre príjem platieb</translation> </message> <message> <location line="+34"/> <source>E&amp;xit</source> <translation>&amp;Ukončiť</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Ukončiť program</translation> </message> <message> <location line="+4"/> <source>Show information about BingoCoin</source> <translation>Zobraziť informácie o BingoCoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>O &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Zobrazit informácie o Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Možnosti...</translation> </message> <message> <location line="+4"/> <source>&amp;Encrypt Wallet...</source> <translation>&amp;Zašifrovať peňaženku...</translation> </message> <message> <location line="+2"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Zálohovať peňaženku...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>&amp;Zmena hesla...</translation> </message> <message> <location line="+9"/> <source>&amp;Export...</source> <translation>&amp;Export...</translation> </message> <message> <location line="-55"/> <source>Send coins to a BingoCoin address</source> <translation>Poslať mince na BingoCoin adresu</translation> </message> <message> <location line="+39"/> <source>Modify configuration options for BingoCoin</source> <translation>Upraviť možnosti konfigurácie pre BingoCoin</translation> </message> <message> <location line="+17"/> <source>Export the data in the current tab to a file</source> <translation>Exportovať dáta v aktuálnej karte do súboru</translation> </message> <message> <location line="-13"/> <source>Encrypt or decrypt wallet</source> <translation>Zašifrovať alebo dešifrovať peňaženku</translation> </message> <message> <location line="+2"/> <source>Backup wallet to another location</source> <translation>Zálohovať peňaženku na iné miesto</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Zmeniť heslo použité na šifrovanie peňaženky</translation> </message> <message> <location line="+10"/> <source>&amp;Debug window</source> <translation>&amp;Ladiace okno</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Otvor konzolu pre ladenie a diagnostiku</translation> </message> <message> <location line="-5"/> <source>&amp;Verify message...</source> <translation>Overiť správu</translation> </message> <message> <location line="-214"/> <location line="+555"/> <source>BingoCoin</source> <translation>BingoCoin</translation> </message> <message> <location line="-555"/> <source>Wallet</source> <translation>Peňaženka</translation> </message> <message> <location line="+193"/> <source>&amp;About BingoCoin</source> <translation>&amp;O BingoCoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>Zobraziť / skryť</translation> </message> <message> <location line="+8"/> <source>Unlock wallet</source> <translation>Odomknúť peňaženku</translation> </message> <message> <location line="+1"/> <source>&amp;Lock Wallet</source> <translation>&amp;Zamknúť peňaženku</translation> </message> <message> <location line="+1"/> <source>Lock wallet</source> <translation>Zamknúť peňaženku</translation> </message> <message> <location line="+32"/> <source>&amp;File</source> <translation>&amp;Súbor</translation> </message> <message> <location line="+8"/> <source>&amp;Settings</source> <translation>&amp;Nastavenia</translation> </message> <message> <location line="+8"/> <source>&amp;Help</source> <translation>&amp;Pomoc</translation> </message> <message> <location line="+17"/> <source>Tabs toolbar</source> <translation>Lišta záložiek</translation> </message> <message> <location line="+46"/> <location line="+9"/> <source>[testnet]</source> <translation>[testovacia sieť]</translation> </message> <message> <location line="+0"/> <location line="+58"/> <source>BingoCoin client</source> <translation>BingoCoin klient</translation> </message> <message numerus="yes"> <location line="+70"/> <source>%n active connection(s) to BingoCoin network</source> <translation><numerusform>%n aktívne spojenie s BingoCoin sieťov</numerusform><numerusform>%n aktívnych spojení s BingoCoin sieťov</numerusform><numerusform>%n aktívnych spojení s BingoCoin sieťou</numerusform></translation> </message> <message> <location line="+488"/> <source>Staking.&lt;br&gt;Your weight is %1&lt;br&gt;Network weight is %2&lt;br&gt;Expected time to earn reward is %3</source> <translation>Stávkovanie.&lt;br&gt;Vaša váha je %1&lt;br&gt;Váha siete je %2&lt;br&gt;Odhadovaný čas pre získanie odmeny je %3</translation> </message> <message> <location line="+6"/> <source>Not staking because wallet is locked</source> <translation>Nestávkujem pretože peňaženka je zamknutá</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is offline</source> <translation>Nestávkujem pretože peňaženka je offline</translation> </message> <message> <location line="+2"/> <source>Not staking because wallet is syncing</source> <translation>Nestávkujem pretože peňaženka sa synchronizuje</translation> </message> <message> <location line="+2"/> <source>Not staking because you don&apos;t have mature coins</source> <translation>Nestávkujem pretože nemáte odležané mince</translation> </message> <message> <location line="-812"/> <source>&amp;Dashboard</source> <translation>&amp;Dashboard</translation> </message> <message> <location line="+6"/> <source>&amp;Receive</source> <translation>&amp;Prijať</translation> </message> <message> <location line="+6"/> <source>&amp;Send</source> <translation>&amp;Poslať</translation> </message> <message> <location line="+49"/> <source>&amp;Unlock Wallet...</source> <translation>&amp;Odomknúť peňaženku...</translation> </message> <message> <location line="+277"/> <source>Up to date</source> <translation>Aktualizovaný</translation> </message> <message> <location line="+43"/> <source>Catching up...</source> <translation>Sťahujem...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Potvrďte transakčný poplatok</translation> </message> <message> <location line="+27"/> <source>Sent transaction</source> <translation>Odoslané transakcie</translation> </message> <message> <location line="+1"/> <source>Incoming transaction</source> <translation>Prijaté transakcie</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Dátum: %1 Suma: %2 Typ: %3 Adresa: %4</translation> </message> <message> <location line="+100"/> <location line="+15"/> <source>URI handling</source> <translation>URI manipulácia</translation> </message> <message> <location line="-15"/> <location line="+15"/> <source>URI can not be parsed! This can be caused by an invalid BingoCoin address or malformed URI parameters.</source> <translation>URI nemožno analyzovať! Toto môže byť spôsobené neplatnou BingoCoin adresu alebo chybnými URI parametrami.</translation> </message> <message> <location line="+9"/> <source>Wallet is &lt;b&gt;not encrypted&lt;/b&gt;</source> <translation>Peňaženka &lt;b&gt;nie je zašifrovaná&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>Peňaženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálne &lt;b&gt;odomknutá&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>Peňaženka je &lt;b&gt;zašifrovaná&lt;/b&gt; a momentálne &lt;b&gt;zamknutá&lt;/b&gt;</translation> </message> <message> <location line="+24"/> <source>Backup Wallet</source> <translation>Zálohovanie peňaženky</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Dáta peňaženky (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Zálohovanie zlyhalo</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Došlo k chybe pri pokuse o uloženie dát peňaženky do nového umiestnenia.</translation> </message> <message numerus="yes"> <location line="+91"/> <source>%n second(s)</source> <translation><numerusform>%n sekunda</numerusform><numerusform>%n sekúnd</numerusform><numerusform>%n sekúnd</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n minute(s)</source> <translation><numerusform>%n minúta</numerusform><numerusform>%n minút</numerusform><numerusform>%n minút</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+433"/> <source>%n hour(s)</source> <translation><numerusform>%n hodina</numerusform><numerusform>%n hodiny</numerusform><numerusform>%n hodín</numerusform></translation> </message> <message> <location line="-456"/> <source>Processed %1 blocks of transaction history.</source> <translation>Spracovaných %1 blokov transakčnej histórie.</translation> </message> <message numerus="yes"> <location line="+27"/> <location line="+433"/> <source>%n day(s)</source> <translation><numerusform>%n deň</numerusform><numerusform>%n dni</numerusform><numerusform>%n dní</numerusform></translation> </message> <message numerus="yes"> <location line="-429"/> <location line="+6"/> <source>%n week(s)</source> <translation><numerusform>%n týždeň</numerusform><numerusform>%n týždne</numerusform><numerusform>%n týždňov</numerusform></translation> </message> <message> <location line="+0"/> <source>%1 and %2</source> <translation>%1 a %2</translation> </message> <message numerus="yes"> <location line="+0"/> <source>%n year(s)</source> <translation><numerusform>%n rok</numerusform><numerusform>%n roky</numerusform><numerusform>%n rokov</numerusform></translation> </message> <message> <location line="+5"/> <source>%1 behind</source> <translation>%1 pozadu</translation> </message> <message> <location line="+15"/> <source>Last received block was generated %1 ago.</source> <translation>Posledný prijatý blok bol vytvorený pred %1.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transakcie po tejto ešte nebudú viditeľné</translation> </message> <message> <location line="+23"/> <source>Error</source> <translation>Chyba</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Varovanie</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informácia</translation> </message> <message> <location line="+69"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Táto transakcia je nad veľkostný limit. Stále ju môžete poslať za poplatok %1, ktorý ide uzlom spracujúcim vaše transakcie, čím pomáhate podporovať sieť. Chcete zaplatiť poplatok?</translation> </message> <message> <location line="+324"/> <source>Not staking</source> <translation>Nestávkuje sa</translation> </message> <message> <location filename="../bitcoin.cpp" line="+104"/> <source>A fatal error occurred. BingoCoin can no longer continue safely and will quit.</source> <translation>Došlo k závažnej chybe. BingoCoin už nemôže pokračovať bezpečne a bude ukončený.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+110"/> <source>Network Alert</source> <translation>Výstraha siete</translation> </message> </context> <context> <name>CoinControlDialog</name> <message> <location filename="../forms/coincontroldialog.ui" line="+14"/> <source>Coin Control</source> <translation>Kontrola mincí</translation> </message> <message> <location line="+31"/> <source>Quantity:</source> <translation>Množstvo:</translation> </message> <message> <location line="+32"/> <source>Bytes:</source> <translation>Bajty:</translation> </message> <message> <location line="+48"/> <source>Amount:</source> <translation>Suma:</translation> </message> <message> <location line="+32"/> <source>Priority:</source> <translation>Priorita:</translation> </message> <message> <location line="+48"/> <source>Fee:</source> <translation>Poplatok:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Nízky výstup:</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="+537"/> <source>no</source> <translation>nie</translation> </message> <message> <location filename="../forms/coincontroldialog.ui" line="+51"/> <source>After Fee:</source> <translation>Po poplatku:</translation> </message> <message> <location line="+35"/> <source>Change:</source> <translation>Zmena:</translation> </message> <message> <location line="+69"/> <source>(un)select all</source> <translation>(Ne)označiť všetko</translation> </message> <message> <location line="+13"/> <source>Tree mode</source> <translation>Stromový režim</translation> </message> <message> <location line="+16"/> <source>List mode</source> <translation>Zoznamový režim</translation> </message> <message> <location line="+45"/> <source>Amount</source> <translation>Suma</translation> </message> <message> <location line="+5"/> <source>Label</source> <translation>Menovka</translation> </message> <message> <location line="+5"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+5"/> <source>Date</source> <translation>Dátum</translation> </message> <message> <location line="+5"/> <source>Confirmations</source> <translation>Potvrdenia</translation> </message> <message> <location line="+3"/> <source>Confirmed</source> <translation>Potvrdené</translation> </message> <message> <location line="+5"/> <source>Priority</source> <translation>Priorita</translation> </message> <message> <location filename="../coincontroldialog.cpp" line="-500"/> <source>Copy address</source> <translation>Kopírovať adresu</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopírovať popis</translation> </message> <message> <location line="+1"/> <location line="+26"/> <source>Copy amount</source> <translation>Kopírovať sumu</translation> </message> <message> <location line="-25"/> <source>Copy transaction ID</source> <translation>Kopírovať ID transakcie</translation> </message> <message> <location line="+24"/> <source>Copy quantity</source> <translation>Kopírovať množstvo</translation> </message> <message> <location line="+2"/> <source>Copy fee</source> <translation>Kopírovať poplatok</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Kopírovať po poplatku</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Kopírovať bajty</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Kopírovať prioritu</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Kopírovať nízky výstup</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Kopírovať zmenu</translation> </message> <message> <location line="+317"/> <source>highest</source> <translation>najvyššia</translation> </message> <message> <location line="+1"/> <source>high</source> <translation>vysoká</translation> </message> <message> <location line="+1"/> <source>medium-high</source> <translation>stredne vysoká</translation> </message> <message> <location line="+1"/> <source>medium</source> <translation>stredná</translation> </message> <message> <location line="+4"/> <source>low-medium</source> <translation>stredne nízka</translation> </message> <message> <location line="+1"/> <source>low</source> <translation>nízka</translation> </message> <message> <location line="+1"/> <source>lowest</source> <translation>najnižšia</translation> </message> <message> <location line="+140"/> <source>DUST</source> <translation>PRACH</translation> </message> <message> <location line="+0"/> <source>yes</source> <translation>áno</translation> </message> <message> <location line="+10"/> <source>This label turns red, if the transaction size is bigger than 10000 bytes. This means a fee of at least %1 per kb is required. Can vary +/- 1 Byte per input.</source> <translation>Tento popis sčervená, v prípade, že veľkosť transakcie je väčšia ako 10000 bajtov. To znamená, že je potrebný poplatok vo výške najmenej %1 za kb. Môže sa líšiť +/- 1 bajt za vstup.</translation> </message> <message> <location line="+1"/> <source>Transactions with higher priority get more likely into a block. This label turns red, if the priority is smaller than &quot;medium&quot;. This means a fee of at least %1 per kb is required.</source> <translation>Transakcie s vyššou prioritou sa dostanú s väčšou pravdepodobnosťou do bloku. Tento popis sčervenie, ak je priorita menšia ako &quot;stredná&quot;. To znamená, že je nutný poplatok vo výške aspoň %1 za kb.</translation> </message> <message> <location line="+1"/> <source>This label turns red, if any recipient receives an amount smaller than %1. This means a fee of at least %2 is required. Amounts below 0.546 times the minimum relay fee are shown as DUST.</source> <translation>Tento popis sčervenie, ak príjemca dostane sumu menšiu ako %1. To znamená, že je potrebný poplatok aspoň %2. Sumy nižšie ako 0,546 násobok minimálneho poplatku sú zobrazené ako PRACH.</translation> </message> <message> <location line="+1"/> <source>This label turns red, if the change is smaller than %1. This means a fee of at least %2 is required.</source> <translation>Tento popis sčervenie, ak je zmena menšia než %1. To znamená, že je potrebný poplatok aspoň %2.</translation> </message> <message> <location line="+36"/> <location line="+66"/> <source>(no label)</source> <translation>(bez popisu)</translation> </message> <message> <location line="-9"/> <source>change from %1 (%2)</source> <translation>zmena od %1 (%2)</translation> </message> <message> <location line="+1"/> <source>(change)</source> <translation>(zmena)</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Upraviť adresu</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Popis</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>Popis spojený s touto položkou v adresáry</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>&amp;Adresa</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>Adresa spojená s položkou v tomto adresári. Toto môže byť zmenené iba pre odosielané adresy.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Nová adresa pre prijímanie</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Nová adresa pre odoslanie</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Upraviť adresu pre prijímanie</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Upraviť adresu pre odosielanie</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>Zadaná adresa &quot;%1&quot; sa už nachádza v adresári.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid BingoCoin address.</source> <translation>Zadaná adresa &quot;%1&quot; nie je platnou BingoCoin adresou.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Nepodarilo sa odomknúť peňaženku.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Generovanie nového kľúča zlyhalo.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+426"/> <location line="+12"/> <source>BingoCoin-Qt</source> <translation>BingoCoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>verzia</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Použitie:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>možnosti príkazového riadka</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Možnosti používateľského rozhrania</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Nastavenie jazyka, napr &quot;de_DE&quot; (predvolené: miestne nastavenie systému)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Spustiť minimalizované</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Zobraziť úvodnú obrazovku pri štarte (predvolené: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Možnosti</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Hlavné</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source> <translation>Voliteľný transakčný poplatok za kB, ktorý pomáha zaistiť, že vaše transakcie sú spracované rýchlo. Väčšina transakcií je 1 kB. Poplatok 0.01 je odporúčaný.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Zaplatiť transakčné &amp;poplatky</translation> </message> <message> <location line="+31"/> <source>Reserved amount does not participate in staking and is therefore spendable at any time.</source> <translation>Rezervované množstvo sa nepodieľa na stávkovaní a preto je použiteľné kedykoľvek.</translation> </message> <message> <location line="+15"/> <source>Reserve</source> <translation>Rezerva</translation> </message> <message> <location line="+31"/> <source>Automatically start BingoCoin after logging in to the system.</source> <translation>Automaticky spustiť BingoCoin po prihlásení sa do systému.</translation> </message> <message> <location line="+3"/> <source>&amp;Start BingoCoin on system login</source> <translation>&amp;Spustiť BingoCoin pri prihlásení do systému</translation> </message> <message> <location line="+21"/> <source>&amp;Network</source> <translation>Sieť</translation> </message> <message> <location line="+6"/> <source>Automatically open the BingoCoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Automaticky otvoriť port klienta BingoCoin na routeri. To funguje iba vtedy, ak váš router podporuje UPnP a je povolené.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapovať port pomocou &amp;UPnP</translation> </message> <message> <location line="+19"/> <source>Proxy &amp;IP:</source> <translation>Proxy &amp;IP:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>IP adresa proxy servera (napr. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Port:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Port proxy (napr. 9050)</translation> </message> <message> <location line="-57"/> <source>Connect to the BingoCoin network through a SOCKS5 proxy (e.g. when connecting through Tor).</source> <translation type="unfinished"/> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS5 proxy:</source> <translation type="unfinished"/> </message> <message> <location line="+90"/> <source>&amp;Window</source> <translation>Okno</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Zobraziť len ikonu na lište po minimalizovaní okna.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>Minimalizovať na lištu namiesto panelu úloh</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimalizovať namiesto ukončenia aplikácie keď sa zatvorí okno. Keď je zvolená táto možnosť, aplikácia sa zatvorí len po zvolení Ukončiť v menu.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimalizovať pri zatvorení</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>&amp;Displej</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>Jazyk používateľského rozhrania:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting BingoCoin.</source> <translation>Tu môžete nastaviť jazyk používateľského rozhrania. Toto nastavenie sa prejaví až po reštartovaní BingoCoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Zobrazovať hodnoty v jednotkách:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Vyberte si predvolené delenie jednotiek zobrazované v rozhraní a pri odosielaní mincí.</translation> </message> <message> <location line="+9"/> <source>Whether to show coin control features or not.</source> <translation>Či sa majú zobraziť funkcie kontroly mincí alebo nie.</translation> </message> <message> <location line="+3"/> <source>Display coin &amp;control features (experts only!)</source> <translation>Zobraziť funkcie &amp;kontroly mincí (len pre odborníkov!)</translation> </message> <message> <location line="+7"/> <source>Whether to select the coin outputs randomly or with minimal coin age.</source> <translation>Zvoliť výstupy mincí náhodne, alebo s minimálnym vekom mince.</translation> </message> <message> <location line="+3"/> <source>Minimize weight consumption (experimental)</source> <translation>Minimalizovať spotrebu hmotnosti (experimentálne)</translation> </message> <message> <location line="+7"/> <source>Use black visual theme (requires restart)</source> <translation>Použiť čiernu vizuálnu tému (vyžaduje reštart)</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>Zrušiť</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Použiť</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+47"/> <source>default</source> <translation>predvolené</translation> </message> <message> <location line="+148"/> <location line="+9"/> <source>Warning</source> <translation>Upozornenie</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting BingoCoin.</source> <translation>Toto nastavenie sa prejaví až po reštartovaní BingoCoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>Zadaná proxy adresa je neplatná.</translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Forma</translation> </message> <message> <location line="+46"/> <location line="+247"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the BingoCoin network after a connection is established, but this process has not completed yet.</source> <translation>Zobrazené informácie môžu byť zastaralé. Vaša peňaženka sa automaticky synchronizuje so sieťou BingoCoin po nadviazaní spojenia, ale tento proces nie je ešte dokončený.</translation> </message> <message> <location line="-173"/> <source>Stake:</source> <translation>V stávke:</translation> </message> <message> <location line="+32"/> <source>Unconfirmed:</source> <translation>Nepotvrdené:</translation> </message> <message> <location line="-113"/> <source>Wallet</source> <translation>Peňaženka</translation> </message> <message> <location line="+49"/> <source>Spendable:</source> <translation>Použiteľné:</translation> </message> <message> <location line="+16"/> <source>Your current spendable balance</source> <translation>Váš aktuálny použiteľný zostatok</translation> </message> <message> <location line="+80"/> <source>Immature:</source> <translation>Nezrelé:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>Vyťažený zostatok, ktorý nebol ešte dozretý</translation> </message> <message> <location line="+23"/> <source>Total:</source> <translation>Celkovo:</translation> </message> <message> <location line="+16"/> <source>Your current total balance</source> <translation>Váš súčasný celkový zostatok</translation> </message> <message> <location line="+50"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Nedávne transakcie&lt;/b&gt;</translation> </message> <message> <location line="-118"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Súčet transakcií, ktoré neboli ešte potvrdené, a ešte nezapočítané do aktuálneho zostatku</translation> </message> <message> <location line="-32"/> <source>Total of coins that was staked, and do not yet count toward the current balance</source> <translation>Súčet mincí, ktoré sú v stávke a ešte neboli započítané do aktuálneho zostatku</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>nezosynchronizované</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start bingocoin: click-to-pay handler</source> <translation>BingoCoin sa nedá spustiť: click-to-pay handler</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>QR Code Dialóg</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Vyžiadať Platbu</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Čiastka:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Popis:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Správa:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Uložiť ako...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Chyba kódovania URI do QR Code.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>Zadaná suma je neplatná, prosím skontrolujte.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>Výsledná URI príliš dlhá, skúste skrátiť text popisu / správy.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Uložiť QR Code</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>PNG Obrázky (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Meno klienta</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <source>N/A</source> <translation>nie je k dispozícii</translation> </message> <message> <location line="-194"/> <source>Client version</source> <translation>Verzia klienta</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informácie</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Používa OpenSSL verziu</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Čas spustenia</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Sieť</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Počet pripojení</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Na testovacej sieti</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Reťazec blokov</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Aktuálny počet blokov</translation> </message> <message> <location line="+197"/> <source>&amp;Network Traffic</source> <translation>&amp;Sieťové prenosy</translation> </message> <message> <location line="+52"/> <source>&amp;Clear</source> <translation>Vymazať</translation> </message> <message> <location line="+13"/> <source>Totals</source> <translation>Súčty</translation> </message> <message> <location line="+64"/> <source>In:</source> <translation>Vstup:</translation> </message> <message> <location line="+80"/> <source>Out:</source> <translation>Výstup:</translation> </message> <message> <location line="-383"/> <source>Last block time</source> <translation>Čas posledného bloku</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Otvoriť</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Možnosti príkazového riadka</translation> </message> <message> <location line="+7"/> <source>Show the BingoCoin-Qt help message to get a list with possible BingoCoin command-line options.</source> <translation>Zobraziť BingoCoin-Qt nápovedu k získaniu zoznamu pre možnosti príkazového riadku BingoCoin.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>&amp;Zobraziť</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Konzola</translation> </message> <message> <location line="-237"/> <source>Build date</source> <translation>Dátum zostavenia</translation> </message> <message> <location line="-104"/> <source>BingoCoin - Debug window</source> <translation>BingoCoin - Ladiace okno</translation> </message> <message> <location line="+25"/> <source>BingoCoin Core</source> <translation>Jadro BingoCoin</translation> </message> <message> <location line="+256"/> <source>Debug log file</source> <translation>Súbor denníka ladenia</translation> </message> <message> <location line="+7"/> <source>Open the BingoCoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Otvorte BingoCoin súbor denníku ladenia z aktuálneho adresára dát. To môže trvať niekoľko sekúnd pre veľké súbory denníka.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Vymazať konzolu</translation> </message> <message> <location filename="../rpcconsole.cpp" line="+325"/> <source>Welcome to the BingoCoin RPC console.</source> <translation>Vitajte v konzole BingoCoin RPC.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Použite šípky hore a dole pre navigáciu históriou, a &lt;b&gt; Ctrl-L &lt;/ b&gt; pre vymazanie obrazovky.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Zadajte &lt;b&gt;help&lt;/b&gt; pre prehľad dostupných príkazov.</translation> </message> <message> <location line="+127"/> <source>%1 B</source> <translation>%1 B</translation> </message> <message> <location line="+2"/> <source>%1 KB</source> <translation>%1 KB</translation> </message> <message> <location line="+2"/> <source>%1 MB</source> <translation>%1 MB</translation> </message> <message> <location line="+2"/> <source>%1 GB</source> <translation>%1 GB</translation> </message> <message> <location line="+7"/> <source>%1 m</source> <translation>%1 m</translation> </message> <message> <location line="+5"/> <source>%1 h</source> <translation>%1 h</translation> </message> <message> <location line="+2"/> <source>%1 h %2 m</source> <translation>%1 h %2 m</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+182"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Poslať mince</translation> </message> <message> <location line="+76"/> <source>Coin Control Features</source> <translation>Funkcie kontroly mincí</translation> </message> <message> <location line="+20"/> <source>Inputs...</source> <translation>Vstupy...</translation> </message> <message> <location line="+7"/> <source>automatically selected</source> <translation>automaticky vybrané</translation> </message> <message> <location line="+19"/> <source>Insufficient funds!</source> <translation>Nedostatok prostriedkov!</translation> </message> <message> <location line="+77"/> <source>Quantity:</source> <translation>Množstvo:</translation> </message> <message> <location line="+22"/> <location line="+35"/> <source>0</source> <translation>0</translation> </message> <message> <location line="-19"/> <source>Bytes:</source> <translation>Bajtov:</translation> </message> <message> <location line="+51"/> <source>Amount:</source> <translation>Suma:</translation> </message> <message> <location line="+35"/> <source>Priority:</source> <translation>Priorita:</translation> </message> <message> <location line="+19"/> <source>medium</source> <translation>stredne</translation> </message> <message> <location line="+32"/> <source>Fee:</source> <translation>Poplatok:</translation> </message> <message> <location line="+35"/> <source>Low Output:</source> <translation>Nízky výstup:</translation> </message> <message> <location line="+19"/> <source>no</source> <translation>nie</translation> </message> <message> <location line="+32"/> <source>After Fee:</source> <translation>Po poplatkoch:</translation> </message> <message> <location line="+35"/> <source>Change</source> <translation>Zmeniť</translation> </message> <message> <location line="+50"/> <source>custom change address</source> <translation>vlastná zmena adresy</translation> </message> <message> <location line="+106"/> <source>Send to multiple recipients at once</source> <translation>Poslať viacerým príjemcom naraz</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>&amp;Pridať príjemcu</translation> </message> <message> <location line="+16"/> <source>Remove all transaction fields</source> <translation>Odstráňte všetky transakčné polia</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>Zmazať &amp;všetko</translation> </message> <message> <location line="+24"/> <source>Balance:</source> <translation>Zostatok:</translation> </message> <message> <location line="+47"/> <source>Confirm the send action</source> <translation>Potvrďte odoslanie</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Odoslať</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-174"/> <source>Enter a BingoCoin address (e.g. <API key>)</source> <translation>Zadajte BingoCoin adresu (napr. <API key>)</translation> </message> <message> <location line="+15"/> <source>Copy quantity</source> <translation>Kopírovať množstvo</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopírovať sumu</translation> </message> <message> <location line="+1"/> <source>Copy fee</source> <translation>Kopírovať poplatok</translation> </message> <message> <location line="+1"/> <source>Copy after fee</source> <translation>Kopírovať po poplatkoch</translation> </message> <message> <location line="+1"/> <source>Copy bytes</source> <translation>Kopírovať bajty</translation> </message> <message> <location line="+1"/> <source>Copy priority</source> <translation>Kopírovať prioritu</translation> </message> <message> <location line="+1"/> <source>Copy low output</source> <translation>Kopírovať nízky výstup</translation> </message> <message> <location line="+1"/> <source>Copy change</source> <translation>Kopírovať zmenu</translation> </message> <message> <location line="+87"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; do %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Potvrdiť odoslanie mincí</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Ste si istý, že chcete poslať %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation>a</translation> </message> <message> <location line="+29"/> <source>The recipient address is not valid, please recheck.</source> <translation>Adresa príjemcu je neplatná, overte ju prosím.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>Suma na úhradu musí byť väčšia ako 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>Suma je vyššia ako Váš zostatok.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>Celková suma prevyšuje Váš zostatok ak sú započítané aj transakčné poplatky %1.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Objavený duplikát adresy, na každú adresu je možné poslať len raz v jednej odchádzajúcej transakcii.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Chyba: Vytvorenie transakcie zlyhalo!</translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Chyba: Transakcia bola zamietnutá. To môže nastať, ak niektoré z mincí vo vašej peňaženke sa už použili, ako napríklad, ak ste použili kópiu wallet.dat a mince boli použité v kópii, ale neboli označené tu ako použité.</translation> </message> <message> <location line="+247"/> <source>WARNING: Invalid BingoCoin address</source> <translation>UPOZORNENIE: Neplatná BingoCoin adresa</translation> </message> <message> <location line="+13"/> <source>(no label)</source> <translation>(bez popisu)</translation> </message> <message> <location line="+4"/> <source>WARNING: unknown change address</source> <translation>UPOZORNENIE: Neznáma zmena adresy</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulár</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Su&amp;ma:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>Zapla&amp;tiť:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. <API key>)</source> <translation>Adresa pre poslanie platby (napr. <API key>)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Vložte popis pre túto adresu aby sa pridala do adresára</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>&amp;Popis:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Vybrať adresu z adresára</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Vložiť adresu zo schránky</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Odstrániť tohto príjemcu</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a BingoCoin address (e.g. <API key>)</source> <translation>Zadajte BingoCoin adresu (napr. <API key>)</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Podpisy - Prihlásiť sa / Overiť správu</translation> </message> <message> <location line="+13"/> <location line="+124"/> <source>&amp;Sign Message</source> <translation>&amp;Podpísať správu</translation> </message> <message> <location line="-118"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Môžete podpísať správy svojimi adresami a dokázať tak, že ich vlastníte. Buďte opatrní a podpíšte len prehlásenia s ktorými plne súhlasíte, nakoľko útoky typu &quot;phishing&quot; Vás môžu lákať k ich podpísaniu. Podpisujete iba plne detailné vyhlásenia s ktorými súhlasíte.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. <API key>)</source> <translation>Adresa na podpísanie správy (napr. <API key>)</translation> </message> <message> <location line="+10"/> <location line="+203"/> <source>Choose an address from the address book</source> <translation>Vyberte adresu z adresára</translation> </message> <message> <location line="-193"/> <location line="+203"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-193"/> <source>Paste address from clipboard</source> <translation>Vložiť adresu zo schránky</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Sem vložte správu ktorú chcete podpísať</translation> </message> <message> <location line="+24"/> <source>Copy the current signature to the system clipboard</source> <translation>Skopírujte aktuálny podpis do schránky</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this BingoCoin address</source> <translation>Podpísať správu ako dôkaz, že vlastníte túto BingoCoin adresu</translation> </message> <message> <location line="+17"/> <source>Reset all sign message fields</source> <translation>Obnoviť všetky polia podpísania správy</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Zmazať &amp;všetko</translation> </message> <message> <location line="-87"/> <location line="+70"/> <source>&amp;Verify Message</source> <translation>Overiť správu...</translation> </message> <message> <location line="-64"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Zadajte podpisovú adresu správy (uistite sa že presne kopírujete konce riadkov, medzier, tabulátorov, atď.) a podpis nižšie pre overenie správy. Dávajte pozor, aby ste nedali viac do podpisu, než to, čo je v podpísanej správe samotnej, aby ste sa vyhli oklamaniu útokom typu man-in-the-middle.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. <API key>)</source> <translation>Adresa správy bola podpísaná (napr. <API key>)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified BingoCoin address</source> <translation>Overte správu, aby ste sa ubezpečili, že bola podpísaná s danou BingoCoin adresou</translation> </message> <message> <location line="+17"/> <source>Reset all verify message fields</source> <translation>Obnoviť všetky polia pre overenie správy</translation> </message> <message> <location filename="../<API key>.cpp" line="+27"/> <location line="+3"/> <source>Enter a BingoCoin address (e.g. <API key>)</source> <translation>Zadajte BingoCoin adresu (napr. <API key>)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Kliknite &quot;Podpísať správu&quot; pre získanie podpisu</translation> </message> <message> <location line="+3"/> <source>Enter BingoCoin signature</source> <translation>Zadajte BingoCoin podpis</translation> </message> <message> <location line="+85"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>Zadaná adresa je neplatná.</translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Prosím skontrolujte adresu a skúste znova.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>Zadaná adresa sa nevzťahuje na kľúč.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>Odomknutie peňaženky bolo zrušené.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>Súkromný kľúč k zadanej adrese nie je k dispozícii.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Podpísanie správy zlyhalo.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Správa podpísaná.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>Podpis nie je možné dekódovať.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Prosím skontrolujte podpis a skúste znova.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>Podpis nezodpovedá súhrnu správy.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Overenie správy zlyhalo.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Správa overená.</translation> </message> </context> <context> <name>TrafficGraphWidget</name> <message> <location filename="../trafficgraphwidget.cpp" line="+75"/> <source>KB/s</source> <translation>KB/s</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+25"/> <source>Open until %1</source> <translation>Otvorené do %1</translation> </message> <message> <location line="+6"/> <source>conflicted</source> <translation>v rozpore</translation> </message> <message> <location line="+2"/> <source>%1/offline</source> <translation>%1/offline</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/nepotvrdené</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 potvrdení</translation> </message> <message> <location line="+17"/> <source>Status</source> <translation>Stav</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, vysielanie cez %n uzol</numerusform><numerusform>, vysielanie cez %n uzlov</numerusform><numerusform>, vysielanie cez %n uzlov</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Dátum</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Zdroj</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Vygenerované</translation> </message> <message> <location line="+5"/> <location line="+13"/> <source>From</source> <translation>Od</translation> </message> <message> <location line="+1"/> <location line="+19"/> <location line="+58"/> <source>To</source> <translation>Pre</translation> </message> <message> <location line="-74"/> <location line="+2"/> <source>own address</source> <translation>vlastná adresa</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>popis</translation> </message> <message> <location line="+34"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Kredit</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>dozreje o ďalší %n blok</numerusform><numerusform>dozreje o ďalších %n blokov</numerusform><numerusform>dozreje o ďalších %n blokov</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>neprijaté</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Debet</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Transakčný poplatok</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Čiastka netto</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Správa</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Komentár</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID transakcie</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 25 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Generované mince musia zrieť 25 blokov pred tým, než môžu byť použité. Keď sa vygeneroval tento blok, bol vysielaný do siete, kde má byť pridaný do reťazca blokov. Ak sa nepodarí dostať ho do reťazca blokov, jeho stav sa zmení na &quot;Neprijatý&quot;, a nebude použiteľný. Toto sa môže občas stať, ak iný uzol generuje blok v priebehu niekoľkých sekúnd pred Vami.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Ladiace informácie</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transakcie</translation> </message> <message> <location line="+5"/> <source>Inputs</source> <translation>Vstupy</translation> </message> <message> <location line="+21"/> <source>Amount</source> <translation>Suma</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>pravda</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>nepravda</translation> </message> <message> <location line="-202"/> <source>, has not been successfully broadcast yet</source> <translation>, ešte nebola úspešne odoslaná</translation> </message> <message numerus="yes"> <location line="-36"/> <source>Open for %n more block(s)</source> <translation><numerusform>Otvorené pre %n ďalší blok</numerusform><numerusform>Otvorené pre %n ďalšie bloky</numerusform><numerusform>Otvorené pre %n ďalších blokov</numerusform></translation> </message> <message> <location line="+67"/> <source>unknown</source> <translation>neznámy</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../forms/<API key>.ui" line="+14"/> <source>Transaction details</source> <translation>Detaily transakcie</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Táto časť obrazovky zobrazuje detailný popis transakcie</translation> </message> </context> <context> <name><API key></name> <message> <location filename="../<API key>.cpp" line="+231"/> <source>Date</source> <translation>Dátum</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Typ</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Hodnota</translation> </message> <message> <location line="+52"/> <source>Open until %1</source> <translation>Otvorené do %1</translation> </message> <message> <location line="+12"/> <source>Confirmed (%1 confirmations)</source> <translation>Potvrdené (%1 potvrdení)</translation> </message> <message numerus="yes"> <location line="-15"/> <source>Open for %n more block(s)</source> <translation><numerusform>Otvoriť pre %n ďalší blok</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform><numerusform>Otvoriť pre %n ďalšie bloky</numerusform></translation> </message> <message> <location line="+6"/> <source>Offline</source> <translation>Offline</translation> </message> <message> <location line="+3"/> <source>Unconfirmed</source> <translation>Nepotvrdené</translation> </message> <message> <location line="+3"/> <source>Confirming (%1 of %2 recommended confirmations)</source> <translation>Potvrdzujem (%1 z %2 doporučených potvrdení)</translation> </message> <message> <location line="+6"/> <source>Conflicted</source> <translation>V rozpore</translation> </message> <message> <location line="+3"/> <source>Immature (%1 confirmations, will be available after %2)</source> <translation>Nezrelé (%1 potvrdení, bude k dispozícii po %2)</translation> </message> <message> <location line="+3"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Ten blok nebol prijatý žiadnym iným uzlom a pravdepodobne nebude akceptovaný!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Vypočítané ale neakceptované</translation> </message> <message> <location line="+42"/> <source>Received with</source> <translation>Prijaté s</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Prijaté od:</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Odoslané na</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Platba sebe samému</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Vyťažené</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/a)</translation> </message> <message> <location line="+194"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Status transakcie. Presuňte myš nad toto pole a zobrazí sa počet potvrdení.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Dátum a čas prijatia transakcie.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Typ transakcie.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Cieľová adresa transakcie.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Suma pridaná alebo odobraná k zostatku.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+54"/> <location line="+17"/> <source>All</source> <translation>Všetko</translation> </message> <message> <location line="-16"/> <source>Today</source> <translation>Dnes</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Tento týždeň</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Tento mesiac</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Minulý mesiac</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Tento rok</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Rozsah...</translation> </message> <message> <location line="+12"/> <source>Received with</source> <translation>Prijaté s</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Odoslané na</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Sebe samému</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Vyťažené</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Iné</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Vložte adresu alebo popis pre vyhľadávanie</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Min. množstvo</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Kopírovať adresu</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Kopírovať popis</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Kopírovať sumu</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Kopírovať ID transakcie</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editovať popis</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Zobraziť podrobnosti transakcie</translation> </message> <message> <location line="+138"/> <source>Export Transaction Data</source> <translation>Export transakčných údajov</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Čiarkou oddelovaný súbor (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Potvrdené</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Dátum</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Typ</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Popis</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Adresa</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Suma</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Chyba pri exporte</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Nemožno zapisovať do súboru %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Rozsah:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>do</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+208"/> <source>Sending...</source> <translation>Posielam...</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+173"/> <source>BingoCoin version</source> <translation>BingoCoin verzia</translation> </message> <message> <location line="+1"/> <source>Usage:</source> <translation>Použitie:</translation> </message> <message> <location line="+1"/> <source>Send command to -server or bingocoind</source> <translation>Pošli príkaz na -server alebo bingocoind</translation> </message> <message> <location line="+1"/> <source>List commands</source> <translation>Zoznam príkazov</translation> </message> <message> <location line="+1"/> <source>Get help for a command</source> <translation>Získať pomoc pre príkaz</translation> </message> <message> <location line="-147"/> <source>Options:</source> <translation>Možnosti:</translation> </message> <message> <location line="+2"/> <source>Specify configuration file (default: bingocoin.conf)</source> <translation>Zadajte konfiguračný súbor (predvolené: bingocoin.conf)</translation> </message> <message> <location line="+1"/> <source>Specify pid file (default: bingocoind.pid)</source> <translation>Zadajte pid súbor (predvolené: bingocoind.pid)</translation> </message> <message> <location line="+2"/> <source>Specify wallet file (within data directory)</source> <translation>Zadajte súbor peňaženky (v rámci dátového adresára)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Zadajte priečinok s dátami</translation> </message> <message> <location line="-25"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=bingocoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;BingoCoin Alert&quot; admin@foo.com </source> <translation>%s, musíte nastaviť rpcpassword v konfiguračnom súbore: %s Doporučuje sa použiť nasledovné náhodne heslo: rpcuser=bingocoinrpc rpcpassword=%s (toto heslo si nemusíte pamätať) Užívateľské meno a heslo NESMIE byť rovnaké. Ak súbor neexistuje, vytvorte ho s právami &quot;môže čítať iba vlastník&quot;. Odporúča sa tiež nastaviť &quot;alertnotify&quot;, takže budete upozornení na problémy, napríklad: alertnotify=echo %%s | mail -s &quot;BingoCoin upozornenie&quot; admin@foo.com </translation> </message> <message> <location line="+27"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Nastaviť veľkosť vyrovnávajúcej pamäte pre databázu v megabytoch (predvolené: 25)</translation> </message> <message> <location line="+1"/> <source>Set database disk log size in megabytes (default: 100)</source> <translation>Nastaviť veľkosť databázového denníka na disku v MB (predvolené: 100)</translation> </message> <message> <location line="+5"/> <source>Listen for connections on &lt;port&gt; (default: 15714 or testnet: 25714)</source> <translation>Počúvať pripojenia na &lt;port&gt; (predvolené: 15714 alebo testovacia sieť: 25714)</translation> </message> <message> <location line="+1"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Udržiavať maximálne &lt;n&gt; spojení (predvolené: 125)</translation> </message> <message> <location line="+3"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Pre načítanie peer adresy sa pripojte k uzlu, a odpojte</translation> </message> <message> <location line="+1"/> <source>Specify your own public address</source> <translation>Určite vašu vlastnú verejnú adresu</translation> </message> <message> <location line="+4"/> <source>Bind to given address. Use [host]:port notation for IPv6</source> <translation>Spojiť do danej adresy. Použite [host]:port zápis pre IPv6</translation> </message> <message> <location line="+1"/> <source>Query for peer addresses via DNS lookup, if low on addresses (default: 1 unless -connect)</source> <translation>Dotaz na partnerské adresy pomocou vyhľadávania DNS v prípade nedostatku adries (predvolené: 1, pokiaľ -connect)</translation> </message> <message> <location line="+3"/> <source>Always query for peer addresses via DNS lookup (default: 0)</source> <translation>Vždy sa pýtať na partnerské adresy pomocou vyhľadávania DNS (predvolené: 0)</translation> </message> <message> <location line="+5"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Hranica pre odpojenie zle sa správajúcich peerov (predvolené: 100)</translation> </message> <message> <location line="+1"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Počet sekúnd kedy sa zabráni zle sa správajúcim peerom znovupripojenie (predvolené: 86400)</translation> </message> <message> <location line="-36"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Pri nastavovaní portu RPC %u pre počúvanie na IPv4 došlo k chybe: %s</translation> </message> <message> <location line="+63"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 15715 or testnet: 25715)</source> <translation>Počúvajte pre JSON-RPC spojenie na &lt;port&gt; (predvolené: 15715 alebo testovacia sieť: 25715)</translation> </message> <message> <location line="-16"/> <source>Accept command line and JSON-RPC commands</source> <translation>Prijímať príkazy z príkazového riadku a JSON-RPC</translation> </message> <message> <location line="+1"/> <source>Run in the background as a daemon and accept commands</source> <translation>Bežať na pozadí ako démon a prijímať príkazy</translation> </message> <message> <location line="+1"/> <source>Use the test network</source> <translation>Použiť testovaciu sieť</translation> </message> <message> <location line="-24"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Prijímať pripojenie z vonka (predvolené: 1, ak nie -proxy alebo -connect)</translation> </message> <message> <location line="-28"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Pri nastavovaní portu RPC %u pre počúvanie na IPv6, spadne späť do IPv4 došlo k chybe: %s</translation> </message> <message> <location line="+94"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Nastavte maximálnu veľkosť high-priority/low-fee transakcií v bajtoch (predvolené: 27000)</translation> </message> <message> <location line="+15"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Upozornenie: -paytxfee je nastavené veľmi vysoko. Toto sú transakčné poplatky ktoré zaplatíte ak odošlete transakciu.</translation> </message> <message> <location line="-104"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong BingoCoin will not work properly.</source> <translation>Upozornenie: Skontrolujte, že dátum a čas počítača sú správne! Ak je Váš čas nesprávny BingoCoin nebude pracovať správne.</translation> </message> <message> <location line="+132"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Upozornenie: Chyba pri čítaní wallet.dat! Všetky kľúče načítané správne, ale transakčné dáta alebo položky adresára môže chýbať alebo byť nesprávne.</translation> </message> <message> <location line="-17"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Upozornenie: wallet.dat poškodený, údaje zachránené! Pôvodný wallet.dat bol uložený ako wallet.{timestamp}.bak v %s; ak váš zostatok alebo transakcie nie sú správne, mali by ste obnoviť zo zálohy.</translation> </message> <message> <location line="-34"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Pokus obnoviť súkromné kľúče z poškodeného wallet.dat</translation> </message> <message> <location line="+5"/> <source>Block creation options:</source> <translation>Voľby vytvorenia bloku:</translation> </message> <message> <location line="-68"/> <source>Connect only to the specified node(s)</source> <translation>Pripojiť sa len k určenému uzlu(om)</translation> </message> <message> <location line="+4"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Objavte vlastnú IP adresa (predvolené: 1 pri počúvaní a nie -externalip)</translation> </message> <message> <location line="+102"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Nepodarilo sa počúvať žiadnom porte. Použite -listen=0 ak to chcete.</translation> </message> <message> <location line="-92"/> <source>Sync checkpoints policy (default: strict)</source> <translation>Sync checkpoints policy (predvolené: strict)</translation> </message> <message> <location line="+90"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Neplatná -tor adresa: &apos;%s&apos;</translation> </message> <message> <location line="+4"/> <source>Invalid amount for -reservebalance=&lt;amount&gt;</source> <translation>Neplatná suma pre -reservebalance=&lt;množstvo&gt;</translation> </message> <message> <location line="-89"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Maximum pre-pripojenie prijímacej vyrovnávacej pamäti, &lt;n&gt;*1000 bajtov (predvolené: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Maximum pre-pripojenie posielacej vyrovnávacej pamäti, &lt;n&gt;*1000 bajtov (predvolené: 1000)</translation> </message> <message> <location line="-17"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Pripojiť len k uzlom siete &lt;net&gt; (IPv4, IPv6 alebo Tor)</translation> </message> <message> <location line="+31"/> <source>Prepend debug output with timestamp</source> <translation>Pred debug výstup s časovou pečiatkou</translation> </message> <message> <location line="+40"/> <source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source> <translation>SSL možnosť: (pozrite Bitcoin Wiki pre návod na nastavenie SSL)</translation> </message> <message> <location line="-38"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Odoslať trace/debug informácie na konzolu namiesto debug.info súboru</translation> </message> <message> <location line="+34"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Nastavte maximálnu veľkosť bloku v bajtoch (predvolené: 250000)</translation> </message> <message> <location line="-1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Nastavte minimálnu veľkosť bloku v bajtoch (predvolené: 0)</translation> </message> <message> <location line="-34"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Stlačiť debug.log súbor na spustenie klienta (predvolené: 1, keď nie -debug)</translation> </message> <message> <location line="-42"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Určiť aut spojenia v milisekundách (predvolené: 5000)</translation> </message> <message> <location line="+116"/> <source>Unable to sign checkpoint, wrong checkpointkey? </source> <translation>Nemožno podpísať kontrolný bod, zlý checkpointkey? </translation> </message> <message> <location line="-87"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 0)</translation> </message> <message> <location line="-1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 1 when listening)</translation> </message> <message> <location line="-26"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Použiť proxy server k získaniu Tor skrytých služieb (predvolené: rovnaká ako -proxy)</translation> </message> <message> <location line="+46"/> <source>Username for JSON-RPC connections</source> <translation>Užívateľské meno pre JSON-RPC spojenia</translation> </message> <message> <location line="+54"/> <source>Verifying database integrity...</source> <translation>Overenie integrity databázy ...</translation> </message> <message> <location line="+43"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Chyba: Peňaženka je zamknutá, nie je možné vytvoriť transakciu!</translation> </message> <message> <location line="+2"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Chyba: Táto operácia vyžaduje transakčný poplatok vo výške aspoň %s, kvôli jej množstvu, zložitosti, alebo použitím nedávno prijatých finančných prostriedkov!</translation> </message> <message> <location line="+3"/> <source>Error: Transaction creation failed!</source> <translation>Chyba: Vytvorenie transakcie zlyhalo!</translation> </message> <message> <location line="+2"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Chyba: Transakcia bola zamietnutá! Toto môže nastať, ak niektoré z mincí vo vašej peňaženke sa už použili, ako napríklad, ak ste použili kópiu wallet.dat a mince boli použité v kópii, ale neboli označené ako použité tu.</translation> </message> <message> <location line="+7"/> <source>Warning</source> <translation>Varovanie</translation> </message> <message> <location line="+1"/> <source>Information</source> <translation>Informácia</translation> </message> <message> <location line="+2"/> <source>WARNING: syncronized checkpoint violation detected, but skipped!</source> <translation>UPOZORNENIE: detekovaný synchronizovaný porušený checkpoint, ale preskočený!</translation> </message> <message> <location line="-1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Upozornenie: Táto verzia je zastaraná, vyžaduje sa aktualizácia!</translation> </message> <message> <location line="-53"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat je poškodený, záchrana zlyhala</translation> </message> <message> <location line="-59"/> <source>Password for JSON-RPC connections</source> <translation>Heslo pre JSON-rPC spojenia</translation> </message> <message> <location line="-48"/> <source>Connect through SOCKS5 proxy</source> <translation type="unfinished"/> </message> <message> <location line="+17"/> <source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source> <translation>Synchronizácia času s ostatnými uzlami. Zakázať ak čas na vašom systéme je presný, napr synchronizáciu s NTP (predvolené: 1)</translation> </message> <message> <location line="+13"/> <source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source> <translation>Pri vytváraní transakcií, ignorovať vstupy s hodnotou nižšou než táto (predvolené: 0.01)</translation> </message> <message> <location line="+6"/> <source>Output debugging information (default: 0, supplying &lt;category&gt; is optional)</source> <translation>Výstupné informácie o ladení. (predvolené: 0, zadanie &lt;category&gt; je nepovinné)</translation> </message> <message> <location line="+2"/> <source>If &lt;category&gt; is not supplied, output all debugging information.</source> <translation>Ak nie je zadaná &lt;category&gt;, vypíš všetky ladiace informácie</translation> </message> <message> <location line="+1"/> <source>&lt;category&gt; can be:</source> <translation>&lt;category&gt; môže byť:</translation> </message> <message> <location line="+4"/> <source>Enter regression test mode, which uses a special chain in which blocks can be solved instantly. This is intended for regression testing tools and app development.</source> <translation>Vstúpte do režimu testovania regresiou, ktorá používa špeciálny reťazec, v ktorom môžu byť bloky vyriešiť okamžite. Tento je určený pre regresné testovanie nástrojov a vývoja aplikácie.</translation> </message> <message> <location line="+8"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Povoliť JSON-RPC spojenia z určenej IP adresy.</translation> </message> <message> <location line="+1"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Poslať príkaz nóde bežiacej na &lt;ip&gt; (predvolené: 127.0.0.1)</translation> </message> <message> <location line="+1"/> <source>Wait for RPC server to start</source> <translation>Pred spustením počkať na RPC server</translation> </message> <message> <location line="+1"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Nastavte počet vlákien pre obsluhu RPC volaní (predvolené: 4)</translation> </message> <message> <location line="+1"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Vykonaj príkaz, ak zmeny v najlepšom bloku (%s v príkaze nahradí blok hash)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Spustiť príkaz ak sa zmení transakcia v peňaženke (%s v cmd sa nahrádza TxID)</translation> </message> <message> <location line="+3"/> <source>Require a confirmations for change (default: 0)</source> <translation>Požadovať potvrdenie pre zmenu (predvolené: 0)</translation> </message> <message> <location line="+2"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Spustiť príkaz, keď je prijaté príslušné upozornenie (%s v cmd je nahradený správou)</translation> </message> <message> <location line="+3"/> <source>Upgrade wallet to latest format</source> <translation>Aktualizuj peňaženku na najnovší formát.</translation> </message> <message> <location line="+1"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Nastaviť zásobu adries na &lt;n&gt; (predvolené: 100)</translation> </message> <message> <location line="+1"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Znovu skenovať reťaz blokov pre chýbajúce transakcie</translation> </message> <message> <location line="+3"/> <source>How thorough the block verification is (0-6, default: 1)</source> <translation>Ako dôkladné overenie bloku je (0-6, predvolené: 1)</translation> </message> <message> <location line="+1"/> <source>Imports blocks from external blk000?.dat file</source> <translation>Importovať bloky z externého blk000?.dat súbora</translation> </message> <message> <location line="+9"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Použiť OpenSSL (https) pre JSON-RPC spojenia</translation> </message> <message> <location line="+1"/> <source>Server certificate file (default: server.cert)</source> <translation>Súbor s certifikátom servra (predvolené: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Súkromný kľúč servra (predvolené: server.pem)</translation> </message> <message> <location line="+5"/> <source>Error: Unsupported argument -socks found. Setting SOCKS version isn&apos;t possible anymore, only SOCKS5 proxies are supported.</source> <translation type="unfinished"/> </message> <message> <location line="+8"/> <source>Initialization sanity check failed. BingoCoin is shutting down.</source> <translation>Úvodné kontrolné testy zlyhali. BingoCoin sa teraz zatvori.</translation> </message> <message> <location line="+21"/> <source>Error loading block database</source> <translation type="unfinished"/> </message> <message> <location line="+28"/> <source>Error: Wallet unlocked for staking only, unable to create transaction.</source> <translation>Chyba: Peňaženka je odomknutá len pre stávkovanie, nemožné vytvoriť transakciu.</translation> </message> <message> <location line="+17"/> <source>Error: Disk space is low!</source> <translation>Chyba: Nedostatok miesta na disku!</translation> </message> <message> <location line="+1"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Toto je predbežná testovacia zostava - používate na vlastné riziko - nepoužívajte na ťaženie alebo obchodné aplikácie</translation> </message> <message> <location line="+3"/> <source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source> <translation>UPOZORNENIE: Neplatný checkpoint nájdený! Uvedené transakcie nemusia byť správne! Možno budete musieť upgradovať, alebo upozorniť vývojárov.</translation> </message> <message> <location line="-174"/> <source>This help message</source> <translation>Táto pomocná správa</translation> </message> <message> <location line="+105"/> <source>Wallet %s resides outside data directory %s.</source> <translation>Peňaženka %s je umiestnená mimo dátový adresár %s.</translation> </message> <message> <location line="+36"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Nemôžem sa pripojiť k %s na tomto počítači (bind vrátil chybu %d, %s)</translation> </message> <message> <location line="-131"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Povoliť vyhľadávanie DNS pre pridanie nódy a spojenie</translation> </message> <message> <location line="+127"/> <source>Loading addresses...</source> <translation>Načítavanie adries...</translation> </message> <message> <location line="-10"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Chyba načítania wallet.dat: Peňaženka je poškodená</translation> </message> <message> <location line="+4"/> <source>Error loading wallet.dat: Wallet requires newer version of BingoCoin</source> <translation>Chyba pri načítaní wallet.dat: Peňaženka vyžaduje novšiu verziu BingoCoin</translation> </message> <message> <location line="+1"/> <source>Wallet needed to be rewritten: restart BingoCoin to complete</source> <translation>Peňaženka potrebuje byť prepísaná: reštartujte BingoCoin k dokončeniu</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat</source> <translation>Chyba načítania wallet.dat</translation> </message> <message> <location line="-16"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Neplatná adresa proxy: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Špecifikovaná neznáma sieť v -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="+3"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Nemožno rozložiť -bind adresu: &apos;%s&apos;</translation> </message> <message> <location line="+2"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Nemožno rozložiť -externalip adresu: &apos;%s&apos;</translation> </message> <message> <location line="-22"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Neplatná suma pre -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+59"/> <source>Sending...</source> <translation>Posielam...</translation> </message> <message> <location line="+5"/> <source>Invalid amount</source> <translation>Neplatná suma</translation> </message> <message> <location line="+1"/> <source>Insufficient funds</source> <translation>Nedostatok prostriedkov</translation> </message> <message> <location line="-40"/> <source>Loading block index...</source> <translation>Načítavanie zoznamu blokov...</translation> </message> <message> <location line="-111"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Pridať nód na pripojenie a pokus o udržanie pripojenia otvoreného</translation> </message> <message> <location line="+126"/> <source>Unable to bind to %s on this computer. BingoCoin is probably already running.</source> <translation>Nemôžem sa pripojiť na %s na tomto počítači. BingoCoin je pravdepodobne už beží.</translation> </message> <message> <location line="-102"/> <source>Fee per KB to add to transactions you send</source> <translation>Poplatok za KB pridať do transakcií, ktoré odosielate</translation> </message> <message> <location line="+33"/> <source>Minimize weight consumption (experimental) (default: 0)</source> <translation>Minimalizovať spotrebu hmotnosti (experimentálne) (predvolené: 0)</translation> </message> <message> <location line="+8"/> <source>How many blocks to check at startup (default: 500, 0 = all)</source> <translation>Koľko blokov skontrolovať pri štarte (predvolené: 2500, 0 = všetky) {500, 0 ?}</translation> </message> <message> <location line="+3"/> <source>Keep at most &lt;n&gt; unconnectable blocks in memory (default: %u)</source> <translation>Uchovávať najviac &lt;n&gt; nepripojiteľných blokov v pamäti (predvolené: %u)</translation> </message> <message> <location line="+11"/> <source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source> <translation>Akceptovateľné šifry (predvolené: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</translation> </message> <message> <location line="+3"/> <source>Warning: Deprecated argument -debugnet ignored, use -debug=net</source> <translation>Upozornenie: Zastaraný argument -debugnet bol ignorovaný, použite -debug=net</translation> </message> <message> <location line="+8"/> <source>Invalid amount for -mininput=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Neplatná suma pre -mininput=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. BingoCoin is probably already running.</source> <translation>Nedá sa zamknúť dátová zložka %s. BingoCoin je pravdepodobne už spustený</translation> </message> <message> <location line="+4"/> <source>Error initializing wallet database environment %s!</source> <translation>Chyba pri inicializácii databázového prostredia peňaženky %s!</translation> </message> <message> <location line="+16"/> <source>Loading wallet...</source> <translation>Načítavam peňaženku...</translation> </message> <message> <location line="+8"/> <source>Cannot downgrade wallet</source> <translation>Nie je možné prejsť na nižšiu verziu peňaženky</translation> </message> <message> <location line="+1"/> <source>Cannot write default address</source> <translation>Nie je možné zapísať predvolenú adresu.</translation> </message> <message> <location line="+1"/> <source>Rescanning...</source> <translation>Nové prehľadávanie...</translation> </message> <message> <location line="+2"/> <source>Done loading</source> <translation>Dokončené načítavanie</translation> </message> <message> <location line="-161"/> <source>To use the %s option</source> <translation>Použiť možnosť %s</translation> </message> <message> <location line="+188"/> <source>Error</source> <translation>Chyba</translation> </message> <message> <location line="-18"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Musíš nastaviť rpcpassword=&lt;heslo&gt; v konfiguračnom súbore: %s Ak súbor neexistuje, vytvorte ho s oprávnením pre čítanie len vlastníkom (owner-readable-only)</translation> </message> </context> </TS>
package com.lukasheise.freeslw4j.openal; import com.lukasheise.freeslw4j.AudioFormat; import com.lukasheise.freeslw4j.Group; import com.lukasheise.freeslw4j.Priority; import com.lukasheise.freeslw4j.Sound; import com.lukasheise.freeslw4j.util.Fade; import static org.lwjgl.openal.AL10.*; import static org.lwjgl.openal.AL11.*; public class OpenALStaticSound implements Sound, OpenALSound { private <API key> ai; private Source source; private Buffer buffer; private Priority priority; private Group group; private Fade fade; public OpenALStaticSound(<API key> ai, Buffer buffer, Priority priority, Group group) { this.buffer = buffer; this.priority = priority; this.group = group; this.ai = ai; this.fade = new Fade(); this.source = new Source(); } @Override public void release() { OpenALConfiguration.getStaticSounds().remove(this); stop(); buffer.release(); } public Source getSource() { return source; } public Buffer getBuffer() { return buffer; } @Override public void update(float deltaTime) { if (fade.isActive() && isPlaying()) { source.setGainScale(fade.update(deltaTime)); } } @Override public String getName() { return buffer.getName(); } @Override public int getFrequency() { return buffer.getFrequency(); } @Override public AudioFormat getFormat() { return buffer.getFormat(); } @Override public boolean isStream() { return false; } @Override public void setGroup(Group id) { group = id; if (!ai.isGroupActive(id) && isPlaying()) { pause(); } } @Override public Group getGroup() { return group; } @Override public void setPriority(Priority priority) { this.priority = priority; } @Override public Priority getPriority() { return priority; } @Override public void play() { if (isPlaying()) { return; } if (source.beginSource(group,priority,buffer,true,true)) { alSourcePlay(source.getSource().sourceId); OpenALConfiguration.getPlayingSounds().add(this); } } @Override public void resume() { if (isPaused()) { alSourcePlay(source.getSource().sourceId); OpenALConfiguration.getPlayingSounds().add(this); } } @Override public void rewind() { if (source.hasSource()) { alSourceRewind(source.getSource().sourceId); } } @Override public void stop() { if (source.hasSource()) { alSourceStop(source.getSource().sourceId); source.endSource(); OpenALConfiguration.getPlayingSounds().remove(this); } } @Override public void pause() { if (source.hasSource()) { alSourcePause(source.getSource().sourceId); OpenALConfiguration.getPlayingSounds().remove(this); } } @Override public boolean isPlaying() { if (source.hasSource()) { int state = alGetSourcei(source.getSource().sourceId,AL_SOURCE_STATE); return (state == AL_PLAYING); } return false; } @Override public boolean isPaused() { if (source.hasSource()) { int state = alGetSourcei(source.getSource().sourceId,AL_SOURCE_STATE); return (state == AL_PAUSED); } return false; } @Override public void setLooping(boolean doLoop) { source.setLooping(doLoop,true); } @Override public boolean isLooping() { return source.isLooping(); } @Override public void setPosition(float x, float y, float z) { source.setPosition(x,y,z); } @Override public float[] getPosition() { return source.getPosition(); } @Override public void setVelocity(float x, float y, float z) { source.setVelocity(x,y,z); } @Override public float[] getVelocity() { return source.getVelocity(); } @Override public void setPitch(float p) { source.setPitch(p); } @Override public float getPitch() { return source.getPitch(); } @Override public void setGain(float g) { source.setGain(g); } @Override public float getGain() { return source.getGain(); } @Override public void setRolloff(float r) { source.setRolloff(r); } @Override public float getRolloff() { return source.getRolloff(); } @Override public void setDistance(float refDistance, float maxDistance) { source.setRefDistance(refDistance); source.setMaxDistance(maxDistance); } @Override public float[] getDistance() { return new float[] { source.getRefDistance(), source.getMaxDistance() }; } @Override public float getPlayDuration() { return (float)buffer.getLength() / 1000.0f; } @Override public float getPlayTime() { if (source.hasSource()) { return alGetSourcef(source.getSource().sourceId,AL_SEC_OFFSET); } return 0.0f; } @Override public void setPlayTime(float seconds) { if (source.hasSource()) { alSourcef(source.getSource().sourceId,AL_SEC_OFFSET,seconds); } } @Override public void fadeIn(float duration) { fade.begin(true,duration); } @Override public void fadeOut(float duration) { fade.begin(false,duration); } }
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>SelectionSchema | vend.io</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">vend.io</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="<API key>"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="<API key>" checked /> <label class="tsd-widget" for="<API key>">Inherited</label> <input type="checkbox" id="<API key>" checked /> <label class="tsd-widget" for="<API key>">Externals</label> <input type="checkbox" id="<API key>" /> <label class="tsd-widget" for="<API key>">Only exported</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">Globals</a> </li> <li> <a href="../modules/_schema_.html">&quot;schema&quot;</a> </li> <li> <a href="_schema_.selectionschema.html">SelectionSchema</a> </li> </ul> <h1>Interface SelectionSchema</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-comment"> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>A JSON schema for Option.Selection</p> </div> </div> </section> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <a href="_schema_.schema.html" class="tsd-signature-type">Schema</a> <ul class="tsd-hierarchy"> <li> <span class="target">SelectionSchema</span> </li> </ul> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property <API key>"><a href="_schema_.selectionschema.html#type" class="tsd-kind-icon">type</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property <API key>"> <a name="type" class="tsd-anchor"></a> <h3>type</h3> <div class="tsd-signature tsd-kind-icon">type<span class="<API key>">:</span> <span class="tsd-signature-type">"single"</span><span class="<API key>"> | </span><span class="tsd-signature-type">"multiple"</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/vend-io/vend.io/blob/0e98cf5/src/schema.ts#L19">schema.ts:19</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>The type of selection to use</p> </div> </div> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="globals "> <a href="../globals.html"><em>Globals</em></a> </li> <li class=" <API key>"> <a href="../modules/_core_.html">"core"</a> </li> <li class=" <API key>"> <a href="../modules/_index_.html">"index"</a> </li> <li class=" <API key>"> <a href="../modules/_inventory_.html">"inventory"</a> </li> <li class=" <API key>"> <a href="../modules/_item_.html">"item"</a> </li> <li class=" <API key>"> <a href="../modules/_options_.html">"options"</a> </li> <li class=" <API key>"> <a href="../modules/_payment_.html">"payment"</a> </li> <li class="current <API key>"> <a href="../modules/_schema_.html">"schema"</a> </li> <li class=" <API key>"> <a href="../modules/_selection_.html">"selection"</a> </li> <li class=" <API key>"> <a href="../modules/_state_.html">"state"</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.ijson.html" class="tsd-kind-icon">IJSON</a> </li> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.itemschema.html" class="tsd-kind-icon">Item<wbr>Schema</a> </li> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.optionschema.html" class="tsd-kind-icon">Option<wbr>Schema</a> </li> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.paymentschema.html" class="tsd-kind-icon">Payment<wbr>Schema</a> </li> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.schema.html" class="tsd-kind-icon">Schema</a> </li> </ul> <ul class="current"> <li class="current tsd-kind-interface <API key>"> <a href="_schema_.selectionschema.html" class="tsd-kind-icon">Selection<wbr>Schema</a> <ul> <li class=" tsd-kind-property <API key>"> <a href="_schema_.selectionschema.html#type" class="tsd-kind-icon">type</a> </li> </ul> </li> </ul> <ul class="after-current"> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.uischema.html" class="tsd-kind-icon">UISchema</a> </li> <li class=" tsd-kind-interface <API key>"> <a href="_schema_.vendorschema.html" class="tsd-kind-icon">Vendor<wbr>Schema</a> </li> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="<API key>"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function <API key>"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="<API key>"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="<API key>"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface <API key>"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="<API key> <API key>"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li> <li class="<API key> <API key>"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class <API key>"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="<API key> <API key>"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property <API key>"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method <API key>"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor <API key>"><span class="tsd-kind-icon">Accessor</span></li> <li class="<API key> <API key>"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="<API key> <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor <API key> tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor <API key> tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property <API key> tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method <API key> tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor <API key> tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property <API key> tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="<API key> <API key> tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="http://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
FILE(REMOVE_RECURSE "CMakeFiles/eigen2support_5.dir/eigen2support.cpp.o" "eigen2support_5.pdb" "eigen2support_5" ) # Per-language clean rules from dependency scanning. FOREACH(lang CXX) INCLUDE(CMakeFiles/eigen2support_5.dir/cmake_clean_${lang}.cmake OPTIONAL) ENDFOREACH(lang)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>maple-mode: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.12.0 / maple-mode - 8.5.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> maple-mode <small> 8.5.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2021-11-05 11:22:42 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-05 11:22:42 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils coq 8.12.0 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.1 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matej.kosik@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/maple-mode&quot; license: &quot;Proprietary&quot; build: [make &quot;-j%{jobs}%&quot;] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/MapleMode&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.6~&quot; &amp; != &quot;8.5.0~camlp4&quot; &amp; != &quot;8.5.2~camlp4&quot;} ] tags: [ &quot;keyword:maple&quot; &quot;keyword:simplification&quot; &quot;keyword:field tactic&quot; &quot;category:Miscellaneous/Coq Extensions&quot; &quot;date:2002-03&quot; ] authors: [ &quot;David Delahaye &lt;&gt;&quot; &quot;Micaela Mayero &lt;&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/maple-mode/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/maple-mode.git&quot; synopsis: &quot;A Maple Mode for Coq&quot; description: &quot;&quot;&quot; This contribution is an interface between Coq and Maple. In particular, this exports the functions simplify/factor/expand/normal giving the corresponding tactics Simplify/Factor/Expand/Normal. The manipulations carried out by these tactics are proved thanks to the tactic Field. These tactics can be also used as functions by means of the Eval ... In command.&quot;&quot;&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/maple-mode/archive/v8.5.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-maple-mode.8.5.0 coq.8.12.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.12.0). The following dependencies couldn&#39;t be met: - coq-maple-mode -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-maple-mode.8.5.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>coq-in-coq: Not compatible </title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file: <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif] </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.0 / coq-in-coq - 8.5.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> coq-in-coq <small> 8.5.0 <span class="label label-info">Not compatible </span> </small> </h1> <p> <em><script>document.write(moment("2022-03-04 11:22:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-04 11:22:03 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 <API key> of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.0 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.03.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.03.0 Official 4.03.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;matej.kosik@inria.fr&quot; homepage: &quot;https://github.com/coq-contribs/coq-in-coq&quot; license: &quot;LGPL 2&quot; build: [make] install: [make &quot;install&quot;] remove: [&quot;rm&quot; &quot;-R&quot; &quot;%{lib}%/coq/user-contrib/CoqInCoq&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.6~&quot;} ] tags: [ &quot;keyword:calculus of constructions&quot; &quot;category:Mathematics/Logic/Type theory&quot; &quot;category:Miscellaneous/Extracted Programs/Type checking unification and normalization&quot; ] authors: [ &quot;Bruno Barras &lt;&gt;&quot; ] bug-reports: &quot;https://github.com/coq-contribs/coq-in-coq/issues&quot; dev-repo: &quot;git+https://github.com/coq-contribs/coq-in-coq.git&quot; synopsis: &quot;A formalisation of the Calculus of Construction&quot; flags: light-uninstall url { src: &quot;https://github.com/coq-contribs/coq-in-coq/archive/v8.5.0.tar.gz&quot; checksum: &quot;md5=<API key>&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install </h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-coq-in-coq.8.5.0 coq.8.7.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.0). The following dependencies couldn&#39;t be met: - coq-coq-in-coq -&gt; coq &lt; 8.6~ -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coq-in-coq.8.5.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install </h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https: </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
#!/usr/bin/env bash # bash script that converts the C++ algorithms code into a pretty-printed PDF # named binder.pdf. This expects to be run in a Linux/BSD environment with the # "a2ps" command installed. On .deb and .rpm based Linux systems that command # is in a package called "a2ps". # Kevin Wortman <kwortman@fullerton.edu> # November 2013 # This is rather quick and dirty but it works. # check that a2ps is installed a2ps --help >/dev/null 2>&1 || { echo >2& "error: a2ps not installed"; exit 1; } # convert all files in algorithms/ and algorithms/floyd/ to postscript
// <auto-generated> // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Compute { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; using System.Collections; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; <summary> <API key> operations. </summary> public partial interface <API key> { <summary> Get a community gallery image. </summary> <param name='location'> Resource location. </param> <param name='publicGalleryName'> The public name of the community gallery. </param> <param name='galleryImageName'> The name of the community gallery image definition. </param> <param name='customHeaders'> The headers that will be added to request. </param> <param name='cancellationToken'> The cancellation token. </param> <exception cref="Microsoft.Rest.Azure.CloudException"> Thrown when the operation returned an invalid status code </exception> <exception cref="Microsoft.Rest.<API key>"> Thrown when unable to deserialize the response </exception> <exception cref="Microsoft.Rest.ValidationException"> Thrown when a required parameter is null </exception> Task<<API key><<API key>>> <API key>(string location, string publicGalleryName, string galleryImageName, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken)); } }
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>&nbsp;</b></th><td class="std2"></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2"><sup class="subfont">ˋ</sup><sup class="subfont">ˋ</sup><sup class="subfont">ˊ</sup></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2"><font class="english_word">yīn hào bù jué</font></td></tr> <tr><th class="std1"><b>&nbsp;</b></th><td class="std2"><img src=/cydic/dicword/fa40.gif border=0 alt=* class=fontimg valign=center><img src=/cydic/dicword/fa41.gif border=0 alt=* class=fontimg valign=center></td></tr> <tr><th class="std1"><b><font class="fltypefont"></font>&nbsp;</b></th><td class="std2"></td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
// <API key>.h // BUtton #import <UIKit/UIKit.h> @interface <API key> : UIViewController @end
package antsColony /** * @author mayas * */ class pathFinder(field : Array[Array[Int]], goalI : Int, goalJ : Int) { val _field = field val _goalI = goalI val _goalJ = goalJ def findPath(pathFindingInstance : PathFindingMethod) : Array[Int] = { return pathFindingInstance.getPath(_field, _goalI, _goalJ) } }
#include <assert.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "tssx/string-set.h" void ss_setup(StringSet* set, size_t capacity) { assert(set != NULL); if (capacity < SS_MINIMUM_CAPACITY) { capacity = SS_MINIMUM_CAPACITY; } _ss_allocate(set, capacity); set->size = 0; } void ss_destroy(StringSet* set) { Node* node; Node* next; assert(set != NULL); for (size_t i = 0; i < set->capacity; ++i) { node = set->nodes[i]; while (node) { next = node->next; free(node); node = next; } } free(set->nodes); } bool ss_insert(StringSet* set, String key) { Node* node; size_t index; <API key>(set); if (set->size == set->threshold) { _ss_resize(set); } index = _ss_hash(set, key); node = set->nodes[index]; for (; node; node = node->next) { if (_ss_equals(node->key, key)) { return SS_NOT_INSERTED; } } node = _ss_create_node(key, set->nodes[index]); set->nodes[index] = node; ++set->size; return SS_INSERTED; } bool ss_contains(StringSet* set, String key) { Node* node; size_t index; if (set->nodes != SS_UNINITIALIZED) { index = _ss_hash(set, key); for (node = set->nodes[index]; node; node = node->next) { if (_ss_equals(node->key, key)) return SS_FOUND; } } return SS_NOT_FOUND; } bool ss_remove(StringSet* set, String key) { Node* node; Node* previous; size_t index; if (set->nodes == SS_UNINITIALIZED) { return SS_NOT_FOUND; } index = _ss_hash(set, key); node = set->nodes[index]; for (previous = NULL; node; previous = node, node = node->next) { if (node->key == key) { if (previous) { previous->next = node->next; } else { set->nodes[index] = node->next; } free(node); if (--set->size == set->threshold / 4) { _ss_resize(set); } return SS_OK; } } return SS_NOT_FOUND; } void ss_clear(StringSet* set) { if (set->nodes == SS_UNINITIALIZED) return; ss_destroy(set); _ss_allocate(set, SS_MINIMUM_CAPACITY); set->size = 0; } bool ss_is_empty(StringSet* set) { return set->size == 0; } bool ss_is_initialized(StringSet* set) { return set->nodes != SS_UNINITIALIZED; } bool _ss_equals(String first, String second) { return strcmp(first, second) == 0; } void <API key>(StringSet* set) { assert(set != NULL); if (set->nodes == SS_UNINITIALIZED) { ss_setup(set, 0); } } void _ss_allocate(StringSet* set, size_t capacity) { size_t bytes; bytes = sizeof(Node*) * capacity; set->nodes = (Node**)malloc(bytes); memset(set->nodes, 0, bytes); set->capacity = capacity; set->threshold = capacity * SS_LOAD_FACTOR; } Node* _ss_create_node(String key, Node* next) { // Allocate the size of the node up to the flexible array member // and then also the node itself. This is cool, because only need // to delete the node and not the key separately (if we used a char* // instead of a flexible array). Also, cache lookup should be improved. Node* node = (Node*)malloc(sizeof(Node) + strlen(key)); strcpy(node->key, key); node->next = next; return node; } size_t _ss_hash(StringSet* set, String key) { // djb2 string hashing algorithm size_t hash; for (hash = 5381; *key != '\0'; ++key) { // (hash << 5) + hash = hash * 33 hash = ((hash << 5) + hash) ^ *key; } return hash % set->capacity; } void _ss_resize(StringSet* set) { size_t old_capacity = set->capacity; size_t new_capacity = set->size * 2; if (new_capacity < SS_MINIMUM_CAPACITY) return; Node** old = set->nodes; _ss_allocate(set, new_capacity); _ss_rehash(set, old, old_capacity); free(old); } void _ss_rehash(StringSet* set, Node** old, size_t old_capacity) { Node* node; Node* next; size_t new_index; size_t i; for (i = 0; i < old_capacity; ++i) { for (node = old[i]; node;) { next = node->next; new_index = _ss_hash(set, node->key); node->next = set->nodes[new_index]; set->nodes[new_index] = node; node = next; } } }
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.<API key>(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var core_1 = require('@angular/core'); var <API key> = require('../services/managers/info-window-manager'); var infoWindowId = 0; var <API key> = (function () { function <API key>(_infoWindowManager, _el) { this._infoWindowManager = _infoWindowManager; this._el = _el; /** * Sets the open state for the InfoWindow. You can also call the open() and close() methods. */ this.isOpen = false; /** * Emits an event when the info window is closed. */ this.infoWindowClose = new core_1.EventEmitter(); this.<API key> = false; this._id = (infoWindowId++).toString(); } <API key>.prototype.ngOnInit = function () { this.content = this._el.nativeElement.querySelector('.<API key>'); this._infoWindowManager.addInfoWindow(this); this.<API key> = true; this._updateOpenState(); }; /** @internal */ <API key>.prototype.ngOnChanges = function (changes) { if (!this.<API key>) { return; } if ((changes['latitude'] || changes['longitude']) && typeof this.latitude === 'number' && typeof this.longitude === 'number') { this._infoWindowManager.setPosition(this); } if (changes['zIndex']) { this._infoWindowManager.setZIndex(this); } if (changes['isOpen']) { this._updateOpenState(); } this.<API key>(changes); }; <API key>.prototype._updateOpenState = function () { this.isOpen ? this._infoWindowManager.open(this) : this._infoWindowManager.close(this); }; <API key>.prototype.<API key> = function (changes) { var options = {}; var optionKeys = Object.keys(changes).filter(function (k) { return <API key>.<API key>.indexOf(k) !== -1; }); optionKeys.forEach(function (k) { options[k] = changes[k].currentValue; }); this._infoWindowManager.setOptions(this, options); }; /** * Opens the info window. */ <API key>.prototype.open = function () { return this._infoWindowManager.open(this); }; /** * Closes the info window. */ <API key>.prototype.close = function () { var _this = this; return this._infoWindowManager.close(this).then(function () { _this.infoWindowClose.emit(void 0); }); }; /** @internal */ <API key>.prototype.id = function () { return this._id; }; /** @internal */ <API key>.prototype.toString = function () { return '<API key>-' + this._id.toString(); }; /** @internal */ <API key>.prototype.ngOnDestroy = function () { this._infoWindowManager.deleteInfoWindow(this); }; <API key>.<API key> = ['disableAutoPan', 'maxWidth']; <API key> = __decorate([ core_1.Component({ selector: '<API key>', inputs: ['latitude', 'longitude', 'disableAutoPan', 'isOpen'], outputs: ['infoWindowClose'], template: "<div class='<API key>'>\n <ng-content></ng-content>\n </div>\n " }), __metadata('design:paramtypes', [<API key>.InfoWindowManager, core_1.ElementRef]) ], <API key>); return <API key>; }()); exports.<API key> = <API key>; //# sourceMappingURL=<API key>.js.map
#ifndef QT_SFML_CANVAS_HPP #define QT_SFML_CANVAS_HPP #include <SFML/Graphics.hpp> #include <QtWidgets/qwidget.h> #include <QtCore/qtimer.h> #include "core/vector2.hpp" namespace interface { class QtSFMLCanvas : public QWidget, public sf::RenderWindow { public: QtSFMLCanvas(QWidget* parent); virtual ~QtSFMLCanvas() = default; using CursorId = std::size_t; enum : CursorId { InvalidCursorId = CursorId(-1) }; CursorId create_cursor(const sf::Image& image, sf::IntRect rect = sf::IntRect()); void set_active_cursor(CursorId); protected: void <API key>(CursorId); virtual void showEvent(QShowEvent*) override; virtual void paintEvent(QPaintEvent*) override; virtual void resizeEvent(QResizeEvent*) override; virtual void closeEvent(QCloseEvent*) override; virtual void leaveEvent(QEvent*) override; virtual void enterEvent(QEvent*) override; private: void render(); void draw_cursor(); void <API key>(); CursorId active_cursor() const; bool <API key>() const; virtual QPaintEngine* paintEngine() const override; virtual void onInitialize() {} virtual void onRender() {} bool initialized_ = false; bool cursor_visible_ = false; bool was_cursor_visible_ = false; QTimer timer_; std::map<CursorId, sf::Texture> cursor_map_; CursorId active_cursor_ = InvalidCursorId; CursorId prioritized_cursor_ = InvalidCursorId; CursorId last_cursor_ = InvalidCursorId; core::Vector2i mouse_position_; }; } #endif
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include "mraa/i2c.h" #include "mraa_internal_types.h" extern mraa_board_t* plat; void print_version() { fprintf(stdout, "Version %s on %s", mraa_get_version(), <API key>()); if (plat != NULL && plat->sub_platform != NULL) fprintf(stdout, " with %s", plat->sub_platform->platform_name); fprintf(stdout, "\n"); } void print_help() { fprintf(stdout, "version Get mraa version and board name\n"); fprintf(stdout, "list List available busses\n"); fprintf(stdout, "detect bus List detected devices on specified bus\n"); fprintf(stdout, "get bus device reg Get value from specified device register\n"); fprintf(stdout, "set bus device reg value Set specified device register to value\n"); } void print_command_error() { fprintf(stdout, "Invalid command, options are:\n"); print_help(); } void print_bus(mraa_board_t* board) { int i, bus; for (i = 0; i < board->i2c_bus_count; ++i) { char* busType; switch (board->platform_type) { case <API key>: case <API key>: case <API key>: case MRAA_INTEL_DE3815: case <API key>: case MRAA_RASPBERRY_PI: case MRAA_BEAGLEBONE: case MRAA_BANANA: case MRAA_UP: bus = i; busType = "linux"; break; case MRAA_FTDI_FT4222: busType = "ft4222"; bus = <API key>(i); break; default: busType = "unknown"; break; } int id = board->i2c_bus[i].bus_id; fprintf(stdout, "Bus %3d: id=%02d type=%s ", bus, id, busType); if (i == board->def_i2c_bus) fprintf(stdout, " default"); if (id == -1) fprintf(stdout, " disabled"); fprintf(stdout, "\n"); } } void print_busses() { print_bus(plat); if (<API key>()) print_bus(plat->sub_platform); } mraa_result_t i2c_get(int bus, uint8_t device_address, uint8_t register_address, uint8_t* data) { mraa_result_t status = MRAA_SUCCESS; mraa_i2c_context i2c = mraa_i2c_init(bus); if (i2c == NULL) { return <API key>; } status = mraa_i2c_address(i2c, device_address); if (status != MRAA_SUCCESS) { goto i2c_get_exit; } status = mraa_i2c_write_byte(i2c, register_address); if (status != MRAA_SUCCESS) { goto i2c_get_exit; } status = mraa_i2c_read(i2c, data, 1) == 1 ? MRAA_SUCCESS : <API key>; if (status != MRAA_SUCCESS) { goto i2c_get_exit; } i2c_get_exit: mraa_i2c_stop(i2c); return status; } mraa_result_t i2c_set(int bus, uint8_t device_address, uint8_t register_address, uint8_t data) { mraa_result_t status = MRAA_SUCCESS; mraa_i2c_context i2c = mraa_i2c_init(bus); if (i2c == NULL) { return <API key>; } status = mraa_i2c_address(i2c, device_address); if (status != MRAA_SUCCESS) { fprintf(stderr, "Could not set i2c device address\n"); goto i2c_set_exit; } status = <API key>(i2c, data, register_address); if (status != MRAA_SUCCESS) { fprintf(stderr, "Could not write to i2c register. Status = %d\n", status); goto i2c_set_exit; } i2c_set_exit: mraa_i2c_stop(i2c); return status; } void i2c_detect_devices(int bus) { mraa_result_t status = MRAA_SUCCESS; mraa_i2c_context i2c = mraa_i2c_init(bus); if (i2c == NULL) { return; } int addr; for (addr = 0x0; addr < 0x80; ++addr) { uint8_t value; if ((addr) % 16 == 0) printf("%02x: ", addr); if (i2c_get(bus, addr, 0, &value) == MRAA_SUCCESS) printf("%02x ", addr); else printf(" if ((addr + 1) % 16 == 0) printf("\n"); } } int process_command(int argc, char** argv) { int status = 0; if (strcmp(argv[1], "help") == 0) { print_help(); return 0; } else if (strcmp(argv[1], "version") == 0) { print_version(); return 0; } else if (strcmp(argv[1], "list") == 0) { print_busses(); return 0; } else if (strcmp(argv[1], "detect") == 0) { if (argc == 3) { int bus = strtol(argv[2], NULL, 0); i2c_detect_devices(bus); return 0; } else { print_command_error(); return 1; } } else if ((strcmp(argv[1], "get") == 0) || (strcmp(argv[1], "getrpt") == 0)) { if (argc == 5) { int interation = 0; mraa_boolean_t should_repeat = strcmp(argv[1], "getrpt") == 0; int bus = strtol(argv[2], NULL, 0); uint8_t device_address = strtol(argv[3], NULL, 0); uint8_t register_address = strtol(argv[4], NULL, 0); // fprintf(stdout, "Device %02X, Register = %02X\n", device_address, register_address); uint8_t data; do { if (i2c_get(bus, device_address, register_address, &data) == MRAA_SUCCESS) { if (should_repeat) fprintf(stdout, "%4d: ", interation); fprintf(stdout, "Register %#02X = %#02X\n", register_address, data); status = 0; } else { fprintf(stdout, "i2c get failed\n"); status = 1; } interation++; usleep(10000); } while (should_repeat && status == 0); } else { print_command_error(); status = 1; } return status; } else if ((strcmp(argv[1], "set") == 0)) { if (argc == 6) { int bus = strtol(argv[2], NULL, 0); uint8_t device_address = strtol(argv[3], NULL, 0); uint8_t register_address = strtol(argv[4], NULL, 0); uint8_t value = strtol(argv[5], NULL, 0); fprintf(stdout, "Device %02X, Register = %02X, Value = %02X\n", device_address, register_address, value); if (i2c_set(bus, device_address, register_address, value) != MRAA_SUCCESS) { fprintf(stdout, "i2c set failed\n"); return 0; } return 1; } else { print_command_error(); return 1; } } else { print_command_error(); return 1; } } void <API key>() { char command[80]; while (1) { int i, argc = 1; char* argv[32]; char* arg; argv[0] = "mraa-i2c"; fprintf(stdout, "Command: "); fgets(command, 80, stdin); command[strlen(command) - 1] = 0; if (strcmp(command, "q") == 0) return; char* str = strtok(command, " "); while (str != NULL) { arg = malloc(strlen(str) + 1); argv[argc++] = strcpy(arg, str); str = strtok(NULL, " "); } process_command(argc, argv); for (i = 1; i < argc; ++i) free(argv[i]); } } int main(int argc, char** argv) { mraa_set_log_level(7); if (argc == 1) { <API key>(); return 0; } else return process_command(argc, argv); }
layout: post microblog: true category: photo date: '2015-06-04T21:54:55' title: "" slug: '15060412215455' location: '' mf-photo: - https://cdn.ericalba.com/blog-images/_ig-photos/photos/201506/<API key>.jpg Trying out the original Jucy Lucy (sic). Cheeseburger with molten cheese core inside patty. Great! W/ @wassupjodi & @gnu44 #eater <img src="https://cdn.ericalba.com/blog-images/_ig-photos/photos/201506/<API key>.jpg" />
<?php namespace Manaferra\App\Commands; use App\Models\Language; use App\Models\Settings; use App\Models\User; use App\Models\UserGroup; use Doctrine\DBAL\Driver\PDOException; use Illuminate\Console\Command; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Hash; use Larapack\ConfigWriter\Repository; use Manaferra\App\Services\Languages; use Manaferra\App\Services\Requirements; use Manaferra\App\Services\Environment; use Manaferra\<API key>; use Mockery\Exception; use Manaferra\App\Traits\GetAvailableOptions; use Manaferra\App\Traits\OutputStyles; use Illuminate\Config\Repository as ConfigRepository; class AppInstall extends Command{ use OutputStyles, GetAvailableOptions; /** * The name and signature of the console command. * * @var string */ protected $signature = 'app:install {--deleteUploads}'; /** * The console command description. * * @var string */ protected $description = 'Install Manaferra CMS'; /** * if cms is installed * @var */ private $isInstalled = false; /** * App name * @var string */ private $APP_NAME; /** * APP URL * @var string */ private $APP_URL; /** Database type * @var string */ private $DB_TYPE; /** Database Host * @var string */ private $DB_HOST; /** Database Port * @var int */ private $DB_PORT; /** Database Name * @var string */ private $DB_DATABASE; /** Database Username * @var string */ private $DB_USERNAME; /** Database Password * @var string */ private $DB_PASSWORD; /** * Time zone * @var string $TIMEZONE */ private $TIMEZONE; /** * ADMin first name * @var string $ADMIN_FIRST_NAME */ private $ADMIN_FIRST_NAME; /** * Admin last name * @var string $ADMIN_LAST_NAME */ private $ADMIN_LAST_NAME; /** * Admin email * @var string $ADMIN_EMAIL */ private $ADMIN_EMAIL; /** * Admin password * @var string $ADMIN_PASSWORD */ private $ADMIN_PASSWORD; /** * Site's primary language * @var object $PRIMARY_LANGUAGE */ private $PRIMARY_LANGUAGE; /** * @var Requirements */ private $requirements; /** * @var object */ private $bar; /** * @var Environment */ private $env; /** * @var ConfigRepository */ private $config; /** * MakeInstall constructor. * * @param Requirements $requirements * @param Environment $environment * * @return void */ public function __construct( ConfigRepository $config, Requirements $requirements, Environment $environment ){ parent::__construct(); $this->config = $config; $this->requirements = $requirements; $this->env = $environment; } /** * Execute the console command. * * @throws \Exception */ public function handle(){ $this->clearCaches(); if($this->isInstalled()){ return false; } // delete current .env file if(file_exists(app()->environmentFilePath())){ File::delete(app()->environmentFilePath()); } // get .env.example or stub file $envTemplate = base_path('.env.example'); if(!file_exists($envTemplate)){ $envTemplate = stubPath('.env'); } File::put(app()->environmentFilePath(), File::get($envTemplate)); $this->config->set('app.key', 'SomeRandomString'); $this->config->set('app.env', 'local'); $this->block(' -- Welcome to CMS -- ', 'fg=white;bg=green;options=bold'); $this->line(''); $this->line('Please answer the following questions:'); $this->line(''); // show Bar $steps = 14; if($this->option('deleteUploads')){ $steps++; } $this->bar = $this->output->createProgressBar($steps); $this->APP_NAME = $this->ask('Your Site Name', config('app.name')); $this->APP_URL = $this->ask('Your App URL', config('app.url')); $this->DB_TYPE = $this->ask('Your Database type', config('database.default')); $this->DB_HOST = $this->ask('Your DB_HOST', config('database.connections.'.$this->DB_TYPE.'.host')); $this->DB_PORT = $this->ask('Your DB PORT', config('database.connections.'.$this->DB_TYPE.'.port')); $this->DB_DATABASE = $this->ask('Your Database Name', config('database.connections.'.$this->DB_TYPE.'.database')); $this->DB_USERNAME = $this->ask('Your DB Username', config('database.connections.'.$this->DB_TYPE.'.username')); $this->DB_PASSWORD = $this->ask('Your DB Password', config('database.connections.'.$this->DB_TYPE.'.password')); // Validate Database $this->validateDatabase(); $regions = $this->getTimezoneRegions(); $this->TIMEZONE = $this->choice('Timezone region', array_keys($regions), 0); if ($this->TIMEZONE !== 'UTC') { $locations = $this-><API key>($regions[$this->TIMEZONE]); $this->TIMEZONE .= '/' . $this->choice('Timezone location', $locations, 0); } $this-><API key>(); $this->ADMIN_FIRST_NAME = $this->ask('Your First Name'); $this->ADMIN_LAST_NAME = $this->ask('Your Last Name'); $this->ADMIN_EMAIL = $this->ask('Your Email'); $this->ADMIN_PASSWORD = $this->ask('Set Your Admin Password'); $this->saveConfiguration(); if($this->option('deleteUploads')){ $this->info("Deleting uploads"); File::deleteDirectory(public_path('uploads'), true); $this->advanceBar(); } $this->info("Running database migration"); $this->call('migrate',['--force' => true]); $this->advanceBar(); $this->clearCaches(); $this->optimize(); // Create Default Language $this->info("Creating default language"); factory(\App\Models\Language::class)->create([ 'name' => $this->PRIMARY_LANGUAGE->name, 'nativeName' => $this->PRIMARY_LANGUAGE->nativeName, 'slug' => $this->PRIMARY_LANGUAGE->slug, 'isDefault' => true ]); $this->advanceBar(); $this->info("Creating default roles"); UserGroup::createDefaultRoles(); $this->advanceBar(); $this->info("Creating admin user"); $this->createAdminUser(); $this->advanceBar(); $this->info("Creating default post types"); (new \<API key>())->run(); $this->advanceBar(); $this->info("Creating examples media files"); (new \MediaDevSeeder())->run(10); $this->advanceBar(); // Create tags example $this->info("Creating example tags"); (new \TagDevSeeder())->run(); $this->advanceBar(); // Create a category $this->info("Creating an example category"); $categoryObj = new \CategoryDevSeeder(); $categoryObj->exampleTitles = true; $categoryObj->run(); $this->advanceBar(); // Create default permalinks $this->info("Creating default permalinks"); (new \<API key>())->run(); $this->advanceBar(); // Creating settings $this->info("Saving settings"); $this->setSettings(); $this->advanceBar(); $this->info("Creating example posts"); (new \PostDevSeeder())->run(3); $this->advanceBar(); // Create Primary Menu $this->info("Creating primary Menu"); $menuSeeder = new \MenuSeeder(); $menu = $menuSeeder->createPrimaryMenu(); $menuSeeder-><API key>($menu); $menuSeeder-><API key>($menu); $menuSeeder->addCategoryToMenu($menu); $this->advanceBar(); $this->generateKey(); $this->clearCaches(); $this->optimize(); /** * Save configuration in .env file and in config run time */ private function saveConfiguration(){ $this->info("Writing configuration file"); // Save in .env file $this->env->setEnv([ 'APP_URL' => $this->APP_URL, 'DB_CONNECTION' => $this->DB_TYPE, 'DB_HOST' => $this->DB_HOST, 'DB_PORT' => $this->DB_PORT, 'DB_DATABASE' => $this->DB_DATABASE, 'DB_USERNAME' => $this->DB_USERNAME, 'DB_PASSWORD' => $this->DB_PASSWORD, ]); // save in runtime $this->config->set('app.url', $this->APP_URL); $this->config->set('app.name', str_replace(' ','_',$this->APP_NAME)); $this->config->set('database.connections.mysql.driver', $this->DB_TYPE); $this->config->set('database.connections.mysql.host', $this->DB_HOST); $this->config->set('database.connections.mysql.port', $this->DB_PORT); $this->config->set('database.connections.mysql.database', $this->DB_DATABASE); $this->config->set('database.connections.mysql.username', $this->DB_USERNAME); $this->config->set('database.connections.mysql.password', $this->DB_PASSWORD); // save in app.config $content = File::get(config_path('app.php')); $newContent = str_replace("'name' => '".config('app.name')."'", "'name' => '".$this->APP_NAME."'", $content); FILe::put(config_path('app.php'), $newContent); $this->advanceBar(); } /** * Set CMS Settings * @return void */ private function setSettings(){ Settings::setSetting('siteTitle', $this->APP_NAME); Settings::setSetting('adminEmail', $this->ADMIN_EMAIL); Settings::setSetting('defaultUserRole', 'admin'); Settings::setSetting('timezone', $this->TIMEZONE); Settings::setSetting('logo', 1); Settings::setSetting('activeTheme', config('project.defaultTheme')); Settings::setSetting('activateMobileTheme', false); Settings::setSetting('mobileActiveTheme', ''); Settings::setSetting('trackingCode', ''); Settings::setSetting('useTagManager', 0); Settings::setSetting('tagManager', ''); $language = Language::where('isDefault', 1)->first(); Settings::setSetting('defaultLanguage', $language->languageID); } /** * Forks a process to create the admin user. * */ private function createAdminUser(){ factory(User::class)->create([ 'firstName' => $this->ADMIN_FIRST_NAME, 'lastName' => $this->ADMIN_LAST_NAME, 'slug' => str_slug($this->ADMIN_FIRST_NAME.'-'.$this->ADMIN_LAST_NAME), 'email' => $this->ADMIN_EMAIL, 'password' => Hash::make($this->ADMIN_PASSWORD), 'isActive' => true, 'groupIDs' => [ 1 => UserGroup::getAdminRole()->groupID ] ]); } /** * Calls the artisan key:generate to set the APP_KEY. */ private function generateKey() { $this->info('Generating application key'); $this->callSilent('key:generate', ['--force' => true]); $this->advanceBar(); } /** * Clears all Laravel caches. */ protected function clearCaches() { $this->callSilent('clear-compiled'); $this->callSilent('cache:clear'); $this->callSilent('route:clear'); $this->callSilent('config:clear'); $this->callSilent('view:clear'); Cache::flush(); } /** * Runs the artisan optimize commands. */ protected function optimize() { if (!App::environment('local')) { $this->callSilent('optimize', ['--force' => true]); $this->callSilent('config:cache'); } } /** * Validate Database * @return void * @throws Exception */ private function validateDatabase(){ /* * Check Database Connection */ $dsn = $this->DBConnectComand(); try { $DBConnection = new \PDO($dsn, $this->DB_USERNAME, $this->DB_PASSWORD, array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION)); } catch (PDOException $ex) { throw new Exception('Connection to database failed: ' . $ex->getMessage()); } /* * Check if the database is empty on install */ if(!$this->isInstalled) { $tables = 0; $fetch = $this->checkDatabase($DBConnection); while ($result = $fetch->fetch()){ $tables++; break; } if ($tables > 0) { throw new Exception('Database "' . $this->DB_DATABASE . '" is not empty. Please empty the database or specify another database.'); } } return; } /** * Create db connection command for PDO * @return string */ private function DBConnectComand(){ /* * Check Database Connection */ switch ($this->DB_TYPE){ case 'sqlite': $dsn = 'sqlite:'.$this->DB_DATABASE; $this->validateSqliteFile($this->DB_DATABASE); break; case 'pgsql': $dsn ='pgsql:host='.$this->DB_HOST.';dbname='.$this->DB_DATABASE.';port='.$this->DB_PORT; break; case 'sqlsrv': $availableDrivers = \PDO::getAvailableDrivers(); if (in_array('dblib', $availableDrivers)) { $dsn = 'dblib:host='.$this->DB_HOST.$this->DB_PORT.';dbname='.$this->DB_DATABASE; } else { $dsn = 'sqlsrv:Server='.$this->DB_HOST.$this->DB_PORT.';Database='.$this->DB_DATABASE; } break; default: $dsn = 'mysql:host='.$this->DB_HOST.';dbname='.$this->DB_DATABASE.';port='.$this->DB_PORT; break; } return $dsn; } /** * @param \PDO $DBConnection * @return mixed */ private function checkDatabase($DBConnection){ switch ($this->DB_TYPE){ case 'sqlite': $fetch = $DBConnection->query("select name from sqlite_master where type='table'", \PDO::FETCH_NUM); break; case 'pgsql': $fetch = $DBConnection->query("select table_name from information_schema.tables where table_schema = 'public'", \PDO::FETCH_NUM); break; case 'sqlsrv': $fetch = $DBConnection->query("select [table_name] from information_schema.tables", \PDO::FETCH_NUM); break; default: $fetch = $DBConnection->query('show tables', \PDO::FETCH_NUM); break; } return $fetch; } /** * Validate that sql file exist * @param string $DB_DATABASE * @return void */ protected function validateSqliteFile($DB_DATABASE) { if (!file_exists($DB_DATABASE)) { $directory = dirname($DB_DATABASE); if (!is_dir($directory)) mkdir($directory, 0644, true); new \PDO('sqlite:' . $DB_DATABASE); } return; } private function advanceBar(){ $this->bar->advance(); $this->line(''); $this->line(''); } /** * @return bool */ private function isInstalled(){ if( // APP KEY is not a a random string ($this->config->get('app.key') && $this->config->get('app.key') !== 'SomeRandomString') // .env file exists || File::exists(app()->environmentFilePath()) ) { $this->failure( 'You have already installed CMS!', 'If you were trying to update CMS, please use "php artisan app:update" or run "php artisan app:uninstall" to delete current instalation.', 'If you were trying to reinstall CMS, you have to first uninstall it by running php artisan app::uninstall'); return true; } return false; } /** * Ask about default langauge * @throws \Exception */ private function <API key>(){ $languageList = []; foreach(Language::ISOlist() as $language){ $languageList[] = $language->name; } $languageName = $this->anticipate('What is your site\'s primary language?', $languageList, 'English'); $this->PRIMARY_LANGUAGE = Language::getISOByName($languageName); if(!$this->PRIMARY_LANGUAGE){ throw new \Exception('Langauge could not be found in ISO 639.1 list!'); } } }
package com.highcharts.config import scalajs.js, js.`|` import com.highcharts.CleanJsObject import com.highcharts.HighchartsUtils._ /** * @note JavaScript name: <code><API key></code> */ @js.annotation.ScalaJSDefined class <API key> extends com.highcharts.<API key> { val duration: js.UndefOr[Double] = js.undefined } object <API key> { def apply(duration: js.UndefOr[Double] = js.undefined): <API key> = { val durationOuter: js.UndefOr[Double] = duration com.highcharts.<API key>.toCleanObject(new <API key> { override val duration: js.UndefOr[Double] = durationOuter }) } }
using System.Threading.Tasks; namespace Ceta.Core { <summary> Represents a request to be tested in a chained test thread. </summary> public interface ICetaRequest { <summary> Gets the response asynchronously. </summary> <param name="context">The <see cref="ITestContext"/> for the request.</param> <returns>A task that represents the request sending.</returns> Task<ICetaResponse> GetResponseAsync(ITestContext context); } }
<style type="text/css"> /* COLORS */ /* Text Color */ body, article section ul.credit li.author a:hover, article footer a:hover, body.permalink-page article ul.credit li a:hover, body.permalink-page article ul.tags li a:hover, body.permalink-page article div.comments, body.permalink-page article div.notes { color: {{ site.text_color }}; } /* Accent Color */ a, ul.post-archive a:hover .title { color: {{ site.accent_color }}; } /* Hover Color */ a:hover, article.text header h2 a:hover { color: {{ site.hover_color }}; } /* Sublte Color */ header.site-fixed nav.pages ul li:after, a.highres, a.permalink-button, article section ul.credit, article section ul.credit li.author a, article footer, article footer a, article.chat strong, article.ask header div.asker-wrap p.asker, article.photo ul.exif, body.permalink-page article ul.credit, body.permalink-page article ul.tags, body.permalink-page article ul.credit li a, body.permalink-page article ul.tags li a, ul.post-archive .date { color: {{ site.subtle_color }}; } /* Subtle Icon Color */ a.highres span:before, a.permalink-button span:before, a.highres:after, article footer a:before, article footer ul.meta li span:before, article.link header h2 a:after { color: {{ site.subtle_color }}; opacity: 0.6; } /* Subtle Color Hover */ a.highres span:hover:before, a.permalink-button span:hover:before, a.highres:hover:after, article footer a:hover:before, article footer ul.meta li span:hover:before, article.link header h2 a:hover:after { color: {{ site.subtle_color }}; } /* Title Color */ h1, article.photo h2:first-of-type, article.video h2:first-of-type, article.photoset h2:first-of-type, article.audio h2:first-of-type, article.text header h2, article.text header p, article.chat header h2, article.chat header p, article.quote header h2, article.quote header p, article.text header h2 a, ul.post-archive .title { color: {{ site.title_color }}; } /* Text On Accent Color */ a.button { color: {{ site.<API key> }}; } /* Text On Accent Color */ a.read-more.button:after, nav#pagination ul li.prev a:before, nav#pagination ul li.next a:after { color: {{ site.<API key> }}; opacity: 0.4; } /* Header Area */ /* Header Title Color */ header.site-info section.description h1 a, header.site-info nav.pages ul li a:hover, footer.page-foot a:hover, header.site-info ul.util a:hover, footer.page-foot section h1, footer.page-foot section h2, footer.page-foot section h3, footer.page-foot section h4, footer.page-foot section h5, footer.page-foot section.social-links ul li a:hover { color: {{ site.header_title_color }}; } /* Header Text Color */ header.site-info section.description p, footer.page-foot, footer.page-foot section.bottom a:hover { color: {{ site.header_text_color }}; } /* Header Accent Color */ header.site-info nav.pages ul li a, footer.page-foot section.social-links ul li a { color: {{ site.header_accent_color }}; } /* Header Subtle Color */ header.site-info ul.util, header.site-info ul.util a, header.site-info nav.pages ul li:after, footer.page-foot section.bottom, footer.page-foot section.instagram a.btn { color: {{ site.header_subtle_color }}; } /* Backgrounds */ article.audio header .audio-embed, p > code, li > code { background-color: {{ site.subtle_border }}; } /* Background */ body, header.site-fixed nav.pages, a.highres, a.permalink-button { background-color: {{ site.background }}; } /* Header Background */ header.site-info, footer.page-foot { background-color: {{ site.header_background }}; } /* Post Background */ header.site-fixed nav.pages { background-color: {{ site.post_background }}; } /* Accent Background */ a.button { background-color: {{ site.accent_color }} } /* Borders */ /* subtleBorder */ blockquote, article footer, article.photo h2:first-of-type, article.video h2:first-of-type, article.photoset h2:first-of-type, article.audio h2:first-of-type, article.text header, article.ask header, article.chat header, article.quote header, article.link header, body.permalink-page article div.notes, ul.post-archive li { border-color: {{ site.subtle_border }}; } /* headerSubtleBorder */ header.site-info nav.pages, footer.page-foot section.bottom { border-color: {{ site.<API key> }}; } /* if posts have background color set */ {% if site.post_background %} article, header.site-fixed nav.pages { background-color: {{ site.post_background }}; } article.photo header, article.video header, article.photoset header, article.audio header { margin-top: 0em; } article { padding-bottom: 0; } hr { visibility: hidden; } div.comments { background-color: {{ site.post_background }}; } {% endif %} </style>
Add your custom my.cnf here or mount one at run time to /container/service/mariadb/assets/config/my.cnf If not present the default one will be used.
<?php namespace WP; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpKernel\TerminableInterface; use Monolog\Logger; use Stack\Builder; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; class Application implements HttpKernelInterface, TerminableInterface { use InjectorTrait; /** @var \WP\Route\RouteCollection */ protected $router; /** @var \callable */ protected $exceptionDecorator; /** @var array */ protected $config = []; /** @var array */ protected $loggers = []; /** * @param bool $debug Enable debug mode */ public function __construct($debug = true) { $this->setConfig('debug', $debug); $this-><API key>(function (\Exception $e) { $response = new Response; $response->setStatusCode(method_exists($e, 'getStatusCode') ? $e->getStatusCode() : 500); $response->headers->add(['Content-Type' => 'application/json']); $return = [ 'error' => [ 'message' => $e->getMessage() ] ]; if ($this->getConfig('debug', true) === true) { $return['error']['trace'] = explode(PHP_EOL, $e->getTraceAsString()); } //$response->setContent(json_encode($return)); $response->setContent('<pre>'.print_r($return, true).'</pre>'); return $response; }); } /** * Return the router. * * @return \WP\Route\RouteCollection */ public function getRouter() { if (!isset($this->router)) { $this->router = $this->getInjector()->make('\WP\Route\RouteCollection'); $this->getInjector()->share($this->router); } return $this->router; } /* * Return the event emitter. * * @return \League\Event\Emitter */ //public function getEventEmitter() // return $this->getEmitter(); /** * Return a logger * * @param string $name * @return \Psr\Log\LoggerInterface */ public function getLogger($name = 'default') { if (isset($this->loggers[$name])) { return $this->loggers[$name]; } $logger = new Logger($name); $this->loggers[$name] = $logger; return $logger; } /** * Set the exception decorator. * * @param callable $func * * @return void */ public function <API key>(callable $func) { $this->exceptionDecorator = $func; } /** * Handle the request. * * @param \Symfony\Component\HttpFoundation\Request $request * @param int $type * @param bool $catch * * @throws \Exception * @throws \LogicException * * @return \Symfony\Component\HttpFoundation\Response */ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true) { $this->getInjector()->share($request); try { //$this->emit('request.received', $request); $dispatcher = $this->getRouter()->getDispatcher(); $response = $dispatcher->dispatch( $request->getMethod(), $request->getPathInfo() ); //$this->emit('response.created', $request, $response); return $response; } catch (\Exception $e) { if (!$catch) { throw $e; } $response = call_user_func($this->exceptionDecorator, $e); if (!$response instanceof Response) { throw new \LogicException('Exception decorator did not return an instance of Symfony\Component\HttpFoundation\Response'); } //$this->emit('response.created', $request, $response); return $response; } } /** * Terminates a request/response cycle. * * @param \Symfony\Component\HttpFoundation\Request $request * @param \Symfony\Component\HttpFoundation\Response $response * * @return void */ public function terminate(Request $request, Response $response) { //$this->emit('response.sent', $request, $response); } /** * Run the application. * * @param \Symfony\Component\HttpFoundation\Request|null $request * * @return void */ public function run(Request $request = null) { if (null === $request) { $request = Request::createFromGlobals(); } $app = (new Builder()) ->push('WP\Middleware\ApiVersion') ->resolve($this); $response = $app->handle($request, self::MASTER_REQUEST, false); $response->send(); $this->terminate($request, $response); } /* * Subscribe to an event. * * @param string $event * @param callable $listener * @param int $priority */ //public function subscribe($event, $listener, $priority = <API key>::P_NORMAL) // $this->addListener($event, $listener, $priority); /** * Set a config item * * @param string $key * @param mixed $value */ public function setConfig($key, $value) { $this->config[$key] = $value; } /** * Get a config key's value * * @param string $key * @param mixed $default * * @return mixed */ public function getConfig($key, $default = null) { return isset($this->config[$key]) ? $this->config[$key] : $default; } }
#pragma once #include "AssertionException.h" #include <sstream> namespace SlothUnit { class Assertion { bool givenBoolean = false; std::string givenString = ""; int givenInteger = 0; float givenFloat = 0.f; public: explicit Assertion(bool givenBoolean) : givenBoolean(givenBoolean) {} explicit Assertion(std::string givenString) : givenString(givenString) {} explicit Assertion(int givenInteger) : givenInteger(givenInteger) {} explicit Assertion(float givenFloat) : givenFloat(givenFloat) {} bool ToBeTrue(); bool ToBeFalse(); bool ToBe(std::string expectedString); bool ToBe(int expectedInteger); bool ToBe(float expectedFloat); }; bool Assertion::ToBeTrue() { if (givenBoolean) return true; throw AssertionException(std::string("Expected true, obtained false")); } bool Assertion::ToBeFalse() { if (!givenBoolean) return true; throw AssertionException(std::string("Expected false, obtained true")); } bool Assertion::ToBe(std::string expectedString) { if (givenString == expectedString) return true; std::string exceptionMessage = "Expected \"" + expectedString + "\", obtained \"" + std::string(givenString) + "\""; throw AssertionException(exceptionMessage); } bool Assertion::ToBe(int expectedInteger) { if (givenInteger == expectedInteger) return true; std::ostringstream exceptionStream; exceptionStream << "Expected " << expectedInteger << ", obtained " << givenInteger; throw AssertionException(exceptionStream.str()); } bool Assertion::ToBe(float expectedFloat) { if (abs(givenFloat - expectedFloat) < std::numeric_limits<float>::epsilon()) return true; std::ostringstream exceptionStream; exceptionStream.precision(20); exceptionStream << "Expected " << expectedFloat << ", obtained " << givenFloat; throw AssertionException(exceptionStream.str()); } inline Assertion Expect(bool givenBoolean) { return Assertion(givenBoolean); } inline Assertion Expect(std::string givenString) { return Assertion(givenString); } inline Assertion Expect(char* givenString) { return Assertion(std::string(givenString)); } inline Assertion Expect(int givenInteger) { return Assertion(givenInteger); } inline Assertion Expect(float givenFloat) { return Assertion(givenFloat); } }
<?php namespace Oro\Bundle\ApiBundle\Tests\Unit\Validator\Constraints; use Doctrine\Common\Collections\<API key>; use Oro\Bundle\ApiBundle\Validator\Constraints\All; use Oro\Bundle\ApiBundle\Validator\Constraints\AllValidator; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Test\<API key>; class AllValidatorTest extends <API key> { protected function createValidator() { return new AllValidator(); } public function testNullIsValid() { $this->validator->validate(null, new All(new NotBlank())); $this->assertNoViolation(); } /** * @expectedException \Symfony\Component\Validator\Exception\<API key> */ public function <API key>() { $this->validator->validate('test', new All(new NotBlank())); } /** * @dataProvider getValidArguments */ public function <API key>($array) { $constraint = new NotBlank(); $i = 0; foreach ($array as $key => $value) { $this-><API key>($i++, '[' . $key . ']', $value, [$constraint]); } $this->validator->validate($array, new All($constraint)); $this->assertNoViolation(); } /** * @dataProvider getValidArguments */ public function <API key>($array) { $constraints = [new NotBlank(), new NotNull()]; $i = 0; foreach ($array as $key => $value) { $this-><API key>($i++, '[' . $key . ']', $value, $constraints); } $this->validator->validate($array, new All($constraints)); $this->assertNoViolation(); } public function getValidArguments() { return [ [[5, 6, 7]], [new \ArrayObject([5, 6, 7])] ]; } public function <API key>() { /** @var <API key> $collection */ $collection = $this-><API key>(<API key>::class); $this->validator->validate($collection, new All(new NotBlank())); $this->assertNoViolation(); self::assertFalse($collection->isInitialized()); } }
#ifndef <API key> #define <API key> // rose_config.h // 9/11/2012 jichi // Suppress harmless compiler warnings for ROSE 0.9 #ifdef __clang__ # pragma GCC diagnostic ignored "-Wdeprecated" # pragma GCC diagnostic ignored "-Wignored-qualifiers" # pragma GCC diagnostic ignored "-Wmismatched-tags" # pragma GCC diagnostic ignored "-Woverloaded-virtual" # pragma GCC diagnostic ignored "-Wparentheses" # pragma GCC diagnostic ignored "-Wunused-parameter" # pragma GCC diagnostic ignored "-Wunused-variable" # pragma GCC diagnostic ignored "-<API key>" #elif defined __GNUC__ # pragma GCC diagnostic ignored "-Wignored-qualifiers" # pragma GCC diagnostic ignored "-Wunused-parameter" #endif // __GNUC__ #include "xt/c++11.h" #endif // <API key>
<?php namespace OpenEcoles\OpenAnnoncesBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class <API key> extends WebTestCase { }
export default { name: '<API key>', functional: true, render (h, ctx) { const data = ctx.data, cls = data.staticClass, slots = ctx.slots() let child = [h('div', {staticClass: 'col'}), slots.default] data.staticClass = `q-stepper-nav order-last row no-wrap items-center${cls ? ` ${cls}` : ''}` if (slots.left) { child.unshift(slots.left) } return h('div', data, child) } }
<?php $EM_CONF[$_EXTKEY] = [ 'title' => 'Bootstrap Package', 'description' => 'Bootstrap Package delivers a full configured frontend theme for TYPO3, based on the Bootstrap CSS Framework.', 'category' => 'templates', 'constraints' => [ 'depends' => [ 'typo3' => '9.5.0-10.0.99', 'rte_ckeditor' => '9.5.0-10.0.99' ], 'conflicts' => [ 'css_styled_content' => '*', '<API key>' => '*', 'themes' => '*', 'fluidpages' => '*', 'dyncss' => '*', ], ], 'autoload' => [ 'psr-4' => [ 'BK2K\\BootstrapPackage\\' => 'Classes' ], ], 'state' => 'stable', 'uploadfolder' => 0, 'createDirs' => '', 'clearCacheOnLoad' => 1, 'author' => 'Benjamin Kott', 'author_email' => 'info@bk2k.info', 'author_company' => 'private', 'version' => '10.0.0', ];
package io.github.nucleuspowered.nucleus.core.scaffold.command.modifier; public final class CommandModifiers { private CommandModifiers() {} public static final String HAS_COOLDOWN = "nucleus:has_cooldown"; public static final String HAS_WARMUP = "nucleus:has_warmup"; public static final String REQUIRE_ECONOMY = "nucleus:requires_economy"; public static final String HAS_COST = "nucleus:has_cost"; }
using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Linq.Expressions; using System.Reflection; using NHibernate.Hql.Ast; using NHibernate.Linq; using NHibernate.Linq.Functions; using NHibernate.Linq.Visitors; using NodaTime; namespace Dematt.Airy.Nhibernate.NodaTime.Helpers { <summary> Class that extends the NHiberate Linq Provider to allow the ZonedDateTime.ToDateTimeOffset() method to be used in Linq queries. </summary> <remarks>Use the <see cref="<API key>"/> class to register this generator with Nhibernate.</remarks> [SuppressMessage("ReSharper", "<API key>")] public class <API key> : <API key> { <summary> Gets the methods that are supported by this Linq extension. </summary> private static readonly HashSet<MethodInfo> ActingMethods = new HashSet<MethodInfo> { // The method calls are used only to get info about the signature, any parameters are just ignored. ReflectionHelper.GetMethodDefinition<ZonedDateTime>(x => x.ToDateTimeOffset()), // Not sure how to add CompareTo (> , =>, < and <=) to be supported methods. // From the NHibernate source of the CompareGenerator class the below should work but it does not, // possible something to do with the way ZonedDateTime implements CompareTo? //ReflectionHelper.GetMethodDefinition<ZonedDateTime>(x => x.CompareTo(x)) }; <summary> Constructor sets the supported properties. </summary> public <API key>() { SupportedMethods = ActingMethods.ToArray(); //SupportedMethods = typeof(ZonedDateTime).GetMethods().Where(m => m.Name == "CompareTo").ToArray(); //SupportedMethods = typeof(ZonedDateTime).GetMethods().Where(m => m.Name.Contains("Than")).ToArray(); } <summary> Overrides the BuildHql method to add an expression that supports Linq querying using the supported methods. </summary> public override HqlTreeNode BuildHql(MethodInfo method, Expression targetObject, ReadOnlyCollection<Expression> arguments, HqlTreeBuilder treeBuilder, <API key> visitor) { var source = visitor.Visit(targetObject).AsExpression(); var property = treeBuilder.Ident("DateTimeOffset"); return treeBuilder.Dot(source, property); } } }
<div> <h2>Report failure</h2> <div> <label for="<API key>">Email To:</label> <select name="reportFailureEmail" id="<API key>" ng-model="reportFailureEmail" ng-options="staged.userName for staged in stagedList" ng-change="<API key>(reportFailureEmail)"> <option value="">-- Not chosen --</option> </select> </div> </div>