text
stringlengths 2
100k
| meta
dict |
---|---|
# This file is distributed under the same license as the Django package.
#
# Translators:
# Jannis Leidel <[email protected]>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-10-15 10:57+0200\n"
"PO-Revision-Date: 2012-02-14 13:49+0000\n"
"Last-Translator: Jannis Leidel <[email protected]>\n"
"Language-Team: Hebrew (http://www.transifex.com/projects/p/django/language/"
"he/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: he\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: models.py:39
msgid "domain name"
msgstr "שם מתחם"
#: models.py:40
msgid "display name"
msgstr "שם לתצוגה"
#: models.py:45
msgid "site"
msgstr "אתר"
#: models.py:46
msgid "sites"
msgstr "אתרים"
| {
"pile_set_name": "Github"
} |
#include <signal.h>
#include <stdlib.h>
#include "ethos.hpp"
#include "bootstrap.cpp"
#include "resource/resource.cpp"
#include "../ananke/ananke.hpp"
#include <stdio.h>
Program* program = nullptr;
DSP dspaudio;
struct color {
short r, g, b;
} white, black, red, green, yellow;
Emulator::Interface& system() {
if(program->active == nullptr) throw;
return *program->active;
}
string Program::path(string name) {
string path = {basepath, name};
if(file::exists(path) || directory::exists(path)) return path;
path = {userpath, name};
if(file::exists(path) || directory::exists(path)) return path;
path = {sharedpath, name};
if(file::exists(path) || directory::exists(path)) return path;
return {userpath, name};
}
void Program::init_curses() {
setlocale(LC_ALL, "");
//window = subwin(initscr(), 200, 200, 0, 0);
window= initscr();
start_color();
timeout(0);
noecho();
/*if (!has_colors() || ! can_change_color()) {
//TODO: Add descriptive error message, clean up
exit(EXIT_FAILURE);
}*/
color_content(COLOR_WHITE, &white.r, &white.g, &white.b);
color_content(COLOR_BLACK, &black.r, &black.g, &black.b);
color_content(COLOR_RED, &red.r, &red.g, &red.b);
color_content(COLOR_GREEN, &green.r, &green.g, &green.b);
color_content(COLOR_YELLOW, &yellow.r, &yellow.g, &yellow.b);
init_pair(1, COLOR_BLACK, COLOR_BLACK);
init_pair(2, COLOR_BLACK, COLOR_RED);
init_pair(3, COLOR_BLACK, COLOR_GREEN);
init_pair(4, COLOR_BLACK, COLOR_YELLOW);
init_pair(5, COLOR_RED, COLOR_BLACK);
init_pair(6, COLOR_RED, COLOR_RED);
init_pair(7, COLOR_RED, COLOR_GREEN);
init_pair(8, COLOR_RED, COLOR_YELLOW);
init_pair(9, COLOR_GREEN, COLOR_BLACK);
init_pair(10, COLOR_GREEN, COLOR_RED);
init_pair(11, COLOR_GREEN, COLOR_GREEN);
init_pair(12, COLOR_GREEN, COLOR_YELLOW);
init_pair(13, COLOR_YELLOW, COLOR_BLACK);
init_pair(14, COLOR_YELLOW, COLOR_RED);
init_pair(15, COLOR_YELLOW, COLOR_GREEN);
init_pair(16, COLOR_YELLOW, COLOR_YELLOW);
init_color(COLOR_WHITE, 0, 0, 0);
init_color(COLOR_BLACK, 0, 0, 0);
init_color(COLOR_RED, 333, 333, 333);
init_color(COLOR_GREEN, 667, 667, 667);
init_color(COLOR_YELLOW, 1000, 1000, 1000);
erase();
}
void Program::main() {
system().run();
}
Program::Program(int argc, char** argv) {
program = this;
basepath = dir(realpath(argv[0]));
userpath = {nall::configpath(), "termboy/"};
sharedpath = {nall::sharedpath(), "termboy/"};
directory::create(userpath);
bootstrap();
active = nullptr;
config = new ConfigurationSettings;
utility = new Utility;
audio.driver("ALSA");
if(audio.init() == false) {
audio.driver("None");
audio.init();
}
init_curses();
inputManager = new InputManager();
inputManager->setupKeyboard();
dspaudio.setPrecision(16);
dspaudio.setBalance(0.0);
dspaudio.setFrequency(96000);
utility->synchronizeRuby();
utility->updateShader();
if(argc >= 2)
utility->loadMedia(argv[1]);
//TODO: This is bad! Remove hardcoded string and use appropriate path
//TODO: periodically sync RAM in case of crash?
Ananke ananke;
ananke.sync("/home/dobyrch/ROMs/Game Boy/pokemon_blue.gb");
while(true) {
main();
}
utility->unload();
//config->save();
}
//TODO: Come up with a solution that is guaranteed to work when multiple threads are running
void sighandler(int sig) {
init_color(COLOR_WHITE, white.r, white.g, white.b);
init_color(COLOR_BLACK, black.r, black.g, black.b);
int ret1 = init_color(COLOR_RED, red.r, red.g, red.b);
init_color(COLOR_GREEN, green.r, green.g, green.b);
init_color(COLOR_YELLOW, yellow.r, yellow.g, yellow.b);
//FILE *fp;
//fp = fopen("/home/dobyrch/Documents/termboy/out.log", "w");
//fprintf(fp, "In handler\n");
//fprintf(fp, "Setting color: %d\n", ret1);
endwin();
//fprintf(fp, "Closed window\n");
init_color(COLOR_WHITE, white.r, white.g, white.b);
init_color(COLOR_BLACK, black.r, black.g, black.b);
int ret2 = init_color(COLOR_RED, red.r, red.g, red.b);
init_color(COLOR_GREEN, green.r, green.g, green.b);
init_color(COLOR_YELLOW, yellow.r, yellow.g, yellow.b);
//fprintf(fp, "Setting color: %d\n", ret2);
inputManager->restoreKeyboard();
//fprintf(fp, "Restored keyboard\n");
utility->unload();
//fprintf(fp, "Unloaded game\n");
//fprintf(fp, "Caught signal: %d\n", sig);
//fprintf(fp, "Printed signal\n");
//fclose(fp);
exit(0);
}
int main(int argc, char** argv) {
signal(SIGINT, sighandler);
signal(SIGQUIT, sighandler);
signal(SIGSEGV, sighandler);
audio.clear();
new Program(argc, argv);
delete program;
return 0;
}
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
import sys
import os
import re
import anchore.anchore_utils
# parse the commandline and set up local config
try:
config = anchore.anchore_utils.init_query_cmdline(sys.argv, "params: <package> <package> ...\nhelp: search input image(s) for specified <package> installations")
except Exception as err:
print str(err)
sys.exit(1)
if not config:
sys.exit(0)
# at this point, the 'config' dict contains (minimally)
# config['name'] : name for this module
# config['imgid'] : image ID of image to be queried
# config['dirs']['datadir'] : top level directory of the anchore image data store
# config['dirs']['imgdir'] : location of the files that contain useful image information
# config['dirs']['analyzerdir'] : location of the files that contain results of the image analysis
# config['dirs']['comparedir'] : location of the files that contain comparison results between image and other images in its familytree
# config['dirs']['gatesdir'] : location of the results of the latest anchore gate evaulation
# config['params'] : any extra parameters passed in from the CLI to this module
# set up the output row array
outlist = list()
# the first value in the output array must contain column header names (no whitespace!)
outlist.append(["FullImageID", "FileName", "IsFound"])
# perform your check
# read the file that container a list of all files in the container that is a result of previous anchore analysis
allfiles = '/'.join([config['dirs']['analyzerdir'], 'file_list', 'files.all'])
# use helpful anchore util to read the contents of analyzer file into a dict
files = anchore.anchore_utils.read_kvfile_todict(allfiles)
# perform your check
if "./etc/passwd" in files.keys():
outlist.append([config['imgid'], "/etc/passwd", "Yes"])
else:
outlist.append([config['imgid'], "/etc/passwd", "No"])
# use helpful anchore util to write the resulting list to the correct location
anchore.anchore_utils.write_kvfile_fromlist(config['output'], outlist)
# all done!
sys.exit(0)
# To try this query:
# 1) place this example script in the queries directory (cp query-example.py $ANCHOREROOT/lib/anchore/queries/query-example)
# 2) ensure that the script is executable (chmod +x $ANCHOREROOT/lib/anchore/queries/query-example)
# 3) run the anchore query against an analyzed container (anchore explore --image centos query query-example all)
| {
"pile_set_name": "Github"
} |
description: STM32 F1 flash controller
compatible: "st,stm32f1-flash-controller"
include: flash-controller.yaml
| {
"pile_set_name": "Github"
} |
JASC-PAL
0100
16
24 41 82
255 255 255
222 230 238
189 205 230
156 180 222
131 131 139
98 98 123
65 74 106
41 49 90
115 189 246
98 172 238
238 230 164
222 205 131
213 180 106
205 156 82
115 197 164
| {
"pile_set_name": "Github"
} |
# mach: crisv3 crisv8 crisv10 crisv32
# output: ffffff42\n94\nffff4321\n9234\n76543210\n76540000\n
; Move constant byte, word, dword to register. Check that no extension is
; performed, that only part of the register is set.
.include "testutils.inc"
startnostack
moveq -1,r3
move.b 0x42,r3
test_move_cc 0 0 0 0
checkr3 ffffff42
moveq 0,r3
move.b 0x94,r3
test_move_cc 1 0 0 0
checkr3 94
moveq -1,r3
move.w 0x4321,r3
test_move_cc 0 0 0 0
checkr3 ffff4321
moveq 0,r3
move.w 0x9234,r3
test_move_cc 1 0 0 0
checkr3 9234
move.d 0x76543210,r3
test_move_cc 0 0 0 0
checkr3 76543210
move.w 0,r3
test_move_cc 0 1 0 0
checkr3 76540000
quit
| {
"pile_set_name": "Github"
} |
/*
* Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2007-2008 Red Hat, Inc.
* (C) Copyright IBM Corporation 2004
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDERS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
* USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/**
* \file dri_interface.h
*
* This file contains all the types and functions that define the interface
* between a DRI driver and driver loader. Currently, the most common driver
* loader is the XFree86 libGL.so. However, other loaders do exist, and in
* the future the server-side libglx.a will also be a loader.
*
* \author Kevin E. Martin <[email protected]>
* \author Ian Romanick <[email protected]>
* \author Kristian Høgsberg <[email protected]>
*/
#ifndef DRI_INTERFACE_H
#define DRI_INTERFACE_H
/* For archs with no drm.h */
#if defined(__APPLE__) || defined(__CYGWIN__) || defined(__GNU__)
#ifndef __NOT_HAVE_DRM_H
#define __NOT_HAVE_DRM_H
#endif
#endif
#ifndef __NOT_HAVE_DRM_H
#include <drm.h>
#else
typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t;
typedef struct drm_clip_rect drm_clip_rect_t;
#endif
/**
* \name DRI interface structures
*
* The following structures define the interface between the GLX client
* side library and the DRI (direct rendering infrastructure).
*/
/*@{*/
typedef struct __DRIdisplayRec __DRIdisplay;
typedef struct __DRIscreenRec __DRIscreen;
typedef struct __DRIcontextRec __DRIcontext;
typedef struct __DRIdrawableRec __DRIdrawable;
typedef struct __DRIconfigRec __DRIconfig;
typedef struct __DRIframebufferRec __DRIframebuffer;
typedef struct __DRIversionRec __DRIversion;
typedef struct __DRIcoreExtensionRec __DRIcoreExtension;
typedef struct __DRIextensionRec __DRIextension;
typedef struct __DRIcopySubBufferExtensionRec __DRIcopySubBufferExtension;
typedef struct __DRIswapControlExtensionRec __DRIswapControlExtension;
typedef struct __DRIframeTrackingExtensionRec __DRIframeTrackingExtension;
typedef struct __DRImediaStreamCounterExtensionRec __DRImediaStreamCounterExtension;
typedef struct __DRItexOffsetExtensionRec __DRItexOffsetExtension;
typedef struct __DRItexBufferExtensionRec __DRItexBufferExtension;
typedef struct __DRIlegacyExtensionRec __DRIlegacyExtension;
typedef struct __DRIswrastExtensionRec __DRIswrastExtension;
typedef struct __DRIbufferRec __DRIbuffer;
typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
/*@}*/
/**
* Extension struct. Drivers 'inherit' from this struct by embedding
* it as the first element in the extension struct.
*
* We never break API in for a DRI extension. If we need to change
* the way things work in a non-backwards compatible manner, we
* introduce a new extension. During a transition period, we can
* leave both the old and the new extension in the driver, which
* allows us to move to the new interface without having to update the
* loader(s) in lock step.
*
* However, we can add entry points to an extension over time as long
* as we don't break the old ones. As we add entry points to an
* extension, we increase the version number. The corresponding
* #define can be used to guard code that accesses the new entry
* points at compile time and the version field in the extension
* struct can be used at run-time to determine how to use the
* extension.
*/
struct __DRIextensionRec {
const char *name;
int version;
};
/**
* The first set of extension are the screen extensions, returned by
* __DRIcore::getExtensions(). This entry point will return a list of
* extensions and the loader can use the ones it knows about by
* casting them to more specific extensions and advertising any GLX
* extensions the DRI extensions enables.
*/
/**
* Used by drivers to indicate support for setting the read drawable.
*/
#define __DRI_READ_DRAWABLE "DRI_ReadDrawable"
#define __DRI_READ_DRAWABLE_VERSION 1
/**
* Used by drivers that implement the GLX_MESA_copy_sub_buffer extension.
*/
#define __DRI_COPY_SUB_BUFFER "DRI_CopySubBuffer"
#define __DRI_COPY_SUB_BUFFER_VERSION 1
struct __DRIcopySubBufferExtensionRec {
__DRIextension base;
void (*copySubBuffer)(__DRIdrawable *drawable, int x, int y, int w, int h);
};
/**
* Used by drivers that implement the GLX_SGI_swap_control or
* GLX_MESA_swap_control extension.
*/
#define __DRI_SWAP_CONTROL "DRI_SwapControl"
#define __DRI_SWAP_CONTROL_VERSION 1
struct __DRIswapControlExtensionRec {
__DRIextension base;
void (*setSwapInterval)(__DRIdrawable *drawable, unsigned int inteval);
unsigned int (*getSwapInterval)(__DRIdrawable *drawable);
};
/**
* Used by drivers that implement the GLX_MESA_swap_frame_usage extension.
*/
#define __DRI_FRAME_TRACKING "DRI_FrameTracking"
#define __DRI_FRAME_TRACKING_VERSION 1
struct __DRIframeTrackingExtensionRec {
__DRIextension base;
/**
* Enable or disable frame usage tracking.
*
* \since Internal API version 20030317.
*/
int (*frameTracking)(__DRIdrawable *drawable, GLboolean enable);
/**
* Retrieve frame usage information.
*
* \since Internal API version 20030317.
*/
int (*queryFrameTracking)(__DRIdrawable *drawable,
int64_t * sbc, int64_t * missedFrames,
float * lastMissedUsage, float * usage);
};
/**
* Used by drivers that implement the GLX_SGI_video_sync extension.
*/
#define __DRI_MEDIA_STREAM_COUNTER "DRI_MediaStreamCounter"
#define __DRI_MEDIA_STREAM_COUNTER_VERSION 1
struct __DRImediaStreamCounterExtensionRec {
__DRIextension base;
/**
* Wait for the MSC to equal target_msc, or, if that has already passed,
* the next time (MSC % divisor) is equal to remainder. If divisor is
* zero, the function will return as soon as MSC is greater than or equal
* to target_msc.
*/
int (*waitForMSC)(__DRIdrawable *drawable,
int64_t target_msc, int64_t divisor, int64_t remainder,
int64_t * msc, int64_t * sbc);
/**
* Get the number of vertical refreshes since some point in time before
* this function was first called (i.e., system start up).
*/
int (*getDrawableMSC)(__DRIscreen *screen, __DRIdrawable *drawable,
int64_t *msc);
};
#define __DRI_TEX_OFFSET "DRI_TexOffset"
#define __DRI_TEX_OFFSET_VERSION 1
struct __DRItexOffsetExtensionRec {
__DRIextension base;
/**
* Method to override base texture image with a driver specific 'offset'.
* The depth passed in allows e.g. to ignore the alpha channel of texture
* images where the non-alpha components don't occupy a whole texel.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexOffset)(__DRIcontext *pDRICtx, GLint texname,
unsigned long long offset, GLint depth, GLuint pitch);
};
/* Valid values for format in the setTexBuffer2 function below. These
* values match the GLX tokens for compatibility reasons, but we
* define them here since the DRI interface can't depend on GLX. */
#define __DRI_TEXTURE_FORMAT_NONE 0x20D8
#define __DRI_TEXTURE_FORMAT_RGB 0x20D9
#define __DRI_TEXTURE_FORMAT_RGBA 0x20DA
#define __DRI_TEX_BUFFER "DRI_TexBuffer"
#define __DRI_TEX_BUFFER_VERSION 2
struct __DRItexBufferExtensionRec {
__DRIextension base;
/**
* Method to override base texture image with the contents of a
* __DRIdrawable.
*
* For GLX_EXT_texture_from_pixmap with AIGLX. Deprecated in favor of
* setTexBuffer2 in version 2 of this interface
*/
void (*setTexBuffer)(__DRIcontext *pDRICtx,
GLint target,
__DRIdrawable *pDraw);
/**
* Method to override base texture image with the contents of a
* __DRIdrawable, including the required texture format attribute.
*
* For GLX_EXT_texture_from_pixmap with AIGLX.
*/
void (*setTexBuffer2)(__DRIcontext *pDRICtx,
GLint target,
GLint format,
__DRIdrawable *pDraw);
};
/**
* Used by drivers that implement DRI2
*/
#define __DRI2_FLUSH "DRI2_Flush"
#define __DRI2_FLUSH_VERSION 3
struct __DRI2flushExtensionRec {
__DRIextension base;
void (*flush)(__DRIdrawable *drawable);
/**
* Ask the driver to call getBuffers/getBuffersWithFormat before
* it starts rendering again.
*
* \param drawable the drawable to invalidate
*
* \since 3
*/
void (*invalidate)(__DRIdrawable *drawable);
};
/**
* XML document describing the configuration options supported by the
* driver.
*/
extern const char __driConfigOptions[];
/*@}*/
/**
* The following extensions describe loader features that the DRI
* driver can make use of. Some of these are mandatory, such as the
* getDrawableInfo extension for DRI and the DRI Loader extensions for
* DRI2, while others are optional, and if present allow the driver to
* expose certain features. The loader pass in a NULL terminated
* array of these extensions to the driver in the createNewScreen
* constructor.
*/
typedef struct __DRIgetDrawableInfoExtensionRec __DRIgetDrawableInfoExtension;
typedef struct __DRIsystemTimeExtensionRec __DRIsystemTimeExtension;
typedef struct __DRIdamageExtensionRec __DRIdamageExtension;
typedef struct __DRIloaderExtensionRec __DRIloaderExtension;
typedef struct __DRIswrastLoaderExtensionRec __DRIswrastLoaderExtension;
/**
* Callback to getDrawableInfo protocol
*/
#define __DRI_GET_DRAWABLE_INFO "DRI_GetDrawableInfo"
#define __DRI_GET_DRAWABLE_INFO_VERSION 1
struct __DRIgetDrawableInfoExtensionRec {
__DRIextension base;
/**
* This function is used to get information about the position, size, and
* clip rects of a drawable.
*/
GLboolean (* getDrawableInfo) ( __DRIdrawable *drawable,
unsigned int * index, unsigned int * stamp,
int * x, int * y, int * width, int * height,
int * numClipRects, drm_clip_rect_t ** pClipRects,
int * backX, int * backY,
int * numBackClipRects, drm_clip_rect_t ** pBackClipRects,
void *loaderPrivate);
};
/**
* Callback to get system time for media stream counter extensions.
*/
#define __DRI_SYSTEM_TIME "DRI_SystemTime"
#define __DRI_SYSTEM_TIME_VERSION 1
struct __DRIsystemTimeExtensionRec {
__DRIextension base;
/**
* Get the 64-bit unadjusted system time (UST).
*/
int (*getUST)(int64_t * ust);
/**
* Get the media stream counter (MSC) rate.
*
* Matching the definition in GLX_OML_sync_control, this function returns
* the rate of the "media stream counter". In practical terms, this is
* the frame refresh rate of the display.
*/
GLboolean (*getMSCRate)(__DRIdrawable *draw,
int32_t * numerator, int32_t * denominator,
void *loaderPrivate);
};
/**
* Damage reporting
*/
#define __DRI_DAMAGE "DRI_Damage"
#define __DRI_DAMAGE_VERSION 1
struct __DRIdamageExtensionRec {
__DRIextension base;
/**
* Reports areas of the given drawable which have been modified by the
* driver.
*
* \param drawable which the drawing was done to.
* \param rects rectangles affected, with the drawable origin as the
* origin.
* \param x X offset of the drawable within the screen (used in the
* front_buffer case)
* \param y Y offset of the drawable within the screen.
* \param front_buffer boolean flag for whether the drawing to the
* drawable was actually done directly to the front buffer (instead
* of backing storage, for example)
* \param loaderPrivate the data passed in at createNewDrawable time
*/
void (*reportDamage)(__DRIdrawable *draw,
int x, int y,
drm_clip_rect_t *rects, int num_rects,
GLboolean front_buffer,
void *loaderPrivate);
};
#define __DRI_SWRAST_IMAGE_OP_DRAW 1
#define __DRI_SWRAST_IMAGE_OP_CLEAR 2
#define __DRI_SWRAST_IMAGE_OP_SWAP 3
/**
* SWRast Loader extension.
*/
#define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
#define __DRI_SWRAST_LOADER_VERSION 1
struct __DRIswrastLoaderExtensionRec {
__DRIextension base;
/*
* Drawable position and size
*/
void (*getDrawableInfo)(__DRIdrawable *drawable,
int *x, int *y, int *width, int *height,
void *loaderPrivate);
/**
* Put image to drawable
*/
void (*putImage)(__DRIdrawable *drawable, int op,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
/**
* Get image from readable
*/
void (*getImage)(__DRIdrawable *readable,
int x, int y, int width, int height,
char *data, void *loaderPrivate);
};
/**
* Invalidate loader extension. The presence of this extension
* indicates to the DRI driver that the loader will call invalidate in
* the __DRI2_FLUSH extension, whenever the needs to query for new
* buffers. This means that the DRI driver can drop the polling in
* glViewport().
*
* The extension doesn't provide any functionality, it's only use to
* indicate to the driver that it can use the new semantics. A DRI
* driver can use this to switch between the different semantics or
* just refuse to initialize if this extension isn't present.
*/
#define __DRI_USE_INVALIDATE "DRI_UseInvalidate"
#define __DRI_USE_INVALIDATE_VERSION 1
typedef struct __DRIuseInvalidateExtensionRec __DRIuseInvalidateExtension;
struct __DRIuseInvalidateExtensionRec {
__DRIextension base;
};
/**
* The remaining extensions describe driver extensions, immediately
* available interfaces provided by the driver. To start using the
* driver, dlsym() for the __DRI_DRIVER_EXTENSIONS symbol and look for
* the extension you need in the array.
*/
#define __DRI_DRIVER_EXTENSIONS "__driDriverExtensions"
/**
* Tokens for __DRIconfig attribs. A number of attributes defined by
* GLX or EGL standards are not in the table, as they must be provided
* by the loader. For example, FBConfig ID or visual ID, drawable type.
*/
#define __DRI_ATTRIB_BUFFER_SIZE 1
#define __DRI_ATTRIB_LEVEL 2
#define __DRI_ATTRIB_RED_SIZE 3
#define __DRI_ATTRIB_GREEN_SIZE 4
#define __DRI_ATTRIB_BLUE_SIZE 5
#define __DRI_ATTRIB_LUMINANCE_SIZE 6
#define __DRI_ATTRIB_ALPHA_SIZE 7
#define __DRI_ATTRIB_ALPHA_MASK_SIZE 8
#define __DRI_ATTRIB_DEPTH_SIZE 9
#define __DRI_ATTRIB_STENCIL_SIZE 10
#define __DRI_ATTRIB_ACCUM_RED_SIZE 11
#define __DRI_ATTRIB_ACCUM_GREEN_SIZE 12
#define __DRI_ATTRIB_ACCUM_BLUE_SIZE 13
#define __DRI_ATTRIB_ACCUM_ALPHA_SIZE 14
#define __DRI_ATTRIB_SAMPLE_BUFFERS 15
#define __DRI_ATTRIB_SAMPLES 16
#define __DRI_ATTRIB_RENDER_TYPE 17
#define __DRI_ATTRIB_CONFIG_CAVEAT 18
#define __DRI_ATTRIB_CONFORMANT 19
#define __DRI_ATTRIB_DOUBLE_BUFFER 20
#define __DRI_ATTRIB_STEREO 21
#define __DRI_ATTRIB_AUX_BUFFERS 22
#define __DRI_ATTRIB_TRANSPARENT_TYPE 23
#define __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE 24
#define __DRI_ATTRIB_TRANSPARENT_RED_VALUE 25
#define __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE 26
#define __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE 27
#define __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE 28
#define __DRI_ATTRIB_FLOAT_MODE 29
#define __DRI_ATTRIB_RED_MASK 30
#define __DRI_ATTRIB_GREEN_MASK 31
#define __DRI_ATTRIB_BLUE_MASK 32
#define __DRI_ATTRIB_ALPHA_MASK 33
#define __DRI_ATTRIB_MAX_PBUFFER_WIDTH 34
#define __DRI_ATTRIB_MAX_PBUFFER_HEIGHT 35
#define __DRI_ATTRIB_MAX_PBUFFER_PIXELS 36
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH 37
#define __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT 38
#define __DRI_ATTRIB_VISUAL_SELECT_GROUP 39
#define __DRI_ATTRIB_SWAP_METHOD 40
#define __DRI_ATTRIB_MAX_SWAP_INTERVAL 41
#define __DRI_ATTRIB_MIN_SWAP_INTERVAL 42
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGB 43
#define __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA 44
#define __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE 45
#define __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS 46
#define __DRI_ATTRIB_YINVERTED 47
/* __DRI_ATTRIB_RENDER_TYPE */
#define __DRI_ATTRIB_RGBA_BIT 0x01
#define __DRI_ATTRIB_COLOR_INDEX_BIT 0x02
#define __DRI_ATTRIB_LUMINANCE_BIT 0x04
/* __DRI_ATTRIB_CONFIG_CAVEAT */
#define __DRI_ATTRIB_SLOW_BIT 0x01
#define __DRI_ATTRIB_NON_CONFORMANT_CONFIG 0x02
/* __DRI_ATTRIB_TRANSPARENT_TYPE */
#define __DRI_ATTRIB_TRANSPARENT_RGB 0x00
#define __DRI_ATTRIB_TRANSPARENT_INDEX 0x01
/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
#define __DRI_ATTRIB_TEXTURE_1D_BIT 0x01
#define __DRI_ATTRIB_TEXTURE_2D_BIT 0x02
#define __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT 0x04
/**
* This extension defines the core DRI functionality.
*/
#define __DRI_CORE "DRI_Core"
#define __DRI_CORE_VERSION 1
struct __DRIcoreExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen, int fd,
unsigned int sarea_handle,
const __DRIextension **extensions,
const __DRIconfig ***driverConfigs,
void *loaderPrivate);
void (*destroyScreen)(__DRIscreen *screen);
const __DRIextension **(*getExtensions)(__DRIscreen *screen);
int (*getConfigAttrib)(const __DRIconfig *config,
unsigned int attrib,
unsigned int *value);
int (*indexConfigAttrib)(const __DRIconfig *config, int index,
unsigned int *attrib, unsigned int *value);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
unsigned int drawable_id,
unsigned int head,
void *loaderPrivate);
void (*destroyDrawable)(__DRIdrawable *drawable);
void (*swapBuffers)(__DRIdrawable *drawable);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
int (*copyContext)(__DRIcontext *dest,
__DRIcontext *src,
unsigned long mask);
void (*destroyContext)(__DRIcontext *context);
int (*bindContext)(__DRIcontext *ctx,
__DRIdrawable *pdraw,
__DRIdrawable *pread);
int (*unbindContext)(__DRIcontext *ctx);
};
/**
* Stored version of some component (i.e., server-side DRI module, kernel-side
* DRM, etc.).
*
* \todo
* There are several data structures that explicitly store a major version,
* minor version, and patch level. These structures should be modified to
* have a \c __DRIversionRec instead.
*/
struct __DRIversionRec {
int major; /**< Major version number. */
int minor; /**< Minor version number. */
int patch; /**< Patch-level. */
};
/**
* Framebuffer information record. Used by libGL to communicate information
* about the framebuffer to the driver's \c __driCreateNewScreen function.
*
* In XFree86, most of this information is derrived from data returned by
* calling \c XF86DRIGetDeviceInfo.
*
* \sa XF86DRIGetDeviceInfo __DRIdisplayRec::createNewScreen
* __driUtilCreateNewScreen CallCreateNewScreen
*
* \bug This structure could be better named.
*/
struct __DRIframebufferRec {
unsigned char *base; /**< Framebuffer base address in the CPU's
* address space. This value is calculated by
* calling \c drmMap on the framebuffer handle
* returned by \c XF86DRIGetDeviceInfo (or a
* similar function).
*/
int size; /**< Framebuffer size, in bytes. */
int stride; /**< Number of bytes from one line to the next. */
int width; /**< Pixel width of the framebuffer. */
int height; /**< Pixel height of the framebuffer. */
int dev_priv_size; /**< Size of the driver's dev-priv structure. */
void *dev_priv; /**< Pointer to the driver's dev-priv structure. */
};
/**
* This extension provides alternative screen, drawable and context
* constructors for legacy DRI functionality. This is used in
* conjunction with the core extension.
*/
#define __DRI_LEGACY "DRI_Legacy"
#define __DRI_LEGACY_VERSION 1
struct __DRIlegacyExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen,
const __DRIversion *ddx_version,
const __DRIversion *dri_version,
const __DRIversion *drm_version,
const __DRIframebuffer *frame_buffer,
void *pSAREA, int fd,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
drm_drawable_t hwDrawable,
int renderType, const int *attrs,
void *loaderPrivate);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
int render_type,
__DRIcontext *shared,
drm_context_t hwContext,
void *loaderPrivate);
};
/**
* This extension provides alternative screen, drawable and context
* constructors for swrast DRI functionality. This is used in
* conjunction with the core extension.
*/
#define __DRI_SWRAST "DRI_SWRast"
#define __DRI_SWRAST_VERSION 1
struct __DRIswrastExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
};
/**
* DRI2 Loader extension.
*/
#define __DRI_BUFFER_FRONT_LEFT 0
#define __DRI_BUFFER_BACK_LEFT 1
#define __DRI_BUFFER_FRONT_RIGHT 2
#define __DRI_BUFFER_BACK_RIGHT 3
#define __DRI_BUFFER_DEPTH 4
#define __DRI_BUFFER_STENCIL 5
#define __DRI_BUFFER_ACCUM 6
#define __DRI_BUFFER_FAKE_FRONT_LEFT 7
#define __DRI_BUFFER_FAKE_FRONT_RIGHT 8
#define __DRI_BUFFER_DEPTH_STENCIL 9 /**< Only available with DRI2 1.1 */
struct __DRIbufferRec {
unsigned int attachment;
unsigned int name;
unsigned int pitch;
unsigned int cpp;
unsigned int flags;
};
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
#define __DRI_DRI2_LOADER_VERSION 3
struct __DRIdri2LoaderExtensionRec {
__DRIextension base;
__DRIbuffer *(*getBuffers)(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
/**
* Flush pending front-buffer rendering
*
* Any rendering that has been performed to the
* \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
* \c __DRI_BUFFER_FRONT_LEFT.
*
* \param driDrawable Drawable whose front-buffer is to be flushed
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable
*/
void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
/**
* Get list of buffers from the server
*
* Gets a list of buffer for the specified set of attachments. Unlike
* \c ::getBuffers, this function takes a list of attachments paired with
* opaque \c unsigned \c int value describing the format of the buffer.
* It is the responsibility of the caller to know what the service that
* allocates the buffers will expect to receive for the format.
*
* \param driDrawable Drawable whose buffers are being queried.
* \param width Output where the width of the buffers is stored.
* \param height Output where the height of the buffers is stored.
* \param attachments List of pairs of attachment ID and opaque format
* requested for the drawable.
* \param count Number of attachment / format pairs stored in
* \c attachments.
* \param loaderPrivate Loader's private data that was previously passed
* into __DRIdri2ExtensionRec::createNewDrawable.
*/
__DRIbuffer *(*getBuffersWithFormat)(__DRIdrawable *driDrawable,
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
};
/**
* This extension provides alternative screen, drawable and context
* constructors for DRI2.
*/
#define __DRI_DRI2 "DRI_DRI2"
#define __DRI_DRI2_VERSION 2
#define __DRI_API_OPENGL 0
#define __DRI_API_GLES 1
#define __DRI_API_GLES2 2
struct __DRIdri2ExtensionRec {
__DRIextension base;
__DRIscreen *(*createNewScreen)(int screen, int fd,
const __DRIextension **extensions,
const __DRIconfig ***driver_configs,
void *loaderPrivate);
__DRIdrawable *(*createNewDrawable)(__DRIscreen *screen,
const __DRIconfig *config,
void *loaderPrivate);
__DRIcontext *(*createNewContext)(__DRIscreen *screen,
const __DRIconfig *config,
__DRIcontext *shared,
void *loaderPrivate);
/* Since version 2 */
unsigned int (*getAPIMask)(__DRIscreen *screen);
__DRIcontext *(*createNewContextForAPI)(__DRIscreen *screen,
int api,
const __DRIconfig *config,
__DRIcontext *shared,
void *data);
};
/**
* This extension provides functionality to enable various EGLImage
* extensions.
*/
#define __DRI_IMAGE "DRI_IMAGE"
#define __DRI_IMAGE_VERSION 1
/**
* These formats correspond to the similarly named MESA_FORMAT_*
* tokens, except in the native endian of the CPU. For example, on
* little endian __DRI_IMAGE_FORMAT_XRGB8888 corresponds to
* MESA_FORMAT_XRGB8888, but MESA_FORMAT_XRGB8888_REV on big endian.
*/
#define __DRI_IMAGE_FORMAT_RGB565 0x1001
#define __DRI_IMAGE_FORMAT_XRGB8888 0x1002
#define __DRI_IMAGE_FORMAT_ARGB8888 0x1003
#define __DRI_IMAGE_USE_SHARE 0x0001
#define __DRI_IMAGE_USE_SCANOUT 0x0002
/**
* queryImage attributes
*/
#define __DRI_IMAGE_ATTRIB_STRIDE 0x2000
#define __DRI_IMAGE_ATTRIB_HANDLE 0x2001
#define __DRI_IMAGE_ATTRIB_NAME 0x2002
typedef struct __DRIimageRec __DRIimage;
typedef struct __DRIimageExtensionRec __DRIimageExtension;
struct __DRIimageExtensionRec {
__DRIextension base;
__DRIimage *(*createImageFromName)(__DRIscreen *screen,
int width, int height, int format,
int name, int pitch,
void *loaderPrivate);
__DRIimage *(*createImageFromRenderbuffer)(__DRIcontext *context,
int renderbuffer,
void *loaderPrivate);
void (*destroyImage)(__DRIimage *image);
__DRIimage *(*createImage)(__DRIscreen *screen,
int width, int height, int format,
unsigned int use,
void *loaderPrivate);
GLboolean (*queryImage)(__DRIimage *image, int attrib, int *value);
};
/**
* This extension must be implemented by the loader and passed to the
* driver at screen creation time. The EGLImage entry points in the
* various client APIs take opaque EGLImage handles and use this
* extension to map them to a __DRIimage. At version 1, this
* extensions allows mapping EGLImage pointers to __DRIimage pointers,
* but future versions could support other EGLImage-like, opaque types
* with new lookup functions.
*/
#define __DRI_IMAGE_LOOKUP "DRI_IMAGE_LOOKUP"
#define __DRI_IMAGE_LOOKUP_VERSION 1
typedef struct __DRIimageLookupExtensionRec __DRIimageLookupExtension;
struct __DRIimageLookupExtensionRec {
__DRIextension base;
__DRIimage *(*lookupEGLImage)(__DRIscreen *screen, void *image,
void *loaderPrivate);
};
/**
* This extension allows for common DRI2 options
*/
#define __DRI2_CONFIG_QUERY "DRI_CONFIG_QUERY"
#define __DRI2_CONFIG_QUERY_VERSION 1
typedef struct __DRI2configQueryExtensionRec __DRI2configQueryExtension;
struct __DRI2configQueryExtensionRec {
__DRIextension base;
int (*configQueryb)(__DRIscreen *screen, const char *var, GLboolean *val);
int (*configQueryi)(__DRIscreen *screen, const char *var, GLint *val);
int (*configQueryf)(__DRIscreen *screen, const char *var, GLfloat *val);
};
#endif
| {
"pile_set_name": "Github"
} |
require 'starscope/version'
require 'starscope/db'
| {
"pile_set_name": "Github"
} |
/*
* linux/drivers/mmc/host/sdhci.h - Secure Digital Host Controller Interface driver
*
* Header file for Host Controller registers and I/O accessors.
*
* Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*/
#ifndef __SDHCI_HW_H
#define __SDHCI_HW_H
#include <linux/scatterlist.h>
#include <linux/compiler.h>
#include <linux/types.h>
#include <linux/io.h>
#include <linux/mmc/sdhci.h>
/*
* Controller registers
*/
#define SDHCI_DMA_ADDRESS 0x00
#define SDHCI_ARGUMENT2 SDHCI_DMA_ADDRESS
#define SDHCI_BLOCK_SIZE 0x04
#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))
#define SDHCI_BLOCK_COUNT 0x06
#define SDHCI_ARGUMENT 0x08
#define SDHCI_TRANSFER_MODE 0x0C
#define SDHCI_TRNS_DMA 0x01
#define SDHCI_TRNS_BLK_CNT_EN 0x02
#define SDHCI_TRNS_AUTO_CMD12 0x04
#define SDHCI_TRNS_AUTO_CMD23 0x08
#define SDHCI_TRNS_READ 0x10
#define SDHCI_TRNS_MULTI 0x20
#define SDHCI_COMMAND 0x0E
#define SDHCI_CMD_RESP_MASK 0x03
#define SDHCI_CMD_CRC 0x08
#define SDHCI_CMD_INDEX 0x10
#define SDHCI_CMD_DATA 0x20
#define SDHCI_CMD_ABORTCMD 0xC0
#define SDHCI_CMD_RESP_NONE 0x00
#define SDHCI_CMD_RESP_LONG 0x01
#define SDHCI_CMD_RESP_SHORT 0x02
#define SDHCI_CMD_RESP_SHORT_BUSY 0x03
#define SDHCI_MAKE_CMD(c, f) (((c & 0xff) << 8) | (f & 0xff))
#define SDHCI_GET_CMD(c) ((c>>8) & 0x3f)
#define SDHCI_RESPONSE 0x10
#define SDHCI_BUFFER 0x20
#define SDHCI_PRESENT_STATE 0x24
#define SDHCI_CMD_INHIBIT 0x00000001
#define SDHCI_DATA_INHIBIT 0x00000002
#define SDHCI_DOING_WRITE 0x00000100
#define SDHCI_DOING_READ 0x00000200
#define SDHCI_SPACE_AVAILABLE 0x00000400
#define SDHCI_DATA_AVAILABLE 0x00000800
#define SDHCI_CARD_PRESENT 0x00010000
#define SDHCI_WRITE_PROTECT 0x00080000
#define SDHCI_DATA_LVL_MASK 0x00F00000
#define SDHCI_DATA_LVL_SHIFT 20
#define SDHCI_HOST_CONTROL 0x28
#define SDHCI_CTRL_LED 0x01
#define SDHCI_CTRL_4BITBUS 0x02
#define SDHCI_CTRL_HISPD 0x04
#define SDHCI_CTRL_DMA_MASK 0x18
#define SDHCI_CTRL_SDMA 0x00
#define SDHCI_CTRL_ADMA1 0x08
#define SDHCI_CTRL_ADMA32 0x10
#define SDHCI_CTRL_ADMA64 0x18
#define SDHCI_CTRL_8BITBUS 0x20
#define SDHCI_POWER_CONTROL 0x29
#define SDHCI_POWER_ON 0x01
#define SDHCI_POWER_180 0x0A
#define SDHCI_POWER_300 0x0C
#define SDHCI_POWER_330 0x0E
#define SDHCI_BLOCK_GAP_CONTROL 0x2A
#define SDHCI_WAKE_UP_CONTROL 0x2B
#define SDHCI_WAKE_ON_INT 0x01
#define SDHCI_WAKE_ON_INSERT 0x02
#define SDHCI_WAKE_ON_REMOVE 0x04
#define SDHCI_CLOCK_CONTROL 0x2C
#define SDHCI_DIVIDER_SHIFT 8
#define SDHCI_DIVIDER_HI_SHIFT 6
#define SDHCI_DIV_MASK 0xFF
#define SDHCI_DIV_MASK_LEN 8
#define SDHCI_DIV_HI_MASK 0x300
#define SDHCI_PROG_CLOCK_MODE 0x0020
#define SDHCI_CLOCK_CARD_EN 0x0004
#define SDHCI_CLOCK_INT_STABLE 0x0002
#define SDHCI_CLOCK_INT_EN 0x0001
#define SDHCI_TIMEOUT_CONTROL 0x2E
#define SDHCI_SOFTWARE_RESET 0x2F
#define SDHCI_RESET_ALL 0x01
#define SDHCI_RESET_CMD 0x02
#define SDHCI_RESET_DATA 0x04
#define SDHCI_INT_STATUS 0x30
#define SDHCI_INT_ENABLE 0x34
#define SDHCI_SIGNAL_ENABLE 0x38
#define SDHCI_INT_RESPONSE 0x00000001
#define SDHCI_INT_DATA_END 0x00000002
#define SDHCI_INT_DMA_END 0x00000008
#define SDHCI_INT_SPACE_AVAIL 0x00000010
#define SDHCI_INT_DATA_AVAIL 0x00000020
#define SDHCI_INT_CARD_INSERT 0x00000040
#define SDHCI_INT_CARD_REMOVE 0x00000080
#define SDHCI_INT_CARD_INT 0x00000100
#define SDHCI_INT_ERROR 0x00008000
#define SDHCI_INT_TIMEOUT 0x00010000
#define SDHCI_INT_CRC 0x00020000
#define SDHCI_INT_END_BIT 0x00040000
#define SDHCI_INT_INDEX 0x00080000
#define SDHCI_INT_DATA_TIMEOUT 0x00100000
#define SDHCI_INT_DATA_CRC 0x00200000
#define SDHCI_INT_DATA_END_BIT 0x00400000
#define SDHCI_INT_BUS_POWER 0x00800000
#define SDHCI_INT_AUTO_CMD_ERR 0x01000000
#define SDHCI_INT_ADMA_ERROR 0x02000000
#define SDHCI_INT_NORMAL_MASK 0x00007FFF
#define SDHCI_INT_ERROR_MASK 0xFFFF8000
#define SDHCI_INT_CMD_MASK (SDHCI_INT_RESPONSE | SDHCI_INT_TIMEOUT | \
SDHCI_INT_CRC | SDHCI_INT_END_BIT | SDHCI_INT_INDEX | \
SDHCI_INT_AUTO_CMD_ERR)
#define SDHCI_INT_DATA_MASK (SDHCI_INT_DATA_END | SDHCI_INT_DMA_END | \
SDHCI_INT_DATA_AVAIL | SDHCI_INT_SPACE_AVAIL | \
SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_DATA_CRC | \
SDHCI_INT_DATA_END_BIT | SDHCI_INT_ADMA_ERROR)
#define SDHCI_INT_ALL_MASK ((unsigned int)-1)
#define SDHCI_AUTO_CMD_ERR 0x3C
#define SDHCI_AUTO_CMD12_NOT_EXEC 0x0001
#define SDHCI_AUTO_CMD_TIMEOUT_ERR 0x0002
#define SDHCI_AUTO_CMD_CRC_ERR 0x0004
#define SDHCI_AUTO_CMD_ENDBIT_ERR 0x0008
#define SDHCI_AUTO_CMD_INDEX_ERR 0x0010
#define SDHCI_AUTO_CMD12_NOT_ISSUED 0x0080
#define SDHCI_HOST_CONTROL2 0x3E
#define SDHCI_CTRL_UHS_MASK 0x0007
#define SDHCI_CTRL_UHS_SDR12 0x0000
#define SDHCI_CTRL_UHS_SDR25 0x0001
#define SDHCI_CTRL_UHS_SDR50 0x0002
#define SDHCI_CTRL_UHS_SDR104 0x0003
#define SDHCI_CTRL_UHS_DDR50 0x0004
#define SDHCI_CTRL_HS_SDR200 0x0005 /* reserved value in SDIO spec */
#define SDHCI_CTRL_VDD_180 0x0008
#define SDHCI_CTRL_DRV_TYPE_MASK 0x0030
#define SDHCI_CTRL_DRV_TYPE_B 0x0000
#define SDHCI_CTRL_DRV_TYPE_A 0x0010
#define SDHCI_CTRL_DRV_TYPE_C 0x0020
#define SDHCI_CTRL_DRV_TYPE_D 0x0030
#define SDHCI_CTRL_EXEC_TUNING 0x0040
#define SDHCI_CTRL_TUNED_CLK 0x0080
#define SDHCI_CTRL_ASYNC_INT_ENABLE 0x4000
#define SDHCI_CTRL_PRESET_VAL_ENABLE 0x8000
#define SDHCI_CAPABILITIES 0x40
#define SDHCI_TIMEOUT_CLK_MASK 0x0000003F
#define SDHCI_TIMEOUT_CLK_SHIFT 0
#define SDHCI_TIMEOUT_CLK_UNIT 0x00000080
#define SDHCI_CLOCK_BASE_MASK 0x00003F00
#define SDHCI_CLOCK_V3_BASE_MASK 0x0000FF00
#define SDHCI_CLOCK_BASE_SHIFT 8
#define SDHCI_MAX_BLOCK_MASK 0x00030000
#define SDHCI_MAX_BLOCK_SHIFT 16
#define SDHCI_CAN_DO_8BIT 0x00040000
#define SDHCI_CAN_DO_ADMA2 0x00080000
#define SDHCI_CAN_DO_ADMA1 0x00100000
#define SDHCI_CAN_DO_HISPD 0x00200000
#define SDHCI_CAN_DO_SDMA 0x00400000
#define SDHCI_CAN_VDD_330 0x01000000
#define SDHCI_CAN_VDD_300 0x02000000
#define SDHCI_CAN_VDD_180 0x04000000
#define SDHCI_CAN_64BIT 0x10000000
#define SDHCI_ASYNC_INTR 0x20000000
#define SDHCI_SUPPORT_SDR50 0x00000001
#define SDHCI_SUPPORT_SDR104 0x00000002
#define SDHCI_SUPPORT_DDR50 0x00000004
#define SDHCI_DRIVER_TYPE_A 0x00000010
#define SDHCI_DRIVER_TYPE_C 0x00000020
#define SDHCI_DRIVER_TYPE_D 0x00000040
#define SDHCI_RETUNING_TIMER_COUNT_MASK 0x00000F00
#define SDHCI_RETUNING_TIMER_COUNT_SHIFT 8
#define SDHCI_USE_SDR50_TUNING 0x00002000
#define SDHCI_RETUNING_MODE_MASK 0x0000C000
#define SDHCI_RETUNING_MODE_SHIFT 14
#define SDHCI_CLOCK_MUL_MASK 0x00FF0000
#define SDHCI_CLOCK_MUL_SHIFT 16
#define SDHCI_CAPABILITIES_1 0x44
#define SDHCI_MAX_CURRENT 0x48
#define SDHCI_MAX_CURRENT_330_MASK 0x0000FF
#define SDHCI_MAX_CURRENT_330_SHIFT 0
#define SDHCI_MAX_CURRENT_300_MASK 0x00FF00
#define SDHCI_MAX_CURRENT_300_SHIFT 8
#define SDHCI_MAX_CURRENT_180_MASK 0xFF0000
#define SDHCI_MAX_CURRENT_180_SHIFT 16
#define SDHCI_MAX_CURRENT_MULTIPLIER 4
/* 4C-4F reserved for more max current */
#define SDHCI_SET_ACMD12_ERROR 0x50
#define SDHCI_SET_INT_ERROR 0x52
#define SDHCI_ADMA_ERROR 0x54
/* 55-57 reserved */
#define SDHCI_ADMA_ADDRESS 0x58
/* 60-FB reserved */
#define SDHCI_PRESET_FOR_SDR12 0x66
#define SDHCI_PRESET_FOR_SDR25 0x68
#define SDHCI_PRESET_FOR_SDR50 0x6A
#define SDHCI_PRESET_FOR_SDR104 0x6C
#define SDHCI_PRESET_FOR_DDR50 0x6E
#define SDHCI_PRESET_DRV_MASK 0xC000
#define SDHCI_PRESET_DRV_SHIFT 14
#define SDHCI_PRESET_CLKGEN_SEL_MASK 0x400
#define SDHCI_PRESET_CLKGEN_SEL_SHIFT 10
#define SDHCI_PRESET_SDCLK_FREQ_MASK 0x3FF
#define SDHCI_PRESET_SDCLK_FREQ_SHIFT 0
#define SDHCI_SLOT_INT_STATUS 0xFC
#define SDHCI_HOST_VERSION 0xFE
#define SDHCI_VENDOR_VER_MASK 0xFF00
#define SDHCI_VENDOR_VER_SHIFT 8
#define SDHCI_SPEC_VER_MASK 0x00FF
#define SDHCI_SPEC_VER_SHIFT 0
#define SDHCI_SPEC_100 0
#define SDHCI_SPEC_200 1
#define SDHCI_SPEC_300 2
/*
* End of controller registers.
*/
#define SDHCI_MAX_DIV_SPEC_200 256
#define SDHCI_MAX_DIV_SPEC_300 2046
/*
* Host SDMA buffer boundary. Valid values from 4K to 512K in powers of 2.
*/
#define SDHCI_DEFAULT_BOUNDARY_SIZE (512 * 1024)
#define SDHCI_DEFAULT_BOUNDARY_ARG (ilog2(SDHCI_DEFAULT_BOUNDARY_SIZE) - 12)
struct sdhci_ops {
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
u32 (*read_l)(struct sdhci_host *host, int reg);
u16 (*read_w)(struct sdhci_host *host, int reg);
u8 (*read_b)(struct sdhci_host *host, int reg);
void (*write_l)(struct sdhci_host *host, u32 val, int reg);
void (*write_w)(struct sdhci_host *host, u16 val, int reg);
void (*write_b)(struct sdhci_host *host, u8 val, int reg);
#endif
void (*set_clock)(struct sdhci_host *host, unsigned int clock);
int (*enable_dma)(struct sdhci_host *host);
unsigned int (*get_max_clock)(struct sdhci_host *host);
unsigned int (*get_min_clock)(struct sdhci_host *host);
unsigned int (*get_timeout_clock)(struct sdhci_host *host);
int (*platform_8bit_width)(struct sdhci_host *host,
int width);
void (*platform_send_init_74_clocks)(struct sdhci_host *host,
u8 power_mode);
unsigned int (*get_ro)(struct sdhci_host *host);
void (*platform_reset_enter)(struct sdhci_host *host, u8 mask);
void (*platform_reset_exit)(struct sdhci_host *host, u8 mask);
int (*set_uhs_signaling)(struct sdhci_host *host, unsigned int uhs);
void (*hw_reset)(struct sdhci_host *host);
void (*platform_suspend)(struct sdhci_host *host);
void (*platform_resume)(struct sdhci_host *host);
void (*check_power_status)(struct sdhci_host *host, u32 req_type);
#define REQ_BUS_OFF (1 << 0)
#define REQ_BUS_ON (1 << 1)
#define REQ_IO_LOW (1 << 2)
#define REQ_IO_HIGH (1 << 3)
int (*execute_tuning)(struct sdhci_host *host, u32 opcode);
void (*toggle_cdr)(struct sdhci_host *host, bool enable);
unsigned int (*get_max_segments)(void);
void (*platform_bus_voting)(struct sdhci_host *host, u32 enable);
void (*disable_data_xfer)(struct sdhci_host *host);
void (*dump_vendor_regs)(struct sdhci_host *host);
int (*enable_controller_clock)(struct sdhci_host *host);
int (*config_auto_tuning_cmd)(struct sdhci_host *host,
bool enable,
u32 type);
};
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
static inline void sdhci_writel(struct sdhci_host *host, u32 val, int reg)
{
if (unlikely(host->ops->write_l))
host->ops->write_l(host, val, reg);
else
writel(val, host->ioaddr + reg);
}
static inline void sdhci_writew(struct sdhci_host *host, u16 val, int reg)
{
if (unlikely(host->ops->write_w))
host->ops->write_w(host, val, reg);
else
writew(val, host->ioaddr + reg);
}
static inline void sdhci_writeb(struct sdhci_host *host, u8 val, int reg)
{
if (unlikely(host->ops->write_b))
host->ops->write_b(host, val, reg);
else
writeb(val, host->ioaddr + reg);
}
static inline u32 sdhci_readl(struct sdhci_host *host, int reg)
{
if (unlikely(host->ops->read_l))
return host->ops->read_l(host, reg);
else
return readl(host->ioaddr + reg);
}
static inline u16 sdhci_readw(struct sdhci_host *host, int reg)
{
if (unlikely(host->ops->read_w))
return host->ops->read_w(host, reg);
else
return readw(host->ioaddr + reg);
}
static inline u8 sdhci_readb(struct sdhci_host *host, int reg)
{
if (unlikely(host->ops->read_b))
return host->ops->read_b(host, reg);
else
return readb(host->ioaddr + reg);
}
#else
static inline void sdhci_writel(struct sdhci_host *host, u32 val, int reg)
{
writel(val, host->ioaddr + reg);
}
static inline void sdhci_writew(struct sdhci_host *host, u16 val, int reg)
{
writew(val, host->ioaddr + reg);
}
static inline void sdhci_writeb(struct sdhci_host *host, u8 val, int reg)
{
writeb(val, host->ioaddr + reg);
}
static inline u32 sdhci_readl(struct sdhci_host *host, int reg)
{
return readl(host->ioaddr + reg);
}
static inline u16 sdhci_readw(struct sdhci_host *host, int reg)
{
return readw(host->ioaddr + reg);
}
static inline u8 sdhci_readb(struct sdhci_host *host, int reg)
{
return readb(host->ioaddr + reg);
}
#endif /* CONFIG_MMC_SDHCI_IO_ACCESSORS */
extern struct sdhci_host *sdhci_alloc_host(struct device *dev,
size_t priv_size);
extern void sdhci_free_host(struct sdhci_host *host);
static inline void *sdhci_priv(struct sdhci_host *host)
{
return (void *)host->private;
}
extern void sdhci_card_detect(struct sdhci_host *host);
extern int sdhci_add_host(struct sdhci_host *host);
extern void sdhci_remove_host(struct sdhci_host *host, int dead);
#ifdef CONFIG_PM
extern int sdhci_suspend_host(struct sdhci_host *host);
extern int sdhci_resume_host(struct sdhci_host *host);
extern void sdhci_enable_irq_wakeups(struct sdhci_host *host);
#endif
#ifdef CONFIG_PM_RUNTIME
extern int sdhci_runtime_suspend_host(struct sdhci_host *host);
extern int sdhci_runtime_resume_host(struct sdhci_host *host);
#endif
void sdhci_cfg_irq(struct sdhci_host *host, bool enable, bool sync);
#endif /* __SDHCI_HW_H */
| {
"pile_set_name": "Github"
} |
#if __VERSION__ >= 130
#define varying in
out vec4 mgl_FragColor;
#define gl_FragColor mgl_FragColor
#endif
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
varying vec4 pass_textureCoords;
uniform sampler2D textureSampler;
void main (void)
{
vec4 inputColor = texture2D(textureSampler,vec2(pass_textureCoords.x/pass_textureCoords.w,-pass_textureCoords.y/pass_textureCoords.w));
gl_FragColor = inputColor;
} | {
"pile_set_name": "Github"
} |
//
// TernarySearchTree.swift
//
//
// Created by Siddharth Atre on 3/15/16.
//
//
import Foundation
public class TernarySearchTree<Element> {
var root: TSTNode<Element>?
public init() {}
// MARK: - Insertion
public func insert(data: Element, withKey key: String) -> Bool {
return insert(node: &root, withData: data, andKey: key, atIndex: 0)
}
private func insert(node: inout TSTNode<Element>?, withData data: Element, andKey key: String, atIndex charIndex: Int) -> Bool {
//sanity check.
if key.characters.count == 0 {
return false
}
//create a new node if necessary.
if node == nil {
let index = key.index(key.startIndex, offsetBy: charIndex)
node = TSTNode<Element>(key: key[index])
}
//if current char is less than the current node's char, go left
let index = key.index(key.startIndex, offsetBy: charIndex)
if key[index] < node!.key {
return insert(node: &node!.left, withData: data, andKey: key, atIndex: charIndex)
}
//if it's greater, go right.
else if key[index] > node!.key {
return insert(node: &node!.right, withData: data, andKey: key, atIndex: charIndex)
}
//current char is equal to the current nodes, go middle
else {
//continue down the middle.
if charIndex + 1 < key.characters.count {
return insert(node: &node!.middle, withData: data, andKey: key, atIndex: charIndex + 1)
}
//otherwise, all done.
else {
node!.data = data
node?.hasData = true
return true
}
}
}
// MARK: - Finding
public func find(key: String) -> Element? {
return find(node: root, withKey: key, atIndex: 0)
}
private func find(node: TSTNode<Element>?, withKey key: String, atIndex charIndex: Int) -> Element? {
//Given key does not exist in tree.
if node == nil {
return nil
}
let index = key.index(key.startIndex, offsetBy: charIndex)
//go left
if key[index] < node!.key {
return find(node: node!.left, withKey: key, atIndex: charIndex)
}
//go right
else if key[index] > node!.key {
return find(node: node!.right, withKey: key, atIndex: charIndex)
}
//go middle
else {
if charIndex + 1 < key.characters.count {
return find(node: node!.middle, withKey: key, atIndex: charIndex + 1)
} else {
return node!.data
}
}
}
}
| {
"pile_set_name": "Github"
} |
/* BSDI osd_defs.h,v 1.4 1998/06/03 19:14:58 karels Exp */
/*
* Copyright (c) 1996-1999 Distributed Processing Technology Corporation
* All rights reserved.
*
* Redistribution and use in source form, with or without modification, are
* permitted provided that redistributions of source code must retain the
* above copyright notice, this list of conditions and the following disclaimer.
*
* This software is provided `as is' by Distributed Processing Technology and
* any express or implied warranties, including, but not limited to, the
* implied warranties of merchantability and fitness for a particular purpose,
* are disclaimed. In no event shall Distributed Processing Technology be
* liable for any direct, indirect, incidental, special, exemplary or
* consequential damages (including, but not limited to, procurement of
* substitute goods or services; loss of use, data, or profits; or business
* interruptions) however caused and on any theory of liability, whether in
* contract, strict liability, or tort (including negligence or otherwise)
* arising in any way out of the use of this driver software, even if advised
* of the possibility of such damage.
*
*/
#ifndef _OSD_DEFS_H
#define _OSD_DEFS_H
/*File - OSD_DEFS.H
****************************************************************************
*
*Description:
*
* This file contains the OS dependent defines. This file is included
*in osd_util.h and provides the OS specific defines for that file.
*
*Copyright Distributed Processing Technology, Corp.
* 140 Candace Dr.
* Maitland, Fl. 32751 USA
* Phone: (407) 830-5522 Fax: (407) 260-5366
* All Rights Reserved
*
*Author: Doug Anderson
*Date: 1/31/94
*
*Editors:
*
*Remarks:
*
*
*****************************************************************************/
/*Definitions - Defines & Constants ----------------------------------------- */
/* Define the operating system */
#if (defined(__linux__))
# define _DPT_LINUX
#elif (defined(__bsdi__))
# define _DPT_BSDI
#elif (defined(__FreeBSD__))
# define _DPT_FREE_BSD
#else
# define _DPT_SCO
#endif
#if defined (ZIL_CURSES)
#define _DPT_CURSES
#else
#define _DPT_MOTIF
#endif
/* Redefine 'far' to nothing - no far pointer type required in UNIX */
#define far
/* Define the mutually exclusive semaphore type */
#define SEMAPHORE_T unsigned int *
/* Define a handle to a DLL */
#define DLL_HANDLE_T unsigned int *
#endif
| {
"pile_set_name": "Github"
} |
import datetime
from peewee import (ForeignKeyField, BooleanField, DateTimeField)
from models.base import BaseModel
from models.user import UserProfile
class FollowRequest(BaseModel):
account = ForeignKeyField(UserProfile)
target = ForeignKeyField(UserProfile)
created_at = DateTimeField(default=datetime.datetime.now)
def authorize(self):
account.follow(target)
#TODO: Add it to the notifications
#MergeWorker(account, target)
self.delete_instance()
def reject(self):
self.delete_instance()
def notify(self):
pass | {
"pile_set_name": "Github"
} |
#!/bin/bash
# font color : green
color='\e[0;32m'
# font color : white
NC='\e[0m'
getquote(){
num_online_quotes=9999
rand_online=$[ ( $RANDOM % $num_online_quotes ) + 1 ]
quote=$(wget -q -O - "http://www.quotationspage.com/quote/$rand_online.html" |
grep -e "<dt>" -e "</dd>" | awk -F'[<>]' '{
if($2 ~ /dt/)
{ print $3 }
else if($4 ~ /b/)
{ print "-- " $7 " n(" $19 ")"}
}')
}
i=1
color='\e[0;32m'
NC='\e[0m'
wget -q --spider http://google.com
if [ $? -eq 0 ]; then
while [ $i -lt 5 ]
do
getquote
echo "$quote" | grep ERROR > /dev/null
if [ $? -eq 0 ];then
getquote
i=`expr $i + 1`
else
break
fi
done
else
a=`date|cut -c 19`
var=(" Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.
\n \t\t\t\t\t\t\t-Samuel Beckett " "Never give up, for that is just the place and time that the tide will turn.
\n \t\t\t\t\t\t\t-Harriet Beecher Stowe " "Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.
\n \t\t\t\t\t\t\t-Thomas A. Edison" "Life isn't about getting and having, it's about giving and being.
\n \t\t\t\t\t\t\t-Kevin Kruse" "Strive not to be a success, but rather to be of value.
\n \t\t\t\t\t\t\t-Albert Einstein" "You miss 100% of the shots you don't take.
\n \t\t\t\t\t\t\t-Wayne Gretzky" "People who are unable to motivate themselves must be content with mediocrity, no matter how impressive their other talents.
\n \t\t\t\t\t\t\t-Andrew Carnegie" "Design is not just what it looks like and feels like. Design is how it works.
\n \t\t\t\t\t\t\t-Steve Jobs" "Only those who dare to fail greatly can ever achieve greatly.
\n \t\t\t\t\t\t\t-Robert F. Kennedy" "All our dreams can come true, if we have the courage to pursue them.
\n \t\t\t\t\t\t\t-Walt Disney " "Success consists of going from failure to failure without loss of enthusiasm.
\n \t\t\t\t\t\t\t-Winston Churchill" )
quote="${var[$a]}"
# Welcome message ! Edit it with your name
#end of code
fi
#echo -e "${color}"
#echo "**************** Welcome back Addy! *****************"
#echo -e "\n"
echo -e "$quote" | sed 's/n()//g'| xargs -0 echo | fmt -60
#echo -e "${NC}"
| {
"pile_set_name": "Github"
} |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_BASEGFX_SOURCE_WORKBENCH_BEZIERCLIP_HXX
#define INCLUDED_BASEGFX_SOURCE_WORKBENCH_BEZIERCLIP_HXX
#include <vector>
struct Point2D
{
typedef double value_type;
Point2D( double _x, double _y ) : x(_x), y(_y) {}
Point2D() : x(), y() {}
double x;
double y;
};
struct Bezier
{
Point2D p0;
Point2D p1;
Point2D p2;
Point2D p3;
Point2D& operator[]( int i ) { return reinterpret_cast<Point2D*>(this)[i]; }
const Point2D& operator[]( int i ) const { return reinterpret_cast<const Point2D*>(this)[i]; }
};
struct FatLine
{
// line L through p1 and p4 in normalized implicit form
double a;
double b;
double c;
// the upper and lower distance from this line
double dMin;
double dMax;
};
template <typename DataType> DataType calcLineDistance( const DataType& a,
const DataType& b,
const DataType& c,
const DataType& x,
const DataType& y )
{
return a*x + b*y + c;
}
typedef std::vector< Point2D > Polygon2D;
/* little abs template */
template <typename NumType> NumType absval( NumType x )
{
return x<0 ? -x : x;
}
Polygon2D convexHull( const Polygon2D& rPoly );
// TODO: find proper epsilon here (try std::numeric_limits<NumType>::epsilon()?)!
#define DBL_EPSILON 1.0e-100
/* little approximate comparisons */
template <typename NumType> bool tolZero( NumType n ) { return fabs(n) < DBL_EPSILON; }
template <typename NumType> bool tolEqual( NumType n1, NumType n2 ) { return tolZero(n1-n2); }
template <typename NumType> bool tolLessEqual( NumType n1, NumType n2 ) { return tolEqual(n1,n2) || n1<n2; }
template <typename NumType> bool tolGreaterEqual( NumType n1, NumType n2 ) { return tolEqual(n1,n2) || n1>n2; }
#endif // INCLUDED_BASEGFX_SOURCE_WORKBENCH_BEZIERCLIP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
| {
"pile_set_name": "Github"
} |
<?php
/*
* 2007-2016 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <[email protected]>
* @copyright 2007-2016 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header('Location: ../');
exit; | {
"pile_set_name": "Github"
} |
sha256:401a2c2470e1fb95051388dc82c632a952cc72b90979cfdb1a2494a585f3e98a
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2017-2019 Alibaba Group Holding Limited
*/
/******************************************************************************
* @file wj_usi_spi.h
* @brief header file for usi spi
* @version V1.0
* @date 02. June 2017
******************************************************************************/
#ifndef _WJ_USI_SPI_H_
#define _WJ_USI_SPI_H_
#include "wj_usi.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
WJENUM_SPI_TXRX = 0,
WJENUM_SPI_TX = 1,
WJENUM_SPI_RX = 2,
WJENUM_SPI_EERX = 3
} WJENUM_SPI_MODE;
typedef enum {
WJENUM_SPI_CLOCK_POLARITY_LOW = 0,
WJENUM_SPI_CLOCK_POLARITY_HIGH = 1
} WJENUM_SPI_POLARITY;
typedef enum {
WJENUM_SPI_CLOCK_PHASE_MIDDLE = 0,
WJENUM_SPI_CLOCK_PHASE_START = 1
} WJENUM_SPI_PHASE;
typedef enum {
WJENUM_SPI_DATASIZE_4 = 3,
WJENUM_SPI_DATASIZE_5 = 4,
WJENUM_SPI_DATASIZE_6 = 5,
WJENUM_SPI_DATASIZE_7 = 6,
WJENUM_SPI_DATASIZE_8 = 7,
WJENUM_SPI_DATASIZE_9 = 8,
WJENUM_SPI_DATASIZE_10 = 9,
WJENUM_SPI_DATASIZE_11 = 10,
WJENUM_SPI_DATASIZE_12 = 11,
WJENUM_SPI_DATASIZE_13 = 12,
WJENUM_SPI_DATASIZE_14 = 13,
WJENUM_SPI_DATASIZE_15 = 14,
WJENUM_SPI_DATASIZE_16 = 15
} WJENUM_SPI_DATAWIDTH;
#define WJ_USI_SPI_MODE_MASTER 0x1
#define WJ_USI_SPI_MODE_SLAVE 0x0
/* some register bits macro for spi control register */
#define WJ_USI_SPI_CTRL_CPOL (1 << 7)
#define WJ_USI_SPI_CTRL_CPHA (1 << 6)
#define WJ_USI_SPI_CTRL_TMODE (3 << 4)
#define WJ_USI_SPI_CTRL_TMODE_TXRX (0 << 4)
#define WJ_USI_SPI_CTRL_TMODE_TX (1 << 4)
#define WJ_USI_SPI_CTRL_TMODE_RX (2 << 4)
#define WJ_USI_SPI_CTRL_DATA_SIZE 0xfff0
#define SPI_INITIALIZED ((uint8_t)(1U)) // SPI initalized
#define SPI_POWERED ((uint8_t)(1U<< 1)) // SPI powered on
#define SPI_CONFIGURED ((uint8_t)(1U << 2)) // SPI configured
#define SPI_DATA_LOST ((uint8_t)(1U << 3)) // SPI data lost occurred
#define SPI_MODE_FAULT ((uint8_t)(1U << 4)) // SPI mode fault occurred
#ifdef __cplusplus
}
#endif
#endif /* _WJ_USI_SPI_H_ */
| {
"pile_set_name": "Github"
} |
<form action="%type_page%" method="get" id="zen_form">
<input type="hidden" name="id" value="%form_id%"/>
<div id="zen_content" class="zen_round zen_box_shadow zen_fonts">
<div class="zen_pad zen_base_form">
<h2 class="zen_notopmargin">Please Input Your Registration Code</h2>
<p class="zen_medium">A code is required to use this form.</p>
<label class="zen_left zen_medium">Code</label>
<div class="zen_field_entry zen_medium">
<input type="text" name="code" maxlength="29" style="width:300px;"/>
</div>
<div class="zen_clear"></div>
</div>
</div>
<div id="zen_section_footer" class="zen_fonts zen_small zen_shadow_light zen_gray">
<div class="zen_section_right" style="text-align:right;">
<input type="submit" value="Continue"/>
</div>
<div class="zen_section_left">
<span><a href="%pp_url%/register.php?action=reset">Cancel Registration</a></span>
</div>
<div class="zen_clear"></div>
</div>
</form> | {
"pile_set_name": "Github"
} |
/* AVX2 version of vectorized cos, vector length is 8.
Copyright (C) 2014-2020 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
#define _ZGVeN8v_cos _ZGVeN8v_cos_avx2_wrapper
#include "../svml_d_cos8_core.S"
| {
"pile_set_name": "Github"
} |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='LinkReference',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('object_pk', models.PositiveIntegerField(null=True, verbose_name='object ID', blank=True)),
('name', models.CharField(default='', max_length=64, blank=True)),
('url', models.TextField()),
('created_on', models.DateTimeField(auto_now_add=True)),
('content_type', models.ForeignKey(related_name='content_type_set_for_linkreference', verbose_name='content type', blank=True, to='contenttypes.ContentType', null=True, on_delete=models.CASCADE)),
('site', models.ForeignKey(to='sites.Site', on_delete=models.CASCADE)),
],
options={
'db_table': 'tcms_linkrefs',
},
),
migrations.AlterIndexTogether(
name='linkreference',
index_together={('content_type', 'object_pk', 'site')},
),
]
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>stm32f103xE</name>
<toolchain>
<name>ARM</name>
</toolchain>
<debug>1</debug>
<settings>
<name>C-STAT</name>
<archiveVersion>259</archiveVersion>
<data>
<version>259</version>
<cstatargs>
<useExtraArgs>0</useExtraArgs>
<extraArgs></extraArgs>
<analyzeTimeoutEnabled>1</analyzeTimeoutEnabled>
<analyzeTimeout>600</analyzeTimeout>
<enableParallel>0</enableParallel>
<parallelThreads>2</parallelThreads>
<enableFalsePositives>0</enableFalsePositives>
<messagesLimitEnabled>1</messagesLimitEnabled>
<messagesLimit>100</messagesLimit>
</cstatargs>
<cstat_settings>
<cstat_version>1.3.2</cstat_version>
<checks_tree>
<package enabled="true" name="STDCHECKS">
<group enabled="true" name="ARR">
<check enabled="true" name="ARR-inv-index-pos"/>
<check enabled="true" name="ARR-inv-index-ptr-pos"/>
<check enabled="true" name="ARR-inv-index-ptr"/>
<check enabled="true" name="ARR-inv-index"/>
<check enabled="true" name="ARR-neg-index"/>
<check enabled="true" name="ARR-uninit-index"/>
</group>
<group enabled="true" name="ATH">
<check enabled="true" name="ATH-cmp-float"/>
<check enabled="true" name="ATH-cmp-unsign-neg"/>
<check enabled="true" name="ATH-cmp-unsign-pos"/>
<check enabled="true" name="ATH-div-0-assign"/>
<check enabled="false" name="ATH-div-0-cmp-aft"/>
<check enabled="true" name="ATH-div-0-cmp-bef"/>
<check enabled="true" name="ATH-div-0-interval"/>
<check enabled="true" name="ATH-div-0-pos"/>
<check enabled="true" name="ATH-div-0-unchk-global"/>
<check enabled="true" name="ATH-div-0-unchk-local"/>
<check enabled="true" name="ATH-div-0-unchk-param"/>
<check enabled="true" name="ATH-div-0"/>
<check enabled="true" name="ATH-inc-bool"/>
<check enabled="true" name="ATH-malloc-overrun"/>
<check enabled="true" name="ATH-neg-check-nonneg"/>
<check enabled="true" name="ATH-neg-check-pos"/>
<check enabled="true" name="ATH-new-overrun"/>
<check enabled="false" name="ATH-overflow-cast"/>
<check enabled="true" name="ATH-overflow"/>
<check enabled="true" name="ATH-shift-bounds"/>
<check enabled="true" name="ATH-shift-neg"/>
<check enabled="true" name="ATH-sizeof-by-sizeof"/>
</group>
<group enabled="true" name="CAST">
<check enabled="false" name="CAST-old-style"/>
</group>
<group enabled="true" name="CATCH">
<check enabled="true" name="CATCH-object-slicing"/>
<check enabled="false" name="CATCH-xtor-bad-member"/>
</group>
<group enabled="true" name="COMMA">
<check enabled="false" name="COMMA-overload"/>
</group>
<group enabled="true" name="COMMENT">
<check enabled="true" name="COMMENT-nested"/>
</group>
<group enabled="true" name="CONST">
<check enabled="true" name="CONST-member-ret"/>
</group>
<group enabled="true" name="COP">
<check enabled="false" name="COP-alloc-ctor"/>
<check enabled="true" name="COP-assign-op-ret"/>
<check enabled="true" name="COP-assign-op-self"/>
<check enabled="true" name="COP-assign-op"/>
<check enabled="true" name="COP-copy-ctor"/>
<check enabled="false" name="COP-dealloc-dtor"/>
<check enabled="true" name="COP-dtor-throw"/>
<check enabled="true" name="COP-dtor"/>
<check enabled="true" name="COP-init-order"/>
<check enabled="true" name="COP-init-uninit"/>
<check enabled="true" name="COP-member-uninit"/>
</group>
<group enabled="true" name="CPU">
<check enabled="true" name="CPU-ctor-call-virt"/>
<check enabled="false" name="CPU-ctor-implicit"/>
<check enabled="true" name="CPU-delete-throw"/>
<check enabled="true" name="CPU-delete-void"/>
<check enabled="true" name="CPU-dtor-call-virt"/>
<check enabled="true" name="CPU-malloc-class"/>
<check enabled="true" name="CPU-nonvirt-dtor"/>
<check enabled="true" name="CPU-return-ref-to-class-data"/>
</group>
<group enabled="true" name="DECL">
<check enabled="false" name="DECL-implicit-int"/>
</group>
<group enabled="true" name="DEFINE">
<check enabled="true" name="DEFINE-hash-multiple"/>
</group>
<group enabled="true" name="ENUM">
<check enabled="false" name="ENUM-bounds"/>
</group>
<group enabled="true" name="EXP">
<check enabled="true" name="EXP-cond-assign"/>
<check enabled="true" name="EXP-dangling-else"/>
<check enabled="true" name="EXP-loop-exit"/>
<check enabled="false" name="EXP-main-ret-int"/>
<check enabled="false" name="EXP-null-stmt"/>
<check enabled="false" name="EXP-stray-semicolon"/>
</group>
<group enabled="true" name="EXPR">
<check enabled="true" name="EXPR-const-overflow"/>
</group>
<group enabled="true" name="FPT">
<check enabled="true" name="FPT-cmp-null"/>
<check enabled="false" name="FPT-literal"/>
<check enabled="true" name="FPT-misuse"/>
</group>
<group enabled="true" name="FUNC">
<check enabled="false" name="FUNC-implicit-decl"/>
<check enabled="false" name="FUNC-unprototyped-all"/>
<check enabled="true" name="FUNC-unprototyped-used"/>
</group>
<group enabled="true" name="INCLUDE">
<check enabled="false" name="INCLUDE-c-file"/>
</group>
<group enabled="true" name="INT">
<check enabled="false" name="INT-use-signed-as-unsigned-pos"/>
<check enabled="true" name="INT-use-signed-as-unsigned"/>
</group>
<group enabled="true" name="ITR">
<check enabled="true" name="ITR-end-cmp-aft"/>
<check enabled="true" name="ITR-end-cmp-bef"/>
<check enabled="true" name="ITR-invalidated"/>
<check enabled="false" name="ITR-mismatch-alg"/>
<check enabled="false" name="ITR-store"/>
<check enabled="true" name="ITR-uninit"/>
</group>
<group enabled="true" name="LIB">
<check enabled="false" name="LIB-bsearch-overrun-pos"/>
<check enabled="false" name="LIB-bsearch-overrun"/>
<check enabled="false" name="LIB-fn-unsafe"/>
<check enabled="false" name="LIB-fread-overrun-pos"/>
<check enabled="true" name="LIB-fread-overrun"/>
<check enabled="false" name="LIB-memchr-overrun-pos"/>
<check enabled="true" name="LIB-memchr-overrun"/>
<check enabled="false" name="LIB-memcpy-overrun-pos"/>
<check enabled="true" name="LIB-memcpy-overrun"/>
<check enabled="false" name="LIB-memset-overrun-pos"/>
<check enabled="true" name="LIB-memset-overrun"/>
<check enabled="false" name="LIB-putenv"/>
<check enabled="false" name="LIB-qsort-overrun-pos"/>
<check enabled="false" name="LIB-qsort-overrun"/>
<check enabled="true" name="LIB-return-const"/>
<check enabled="true" name="LIB-return-error"/>
<check enabled="true" name="LIB-return-leak"/>
<check enabled="true" name="LIB-return-neg"/>
<check enabled="true" name="LIB-return-null"/>
<check enabled="false" name="LIB-sprintf-overrun"/>
<check enabled="false" name="LIB-std-sort-overrun-pos"/>
<check enabled="true" name="LIB-std-sort-overrun"/>
<check enabled="false" name="LIB-strcat-overrun-pos"/>
<check enabled="true" name="LIB-strcat-overrun"/>
<check enabled="false" name="LIB-strcpy-overrun-pos"/>
<check enabled="true" name="LIB-strcpy-overrun"/>
<check enabled="false" name="LIB-strncat-overrun-pos"/>
<check enabled="true" name="LIB-strncat-overrun"/>
<check enabled="false" name="LIB-strncmp-overrun-pos"/>
<check enabled="true" name="LIB-strncmp-overrun"/>
<check enabled="false" name="LIB-strncpy-overrun-pos"/>
<check enabled="true" name="LIB-strncpy-overrun"/>
</group>
<group enabled="true" name="LOGIC">
<check enabled="false" name="LOGIC-overload"/>
</group>
<group enabled="true" name="MEM">
<check enabled="true" name="MEM-delete-array-op"/>
<check enabled="true" name="MEM-delete-op"/>
<check enabled="true" name="MEM-double-free-alias"/>
<check enabled="true" name="MEM-double-free-some"/>
<check enabled="true" name="MEM-double-free"/>
<check enabled="true" name="MEM-free-field"/>
<check enabled="true" name="MEM-free-fptr"/>
<check enabled="false" name="MEM-free-no-alloc-struct"/>
<check enabled="false" name="MEM-free-no-alloc"/>
<check enabled="true" name="MEM-free-no-use"/>
<check enabled="true" name="MEM-free-op"/>
<check enabled="true" name="MEM-free-struct-field"/>
<check enabled="true" name="MEM-free-variable-alias"/>
<check enabled="true" name="MEM-free-variable"/>
<check enabled="true" name="MEM-leak-alias"/>
<check enabled="false" name="MEM-leak"/>
<check enabled="false" name="MEM-malloc-arith"/>
<check enabled="true" name="MEM-malloc-diff-type"/>
<check enabled="true" name="MEM-malloc-sizeof-ptr"/>
<check enabled="true" name="MEM-malloc-sizeof"/>
<check enabled="false" name="MEM-malloc-strlen"/>
<check enabled="true" name="MEM-realloc-diff-type"/>
<check enabled="true" name="MEM-return-free"/>
<check enabled="true" name="MEM-return-no-assign"/>
<check enabled="true" name="MEM-stack-global-field"/>
<check enabled="true" name="MEM-stack-global"/>
<check enabled="true" name="MEM-stack-param-ref"/>
<check enabled="true" name="MEM-stack-param"/>
<check enabled="true" name="MEM-stack-pos"/>
<check enabled="true" name="MEM-stack-ref"/>
<check enabled="true" name="MEM-stack"/>
<check enabled="true" name="MEM-use-free-all"/>
<check enabled="true" name="MEM-use-free-some"/>
</group>
<group enabled="true" name="PTR">
<check enabled="true" name="PTR-arith-field"/>
<check enabled="true" name="PTR-arith-stack"/>
<check enabled="true" name="PTR-arith-var"/>
<check enabled="true" name="PTR-cmp-str-lit"/>
<check enabled="false" name="PTR-null-assign-fun-pos"/>
<check enabled="false" name="PTR-null-assign-pos"/>
<check enabled="true" name="PTR-null-assign"/>
<check enabled="true" name="PTR-null-cmp-aft"/>
<check enabled="true" name="PTR-null-cmp-bef-fun"/>
<check enabled="true" name="PTR-null-cmp-bef"/>
<check enabled="true" name="PTR-null-fun-pos"/>
<check enabled="false" name="PTR-null-literal-pos"/>
<check enabled="false" name="PTR-overload"/>
<check enabled="false" name="PTR-singleton-arith-pos"/>
<check enabled="true" name="PTR-singleton-arith"/>
<check enabled="true" name="PTR-unchk-param-some"/>
<check enabled="false" name="PTR-unchk-param"/>
<check enabled="false" name="PTR-uninit-pos"/>
<check enabled="true" name="PTR-uninit"/>
</group>
<group enabled="true" name="RED">
<check enabled="false" name="RED-alloc-zero-bytes"/>
<check enabled="false" name="RED-case-reach"/>
<check enabled="false" name="RED-cmp-always"/>
<check enabled="false" name="RED-cmp-never"/>
<check enabled="false" name="RED-cond-always"/>
<check enabled="true" name="RED-cond-const-assign"/>
<check enabled="false" name="RED-cond-const-expr"/>
<check enabled="false" name="RED-cond-const"/>
<check enabled="false" name="RED-cond-never"/>
<check enabled="true" name="RED-dead"/>
<check enabled="false" name="RED-expr"/>
<check enabled="false" name="RED-func-no-effect"/>
<check enabled="true" name="RED-local-hides-global"/>
<check enabled="false" name="RED-local-hides-local"/>
<check enabled="false" name="RED-local-hides-member"/>
<check enabled="true" name="RED-local-hides-param"/>
<check enabled="false" name="RED-no-effect"/>
<check enabled="true" name="RED-self-assign"/>
<check enabled="true" name="RED-unused-assign"/>
<check enabled="false" name="RED-unused-param"/>
<check enabled="false" name="RED-unused-return-val"/>
<check enabled="false" name="RED-unused-val"/>
<check enabled="true" name="RED-unused-var-all"/>
</group>
<group enabled="true" name="RESOURCE">
<check enabled="false" name="RESOURCE-deref-file"/>
<check enabled="true" name="RESOURCE-double-close"/>
<check enabled="true" name="RESOURCE-file-no-close-all"/>
<check enabled="false" name="RESOURCE-file-pos-neg"/>
<check enabled="true" name="RESOURCE-file-use-after-close"/>
<check enabled="false" name="RESOURCE-implicit-deref-file"/>
<check enabled="true" name="RESOURCE-write-ronly-file"/>
</group>
<group enabled="true" name="SIZEOF">
<check enabled="true" name="SIZEOF-side-effect"/>
</group>
<group enabled="true" name="SPC">
<check enabled="true" name="SPC-order"/>
<check enabled="false" name="SPC-uninit-arr-all"/>
<check enabled="true" name="SPC-uninit-struct-field-heap"/>
<check enabled="false" name="SPC-uninit-struct-field"/>
<check enabled="true" name="SPC-uninit-struct"/>
<check enabled="true" name="SPC-uninit-var-all"/>
<check enabled="true" name="SPC-uninit-var-some"/>
<check enabled="false" name="SPC-volatile-reads"/>
<check enabled="false" name="SPC-volatile-writes"/>
</group>
<group enabled="true" name="STRUCT">
<check enabled="false" name="STRUCT-signed-bit"/>
</group>
<group enabled="true" name="SWITCH">
<check enabled="true" name="SWITCH-fall-through"/>
</group>
<group enabled="true" name="THROW">
<check enabled="false" name="THROW-empty"/>
<check enabled="false" name="THROW-main"/>
<check enabled="true" name="THROW-null"/>
<check enabled="true" name="THROW-ptr"/>
<check enabled="true" name="THROW-static"/>
<check enabled="true" name="THROW-unhandled"/>
</group>
<group enabled="true" name="UNION">
<check enabled="true" name="UNION-overlap-assign"/>
<check enabled="true" name="UNION-type-punning"/>
</group>
</package>
<package enabled="false" name="CERT">
<group enabled="true" name="CERT-EXP">
<check enabled="true" name="CERT-EXP19-C"/>
</group>
<group enabled="true" name="CERT-FIO">
<check enabled="true" name="CERT-FIO37-C"/>
<check enabled="true" name="CERT-FIO38-C"/>
</group>
<group enabled="true" name="CERT-SIG">
<check enabled="true" name="CERT-SIG31-C"/>
</group>
</package>
<package enabled="false" name="SECURITY">
<group enabled="true" name="SEC-BUFFER">
<check enabled="true" name="SEC-BUFFER-memory-leak-alias"/>
<check enabled="false" name="SEC-BUFFER-memory-leak"/>
<check enabled="false" name="SEC-BUFFER-memset-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-memset-overrun"/>
<check enabled="false" name="SEC-BUFFER-qsort-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-qsort-overrun"/>
<check enabled="true" name="SEC-BUFFER-sprintf-overrun"/>
<check enabled="false" name="SEC-BUFFER-std-sort-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-std-sort-overrun"/>
<check enabled="false" name="SEC-BUFFER-strcat-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-strcat-overrun"/>
<check enabled="false" name="SEC-BUFFER-strcpy-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-strcpy-overrun"/>
<check enabled="false" name="SEC-BUFFER-strncat-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-strncat-overrun"/>
<check enabled="false" name="SEC-BUFFER-strncmp-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-strncmp-overrun"/>
<check enabled="false" name="SEC-BUFFER-strncpy-overrun-pos"/>
<check enabled="true" name="SEC-BUFFER-strncpy-overrun"/>
<check enabled="true" name="SEC-BUFFER-tainted-alloc-size"/>
<check enabled="true" name="SEC-BUFFER-tainted-copy-length"/>
<check enabled="true" name="SEC-BUFFER-tainted-copy"/>
<check enabled="true" name="SEC-BUFFER-tainted-index"/>
<check enabled="true" name="SEC-BUFFER-tainted-offset"/>
<check enabled="true" name="SEC-BUFFER-use-after-free-all"/>
<check enabled="true" name="SEC-BUFFER-use-after-free-some"/>
</group>
<group enabled="true" name="SEC-DIV-0">
<check enabled="true" name="SEC-DIV-0-compare-after"/>
<check enabled="true" name="SEC-DIV-0-compare-before"/>
<check enabled="true" name="SEC-DIV-0-tainted"/>
</group>
<group enabled="true" name="SEC-FILEOP">
<check enabled="true" name="SEC-FILEOP-open-no-close"/>
<check enabled="false" name="SEC-FILEOP-path-traversal"/>
<check enabled="true" name="SEC-FILEOP-use-after-close"/>
</group>
<group enabled="true" name="SEC-INJECTION">
<check enabled="false" name="SEC-INJECTION-sql"/>
<check enabled="false" name="SEC-INJECTION-xpath"/>
</group>
<group enabled="true" name="SEC-LOOP">
<check enabled="true" name="SEC-LOOP-tainted-bound"/>
</group>
<group enabled="true" name="SEC-NULL">
<check enabled="false" name="SEC-NULL-assignment-fun-pos"/>
<check enabled="true" name="SEC-NULL-assignment"/>
<check enabled="true" name="SEC-NULL-cmp-aft"/>
<check enabled="true" name="SEC-NULL-cmp-bef-fun"/>
<check enabled="true" name="SEC-NULL-cmp-bef"/>
<check enabled="false" name="SEC-NULL-literal-pos"/>
</group>
<group enabled="true" name="SEC-STRING">
<check enabled="true" name="SEC-STRING-format-string"/>
<check enabled="false" name="SEC-STRING-hard-coded-credentials"/>
</group>
</package>
<package enabled="false" name="MISRAC2004">
<group enabled="true" name="MISRAC2004-1">
<check enabled="true" name="MISRAC2004-1.1"/>
<check enabled="true" name="MISRAC2004-1.2_a"/>
<check enabled="true" name="MISRAC2004-1.2_b"/>
<check enabled="true" name="MISRAC2004-1.2_c"/>
<check enabled="true" name="MISRAC2004-1.2_d"/>
<check enabled="true" name="MISRAC2004-1.2_e"/>
<check enabled="true" name="MISRAC2004-1.2_f"/>
<check enabled="true" name="MISRAC2004-1.2_g"/>
<check enabled="true" name="MISRAC2004-1.2_h"/>
<check enabled="true" name="MISRAC2004-1.2_i"/>
<check enabled="true" name="MISRAC2004-1.2_j"/>
</group>
<group enabled="true" name="MISRAC2004-2">
<check enabled="true" name="MISRAC2004-2.1"/>
<check enabled="true" name="MISRAC2004-2.2"/>
<check enabled="true" name="MISRAC2004-2.3"/>
<check enabled="false" name="MISRAC2004-2.4"/>
</group>
<group enabled="true" name="MISRAC2004-5">
<check enabled="true" name="MISRAC2004-5.2"/>
<check enabled="true" name="MISRAC2004-5.3"/>
<check enabled="true" name="MISRAC2004-5.4"/>
<check enabled="false" name="MISRAC2004-5.5"/>
<check enabled="false" name="MISRAC2004-5.6"/>
</group>
<group enabled="true" name="MISRAC2004-6">
<check enabled="true" name="MISRAC2004-6.1"/>
<check enabled="false" name="MISRAC2004-6.3"/>
<check enabled="true" name="MISRAC2004-6.4"/>
<check enabled="true" name="MISRAC2004-6.5"/>
</group>
<group enabled="true" name="MISRAC2004-7">
<check enabled="true" name="MISRAC2004-7.1"/>
</group>
<group enabled="true" name="MISRAC2004-8">
<check enabled="true" name="MISRAC2004-8.1"/>
<check enabled="true" name="MISRAC2004-8.2"/>
<check enabled="true" name="MISRAC2004-8.5_a"/>
<check enabled="true" name="MISRAC2004-8.5_b"/>
<check enabled="true" name="MISRAC2004-8.12"/>
</group>
<group enabled="true" name="MISRAC2004-9">
<check enabled="true" name="MISRAC2004-9.1_a"/>
<check enabled="true" name="MISRAC2004-9.1_b"/>
<check enabled="true" name="MISRAC2004-9.1_c"/>
<check enabled="true" name="MISRAC2004-9.2"/>
</group>
<group enabled="true" name="MISRAC2004-10">
<check enabled="true" name="MISRAC2004-10.1_a"/>
<check enabled="true" name="MISRAC2004-10.1_b"/>
<check enabled="true" name="MISRAC2004-10.1_c"/>
<check enabled="true" name="MISRAC2004-10.1_d"/>
<check enabled="true" name="MISRAC2004-10.2_a"/>
<check enabled="true" name="MISRAC2004-10.2_b"/>
<check enabled="true" name="MISRAC2004-10.2_c"/>
<check enabled="true" name="MISRAC2004-10.2_d"/>
<check enabled="true" name="MISRAC2004-10.3"/>
<check enabled="true" name="MISRAC2004-10.4"/>
<check enabled="true" name="MISRAC2004-10.5"/>
<check enabled="true" name="MISRAC2004-10.6"/>
</group>
<group enabled="true" name="MISRAC2004-11">
<check enabled="true" name="MISRAC2004-11.1"/>
<check enabled="false" name="MISRAC2004-11.3"/>
<check enabled="false" name="MISRAC2004-11.4"/>
<check enabled="true" name="MISRAC2004-11.5"/>
</group>
<group enabled="true" name="MISRAC2004-12">
<check enabled="false" name="MISRAC2004-12.1"/>
<check enabled="true" name="MISRAC2004-12.2_a"/>
<check enabled="true" name="MISRAC2004-12.2_b"/>
<check enabled="true" name="MISRAC2004-12.2_c"/>
<check enabled="true" name="MISRAC2004-12.3"/>
<check enabled="true" name="MISRAC2004-12.4"/>
<check enabled="false" name="MISRAC2004-12.6_a"/>
<check enabled="false" name="MISRAC2004-12.6_b"/>
<check enabled="true" name="MISRAC2004-12.7"/>
<check enabled="true" name="MISRAC2004-12.8"/>
<check enabled="true" name="MISRAC2004-12.9"/>
<check enabled="true" name="MISRAC2004-12.10"/>
<check enabled="false" name="MISRAC2004-12.11"/>
<check enabled="true" name="MISRAC2004-12.12_a"/>
<check enabled="true" name="MISRAC2004-12.12_b"/>
<check enabled="false" name="MISRAC2004-12.13"/>
</group>
<group enabled="true" name="MISRAC2004-13">
<check enabled="true" name="MISRAC2004-13.1"/>
<check enabled="false" name="MISRAC2004-13.2_a"/>
<check enabled="false" name="MISRAC2004-13.2_b"/>
<check enabled="false" name="MISRAC2004-13.2_c"/>
<check enabled="false" name="MISRAC2004-13.2_d"/>
<check enabled="false" name="MISRAC2004-13.2_e"/>
<check enabled="true" name="MISRAC2004-13.3"/>
<check enabled="true" name="MISRAC2004-13.4"/>
<check enabled="true" name="MISRAC2004-13.5"/>
<check enabled="true" name="MISRAC2004-13.6"/>
<check enabled="true" name="MISRAC2004-13.7_a"/>
<check enabled="true" name="MISRAC2004-13.7_b"/>
</group>
<group enabled="true" name="MISRAC2004-14">
<check enabled="true" name="MISRAC2004-14.1"/>
<check enabled="true" name="MISRAC2004-14.2"/>
<check enabled="true" name="MISRAC2004-14.3"/>
<check enabled="true" name="MISRAC2004-14.4"/>
<check enabled="true" name="MISRAC2004-14.5"/>
<check enabled="true" name="MISRAC2004-14.6"/>
<check enabled="true" name="MISRAC2004-14.7"/>
<check enabled="true" name="MISRAC2004-14.8_a"/>
<check enabled="true" name="MISRAC2004-14.8_b"/>
<check enabled="true" name="MISRAC2004-14.8_c"/>
<check enabled="true" name="MISRAC2004-14.8_d"/>
<check enabled="true" name="MISRAC2004-14.9"/>
<check enabled="true" name="MISRAC2004-14.10"/>
</group>
<group enabled="true" name="MISRAC2004-15">
<check enabled="true" name="MISRAC2004-15.0"/>
<check enabled="true" name="MISRAC2004-15.1"/>
<check enabled="true" name="MISRAC2004-15.2"/>
<check enabled="true" name="MISRAC2004-15.3"/>
<check enabled="true" name="MISRAC2004-15.4"/>
<check enabled="true" name="MISRAC2004-15.5"/>
</group>
<group enabled="true" name="MISRAC2004-16">
<check enabled="true" name="MISRAC2004-16.1"/>
<check enabled="true" name="MISRAC2004-16.2_a"/>
<check enabled="true" name="MISRAC2004-16.2_b"/>
<check enabled="true" name="MISRAC2004-16.3"/>
<check enabled="true" name="MISRAC2004-16.5"/>
<check enabled="true" name="MISRAC2004-16.7"/>
<check enabled="true" name="MISRAC2004-16.8"/>
<check enabled="true" name="MISRAC2004-16.9"/>
<check enabled="true" name="MISRAC2004-16.10"/>
</group>
<group enabled="true" name="MISRAC2004-17">
<check enabled="true" name="MISRAC2004-17.1_a"/>
<check enabled="true" name="MISRAC2004-17.1_b"/>
<check enabled="true" name="MISRAC2004-17.1_c"/>
<check enabled="true" name="MISRAC2004-17.4_a"/>
<check enabled="true" name="MISRAC2004-17.4_b"/>
<check enabled="true" name="MISRAC2004-17.5"/>
<check enabled="true" name="MISRAC2004-17.6_a"/>
<check enabled="true" name="MISRAC2004-17.6_b"/>
<check enabled="true" name="MISRAC2004-17.6_c"/>
<check enabled="true" name="MISRAC2004-17.6_d"/>
</group>
<group enabled="true" name="MISRAC2004-18">
<check enabled="true" name="MISRAC2004-18.1"/>
<check enabled="true" name="MISRAC2004-18.2"/>
<check enabled="true" name="MISRAC2004-18.4"/>
</group>
<group enabled="true" name="MISRAC2004-19">
<check enabled="false" name="MISRAC2004-19.2"/>
<check enabled="true" name="MISRAC2004-19.6"/>
<check enabled="false" name="MISRAC2004-19.7"/>
<check enabled="true" name="MISRAC2004-19.12"/>
<check enabled="false" name="MISRAC2004-19.13"/>
<check enabled="true" name="MISRAC2004-19.15"/>
</group>
<group enabled="true" name="MISRAC2004-20">
<check enabled="true" name="MISRAC2004-20.1"/>
<check enabled="true" name="MISRAC2004-20.4"/>
<check enabled="true" name="MISRAC2004-20.5"/>
<check enabled="true" name="MISRAC2004-20.6"/>
<check enabled="true" name="MISRAC2004-20.7"/>
<check enabled="true" name="MISRAC2004-20.8"/>
<check enabled="true" name="MISRAC2004-20.9"/>
<check enabled="true" name="MISRAC2004-20.10"/>
<check enabled="true" name="MISRAC2004-20.11"/>
<check enabled="true" name="MISRAC2004-20.12"/>
</group>
</package>
<package enabled="false" name="MISRAC2012">
<group enabled="true" name="MISRAC2012-Dir-4">
<check enabled="true" name="MISRAC2012-Dir-4.3"/>
<check enabled="false" name="MISRAC2012-Dir-4.4"/>
<check enabled="false" name="MISRAC2012-Dir-4.5"/>
<check enabled="false" name="MISRAC2012-Dir-4.6_a"/>
<check enabled="false" name="MISRAC2012-Dir-4.6_b"/>
<check enabled="false" name="MISRAC2012-Dir-4.7_a"/>
<check enabled="false" name="MISRAC2012-Dir-4.7_b"/>
<check enabled="false" name="MISRAC2012-Dir-4.7_c"/>
<check enabled="false" name="MISRAC2012-Dir-4.8"/>
<check enabled="false" name="MISRAC2012-Dir-4.9"/>
<check enabled="true" name="MISRAC2012-Dir-4.10"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_a"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_b"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_c"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_d"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_e"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_f"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_g"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_h"/>
<check enabled="false" name="MISRAC2012-Dir-4.11_i"/>
<check enabled="false" name="MISRAC2012-Dir-4.12"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_b"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_c"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_d"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_e"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_f"/>
<check enabled="true" name="MISRAC2012-Dir-4.13_g"/>
<check enabled="false" name="MISRAC2012-Dir-4.13_h"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-1">
<check enabled="true" name="MISRAC2012-Rule-1.3_a"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_b"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_c"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_d"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_e"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_f"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_g"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_h"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_i"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_j"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_k"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_m"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_n"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_o"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_p"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_q"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_r"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_s"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_t"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_u"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_v"/>
<check enabled="true" name="MISRAC2012-Rule-1.3_w"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-2">
<check enabled="true" name="MISRAC2012-Rule-2.1_a"/>
<check enabled="true" name="MISRAC2012-Rule-2.1_b"/>
<check enabled="true" name="MISRAC2012-Rule-2.2_a"/>
<check enabled="true" name="MISRAC2012-Rule-2.2_b"/>
<check enabled="true" name="MISRAC2012-Rule-2.2_c"/>
<check enabled="false" name="MISRAC2012-Rule-2.3"/>
<check enabled="false" name="MISRAC2012-Rule-2.4"/>
<check enabled="false" name="MISRAC2012-Rule-2.5"/>
<check enabled="false" name="MISRAC2012-Rule-2.6"/>
<check enabled="false" name="MISRAC2012-Rule-2.7"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-3">
<check enabled="true" name="MISRAC2012-Rule-3.1"/>
<check enabled="true" name="MISRAC2012-Rule-3.2"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-5">
<check enabled="true" name="MISRAC2012-Rule-5.1"/>
<check enabled="true" name="MISRAC2012-Rule-5.2_c89"/>
<check enabled="true" name="MISRAC2012-Rule-5.2_c99"/>
<check enabled="true" name="MISRAC2012-Rule-5.3_c89"/>
<check enabled="true" name="MISRAC2012-Rule-5.3_c99"/>
<check enabled="true" name="MISRAC2012-Rule-5.4_c89"/>
<check enabled="true" name="MISRAC2012-Rule-5.4_c99"/>
<check enabled="true" name="MISRAC2012-Rule-5.5_c89"/>
<check enabled="true" name="MISRAC2012-Rule-5.5_c99"/>
<check enabled="true" name="MISRAC2012-Rule-5.6"/>
<check enabled="true" name="MISRAC2012-Rule-5.7"/>
<check enabled="true" name="MISRAC2012-Rule-5.8"/>
<check enabled="false" name="MISRAC2012-Rule-5.9"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-6">
<check enabled="true" name="MISRAC2012-Rule-6.1"/>
<check enabled="true" name="MISRAC2012-Rule-6.2"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-7">
<check enabled="true" name="MISRAC2012-Rule-7.1"/>
<check enabled="true" name="MISRAC2012-Rule-7.2"/>
<check enabled="true" name="MISRAC2012-Rule-7.3"/>
<check enabled="true" name="MISRAC2012-Rule-7.4_a"/>
<check enabled="true" name="MISRAC2012-Rule-7.4_b"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-8">
<check enabled="true" name="MISRAC2012-Rule-8.1"/>
<check enabled="true" name="MISRAC2012-Rule-8.2_a"/>
<check enabled="true" name="MISRAC2012-Rule-8.2_b"/>
<check enabled="true" name="MISRAC2012-Rule-8.3_b"/>
<check enabled="true" name="MISRAC2012-Rule-8.4"/>
<check enabled="false" name="MISRAC2012-Rule-8.5_a"/>
<check enabled="true" name="MISRAC2012-Rule-8.5_b"/>
<check enabled="true" name="MISRAC2012-Rule-8.6"/>
<check enabled="false" name="MISRAC2012-Rule-8.7"/>
<check enabled="false" name="MISRAC2012-Rule-8.9_a"/>
<check enabled="false" name="MISRAC2012-Rule-8.9_b"/>
<check enabled="true" name="MISRAC2012-Rule-8.10"/>
<check enabled="false" name="MISRAC2012-Rule-8.11"/>
<check enabled="true" name="MISRAC2012-Rule-8.12"/>
<check enabled="false" name="MISRAC2012-Rule-8.13"/>
<check enabled="true" name="MISRAC2012-Rule-8.14"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-9">
<check enabled="true" name="MISRAC2012-Rule-9.1_a"/>
<check enabled="true" name="MISRAC2012-Rule-9.1_b"/>
<check enabled="true" name="MISRAC2012-Rule-9.1_c"/>
<check enabled="true" name="MISRAC2012-Rule-9.1_d"/>
<check enabled="true" name="MISRAC2012-Rule-9.1_e"/>
<check enabled="true" name="MISRAC2012-Rule-9.1_f"/>
<check enabled="true" name="MISRAC2012-Rule-9.2"/>
<check enabled="true" name="MISRAC2012-Rule-9.3"/>
<check enabled="true" name="MISRAC2012-Rule-9.4"/>
<check enabled="true" name="MISRAC2012-Rule-9.5_a"/>
<check enabled="true" name="MISRAC2012-Rule-9.5_b"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-10">
<check enabled="true" name="MISRAC2012-Rule-10.1_R2"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R3"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R4"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R5"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R6"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R7"/>
<check enabled="true" name="MISRAC2012-Rule-10.1_R8"/>
<check enabled="true" name="MISRAC2012-Rule-10.2"/>
<check enabled="true" name="MISRAC2012-Rule-10.3"/>
<check enabled="true" name="MISRAC2012-Rule-10.4_a"/>
<check enabled="true" name="MISRAC2012-Rule-10.4_b"/>
<check enabled="false" name="MISRAC2012-Rule-10.5"/>
<check enabled="true" name="MISRAC2012-Rule-10.6"/>
<check enabled="true" name="MISRAC2012-Rule-10.7"/>
<check enabled="true" name="MISRAC2012-Rule-10.8"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-11">
<check enabled="true" name="MISRAC2012-Rule-11.1"/>
<check enabled="true" name="MISRAC2012-Rule-11.2"/>
<check enabled="true" name="MISRAC2012-Rule-11.3"/>
<check enabled="false" name="MISRAC2012-Rule-11.4"/>
<check enabled="false" name="MISRAC2012-Rule-11.5"/>
<check enabled="true" name="MISRAC2012-Rule-11.6"/>
<check enabled="true" name="MISRAC2012-Rule-11.7"/>
<check enabled="true" name="MISRAC2012-Rule-11.8"/>
<check enabled="true" name="MISRAC2012-Rule-11.9"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-12">
<check enabled="false" name="MISRAC2012-Rule-12.1"/>
<check enabled="true" name="MISRAC2012-Rule-12.2"/>
<check enabled="false" name="MISRAC2012-Rule-12.3"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-13">
<check enabled="true" name="MISRAC2012-Rule-13.1"/>
<check enabled="true" name="MISRAC2012-Rule-13.2_a"/>
<check enabled="true" name="MISRAC2012-Rule-13.2_b"/>
<check enabled="true" name="MISRAC2012-Rule-13.2_c"/>
<check enabled="false" name="MISRAC2012-Rule-13.3"/>
<check enabled="false" name="MISRAC2012-Rule-13.4_a"/>
<check enabled="false" name="MISRAC2012-Rule-13.4_b"/>
<check enabled="true" name="MISRAC2012-Rule-13.5"/>
<check enabled="true" name="MISRAC2012-Rule-13.6"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-14">
<check enabled="true" name="MISRAC2012-Rule-14.1_a"/>
<check enabled="true" name="MISRAC2012-Rule-14.1_b"/>
<check enabled="true" name="MISRAC2012-Rule-14.2"/>
<check enabled="true" name="MISRAC2012-Rule-14.3_a"/>
<check enabled="true" name="MISRAC2012-Rule-14.3_b"/>
<check enabled="true" name="MISRAC2012-Rule-14.4_a"/>
<check enabled="true" name="MISRAC2012-Rule-14.4_b"/>
<check enabled="true" name="MISRAC2012-Rule-14.4_c"/>
<check enabled="true" name="MISRAC2012-Rule-14.4_d"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-15">
<check enabled="false" name="MISRAC2012-Rule-15.1"/>
<check enabled="true" name="MISRAC2012-Rule-15.2"/>
<check enabled="true" name="MISRAC2012-Rule-15.3"/>
<check enabled="false" name="MISRAC2012-Rule-15.4"/>
<check enabled="false" name="MISRAC2012-Rule-15.5"/>
<check enabled="true" name="MISRAC2012-Rule-15.6_a"/>
<check enabled="true" name="MISRAC2012-Rule-15.6_b"/>
<check enabled="true" name="MISRAC2012-Rule-15.6_c"/>
<check enabled="true" name="MISRAC2012-Rule-15.6_d"/>
<check enabled="true" name="MISRAC2012-Rule-15.6_e"/>
<check enabled="true" name="MISRAC2012-Rule-15.7"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-16">
<check enabled="true" name="MISRAC2012-Rule-16.1"/>
<check enabled="true" name="MISRAC2012-Rule-16.2"/>
<check enabled="true" name="MISRAC2012-Rule-16.3"/>
<check enabled="true" name="MISRAC2012-Rule-16.4"/>
<check enabled="true" name="MISRAC2012-Rule-16.5"/>
<check enabled="true" name="MISRAC2012-Rule-16.6"/>
<check enabled="true" name="MISRAC2012-Rule-16.7"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-17">
<check enabled="true" name="MISRAC2012-Rule-17.1"/>
<check enabled="true" name="MISRAC2012-Rule-17.2_a"/>
<check enabled="true" name="MISRAC2012-Rule-17.2_b"/>
<check enabled="true" name="MISRAC2012-Rule-17.3"/>
<check enabled="true" name="MISRAC2012-Rule-17.4"/>
<check enabled="false" name="MISRAC2012-Rule-17.5"/>
<check enabled="true" name="MISRAC2012-Rule-17.6"/>
<check enabled="true" name="MISRAC2012-Rule-17.7"/>
<check enabled="false" name="MISRAC2012-Rule-17.8"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-18">
<check enabled="true" name="MISRAC2012-Rule-18.1_a"/>
<check enabled="true" name="MISRAC2012-Rule-18.1_b"/>
<check enabled="true" name="MISRAC2012-Rule-18.1_c"/>
<check enabled="true" name="MISRAC2012-Rule-18.1_d"/>
<check enabled="true" name="MISRAC2012-Rule-18.2"/>
<check enabled="true" name="MISRAC2012-Rule-18.3"/>
<check enabled="true" name="MISRAC2012-Rule-18.4"/>
<check enabled="false" name="MISRAC2012-Rule-18.5"/>
<check enabled="true" name="MISRAC2012-Rule-18.6_a"/>
<check enabled="true" name="MISRAC2012-Rule-18.6_b"/>
<check enabled="true" name="MISRAC2012-Rule-18.6_c"/>
<check enabled="true" name="MISRAC2012-Rule-18.6_d"/>
<check enabled="true" name="MISRAC2012-Rule-18.7"/>
<check enabled="true" name="MISRAC2012-Rule-18.8"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-19">
<check enabled="true" name="MISRAC2012-Rule-19.1"/>
<check enabled="false" name="MISRAC2012-Rule-19.2"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-20">
<check enabled="false" name="MISRAC2012-Rule-20.1"/>
<check enabled="true" name="MISRAC2012-Rule-20.2"/>
<check enabled="true" name="MISRAC2012-Rule-20.4_c89"/>
<check enabled="true" name="MISRAC2012-Rule-20.4_c99"/>
<check enabled="false" name="MISRAC2012-Rule-20.5"/>
<check enabled="true" name="MISRAC2012-Rule-20.7"/>
<check enabled="false" name="MISRAC2012-Rule-20.10"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-21">
<check enabled="true" name="MISRAC2012-Rule-21.1"/>
<check enabled="true" name="MISRAC2012-Rule-21.2"/>
<check enabled="true" name="MISRAC2012-Rule-21.3"/>
<check enabled="true" name="MISRAC2012-Rule-21.4"/>
<check enabled="true" name="MISRAC2012-Rule-21.5"/>
<check enabled="true" name="MISRAC2012-Rule-21.6"/>
<check enabled="true" name="MISRAC2012-Rule-21.7"/>
<check enabled="true" name="MISRAC2012-Rule-21.8"/>
<check enabled="true" name="MISRAC2012-Rule-21.9"/>
<check enabled="true" name="MISRAC2012-Rule-21.10"/>
<check enabled="true" name="MISRAC2012-Rule-21.11"/>
<check enabled="false" name="MISRAC2012-Rule-21.12_a"/>
<check enabled="false" name="MISRAC2012-Rule-21.12_b"/>
</group>
<group enabled="true" name="MISRAC2012-Rule-22">
<check enabled="true" name="MISRAC2012-Rule-22.1_a"/>
<check enabled="true" name="MISRAC2012-Rule-22.1_b"/>
<check enabled="true" name="MISRAC2012-Rule-22.2_a"/>
<check enabled="true" name="MISRAC2012-Rule-22.2_b"/>
<check enabled="true" name="MISRAC2012-Rule-22.2_c"/>
<check enabled="true" name="MISRAC2012-Rule-22.3"/>
<check enabled="true" name="MISRAC2012-Rule-22.4"/>
<check enabled="true" name="MISRAC2012-Rule-22.5_a"/>
<check enabled="true" name="MISRAC2012-Rule-22.5_b"/>
<check enabled="true" name="MISRAC2012-Rule-22.6"/>
</group>
</package>
<package enabled="false" name="MISRAC++2008">
<group enabled="true" name="MISRAC++2008-0-1">
<check enabled="true" name="MISRAC++2008-0-1-1"/>
<check enabled="true" name="MISRAC++2008-0-1-2_a"/>
<check enabled="true" name="MISRAC++2008-0-1-2_b"/>
<check enabled="true" name="MISRAC++2008-0-1-2_c"/>
<check enabled="true" name="MISRAC++2008-0-1-3"/>
<check enabled="true" name="MISRAC++2008-0-1-4_a"/>
<check enabled="true" name="MISRAC++2008-0-1-4_b"/>
<check enabled="true" name="MISRAC++2008-0-1-6"/>
<check enabled="true" name="MISRAC++2008-0-1-7"/>
<check enabled="false" name="MISRAC++2008-0-1-8"/>
<check enabled="true" name="MISRAC++2008-0-1-9"/>
<check enabled="true" name="MISRAC++2008-0-1-11"/>
</group>
<group enabled="true" name="MISRAC++2008-0-2">
<check enabled="true" name="MISRAC++2008-0-2-1"/>
</group>
<group enabled="true" name="MISRAC++2008-0-3">
<check enabled="true" name="MISRAC++2008-0-3-2"/>
</group>
<group enabled="true" name="MISRAC++2008-2-7">
<check enabled="true" name="MISRAC++2008-2-7-1"/>
<check enabled="true" name="MISRAC++2008-2-7-2"/>
<check enabled="false" name="MISRAC++2008-2-7-3"/>
</group>
<group enabled="true" name="MISRAC++2008-2-10">
<check enabled="true" name="MISRAC++2008-2-10-1"/>
<check enabled="true" name="MISRAC++2008-2-10-2"/>
<check enabled="true" name="MISRAC++2008-2-10-3"/>
<check enabled="true" name="MISRAC++2008-2-10-4"/>
<check enabled="false" name="MISRAC++2008-2-10-5"/>
<check enabled="true" name="MISRAC++2008-2-10-6"/>
</group>
<group enabled="true" name="MISRAC++2008-2-13">
<check enabled="true" name="MISRAC++2008-2-13-2"/>
<check enabled="true" name="MISRAC++2008-2-13-3"/>
<check enabled="true" name="MISRAC++2008-2-13-4_a"/>
<check enabled="true" name="MISRAC++2008-2-13-4_b"/>
</group>
<group enabled="true" name="MISRAC++2008-3-1">
<check enabled="true" name="MISRAC++2008-3-1-1"/>
<check enabled="true" name="MISRAC++2008-3-1-3"/>
</group>
<group enabled="true" name="MISRAC++2008-3-9">
<check enabled="false" name="MISRAC++2008-3-9-2"/>
<check enabled="true" name="MISRAC++2008-3-9-3"/>
</group>
<group enabled="true" name="MISRAC++2008-4-5">
<check enabled="true" name="MISRAC++2008-4-5-1"/>
<check enabled="true" name="MISRAC++2008-4-5-2"/>
<check enabled="true" name="MISRAC++2008-4-5-3"/>
</group>
<group enabled="true" name="MISRAC++2008-5-0">
<check enabled="true" name="MISRAC++2008-5-0-1_a"/>
<check enabled="true" name="MISRAC++2008-5-0-1_b"/>
<check enabled="true" name="MISRAC++2008-5-0-1_c"/>
<check enabled="false" name="MISRAC++2008-5-0-2"/>
<check enabled="true" name="MISRAC++2008-5-0-3"/>
<check enabled="true" name="MISRAC++2008-5-0-4"/>
<check enabled="true" name="MISRAC++2008-5-0-5"/>
<check enabled="true" name="MISRAC++2008-5-0-6"/>
<check enabled="true" name="MISRAC++2008-5-0-7"/>
<check enabled="true" name="MISRAC++2008-5-0-8"/>
<check enabled="true" name="MISRAC++2008-5-0-9"/>
<check enabled="true" name="MISRAC++2008-5-0-10"/>
<check enabled="true" name="MISRAC++2008-5-0-13_a"/>
<check enabled="true" name="MISRAC++2008-5-0-13_b"/>
<check enabled="true" name="MISRAC++2008-5-0-13_c"/>
<check enabled="true" name="MISRAC++2008-5-0-13_d"/>
<check enabled="true" name="MISRAC++2008-5-0-14"/>
<check enabled="true" name="MISRAC++2008-5-0-15_a"/>
<check enabled="true" name="MISRAC++2008-5-0-15_b"/>
<check enabled="true" name="MISRAC++2008-5-0-16_a"/>
<check enabled="true" name="MISRAC++2008-5-0-16_b"/>
<check enabled="true" name="MISRAC++2008-5-0-16_c"/>
<check enabled="true" name="MISRAC++2008-5-0-16_d"/>
<check enabled="true" name="MISRAC++2008-5-0-16_e"/>
<check enabled="true" name="MISRAC++2008-5-0-16_f"/>
<check enabled="true" name="MISRAC++2008-5-0-19"/>
<check enabled="true" name="MISRAC++2008-5-0-21"/>
</group>
<group enabled="true" name="MISRAC++2008-5-2">
<check enabled="true" name="MISRAC++2008-5-2-4"/>
<check enabled="true" name="MISRAC++2008-5-2-5"/>
<check enabled="true" name="MISRAC++2008-5-2-6"/>
<check enabled="true" name="MISRAC++2008-5-2-7"/>
<check enabled="false" name="MISRAC++2008-5-2-9"/>
<check enabled="false" name="MISRAC++2008-5-2-10"/>
<check enabled="true" name="MISRAC++2008-5-2-11_a"/>
<check enabled="true" name="MISRAC++2008-5-2-11_b"/>
</group>
<group enabled="true" name="MISRAC++2008-5-3">
<check enabled="true" name="MISRAC++2008-5-3-1"/>
<check enabled="true" name="MISRAC++2008-5-3-2_a"/>
<check enabled="true" name="MISRAC++2008-5-3-2_b"/>
<check enabled="true" name="MISRAC++2008-5-3-3"/>
<check enabled="true" name="MISRAC++2008-5-3-4"/>
</group>
<group enabled="true" name="MISRAC++2008-5-8">
<check enabled="true" name="MISRAC++2008-5-8-1"/>
</group>
<group enabled="true" name="MISRAC++2008-5-14">
<check enabled="true" name="MISRAC++2008-5-14-1"/>
</group>
<group enabled="true" name="MISRAC++2008-5-18">
<check enabled="true" name="MISRAC++2008-5-18-1"/>
</group>
<group enabled="true" name="MISRAC++2008-5-19">
<check enabled="false" name="MISRAC++2008-5-19-1"/>
</group>
<group enabled="true" name="MISRAC++2008-6-2">
<check enabled="true" name="MISRAC++2008-6-2-1"/>
<check enabled="true" name="MISRAC++2008-6-2-2"/>
<check enabled="false" name="MISRAC++2008-6-2-3"/>
</group>
<group enabled="true" name="MISRAC++2008-6-3">
<check enabled="true" name="MISRAC++2008-6-3-1_a"/>
<check enabled="true" name="MISRAC++2008-6-3-1_b"/>
<check enabled="true" name="MISRAC++2008-6-3-1_c"/>
<check enabled="true" name="MISRAC++2008-6-3-1_d"/>
</group>
<group enabled="true" name="MISRAC++2008-6-4">
<check enabled="true" name="MISRAC++2008-6-4-1"/>
<check enabled="true" name="MISRAC++2008-6-4-2"/>
<check enabled="true" name="MISRAC++2008-6-4-3"/>
<check enabled="true" name="MISRAC++2008-6-4-4"/>
<check enabled="true" name="MISRAC++2008-6-4-5"/>
<check enabled="true" name="MISRAC++2008-6-4-6"/>
<check enabled="true" name="MISRAC++2008-6-4-7"/>
<check enabled="true" name="MISRAC++2008-6-4-8"/>
</group>
<group enabled="true" name="MISRAC++2008-6-5">
<check enabled="true" name="MISRAC++2008-6-5-1_a"/>
<check enabled="true" name="MISRAC++2008-6-5-2"/>
<check enabled="true" name="MISRAC++2008-6-5-3"/>
<check enabled="true" name="MISRAC++2008-6-5-4"/>
<check enabled="true" name="MISRAC++2008-6-5-6"/>
</group>
<group enabled="true" name="MISRAC++2008-6-6">
<check enabled="true" name="MISRAC++2008-6-6-1"/>
<check enabled="true" name="MISRAC++2008-6-6-2"/>
<check enabled="true" name="MISRAC++2008-6-6-4"/>
<check enabled="true" name="MISRAC++2008-6-6-5"/>
</group>
<group enabled="true" name="MISRAC++2008-7-1">
<check enabled="true" name="MISRAC++2008-7-1-1"/>
<check enabled="true" name="MISRAC++2008-7-1-2"/>
</group>
<group enabled="true" name="MISRAC++2008-7-2">
<check enabled="true" name="MISRAC++2008-7-2-1"/>
</group>
<group enabled="true" name="MISRAC++2008-7-4">
<check enabled="true" name="MISRAC++2008-7-4-3"/>
</group>
<group enabled="true" name="MISRAC++2008-7-5">
<check enabled="true" name="MISRAC++2008-7-5-1_a"/>
<check enabled="true" name="MISRAC++2008-7-5-1_b"/>
<check enabled="true" name="MISRAC++2008-7-5-2_a"/>
<check enabled="true" name="MISRAC++2008-7-5-2_b"/>
<check enabled="true" name="MISRAC++2008-7-5-2_c"/>
<check enabled="true" name="MISRAC++2008-7-5-2_d"/>
<check enabled="false" name="MISRAC++2008-7-5-4_a"/>
<check enabled="false" name="MISRAC++2008-7-5-4_b"/>
</group>
<group enabled="true" name="MISRAC++2008-8-0">
<check enabled="true" name="MISRAC++2008-8-0-1"/>
</group>
<group enabled="true" name="MISRAC++2008-8-4">
<check enabled="true" name="MISRAC++2008-8-4-1"/>
<check enabled="true" name="MISRAC++2008-8-4-3"/>
<check enabled="true" name="MISRAC++2008-8-4-4"/>
</group>
<group enabled="true" name="MISRAC++2008-8-5">
<check enabled="true" name="MISRAC++2008-8-5-1_a"/>
<check enabled="true" name="MISRAC++2008-8-5-1_b"/>
<check enabled="true" name="MISRAC++2008-8-5-1_c"/>
<check enabled="true" name="MISRAC++2008-8-5-2"/>
</group>
<group enabled="true" name="MISRAC++2008-9-3">
<check enabled="true" name="MISRAC++2008-9-3-1"/>
<check enabled="true" name="MISRAC++2008-9-3-2"/>
</group>
<group enabled="true" name="MISRAC++2008-9-5">
<check enabled="true" name="MISRAC++2008-9-5-1"/>
</group>
<group enabled="true" name="MISRAC++2008-9-6">
<check enabled="true" name="MISRAC++2008-9-6-2"/>
<check enabled="true" name="MISRAC++2008-9-6-3"/>
<check enabled="true" name="MISRAC++2008-9-6-4"/>
</group>
<group enabled="true" name="MISRAC++2008-12-1">
<check enabled="true" name="MISRAC++2008-12-1-1_a"/>
<check enabled="true" name="MISRAC++2008-12-1-1_b"/>
<check enabled="true" name="MISRAC++2008-12-1-3"/>
</group>
<group enabled="true" name="MISRAC++2008-15-0">
<check enabled="false" name="MISRAC++2008-15-0-2"/>
</group>
<group enabled="true" name="MISRAC++2008-15-1">
<check enabled="true" name="MISRAC++2008-15-1-2"/>
<check enabled="true" name="MISRAC++2008-15-1-3"/>
</group>
<group enabled="true" name="MISRAC++2008-15-3">
<check enabled="true" name="MISRAC++2008-15-3-1"/>
<check enabled="false" name="MISRAC++2008-15-3-2"/>
<check enabled="true" name="MISRAC++2008-15-3-3"/>
<check enabled="true" name="MISRAC++2008-15-3-4"/>
<check enabled="true" name="MISRAC++2008-15-3-5"/>
</group>
<group enabled="true" name="MISRAC++2008-15-5">
<check enabled="true" name="MISRAC++2008-15-5-1"/>
</group>
<group enabled="true" name="MISRAC++2008-16-0">
<check enabled="true" name="MISRAC++2008-16-0-3"/>
<check enabled="true" name="MISRAC++2008-16-0-4"/>
</group>
<group enabled="true" name="MISRAC++2008-16-2">
<check enabled="true" name="MISRAC++2008-16-2-2"/>
<check enabled="true" name="MISRAC++2008-16-2-3"/>
<check enabled="true" name="MISRAC++2008-16-2-4"/>
<check enabled="false" name="MISRAC++2008-16-2-5"/>
</group>
<group enabled="true" name="MISRAC++2008-16-3">
<check enabled="true" name="MISRAC++2008-16-3-1"/>
<check enabled="false" name="MISRAC++2008-16-3-2"/>
</group>
<group enabled="true" name="MISRAC++2008-17-0">
<check enabled="true" name="MISRAC++2008-17-0-1"/>
<check enabled="true" name="MISRAC++2008-17-0-3"/>
<check enabled="true" name="MISRAC++2008-17-0-5"/>
</group>
<group enabled="true" name="MISRAC++2008-18-0">
<check enabled="true" name="MISRAC++2008-18-0-1"/>
<check enabled="true" name="MISRAC++2008-18-0-2"/>
<check enabled="true" name="MISRAC++2008-18-0-3"/>
<check enabled="true" name="MISRAC++2008-18-0-4"/>
<check enabled="true" name="MISRAC++2008-18-0-5"/>
</group>
<group enabled="true" name="MISRAC++2008-18-2">
<check enabled="true" name="MISRAC++2008-18-2-1"/>
</group>
<group enabled="true" name="MISRAC++2008-18-4">
<check enabled="true" name="MISRAC++2008-18-4-1"/>
</group>
<group enabled="true" name="MISRAC++2008-18-7">
<check enabled="true" name="MISRAC++2008-18-7-1"/>
</group>
<group enabled="true" name="MISRAC++2008-19-3">
<check enabled="true" name="MISRAC++2008-19-3-1"/>
</group>
<group enabled="true" name="MISRAC++2008-27-0">
<check enabled="true" name="MISRAC++2008-27-0-1"/>
</group>
</package>
</checks_tree>
</cstat_settings>
</data>
</settings>
<settings>
<name>RuntimeChecking</name>
<archiveVersion>0</archiveVersion>
<data>
<version>2</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>GenRtcDebugHeap</name>
<state>0</state>
</option>
<option>
<name>GenRtcEnableBoundsChecking</name>
<state>0</state>
</option>
<option>
<name>GenRtcCheckPtrsNonInstrMem</name>
<state>1</state>
</option>
<option>
<name>GenRtcTrackPointerBounds</name>
<state>1</state>
</option>
<option>
<name>GenRtcCheckAccesses</name>
<state>1</state>
</option>
<option>
<name>GenRtcGenerateEntries</name>
<state>0</state>
</option>
<option>
<name>GenRtcNrTrackedPointers</name>
<state>1000</state>
</option>
<option>
<name>GenRtcIntOverflow</name>
<state>0</state>
</option>
<option>
<name>GenRtcIncUnsigned</name>
<state>0</state>
</option>
<option>
<name>GenRtcIntConversion</name>
<state>0</state>
</option>
<option>
<name>GenRtcInclExplicit</name>
<state>0</state>
</option>
<option>
<name>GenRtcIntShiftOverflow</name>
<state>0</state>
</option>
<option>
<name>GenRtcInclUnsignedShiftOverflow</name>
<state>0</state>
</option>
<option>
<name>GenRtcUnhandledCase</name>
<state>0</state>
</option>
<option>
<name>GenRtcDivByZero</name>
<state>0</state>
</option>
<option>
<name>GenRtcEnable</name>
<state>0</state>
</option>
<option>
<name>GenRtcCheckPtrsNonInstrFunc</name>
<state>1</state>
</option>
</data>
</settings>
</configuration>
<group>
<name>app</name>
<file>
<name>$PROJ_DIR$\..\app\src\app.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\app\src\app_task.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\app\src\fault_test.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\app\inc\rtconfig.h</name>
</file>
<file>
<name>$PROJ_DIR$\..\app\src\stm32f4xx_it.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\app\src\user_finsh_cmd.c</name>
</file>
</group>
<group>
<name>components</name>
<group>
<name>cm_backtrace</name>
<file>
<name>$PROJ_DIR$\..\..\..\..\..\cm_backtrace\cm_backtrace.c</name>
</file>
</group>
<group>
<name>others</name>
<file>
<name>$PROJ_DIR$\..\components\others\bsp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\components\others\utils.c</name>
</file>
</group>
<group>
<name>rtt_uart</name>
<file>
<name>$PROJ_DIR$\..\components\rtt_uart\usart.c</name>
</file>
</group>
</group>
<group>
<name>libs</name>
<group>
<name>cmsis</name>
<file>
<name>$PROJ_DIR$\..\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\iar\startup_stm32f40_41xxx.s</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\CMSIS\Device\ST\STM32F4xx\Source\Templates\system_stm32f4xx.c</name>
</file>
</group>
<group>
<name>std_periph_driver</name>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\misc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_adc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_can.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_crc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_aes.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_des.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_cryp_tdes.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dac.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dbgmcu.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dcmi.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_dma2d.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_exti.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_flash_ramfunc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_fsmc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_gpio.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_md5.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_hash_sha1.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_i2c.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_iwdg.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_ltdc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_pwr.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rcc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rng.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_rtc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sai.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_sdio.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_spi.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_syscfg.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_tim.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_usart.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Libraries\STM32F4xx_StdPeriph_Driver\src\stm32f4xx_wwdg.c</name>
</file>
</group>
</group>
<group>
<name>rt_thread_1.2.2</name>
<group>
<name>drivers</name>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\completion.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\dataqueue.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\pipe.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\portal.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\ringbuffer.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\serial\serial.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\drivers\src\wrokqueue.c</name>
</file>
</group>
<group>
<name>finsh</name>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\cmd.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_compiler.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_error.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_heap.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_init.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_node.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_ops.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_parser.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_token.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_var.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\finsh_vm.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\msh.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\msh_cmd.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\shell.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\components\finsh\symbol.c</name>
</file>
</group>
<group>
<name>kernel</name>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\clock.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\cpuusage.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\device.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\idle.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\ipc.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\irq.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\kservice.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\mem.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\memheap.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\mempool.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\module.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\object.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\scheduler.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\slab.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\thread.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\src\timer.c</name>
</file>
</group>
<group>
<name>libcpu</name>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\libcpu\arm\cortex-m4\context_iar.S</name>
</file>
<file>
<name>$PROJ_DIR$\..\RT-Thread-1.2.2\libcpu\arm\cortex-m4\cpuport.c</name>
</file>
</group>
</group>
</project>
| {
"pile_set_name": "Github"
} |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build go1.2
package language
import "sort"
var sortStable = sort.Stable
| {
"pile_set_name": "Github"
} |
package gw.internal.gosu.parser;
import gw.lang.reflect.java.JavaTypes;
import gw.test.TestClass;
public class JavaTypeExtensionsTest extends TestClass {
public void testSimpleExtension() {
IJavaTypeInternal extendedType = JavaTypeExtensions.newExtendedType(
TestTypeExtension.class, (IJavaTypeInternal) JavaTypes.STRING(), new TestTypeExtensionImpl());
TestTypeExtension type = (TestTypeExtension) extendedType;
assertEquals("42", type.intToString(42));
}
public void testExceptionsHandledCorrectly() {
IJavaTypeInternal extendedType = JavaTypeExtensions.newExtendedType(
TestTypeExtension.class, (IJavaTypeInternal) JavaTypes.STRING(), new TestTypeExtensionImpl());
TestTypeExtension type = (TestTypeExtension) extendedType;
try {
type.doThrow();
fail();
} catch (Exception e) {
assertEquals("bad", e.getMessage());
}
}
public void testToStringDelegatesToPrimaryObject() {
IJavaTypeInternal extendedType = JavaTypeExtensions.newExtendedType(
TestTypeExtension.class, (IJavaTypeInternal) JavaTypes.STRING(), new TestTypeExtensionImpl());
assertEquals(JavaTypes.STRING().toString(), extendedType.toString());
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JDK-8020463: Input argument array wrapping in loadWithNewGlobal is wrong
*
* @test
* @run
*/
loadWithNewGlobal({
name: "test",
script: "arguments[0]();"
}, func);
function func() {
try {
foo;
} catch (e) {
if (! (e instanceof ReferenceError)) {
fail("FAILED: expected ReferenceError!");
}
}
}
// identity
var result = loadWithNewGlobal({
name: "test2",
script: "arguments[0]"
}, this);
if (result !== this) {
fail("FAILED: expected global to be returned 'as is'");
}
| {
"pile_set_name": "Github"
} |
==================================
Contributing to LLVM
==================================
Thank you for your interest in contributing to LLVM! There are multiple ways to
contribute, and we appreciate all contributions. In case you
have questions, you can either use the `Developer's List (llvm-dev)`_
or the #llvm channel on `irc.oftc.net`_.
If you want to contribute code, please familiarize yourself with the :doc:`DeveloperPolicy`.
.. contents::
:local:
Ways to Contribute
==================
Bug Reports
-----------
If you are working with LLVM and run into a bug, we definitely want to know
about it. Please let us know and follow the instructions in
:doc:`HowToSubmitABug` to create a bug report.
Bug Fixes
---------
If you are interested in contributing code to LLVM, bugs labeled with the
`beginner keyword`_ in the `bug tracker`_ are a good way to get familiar with
the code base. If you are interested in fixing a bug, please create an account
for the bug tracker and assign it to yourself, to let people know you are working on
it.
Then try to reproduce and fix the bug with upstream LLVM. Start by building
LLVM from source as described in :doc:`GettingStarted` and
and use the built binaries to reproduce the failure described in the bug. Use
a debug build (`-DCMAKE_BUILD_TYPE=Debug`) or a build with assertions
(`-DLLVM_ENABLE_ASSERTIONS=On`, enabled for Debug builds).
Bigger Pieces of Work
---------------------
In case you are interested in taking on a bigger piece of work, a list of
interesting projects is maintained at the `LLVM's Open Projects page`_. In case
you are interested in working on any of these projects, please send a mail to
the `LLVM Developer's mailing list`_, so that we know the project is being
worked on.
How to Submit a Patch
=====================
Once you have a patch ready, it is time to submit it. The patch should:
* include a small unit test
* conform to the :doc:`CodingStandards`. You can use the `clang-format-diff.py`_ or `git-clang-format`_ tools to automatically format your patch properly.
* not contain any unrelated changes
* be an isolated change. Independent changes should be submitted as separate patches as this makes reviewing easier.
To get a patch accepted, it has to be reviewed by the LLVM community. This can
be done using `LLVM's Phabricator`_ or the llvm-commits mailing list.
Please follow :ref:`Phabricator#requesting-a-review-via-the-web-interface <phabricator-request-review-web>`
to request a review using Phabricator.
To make sure the right people see your patch, please select suitable reviewers
and add them to your patch when requesting a review. Suitable reviewers are the
code owner (see CODE_OWNERS.txt) and other people doing work in the area your
patch touches. If you are using Phabricator, add them to the `Reviewers` field
when creating a review and if you are using `llvm-commits`, add them to the CC of
your email.
A reviewer may request changes or ask questions during the review. If you are
uncertain on how to provide test cases, documentation, etc., feel free to ask
for guidance during the review. Please address the feedback and re-post an
updated version of your patch. This cycle continues until all requests and comments
have been addressed and a reviewer accepts the patch with a `Looks good to me` or `LGTM`.
Once that is done the change can be committed. If you do not have commit
access, please let people know during the review and someone should commit it
on your behalf.
If you have received no comments on your patch for a week, you can request a
review by 'ping'ing a patch by responding to the email thread containing the
patch, or the Phabricator review with "Ping." The common courtesy 'ping' rate
is once a week. Please remember that you are asking for valuable time from other
professional developers.
Helpful Information About LLVM
==============================
:doc:`LLVM's documentation <index>` provides a wealth of information about LLVM's internals as
well as various user guides. The pages listed below should provide a good overview
of LLVM's high-level design, as well as its internals:
:doc:`GettingStarted`
Discusses how to get up and running quickly with the LLVM infrastructure.
Everything from unpacking and compilation of the distribution to execution
of some tools.
:doc:`LangRef`
Defines the LLVM intermediate representation.
:doc:`ProgrammersManual`
Introduction to the general layout of the LLVM sourcebase, important classes
and APIs, and some tips & tricks.
:ref:`index-subsystem-docs`
A collection of pages documenting various subsystems of LLVM.
`LLVM for Grad Students`__
This is an introduction to the LLVM infrastructure by Adrian Sampson. While it
has been written for grad students, it provides a good, compact overview of
LLVM's architecture, LLVM's IR and how to write a new pass.
.. __: http://www.cs.cornell.edu/~asampson/blog/llvm.html
`Intro to LLVM`__
Book chapter providing a compiler hacker's introduction to LLVM.
.. __: http://www.aosabook.org/en/llvm.html
.. _Developer's List (llvm-dev): http://lists.llvm.org/mailman/listinfo/llvm-dev
.. _irc.oftc.net: irc://irc.oftc.net/llvm
.. _beginner keyword: https://bugs.llvm.org/buglist.cgi?bug_status=NEW&bug_status=REOPENED&keywords=beginner%2C%20&keywords_type=allwords&list_id=130748&query_format=advanced&resolution=---
.. _bug tracker: https://bugs.llvm.org
.. _clang-format-diff.py: https://reviews.llvm.org/source/clang/browse/cfe/trunk/tools/clang-format/clang-format-diff.py
.. _git-clang-format: https://reviews.llvm.org/source/clang/browse/cfe/trunk/tools/clang-format/git-clang-format
.. _LLVM's Phabricator: https://reviews.llvm.org/
.. _LLVM's Open Projects page: https://llvm.org/OpenProjects.html#what
.. _LLVM Developer's mailing list: http://lists.llvm.org/mailman/listinfo/llvm-dev
| {
"pile_set_name": "Github"
} |
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
QM DSP Library
Centre for Digital Music, Queen Mary, University of London.
This file copyright 2008-2009 Matthew Davies and QMUL.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. See the file
COPYING included with this distribution for more information.
*/
#ifndef QM_DSP_TEMPOTRACKV2_H
#define QM_DSP_TEMPOTRACKV2_H
#include <vector>
//!!! Question: how far is this actually sample rate dependent? I
// think it does produce plausible results for e.g. 48000 as well as
// 44100, but surely the fixed window sizes and comb filtering will
// make it prefer double or half time when run at e.g. 96000?
class TempoTrackV2
{
public:
/**
* Construct a tempo tracker that will operate on beat detection
* function data calculated from audio at the given sample rate
* with the given frame increment.
*
* Currently the sample rate and increment are used only for the
* conversion from beat frame location to bpm in the tempo array.
*/
TempoTrackV2(float sampleRate, int dfIncrement);
~TempoTrackV2();
// Returned beat periods are given in df increment units; inputtempo and tempi in bpm
void calculateBeatPeriod(const std::vector<double> &df,
std::vector<double> &beatPeriod,
std::vector<double> &tempi) {
calculateBeatPeriod(df, beatPeriod, tempi, 120.0, false);
}
// Returned beat periods are given in df increment units; inputtempo and tempi in bpm
// MEPD 28/11/12 Expose inputtempo and constraintempo parameters
// Note, if inputtempo = 120 and constraintempo = false, then functionality is as it was before
void calculateBeatPeriod(const std::vector<double> &df,
std::vector<double> &beatPeriod,
std::vector<double> &tempi,
double inputtempo, bool constraintempo);
// Returned beat positions are given in df increment units
void calculateBeats(const std::vector<double> &df,
const std::vector<double> &beatPeriod,
std::vector<double> &beats) {
calculateBeats(df, beatPeriod, beats, 0.9, 4.0);
}
// Returned beat positions are given in df increment units
// MEPD 28/11/12 Expose alpha and tightness parameters
// Note, if alpha = 0.9 and tightness = 4, then functionality is as it was before
void calculateBeats(const std::vector<double> &df,
const std::vector<double> &beatPeriod,
std::vector<double> &beats,
double alpha, double tightness);
private:
typedef std::vector<int> i_vec_t;
typedef std::vector<std::vector<int> > i_mat_t;
typedef std::vector<double> d_vec_t;
typedef std::vector<std::vector<double> > d_mat_t;
float m_rate;
int m_increment;
void adapt_thresh(d_vec_t &df);
double mean_array(const d_vec_t &dfin, int start, int end);
void filter_df(d_vec_t &df);
void get_rcf(const d_vec_t &dfframe, const d_vec_t &wv, d_vec_t &rcf);
void viterbi_decode(const d_mat_t &rcfmat, const d_vec_t &wv,
d_vec_t &bp, d_vec_t &tempi);
double get_max_val(const d_vec_t &df);
int get_max_ind(const d_vec_t &df);
void normalise_vec(d_vec_t &df);
};
#endif
| {
"pile_set_name": "Github"
} |
package org.eternity.theater.step03;
import java.time.LocalDateTime;
public class Invitation {
private LocalDateTime when;
}
| {
"pile_set_name": "Github"
} |
<http://example.org/res1> <http://example.org/prop1> "000000"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/res2> <http://example.org/prop2> "0"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/res3> <http://example.org/prop3> "000001"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/res4> <http://example.org/prop4> "2"^^<http://www.w3.org/2001/XMLSchema#integer> .
<http://example.org/res5> <http://example.org/prop5> "4"^^<http://www.w3.org/2001/XMLSchema#integer> .
| {
"pile_set_name": "Github"
} |
<?php
namespace Faker\Test\Provider;
use Faker\Generator;
use Faker\Provider\Company;
use Faker\Provider\Internet;
use Faker\Provider\Lorem;
use Faker\Provider\Person;
class InternetTest extends \PHPUnit_Framework_TestCase
{
/**
* @var Generator
*/
private $faker;
public function setUp()
{
$faker = new Generator();
$faker->addProvider(new Lorem($faker));
$faker->addProvider(new Person($faker));
$faker->addProvider(new Internet($faker));
$faker->addProvider(new Company($faker));
$this->faker = $faker;
}
public function localeDataProvider()
{
$providerPath = realpath(__DIR__ . '/../../../src/Faker/Provider');
$localePaths = array_filter(glob($providerPath . '/*', GLOB_ONLYDIR));
foreach ($localePaths as $path) {
$parts = explode('/', $path);
$locales[] = array($parts[count($parts) - 1]);
}
return $locales;
}
/**
* @link http://stackoverflow.com/questions/12026842/how-to-validate-an-email-address-in-php
*
* @requires PHP 5.4
* @dataProvider localeDataProvider
*/
public function testEmailIsValid($locale)
{
$this->loadLocalProviders($locale);
$pattern = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-+[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-+[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';
$emailAddress = $this->faker->email();
$this->assertRegExp($pattern, $emailAddress);
}
/**
* @requires PHP 5.4
* @dataProvider localeDataProvider
*/
public function testUsernameIsValid($locale)
{
$this->loadLocalProviders($locale);
$pattern = '/^[A-Za-z0-9._]+$/';
$username = $this->faker->username();
$this->assertRegExp($pattern, $username);
}
public function loadLocalProviders($locale)
{
$providerPath = realpath(__DIR__ . '/../../../src/Faker/Provider');
if (file_exists($providerPath.'/'.$locale.'/Internet.php')) {
$internet = "\\Faker\\Provider\\$locale\\Internet";
$this->faker->addProvider(new $internet($this->faker));
}
if (file_exists($providerPath.'/'.$locale.'/Person.php')) {
$person = "\\Faker\\Provider\\$locale\\Person";
$this->faker->addProvider(new $person($this->faker));
}
if (file_exists($providerPath.'/'.$locale.'/Company.php')) {
$company = "\\Faker\\Provider\\$locale\\Company";
$this->faker->addProvider(new $company($this->faker));
}
}
public function testPasswordIsValid()
{
$this->assertRegexp('/^.{6}$/', $this->faker->password(6, 6));
}
public function testSlugIsValid()
{
$pattern = '/^[a-z0-9-]+$/';
$slug = $this->faker->slug();
$this->assertSame(preg_match($pattern, $slug), 1);
}
public function testUrlIsValid()
{
$url = $this->faker->url();
$this->assertNotFalse(filter_var($url, FILTER_VALIDATE_URL));
}
public function testLocalIpv4()
{
$this->assertNotFalse(filter_var(Internet::localIpv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
}
public function testIpv4()
{
$this->assertNotFalse(filter_var($this->faker->ipv4(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4));
}
public function testIpv4NotLocalNetwork()
{
$this->assertNotRegExp('/\A1\./', $this->faker->ipv4());
}
public function testIpv4NotBroadcast()
{
$this->assertNotEquals('255.255.255.255', $this->faker->ipv4());
}
public function testIpv6()
{
$this->assertNotFalse(filter_var($this->faker->ipv6(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6));
}
public function testMacAddress()
{
$this->assertRegExp('/^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$/i', Internet::macAddress());
}
}
| {
"pile_set_name": "Github"
} |
--
-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
-- under one or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information regarding copyright
-- ownership. Camunda licenses this file to you under the Apache License,
-- Version 2.0; you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
-- https://app.camunda.com/jira/browse/CAM-9435
create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_);
| {
"pile_set_name": "Github"
} |
ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var DocCommentHighlightRules = function() {
this.$rules = {
"start" : [ {
token : "comment.doc.tag",
regex : "@[\\w\\d_]+" // TODO: fix email addresses
},
DocCommentHighlightRules.getTagRule(),
{
defaultToken : "comment.doc",
caseInsensitive: true
}]
};
};
oop.inherits(DocCommentHighlightRules, TextHighlightRules);
DocCommentHighlightRules.getTagRule = function(start) {
return {
token : "comment.doc.tag.storage.type",
regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
};
};
DocCommentHighlightRules.getStartRule = function(start) {
return {
token : "comment.doc", // doc comment
regex : "\\/\\*(?=\\*)",
next : start
};
};
DocCommentHighlightRules.getEndRule = function (start) {
return {
token : "comment.doc", // closing comment
regex : "\\*\\/",
next : start
};
};
exports.DocCommentHighlightRules = DocCommentHighlightRules;
});
ace.define("ace/mode/asl_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var ASLHighlightRules = function() {
var keywords = (
"Default|DefinitionBlock|Device|Method|Else|ElseIf|For|Function|If|Include|Method|Return|" +
"Scope|Switch|Case|While|Break|BreakPoint|Continue|NoOp|Wait"
);
var keywordOperators = (
"Add|And|Decrement|Divide|Increment|Index|LAnd|LEqual|LGreater|LGreaterEqual|" +
"LLess|LLessEqual|LNot|LNotEqual|LOr|Mod|Multiply|NAnd|NOr|Not|Or|RefOf|Revision|" +
"ShiftLeft|ShiftRight|Subtract|XOr|DerefOf"
);
var buildinFunctions = (
"AccessAs|Acquire|Alias|BankField|Buffer|Concatenate|ConcatenateResTemplate|" +
"CondRefOf|Connection|CopyObject|CreateBitField|CreateByteField|CreateDWordField|" +
"CreateField|CreateQWordField|CreateWordField|DataTableRegion|Debug|" +
"DMA|DWordIO|DWordMemory|DWordSpace|EisaId|EISAID|EndDependentFn|Event|ExtendedIO|" +
"ExtendedMemory|ExtendedSpace|External|Fatal|Field|FindSetLeftBit|FindSetRightBit|" +
"FixedDMA|FixedIO|Fprintf|FromBCD|GpioInt|GpioIo|I2CSerialBusV2|IndexField|" +
"Interrupt|IO|IRQ|IRQNoFlags|Load|LoadTable|Match|Memory32|Memory32Fixed|" +
"Mid|Mutex|Name|Notify|Offset|ObjectType|OperationRegion|Package|PowerResource|Printf|" +
"QWordIO|QWordMemory|QWordSpace|RawDataBuffer|Register|Release|Reset|ResourceTemplate|" +
"Signal|SizeOf|Sleep|SPISerialBusV2|Stall|StartDependentFn|StartDependentFnNoPri|" +
"Store|ThermalZone|Timer|ToBCD|ToBuffer|ToDecimalString|ToInteger|ToPLD|ToString|" +
"ToUUID|UARTSerialBusV2|Unicode|Unload|VendorLong|VendorShort|WordBusNumber|WordIO|" +
"WordSpace"
);
var flags = (
"AttribQuick|AttribSendReceive|AttribByte|AttribBytes|AttribRawBytes|" +
"AttribRawProcessBytes|AttribWord|AttribBlock|AttribProcessCall|AttribBlockProcessCall|" +
"AnyAcc|ByteAcc|WordAcc|DWordAcc|QWordAcc|BufferAcc|" +
"AddressRangeMemory|AddressRangeReserved|AddressRangeNVS|AddressRangeACPI|" +
"RegionSpaceKeyword|FFixedHW|PCC|" +
"AddressingMode7Bit|AddressingMode10Bit|" +
"DataBitsFive|DataBitsSix|DataBitsSeven|DataBitsEight|DataBitsNine|" +
"BusMaster|NotBusMaster|" +
"ClockPhaseFirst|ClockPhaseSecond|ClockPolarityLow|ClockPolarityHigh|" +
"SubDecode|PosDecode|" +
"BigEndianing|LittleEndian|" +
"FlowControlNone|FlowControlXon|FlowControlHardware|" +
"Edge|Level|ActiveHigh|ActiveLow|ActiveBoth|Decode16|Decode10|" +
"IoRestrictionNone|IoRestrictionInputOnly|IoRestrictionOutputOnly|" +
"IoRestrictionNoneAndPreserve|Lock|NoLock|MTR|MEQ|MLE|MLT|MGE|MGT|" +
"MaxFixed|MaxNotFixed|Cacheable|WriteCombining|Prefetchable|NonCacheable|" +
"MinFixed|MinNotFixed|" +
"ParityTypeNone|ParityTypeSpace|ParityTypeMark|ParityTypeOdd|ParityTypeEven|" +
"PullDefault|PullUp|PullDown|PullNone|PolarityHigh|PolarityLow|" +
"ISAOnlyRanges|NonISAOnlyRanges|EntireRange|ReadWrite|ReadOnly|" +
"UserDefRegionSpace|SystemIO|SystemMemory|PCI_Config|EmbeddedControl|" +
"SMBus|SystemCMOS|PciBarTarget|IPMI|GeneralPurposeIO|GenericSerialBus|" +
"ResourceConsumer|ResourceProducer|Serialized|NotSerialized|" +
"Shared|Exclusive|SharedAndWake|ExclusiveAndWake|ControllerInitiated|DeviceInitiated|" +
"StopBitsZero|StopBitsOne|StopBitsOnePlusHalf|StopBitsTwo|" +
"Width8Bit|Width16Bit|Width32Bit|Width64Bit|Width128Bit|Width256Bit|" +
"SparseTranslation|DenseTranslation|TypeTranslation|TypeStatic|" +
"Preserve|WriteAsOnes|WriteAsZeros|Transfer8|Transfer16|Transfer8_16|" +
"ThreeWireMode|FourWireMode"
);
var storageTypes = (
"UnknownObj|IntObj|StrObj|BuffObj|PkgObj|FieldUnitObj|DeviceObj|" +
"EventObj|MethodObj|MutexObj|OpRegionObj|PowerResObj|ProcessorObj|" +
"ThermalZoneObj|BuffFieldObj|DDBHandleObj"
);
var buildinConstants = (
"__FILE__|__PATH__|__LINE__|__DATE__|__IASL__"
);
var deprecated = (
"Memory24|Processor"
);
var keywordMapper = this.createKeywordMapper({
"keyword": keywords,
"keyword.operator": keywordOperators,
"function.buildin": buildinFunctions,
"constant.language": buildinConstants,
"storage.type": storageTypes,
"constant.character": flags,
"invalid.deprecated": deprecated
}, "identifier");
this.$rules = {
"start" : [
{
token : "comment",
regex : "\\/\\/.*$"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // multi line comment
regex : "\\/\\*",
next : "comment"
},
DocCommentHighlightRules.getStartRule("doc-start"),
{
token : "comment", // ignored fields / comments
regex : "\\\[",
next : "ignoredfield"
}, {
token : "variable",
regex : "\\Local[0-7]|\\Arg[0-6]"
}, {
token : "keyword", // pre-compiler directives
regex : "#\\s*(?:define|elif|else|endif|error|if|ifdef|ifndef|include|includebuffer|line|pragma|undef|warning)\\b",
next : "directive"
}, {
token : "string", // single line
regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
}, {
token : "constant.character", // single line
regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
}, {
token : "constant.numeric", // hex
regex : /0[xX][0-9a-fA-F]+\b/
}, {
token : "constant.numeric",
regex : /(One(s)?|Zero|True|False|[0-9]+)\b/
}, {
token : keywordMapper,
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
}, {
token : "keyword.operator",
regex : "/|!|\\$|%|&|\\||\\*|\\-\\-|\\-|\\+\\+|\\+|~|==|=|!=|\\^|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\|="
}, {
token : "lparen",
regex : "[[({]"
}, {
token : "rparen",
regex : "[\\])}]"
}, {
token : "text",
regex : "\\s+"
}
],
"comment" : [
{
token : "comment", // closing comment
regex : "\\*\\/",
next : "start"
}, {
defaultToken : "comment"
}
],
"ignoredfield" : [
{
token : "comment", // closing ignored fields / comments
regex : "\\\]",
next : "start"
}, {
defaultToken : "comment"
}
],
"directive" : [
{
token : "constant.other.multiline",
regex : /\\/
},
{
token : "constant.other.multiline",
regex : /.*\\/
},
{
token : "constant.other",
regex : "\\s*<.+?>*s",
next : "start"
},
{
token : "constant.other", // single line
regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]*s',
next : "start"
},
{
token : "constant.other", // single line
regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
next : "start"
},
{
token : "constant.other",
regex : /[^\\\/]+/,
next : "start"
}
]
};
this.embedRules(DocCommentHighlightRules, "doc-",
[ DocCommentHighlightRules.getEndRule("start") ]);
};
oop.inherits(ASLHighlightRules, TextHighlightRules);
exports.ASLHighlightRules = ASLHighlightRules;
});
ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(commentRegex) {
if (commentRegex) {
this.foldingStartMarker = new RegExp(
this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
);
this.foldingStopMarker = new RegExp(
this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
);
}
};
oop.inherits(FoldMode, BaseFoldMode);
(function() {
this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
this._getFoldWidgetBase = this.getFoldWidget;
this.getFoldWidget = function(session, foldStyle, row) {
var line = session.getLine(row);
if (this.singleLineBlockCommentRe.test(line)) {
if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
return "";
}
var fw = this._getFoldWidgetBase(session, foldStyle, row);
if (!fw && this.startRegionRe.test(line))
return "start"; // lineCommentRegionStart
return fw;
};
this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
var line = session.getLine(row);
if (this.startRegionRe.test(line))
return this.getCommentRegionBlock(session, line, row);
var match = line.match(this.foldingStartMarker);
if (match) {
var i = match.index;
if (match[1])
return this.openingBracketBlock(session, match[1], row, i);
var range = session.getCommentFoldRange(row, i + match[0].length, 1);
if (range && !range.isMultiLine()) {
if (forceMultiline) {
range = this.getSectionRange(session, row);
} else if (foldStyle != "all")
range = null;
}
return range;
}
if (foldStyle === "markbegin")
return;
var match = line.match(this.foldingStopMarker);
if (match) {
var i = match.index + match[0].length;
if (match[1])
return this.closingBracketBlock(session, match[1], row, i);
return session.getCommentFoldRange(row, i, -1);
}
};
this.getSectionRange = function(session, row) {
var line = session.getLine(row);
var startIndent = line.search(/\S/);
var startRow = row;
var startColumn = line.length;
row = row + 1;
var endRow = row;
var maxRow = session.getLength();
while (++row < maxRow) {
line = session.getLine(row);
var indent = line.search(/\S/);
if (indent === -1)
continue;
if (startIndent > indent)
break;
var subRange = this.getFoldWidgetRange(session, "all", row);
if (subRange) {
if (subRange.start.row <= startRow) {
break;
} else if (subRange.isMultiLine()) {
row = subRange.end.row;
} else if (startIndent == indent) {
break;
}
}
endRow = row;
}
return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
};
this.getCommentRegionBlock = function(session, line, row) {
var startColumn = line.search(/\s*$/);
var maxRow = session.getLength();
var startRow = row;
var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
var depth = 1;
while (++row < maxRow) {
line = session.getLine(row);
var m = re.exec(line);
if (!m) continue;
if (m[1]) depth--;
else depth++;
if (!depth) break;
}
var endRow = row;
if (endRow > startRow) {
return new Range(startRow, startColumn, endRow, line.length);
}
};
}).call(FoldMode.prototype);
});
ace.define("ace/mode/asl",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/asl_highlight_rules","ace/mode/folding/cstyle"], function (require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var ASLHighlightRules = require("./asl_highlight_rules").ASLHighlightRules;
var FoldMode = require("./folding/cstyle").FoldMode;
var Mode = function () {
this.HighlightRules = ASLHighlightRules;
this.foldingRules = new FoldMode();
this.$behaviour = this.$defaultBehaviour;
};
oop.inherits(Mode, TextMode);
(function () {
this.$id = "ace/mode/asl";
}).call(Mode.prototype);
exports.Mode = Mode;
});
(function() {
ace.require(["ace/mode/asl"], function(m) {
if (typeof module == "object" && typeof exports == "object" && module) {
module.exports = m;
}
});
})();
| {
"pile_set_name": "Github"
} |
// mkerrors.sh -Wall -Werror -static -I/tmp/include -m32
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build 386,linux
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
package unix
import "syscall"
const (
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
AF_ATMPVC = 0x8
AF_ATMSVC = 0x14
AF_AX25 = 0x3
AF_BLUETOOTH = 0x1f
AF_BRIDGE = 0x7
AF_CAIF = 0x25
AF_CAN = 0x1d
AF_DECnet = 0xc
AF_ECONET = 0x13
AF_FILE = 0x1
AF_IB = 0x1b
AF_IEEE802154 = 0x24
AF_INET = 0x2
AF_INET6 = 0xa
AF_IPX = 0x4
AF_IRDA = 0x17
AF_ISDN = 0x22
AF_IUCV = 0x20
AF_KCM = 0x29
AF_KEY = 0xf
AF_LLC = 0x1a
AF_LOCAL = 0x1
AF_MAX = 0x2c
AF_MPLS = 0x1c
AF_NETBEUI = 0xd
AF_NETLINK = 0x10
AF_NETROM = 0x6
AF_NFC = 0x27
AF_PACKET = 0x11
AF_PHONET = 0x23
AF_PPPOX = 0x18
AF_QIPCRTR = 0x2a
AF_RDS = 0x15
AF_ROSE = 0xb
AF_ROUTE = 0x10
AF_RXRPC = 0x21
AF_SECURITY = 0xe
AF_SMC = 0x2b
AF_SNA = 0x16
AF_TIPC = 0x1e
AF_UNIX = 0x1
AF_UNSPEC = 0x0
AF_VSOCK = 0x28
AF_WANPIPE = 0x19
AF_X25 = 0x9
ALG_OP_DECRYPT = 0x0
ALG_OP_ENCRYPT = 0x1
ALG_SET_AEAD_ASSOCLEN = 0x4
ALG_SET_AEAD_AUTHSIZE = 0x5
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
ARPHRD_ARCNET = 0x7
ARPHRD_ASH = 0x30d
ARPHRD_ATM = 0x13
ARPHRD_AX25 = 0x3
ARPHRD_BIF = 0x307
ARPHRD_CAIF = 0x336
ARPHRD_CAN = 0x118
ARPHRD_CHAOS = 0x5
ARPHRD_CISCO = 0x201
ARPHRD_CSLIP = 0x101
ARPHRD_CSLIP6 = 0x103
ARPHRD_DDCMP = 0x205
ARPHRD_DLCI = 0xf
ARPHRD_ECONET = 0x30e
ARPHRD_EETHER = 0x2
ARPHRD_ETHER = 0x1
ARPHRD_EUI64 = 0x1b
ARPHRD_FCAL = 0x311
ARPHRD_FCFABRIC = 0x313
ARPHRD_FCPL = 0x312
ARPHRD_FCPP = 0x310
ARPHRD_FDDI = 0x306
ARPHRD_FRAD = 0x302
ARPHRD_HDLC = 0x201
ARPHRD_HIPPI = 0x30c
ARPHRD_HWX25 = 0x110
ARPHRD_IEEE1394 = 0x18
ARPHRD_IEEE802 = 0x6
ARPHRD_IEEE80211 = 0x321
ARPHRD_IEEE80211_PRISM = 0x322
ARPHRD_IEEE80211_RADIOTAP = 0x323
ARPHRD_IEEE802154 = 0x324
ARPHRD_IEEE802154_MONITOR = 0x325
ARPHRD_IEEE802_TR = 0x320
ARPHRD_INFINIBAND = 0x20
ARPHRD_IP6GRE = 0x337
ARPHRD_IPDDP = 0x309
ARPHRD_IPGRE = 0x30a
ARPHRD_IRDA = 0x30f
ARPHRD_LAPB = 0x204
ARPHRD_LOCALTLK = 0x305
ARPHRD_LOOPBACK = 0x304
ARPHRD_METRICOM = 0x17
ARPHRD_NETLINK = 0x338
ARPHRD_NETROM = 0x0
ARPHRD_NONE = 0xfffe
ARPHRD_PHONET = 0x334
ARPHRD_PHONET_PIPE = 0x335
ARPHRD_PIMREG = 0x30b
ARPHRD_PPP = 0x200
ARPHRD_PRONET = 0x4
ARPHRD_RAWHDLC = 0x206
ARPHRD_ROSE = 0x10e
ARPHRD_RSRVD = 0x104
ARPHRD_SIT = 0x308
ARPHRD_SKIP = 0x303
ARPHRD_SLIP = 0x100
ARPHRD_SLIP6 = 0x102
ARPHRD_TUNNEL = 0x300
ARPHRD_TUNNEL6 = 0x301
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
B115200 = 0x1002
B1152000 = 0x1009
B1200 = 0x9
B134 = 0x4
B150 = 0x5
B1500000 = 0x100a
B1800 = 0xa
B19200 = 0xe
B200 = 0x6
B2000000 = 0x100b
B230400 = 0x1003
B2400 = 0xb
B2500000 = 0x100c
B300 = 0x7
B3000000 = 0x100d
B3500000 = 0x100e
B38400 = 0xf
B4000000 = 0x100f
B460800 = 0x1004
B4800 = 0xc
B50 = 0x1
B500000 = 0x1005
B57600 = 0x1001
B576000 = 0x1006
B600 = 0x8
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
BLKBSZGET = 0x80041270
BLKBSZSET = 0x40041271
BLKFLSBUF = 0x1261
BLKFRAGET = 0x1265
BLKFRASET = 0x1264
BLKGETSIZE = 0x1260
BLKGETSIZE64 = 0x80041272
BLKPBSZGET = 0x127b
BLKRAGET = 0x1263
BLKRASET = 0x1262
BLKROGET = 0x125e
BLKROSET = 0x125d
BLKRRPART = 0x125f
BLKSECTGET = 0x1267
BLKSECTSET = 0x1266
BLKSSZGET = 0x1268
BOTHER = 0x1000
BPF_A = 0x10
BPF_ABS = 0x20
BPF_ADD = 0x0
BPF_ALU = 0x4
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0x0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
BPF_JMP = 0x5
BPF_JSET = 0x40
BPF_K = 0x0
BPF_LD = 0x0
BPF_LDX = 0x1
BPF_LEN = 0x80
BPF_LL_OFF = -0x200000
BPF_LSH = 0x60
BPF_MAJOR_VERSION = 0x1
BPF_MAXINSNS = 0x1000
BPF_MEM = 0x60
BPF_MEMWORDS = 0x10
BPF_MINOR_VERSION = 0x1
BPF_MISC = 0x7
BPF_MOD = 0x90
BPF_MSH = 0xa0
BPF_MUL = 0x20
BPF_NEG = 0x80
BPF_NET_OFF = -0x100000
BPF_OR = 0x40
BPF_RET = 0x6
BPF_RSH = 0x70
BPF_ST = 0x2
BPF_STX = 0x3
BPF_SUB = 0x10
BPF_TAX = 0x0
BPF_TXA = 0x80
BPF_W = 0x0
BPF_X = 0x8
BPF_XOR = 0xa0
BRKINT = 0x2
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
CAN_EFF_MASK = 0x1fffffff
CAN_ERR_FLAG = 0x20000000
CAN_ERR_MASK = 0x1fffffff
CAN_INV_FILTER = 0x20000000
CAN_ISOTP = 0x6
CAN_MAX_DLC = 0x8
CAN_MAX_DLEN = 0x8
CAN_MCNET = 0x5
CAN_MTU = 0x10
CAN_NPROTO = 0x7
CAN_RAW = 0x1
CAN_RAW_FILTER_MAX = 0x200
CAN_RTR_FLAG = 0x40000000
CAN_SFF_ID_BITS = 0xb
CAN_SFF_MASK = 0x7ff
CAN_TP16 = 0x3
CAN_TP20 = 0x4
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
CLOCK_BOOTTIME_ALARM = 0x9
CLOCK_DEFAULT = 0x0
CLOCK_EXT = 0x1
CLOCK_INT = 0x2
CLOCK_MONOTONIC = 0x1
CLOCK_MONOTONIC_COARSE = 0x6
CLOCK_MONOTONIC_RAW = 0x4
CLOCK_PROCESS_CPUTIME_ID = 0x2
CLOCK_REALTIME = 0x0
CLOCK_REALTIME_ALARM = 0x8
CLOCK_REALTIME_COARSE = 0x5
CLOCK_TAI = 0xb
CLOCK_THREAD_CPUTIME_ID = 0x3
CLOCK_TXFROMRX = 0x4
CLOCK_TXINT = 0x3
CLONE_CHILD_CLEARTID = 0x200000
CLONE_CHILD_SETTID = 0x1000000
CLONE_DETACHED = 0x400000
CLONE_FILES = 0x400
CLONE_FS = 0x200
CLONE_IO = 0x80000000
CLONE_NEWCGROUP = 0x2000000
CLONE_NEWIPC = 0x8000000
CLONE_NEWNET = 0x40000000
CLONE_NEWNS = 0x20000
CLONE_NEWPID = 0x20000000
CLONE_NEWUSER = 0x10000000
CLONE_NEWUTS = 0x4000000
CLONE_PARENT = 0x8000
CLONE_PARENT_SETTID = 0x100000
CLONE_PTRACE = 0x2000
CLONE_SETTLS = 0x80000
CLONE_SIGHAND = 0x800
CLONE_SYSVSEM = 0x40000
CLONE_THREAD = 0x10000
CLONE_UNTRACED = 0x800000
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
CS5 = 0x0
CS6 = 0x10
CS7 = 0x20
CS8 = 0x30
CSIGNAL = 0xff
CSIZE = 0x30
CSTART = 0x11
CSTATUS = 0x0
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
DT_FIFO = 0x1
DT_LNK = 0xa
DT_REG = 0x8
DT_SOCK = 0xc
DT_UNKNOWN = 0x0
DT_WHT = 0xe
ECHO = 0x8
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
ENCODING_MANCHESTER = 0x5
ENCODING_NRZ = 0x1
ENCODING_NRZI = 0x2
EPOLLERR = 0x8
EPOLLET = 0x80000000
EPOLLEXCLUSIVE = 0x10000000
EPOLLHUP = 0x10
EPOLLIN = 0x1
EPOLLMSG = 0x400
EPOLLONESHOT = 0x40000000
EPOLLOUT = 0x4
EPOLLPRI = 0x2
EPOLLRDBAND = 0x80
EPOLLRDHUP = 0x2000
EPOLLRDNORM = 0x40
EPOLLWAKEUP = 0x20000000
EPOLLWRBAND = 0x200
EPOLLWRNORM = 0x100
EPOLL_CLOEXEC = 0x80000
EPOLL_CTL_ADD = 0x1
EPOLL_CTL_DEL = 0x2
EPOLL_CTL_MOD = 0x3
ETH_P_1588 = 0x88f7
ETH_P_8021AD = 0x88a8
ETH_P_8021AH = 0x88e7
ETH_P_8021Q = 0x8100
ETH_P_80221 = 0x8917
ETH_P_802_2 = 0x4
ETH_P_802_3 = 0x1
ETH_P_802_3_MIN = 0x600
ETH_P_802_EX1 = 0x88b5
ETH_P_AARP = 0x80f3
ETH_P_AF_IUCV = 0xfbfb
ETH_P_ALL = 0x3
ETH_P_AOE = 0x88a2
ETH_P_ARCNET = 0x1a
ETH_P_ARP = 0x806
ETH_P_ATALK = 0x809b
ETH_P_ATMFATE = 0x8884
ETH_P_ATMMPOA = 0x884c
ETH_P_AX25 = 0x2
ETH_P_BATMAN = 0x4305
ETH_P_BPQ = 0x8ff
ETH_P_CAIF = 0xf7
ETH_P_CAN = 0xc
ETH_P_CANFD = 0xd
ETH_P_CONTROL = 0x16
ETH_P_CUST = 0x6006
ETH_P_DDCMP = 0x6
ETH_P_DEC = 0x6000
ETH_P_DIAG = 0x6005
ETH_P_DNA_DL = 0x6001
ETH_P_DNA_RC = 0x6002
ETH_P_DNA_RT = 0x6003
ETH_P_DSA = 0x1b
ETH_P_ECONET = 0x18
ETH_P_EDSA = 0xdada
ETH_P_FCOE = 0x8906
ETH_P_FIP = 0x8914
ETH_P_HDLC = 0x19
ETH_P_HSR = 0x892f
ETH_P_IBOE = 0x8915
ETH_P_IEEE802154 = 0xf6
ETH_P_IEEEPUP = 0xa00
ETH_P_IEEEPUPAT = 0xa01
ETH_P_IP = 0x800
ETH_P_IPV6 = 0x86dd
ETH_P_IPX = 0x8137
ETH_P_IRDA = 0x17
ETH_P_LAT = 0x6004
ETH_P_LINK_CTL = 0x886c
ETH_P_LOCALTALK = 0x9
ETH_P_LOOP = 0x60
ETH_P_LOOPBACK = 0x9000
ETH_P_MACSEC = 0x88e5
ETH_P_MOBITEX = 0x15
ETH_P_MPLS_MC = 0x8848
ETH_P_MPLS_UC = 0x8847
ETH_P_MVRP = 0x88f5
ETH_P_NCSI = 0x88f8
ETH_P_PAE = 0x888e
ETH_P_PAUSE = 0x8808
ETH_P_PHONET = 0xf5
ETH_P_PPPTALK = 0x10
ETH_P_PPP_DISC = 0x8863
ETH_P_PPP_MP = 0x8
ETH_P_PPP_SES = 0x8864
ETH_P_PRP = 0x88fb
ETH_P_PUP = 0x200
ETH_P_PUPAT = 0x201
ETH_P_QINQ1 = 0x9100
ETH_P_QINQ2 = 0x9200
ETH_P_QINQ3 = 0x9300
ETH_P_RARP = 0x8035
ETH_P_SCA = 0x6007
ETH_P_SLOW = 0x8809
ETH_P_SNAP = 0x5
ETH_P_TDLS = 0x890d
ETH_P_TEB = 0x6558
ETH_P_TIPC = 0x88ca
ETH_P_TRAILER = 0x1c
ETH_P_TR_802_2 = 0x11
ETH_P_TSN = 0x22f0
ETH_P_WAN_PPP = 0x7
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
FALLOC_FL_NO_HIDE_STALE = 0x4
FALLOC_FL_PUNCH_HOLE = 0x2
FALLOC_FL_UNSHARE_RANGE = 0x40
FALLOC_FL_ZERO_RANGE = 0x10
FD_CLOEXEC = 0x1
FD_SETSIZE = 0x400
FF0 = 0x0
FF1 = 0x8000
FFDLY = 0x8000
FLUSHO = 0x1000
FS_ENCRYPTION_MODE_AES_128_CBC = 0x5
FS_ENCRYPTION_MODE_AES_128_CTS = 0x6
FS_ENCRYPTION_MODE_AES_256_CBC = 0x3
FS_ENCRYPTION_MODE_AES_256_CTS = 0x4
FS_ENCRYPTION_MODE_AES_256_GCM = 0x2
FS_ENCRYPTION_MODE_AES_256_XTS = 0x1
FS_ENCRYPTION_MODE_INVALID = 0x0
FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615
FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614
FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613
FS_KEY_DESCRIPTOR_SIZE = 0x8
FS_KEY_DESC_PREFIX = "fscrypt:"
FS_KEY_DESC_PREFIX_SIZE = 0x8
FS_MAX_KEY_SIZE = 0x40
FS_POLICY_FLAGS_PAD_16 = 0x2
FS_POLICY_FLAGS_PAD_32 = 0x3
FS_POLICY_FLAGS_PAD_4 = 0x0
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
F_EXLCK = 0x4
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLEASE = 0x401
F_GETLK = 0xc
F_GETLK64 = 0xc
F_GETOWN = 0x9
F_GETOWN_EX = 0x10
F_GETPIPE_SZ = 0x408
F_GETSIG = 0xb
F_LOCK = 0x1
F_NOTIFY = 0x402
F_OFD_GETLK = 0x24
F_OFD_SETLK = 0x25
F_OFD_SETLKW = 0x26
F_OK = 0x0
F_RDLCK = 0x0
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLEASE = 0x400
F_SETLK = 0xd
F_SETLK64 = 0xd
F_SETLKW = 0xe
F_SETLKW64 = 0xe
F_SETOWN = 0x8
F_SETOWN_EX = 0xf
F_SETPIPE_SZ = 0x407
F_SETSIG = 0xa
F_SHLCK = 0x8
F_TEST = 0x3
F_TLOCK = 0x2
F_ULOCK = 0x0
F_UNLCK = 0x2
F_WRLCK = 0x1
GENL_ADMIN_PERM = 0x1
GENL_CMD_CAP_DO = 0x2
GENL_CMD_CAP_DUMP = 0x4
GENL_CMD_CAP_HASPOL = 0x8
GENL_HDRLEN = 0x4
GENL_ID_CTRL = 0x10
GENL_ID_PMCRAID = 0x12
GENL_ID_VFS_DQUOT = 0x11
GENL_MAX_ID = 0x3ff
GENL_MIN_ID = 0x10
GENL_NAMSIZ = 0x10
GENL_START_ALLOC = 0x13
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
ICMPV6_FILTER = 0x1
ICRNL = 0x100
IEXTEN = 0x8000
IFA_F_DADFAILED = 0x8
IFA_F_DEPRECATED = 0x20
IFA_F_HOMEADDRESS = 0x10
IFA_F_MANAGETEMPADDR = 0x100
IFA_F_MCAUTOJOIN = 0x400
IFA_F_NODAD = 0x2
IFA_F_NOPREFIXROUTE = 0x200
IFA_F_OPTIMISTIC = 0x4
IFA_F_PERMANENT = 0x80
IFA_F_SECONDARY = 0x1
IFA_F_STABLE_PRIVACY = 0x800
IFA_F_TEMPORARY = 0x1
IFA_F_TENTATIVE = 0x40
IFA_MAX = 0x8
IFF_ALLMULTI = 0x200
IFF_ATTACH_QUEUE = 0x200
IFF_AUTOMEDIA = 0x4000
IFF_BROADCAST = 0x2
IFF_DEBUG = 0x4
IFF_DETACH_QUEUE = 0x400
IFF_DORMANT = 0x20000
IFF_DYNAMIC = 0x8000
IFF_ECHO = 0x40000
IFF_LOOPBACK = 0x8
IFF_LOWER_UP = 0x10000
IFF_MASTER = 0x400
IFF_MULTICAST = 0x1000
IFF_MULTI_QUEUE = 0x100
IFF_NOARP = 0x80
IFF_NOFILTER = 0x1000
IFF_NOTRAILERS = 0x20
IFF_NO_PI = 0x1000
IFF_ONE_QUEUE = 0x2000
IFF_PERSIST = 0x800
IFF_POINTOPOINT = 0x10
IFF_PORTSEL = 0x2000
IFF_PROMISC = 0x100
IFF_RUNNING = 0x40
IFF_SLAVE = 0x800
IFF_TAP = 0x2
IFF_TUN = 0x1
IFF_TUN_EXCL = 0x8000
IFF_UP = 0x1
IFF_VNET_HDR = 0x4000
IFF_VOLATILE = 0x70c5a
IFNAMSIZ = 0x10
IGNBRK = 0x1
IGNCR = 0x80
IGNPAR = 0x4
IMAXBEL = 0x2000
INLCR = 0x40
INPCK = 0x10
IN_ACCESS = 0x1
IN_ALL_EVENTS = 0xfff
IN_ATTRIB = 0x4
IN_CLASSA_HOST = 0xffffff
IN_CLASSA_MAX = 0x80
IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 0x18
IN_CLASSB_HOST = 0xffff
IN_CLASSB_MAX = 0x10000
IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 0x10
IN_CLASSC_HOST = 0xff
IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 0x8
IN_CLOEXEC = 0x80000
IN_CLOSE = 0x18
IN_CLOSE_NOWRITE = 0x10
IN_CLOSE_WRITE = 0x8
IN_CREATE = 0x100
IN_DELETE = 0x200
IN_DELETE_SELF = 0x400
IN_DONT_FOLLOW = 0x2000000
IN_EXCL_UNLINK = 0x4000000
IN_IGNORED = 0x8000
IN_ISDIR = 0x40000000
IN_LOOPBACKNET = 0x7f
IN_MASK_ADD = 0x20000000
IN_MODIFY = 0x2
IN_MOVE = 0xc0
IN_MOVED_FROM = 0x40
IN_MOVED_TO = 0x80
IN_MOVE_SELF = 0x800
IN_NONBLOCK = 0x800
IN_ONESHOT = 0x80000000
IN_ONLYDIR = 0x1000000
IN_OPEN = 0x20
IN_Q_OVERFLOW = 0x4000
IN_UNMOUNT = 0x2000
IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9
IPPROTO_AH = 0x33
IPPROTO_BEETPH = 0x5e
IPPROTO_COMP = 0x6c
IPPROTO_DCCP = 0x21
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
IPPROTO_ENCAP = 0x62
IPPROTO_ESP = 0x32
IPPROTO_FRAGMENT = 0x2c
IPPROTO_GRE = 0x2f
IPPROTO_HOPOPTS = 0x0
IPPROTO_ICMP = 0x1
IPPROTO_ICMPV6 = 0x3a
IPPROTO_IDP = 0x16
IPPROTO_IGMP = 0x2
IPPROTO_IP = 0x0
IPPROTO_IPIP = 0x4
IPPROTO_IPV6 = 0x29
IPPROTO_MH = 0x87
IPPROTO_MPLS = 0x89
IPPROTO_MTP = 0x5c
IPPROTO_NONE = 0x3b
IPPROTO_PIM = 0x67
IPPROTO_PUP = 0xc
IPPROTO_RAW = 0xff
IPPROTO_ROUTING = 0x2b
IPPROTO_RSVP = 0x2e
IPPROTO_SCTP = 0x84
IPPROTO_TCP = 0x6
IPPROTO_TP = 0x1d
IPPROTO_UDP = 0x11
IPPROTO_UDPLITE = 0x88
IPV6_2292DSTOPTS = 0x4
IPV6_2292HOPLIMIT = 0x8
IPV6_2292HOPOPTS = 0x3
IPV6_2292PKTINFO = 0x2
IPV6_2292PKTOPTIONS = 0x6
IPV6_2292RTHDR = 0x5
IPV6_ADDRFORM = 0x1
IPV6_ADDR_PREFERENCES = 0x48
IPV6_ADD_MEMBERSHIP = 0x14
IPV6_AUTHHDR = 0xa
IPV6_AUTOFLOWLABEL = 0x46
IPV6_CHECKSUM = 0x7
IPV6_DONTFRAG = 0x3e
IPV6_DROP_MEMBERSHIP = 0x15
IPV6_DSTOPTS = 0x3b
IPV6_HDRINCL = 0x24
IPV6_HOPLIMIT = 0x34
IPV6_HOPOPTS = 0x36
IPV6_IPSEC_POLICY = 0x22
IPV6_JOIN_ANYCAST = 0x1b
IPV6_JOIN_GROUP = 0x14
IPV6_LEAVE_ANYCAST = 0x1c
IPV6_LEAVE_GROUP = 0x15
IPV6_MINHOPCOUNT = 0x49
IPV6_MTU = 0x18
IPV6_MTU_DISCOVER = 0x17
IPV6_MULTICAST_HOPS = 0x12
IPV6_MULTICAST_IF = 0x11
IPV6_MULTICAST_LOOP = 0x13
IPV6_NEXTHOP = 0x9
IPV6_ORIGDSTADDR = 0x4a
IPV6_PATHMTU = 0x3d
IPV6_PKTINFO = 0x32
IPV6_PMTUDISC_DO = 0x2
IPV6_PMTUDISC_DONT = 0x0
IPV6_PMTUDISC_INTERFACE = 0x4
IPV6_PMTUDISC_OMIT = 0x5
IPV6_PMTUDISC_PROBE = 0x3
IPV6_PMTUDISC_WANT = 0x1
IPV6_RECVDSTOPTS = 0x3a
IPV6_RECVERR = 0x19
IPV6_RECVFRAGSIZE = 0x4d
IPV6_RECVHOPLIMIT = 0x33
IPV6_RECVHOPOPTS = 0x35
IPV6_RECVORIGDSTADDR = 0x4a
IPV6_RECVPATHMTU = 0x3c
IPV6_RECVPKTINFO = 0x31
IPV6_RECVRTHDR = 0x38
IPV6_RECVTCLASS = 0x42
IPV6_ROUTER_ALERT = 0x16
IPV6_RTHDR = 0x39
IPV6_RTHDRDSTOPTS = 0x37
IPV6_RTHDR_LOOSE = 0x0
IPV6_RTHDR_STRICT = 0x1
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_RXDSTOPTS = 0x3b
IPV6_RXHOPOPTS = 0x36
IPV6_TCLASS = 0x43
IPV6_TRANSPARENT = 0x4b
IPV6_UNICAST_HOPS = 0x10
IPV6_UNICAST_IF = 0x4c
IPV6_V6ONLY = 0x1a
IPV6_XFRM_POLICY = 0x23
IP_ADD_MEMBERSHIP = 0x23
IP_ADD_SOURCE_MEMBERSHIP = 0x27
IP_BIND_ADDRESS_NO_PORT = 0x18
IP_BLOCK_SOURCE = 0x26
IP_CHECKSUM = 0x17
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DROP_MEMBERSHIP = 0x24
IP_DROP_SOURCE_MEMBERSHIP = 0x28
IP_FREEBIND = 0xf
IP_HDRINCL = 0x3
IP_IPSEC_POLICY = 0x10
IP_MAXPACKET = 0xffff
IP_MAX_MEMBERSHIPS = 0x14
IP_MF = 0x2000
IP_MINTTL = 0x15
IP_MSFILTER = 0x29
IP_MSS = 0x240
IP_MTU = 0xe
IP_MTU_DISCOVER = 0xa
IP_MULTICAST_ALL = 0x31
IP_MULTICAST_IF = 0x20
IP_MULTICAST_LOOP = 0x22
IP_MULTICAST_TTL = 0x21
IP_NODEFRAG = 0x16
IP_OFFMASK = 0x1fff
IP_OPTIONS = 0x4
IP_ORIGDSTADDR = 0x14
IP_PASSSEC = 0x12
IP_PKTINFO = 0x8
IP_PKTOPTIONS = 0x9
IP_PMTUDISC = 0xa
IP_PMTUDISC_DO = 0x2
IP_PMTUDISC_DONT = 0x0
IP_PMTUDISC_INTERFACE = 0x4
IP_PMTUDISC_OMIT = 0x5
IP_PMTUDISC_PROBE = 0x3
IP_PMTUDISC_WANT = 0x1
IP_RECVERR = 0xb
IP_RECVFRAGSIZE = 0x19
IP_RECVOPTS = 0x6
IP_RECVORIGDSTADDR = 0x14
IP_RECVRETOPTS = 0x7
IP_RECVTOS = 0xd
IP_RECVTTL = 0xc
IP_RETOPTS = 0x7
IP_RF = 0x8000
IP_ROUTER_ALERT = 0x5
IP_TOS = 0x1
IP_TRANSPARENT = 0x13
IP_TTL = 0x2
IP_UNBLOCK_SOURCE = 0x25
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
KEYCTL_DESCRIBE = 0x6
KEYCTL_DH_COMPUTE = 0x17
KEYCTL_GET_KEYRING_ID = 0x0
KEYCTL_GET_PERSISTENT = 0x16
KEYCTL_GET_SECURITY = 0x11
KEYCTL_INSTANTIATE = 0xc
KEYCTL_INSTANTIATE_IOV = 0x14
KEYCTL_INVALIDATE = 0x15
KEYCTL_JOIN_SESSION_KEYRING = 0x1
KEYCTL_LINK = 0x8
KEYCTL_NEGATE = 0xd
KEYCTL_READ = 0xb
KEYCTL_REJECT = 0x13
KEYCTL_RESTRICT_KEYRING = 0x1d
KEYCTL_REVOKE = 0x3
KEYCTL_SEARCH = 0xa
KEYCTL_SESSION_TO_PARENT = 0x12
KEYCTL_SETPERM = 0x5
KEYCTL_SET_REQKEY_KEYRING = 0xe
KEYCTL_SET_TIMEOUT = 0xf
KEYCTL_UNLINK = 0x9
KEYCTL_UPDATE = 0x2
KEY_REQKEY_DEFL_DEFAULT = 0x0
KEY_REQKEY_DEFL_GROUP_KEYRING = 0x6
KEY_REQKEY_DEFL_NO_CHANGE = -0x1
KEY_REQKEY_DEFL_PROCESS_KEYRING = 0x2
KEY_REQKEY_DEFL_REQUESTOR_KEYRING = 0x7
KEY_REQKEY_DEFL_SESSION_KEYRING = 0x3
KEY_REQKEY_DEFL_THREAD_KEYRING = 0x1
KEY_REQKEY_DEFL_USER_KEYRING = 0x4
KEY_REQKEY_DEFL_USER_SESSION_KEYRING = 0x5
KEY_SPEC_GROUP_KEYRING = -0x6
KEY_SPEC_PROCESS_KEYRING = -0x2
KEY_SPEC_REQKEY_AUTH_KEY = -0x7
KEY_SPEC_REQUESTOR_KEYRING = -0x8
KEY_SPEC_SESSION_KEYRING = -0x3
KEY_SPEC_THREAD_KEYRING = -0x1
KEY_SPEC_USER_KEYRING = -0x4
KEY_SPEC_USER_SESSION_KEYRING = -0x5
LINUX_REBOOT_CMD_CAD_OFF = 0x0
LINUX_REBOOT_CMD_CAD_ON = 0x89abcdef
LINUX_REBOOT_CMD_HALT = 0xcdef0123
LINUX_REBOOT_CMD_KEXEC = 0x45584543
LINUX_REBOOT_CMD_POWER_OFF = 0x4321fedc
LINUX_REBOOT_CMD_RESTART = 0x1234567
LINUX_REBOOT_CMD_RESTART2 = 0xa1b2c3d4
LINUX_REBOOT_CMD_SW_SUSPEND = 0xd000fce2
LINUX_REBOOT_MAGIC1 = 0xfee1dead
LINUX_REBOOT_MAGIC2 = 0x28121969
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
LOCK_UN = 0x8
MADV_DODUMP = 0x11
MADV_DOFORK = 0xb
MADV_DONTDUMP = 0x10
MADV_DONTFORK = 0xa
MADV_DONTNEED = 0x4
MADV_FREE = 0x8
MADV_HUGEPAGE = 0xe
MADV_HWPOISON = 0x64
MADV_MERGEABLE = 0xc
MADV_NOHUGEPAGE = 0xf
MADV_NORMAL = 0x0
MADV_RANDOM = 0x1
MADV_REMOVE = 0x9
MADV_SEQUENTIAL = 0x2
MADV_UNMERGEABLE = 0xd
MADV_WILLNEED = 0x3
MAP_32BIT = 0x40
MAP_ANON = 0x20
MAP_ANONYMOUS = 0x20
MAP_DENYWRITE = 0x800
MAP_EXECUTABLE = 0x1000
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_GROWSDOWN = 0x100
MAP_HUGETLB = 0x40000
MAP_HUGE_MASK = 0x3f
MAP_HUGE_SHIFT = 0x1a
MAP_LOCKED = 0x2000
MAP_NONBLOCK = 0x10000
MAP_NORESERVE = 0x4000
MAP_POPULATE = 0x8000
MAP_PRIVATE = 0x2
MAP_SHARED = 0x1
MAP_STACK = 0x20000
MAP_TYPE = 0xf
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
MSG_CTRUNC = 0x8
MSG_DONTROUTE = 0x4
MSG_DONTWAIT = 0x40
MSG_EOR = 0x80
MSG_ERRQUEUE = 0x2000
MSG_FASTOPEN = 0x20000000
MSG_FIN = 0x200
MSG_MORE = 0x8000
MSG_NOSIGNAL = 0x4000
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_PROXY = 0x10
MSG_RST = 0x1000
MSG_SYN = 0x400
MSG_TRUNC = 0x20
MSG_TRYHARD = 0x4
MSG_WAITALL = 0x100
MSG_WAITFORONE = 0x10000
MS_ACTIVE = 0x40000000
MS_ASYNC = 0x1
MS_BIND = 0x1000
MS_BORN = 0x20000000
MS_DIRSYNC = 0x80
MS_INVALIDATE = 0x2
MS_I_VERSION = 0x800000
MS_KERNMOUNT = 0x400000
MS_LAZYTIME = 0x2000000
MS_MANDLOCK = 0x40
MS_MGC_MSK = 0xffff0000
MS_MGC_VAL = 0xc0ed0000
MS_MOVE = 0x2000
MS_NOATIME = 0x400
MS_NODEV = 0x4
MS_NODIRATIME = 0x800
MS_NOEXEC = 0x8
MS_NOREMOTELOCK = 0x8000000
MS_NOSEC = 0x10000000
MS_NOSUID = 0x2
MS_NOUSER = -0x80000000
MS_POSIXACL = 0x10000
MS_PRIVATE = 0x40000
MS_RDONLY = 0x1
MS_REC = 0x4000
MS_RELATIME = 0x200000
MS_REMOUNT = 0x20
MS_RMT_MASK = 0x2800051
MS_SHARED = 0x100000
MS_SILENT = 0x8000
MS_SLAVE = 0x80000
MS_STRICTATIME = 0x1000000
MS_SUBMOUNT = 0x4000000
MS_SYNC = 0x4
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
NAME_MAX = 0xff
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
NETLINK_CAP_ACK = 0xa
NETLINK_CONNECTOR = 0xb
NETLINK_CRYPTO = 0x15
NETLINK_DNRTMSG = 0xe
NETLINK_DROP_MEMBERSHIP = 0x2
NETLINK_ECRYPTFS = 0x13
NETLINK_EXT_ACK = 0xb
NETLINK_FIB_LOOKUP = 0xa
NETLINK_FIREWALL = 0x3
NETLINK_GENERIC = 0x10
NETLINK_INET_DIAG = 0x4
NETLINK_IP6_FW = 0xd
NETLINK_ISCSI = 0x8
NETLINK_KOBJECT_UEVENT = 0xf
NETLINK_LISTEN_ALL_NSID = 0x8
NETLINK_LIST_MEMBERSHIPS = 0x9
NETLINK_NETFILTER = 0xc
NETLINK_NFLOG = 0x5
NETLINK_NO_ENOBUFS = 0x5
NETLINK_PKTINFO = 0x3
NETLINK_RDMA = 0x14
NETLINK_ROUTE = 0x0
NETLINK_RX_RING = 0x6
NETLINK_SCSITRANSPORT = 0x12
NETLINK_SELINUX = 0x7
NETLINK_SMC = 0x16
NETLINK_SOCK_DIAG = 0x4
NETLINK_TX_RING = 0x7
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
NLA_F_NESTED = 0x8000
NLA_F_NET_BYTEORDER = 0x4000
NLA_HDRLEN = 0x4
NLDLY = 0x100
NLMSG_ALIGNTO = 0x4
NLMSG_DONE = 0x3
NLMSG_ERROR = 0x2
NLMSG_HDRLEN = 0x10
NLMSG_MIN_TYPE = 0x10
NLMSG_NOOP = 0x1
NLMSG_OVERRUN = 0x4
NLM_F_ACK = 0x4
NLM_F_ACK_TLVS = 0x200
NLM_F_APPEND = 0x800
NLM_F_ATOMIC = 0x400
NLM_F_CAPPED = 0x100
NLM_F_CREATE = 0x400
NLM_F_DUMP = 0x300
NLM_F_DUMP_FILTERED = 0x20
NLM_F_DUMP_INTR = 0x10
NLM_F_ECHO = 0x8
NLM_F_EXCL = 0x200
NLM_F_MATCH = 0x200
NLM_F_MULTI = 0x2
NLM_F_REPLACE = 0x100
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
OLCUC = 0x2
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
OPOST = 0x1
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
O_CLOEXEC = 0x80000
O_CREAT = 0x40
O_DIRECT = 0x4000
O_DIRECTORY = 0x10000
O_DSYNC = 0x1000
O_EXCL = 0x80
O_FSYNC = 0x101000
O_LARGEFILE = 0x8000
O_NDELAY = 0x800
O_NOATIME = 0x40000
O_NOCTTY = 0x100
O_NOFOLLOW = 0x20000
O_NONBLOCK = 0x800
O_PATH = 0x200000
O_RDONLY = 0x0
O_RDWR = 0x2
O_RSYNC = 0x101000
O_SYNC = 0x101000
O_TMPFILE = 0x410000
O_TRUNC = 0x200
O_WRONLY = 0x1
PACKET_ADD_MEMBERSHIP = 0x1
PACKET_AUXDATA = 0x8
PACKET_BROADCAST = 0x1
PACKET_COPY_THRESH = 0x7
PACKET_DROP_MEMBERSHIP = 0x2
PACKET_FANOUT = 0x12
PACKET_FANOUT_CBPF = 0x6
PACKET_FANOUT_CPU = 0x2
PACKET_FANOUT_DATA = 0x16
PACKET_FANOUT_EBPF = 0x7
PACKET_FANOUT_FLAG_DEFRAG = 0x8000
PACKET_FANOUT_FLAG_ROLLOVER = 0x1000
PACKET_FANOUT_FLAG_UNIQUEID = 0x2000
PACKET_FANOUT_HASH = 0x0
PACKET_FANOUT_LB = 0x1
PACKET_FANOUT_QM = 0x5
PACKET_FANOUT_RND = 0x4
PACKET_FANOUT_ROLLOVER = 0x3
PACKET_FASTROUTE = 0x6
PACKET_HDRLEN = 0xb
PACKET_HOST = 0x0
PACKET_KERNEL = 0x7
PACKET_LOOPBACK = 0x5
PACKET_LOSS = 0xe
PACKET_MR_ALLMULTI = 0x2
PACKET_MR_MULTICAST = 0x0
PACKET_MR_PROMISC = 0x1
PACKET_MR_UNICAST = 0x3
PACKET_MULTICAST = 0x2
PACKET_ORIGDEV = 0x9
PACKET_OTHERHOST = 0x3
PACKET_OUTGOING = 0x4
PACKET_QDISC_BYPASS = 0x14
PACKET_RECV_OUTPUT = 0x3
PACKET_RESERVE = 0xc
PACKET_ROLLOVER_STATS = 0x15
PACKET_RX_RING = 0x5
PACKET_STATISTICS = 0x6
PACKET_TIMESTAMP = 0x11
PACKET_TX_HAS_OFF = 0x13
PACKET_TX_RING = 0xd
PACKET_TX_TIMESTAMP = 0x10
PACKET_USER = 0x6
PACKET_VERSION = 0xa
PACKET_VNET_HDR = 0xf
PARENB = 0x100
PARITY_CRC16_PR0 = 0x2
PARITY_CRC16_PR0_CCITT = 0x4
PARITY_CRC16_PR1 = 0x3
PARITY_CRC16_PR1_CCITT = 0x5
PARITY_CRC32_PR0_CCITT = 0x6
PARITY_CRC32_PR1_CCITT = 0x7
PARITY_DEFAULT = 0x0
PARITY_NONE = 0x1
PARMRK = 0x8
PARODD = 0x200
PENDIN = 0x4000
PERF_EVENT_IOC_DISABLE = 0x2401
PERF_EVENT_IOC_ENABLE = 0x2400
PERF_EVENT_IOC_ID = 0x80042407
PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409
PERF_EVENT_IOC_PERIOD = 0x40082404
PERF_EVENT_IOC_REFRESH = 0x2402
PERF_EVENT_IOC_RESET = 0x2403
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40042406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
PROT_NONE = 0x0
PROT_READ = 0x1
PROT_WRITE = 0x2
PR_CAPBSET_DROP = 0x18
PR_CAPBSET_READ = 0x17
PR_CAP_AMBIENT = 0x2f
PR_CAP_AMBIENT_CLEAR_ALL = 0x4
PR_CAP_AMBIENT_IS_SET = 0x1
PR_CAP_AMBIENT_LOWER = 0x3
PR_CAP_AMBIENT_RAISE = 0x2
PR_ENDIAN_BIG = 0x0
PR_ENDIAN_LITTLE = 0x1
PR_ENDIAN_PPC_LITTLE = 0x2
PR_FPEMU_NOPRINT = 0x1
PR_FPEMU_SIGFPE = 0x2
PR_FP_EXC_ASYNC = 0x2
PR_FP_EXC_DISABLED = 0x0
PR_FP_EXC_DIV = 0x10000
PR_FP_EXC_INV = 0x100000
PR_FP_EXC_NONRECOV = 0x1
PR_FP_EXC_OVF = 0x20000
PR_FP_EXC_PRECISE = 0x3
PR_FP_EXC_RES = 0x80000
PR_FP_EXC_SW_ENABLE = 0x80
PR_FP_EXC_UND = 0x40000
PR_FP_MODE_FR = 0x1
PR_FP_MODE_FRE = 0x2
PR_GET_CHILD_SUBREAPER = 0x25
PR_GET_DUMPABLE = 0x3
PR_GET_ENDIAN = 0x13
PR_GET_FPEMU = 0x9
PR_GET_FPEXC = 0xb
PR_GET_FP_MODE = 0x2e
PR_GET_KEEPCAPS = 0x7
PR_GET_NAME = 0x10
PR_GET_NO_NEW_PRIVS = 0x27
PR_GET_PDEATHSIG = 0x2
PR_GET_SECCOMP = 0x15
PR_GET_SECUREBITS = 0x1b
PR_GET_THP_DISABLE = 0x2a
PR_GET_TID_ADDRESS = 0x28
PR_GET_TIMERSLACK = 0x1e
PR_GET_TIMING = 0xd
PR_GET_TSC = 0x19
PR_GET_UNALIGN = 0x5
PR_MCE_KILL = 0x21
PR_MCE_KILL_CLEAR = 0x0
PR_MCE_KILL_DEFAULT = 0x2
PR_MCE_KILL_EARLY = 0x1
PR_MCE_KILL_GET = 0x22
PR_MCE_KILL_LATE = 0x0
PR_MCE_KILL_SET = 0x1
PR_MPX_DISABLE_MANAGEMENT = 0x2c
PR_MPX_ENABLE_MANAGEMENT = 0x2b
PR_SET_CHILD_SUBREAPER = 0x24
PR_SET_DUMPABLE = 0x4
PR_SET_ENDIAN = 0x14
PR_SET_FPEMU = 0xa
PR_SET_FPEXC = 0xc
PR_SET_FP_MODE = 0x2d
PR_SET_KEEPCAPS = 0x8
PR_SET_MM = 0x23
PR_SET_MM_ARG_END = 0x9
PR_SET_MM_ARG_START = 0x8
PR_SET_MM_AUXV = 0xc
PR_SET_MM_BRK = 0x7
PR_SET_MM_END_CODE = 0x2
PR_SET_MM_END_DATA = 0x4
PR_SET_MM_ENV_END = 0xb
PR_SET_MM_ENV_START = 0xa
PR_SET_MM_EXE_FILE = 0xd
PR_SET_MM_MAP = 0xe
PR_SET_MM_MAP_SIZE = 0xf
PR_SET_MM_START_BRK = 0x6
PR_SET_MM_START_CODE = 0x1
PR_SET_MM_START_DATA = 0x3
PR_SET_MM_START_STACK = 0x5
PR_SET_NAME = 0xf
PR_SET_NO_NEW_PRIVS = 0x26
PR_SET_PDEATHSIG = 0x1
PR_SET_PTRACER = 0x59616d61
PR_SET_PTRACER_ANY = 0xffffffff
PR_SET_SECCOMP = 0x16
PR_SET_SECUREBITS = 0x1c
PR_SET_THP_DISABLE = 0x29
PR_SET_TIMERSLACK = 0x1d
PR_SET_TIMING = 0xe
PR_SET_TSC = 0x1a
PR_SET_UNALIGN = 0x6
PR_TASK_PERF_EVENTS_DISABLE = 0x1f
PR_TASK_PERF_EVENTS_ENABLE = 0x20
PR_TIMING_STATISTICAL = 0x0
PR_TIMING_TIMESTAMP = 0x1
PR_TSC_ENABLE = 0x1
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
PTRACE_EVENT_CLONE = 0x3
PTRACE_EVENT_EXEC = 0x4
PTRACE_EVENT_EXIT = 0x6
PTRACE_EVENT_FORK = 0x1
PTRACE_EVENT_SECCOMP = 0x7
PTRACE_EVENT_STOP = 0x80
PTRACE_EVENT_VFORK = 0x2
PTRACE_EVENT_VFORK_DONE = 0x5
PTRACE_GETEVENTMSG = 0x4201
PTRACE_GETFPREGS = 0xe
PTRACE_GETFPXREGS = 0x12
PTRACE_GETREGS = 0xc
PTRACE_GETREGSET = 0x4204
PTRACE_GETSIGINFO = 0x4202
PTRACE_GETSIGMASK = 0x420a
PTRACE_GET_THREAD_AREA = 0x19
PTRACE_INTERRUPT = 0x4207
PTRACE_KILL = 0x8
PTRACE_LISTEN = 0x4208
PTRACE_OLDSETOPTIONS = 0x15
PTRACE_O_EXITKILL = 0x100000
PTRACE_O_MASK = 0x3000ff
PTRACE_O_SUSPEND_SECCOMP = 0x200000
PTRACE_O_TRACECLONE = 0x8
PTRACE_O_TRACEEXEC = 0x10
PTRACE_O_TRACEEXIT = 0x40
PTRACE_O_TRACEFORK = 0x2
PTRACE_O_TRACESECCOMP = 0x80
PTRACE_O_TRACESYSGOOD = 0x1
PTRACE_O_TRACEVFORK = 0x4
PTRACE_O_TRACEVFORKDONE = 0x20
PTRACE_PEEKDATA = 0x2
PTRACE_PEEKSIGINFO = 0x4209
PTRACE_PEEKSIGINFO_SHARED = 0x1
PTRACE_PEEKTEXT = 0x1
PTRACE_PEEKUSR = 0x3
PTRACE_POKEDATA = 0x5
PTRACE_POKETEXT = 0x4
PTRACE_POKEUSR = 0x6
PTRACE_SECCOMP_GET_FILTER = 0x420c
PTRACE_SEIZE = 0x4206
PTRACE_SETFPREGS = 0xf
PTRACE_SETFPXREGS = 0x13
PTRACE_SETOPTIONS = 0x4200
PTRACE_SETREGS = 0xd
PTRACE_SETREGSET = 0x4205
PTRACE_SETSIGINFO = 0x4203
PTRACE_SETSIGMASK = 0x420b
PTRACE_SET_THREAD_AREA = 0x1a
PTRACE_SINGLEBLOCK = 0x21
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_SYSEMU = 0x1f
PTRACE_SYSEMU_SINGLESTEP = 0x20
PTRACE_TRACEME = 0x0
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
RLIMIT_LOCKS = 0xa
RLIMIT_MEMLOCK = 0x8
RLIMIT_MSGQUEUE = 0xc
RLIMIT_NICE = 0xd
RLIMIT_NOFILE = 0x7
RLIMIT_NPROC = 0x6
RLIMIT_RSS = 0x5
RLIMIT_RTPRIO = 0xe
RLIMIT_RTTIME = 0xf
RLIMIT_SIGPENDING = 0xb
RLIMIT_STACK = 0x3
RLIM_INFINITY = 0xffffffffffffffff
RTAX_ADVMSS = 0x8
RTAX_CC_ALGO = 0x10
RTAX_CWND = 0x7
RTAX_FEATURES = 0xc
RTAX_FEATURE_ALLFRAG = 0x8
RTAX_FEATURE_ECN = 0x1
RTAX_FEATURE_MASK = 0xf
RTAX_FEATURE_SACK = 0x2
RTAX_FEATURE_TIMESTAMP = 0x4
RTAX_HOPLIMIT = 0xa
RTAX_INITCWND = 0xb
RTAX_INITRWND = 0xe
RTAX_LOCK = 0x1
RTAX_MAX = 0x10
RTAX_MTU = 0x2
RTAX_QUICKACK = 0xf
RTAX_REORDERING = 0x9
RTAX_RTO_MIN = 0xd
RTAX_RTT = 0x4
RTAX_RTTVAR = 0x5
RTAX_SSTHRESH = 0x6
RTAX_UNSPEC = 0x0
RTAX_WINDOW = 0x3
RTA_ALIGNTO = 0x4
RTA_MAX = 0x1a
RTCF_DIRECTSRC = 0x4000000
RTCF_DOREDIRECT = 0x1000000
RTCF_LOG = 0x2000000
RTCF_MASQ = 0x400000
RTCF_NAT = 0x800000
RTCF_VALVE = 0x200000
RTF_ADDRCLASSMASK = 0xf8000000
RTF_ADDRCONF = 0x40000
RTF_ALLONLINK = 0x20000
RTF_BROADCAST = 0x10000000
RTF_CACHE = 0x1000000
RTF_DEFAULT = 0x10000
RTF_DYNAMIC = 0x10
RTF_FLOW = 0x2000000
RTF_GATEWAY = 0x2
RTF_HOST = 0x4
RTF_INTERFACE = 0x40000000
RTF_IRTT = 0x100
RTF_LINKRT = 0x100000
RTF_LOCAL = 0x80000000
RTF_MODIFIED = 0x20
RTF_MSS = 0x40
RTF_MTU = 0x40
RTF_MULTICAST = 0x20000000
RTF_NAT = 0x8000000
RTF_NOFORWARD = 0x1000
RTF_NONEXTHOP = 0x200000
RTF_NOPMTUDISC = 0x4000
RTF_POLICY = 0x4000000
RTF_REINSTATE = 0x8
RTF_REJECT = 0x200
RTF_STATIC = 0x400
RTF_THROW = 0x2000
RTF_UP = 0x1
RTF_WINDOW = 0x80
RTF_XRESOLVE = 0x800
RTM_BASE = 0x10
RTM_DELACTION = 0x31
RTM_DELADDR = 0x15
RTM_DELADDRLABEL = 0x49
RTM_DELLINK = 0x11
RTM_DELMDB = 0x55
RTM_DELNEIGH = 0x1d
RTM_DELNETCONF = 0x51
RTM_DELNSID = 0x59
RTM_DELQDISC = 0x25
RTM_DELROUTE = 0x19
RTM_DELRULE = 0x21
RTM_DELTCLASS = 0x29
RTM_DELTFILTER = 0x2d
RTM_F_CLONED = 0x200
RTM_F_EQUALIZE = 0x400
RTM_F_FIB_MATCH = 0x2000
RTM_F_LOOKUP_TABLE = 0x1000
RTM_F_NOTIFY = 0x100
RTM_F_PREFIX = 0x800
RTM_GETACTION = 0x32
RTM_GETADDR = 0x16
RTM_GETADDRLABEL = 0x4a
RTM_GETANYCAST = 0x3e
RTM_GETDCB = 0x4e
RTM_GETLINK = 0x12
RTM_GETMDB = 0x56
RTM_GETMULTICAST = 0x3a
RTM_GETNEIGH = 0x1e
RTM_GETNEIGHTBL = 0x42
RTM_GETNETCONF = 0x52
RTM_GETNSID = 0x5a
RTM_GETQDISC = 0x26
RTM_GETROUTE = 0x1a
RTM_GETRULE = 0x22
RTM_GETSTATS = 0x5e
RTM_GETTCLASS = 0x2a
RTM_GETTFILTER = 0x2e
RTM_MAX = 0x63
RTM_NEWACTION = 0x30
RTM_NEWADDR = 0x14
RTM_NEWADDRLABEL = 0x48
RTM_NEWCACHEREPORT = 0x60
RTM_NEWLINK = 0x10
RTM_NEWMDB = 0x54
RTM_NEWNDUSEROPT = 0x44
RTM_NEWNEIGH = 0x1c
RTM_NEWNEIGHTBL = 0x40
RTM_NEWNETCONF = 0x50
RTM_NEWNSID = 0x58
RTM_NEWPREFIX = 0x34
RTM_NEWQDISC = 0x24
RTM_NEWROUTE = 0x18
RTM_NEWRULE = 0x20
RTM_NEWSTATS = 0x5c
RTM_NEWTCLASS = 0x28
RTM_NEWTFILTER = 0x2c
RTM_NR_FAMILIES = 0x15
RTM_NR_MSGTYPES = 0x54
RTM_SETDCB = 0x4f
RTM_SETLINK = 0x13
RTM_SETNEIGHTBL = 0x43
RTNH_ALIGNTO = 0x4
RTNH_COMPARE_MASK = 0x19
RTNH_F_DEAD = 0x1
RTNH_F_LINKDOWN = 0x10
RTNH_F_OFFLOAD = 0x8
RTNH_F_ONLINK = 0x4
RTNH_F_PERVASIVE = 0x2
RTNH_F_UNRESOLVED = 0x20
RTN_MAX = 0xb
RTPROT_BABEL = 0x2a
RTPROT_BIRD = 0xc
RTPROT_BOOT = 0x3
RTPROT_DHCP = 0x10
RTPROT_DNROUTED = 0xd
RTPROT_GATED = 0x8
RTPROT_KERNEL = 0x2
RTPROT_MROUTED = 0x11
RTPROT_MRT = 0xa
RTPROT_NTK = 0xf
RTPROT_RA = 0x9
RTPROT_REDIRECT = 0x1
RTPROT_STATIC = 0x4
RTPROT_UNSPEC = 0x0
RTPROT_XORP = 0xe
RTPROT_ZEBRA = 0xb
RT_CLASS_DEFAULT = 0xfd
RT_CLASS_LOCAL = 0xff
RT_CLASS_MAIN = 0xfe
RT_CLASS_MAX = 0xff
RT_CLASS_UNSPEC = 0x0
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
RUSAGE_THREAD = 0x1
SCM_CREDENTIALS = 0x2
SCM_RIGHTS = 0x1
SCM_TIMESTAMP = 0x1d
SCM_TIMESTAMPING = 0x25
SCM_TIMESTAMPING_OPT_STATS = 0x36
SCM_TIMESTAMPING_PKTINFO = 0x3a
SCM_TIMESTAMPNS = 0x23
SCM_WIFI_STATUS = 0x29
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
SIOCADDDLCI = 0x8980
SIOCADDMULTI = 0x8931
SIOCADDRT = 0x890b
SIOCATMARK = 0x8905
SIOCBONDCHANGEACTIVE = 0x8995
SIOCBONDENSLAVE = 0x8990
SIOCBONDINFOQUERY = 0x8994
SIOCBONDRELEASE = 0x8991
SIOCBONDSETHWADDR = 0x8992
SIOCBONDSLAVEINFOQUERY = 0x8993
SIOCBRADDBR = 0x89a0
SIOCBRADDIF = 0x89a2
SIOCBRDELBR = 0x89a1
SIOCBRDELIF = 0x89a3
SIOCDARP = 0x8953
SIOCDELDLCI = 0x8981
SIOCDELMULTI = 0x8932
SIOCDELRT = 0x890c
SIOCDEVPRIVATE = 0x89f0
SIOCDIFADDR = 0x8936
SIOCDRARP = 0x8960
SIOCETHTOOL = 0x8946
SIOCGARP = 0x8954
SIOCGHWTSTAMP = 0x89b1
SIOCGIFADDR = 0x8915
SIOCGIFBR = 0x8940
SIOCGIFBRDADDR = 0x8919
SIOCGIFCONF = 0x8912
SIOCGIFCOUNT = 0x8938
SIOCGIFDSTADDR = 0x8917
SIOCGIFENCAP = 0x8925
SIOCGIFFLAGS = 0x8913
SIOCGIFHWADDR = 0x8927
SIOCGIFINDEX = 0x8933
SIOCGIFMAP = 0x8970
SIOCGIFMEM = 0x891f
SIOCGIFMETRIC = 0x891d
SIOCGIFMTU = 0x8921
SIOCGIFNAME = 0x8910
SIOCGIFNETMASK = 0x891b
SIOCGIFPFLAGS = 0x8935
SIOCGIFSLAVE = 0x8929
SIOCGIFTXQLEN = 0x8942
SIOCGIFVLAN = 0x8982
SIOCGMIIPHY = 0x8947
SIOCGMIIREG = 0x8948
SIOCGPGRP = 0x8904
SIOCGRARP = 0x8961
SIOCGSKNS = 0x894c
SIOCGSTAMP = 0x8906
SIOCGSTAMPNS = 0x8907
SIOCINQ = 0x541b
SIOCOUTQ = 0x5411
SIOCOUTQNSD = 0x894b
SIOCPROTOPRIVATE = 0x89e0
SIOCRTMSG = 0x890d
SIOCSARP = 0x8955
SIOCSHWTSTAMP = 0x89b0
SIOCSIFADDR = 0x8916
SIOCSIFBR = 0x8941
SIOCSIFBRDADDR = 0x891a
SIOCSIFDSTADDR = 0x8918
SIOCSIFENCAP = 0x8926
SIOCSIFFLAGS = 0x8914
SIOCSIFHWADDR = 0x8924
SIOCSIFHWBROADCAST = 0x8937
SIOCSIFLINK = 0x8911
SIOCSIFMAP = 0x8971
SIOCSIFMEM = 0x8920
SIOCSIFMETRIC = 0x891e
SIOCSIFMTU = 0x8922
SIOCSIFNAME = 0x8923
SIOCSIFNETMASK = 0x891c
SIOCSIFPFLAGS = 0x8934
SIOCSIFSLAVE = 0x8930
SIOCSIFTXQLEN = 0x8943
SIOCSIFVLAN = 0x8983
SIOCSMIIREG = 0x8949
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
SOCK_IOC_TYPE = 0x89
SOCK_NONBLOCK = 0x800
SOCK_PACKET = 0xa
SOCK_RAW = 0x3
SOCK_RDM = 0x4
SOCK_SEQPACKET = 0x5
SOCK_STREAM = 0x1
SOL_AAL = 0x109
SOL_ALG = 0x117
SOL_ATM = 0x108
SOL_CAIF = 0x116
SOL_CAN_BASE = 0x64
SOL_DCCP = 0x10d
SOL_DECNET = 0x105
SOL_ICMPV6 = 0x3a
SOL_IP = 0x0
SOL_IPV6 = 0x29
SOL_IRDA = 0x10a
SOL_IUCV = 0x115
SOL_KCM = 0x119
SOL_LLC = 0x10c
SOL_NETBEUI = 0x10b
SOL_NETLINK = 0x10e
SOL_NFC = 0x118
SOL_PACKET = 0x107
SOL_PNPIPE = 0x113
SOL_PPPOL2TP = 0x111
SOL_RAW = 0xff
SOL_RDS = 0x114
SOL_RXRPC = 0x110
SOL_SOCKET = 0x1
SOL_TCP = 0x6
SOL_TIPC = 0x10f
SOL_X25 = 0x106
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x1e
SO_ATTACH_BPF = 0x32
SO_ATTACH_FILTER = 0x1a
SO_ATTACH_REUSEPORT_CBPF = 0x33
SO_ATTACH_REUSEPORT_EBPF = 0x34
SO_BINDTODEVICE = 0x19
SO_BPF_EXTENSIONS = 0x30
SO_BROADCAST = 0x6
SO_BSDCOMPAT = 0xe
SO_BUSY_POLL = 0x2e
SO_CNX_ADVICE = 0x35
SO_COOKIE = 0x39
SO_DEBUG = 0x1
SO_DETACH_BPF = 0x1b
SO_DETACH_FILTER = 0x1b
SO_DOMAIN = 0x27
SO_DONTROUTE = 0x5
SO_ERROR = 0x4
SO_GET_FILTER = 0x1a
SO_INCOMING_CPU = 0x31
SO_INCOMING_NAPI_ID = 0x38
SO_KEEPALIVE = 0x9
SO_LINGER = 0xd
SO_LOCK_FILTER = 0x2c
SO_MARK = 0x24
SO_MAX_PACING_RATE = 0x2f
SO_MEMINFO = 0x37
SO_NOFCS = 0x2b
SO_NO_CHECK = 0xb
SO_OOBINLINE = 0xa
SO_PASSCRED = 0x10
SO_PASSSEC = 0x22
SO_PEEK_OFF = 0x2a
SO_PEERCRED = 0x11
SO_PEERGROUPS = 0x3b
SO_PEERNAME = 0x1c
SO_PEERSEC = 0x1f
SO_PRIORITY = 0xc
SO_PROTOCOL = 0x26
SO_RCVBUF = 0x8
SO_RCVBUFFORCE = 0x21
SO_RCVLOWAT = 0x12
SO_RCVTIMEO = 0x14
SO_REUSEADDR = 0x2
SO_REUSEPORT = 0xf
SO_RXQ_OVFL = 0x28
SO_SECURITY_AUTHENTICATION = 0x16
SO_SECURITY_ENCRYPTION_NETWORK = 0x18
SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17
SO_SELECT_ERR_QUEUE = 0x2d
SO_SNDBUF = 0x7
SO_SNDBUFFORCE = 0x20
SO_SNDLOWAT = 0x13
SO_SNDTIMEO = 0x15
SO_TIMESTAMP = 0x1d
SO_TIMESTAMPING = 0x25
SO_TIMESTAMPNS = 0x23
SO_TYPE = 0x3
SO_VM_SOCKETS_BUFFER_MAX_SIZE = 0x2
SO_VM_SOCKETS_BUFFER_MIN_SIZE = 0x1
SO_VM_SOCKETS_BUFFER_SIZE = 0x0
SO_VM_SOCKETS_CONNECT_TIMEOUT = 0x6
SO_VM_SOCKETS_NONBLOCK_TXRX = 0x7
SO_VM_SOCKETS_PEER_HOST_VM_ID = 0x3
SO_VM_SOCKETS_TRUSTED = 0x5
SO_WIFI_STATUS = 0x29
SPLICE_F_GIFT = 0x8
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0
TAB1 = 0x800
TAB2 = 0x1000
TAB3 = 0x1800
TABDLY = 0x1800
TASKSTATS_CMD_ATTR_MAX = 0x4
TASKSTATS_CMD_MAX = 0x2
TASKSTATS_GENL_NAME = "TASKSTATS"
TASKSTATS_GENL_VERSION = 0x1
TASKSTATS_TYPE_MAX = 0x6
TASKSTATS_VERSION = 0x8
TCFLSH = 0x540b
TCGETA = 0x5405
TCGETS = 0x5401
TCGETS2 = 0x802c542a
TCGETX = 0x5432
TCIFLUSH = 0x0
TCIOFF = 0x2
TCIOFLUSH = 0x2
TCION = 0x3
TCOFLUSH = 0x1
TCOOFF = 0x0
TCOON = 0x1
TCP_CC_INFO = 0x1a
TCP_CONGESTION = 0xd
TCP_COOKIE_IN_ALWAYS = 0x1
TCP_COOKIE_MAX = 0x10
TCP_COOKIE_MIN = 0x8
TCP_COOKIE_OUT_NEVER = 0x2
TCP_COOKIE_PAIR_SIZE = 0x20
TCP_COOKIE_TRANSACTIONS = 0xf
TCP_CORK = 0x3
TCP_DEFER_ACCEPT = 0x9
TCP_FASTOPEN = 0x17
TCP_FASTOPEN_CONNECT = 0x1e
TCP_INFO = 0xb
TCP_KEEPCNT = 0x6
TCP_KEEPIDLE = 0x4
TCP_KEEPINTVL = 0x5
TCP_LINGER2 = 0x8
TCP_MAXSEG = 0x2
TCP_MAXWIN = 0xffff
TCP_MAX_WINSHIFT = 0xe
TCP_MD5SIG = 0xe
TCP_MD5SIG_MAXKEYLEN = 0x50
TCP_MSS = 0x200
TCP_MSS_DEFAULT = 0x218
TCP_MSS_DESIRED = 0x4c4
TCP_NODELAY = 0x1
TCP_NOTSENT_LOWAT = 0x19
TCP_QUEUE_SEQ = 0x15
TCP_QUICKACK = 0xc
TCP_REPAIR = 0x13
TCP_REPAIR_OPTIONS = 0x16
TCP_REPAIR_QUEUE = 0x14
TCP_REPAIR_WINDOW = 0x1d
TCP_SAVED_SYN = 0x1c
TCP_SAVE_SYN = 0x1b
TCP_SYNCNT = 0x7
TCP_S_DATA_IN = 0x4
TCP_S_DATA_OUT = 0x8
TCP_THIN_DUPACK = 0x11
TCP_THIN_LINEAR_TIMEOUTS = 0x10
TCP_TIMESTAMP = 0x18
TCP_USER_TIMEOUT = 0x12
TCP_WINDOW_CLAMP = 0xa
TCSAFLUSH = 0x2
TCSBRK = 0x5409
TCSBRKP = 0x5425
TCSETA = 0x5406
TCSETAF = 0x5408
TCSETAW = 0x5407
TCSETS = 0x5402
TCSETS2 = 0x402c542b
TCSETSF = 0x5404
TCSETSF2 = 0x402c542d
TCSETSW = 0x5403
TCSETSW2 = 0x402c542c
TCSETX = 0x5433
TCSETXF = 0x5434
TCSETXW = 0x5435
TCXONC = 0x540a
TIOCCBRK = 0x5428
TIOCCONS = 0x541d
TIOCEXCL = 0x540c
TIOCGDEV = 0x80045432
TIOCGETD = 0x5424
TIOCGEXCL = 0x80045440
TIOCGICOUNT = 0x545d
TIOCGLCKTRMIOS = 0x5456
TIOCGPGRP = 0x540f
TIOCGPKT = 0x80045438
TIOCGPTLCK = 0x80045439
TIOCGPTN = 0x80045430
TIOCGPTPEER = 0x5441
TIOCGRS485 = 0x542e
TIOCGSERIAL = 0x541e
TIOCGSID = 0x5429
TIOCGSOFTCAR = 0x5419
TIOCGWINSZ = 0x5413
TIOCINQ = 0x541b
TIOCLINUX = 0x541c
TIOCMBIC = 0x5417
TIOCMBIS = 0x5416
TIOCMGET = 0x5415
TIOCMIWAIT = 0x545c
TIOCMSET = 0x5418
TIOCM_CAR = 0x40
TIOCM_CD = 0x40
TIOCM_CTS = 0x20
TIOCM_DSR = 0x100
TIOCM_DTR = 0x2
TIOCM_LE = 0x1
TIOCM_RI = 0x80
TIOCM_RNG = 0x80
TIOCM_RTS = 0x4
TIOCM_SR = 0x10
TIOCM_ST = 0x8
TIOCNOTTY = 0x5422
TIOCNXCL = 0x540d
TIOCOUTQ = 0x5411
TIOCPKT = 0x5420
TIOCPKT_DATA = 0x0
TIOCPKT_DOSTOP = 0x20
TIOCPKT_FLUSHREAD = 0x1
TIOCPKT_FLUSHWRITE = 0x2
TIOCPKT_IOCTL = 0x40
TIOCPKT_NOSTOP = 0x10
TIOCPKT_START = 0x8
TIOCPKT_STOP = 0x4
TIOCSBRK = 0x5427
TIOCSCTTY = 0x540e
TIOCSERCONFIG = 0x5453
TIOCSERGETLSR = 0x5459
TIOCSERGETMULTI = 0x545a
TIOCSERGSTRUCT = 0x5458
TIOCSERGWILD = 0x5454
TIOCSERSETMULTI = 0x545b
TIOCSERSWILD = 0x5455
TIOCSER_TEMT = 0x1
TIOCSETD = 0x5423
TIOCSIG = 0x40045436
TIOCSLCKTRMIOS = 0x5457
TIOCSPGRP = 0x5410
TIOCSPTLCK = 0x40045431
TIOCSRS485 = 0x542f
TIOCSSERIAL = 0x541f
TIOCSSOFTCAR = 0x541a
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
TOSTOP = 0x100
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x400854d5
TUNDETACHFILTER = 0x400854d6
TUNGETFEATURES = 0x800454cf
TUNGETFILTER = 0x800854db
TUNGETIFF = 0x800454d2
TUNGETSNDBUF = 0x800454d3
TUNGETVNETBE = 0x800454df
TUNGETVNETHDRSZ = 0x800454d7
TUNGETVNETLE = 0x800454dd
TUNSETDEBUG = 0x400454c9
TUNSETGROUP = 0x400454ce
TUNSETIFF = 0x400454ca
TUNSETIFINDEX = 0x400454da
TUNSETLINK = 0x400454cd
TUNSETNOCSUM = 0x400454c8
TUNSETOFFLOAD = 0x400454d0
TUNSETOWNER = 0x400454cc
TUNSETPERSIST = 0x400454cb
TUNSETQUEUE = 0x400454d9
TUNSETSNDBUF = 0x400454d4
TUNSETTXFILTER = 0x400454d1
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
UMOUNT_NOFOLLOW = 0x8
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
VEOL2 = 0x10
VERASE = 0x2
VINTR = 0x0
VKILL = 0x3
VLNEXT = 0xf
VMADDR_CID_ANY = 0xffffffff
VMADDR_CID_HOST = 0x2
VMADDR_CID_HYPERVISOR = 0x0
VMADDR_CID_RESERVED = 0x1
VMADDR_PORT_ANY = 0xffffffff
VMIN = 0x6
VM_SOCKETS_INVALID_VERSION = 0xffffffff
VQUIT = 0x1
VREPRINT = 0xc
VSTART = 0x8
VSTOP = 0x9
VSUSP = 0xa
VSWTC = 0x7
VT0 = 0x0
VT1 = 0x4000
VTDLY = 0x4000
VTIME = 0x5
VWERASE = 0xe
WALL = 0x40000000
WCLONE = 0x80000000
WCONTINUED = 0x8
WDIOC_GETBOOTSTATUS = 0x80045702
WDIOC_GETPRETIMEOUT = 0x80045709
WDIOC_GETSTATUS = 0x80045701
WDIOC_GETSUPPORT = 0x80285700
WDIOC_GETTEMP = 0x80045703
WDIOC_GETTIMELEFT = 0x8004570a
WDIOC_GETTIMEOUT = 0x80045707
WDIOC_KEEPALIVE = 0x80045705
WDIOC_SETOPTIONS = 0x80045704
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
WORDSIZE = 0x20
WSTOPPED = 0x2
WUNTRACED = 0x2
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
XTABS = 0x1800
)
// Errors
const (
E2BIG = syscall.Errno(0x7)
EACCES = syscall.Errno(0xd)
EADDRINUSE = syscall.Errno(0x62)
EADDRNOTAVAIL = syscall.Errno(0x63)
EADV = syscall.Errno(0x44)
EAFNOSUPPORT = syscall.Errno(0x61)
EAGAIN = syscall.Errno(0xb)
EALREADY = syscall.Errno(0x72)
EBADE = syscall.Errno(0x34)
EBADF = syscall.Errno(0x9)
EBADFD = syscall.Errno(0x4d)
EBADMSG = syscall.Errno(0x4a)
EBADR = syscall.Errno(0x35)
EBADRQC = syscall.Errno(0x38)
EBADSLT = syscall.Errno(0x39)
EBFONT = syscall.Errno(0x3b)
EBUSY = syscall.Errno(0x10)
ECANCELED = syscall.Errno(0x7d)
ECHILD = syscall.Errno(0xa)
ECHRNG = syscall.Errno(0x2c)
ECOMM = syscall.Errno(0x46)
ECONNABORTED = syscall.Errno(0x67)
ECONNREFUSED = syscall.Errno(0x6f)
ECONNRESET = syscall.Errno(0x68)
EDEADLK = syscall.Errno(0x23)
EDEADLOCK = syscall.Errno(0x23)
EDESTADDRREQ = syscall.Errno(0x59)
EDOM = syscall.Errno(0x21)
EDOTDOT = syscall.Errno(0x49)
EDQUOT = syscall.Errno(0x7a)
EEXIST = syscall.Errno(0x11)
EFAULT = syscall.Errno(0xe)
EFBIG = syscall.Errno(0x1b)
EHOSTDOWN = syscall.Errno(0x70)
EHOSTUNREACH = syscall.Errno(0x71)
EHWPOISON = syscall.Errno(0x85)
EIDRM = syscall.Errno(0x2b)
EILSEQ = syscall.Errno(0x54)
EINPROGRESS = syscall.Errno(0x73)
EINTR = syscall.Errno(0x4)
EINVAL = syscall.Errno(0x16)
EIO = syscall.Errno(0x5)
EISCONN = syscall.Errno(0x6a)
EISDIR = syscall.Errno(0x15)
EISNAM = syscall.Errno(0x78)
EKEYEXPIRED = syscall.Errno(0x7f)
EKEYREJECTED = syscall.Errno(0x81)
EKEYREVOKED = syscall.Errno(0x80)
EL2HLT = syscall.Errno(0x33)
EL2NSYNC = syscall.Errno(0x2d)
EL3HLT = syscall.Errno(0x2e)
EL3RST = syscall.Errno(0x2f)
ELIBACC = syscall.Errno(0x4f)
ELIBBAD = syscall.Errno(0x50)
ELIBEXEC = syscall.Errno(0x53)
ELIBMAX = syscall.Errno(0x52)
ELIBSCN = syscall.Errno(0x51)
ELNRNG = syscall.Errno(0x30)
ELOOP = syscall.Errno(0x28)
EMEDIUMTYPE = syscall.Errno(0x7c)
EMFILE = syscall.Errno(0x18)
EMLINK = syscall.Errno(0x1f)
EMSGSIZE = syscall.Errno(0x5a)
EMULTIHOP = syscall.Errno(0x48)
ENAMETOOLONG = syscall.Errno(0x24)
ENAVAIL = syscall.Errno(0x77)
ENETDOWN = syscall.Errno(0x64)
ENETRESET = syscall.Errno(0x66)
ENETUNREACH = syscall.Errno(0x65)
ENFILE = syscall.Errno(0x17)
ENOANO = syscall.Errno(0x37)
ENOBUFS = syscall.Errno(0x69)
ENOCSI = syscall.Errno(0x32)
ENODATA = syscall.Errno(0x3d)
ENODEV = syscall.Errno(0x13)
ENOENT = syscall.Errno(0x2)
ENOEXEC = syscall.Errno(0x8)
ENOKEY = syscall.Errno(0x7e)
ENOLCK = syscall.Errno(0x25)
ENOLINK = syscall.Errno(0x43)
ENOMEDIUM = syscall.Errno(0x7b)
ENOMEM = syscall.Errno(0xc)
ENOMSG = syscall.Errno(0x2a)
ENONET = syscall.Errno(0x40)
ENOPKG = syscall.Errno(0x41)
ENOPROTOOPT = syscall.Errno(0x5c)
ENOSPC = syscall.Errno(0x1c)
ENOSR = syscall.Errno(0x3f)
ENOSTR = syscall.Errno(0x3c)
ENOSYS = syscall.Errno(0x26)
ENOTBLK = syscall.Errno(0xf)
ENOTCONN = syscall.Errno(0x6b)
ENOTDIR = syscall.Errno(0x14)
ENOTEMPTY = syscall.Errno(0x27)
ENOTNAM = syscall.Errno(0x76)
ENOTRECOVERABLE = syscall.Errno(0x83)
ENOTSOCK = syscall.Errno(0x58)
ENOTSUP = syscall.Errno(0x5f)
ENOTTY = syscall.Errno(0x19)
ENOTUNIQ = syscall.Errno(0x4c)
ENXIO = syscall.Errno(0x6)
EOPNOTSUPP = syscall.Errno(0x5f)
EOVERFLOW = syscall.Errno(0x4b)
EOWNERDEAD = syscall.Errno(0x82)
EPERM = syscall.Errno(0x1)
EPFNOSUPPORT = syscall.Errno(0x60)
EPIPE = syscall.Errno(0x20)
EPROTO = syscall.Errno(0x47)
EPROTONOSUPPORT = syscall.Errno(0x5d)
EPROTOTYPE = syscall.Errno(0x5b)
ERANGE = syscall.Errno(0x22)
EREMCHG = syscall.Errno(0x4e)
EREMOTE = syscall.Errno(0x42)
EREMOTEIO = syscall.Errno(0x79)
ERESTART = syscall.Errno(0x55)
ERFKILL = syscall.Errno(0x84)
EROFS = syscall.Errno(0x1e)
ESHUTDOWN = syscall.Errno(0x6c)
ESOCKTNOSUPPORT = syscall.Errno(0x5e)
ESPIPE = syscall.Errno(0x1d)
ESRCH = syscall.Errno(0x3)
ESRMNT = syscall.Errno(0x45)
ESTALE = syscall.Errno(0x74)
ESTRPIPE = syscall.Errno(0x56)
ETIME = syscall.Errno(0x3e)
ETIMEDOUT = syscall.Errno(0x6e)
ETOOMANYREFS = syscall.Errno(0x6d)
ETXTBSY = syscall.Errno(0x1a)
EUCLEAN = syscall.Errno(0x75)
EUNATCH = syscall.Errno(0x31)
EUSERS = syscall.Errno(0x57)
EWOULDBLOCK = syscall.Errno(0xb)
EXDEV = syscall.Errno(0x12)
EXFULL = syscall.Errno(0x36)
)
// Signals
const (
SIGABRT = syscall.Signal(0x6)
SIGALRM = syscall.Signal(0xe)
SIGBUS = syscall.Signal(0x7)
SIGCHLD = syscall.Signal(0x11)
SIGCLD = syscall.Signal(0x11)
SIGCONT = syscall.Signal(0x12)
SIGFPE = syscall.Signal(0x8)
SIGHUP = syscall.Signal(0x1)
SIGILL = syscall.Signal(0x4)
SIGINT = syscall.Signal(0x2)
SIGIO = syscall.Signal(0x1d)
SIGIOT = syscall.Signal(0x6)
SIGKILL = syscall.Signal(0x9)
SIGPIPE = syscall.Signal(0xd)
SIGPOLL = syscall.Signal(0x1d)
SIGPROF = syscall.Signal(0x1b)
SIGPWR = syscall.Signal(0x1e)
SIGQUIT = syscall.Signal(0x3)
SIGSEGV = syscall.Signal(0xb)
SIGSTKFLT = syscall.Signal(0x10)
SIGSTOP = syscall.Signal(0x13)
SIGSYS = syscall.Signal(0x1f)
SIGTERM = syscall.Signal(0xf)
SIGTRAP = syscall.Signal(0x5)
SIGTSTP = syscall.Signal(0x14)
SIGTTIN = syscall.Signal(0x15)
SIGTTOU = syscall.Signal(0x16)
SIGURG = syscall.Signal(0x17)
SIGUSR1 = syscall.Signal(0xa)
SIGUSR2 = syscall.Signal(0xc)
SIGVTALRM = syscall.Signal(0x1a)
SIGWINCH = syscall.Signal(0x1c)
SIGXCPU = syscall.Signal(0x18)
SIGXFSZ = syscall.Signal(0x19)
)
// Error table
var errors = [...]string{
1: "operation not permitted",
2: "no such file or directory",
3: "no such process",
4: "interrupted system call",
5: "input/output error",
6: "no such device or address",
7: "argument list too long",
8: "exec format error",
9: "bad file descriptor",
10: "no child processes",
11: "resource temporarily unavailable",
12: "cannot allocate memory",
13: "permission denied",
14: "bad address",
15: "block device required",
16: "device or resource busy",
17: "file exists",
18: "invalid cross-device link",
19: "no such device",
20: "not a directory",
21: "is a directory",
22: "invalid argument",
23: "too many open files in system",
24: "too many open files",
25: "inappropriate ioctl for device",
26: "text file busy",
27: "file too large",
28: "no space left on device",
29: "illegal seek",
30: "read-only file system",
31: "too many links",
32: "broken pipe",
33: "numerical argument out of domain",
34: "numerical result out of range",
35: "resource deadlock avoided",
36: "file name too long",
37: "no locks available",
38: "function not implemented",
39: "directory not empty",
40: "too many levels of symbolic links",
42: "no message of desired type",
43: "identifier removed",
44: "channel number out of range",
45: "level 2 not synchronized",
46: "level 3 halted",
47: "level 3 reset",
48: "link number out of range",
49: "protocol driver not attached",
50: "no CSI structure available",
51: "level 2 halted",
52: "invalid exchange",
53: "invalid request descriptor",
54: "exchange full",
55: "no anode",
56: "invalid request code",
57: "invalid slot",
59: "bad font file format",
60: "device not a stream",
61: "no data available",
62: "timer expired",
63: "out of streams resources",
64: "machine is not on the network",
65: "package not installed",
66: "object is remote",
67: "link has been severed",
68: "advertise error",
69: "srmount error",
70: "communication error on send",
71: "protocol error",
72: "multihop attempted",
73: "RFS specific error",
74: "bad message",
75: "value too large for defined data type",
76: "name not unique on network",
77: "file descriptor in bad state",
78: "remote address changed",
79: "can not access a needed shared library",
80: "accessing a corrupted shared library",
81: ".lib section in a.out corrupted",
82: "attempting to link in too many shared libraries",
83: "cannot exec a shared library directly",
84: "invalid or incomplete multibyte or wide character",
85: "interrupted system call should be restarted",
86: "streams pipe error",
87: "too many users",
88: "socket operation on non-socket",
89: "destination address required",
90: "message too long",
91: "protocol wrong type for socket",
92: "protocol not available",
93: "protocol not supported",
94: "socket type not supported",
95: "operation not supported",
96: "protocol family not supported",
97: "address family not supported by protocol",
98: "address already in use",
99: "cannot assign requested address",
100: "network is down",
101: "network is unreachable",
102: "network dropped connection on reset",
103: "software caused connection abort",
104: "connection reset by peer",
105: "no buffer space available",
106: "transport endpoint is already connected",
107: "transport endpoint is not connected",
108: "cannot send after transport endpoint shutdown",
109: "too many references: cannot splice",
110: "connection timed out",
111: "connection refused",
112: "host is down",
113: "no route to host",
114: "operation already in progress",
115: "operation now in progress",
116: "stale file handle",
117: "structure needs cleaning",
118: "not a XENIX named type file",
119: "no XENIX semaphores available",
120: "is a named type file",
121: "remote I/O error",
122: "disk quota exceeded",
123: "no medium found",
124: "wrong medium type",
125: "operation canceled",
126: "required key not available",
127: "key has expired",
128: "key has been revoked",
129: "key was rejected by service",
130: "owner died",
131: "state not recoverable",
132: "operation not possible due to RF-kill",
133: "memory page has hardware error",
}
// Signal table
var signals = [...]string{
1: "hangup",
2: "interrupt",
3: "quit",
4: "illegal instruction",
5: "trace/breakpoint trap",
6: "aborted",
7: "bus error",
8: "floating point exception",
9: "killed",
10: "user defined signal 1",
11: "segmentation fault",
12: "user defined signal 2",
13: "broken pipe",
14: "alarm clock",
15: "terminated",
16: "stack fault",
17: "child exited",
18: "continued",
19: "stopped (signal)",
20: "stopped",
21: "stopped (tty input)",
22: "stopped (tty output)",
23: "urgent I/O condition",
24: "CPU time limit exceeded",
25: "file size limit exceeded",
26: "virtual timer expired",
27: "profiling timer expired",
28: "window changed",
29: "I/O possible",
30: "power failure",
31: "bad system call",
}
| {
"pile_set_name": "Github"
} |
const path = require('path');
const glob = require('glob');
const execSync = require('child_process').execSync;
const [version] = process.argv.slice(2);
const examplesPath = path.join(__dirname, '..', 'examples');
{
// Update React InstantSearch DOM
const examples = glob.sync(path.join(examplesPath, '!(react-native*)'));
examples.forEach(example => {
execSync(
`cd ${example} && yarn upgrade react-instantsearch-dom@${version}`,
{
stdio: 'inherit',
}
);
});
}
{
// Update React InstantSearch Native
const examples = glob.sync(path.join(examplesPath, '+(react-native*)'));
examples.forEach(example => {
// @TODO: update to react-instantsearch-native
execSync(`cd ${example} && yarn upgrade react-instantsearch@${version}`, {
stdio: 'inherit',
});
});
}
{
// Update React InstantSearch DOM Maps
const examples = glob.sync(path.join(examplesPath, 'geo-search'));
examples.forEach(example => {
execSync(
`cd ${example} && yarn upgrade react-instantsearch-dom-maps@${version}`,
{
stdio: 'inherit',
}
);
});
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2018-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.redis.connection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.springframework.data.redis.connection.RedisConfiguration.StaticMasterReplicaConfiguration;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* Configuration class used for setting up {@link RedisConnection} via {@link RedisConnectionFactory} using the provided
* Master / Replica configuration to nodes know to not change address. Eg. when connecting to
* <a href="https://aws.amazon.com/documentation/elasticache/">AWS ElastiCache with Read Replicas</a>. <br/>
* Note: Redis is undergoing a nomenclature change where the term replica is used synonymously to slave. Please also
* note that a Master/Replica connection cannot be used for Pub/Sub operations.
*
* @author Mark Paluch
* @author Christoph Strobl
* @author Tamer Soliman
* @since 2.1
*/
public class RedisStaticMasterReplicaConfiguration implements RedisConfiguration, StaticMasterReplicaConfiguration {
private static final int DEFAULT_PORT = 6379;
private List<RedisStandaloneConfiguration> nodes = new ArrayList<>();
private int database;
private @Nullable String username = null;
private RedisPassword password = RedisPassword.none();
/**
* Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName}.
*
* @param hostName must not be {@literal null} or empty.
*/
public RedisStaticMasterReplicaConfiguration(String hostName) {
this(hostName, DEFAULT_PORT);
}
/**
* Create a new {@link StaticMasterReplicaConfiguration} given {@code hostName} and {@code port}.
*
* @param hostName must not be {@literal null} or empty.
* @param port a valid TCP port (1-65535).
*/
public RedisStaticMasterReplicaConfiguration(String hostName, int port) {
addNode(hostName, port);
}
/**
* Add a {@link RedisStandaloneConfiguration node} to the list of nodes given {@code hostName}.
*
* @param hostName must not be {@literal null} or empty.
* @param port a valid TCP port (1-65535).
*/
public void addNode(String hostName, int port) {
addNode(new RedisStandaloneConfiguration(hostName, port));
}
/**
* Add a {@link RedisStandaloneConfiguration node} to the list of nodes.
*
* @param node must not be {@literal null}.
*/
private void addNode(RedisStandaloneConfiguration node) {
Assert.notNull(node, "RedisStandaloneConfiguration must not be null!");
node.setPassword(password);
node.setDatabase(database);
nodes.add(node);
}
/**
* Add a {@link RedisStandaloneConfiguration node} to the list of nodes given {@code hostName}.
*
* @param hostName must not be {@literal null} or empty.
* @return {@code this} {@link StaticMasterReplicaConfiguration}.
*/
public RedisStaticMasterReplicaConfiguration node(String hostName) {
return node(hostName, DEFAULT_PORT);
}
/**
* Add a {@link RedisStandaloneConfiguration node} to the list of nodes given {@code hostName} and {@code port}.
*
* @param hostName must not be {@literal null} or empty.
* @param port a valid TCP port (1-65535).
* @return {@code this} {@link StaticMasterReplicaConfiguration}.
*/
public RedisStaticMasterReplicaConfiguration node(String hostName, int port) {
addNode(hostName, port);
return this;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithDatabaseIndex#getDatabase()
*/
@Override
public int getDatabase() {
return database;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithDatabaseIndex#setDatabase(int)
*/
@Override
public void setDatabase(int index) {
Assert.isTrue(index >= 0, () -> String.format("Invalid DB index '%s' (a positive index required)", index));
this.database = index;
this.nodes.forEach(it -> it.setDatabase(database));
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication#setUsername(String)
*/
@Override
public void setUsername(@Nullable String username) {
this.username = username;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithAuthentication#getUsername()
*/
@Nullable
@Override
public String getUsername() {
return this.username;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithPassword#getPassword()
*/
@Override
public RedisPassword getPassword() {
return password;
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.WithPassword#setPassword(org.springframework.data.redis.connection.RedisPassword)
*/
@Override
public void setPassword(RedisPassword password) {
Assert.notNull(password, "RedisPassword must not be null!");
this.password = password;
this.nodes.forEach(it -> it.setPassword(password));
}
/*
* (non-Javadoc)
* @see org.springframework.data.redis.connection.RedisConfiguration.StaticMasterReplicaConfiguration#getNodes()
*/
@Override
public List<RedisStandaloneConfiguration> getNodes() {
return Collections.unmodifiableList(nodes);
}
}
| {
"pile_set_name": "Github"
} |
<?php
namespace ApacheSolrForTypo3\Solr\Tests\Integration;
/***************************************************************
* Copyright notice
*
* (c) 2010-2015 Timo Schmidt <[email protected]>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use ApacheSolrForTypo3\Solr\Access\Rootline;
use ApacheSolrForTypo3\Solr\Typo3PageIndexer;
use ApacheSolrForTypo3\Solr\Util;
use InvalidArgumentException;
use Nimut\TestingFramework\Exception\Exception;
use ReflectionClass;
use ReflectionException;
use RuntimeException;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Cache\CacheManager;
use Nimut\TestingFramework\TestCase\FunctionalTestCase;
use TYPO3\CMS\Core\Cache\Exception\NoSuchCacheException;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\UserAspect;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Database\Schema\SchemaMigrator;
use TYPO3\CMS\Core\Database\Schema\SqlReader;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Http\ServerRequest;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\TimeTracker\TimeTracker;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Extbase\Object\ObjectManagerInterface;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
use TYPO3\CMS\Frontend\Http\RequestHandler;
use TYPO3\CMS\Frontend\Page\PageGenerator;
use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait;
use function getenv;
/**
* Base class for all integration tests in the EXT:solr project
*
* @author Timo Schmidt
*/
abstract class IntegrationTest extends FunctionalTestCase
{
use SiteBasedTestTrait;
/**
* @var array
*/
protected const LANGUAGE_PRESETS = [
'EN' => ['id' => 0, 'title' => 'English', 'locale' => 'en_US.UTF8'],
'DE' => ['id' => 1, 'title' => 'German', 'locale' => 'de_DE.UTF8', 'fallbackType' => 'fallback', 'fallbacks' => 'EN'],
'DA' => ['id' => 2, 'title' => 'Danish', 'locale' => 'da_DA.UTF8']
];
/**
* @var array
*/
protected $testExtensionsToLoad = [
'typo3conf/ext/solr'
];
/**
* @var array
*/
protected $testSolrCores = [
'core_en',
'core_de',
'core_dk'
];
/**
* @var array
*/
protected $configurationToUseInTestInstance = [
'SYS' => [
'exceptionalErrors' => E_WARNING | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED
]
];
/**
* @var string
*/
protected $instancePath;
/**
* @return void
* @throws NoSuchCacheException
*/
public function setUp()
{
parent::setUp();
//this is needed by the TYPO3 core.
chdir(Environment::getPublicPath() . '/');
// during the tests we don't want the core to cache something in cache_core
/* @var CacheManager $cacheManager */
$cacheManager = GeneralUtility::makeInstance(CacheManager::class);
$coreCache = $cacheManager->getCache('cache_core');
$coreCache->flush();
$this->instancePath = $this->getInstancePath();
$this->failWhenSolrDeprecationIsCreated();
}
/**
* Loads a Fixture from the Fixtures folder beside the current test case.
*
* @param $fixtureName
*/
protected function importDataSetFromFixture($fixtureName)
{
try {
$this->importDataSet($this->getFixturePathByName($fixtureName));
return;
} catch (\Exception $e) {}
$this->fail(sprintf('Can not import "%s" fixture.', $fixtureName));
}
/**
* Returns the absolute root path to the fixtures.
*
* @return string
* @throws ReflectionException
*/
protected function getFixtureRootPath()
{
return $this->getRuntimeDirectory() . '/Fixtures/';
}
/**
* Returns the absolute path to a fixture file.
*
* @param $fixtureName
* @return string
* @throws ReflectionException
*/
protected function getFixturePathByName($fixtureName)
{
return $this->getFixtureRootPath() . $fixtureName;
}
/**
* Returns the content of a fixture file.
*
* @param string $fixtureName
* @return string
* @throws ReflectionException
*/
protected function getFixtureContentByName($fixtureName)
{
return file_get_contents($this->getFixturePathByName($fixtureName));
}
/**
* @param string $fixtureName
* @throws ReflectionException
*/
protected function importDumpFromFixture($fixtureName)
{
$dumpContent = $this->getFixtureContentByName($fixtureName);
$dumpContent = str_replace(["\r", "\n"], '', $dumpContent);
$queries = GeneralUtility::trimExplode(';', $dumpContent, true);
$connection = $this->getDatabaseConnection();
foreach ($queries as $query) {
$connection->exec($query);
}
}
/**
* Imports an ext_tables.sql definition as done by the install tool.
*
* @param string $fixtureName
* @throws ReflectionException
*/
protected function importExtTablesDefinition($fixtureName)
{
// create fake extension database table and TCA
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
$schemaMigrationService = GeneralUtility::makeInstance(SchemaMigrator::class);
$sqlReader = GeneralUtility::makeInstance(SqlReader::class);
$sqlCode = $this->getFixtureContentByName($fixtureName);
$createTableStatements = $sqlReader->getCreateTableStatementArray($sqlCode);
$updateResult = $schemaMigrationService->install($createTableStatements);
$failedStatements = array_filter($updateResult);
$result = array();
foreach ($failedStatements as $query => $error) {
$result[] = 'Query "' . $query . '" returned "' . $error . '"';
}
if (!empty($result)) {
throw new RuntimeException(implode("\n", $result), 1505058450);
}
$insertStatements = $sqlReader->getInsertStatementArray($sqlCode);
$schemaMigrationService->importStaticData($insertStatements);
}
/**
* Returns the directory on runtime.
*
* @return string
* @throws ReflectionException
*/
protected function getRuntimeDirectory()
{
$rc = new ReflectionClass(get_class($this));
return dirname($rc->getFileName());
}
/**
* @param string $version
*/
protected function skipInVersionBelow($version)
{
if ($this->getIsTYPO3VersionBelow($version)) {
$this->markTestSkipped('This test requires TYPO3 ' . $version . ' or greater.');
}
}
/**
* @param string $version
* @return mixed
*/
protected function getIsTYPO3VersionBelow($version)
{
return version_compare(TYPO3_branch, $version, '<');
}
/**
* @param int $id
* @param string $MP
* @param $language
* @return TypoScriptFrontendController
*/
protected function getConfiguredTSFE($id = 1, $MP = '', $language = 0)
{
/** @var TSFETestBootstrapper $bootstrapper */
$bootstrapper = GeneralUtility::makeInstance(TSFETestBootstrapper::class);
if(Util::getIsTYPO3VersionBelow10()) {
// @todo this part can be dropped when TYPO3 9 support will be dropped
$result = $bootstrapper->legacyBootstrap($id, $MP, $language);
} else {
$result = $bootstrapper->bootstrap($id, $MP, $language);
}
return $result->getTsfe();
}
/**
* @param string $coreName
* @return void
*/
protected function cleanUpSolrServerAndAssertEmpty($coreName = 'core_en')
{
$this->validateTestCoreName($coreName);
// cleanup the solr server
$result = file_get_contents($this->getSolrConnectionUriAuthority() . '/solr/' . $coreName . '/update?stream.body=<delete><query>*:*</query></delete>&commit=true');
if (strpos($result, '<int name="QTime">') == false) {
$this->fail('Could not empty solr test index');
}
// we wait to make sure the document will be deleted in solr
$this->waitToBeVisibleInSolr();
$this->assertSolrIsEmpty();
}
/**
* @param string $coreName
* @return void
*/
protected function waitToBeVisibleInSolr($coreName = 'core_en')
{
$this->validateTestCoreName($coreName);
$url = $this->getSolrConnectionUriAuthority() . '/solr/' . $coreName . '/update?softCommit=true';
get_headers($url);
}
/**
* @param string $coreName
* @throws InvalidArgumentException
*/
protected function validateTestCoreName($coreName)
{
if(!in_array($coreName, $this->testSolrCores)) {
throw new InvalidArgumentException('No valid testcore passed');
}
}
/**
* Assertion to check if the solr server is empty.
*
* @return void
*/
protected function assertSolrIsEmpty()
{
$this->assertSolrContainsDocumentCount(0);
}
/**
* Assertion to check if the solr server contains an expected count of documents.
*
* @param int $documentCount
*/
protected function assertSolrContainsDocumentCount($documentCount)
{
$solrContent = file_get_contents($this->getSolrConnectionUriAuthority() . '/solr/core_en/select?q=*:*');
$this->assertContains('"numFound":' . intval($documentCount), $solrContent, 'Solr contains unexpected amount of documents');
}
/**
* @param string $fixture
* @param array $importPageIds
* @param array $feUserGroupArray
* @throws Exception
* @throws ReflectionException
*/
protected function indexPageIdsFromFixture($fixture, $importPageIds, $feUserGroupArray = [0])
{
$this->importDataSetFromFixture($fixture);
$this->indexPageIds($importPageIds, $feUserGroupArray);
$this->fakeBEUser();
}
/**
* @param array $importPageIds
* @param array $feUserGroupArray
*/
protected function indexPageIds($importPageIds, $feUserGroupArray = [0])
{
foreach ($importPageIds as $importPageId) {
$fakeTSFE = $this->fakeTSFE($importPageId, $feUserGroupArray);
/** @var $pageIndexer Typo3PageIndexer */
$pageIndexer = GeneralUtility::makeInstance(Typo3PageIndexer::class, $fakeTSFE);
$pageIndexer->setPageAccessRootline(Rootline::getAccessRootlineByPageId($importPageId));
$pageIndexer->indexPage();
}
// reset to group 0
$this->simulateFrontedUserGroups([0]);
}
/**
* @param int $isAdmin
* @param int $workspace
* @return BackendUserAuthentication
*/
protected function fakeBEUser($isAdmin = 0, $workspace = 0) {
/** @var $beUser BackendUserAuthentication */
$beUser = GeneralUtility::makeInstance(BackendUserAuthentication::class);
$beUser->user['admin'] = $isAdmin;
$beUser->workspace = $workspace;
$GLOBALS['BE_USER'] = $beUser;
return $beUser;
}
/**
* @param integer $pageId
* @param array $feUserGroupArray
* @return TypoScriptFrontendController
*/
protected function fakeTSFE($pageId, $feUserGroupArray = [0])
{
$GLOBALS['TT'] = $this->getMockBuilder(TimeTracker::class)->disableOriginalConstructor()->getMock();
$_SERVER['HTTP_HOST'] = 'test.local.typo3.org';
$_SERVER['REQUEST_URI'] = '/search.html';
$fakeTSFE = $this->getConfiguredTSFE($pageId);
$fakeTSFE->newCObj();
$GLOBALS['TSFE'] = $fakeTSFE;
$this->simulateFrontedUserGroups($feUserGroupArray);
#$fakeTSFE->preparePageContentGeneration();
if(Util::getIsTYPO3VersionBelow10()) {
PageGenerator::renderContent();
} else {
$request = $GLOBALS['TYPO3_REQUEST'];
$requestHandler = GeneralUtility::makeInstance(RequestHandler::class);
$requestHandler->handle($request);
}
return $fakeTSFE;
}
/**
* @param array $feUserGroupArray
*/
protected function simulateFrontedUserGroups(array $feUserGroupArray)
{
/** @var $context Context::class */
$context = GeneralUtility::makeInstance(Context::class);
$userAspect = $this->getMockBuilder(UserAspect::class)->setMethods([])->getMock();
$userAspect->expects($this->any())->method('get')->willReturnCallback(function($key) use($feUserGroupArray){
if ($key === 'groupIds') {
return $feUserGroupArray;
}
if ($key === 'isLoggedIn') {
return true;
}
/* @var UserAspect $originalUserAspect */
$originalUserAspect = GeneralUtility::makeInstance(UserAspect::class);
return $originalUserAspect->get($key);
});
$userAspect->expects($this->any())->method('getGroupIds')->willReturn($feUserGroupArray);
/* @var UserAspect $userAspect */
$context->setAspect('frontend.user', $userAspect);
}
/**
* Applies in CMS 9.2 introduced error handling.
*/
protected function applyUsingErrorControllerForCMS9andAbove()
{
$GLOBALS['TYPO3_REQUEST'] = new ServerRequest();
}
/**
* Returns the data handler
*
* @return DataHandler
*/
protected function getDataHandler()
{
$GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
/* @var DataHandler $dataHandler */
$dataHandler = GeneralUtility::makeInstance(DataHandler::class);
return $dataHandler;
}
/**
* @return void
*/
protected function writeDefaultSolrTestSiteConfiguration() {
$solrConnectionInfo = $this->getSolrConnectionInfo();
$this->writeDefaultSolrTestSiteConfigurationForHostAndPort($solrConnectionInfo['scheme'], $solrConnectionInfo['host'], $solrConnectionInfo['port']);
}
/**
* @var string
*/
protected static $lastSiteCreated = '';
/**
* @param string $scheme
* @param string $host
* @param int $port
* @return void
*/
protected function writeDefaultSolrTestSiteConfigurationForHostAndPort($scheme = 'http', $host = 'localhost', $port = 8999, $disableDefaultLanguage = false)
{
$siteCreatedHash = md5($scheme . $host . $port . $disableDefaultLanguage);
if (self::$lastSiteCreated === $siteCreatedHash) {
return;
}
$defaultLanguage = $this->buildDefaultLanguageConfiguration('EN', '/en/');
$defaultLanguage['solr_core_read'] = 'core_en';
if ($disableDefaultLanguage === true) {
$defaultLanguage['enabled'] = 0;
}
$german = $this->buildLanguageConfiguration('DE', '/de/', ['EN'], 'fallback');
$german['solr_core_read'] = 'core_de';
$danish = $this->buildLanguageConfiguration('DA', '/da/');
$danish['solr_core_read'] = 'core_da';
$this->writeSiteConfiguration(
'integration_tree_one',
$this->buildSiteConfiguration(1, 'http://testone.site/'),
[
$defaultLanguage, $german, $danish
],
[
$this->buildErrorHandlingConfiguration('Fluid', [404])
]
);
$this->writeSiteConfiguration(
'integration_tree_two',
$this->buildSiteConfiguration(111, 'http://testtwo.site/'),
[
$defaultLanguage, $german, $danish
],
[
$this->buildErrorHandlingConfiguration('Fluid', [404])
]
);
$globalSolrSettings = [
'solr_scheme_read' => $scheme,
'solr_host_read' => $host,
'solr_port_read' => $port,
'solr_timeout_read' => 20,
'solr_path_read' => '/solr/',
'solr_use_write_connection' => false,
];
$this->mergeSiteConfiguration('integration_tree_one', $globalSolrSettings);
$this->mergeSiteConfiguration('integration_tree_two', $globalSolrSettings);
clearstatcache();
usleep(500);
self::$lastSiteCreated = $siteCreatedHash;
}
/**
* This method registers an error handler that fails the testcase when a E_USER_DEPRECATED error
* is thrown with the prefix solr:deprecation
*
* @return void
*/
protected function failWhenSolrDeprecationIsCreated(): void
{
error_reporting(error_reporting() & ~E_USER_DEPRECATED);
set_error_handler(function ($id, $msg) {
if ($id === E_USER_DEPRECATED && strpos($msg, 'solr:deprecation: ') === 0) {
$this->fail("Executed deprecated EXT:solr code: " . $msg);
}
});
}
protected function getSolrConnectionInfo(): array
{
return [
'scheme' => getenv('TESTING_SOLR_SCHEME') ?: 'http',
'host' => getenv('TESTING_SOLR_HOST') ?: 'localhost',
'port' => getenv('TESTING_SOLR_PORT') ?: 8999,
];
}
/**
* Returns solr connection URI authority as string as
* scheme://host:port
*
* @return string
*/
protected function getSolrConnectionUriAuthority(): string
{
$solrConnectionInfo = $this->getSolrConnectionInfo();
return $solrConnectionInfo['scheme'] . '://' . $solrConnectionInfo['host'] . ':' . $solrConnectionInfo['port'];
}
/**
* @return ObjectManagerInterface
*/
protected function getFakeObjectManager(): ObjectManagerInterface
{
if(Util::getIsTYPO3VersionBelow10()) {
$fakeObjectManager = new \ApacheSolrForTypo3\Solr\Tests\Unit\Helper\LegacyFakeObjectManager();
} else {
$fakeObjectManager = new \ApacheSolrForTypo3\Solr\Tests\Unit\Helper\FakeObjectManager();
}
return $fakeObjectManager;
}
}
| {
"pile_set_name": "Github"
} |
# Archive SharpKit.Installer\res\Files.zip
Files\Application\4\LicenseAgreement.rtf
Files\Application\4\SharpKitActivation.exe
Files\Application\4\Assemblies\v3.5\SharpKit.AspNetAjax.dll
Files\Application\4\Assemblies\v3.5\SharpKit.AspNetAjax.XML
Files\Application\4\Assemblies\v3.5\SharpKit.ExtJs-3.1.0.XML
Files\Application\4\Assemblies\v3.5\SharpKit.ExtJs-3.3.1.XML
Files\Application\4\Assemblies\v3.5\SharpKit.ExtJs-4.0.2.XML
Files\Application\4\Assemblies\v3.5\SharpKit.ExtJs.dll
Files\Application\4\Assemblies\v3.5\SharpKit.ExtJs.XML
Files\Application\4\Assemblies\v3.5\SharpKit.Html.dll
Files\Application\4\Assemblies\v3.5\SharpKit.Html.XML
Files\Application\4\Assemblies\v3.5\SharpKit.Html4.dll
Files\Application\4\Assemblies\v3.5\SharpKit.Html4.XML
Files\Application\4\Assemblies\v3.5\SharpKit.Html5.XML
Files\Application\4\Assemblies\v3.5\SharpKit.JavaScript.dll
Files\Application\4\Assemblies\v3.5\SharpKit.JavaScript.XML
Files\Application\4\Assemblies\v3.5\SharpKit.jQTouch.dll
Files\Application\4\Assemblies\v3.5\SharpKit.jQTouch.XML
Files\Application\4\Assemblies\v3.5\SharpKit.jQuery.dll
Files\Application\4\Assemblies\v3.5\SharpKit.jQuery.XML
Files\Application\4\Assemblies\v3.5\SharpKit.jQueryUI.dll
Files\Application\4\Assemblies\v3.5\SharpKit.jQueryUI.XML
Files\Application\4\Assemblies\v3.5\SharpKit.JsClr-4.1.0.XML
Files\Application\4\Assemblies\v3.5\SharpKit.JsClr.dll
Files\Application\4\Assemblies\v3.5\SharpKit.JsClr.XML
Files\Application\4\Assemblies\v3.5\SharpKit.KnockoutJs-1.2.1.dll
Files\Application\4\Assemblies\v3.5\SharpKit.KnockoutJs-1.2.1.XML
Files\Application\4\Assemblies\v3.5\SharpKit.SenchaTouch-2.0.0.dll
Files\Application\4\Assemblies\v3.5\SharpKit.SenchaTouch-2.0.0.XML
Files\Application\4\Assemblies\v3.5\SharpKit.W3C.DOM.XML
Files\Application\4\Assemblies\v4.0\SharpKit.AspNetAjax.dll
Files\Application\4\Assemblies\v4.0\SharpKit.AspNetAjax.XML
Files\Application\4\Assemblies\v4.0\SharpKit.ExtJs-3.1.0.XML
Files\Application\4\Assemblies\v4.0\SharpKit.ExtJs-3.3.1.XML
Files\Application\4\Assemblies\v4.0\SharpKit.ExtJs-4.0.2.XML
Files\Application\4\Assemblies\v4.0\SharpKit.ExtJs.dll
Files\Application\4\Assemblies\v4.0\SharpKit.ExtJs.XML
Files\Application\4\Assemblies\v4.0\SharpKit.Html.dll
Files\Application\4\Assemblies\v4.0\SharpKit.Html.XML
Files\Application\4\Assemblies\v4.0\SharpKit.Html4.dll
Files\Application\4\Assemblies\v4.0\SharpKit.Html4.XML
Files\Application\4\Assemblies\v4.0\SharpKit.Html5.XML
Files\Application\4\Assemblies\v4.0\SharpKit.JavaScript.dll
Files\Application\4\Assemblies\v4.0\SharpKit.JavaScript.XML
Files\Application\4\Assemblies\v4.0\SharpKit.jQTouch.dll
Files\Application\4\Assemblies\v4.0\SharpKit.jQTouch.XML
Files\Application\4\Assemblies\v4.0\SharpKit.jQuery.dll
Files\Application\4\Assemblies\v4.0\SharpKit.jQuery.XML
Files\Application\4\Assemblies\v4.0\SharpKit.jQueryUI.dll
Files\Application\4\Assemblies\v4.0\SharpKit.jQueryUI.XML
Files\Application\4\Assemblies\v4.0\SharpKit.JsClr-4.1.0.XML
Files\Application\4\Assemblies\v4.0\SharpKit.JsClr.dll
Files\Application\4\Assemblies\v4.0\SharpKit.JsClr.xml
Files\Application\4\Assemblies\v4.0\SharpKit.KnockoutJs-1.2.1.dll
Files\Application\4\Assemblies\v4.0\SharpKit.KnockoutJs-1.2.1.XML
Files\Application\4\Assemblies\v4.0\SharpKit.SenchaTouch-2.0.0.dll
Files\Application\4\Assemblies\v4.0\SharpKit.SenchaTouch-2.0.0.XML
Files\Application\4\Assemblies\v4.0\SharpKit.W3C.DOM.XML
Files\Application\4\Assemblies\v4.0\SharpKit.Web.dll
Files\Application\4\Assemblies\v4.0\SharpKit.Web.XML
Files\Application\4\Libraries\aspnetajax-3.5.cs
Files\Application\4\Libraries\extjs-3.1.0.cs
Files\Application\4\Libraries\extjs-3.3.1.cs
Files\Application\4\Libraries\html-4.01.cs
Files\Application\4\Libraries\html-5.cs
Files\Application\4\Libraries\javascript-1.5.cs
Files\Application\4\Libraries\jqtouch-1.beta.cs
Files\Application\4\Libraries\jquery-1.6.4.cs
Files\Application\4\Libraries\jquery-ui-1.8.11.cs
Files\Application\4\Libraries\jquery.validate-1.7.cs
Files\Application\4\Scripts\ext-all-debug-w-comments.js
Files\Application\4\Scripts\ext-all-debug.js
Files\Application\4\Scripts\ext-all.js
Files\Application\4\Scripts\jquery-1.5.1.min.js
Files\Application\4\Scripts\jquery-1.6.4.js
Files\Application\4\Scripts\jquery-1.6.4.min.js
Files\Application\4\Scripts\jquery-ui-1.8.11.custom.min.js
Files\Application\4\Scripts\jsclr-4.0.0.js
Files\Application\4\Scripts\jsclr-4.1.0.js
Files\Application\4\Visual Studio 2010\Templates\Project Templates\Visual C#\SharpKit\SharpKit Web Application.zip
Files\NET\4\CsTransformationParserLibrary.dll
Files\NET\4\SharpKit.Build.targets
Files\NET\4\SharpKit.Build.Tasks
Files\NET\4\SharpKit.Build.Tasks.dll
Files\NET\4\skc4.exe
Files\NET\5\ICSharpCode.NRefactory.CSharp.dll
Files\NET\5\ICSharpCode.NRefactory.dll
Files\NET\5\Mono.Cecil.dll
Files\NET\5\SharpKit.Build.targets
Files\NET\5\SharpKit.Build.Tasks
Files\NET\5\SharpKit.Build.Tasks.dll
Files\NET\5\skc5.exe
Files\NET\5\skc5.exe.config
Files\NET_Unix\4\SharpKit.Build.targets
Files\NET_Unix\5\SharpKit.Build.targets
Files\Templates\SharpKit 5 Web Application.zip
Files\Templates\SharpKit Web Application.zip
#
# Files
# 98
| {
"pile_set_name": "Github"
} |
/*
* Copyright (C) 2008 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.dx.dex.file;
import com.android.dx.rop.annotation.Annotation;
import static com.android.dx.rop.annotation.AnnotationVisibility.SYSTEM;
import com.android.dx.rop.annotation.NameValuePair;
import com.android.dx.rop.cst.Constant;
import com.android.dx.rop.cst.CstAnnotation;
import com.android.dx.rop.cst.CstArray;
import com.android.dx.rop.cst.CstInteger;
import com.android.dx.rop.cst.CstKnownNull;
import com.android.dx.rop.cst.CstMethodRef;
import com.android.dx.rop.cst.CstString;
import com.android.dx.rop.cst.CstType;
import com.android.dx.rop.type.Type;
import com.android.dx.rop.type.TypeList;
import java.util.ArrayList;
/**
* Utility class for dealing with annotations.
*/
public final class AnnotationUtils {
/** {@code non-null;} type for {@code AnnotationDefault} annotations */
private static final CstType ANNOTATION_DEFAULT_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/AnnotationDefault;"));
/** {@code non-null;} type for {@code EnclosingClass} annotations */
private static final CstType ENCLOSING_CLASS_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/EnclosingClass;"));
/** {@code non-null;} type for {@code EnclosingMethod} annotations */
private static final CstType ENCLOSING_METHOD_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/EnclosingMethod;"));
/** {@code non-null;} type for {@code InnerClass} annotations */
private static final CstType INNER_CLASS_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/InnerClass;"));
/** {@code non-null;} type for {@code MemberClasses} annotations */
private static final CstType MEMBER_CLASSES_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/MemberClasses;"));
/** {@code non-null;} type for {@code Signature} annotations */
private static final CstType SIGNATURE_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/Signature;"));
/** {@code non-null;} type for {@code SourceDebugExtension} annotations */
private static final CstType SOURCE_DEBUG_EXTENSION_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/SourceDebugExtension;"));
/** {@code non-null;} type for {@code Throws} annotations */
private static final CstType THROWS_TYPE =
CstType.intern(Type.intern("Ldalvik/annotation/Throws;"));
/** {@code non-null;} the UTF-8 constant {@code "accessFlags"} */
private static final CstString ACCESS_FLAGS_STRING = new CstString("accessFlags");
/** {@code non-null;} the UTF-8 constant {@code "name"} */
private static final CstString NAME_STRING = new CstString("name");
/** {@code non-null;} the UTF-8 constant {@code "value"} */
private static final CstString VALUE_STRING = new CstString("value");
/**
* This class is uninstantiable.
*/
private AnnotationUtils() {
// This space intentionally left blank.
}
/**
* Constructs a standard {@code AnnotationDefault} annotation.
*
* @param defaults {@code non-null;} the defaults, itself as an annotation
* @return {@code non-null;} the constructed annotation
*/
public static Annotation makeAnnotationDefault(Annotation defaults) {
Annotation result = new Annotation(ANNOTATION_DEFAULT_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, new CstAnnotation(defaults)));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code EnclosingClass} annotation.
*
* @param clazz {@code non-null;} the enclosing class
* @return {@code non-null;} the annotation
*/
public static Annotation makeEnclosingClass(CstType clazz) {
Annotation result = new Annotation(ENCLOSING_CLASS_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, clazz));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code EnclosingMethod} annotation.
*
* @param method {@code non-null;} the enclosing method
* @return {@code non-null;} the annotation
*/
public static Annotation makeEnclosingMethod(CstMethodRef method) {
Annotation result = new Annotation(ENCLOSING_METHOD_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, method));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code InnerClass} annotation.
*
* @param name {@code null-ok;} the original name of the class, or
* {@code null} to represent an anonymous class
* @param accessFlags the original access flags
* @return {@code non-null;} the annotation
*/
public static Annotation makeInnerClass(CstString name, int accessFlags) {
Annotation result = new Annotation(INNER_CLASS_TYPE, SYSTEM);
Constant nameCst = (name != null) ? name : CstKnownNull.THE_ONE;
result.put(new NameValuePair(NAME_STRING, nameCst));
result.put(new NameValuePair(ACCESS_FLAGS_STRING,
CstInteger.make(accessFlags)));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code MemberClasses} annotation.
*
* @param types {@code non-null;} the list of (the types of) the member classes
* @return {@code non-null;} the annotation
*/
public static Annotation makeMemberClasses(TypeList types) {
CstArray array = makeCstArray(types);
Annotation result = new Annotation(MEMBER_CLASSES_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, array));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code Signature} annotation.
*
* @param signature {@code non-null;} the signature string
* @return {@code non-null;} the annotation
*/
public static Annotation makeSignature(CstString signature) {
Annotation result = new Annotation(SIGNATURE_TYPE, SYSTEM);
/*
* Split the string into pieces that are likely to be common
* across many signatures and the rest of the file.
*/
String raw = signature.getString();
int rawLength = raw.length();
ArrayList<String> pieces = new ArrayList<String>(20);
for (int at = 0; at < rawLength; /*at*/) {
char c = raw.charAt(at);
int endAt = at + 1;
if (c == 'L') {
// Scan to ';' or '<'. Consume ';' but not '<'.
while (endAt < rawLength) {
c = raw.charAt(endAt);
if (c == ';') {
endAt++;
break;
} else if (c == '<') {
break;
}
endAt++;
}
} else {
// Scan to 'L' without consuming it.
while (endAt < rawLength) {
c = raw.charAt(endAt);
if (c == 'L') {
break;
}
endAt++;
}
}
pieces.add(raw.substring(at, endAt));
at = endAt;
}
int size = pieces.size();
CstArray.List list = new CstArray.List(size);
for (int i = 0; i < size; i++) {
list.set(i, new CstString(pieces.get(i)));
}
list.setImmutable();
result.put(new NameValuePair(VALUE_STRING, new CstArray(list)));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code SourceDebugExtension} annotation.
*
* @param smapString {@code non-null;} the SMAP string associated with
* @return {@code non-null;} the annotation
*/
public static Annotation makeSourceDebugExtension(CstString smapString) {
Annotation result = new Annotation(SOURCE_DEBUG_EXTENSION_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, smapString));
result.setImmutable();
return result;
}
/**
* Constructs a standard {@code Throws} annotation.
*
* @param types {@code non-null;} the list of thrown types
* @return {@code non-null;} the annotation
*/
public static Annotation makeThrows(TypeList types) {
CstArray array = makeCstArray(types);
Annotation result = new Annotation(THROWS_TYPE, SYSTEM);
result.put(new NameValuePair(VALUE_STRING, array));
result.setImmutable();
return result;
}
/**
* Converts a {@link TypeList} to a {@link CstArray}.
*
* @param types {@code non-null;} the type list
* @return {@code non-null;} the corresponding array constant
*/
private static CstArray makeCstArray(TypeList types) {
int size = types.size();
CstArray.List list = new CstArray.List(size);
for (int i = 0; i < size; i++) {
list.set(i, CstType.intern(types.getType(i)));
}
list.setImmutable();
return new CstArray(list);
}
}
| {
"pile_set_name": "Github"
} |
/*
* JBoss, Home of Professional Open Source.
* Copyright 2006, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package com.taobao.datasource.tm;
import java.net.InetAddress;
import javax.transaction.xa.Xid;
import java.net.UnknownHostException;
/**
* XidFactory.java
*
*
* Created: Sat Jun 15 19:01:18 2002
*
* @author <a href="mailto:[email protected]">David Jencks</a>
* @version
*
* @jmx.mbean
*/
public class XidFactory implements XidFactoryMBean
{
/**
* The default value of baseGlobalId is the host name of this host,
* followed by a slash.
*
* This is used for building globally unique transaction identifiers.
* It would be safer to use the IP address, but a host name is better
* for humans to read and will do for now.
* This must be set individually if multiple jboss instances are
* running on the same machine.
*/
private String baseGlobalId;
/**
* The next transaction id to use on this host.
*/
private long globalIdNumber = 0;
/**
* The variable <code>pad</code> says whether the byte[] should be their
* maximum 64 byte length or the minimum.
* The max length is required for Oracle..
*/
private boolean pad = false;
/**
* The variable <code>noBranchQualifier</code> is the 1 or 64 byte zero
* array used for initial xids.
*/
private byte[] noBranchQualifier = new byte[1]; // len > 0, per the XA spec
/**
* This field stores the byte reprsentation of baseGlobalId
* to avoid the expensive getBytes() call on this String object
* when we create a new Xid, which we do VERY often!
*/
private byte[] baseGlobalIdBytes;
public XidFactory()
{
try
{
baseGlobalId = InetAddress.getLocalHost().getHostName();
// Ensure room for 14 digits of serial no.
if (baseGlobalId.length() > Xid.MAXGTRIDSIZE - 15)
baseGlobalId = baseGlobalId.substring(0, Xid.MAXGTRIDSIZE - 15);
baseGlobalId = baseGlobalId + "/";
}
catch (UnknownHostException e)
{
baseGlobalId = "localhost/";
}
baseGlobalIdBytes = baseGlobalId.getBytes();
}
/**
* mbean get-set pair for field BaseGlobalId
* Get the value of BaseGlobalId
* @return value of BaseGlobalId
*
* @jmx:managed-attribute
*/
public String getBaseGlobalId()
{
return baseGlobalId;
}
/**
* Set the value of BaseGlobalId
* @param BaseGlobalId Value to assign to BaseGlobalId
*
* @jmx:managed-attribute
*/
public void setBaseGlobalId(final String baseGlobalId)
{
this.baseGlobalId = baseGlobalId;
baseGlobalIdBytes = baseGlobalId.getBytes();
}
/**
* mbean get-set pair for field globalIdNumber
* Get the value of globalIdNumber
* @return value of globalIdNumber
*
* @jmx:managed-attribute
*/
public synchronized long getGlobalIdNumber()
{
return globalIdNumber;
}
/**
* Set the value of globalIdNumber
* @param globalIdNumber Value to assign to globalIdNumber
*
* @jmx:managed-attribute
*/
public synchronized void setGlobalIdNumber(final long globalIdNumber)
{
this.globalIdNumber = globalIdNumber;
}
/**
* mbean get-set pair for field pad
* Get the value of pad
* @return value of pad
*
* @jmx:managed-attribute
*/
public boolean isPad()
{
return pad;
}
/**
* Set the value of pad
* @param pad Value to assign to pad
*
* @jmx:managed-attribute
*/
public void setPad(boolean pad)
{
this.pad = pad;
if (pad)
noBranchQualifier = new byte[Xid.MAXBQUALSIZE];
else
noBranchQualifier = new byte[1]; // length > 0, per the XA spec
}
/**
* mbean get-set pair for field instance
* Get the value of instance
* @return value of instance
*
* @jmx:managed-attribute
*/
public XidFactoryMBean getInstance()
{
return this;
}
/**
* Describe <code>newXid</code> method here.
*
* @return a <code>XidImpl</code> value
* @jmx.managed-operation
*/
public XidImpl newXid()
{
long localId = getNextId();
String id = Long.toString(localId);
int len = pad?Xid.MAXGTRIDSIZE:id.length()+baseGlobalIdBytes.length;
byte[] globalId = new byte[len];
System.arraycopy(baseGlobalIdBytes, 0, globalId, 0, baseGlobalIdBytes.length);
// this method is deprecated, but does exactly what we need in a very fast way
// the default conversion from String.getBytes() is way too expensive
id.getBytes(0, id.length(), globalId, baseGlobalIdBytes.length);
return new XidImpl(globalId, noBranchQualifier, (int)localId, localId);
}
/**
* Describe <code>newBranch</code> method here.
*
* @param xid a <code>XidImpl</code> value
* @param branchIdNum a <code>long</code> value
* @return a <code>XidImpl</code> value
* @jmx.managed-operation
*/
public XidImpl newBranch(XidImpl xid, long branchIdNum)
{
String id = Long.toString(branchIdNum);
int len = pad?Xid.MAXBQUALSIZE:id.length();
byte[] branchId = new byte[len];
// this method is deprecated, but does exactly what we need in a very fast way
// the default conversion from String.getBytes() is way too expensive
id.getBytes(0, id.length(), branchId, 0);
return new XidImpl(xid, branchId);
}
/**
* Extracts the local id contained in a global id.
*
* @param globalId a global id
* @return the local id extracted from the global id
* @jmx:managed-operation
*/
public long extractLocalIdFrom(byte[] globalId)
{
int i, start;
int len = globalId.length;
for (i = 0; globalId[i++] != (byte)'/'; )
;
start = i;
while (i < len && globalId[i] != 0)
i++;
String globalIdNumber = new String(globalId, 0, start, i - start);
return Long.parseLong(globalIdNumber);
}
/**
* Describe <code>toString</code> method here.
*
* @param xid a <code>Xid</code> value
* @return a <code>String</code> value
* @jmx.managed-operation
*/
public String toString(Xid xid)
{
if (xid instanceof XidImpl)
return XidImpl.toString(xid);
else
return xid.toString();
}
private synchronized long getNextId()
{
return ++globalIdNumber;
}
}
| {
"pile_set_name": "Github"
} |
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
#pragma once
#include "rocksdb/status.h"
namespace ROCKSDB_NAMESPACE {
class DB;
class WriteCallback {
public:
virtual ~WriteCallback() {}
// Will be called while on the write thread before the write executes. If
// this function returns a non-OK status, the write will be aborted and this
// status will be returned to the caller of DB::Write().
virtual Status Callback(DB* db) = 0;
// return true if writes with this callback can be batched with other writes
virtual bool AllowWriteBatching() = 0;
};
} // namespace ROCKSDB_NAMESPACE
| {
"pile_set_name": "Github"
} |
/*
* Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.jmx.snmp;
/**
* This exception is thrown when an error occurs in an <CODE> SnmpSecurityModel </CODE>.
* <p><b>This API is a Sun Microsystems internal API and is subject
* to change without notice.</b></p>
* @since 1.5
*/
public class SnmpSecurityException extends Exception {
private static final long serialVersionUID = 5574448147432833480L;
/**
* The current request varbind list.
*/
public SnmpVarBind[] list = null;
/**
* The status of the exception. See {@link com.sun.jmx.snmp.SnmpDefinitions} for possible values.
*/
public int status = SnmpDefinitions.snmpReqUnknownError;
/**
* The current security model related security parameters.
*/
public SnmpSecurityParameters params = null;
/**
* The current context engine Id.
*/
public byte[] contextEngineId = null;
/**
* The current context name.
*/
public byte[] contextName = null;
/**
* The current flags.
*/
public byte flags = (byte) SnmpDefinitions.noAuthNoPriv;
/**
* Constructor.
* @param msg The exception msg to display.
*/
public SnmpSecurityException(String msg) {
super(msg);
}
}
| {
"pile_set_name": "Github"
} |
%description:
Tests that a channel without base class needs a C++ class of the
same name (as with simple modules)
%file: test.ned
import testlib.Dump;
channel TestChannel { }
module Node { gates: input in[]; output out[]; connections allowunconnected: }
network Test
{
submodules:
a: Node;
b: Node;
dump: Dump {printClassNames=true;}
connections allowunconnected:
a.out++ --> TestChannel --> b.in++;
}
%file: test.cc
#include <omnetpp.h>
using namespace omnetpp;
namespace @TESTNAME@ {
class TestChannel : public cIdealChannel
{
};
Register_Class(TestChannel);
}; //namespace
%contains: stdout
out[0]: --> b.in[0], (TestChannel)channel (@TESTNAME@::TestChannel)
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2012 Red Hat Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: Ben Skeggs
*/
#include <core/client.h>
#include <core/os.h>
#include <core/enum.h>
#include <core/class.h>
#include <core/engctx.h>
#include <core/gpuobj.h>
#include <subdev/fb.h>
#include <engine/fifo.h>
#include <engine/crypt.h>
struct nv84_crypt_priv {
struct nouveau_engine base;
};
/*******************************************************************************
* Crypt object classes
******************************************************************************/
static int
nv84_crypt_object_ctor(struct nouveau_object *parent,
struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
{
struct nouveau_gpuobj *obj;
int ret;
ret = nouveau_gpuobj_create(parent, engine, oclass, 0, parent,
16, 16, 0, &obj);
*pobject = nv_object(obj);
if (ret)
return ret;
nv_wo32(obj, 0x00, nv_mclass(obj));
nv_wo32(obj, 0x04, 0x00000000);
nv_wo32(obj, 0x08, 0x00000000);
nv_wo32(obj, 0x0c, 0x00000000);
return 0;
}
static struct nouveau_ofuncs
nv84_crypt_ofuncs = {
.ctor = nv84_crypt_object_ctor,
.dtor = _nouveau_gpuobj_dtor,
.init = _nouveau_gpuobj_init,
.fini = _nouveau_gpuobj_fini,
.rd32 = _nouveau_gpuobj_rd32,
.wr32 = _nouveau_gpuobj_wr32,
};
static struct nouveau_oclass
nv84_crypt_sclass[] = {
{ 0x74c1, &nv84_crypt_ofuncs },
{}
};
/*******************************************************************************
* PCRYPT context
******************************************************************************/
static struct nouveau_oclass
nv84_crypt_cclass = {
.handle = NV_ENGCTX(CRYPT, 0x84),
.ofuncs = &(struct nouveau_ofuncs) {
.ctor = _nouveau_engctx_ctor,
.dtor = _nouveau_engctx_dtor,
.init = _nouveau_engctx_init,
.fini = _nouveau_engctx_fini,
.rd32 = _nouveau_engctx_rd32,
.wr32 = _nouveau_engctx_wr32,
},
};
/*******************************************************************************
* PCRYPT engine/subdev functions
******************************************************************************/
static const struct nouveau_bitfield nv84_crypt_intr_mask[] = {
{ 0x00000001, "INVALID_STATE" },
{ 0x00000002, "ILLEGAL_MTHD" },
{ 0x00000004, "ILLEGAL_CLASS" },
{ 0x00000080, "QUERY" },
{ 0x00000100, "FAULT" },
{}
};
static void
nv84_crypt_intr(struct nouveau_subdev *subdev)
{
struct nouveau_fifo *pfifo = nouveau_fifo(subdev);
struct nouveau_engine *engine = nv_engine(subdev);
struct nouveau_object *engctx;
struct nv84_crypt_priv *priv = (void *)subdev;
u32 stat = nv_rd32(priv, 0x102130);
u32 mthd = nv_rd32(priv, 0x102190);
u32 data = nv_rd32(priv, 0x102194);
u32 inst = nv_rd32(priv, 0x102188) & 0x7fffffff;
int chid;
engctx = nouveau_engctx_get(engine, inst);
chid = pfifo->chid(pfifo, engctx);
if (stat) {
nv_error(priv, "%s", "");
nouveau_bitfield_print(nv84_crypt_intr_mask, stat);
pr_cont(" ch %d [0x%010llx %s] mthd 0x%04x data 0x%08x\n",
chid, (u64)inst << 12, nouveau_client_name(engctx),
mthd, data);
}
nv_wr32(priv, 0x102130, stat);
nv_wr32(priv, 0x10200c, 0x10);
nouveau_engctx_put(engctx);
}
static int
nv84_crypt_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
{
struct nv84_crypt_priv *priv;
int ret;
ret = nouveau_engine_create(parent, engine, oclass, true,
"PCRYPT", "crypt", &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
nv_subdev(priv)->unit = 0x00004000;
nv_subdev(priv)->intr = nv84_crypt_intr;
nv_engine(priv)->cclass = &nv84_crypt_cclass;
nv_engine(priv)->sclass = nv84_crypt_sclass;
return 0;
}
static int
nv84_crypt_init(struct nouveau_object *object)
{
struct nv84_crypt_priv *priv = (void *)object;
int ret;
ret = nouveau_engine_init(&priv->base);
if (ret)
return ret;
nv_wr32(priv, 0x102130, 0xffffffff);
nv_wr32(priv, 0x102140, 0xffffffbf);
nv_wr32(priv, 0x10200c, 0x00000010);
return 0;
}
struct nouveau_oclass
nv84_crypt_oclass = {
.handle = NV_ENGINE(CRYPT, 0x84),
.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv84_crypt_ctor,
.dtor = _nouveau_engine_dtor,
.init = nv84_crypt_init,
.fini = _nouveau_engine_fini,
},
};
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright © 2019 同程艺龙 ([email protected])
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ly.train</groupId>
<artifactId>flower.registry</artifactId>
<version>1.0.4</version>
</parent>
<artifactId>flower.registry.zookeeper</artifactId>
<dependencies>
<dependency>
<groupId>com.ly.train</groupId>
<artifactId>flower.registry.api</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
| {
"pile_set_name": "Github"
} |
package com.enonic.xp.impl.server.rest.task;
import java.time.Duration;
import java.util.Arrays;
import com.enonic.xp.impl.server.rest.model.VacuumRequestJson;
import com.enonic.xp.impl.server.rest.model.VacuumResultJson;
import com.enonic.xp.impl.server.rest.task.listener.VacuumListenerImpl;
import com.enonic.xp.task.AbstractRunnableTask;
import com.enonic.xp.task.ProgressReporter;
import com.enonic.xp.task.TaskId;
import com.enonic.xp.vacuum.VacuumParameters;
import com.enonic.xp.vacuum.VacuumResult;
import com.enonic.xp.vacuum.VacuumService;
public class VacuumRunnableTask
extends AbstractRunnableTask
{
private static final String[] DEFAULT_VACUUM_TASKS = {"SegmentVacuumTask", "VersionTableVacuumTask"};
private final VacuumService vacuumService;
private VacuumRequestJson params;
private VacuumRunnableTask( Builder builder )
{
super( builder );
this.vacuumService = builder.vacuumService;
this.params = builder.params == null ? new VacuumRequestJson( null, null ) : builder.params;
}
public static Builder create()
{
return new Builder();
}
@Override
public void run( final TaskId id, final ProgressReporter progressReporter )
{
final VacuumParameters vacuumParams = VacuumParameters.create().
vacuumListener( new VacuumListenerImpl( progressReporter ) ).
ageThreshold( params.getAgeThreshold() == null ? null : Duration.parse( params.getAgeThreshold() ) ).
taskNames( params.getTasks() == null ? Arrays.asList( DEFAULT_VACUUM_TASKS ) : params.getTasks() ).
build();
final VacuumResult result = this.vacuumService.vacuum( vacuumParams );
progressReporter.info( VacuumResultJson.from( result ).toString() );
}
public static class Builder
extends AbstractRunnableTask.Builder<Builder>
{
private VacuumService vacuumService;
private VacuumRequestJson params;
public Builder vacuumService( final VacuumService vacuumService )
{
this.vacuumService = vacuumService;
return this;
}
public Builder params( final VacuumRequestJson params )
{
this.params = params;
return this;
}
@Override
public VacuumRunnableTask build()
{
return new VacuumRunnableTask( this );
}
}
}
| {
"pile_set_name": "Github"
} |
var key = 'aes__uncompressed';
var data = {data: [{age: 1}, {age: '2'}]};
var aes_u = new SecureLS({encodingType: 'aes', isCompression: false});
ae = aes_u.AES.encrypt(JSON.stringify(data), 's3cr3t@123');
bde = aes_u.AES.decrypt(ae.toString(), 's3cr3t@123');
de = bde.toString(aes_u.enc._Utf8);
aes_u.set(key, data);
console.log('AES NOT Compressed');
console.log(localStorage.getItem(key));
console.log(aes_u.get(key));
console.log('____________________________________') | {
"pile_set_name": "Github"
} |
/*
* SHA-256 hash implementation and interface functions
* Copyright (c) 2003-2012, Jouni Malinen <[email protected]>
*
* This software may be distributed under the terms of the BSD license.
* See README for more details.
*/
#include "includes.h"
#include "common.h"
#include "sha256.h"
#include "crypto.h"
/**
* hmac_sha256_vector - HMAC-SHA256 over data vector (RFC 2104)
* @key: Key for HMAC operations
* @key_len: Length of the key in bytes
* @num_elem: Number of elements in the data vector
* @addr: Pointers to the data areas
* @len: Lengths of the data blocks
* @mac: Buffer for the hash (32 bytes)
* Returns: 0 on success, -1 on failure
*/
int hmac_sha256_vector(const u8 *key, size_t key_len, size_t num_elem,
const u8 *addr[], const size_t *len, u8 *mac)
{
unsigned char k_pad[64]; /* padding - key XORd with ipad/opad */
unsigned char tk[32];
const u8 *_addr[6];
size_t _len[6], i;
if (num_elem > 5) {
/*
* Fixed limit on the number of fragments to avoid having to
* allocate memory (which could fail).
*/
return -1;
}
/* if key is longer than 64 bytes reset it to key = SHA256(key) */
if (key_len > 64) {
if (sha256_vector(1, &key, &key_len, tk) < 0)
return -1;
key = tk;
key_len = 32;
}
/* the HMAC_SHA256 transform looks like:
*
* SHA256(K XOR opad, SHA256(K XOR ipad, text))
*
* where K is an n byte key
* ipad is the byte 0x36 repeated 64 times
* opad is the byte 0x5c repeated 64 times
* and text is the data being protected */
/* start out by storing key in ipad */
os_memset(k_pad, 0, sizeof(k_pad));
os_memcpy(k_pad, key, key_len);
/* XOR key with ipad values */
for (i = 0; i < 64; i++)
k_pad[i] ^= 0x36;
/* perform inner SHA256 */
_addr[0] = k_pad;
_len[0] = 64;
for (i = 0; i < num_elem; i++) {
_addr[i + 1] = addr[i];
_len[i + 1] = len[i];
}
if (sha256_vector(1 + num_elem, _addr, _len, mac) < 0)
return -1;
os_memset(k_pad, 0, sizeof(k_pad));
os_memcpy(k_pad, key, key_len);
/* XOR key with opad values */
for (i = 0; i < 64; i++)
k_pad[i] ^= 0x5c;
/* perform outer SHA256 */
_addr[0] = k_pad;
_len[0] = 64;
_addr[1] = mac;
_len[1] = SHA256_MAC_LEN;
return sha256_vector(2, _addr, _len, mac);
}
/**
* hmac_sha256 - HMAC-SHA256 over data buffer (RFC 2104)
* @key: Key for HMAC operations
* @key_len: Length of the key in bytes
* @data: Pointers to the data area
* @data_len: Length of the data area
* @mac: Buffer for the hash (32 bytes)
* Returns: 0 on success, -1 on failure
*/
int hmac_sha256(const u8 *key, size_t key_len, const u8 *data,
size_t data_len, u8 *mac)
{
return hmac_sha256_vector(key, key_len, 1, &data, &data_len, mac);
}
| {
"pile_set_name": "Github"
} |
// Modified by Princeton University on June 9th, 2015
// ========== Copyright Header Begin ==========================================
//
// OpenSPARC T1 Processor File: iob_tap_3.tap
// Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES.
//
// The above named program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License version 2 as published by the Free Software Foundation.
//
// The above named program is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this work; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
//
// ========== Copyright Header End ============================================
////////////////////////////////////////////////////////////////////////
//
// Diag Name: iob_tap (iob tap read write)
// Description: This diag contains register map which tap stub
// would use to verify read and write access to
// registers in io space.
//
////////////////////////////////////////////////////////////////////////
DEL 0000000300
WRI 97000000b0 0000000000000000
RDC 97000000b0 0000000000000000 000000000000000f
WRI 97000000b0 5555555555555555
RDC 97000000b0 5555555555555555 000000000000000f
WRI 97000000b0 aaaaaaaaaaaaaaaa
RDC 97000000b0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000000b0 ffffffffffffffff
RDC 97000000b0 ffffffffffffffff 000000000000000f
WRI 97000010b0 0000000000000000
RDC 97000010b0 0000000000000000 000000000000000f
WRI 97000010b0 5555555555555555
RDC 97000010b0 5555555555555555 000000000000000f
WRI 97000010b0 aaaaaaaaaaaaaaaa
RDC 97000010b0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000010b0 ffffffffffffffff
RDC 97000010b0 ffffffffffffffff 000000000000000f
WRI 97000020b0 0000000000000000
RDC 97000020b0 0000000000000000 000000000000000f
WRI 97000020b0 5555555555555555
RDC 97000020b0 5555555555555555 000000000000000f
WRI 97000020b0 aaaaaaaaaaaaaaaa
RDC 97000020b0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000020b0 ffffffffffffffff
RDC 97000020b0 ffffffffffffffff 000000000000000f
WRI 97000030b0 0000000000000000
RDC 97000030b0 0000000000000000 000000000000000f
WRI 97000030b0 5555555555555555
RDC 97000030b0 5555555555555555 000000000000000f
WRI 97000030b0 aaaaaaaaaaaaaaaa
RDC 97000030b0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000030b0 ffffffffffffffff
RDC 97000030b0 ffffffffffffffff 000000000000000f
WRI 97000000b8 0000000000000000
RDC 97000000b8 0000000000000000 000000000000000f
WRI 97000000b8 5555555555555555
RDC 97000000b8 5555555555555555 000000000000000f
WRI 97000000b8 aaaaaaaaaaaaaaaa
RDC 97000000b8 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000000b8 ffffffffffffffff
RDC 97000000b8 ffffffffffffffff 000000000000000f
WRI 97000010b8 0000000000000000
RDC 97000010b8 0000000000000000 000000000000000f
WRI 97000010b8 5555555555555555
RDC 97000010b8 5555555555555555 000000000000000f
WRI 97000010b8 aaaaaaaaaaaaaaaa
RDC 97000010b8 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000010b8 ffffffffffffffff
RDC 97000010b8 ffffffffffffffff 000000000000000f
WRI 97000020b8 0000000000000000
RDC 97000020b8 0000000000000000 000000000000000f
WRI 97000020b8 5555555555555555
RDC 97000020b8 5555555555555555 000000000000000f
WRI 97000020b8 aaaaaaaaaaaaaaaa
RDC 97000020b8 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000020b8 ffffffffffffffff
RDC 97000020b8 ffffffffffffffff 000000000000000f
WRI 97000030b8 0000000000000000
RDC 97000030b8 0000000000000000 000000000000000f
WRI 97000030b8 5555555555555555
RDC 97000030b8 5555555555555555 000000000000000f
WRI 97000030b8 aaaaaaaaaaaaaaaa
RDC 97000030b8 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000030b8 ffffffffffffffff
RDC 97000030b8 ffffffffffffffff 000000000000000f
WRI 97000000c0 0000000000000000
RDC 97000000c0 0000000000000000 000000000000000f
WRI 97000000c0 5555555555555555
RDC 97000000c0 5555555555555555 000000000000000f
WRI 97000000c0 aaaaaaaaaaaaaaaa
RDC 97000000c0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000000c0 ffffffffffffffff
RDC 97000000c0 ffffffffffffffff 000000000000000f
WRI 97000010c0 0000000000000000
RDC 97000010c0 0000000000000000 000000000000000f
WRI 97000010c0 5555555555555555
RDC 97000010c0 5555555555555555 000000000000000f
WRI 97000010c0 aaaaaaaaaaaaaaaa
RDC 97000010c0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000010c0 ffffffffffffffff
RDC 97000010c0 ffffffffffffffff 000000000000000f
WRI 97000020c0 0000000000000000
RDC 97000020c0 0000000000000000 000000000000000f
WRI 97000020c0 5555555555555555
RDC 97000020c0 5555555555555555 000000000000000f
WRI 97000020c0 aaaaaaaaaaaaaaaa
RDC 97000020c0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000020c0 ffffffffffffffff
RDC 97000020c0 ffffffffffffffff 000000000000000f
WRI 97000030c0 0000000000000000
RDC 97000030c0 0000000000000000 000000000000000f
WRI 97000030c0 5555555555555555
RDC 97000030c0 5555555555555555 000000000000000f
WRI 97000030c0 aaaaaaaaaaaaaaaa
RDC 97000030c0 aaaaaaaaaaaaaaaa 000000000000000f
WRI 97000030c0 ffffffffffffffff
RDC 97000030c0 ffffffffffffffff 000000000000000f
WRI 97000000c8 0000000000000000
RDC 97000000c8 0000000000000000 000000000000007f
WRI 97000000c8 5555555555555555
RDC 97000000c8 5555555555555555 000000000000007f
WRI 97000000c8 aaaaaaaaaaaaaaaa
RDC 97000000c8 aaaaaaaaaaaaaaaa 000000000000007f
WRI 97000000c8 ffffffffffffffff
RDC 97000000c8 ffffffffffffffff 000000000000007f
WRI 97000010c8 0000000000000000
RDC 97000010c8 0000000000000000 000000000000007f
WRI 97000010c8 5555555555555555
RDC 97000010c8 5555555555555555 000000000000007f
WRI 97000010c8 aaaaaaaaaaaaaaaa
RDC 97000010c8 aaaaaaaaaaaaaaaa 000000000000007f
WRI 97000010c8 ffffffffffffffff
RDC 97000010c8 ffffffffffffffff 000000000000007f
WRI 97000020c8 0000000000000000
RDC 97000020c8 0000000000000000 000000000000007f
WRI 97000020c8 5555555555555555
RDC 97000020c8 5555555555555555 000000000000007f
WRI 97000020c8 aaaaaaaaaaaaaaaa
RDC 97000020c8 aaaaaaaaaaaaaaaa 000000000000007f
WRI 97000020c8 ffffffffffffffff
RDC 97000020c8 ffffffffffffffff 000000000000007f
WRI 97000030c8 0000000000000000
RDC 97000030c8 0000000000000000 000000000000007f
WRI 97000030c8 5555555555555555
RDC 97000030c8 5555555555555555 000000000000007f
WRI 97000030c8 aaaaaaaaaaaaaaaa
RDC 97000030c8 aaaaaaaaaaaaaaaa 000000000000007f
WRI 97000030c8 ffffffffffffffff
RDC 97000030c8 ffffffffffffffff 000000000000007f
WRI 97000000d0 0000000000000000
RDC 97000000d0 0000000000000000 0000000000000003
WRI 97000000d0 5555555555555555
RDC 97000000d0 5555555555555555 0000000000000003
WRI 97000000d0 aaaaaaaaaaaaaaaa
RDC 97000000d0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000000d0 ffffffffffffffff
RDC 97000000d0 ffffffffffffffff 0000000000000003
WRI 97000010d0 0000000000000000
RDC 97000010d0 0000000000000000 0000000000000003
WRI 97000010d0 5555555555555555
RDC 97000010d0 5555555555555555 0000000000000003
WRI 97000010d0 aaaaaaaaaaaaaaaa
RDC 97000010d0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000010d0 ffffffffffffffff
RDC 97000010d0 ffffffffffffffff 0000000000000003
WRI 97000020d0 0000000000000000
RDC 97000020d0 0000000000000000 0000000000000003
WRI 97000020d0 5555555555555555
RDC 97000020d0 5555555555555555 0000000000000003
WRI 97000020d0 aaaaaaaaaaaaaaaa
RDC 97000020d0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000020d0 ffffffffffffffff
RDC 97000020d0 ffffffffffffffff 0000000000000003
WRI 97000030d0 0000000000000000
RDC 97000030d0 0000000000000000 0000000000000003
WRI 97000030d0 5555555555555555
RDC 97000030d0 5555555555555555 0000000000000003
WRI 97000030d0 aaaaaaaaaaaaaaaa
RDC 97000030d0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000030d0 ffffffffffffffff
RDC 97000030d0 ffffffffffffffff 0000000000000003
WRI 97000000e0 0000000000000000
RDC 97000000e0 0000000000000000 0000000000000003
WRI 97000000e0 5555555555555555
RDC 97000000e0 5555555555555555 0000000000000003
WRI 97000000e0 aaaaaaaaaaaaaaaa
RDC 97000000e0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000000e0 ffffffffffffffff
RDC 97000000e0 ffffffffffffffff 0000000000000003
WRI 97000010e0 0000000000000000
RDC 97000010e0 0000000000000000 0000000000000003
WRI 97000010e0 5555555555555555
RDC 97000010e0 5555555555555555 0000000000000003
WRI 97000010e0 aaaaaaaaaaaaaaaa
RDC 97000010e0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000010e0 ffffffffffffffff
RDC 97000010e0 ffffffffffffffff 0000000000000003
WRI 97000020e0 0000000000000000
RDC 97000020e0 0000000000000000 0000000000000003
WRI 97000020e0 5555555555555555
RDC 97000020e0 5555555555555555 0000000000000003
WRI 97000020e0 aaaaaaaaaaaaaaaa
RDC 97000020e0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000020e0 ffffffffffffffff
RDC 97000020e0 ffffffffffffffff 0000000000000003
WRI 97000030e0 0000000000000000
RDC 97000030e0 0000000000000000 0000000000000003
WRI 97000030e0 5555555555555555
RDC 97000030e0 5555555555555555 0000000000000003
WRI 97000030e0 aaaaaaaaaaaaaaaa
RDC 97000030e0 aaaaaaaaaaaaaaaa 0000000000000003
WRI 97000030e0 ffffffffffffffff
RDC 97000030e0 ffffffffffffffff 0000000000000003
WRI 97000000e8 0000000000000000
RDC 97000000e8 0000000000000000 00000000000000ff
WRI 97000000e8 5555555555555555
RDC 97000000e8 5555555555555555 00000000000000ff
WRI 97000000e8 aaaaaaaaaaaaaaaa
RDC 97000000e8 aaaaaaaaaaaaaaaa 00000000000000ff
WRI 97000000e8 ffffffffffffffff
RDC 97000000e8 ffffffffffffffff 00000000000000ff
WRI 97000010e8 0000000000000000
RDC 97000010e8 0000000000000000 00000000000000ff
WRI 97000010e8 5555555555555555
RDC 97000010e8 5555555555555555 00000000000000ff
WRI 97000010e8 aaaaaaaaaaaaaaaa
RDC 97000010e8 aaaaaaaaaaaaaaaa 00000000000000ff
WRI 97000010e8 ffffffffffffffff
RDC 97000010e8 ffffffffffffffff 00000000000000ff
WRI 97000020e8 0000000000000000
RDC 97000020e8 0000000000000000 00000000000000ff
WRI 97000020e8 5555555555555555
RDC 97000020e8 5555555555555555 00000000000000ff
WRI 97000020e8 aaaaaaaaaaaaaaaa
RDC 97000020e8 aaaaaaaaaaaaaaaa 00000000000000ff
WRI 97000020e8 ffffffffffffffff
RDC 97000020e8 ffffffffffffffff 00000000000000ff
WRI 97000030e8 0000000000000000
RDC 97000030e8 0000000000000000 00000000000000ff
WRI 97000030e8 5555555555555555
RDC 97000030e8 5555555555555555 00000000000000ff
WRI 97000030e8 aaaaaaaaaaaaaaaa
RDC 97000030e8 aaaaaaaaaaaaaaaa 00000000000000ff
WRI 97000030e8 ffffffffffffffff
RDC 97000030e8 ffffffffffffffff 00000000000000ff
| {
"pile_set_name": "Github"
} |
#!/usr/bin/env python
import inspect
import os
import random
import sys
import matplotlib.cm as cmx
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import matplotlib.legend as lgd
import matplotlib.markers as mks
def get_log_parsing_script():
dirname = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
return dirname + '/parse_log.sh'
def get_log_file_suffix():
return '.log'
def get_chart_type_description_separator():
return ' vs. '
def is_x_axis_field(field):
x_axis_fields = ['Iters', 'Seconds']
return field in x_axis_fields
def create_field_index():
train_key = 'Train'
test_key = 'Test'
field_index = {train_key:{'Iters':0, 'Seconds':1, train_key + ' loss':2,
train_key + ' learning rate':3},
test_key:{'Iters':0, 'Seconds':1, test_key + ' accuracy':2,
test_key + ' loss':3}}
fields = set()
for data_file_type in field_index.keys():
fields = fields.union(set(field_index[data_file_type].keys()))
fields = list(fields)
fields.sort()
return field_index, fields
def get_supported_chart_types():
field_index, fields = create_field_index()
num_fields = len(fields)
supported_chart_types = []
for i in xrange(num_fields):
if not is_x_axis_field(fields[i]):
for j in xrange(num_fields):
if i != j and is_x_axis_field(fields[j]):
supported_chart_types.append('%s%s%s' % (
fields[i], get_chart_type_description_separator(),
fields[j]))
return supported_chart_types
def get_chart_type_description(chart_type):
supported_chart_types = get_supported_chart_types()
chart_type_description = supported_chart_types[chart_type]
return chart_type_description
def get_data_file_type(chart_type):
description = get_chart_type_description(chart_type)
data_file_type = description.split()[0]
return data_file_type
def get_data_file(chart_type, path_to_log):
return os.path.basename(path_to_log) + '.' + get_data_file_type(chart_type).lower()
def get_field_descriptions(chart_type):
description = get_chart_type_description(chart_type).split(
get_chart_type_description_separator())
y_axis_field = description[0]
x_axis_field = description[1]
return x_axis_field, y_axis_field
def get_field_indecies(x_axis_field, y_axis_field):
data_file_type = get_data_file_type(chart_type)
fields = create_field_index()[0][data_file_type]
return fields[x_axis_field], fields[y_axis_field]
def load_data(data_file, field_idx0, field_idx1):
data = [[], []]
with open(data_file, 'r') as f:
for line in f:
line = line.strip()
if line[0] != '#':
fields = line.split()
data[0].append(float(fields[field_idx0].strip()))
data[1].append(float(fields[field_idx1].strip()))
return data
def random_marker():
markers = mks.MarkerStyle.markers
num = len(markers.values())
idx = random.randint(0, num - 1)
return markers.values()[idx]
def get_data_label(path_to_log):
label = path_to_log[path_to_log.rfind('/')+1 : path_to_log.rfind(
get_log_file_suffix())]
return label
def get_legend_loc(chart_type):
x_axis, y_axis = get_field_descriptions(chart_type)
loc = 'lower right'
if y_axis.find('accuracy') != -1:
pass
if y_axis.find('loss') != -1 or y_axis.find('learning rate') != -1:
loc = 'upper right'
return loc
def plot_chart(chart_type, path_to_png, path_to_log_list):
for path_to_log in path_to_log_list:
os.system('%s %s' % (get_log_parsing_script(), path_to_log))
data_file = get_data_file(chart_type, path_to_log)
x_axis_field, y_axis_field = get_field_descriptions(chart_type)
x, y = get_field_indecies(x_axis_field, y_axis_field)
data = load_data(data_file, x, y)
## TODO: more systematic color cycle for lines
color = [random.random(), random.random(), random.random()]
label = get_data_label(path_to_log)
linewidth = 0.75
## If there too many datapoints, do not use marker.
## use_marker = False
use_marker = True
if not use_marker:
plt.plot(data[0], data[1], label = label, color = color,
linewidth = linewidth)
else:
ok = False
## Some markers throw ValueError: Unrecognized marker style
while not ok:
try:
marker = random_marker()
plt.plot(data[0], data[1], label = label, color = color,
marker = marker, linewidth = linewidth)
ok = True
except:
pass
legend_loc = get_legend_loc(chart_type)
plt.legend(loc = legend_loc, ncol = 1) # ajust ncol to fit the space
plt.title(get_chart_type_description(chart_type))
plt.xlabel(x_axis_field)
plt.ylabel(y_axis_field)
plt.savefig(path_to_png)
plt.show()
def print_help():
print """This script mainly serves as the basis of your customizations.
Customization is a must.
You can copy, paste, edit them in whatever way you want.
Be warned that the fields in the training log may change in the future.
You had better check the data files and change the mapping from field name to
field index in create_field_index before designing your own plots.
Usage:
./plot_log.sh chart_type[0-%s] /where/to/save.png /path/to/first.log ...
Notes:
1. Supporting multiple logs.
2. Log file name must end with the lower-cased "%s".
Supported chart types:""" % (len(get_supported_chart_types()) - 1,
get_log_file_suffix())
supported_chart_types = get_supported_chart_types()
num = len(supported_chart_types)
for i in xrange(num):
print ' %d: %s' % (i, supported_chart_types[i])
exit
def is_valid_chart_type(chart_type):
return chart_type >= 0 and chart_type < len(get_supported_chart_types())
if __name__ == '__main__':
if len(sys.argv) < 4:
print_help()
else:
chart_type = int(sys.argv[1])
if not is_valid_chart_type(chart_type):
print_help()
path_to_png = sys.argv[2]
if not path_to_png.endswith('.png'):
print 'Path must ends with png' % path_to_png
exit
path_to_logs = sys.argv[3:]
for path_to_log in path_to_logs:
if not os.path.exists(path_to_log):
print 'Path does not exist: %s' % path_to_log
exit
if not path_to_log.endswith(get_log_file_suffix()):
print_help()
## plot_chart accpets multiple path_to_logs
plot_chart(chart_type, path_to_png, path_to_logs)
| {
"pile_set_name": "Github"
} |
好奇心原文链接:[“极受欢迎”的一部加缪传记,展现了他迷人的一生_文化_好奇心日报-曾梦龙](https://www.qdaily.com/articles/49232.html)
WebArchive归档链接:[“极受欢迎”的一部加缪传记,展现了他迷人的一生_文化_好奇心日报-曾梦龙](http://web.archive.org/web/20180531155421/http://www.qdaily.com:80/articles/49232.html)
 | {
"pile_set_name": "Github"
} |
itk_wrap_class("itk::TikhonovDeconvolutionImageFilter" POINTER)
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2 "2;3;4")
itk_end_wrap_class()
| {
"pile_set_name": "Github"
} |
//===-- ElimAvailExtern.cpp - DCE unreachable internal functions
//----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This transform is designed to eliminate available external global
// definitions from the program, turning them into declarations.
//
//===----------------------------------------------------------------------===//
#include "llvm/Transforms/IPO/ElimAvailExtern.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Utils/GlobalStatus.h"
#include "llvm/Pass.h"
using namespace llvm;
#define DEBUG_TYPE "elim-avail-extern"
STATISTIC(NumFunctions, "Number of functions removed");
STATISTIC(NumVariables, "Number of global variables removed");
static bool eliminateAvailableExternally(Module &M) {
bool Changed = false;
// Drop initializers of available externally global variables.
for (GlobalVariable &GV : M.globals()) {
if (!GV.hasAvailableExternallyLinkage())
continue;
if (GV.hasInitializer()) {
Constant *Init = GV.getInitializer();
GV.setInitializer(nullptr);
if (isSafeToDestroyConstant(Init))
Init->destroyConstant();
}
GV.removeDeadConstantUsers();
GV.setLinkage(GlobalValue::ExternalLinkage);
NumVariables++;
Changed = true;
}
// Drop the bodies of available externally functions.
for (Function &F : M) {
if (!F.hasAvailableExternallyLinkage())
continue;
if (!F.isDeclaration())
// This will set the linkage to external
F.deleteBody();
F.removeDeadConstantUsers();
NumFunctions++;
Changed = true;
}
return Changed;
}
PreservedAnalyses
EliminateAvailableExternallyPass::run(Module &M, ModuleAnalysisManager &) {
if (!eliminateAvailableExternally(M))
return PreservedAnalyses::all();
return PreservedAnalyses::none();
}
namespace {
struct EliminateAvailableExternallyLegacyPass : public ModulePass {
static char ID; // Pass identification, replacement for typeid
EliminateAvailableExternallyLegacyPass() : ModulePass(ID) {
initializeEliminateAvailableExternallyLegacyPassPass(
*PassRegistry::getPassRegistry());
}
// run - Do the EliminateAvailableExternally pass on the specified module,
// optionally updating the specified callgraph to reflect the changes.
//
bool runOnModule(Module &M) {
if (skipModule(M))
return false;
return eliminateAvailableExternally(M);
}
};
}
char EliminateAvailableExternallyLegacyPass::ID = 0;
INITIALIZE_PASS(EliminateAvailableExternallyLegacyPass, "elim-avail-extern",
"Eliminate Available Externally Globals", false, false)
ModulePass *llvm::createEliminateAvailableExternallyPass() {
return new EliminateAvailableExternallyLegacyPass();
}
| {
"pile_set_name": "Github"
} |
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.oslogin.v1beta.model;
/**
* The POSIX account information associated with a Google account.
*
* <p> This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Cloud OS Login API. For a detailed explanation see:
* <a href="https://developers.google.com/api-client-library/java/google-http-java-client/json">https://developers.google.com/api-client-library/java/google-http-java-client/json</a>
* </p>
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class PosixAccount extends com.google.api.client.json.GenericJson {
/**
* Output only. A POSIX account identifier.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String accountId;
/**
* The GECOS (user information) entry for this account.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String gecos;
/**
* The default group ID.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long gid;
/**
* The path to the home directory for this account.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String homeDirectory;
/**
* The operating system type where this account applies.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String operatingSystemType;
/**
* Only one POSIX account can be marked as primary.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Boolean primary;
/**
* The path to the logic shell for this account.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String shell;
/**
* System identifier for which account the username or uid applies to. By default, the empty value
* is used.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String systemId;
/**
* The user ID.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key @com.google.api.client.json.JsonString
private java.lang.Long uid;
/**
* The username of the POSIX account.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String username;
/**
* Output only. A POSIX account identifier.
* @return value or {@code null} for none
*/
public java.lang.String getAccountId() {
return accountId;
}
/**
* Output only. A POSIX account identifier.
* @param accountId accountId or {@code null} for none
*/
public PosixAccount setAccountId(java.lang.String accountId) {
this.accountId = accountId;
return this;
}
/**
* The GECOS (user information) entry for this account.
* @return value or {@code null} for none
*/
public java.lang.String getGecos() {
return gecos;
}
/**
* The GECOS (user information) entry for this account.
* @param gecos gecos or {@code null} for none
*/
public PosixAccount setGecos(java.lang.String gecos) {
this.gecos = gecos;
return this;
}
/**
* The default group ID.
* @return value or {@code null} for none
*/
public java.lang.Long getGid() {
return gid;
}
/**
* The default group ID.
* @param gid gid or {@code null} for none
*/
public PosixAccount setGid(java.lang.Long gid) {
this.gid = gid;
return this;
}
/**
* The path to the home directory for this account.
* @return value or {@code null} for none
*/
public java.lang.String getHomeDirectory() {
return homeDirectory;
}
/**
* The path to the home directory for this account.
* @param homeDirectory homeDirectory or {@code null} for none
*/
public PosixAccount setHomeDirectory(java.lang.String homeDirectory) {
this.homeDirectory = homeDirectory;
return this;
}
/**
* The operating system type where this account applies.
* @return value or {@code null} for none
*/
public java.lang.String getOperatingSystemType() {
return operatingSystemType;
}
/**
* The operating system type where this account applies.
* @param operatingSystemType operatingSystemType or {@code null} for none
*/
public PosixAccount setOperatingSystemType(java.lang.String operatingSystemType) {
this.operatingSystemType = operatingSystemType;
return this;
}
/**
* Only one POSIX account can be marked as primary.
* @return value or {@code null} for none
*/
public java.lang.Boolean getPrimary() {
return primary;
}
/**
* Only one POSIX account can be marked as primary.
* @param primary primary or {@code null} for none
*/
public PosixAccount setPrimary(java.lang.Boolean primary) {
this.primary = primary;
return this;
}
/**
* The path to the logic shell for this account.
* @return value or {@code null} for none
*/
public java.lang.String getShell() {
return shell;
}
/**
* The path to the logic shell for this account.
* @param shell shell or {@code null} for none
*/
public PosixAccount setShell(java.lang.String shell) {
this.shell = shell;
return this;
}
/**
* System identifier for which account the username or uid applies to. By default, the empty value
* is used.
* @return value or {@code null} for none
*/
public java.lang.String getSystemId() {
return systemId;
}
/**
* System identifier for which account the username or uid applies to. By default, the empty value
* is used.
* @param systemId systemId or {@code null} for none
*/
public PosixAccount setSystemId(java.lang.String systemId) {
this.systemId = systemId;
return this;
}
/**
* The user ID.
* @return value or {@code null} for none
*/
public java.lang.Long getUid() {
return uid;
}
/**
* The user ID.
* @param uid uid or {@code null} for none
*/
public PosixAccount setUid(java.lang.Long uid) {
this.uid = uid;
return this;
}
/**
* The username of the POSIX account.
* @return value or {@code null} for none
*/
public java.lang.String getUsername() {
return username;
}
/**
* The username of the POSIX account.
* @param username username or {@code null} for none
*/
public PosixAccount setUsername(java.lang.String username) {
this.username = username;
return this;
}
@Override
public PosixAccount set(String fieldName, Object value) {
return (PosixAccount) super.set(fieldName, value);
}
@Override
public PosixAccount clone() {
return (PosixAccount) super.clone();
}
}
| {
"pile_set_name": "Github"
} |
package com.github.davidmoten.rx2.internal.flowable.buffertofile;
import java.io.File;
import java.nio.ByteOrder;
import java.util.concurrent.Callable;
import java.util.concurrent.atomic.AtomicInteger;
import com.github.davidmoten.guavamini.Preconditions;
@SuppressWarnings("serial")
// non-final class for unit testing
public class PagedQueue extends AtomicInteger {
private static final boolean isLittleEndian = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
private static final int EXTRA_PADDING_LIMIT = 64;
private static final int SIZE_MESSAGE_SIZE_FIELD = 4;
private static final int SIZE_PADDING_SIZE_FIELD = 1;
private static final int SIZE_MESSAGE_TYPE_FIELD = 1;
private static final int ALIGN_BYTES = 4;
private static final int MAX_PADDING_PER_FULL_MESSAGE = 32;
private static final int SIZE_HEADER_PRIMARY_PART = SIZE_MESSAGE_SIZE_FIELD + SIZE_MESSAGE_TYPE_FIELD
+ SIZE_PADDING_SIZE_FIELD;
private final Pages pages;
private boolean readingFragments;
private byte[] messageBytesAccumulated;
private int indexBytesAccumulated;
public PagedQueue(Callable<File> fileFactory, int pageSize) {
this.pages = new Pages(fileFactory, pageSize);
}
public void offer(byte[] bytes) {
if (getAndIncrement() != 0) {
return;
}
try {
int padding = padding(bytes.length);
int avail = pages.avail();
int fullMessageSize = fullMessageSize(bytes.length, padding);
// header plus 4 bytes
int availAfter = avail - fullMessageSize;
if (availAfter >= 0) {
if (availAfter <= MAX_PADDING_PER_FULL_MESSAGE) {
padding += availAfter;
}
writeFullMessage(bytes, padding);
} else {
writeFragments(bytes, avail);
}
} finally {
decrementAndGet();
}
}
private void writeFullMessage(byte[] bytes, int padding) {
write(bytes, 0, bytes.length, padding, MessageType.FULL_MESSAGE, bytes.length);
}
private void writeFragments(byte[] bytes, int avail) {
int start = 0;
int length = bytes.length;
do {
int extraHeaderBytes = start == 0 ? 4 : 0;
int count = Math.min(avail - 8 - extraHeaderBytes, length);
int padding = padding(count);
int remaining = Math.max(0, avail - count - 6 - padding - extraHeaderBytes);
if (remaining <= EXTRA_PADDING_LIMIT)
padding += remaining;
// System.out.println(String.format(
// "length=%s,start=%s,count=%s,padding=%s,remaining=%s,extraHeaderBytes=%s",
// length, start, count, padding, remaining, extraHeaderBytes));
write(bytes, start, count, padding, MessageType.FRAGMENT, bytes.length);
start += count;
length -= count;
if (length > 0) {
avail = pages.avail();
}
} while (length > 0);
}
private int fullMessageSize(int payloadLength, int padding) {
return SIZE_HEADER_PRIMARY_PART + padding + payloadLength;
}
private static int padding(int payloadLength) {
int rem = (payloadLength + SIZE_PADDING_SIZE_FIELD + SIZE_MESSAGE_TYPE_FIELD) % ALIGN_BYTES;
int padding;
if (rem == 0) {
padding = 0;
} else {
padding = ALIGN_BYTES - rem;
}
return padding;
}
private void write(byte[] bytes, int offset, int length, int padding, final MessageType messageType,
int totalLength) {
Preconditions.checkArgument(length != 0);
pages.markForRewriteAndAdvance4Bytes();// messageSize left as 0
// storeFence not required at this point like Aeron uses.
// UnsafeAccess.unsafe().storeFence();
// TODO optimize for BigEndian as well
if (padding == 2 && isLittleEndian) {
pages.putInt(((messageType.value() & 0xFF) << 0) | (((byte) padding)) << 8);
} else {
pages.putByte(messageType.value()); // message type
pages.putByte((byte) padding);
if (padding > 0) {
pages.moveWritePosition(padding);
}
}
if (messageType == MessageType.FRAGMENT && offset == 0) {
// first fragment only of a sequence of fragments
pages.putInt(totalLength);
}
pages.put(bytes, offset, length);
// now that the message bytes are written we can set the length field in
// the header to indicate that the message is ready to be read
pages.putIntOrderedAtRewriteMark(length);
}
public byte[] poll() {
// loop here accumulating fragments if necessary
while (true) {
int length = pages.getIntVolatile();
if (length == 0) {
// not ready for read
pages.moveReadPosition(-4);
return null;
} else if (length == -1) {
// at end of read queue
// System.out.println("at end of read queue");
return null;
} else {
MessageType messageType;
byte padding;
if (length % 4 == 0 && isLittleEndian) {
// read message type and padding in one int read
int i = pages.getInt();
messageType = MessageType.from((byte) i);
padding = (byte) ((i >> 8) & 0xFF);
if (padding > 2) {
pages.moveReadPosition(padding - 2);
}
} else {
// read message type and padding separately
messageType = MessageType.from(pages.getByte());
padding = pages.getByte();
if (padding > 0) {
pages.moveReadPosition(padding);
}
}
if (!readingFragments && messageType == MessageType.FRAGMENT) {
// is first fragment
int lengthRemaining = pages.getInt();
if (messageBytesAccumulated == null) {
messageBytesAccumulated = new byte[lengthRemaining];
indexBytesAccumulated = 0;
}
readingFragments = true;
}
byte[] result = pages.get(length);
if (result.length == 0) {
return null;
} else {
if (readingFragments) {
System.arraycopy(result, 0, messageBytesAccumulated, indexBytesAccumulated, result.length);
indexBytesAccumulated += result.length;
if (indexBytesAccumulated == messageBytesAccumulated.length) {
readingFragments = false;
byte[] b = messageBytesAccumulated;
messageBytesAccumulated = null;
return b;
}
} else {
return result;
}
}
}
}
}
private void closeWrite() {
incrementAndGet();
while (!compareAndSet(1, 2))
;
}
public void close() {
// to get to here no more reads will happen because close is called from
// the drain loop
closeWrite();
pages.close();
messageBytesAccumulated = null;
}
private static enum MessageType {
FULL_MESSAGE(0), FRAGMENT(1);
private final byte value;
private MessageType(int value) {
this.value = (byte) value;
}
byte value() {
return value;
}
static MessageType from(byte b) {
if (b == 0)
return MessageType.FULL_MESSAGE;
else if (b == 1)
return MessageType.FRAGMENT;
else
throw new RuntimeException("unexpected");
}
}
}
| {
"pile_set_name": "Github"
} |
name: "Daniel Berman"
twitter: "proudboffin"
bio: "Daniel is Product Evangelist at Logz.io, talking and writing about ELK, Docker and AWS. Daniel is a regular contributor to SitePoint and DZone and the organizer of TLV-PHP Meetup, Tel Aviv Elasticsearch and DevOpsDays Tel Aviv. Outside work - Daniel is busy raising his 3 children, running and routing for Liverpool FC." | {
"pile_set_name": "Github"
} |
<?php
/*
* This file is part of the Ivory Google Map package.
*
* (c) Eric GELOEN <[email protected]>
*
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Ivory\Tests\GoogleMap\Service\Place\Autocomplete\Request;
use Ivory\GoogleMap\Service\Place\Autocomplete\Request\AbstractPlaceAutocompleteRequest;
use Ivory\GoogleMap\Service\Place\Autocomplete\Request\PlaceAutocompleteQueryRequest;
/**
* @author GeLo <[email protected]>
*/
class PlaceAutocompleteQueryRequestTest extends \PHPUnit_Framework_TestCase
{
/**
* @var PlaceAutocompleteQueryRequest
*/
private $request;
/**
* @var string
*/
private $input;
/**
* {@inheritdoc}
*/
protected function setUp()
{
$this->request = new PlaceAutocompleteQueryRequest($this->input = 'input');
}
public function testInheritance()
{
$this->assertInstanceOf(AbstractPlaceAutocompleteRequest::class, $this->request);
}
public function testDefaultState()
{
$this->assertSame($this->input, $this->request->getInput());
$this->assertFalse($this->request->hasOffset());
$this->assertNull($this->request->getOffset());
$this->assertFalse($this->request->hasLocation());
$this->assertNull($this->request->getLocation());
$this->assertFalse($this->request->hasRadius());
$this->assertNull($this->request->getRadius());
$this->assertFalse($this->request->hasLanguage());
$this->assertNull($this->request->getLanguage());
}
}
| {
"pile_set_name": "Github"
} |
Browsing
========
While the web app interface is designed to be intuitive, it would be great
to have some documentation. Contributions are welcome!
..
TODO: Add the following? Make sure it is correct.
Tags are one of the main organizing principles of the knowledge repo web app, and it is important to have high integrity on these tag names. For example, having one post tagged as "my_project" and another as "my-project" or "my_projects" prevents these posts from being organized together.
We currently have two ways to maintain tag integrity:
- Browse the `/cluster?group_by=tags` endpoint to find and match existing tags.
- After contributing, organize tags in batch with the `/batch_tags` end point.
| {
"pile_set_name": "Github"
} |
--- a/package.json
+++ b/package.json
@@ -32,7 +32,6 @@
"readmeFilename": "README.md",
"dependencies": {
"async-retry": "^1.2.1",
- "debug": "^3.1.0",
- "epoll": "^2.0.10"
+ "debug": "^3.1.0"
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="club_record_ds_lb_endpoint">
<loadbalance algorithm="org.apache.synapse.endpoints.algorithms.RoundRobin">
<endpoint>
<address uri="http://10.100.2.122:9766/services/ClubDataDS1/"/>
</endpoint>
<endpoint>
<address uri="http://10.100.2.122:9766/services/ClubDataDS1/"/>
</endpoint>
</loadbalance>
</endpoint>
| {
"pile_set_name": "Github"
} |
/*
Copyright 2014 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package rest defines common logic around changes to Kubernetes-style resources.
package rest // import "k8s.io/apiserver/pkg/registry/rest"
| {
"pile_set_name": "Github"
} |
import os
def main():
path = os.path.splitext(get_idb_path())[0] + '.idc'
gen_file(OFILE_IDC, path, 0, 0, GENFLG_IDCTYPE)
Exit(0)
if ( __name__ == "__main__" ):
main()
| {
"pile_set_name": "Github"
} |
dnl acinclude.m4. Change *this* file to add new or change macros.
dnl When changes have been made, delete aclocal.m4 and run
dnl "aclocal".
dnl
dnl DO NOT change aclocal.m4 !
dnl
dnl-----------------------------------------------------------------------------
dnl LA_SEARCH_FILE(variable, filename, PATH)
dnl Search "filename" in the specified "PATH", "variable" will
dnl contain the full pathname or the empty string
dnl PATH is space-separated list of directories.
dnl by Florian Bomers
dnl-----------------------------------------------------------------------------
AC_DEFUN(LA_SEARCH_FILE,[
$1=
dnl hack: eliminate line feeds in $2
for FILE in $2; do
for DIR in $3; do
dnl use PATH in order
if test ".$1"="." && test -f "$DIR/$FILE"; then
$1=$DIR
fi
done
done
])
dnl-----------------------------------------------------------------------------
dnl LA_SEARCH_LIB(lib-variable, include-variable, lib-filename, header-filename, prefix)
dnl looks for "lib-filename" and "header-filename" in the area of "prefix".
dnl if found, "lib-variable" and "include-variable" are set to the
dnl respective paths.
dnl prefix is a single path
dnl libs are searched in prefix, prefix/lib
dnl headers are searched in prefix, prefix/include,
dnl
dnl If one of them is not found, both "lib-variable", "include-variable" are
dnl set to the empty string.
dnl
dnl TODO: assert function call to verify lib
dnl
dnl by Florian Bomers
dnl-----------------------------------------------------------------------------
AC_DEFUN(LA_SEARCH_LIB,[
dnl look for lib
LA_SEARCH_FILE($1, $3, $5 $5/lib )
dnl look for header.
LA_SEARCH_FILE($2, $4, $5 $5/include )
if test ".$1" = "." || test ".$2" = "."; then
$1=
$2=
fi
])
dnl-----------------------------------------------------------------------------
dnl funky posix threads checking, thanks to
dnl Steven G. Johnson <[email protected]>
dnl and Alejandro Forero Cuervo <[email protected]>
dnl see http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html
dnl-----------------------------------------------------------------------------
AC_DEFUN([ACX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_SAVE
AC_LANG_C
acx_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
AC_MSG_RESULT($acx_pthread_ok)
if test x"$acx_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all.
acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# pthread: Linux, etcetera
# --thread-safe: KAI C++
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthread or
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
;;
esac
if test x"$acx_pthread_ok" = xno; then
for flag in $acx_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_TRY_LINK([#include <pthread.h>],
[pthread_t th; pthread_join(th, 0);
pthread_attr_init(0); pthread_cleanup_push(0, 0);
pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
[acx_pthread_ok=yes])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($acx_pthread_ok)
if test "x$acx_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$acx_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: threads are created detached by default
# and the JOINABLE attribute has a nonstandard name (UNDETACHED).
AC_MSG_CHECKING([for joinable pthread attribute])
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_JOINABLE;],
ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
if test x"$ok" = xunknown; then
AC_TRY_LINK([#include <pthread.h>],
[int attr=PTHREAD_CREATE_UNDETACHED;],
ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
fi
if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
[Define to the necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_RESULT(${ok})
if test x"$ok" = xunknown; then
AC_MSG_WARN([we do not know how to create joinable pthreads])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
*solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with cc_r
AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$acx_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
acx_pthread_ok=no
$2
fi
AC_LANG_RESTORE
])dnl ACX_PTHREAD
| {
"pile_set_name": "Github"
} |
//
// NSException+GHTestFailureExceptions.h
//
// Created by Johannes Rudolph on 23.09.09.
// Copyright 2009. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
//! @cond DEV
//
// Portions of this file fall under the following license, marked with:
// GTM_BEGIN : GTM_END
//
// Copyright 2008 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
//
extern NSString *const GHTestFilenameKey;
extern NSString *const GHTestLineNumberKey;
extern NSString *const GHTestFailureException;
// GTM_BEGIN
#import <Foundation/Foundation.h>
@interface NSException(GHUTestFailureExceptions)
+ (NSException *)ghu_failureInFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInCondition:(NSString *)condition
isTrue:(BOOL)isTrue
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInEqualityBetweenObject:(id)left
andObject:(id)right
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInInequalityBetweenObject:(id)left
andObject:(id)right
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInEqualityBetweenValue:(NSValue *)left
andValue:(NSValue *)right
withAccuracy:(NSValue *)accuracy
inFile:(NSString *)filename
atLine:(int) ineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInRaise:(NSString *)expression
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
+ (NSException *)ghu_failureInRaise:(NSString *)expression
exception:(NSException *)exception
inFile:(NSString *)filename
atLine:(int)lineNumber
withDescription:(NSString *)formatString, ...;
@end
// GTM_END
//! @endcond
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<asset name="Tein">
<pos>
<x>2132.315563</x>
<y>1963.660570</y>
</pos>
<GFX>
<space>X00.png</space>
<exterior>desertic4.png</exterior>
</GFX>
<general>
<class>A</class>
<population>0</population>
<hide>0.250000</hide>
<services/>
</general>
</asset>
| {
"pile_set_name": "Github"
} |
// -*- C++ -*-
// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
// of the GNU General Public License as published by the Free Software
// Foundation; either version 2, or (at your option) any later
// version.
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this library; see the file COPYING. If not, write to
// the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
// MA 02111-1307, USA.
// As a special exception, you may use this file as part of a free
// software library without restriction. Specifically, if other files
// instantiate templates or use macros or inline functions from this
// file, or you compile this file and link it with other files to
// produce an executable, this file does not by itself cause the
// resulting executable to be covered by the GNU General Public
// License. This exception does not however invalidate any other
// reasons why the executable file might be covered by the GNU General
// Public License.
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
// Permission to use, copy, modify, sell, and distribute this software
// is hereby granted without fee, provided that the above copyright
// notice appears in all copies, and that both that copyright notice
// and this permission notice appear in supporting documentation. None
// of the above authors, nor IBM Haifa Research Laboratories, make any
// representation about the suitability of this software for any
// purpose. It is provided "as is" without express or implied
// warranty.
/**
* @file find_store_hash_fn_imps.hpp
* Contains implementations of cc_ht_map_'s find related functions,
* when the hash value is stored.
*/
| {
"pile_set_name": "Github"
} |
/*-
* <<
* task
* ==
* Copyright (C) 2019 - 2020 sia
* ==
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* >>
*/
package com.sia.task.quartz.listeners;
import com.sia.task.quartz.job.JobKey;
import com.sia.task.quartz.job.matchers.EverythingMatcher;
import com.sia.task.quartz.job.matchers.Matcher;
import com.sia.task.quartz.job.trigger.TriggerKey;
import java.util.List;
/**
* Client programs may be interested in the 'listener' interfaces that are
* available from Quartz. The <code>{@link JobListener}</code> interface
* provides notifications of <code>Job</code> executions. The
* <code>{@link TriggerListener}</code> interface provides notifications of
* <code>Trigger</code> firings. The <code>{@link SchedulerListener}</code>
* interface provides notifications of <code>Scheduler</code> events and
* errors. Listeners can be associated with local schedulers through the
* {@link ListenerManager} interface.
*
* <p>Listener registration order is preserved, and hence notification of listeners
* will be in the order in which they were registered.</p>
*
* @author jhouse
* @since 2.0 - previously listeners were managed directly on the Scheduler interface.
*/
public interface ListenerManager {
/**
* Add the given <code>{@link JobListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for all Jobs.
*
* Because no matchers are provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addJobListener(JobListener jobListener);
/**
* Add the given <code>{@link JobListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Jobs that are matched by the
* given Matcher.
*
* If no matchers are provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addJobListener(JobListener jobListener, Matcher<JobKey> matcher);
/**
* Add the given <code>{@link JobListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Jobs that are matched by ANY of the
* given Matchers.
*
* If no matchers are provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addJobListener(JobListener jobListener, Matcher<JobKey>... matchers);
/**
* Add the given <code>{@link JobListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Jobs that are matched by ANY of the
* given Matchers.
*
* If no matchers are provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addJobListener(JobListener jobListener, List<Matcher<JobKey>> matchers);
/**
* Add the given Matcher to the set of matchers for which the listener
* will receive events if ANY of the matchers match.
*
* @param listenerName the name of the listener to add the matcher to
* @param matcher the additional matcher to apply for selecting events
* @return true if the identified listener was found and updated
*/
public boolean addJobListenerMatcher(String listenerName, Matcher<JobKey> matcher);
/**
* Remove the given Matcher to the set of matchers for which the listener
* will receive events if ANY of the matchers match.
*
* @param listenerName the name of the listener to add the matcher to
* @param matcher the additional matcher to apply for selecting events
* @return true if the given matcher was found and removed from the listener's list of matchers
*/
public boolean removeJobListenerMatcher(String listenerName, Matcher<JobKey> matcher);
/**
* Set the set of Matchers for which the listener
* will receive events if ANY of the matchers match.
*
* <p>Removes any existing matchers for the identified listener!</p>
*
* @param listenerName the name of the listener to add the matcher to
* @param matchers the matchers to apply for selecting events
* @return true if the given matcher was found and removed from the listener's list of matchers
*/
public boolean setJobListenerMatchers(String listenerName, List<Matcher<JobKey>> matchers);
/**
* Get the set of Matchers for which the listener
* will receive events if ANY of the matchers match.
*
*
* @param listenerName the name of the listener to add the matcher to
* @return the matchers registered for selecting events for the identified listener
*/
public List<Matcher<JobKey>> getJobListenerMatchers(String listenerName);
/**
* Remove the identified <code>{@link JobListener}</code> from the <code>Scheduler</code>.
*
* @return true if the identified listener was found in the list, and
* removed.
*/
public boolean removeJobListener(String name);
/**
* Get a List containing all of the <code>{@link JobListener}</code>s in
* the <code>Scheduler</code>, in the order in which they were registered.
*/
public List<JobListener> getJobListeners();
/**
* Get the <code>{@link JobListener}</code> that has the given name.
*/
public JobListener getJobListener(String name);
/**
* Add the given <code>{@link TriggerListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for all Triggers.
*
* Because no matcher is provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addTriggerListener(TriggerListener triggerListener);
/**
* Add the given <code>{@link TriggerListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Triggers that are matched by the
* given Matcher.
*
* If no matcher is provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey> matcher);
/**
* Add the given <code>{@link TriggerListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Triggers that are matched by ANY of the
* given Matchers.
*
* If no matcher is provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addTriggerListener(TriggerListener triggerListener, Matcher<TriggerKey>... matchers);
/**
* Add the given <code>{@link TriggerListener}</code> to the <code>Scheduler</code>,
* and register it to receive events for Triggers that are matched by ANY of the
* given Matchers.
*
* If no matcher is provided, the <code>EverythingMatcher</code> will be used.
*
* @see Matcher
* @see EverythingMatcher
*/
public void addTriggerListener(TriggerListener triggerListener, List<Matcher<TriggerKey>> matchers);
/**
* Add the given Matcher to the set of matchers for which the listener
* will receive events if ANY of the matchers match.
*
* @param listenerName the name of the listener to add the matcher to
* @param matcher the additional matcher to apply for selecting events
* @return true if the identified listener was found and updated
*/
public boolean addTriggerListenerMatcher(String listenerName, Matcher<TriggerKey> matcher);
/**
* Remove the given Matcher to the set of matchers for which the listener
* will receive events if ANY of the matchers match.
*
* @param listenerName the name of the listener to add the matcher to
* @param matcher the additional matcher to apply for selecting events
* @return true if the given matcher was found and removed from the listener's list of matchers
*/
public boolean removeTriggerListenerMatcher(String listenerName, Matcher<TriggerKey> matcher);
/**
* Set the set of Matchers for which the listener
* will receive events if ANY of the matchers match.
*
* <p>Removes any existing matchers for the identified listener!</p>
*
* @param listenerName the name of the listener to add the matcher to
* @param matchers the matchers to apply for selecting events
* @return true if the given matcher was found and removed from the listener's list of matchers
*/
public boolean setTriggerListenerMatchers(String listenerName, List<Matcher<TriggerKey>> matchers);
/**
* Get the set of Matchers for which the listener
* will receive events if ANY of the matchers match.
*
*
* @param listenerName the name of the listener to add the matcher to
* @return the matchers registered for selecting events for the identified listener
*/
public List<Matcher<TriggerKey>> getTriggerListenerMatchers(String listenerName);
/**
* Remove the identified <code>{@link TriggerListener}</code> from the <code>Scheduler</code>.
*
* @return true if the identified listener was found in the list, and
* removed.
*/
public boolean removeTriggerListener(String name);
/**
* Get a List containing all of the <code>{@link TriggerListener}</code>s
* in the <code>Scheduler</code>, in the order in which they were registered.
*/
public List<TriggerListener> getTriggerListeners();
/**
* Get the <code>{@link TriggerListener}</code> that has the given name.
*/
public TriggerListener getTriggerListener(String name);
/**
* Register the given <code>{@link SchedulerListener}</code> with the
* <code>Scheduler</code>.
*/
public void addSchedulerListener(SchedulerListener schedulerListener);
/**
* Remove the given <code>{@link SchedulerListener}</code> from the
* <code>Scheduler</code>.
*
* @return true if the identified listener was found in the list, and
* removed.
*/
public boolean removeSchedulerListener(SchedulerListener schedulerListener);
/**
* Get a List containing all of the <code>{@link SchedulerListener}</code>s
* registered with the <code>Scheduler</code>, in the order in which they were registered.
*/
public List<SchedulerListener> getSchedulerListeners();
}
| {
"pile_set_name": "Github"
} |
#!/bin/bash
set -o pipefail
function finish {
sync_unlock.sh
}
if [ -z "$TRAP" ]
then
sync_lock.sh || exit -1
trap finish EXIT
export TRAP=1
fi
> errors.txt
> run.log
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie GHA2DB_LOCAL=1 structure 2>>errors.txt | tee -a run.log || exit 1
./devel/db.sh psql cnigenie -c "create extension if not exists pgcrypto" || exit 1
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie GHA2DB_LOCAL=1 gha2db 2017-03-25 0 today now 'cni-genie,Huawei-PaaS/CNI-Genie' 2>>errors.txt | tee -a run.log || exit 2
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie GHA2DB_LOCAL=1 GHA2DB_MGETC=y GHA2DB_SKIPTABLE=1 GHA2DB_INDEX=1 structure 2>>errors.txt | tee -a run.log || exit 3
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie ./shared/setup_repo_groups.sh 2>>errors.txt | tee -a run.log || exit 4
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie ./shared/import_affs.sh 2>>errors.txt | tee -a run.log || exit 5
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie ./shared/setup_scripts.sh 2>>errors.txt | tee -a run.log || exit 6
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie ./shared/get_repos.sh 2>>errors.txt | tee -a run.log || exit 7
GHA2DB_PROJECT=cnigenie PG_DB=cnigenie GHA2DB_LOCAL=1 vars || exit 8
./devel/ro_user_grants.sh cnigenie || exit 9
./devel/psql_user_grants.sh devstats_team cnigenie || exit 10
| {
"pile_set_name": "Github"
} |
included_line4
| {
"pile_set_name": "Github"
} |
<?php
namespace MaxMind\Exception;
/**
* This class represents an HTTP transport error.
*/
class HttpException extends WebServiceException
{
/**
* The URI queried.
*/
private $uri;
/**
* @param string $message a message describing the error
* @param int $httpStatus the HTTP status code of the response
* @param string $uri the URI used in the request
* @param \Exception $previous the previous exception, if any
*/
public function __construct(
$message,
$httpStatus,
$uri,
\Exception $previous = null
) {
$this->uri = $uri;
parent::__construct($message, $httpStatus, $previous);
}
public function getUri()
{
return $this->uri;
}
public function getStatusCode()
{
return $this->getCode();
}
}
| {
"pile_set_name": "Github"
} |
/*
* Copyright 2013 Goldman Sachs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gs.collections.impl.map.immutable.primitive;
import com.gs.collections.impl.test.Verify;
import org.junit.Test;
public class ImmutableObjectIntSingletonMapSerializationTest
{
@Test
public void serializedForm()
{
Verify.assertSerializedForm(
1L,
"rO0ABXNyAHVjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5tYXAuaW1tdXRhYmxlLnByaW1pdGl2ZS5B\n"
+ "YnN0cmFjdEltbXV0YWJsZU9iamVjdEludE1hcCRJbW11dGFibGVPYmplY3RJbnRNYXBTZXJpYWxp\n"
+ "emF0aW9uUHJveHkAAAAAAAAAAQwAAHhwdwQAAAABdAABMXcEAAAAAXg=",
new ImmutableObjectIntSingletonMap<String>("1", 1));
}
}
| {
"pile_set_name": "Github"
} |
const canvasSketch = require('canvas-sketch');
const { renderPaths } = require('canvas-sketch-util/penplot');
const { clipPolylinesToBox } = require('canvas-sketch-util/geometry');
const { linspace, lerpArray, lerp } = require('canvas-sketch-util/math');
const Random = require('canvas-sketch-util/random');
const RBush = require('rbush');
const knn = require('rbush-knn');
const inside = require('point-in-polygon');
const clrs = require('./clrs').clrs();
// You can force a specific seed by replacing this with a string value
const defaultSeed = '';
// Set a random seed so we can reproduce this print later
Random.setSeed(defaultSeed || Random.getRandomSeed());
// Print to console so we can see which seed is being used and copy it if desired
console.log('Random Seed:', Random.getSeed());
const settings = {
suffix: Random.getSeed(),
scaleToView: true,
animate: true,
dimensions: [800 * 2, 600 * 2],
// duration: 12,
// fps: 24,
// playbackRate: 'throttle',
};
const config = {};
const sketch = (props) => {
const { width, height } = props;
const foreground = clrs.ink();
const background = clrs.bg;
const tree = new XYRBush();
const scale = 12;
const forceMultiplier = 0.5;
config.repulsionForce = 0.5 * forceMultiplier;
config.attractionForce = 0.5 * forceMultiplier;
config.alignmentForce = 0.35 * forceMultiplier;
config.brownianMotionRange = (width * 0.005) / scale;
config.leastMinDistance = (width * 0.03) / scale; // the closest comfortable distance between two vertices
config.repulsionRadius = (width * 0.125) / scale; // the distance beyond which disconnected vertices will ignore each other
config.maxDistance = (width * 0.1) / scale; // maximum acceptable distance between two connected nodes (otherwise split)
let path;
const bounds = createLine(5, width / 2, height / 2, width / 4);
return {
begin() {
path = createLine(6, width / 2, height / 2, width / 12);
tree.clear();
tree.load(path);
},
render({ context }) {
iterate(tree, path, bounds, [width / 2, height / 2]);
context.fillStyle = background;
context.fillRect(0, 0, width, height);
context.fillStyle = foreground;
context.lineWidth = 12;
context.lineJoin = 'round';
context.beginPath();
path.forEach(([x, y], idx) => {
if (idx === 0) {
context.moveTo(x, y);
} else {
context.lineTo(x, y);
}
});
context.closePath();
context.fill();
context.strokeStyle = foreground;
context.beginPath();
bounds.forEach(([x, y], idx) => {
if (idx === 0) {
context.moveTo(x, y);
} else {
context.lineTo(x, y);
}
});
context.closePath();
context.stroke();
// context.fillStyle = background;
// context.strokeStyle = foreground;
// path.forEach(([x, y]) => {
// context.beginPath();
// context.ellipse(x, y, 1, 1, 0, 0, 2 * Math.PI);
// context.fill();
// context.stroke();
// });
},
};
};
canvasSketch(sketch, settings);
/**
*
* https://adrianton3.github.io/blog/art/differential-growth/differential-growth
* https://medium.com/@jason.webb/2d-differential-growth-in-js-1843fd51b0ce
* https://inconvergent.net/2016/shepherding-random-growth
*
* 1. Each node wants to be close to it’s connected neighbour nodes and
* will experience a mutual attraction force to them.
*
* 2. Each node wants to maintain a minimum distance from all nearby nodes,
* connected or not, and will experience a mutual repulsion force from them.
*
* 3. Each node wants to rest exactly halfway between it’s connected neighbour
* nodes on as straight of a line as possible and will experience an alignment
* force towards the midpoint.
*
*
* 1. Nodes and Edges: nodes are connected to a certain number of neighbouring nodes through edges.
*
* 2. Attraction: connected nodes will try to maintain a reasonably close proximity to each other.
* In the figure below attraction happens between connected nodes in the loop.
*
* 3. Rejection: nodes will try to avoid being too close to surrounding nodes (within a certain distance).
* Rejection forces are indicated by cyan lines in the figure below.
*
* 4. Splits: If an edges gets too long, a new node will be injected at the middle of the edge.
*
* 5. Growth: in addition to the splits, new nodes are injected according to some growth scheme.
*
*/
class XYRBush extends RBush {
toBBox([x, y]) {
return { minX: x, minY: y, maxX: x, maxY: y };
}
compareMinX(a, b) {
return a.x - b.x;
}
compareMinY(a, b) {
return a.y - b.y;
}
}
function createLine(count, x, y, r) {
const offset = -Math.PI / 2;
return linspace(count).map((idx) => [
x + r * Math.cos(offset + Math.PI * 2 * idx),
y + r * Math.sin(offset + Math.PI * 2 * idx),
]);
}
function iterate(tree, nodes, bounds, centre) {
tree.clear();
// Generate tree from path nodes
tree.load(nodes);
for (let [idx, node] of nodes.entries()) {
applyBrownianMotion(idx, node);
applyRepulsion(idx, nodes, tree);
applyAttraction(idx, nodes);
applyAlignment(idx, nodes);
keepInBounds(idx, nodes, bounds, centre);
}
splitEdges(nodes);
pruneNodes(nodes);
}
function applyBrownianMotion(node) {
node[0] += Random.range(
-config.brownianMotionRange / 2,
config.brownianMotionRange / 2
);
node[1] += Random.range(
-config.brownianMotionRange / 2,
config.brownianMotionRange / 2
);
}
function applyRepulsion(idx, nodes, tree) {
const node = nodes[idx];
// Perform knn search to find all neighbours within certain radius
const neighbours = knn(
tree,
node[0],
node[1],
undefined,
undefined,
config.repulsionRadius
);
// Move this node away from all nearby neighbours
neighbours.forEach((neighbour) => {
const d = distance(neighbour, node);
nodes[idx] = lerpArray(
node,
neighbour,
-config.repulsionForce
// (-config.repulsionForce * d) / config.repulsionRadius
);
});
}
/**
*
* *
* ^
* |
* |
* * ⟍ | ⟋ *
* B ⟍ | ⟋ C
* ⟍ | ⟋
* ⟍ | ⟋
* ⟍ | ⟋
* *
* A
*/
function applyAttraction(index, nodes) {
const node = nodes[index];
const connectedNodes = getConnectedNodes(index, nodes);
Object.values(connectedNodes).forEach((neighbour) => {
const d = distance(node, neighbour);
if (d > config.leastMinDistance) {
nodes[index] = lerpArray(node, neighbour, config.attractionForce);
}
});
}
/**
*
* * ⟍---------*-------------⟋ *
* B ⟍ ^ ⟋ C
* ⟍ | ⟋
* ⟍ | ⟋
* ⟍ | ⟋
* *
* A
*/
function applyAlignment(index, nodes) {
const node = nodes[index];
const { previousNode, nextNode } = getConnectedNodes(index, nodes);
if (!previousNode || !nextNode) {
return;
}
// Find the midpoint between the neighbours of this node
const midpoint = getMidpoint(previousNode, nextNode);
// Move this point towards this midpoint
nodes[index] = lerpArray(node, midpoint, config.alignmentForce);
}
function keepInBounds(idx, nodes, bounds, centre) {
const node = nodes[idx];
const inBounds = inside(node, bounds);
if (!inBounds) {
nodes[idx] = lerpArray(node, centre, 0.01);
}
}
function splitEdges(nodes) {
for (let [idx, node] of nodes.entries()) {
const { previousNode } = getConnectedNodes(idx, nodes);
if (previousNode === undefined) {
break;
}
if (distance(node, previousNode) >= config.maxDistance) {
const midpoint = getMidpoint(node, previousNode);
// Inject the new midpoint into the global list
if (idx == 0) {
nodes.splice(nodes.length, 0, midpoint);
} else {
nodes.splice(idx, 0, midpoint);
}
}
}
}
function pruneNodes(nodes) {
for (let [index, node] of nodes.entries()) {
const { previousNode } = getConnectedNodes(index, nodes);
if (
previousNode !== undefined &&
distance(node, previousNode) < config.leastMinDistance
) {
if (index == 0) {
nodes.splice(nodes.length - 1, 1);
} else {
nodes.splice(index - 1, 1);
}
}
}
}
function getConnectedNodes(index, nodes, isClosed = true) {
let previousNode, nextNode;
if (index == 0 && isClosed) {
previousNode = nodes[nodes.length - 1];
} else if (index >= 1) {
previousNode = nodes[index - 1];
}
if (index == nodes.length - 1 && isClosed) {
nextNode = nodes[0];
} else if (index <= nodes.length - 1) {
nextNode = nodes[index + 1];
}
return { previousNode, nextNode };
}
function distance(v1, v2) {
const dx = v2[0] - v1[0];
const dy = v2[1] - v1[1];
return Math.hypot(dx, dy);
}
function getMidpoint(a, b) {
return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
}
| {
"pile_set_name": "Github"
} |
%noscript
.announcement
%h4
Javascript脚本被禁用
%p
%strong
为了使用ShopQi后台管理,您的浏览器
%em
需要启用javascript脚本
%p
点击了解更多
%a{ :href => "http://www.enable-javascript.com/" }
怎么启用脚本
\.
| {
"pile_set_name": "Github"
} |
// Copyright 2011 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build appengine
package internal
import (
"appengine_internal"
)
func Main() {
appengine_internal.Main()
}
| {
"pile_set_name": "Github"
} |
package sqlite.feature.many2many.case6.persistence;
import android.database.Cursor;
import androidx.sqlite.db.SupportSQLiteStatement;
import com.abubusoft.kripton.android.Logger;
import com.abubusoft.kripton.android.sqlite.Dao;
import com.abubusoft.kripton.android.sqlite.KriptonContentValues;
import com.abubusoft.kripton.android.sqlite.KriptonDatabaseHelper;
import com.abubusoft.kripton.common.EnumUtils;
import com.abubusoft.kripton.common.StringUtils;
import com.abubusoft.kripton.common.Triple;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import sqlite.feature.many2many.case6.model.ActionType;
import sqlite.feature.many2many.case6.model.PhoneNumber;
/**
* <p>
* DAO implementation for entity <code>PhoneNumber</code>, based on interface <code>PhoneDao</code>
* </p>
*
* @see PhoneNumber
* @see PhoneDao
* @see sqlite.feature.many2many.case6.model.PhoneNumberTable
*/
public class PhoneDaoImpl extends Dao implements PhoneDao {
private static SupportSQLiteStatement insertPreparedStatement0;
/**
* SQL definition for method selectById
*/
private static final String SELECT_BY_ID_SQL1 = "SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number WHERE id = ?";
private static SupportSQLiteStatement deleteByIdPreparedStatement1;
private static SupportSQLiteStatement updateByIdPreparedStatement2;
/**
* SQL definition for method selectByNumber
*/
private static final String SELECT_BY_NUMBER_SQL2 = "SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number WHERE number = ?";
/**
* SQL definition for method selectAll
*/
private static final String SELECT_ALL_SQL3 = "SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number ORDER BY contact_name, number";
public PhoneDaoImpl(BindXenoDaoFactory daoFactory) {
super(daoFactory.getContext());
}
/**
* <h2>SQL insert</h2>
* <pre>INSERT OR REPLACE INTO phone_number (action_type, contact_id, contact_name, country_code, number) VALUES (:actionType, :contactId, :contactName, :countryCode, :number)</pre>
*
* <p><code>bean.id</code> is automatically updated because it is the primary key</p>
*
* <p><strong>Inserted columns:</strong></p>
* <dl>
* <dt>action_type</dt><dd>is mapped to <strong>:bean.actionType</strong></dd>
* <dt>contact_id</dt><dd>is mapped to <strong>:bean.contactId</strong></dd>
* <dt>contact_name</dt><dd>is mapped to <strong>:bean.contactName</strong></dd>
* <dt>country_code</dt><dd>is mapped to <strong>:bean.countryCode</strong></dd>
* <dt>number</dt><dd>is mapped to <strong>:bean.number</strong></dd>
* </dl>
*
* @param bean
* is mapped to parameter <strong>bean</strong>
*
* @return <strong>id</strong> of inserted record
*/
@Override
public int insert(PhoneNumber bean) {
// Specialized Insert - InsertType - BEGIN
if (insertPreparedStatement0==null) {
// generate static SQL for statement
String _sql="INSERT OR REPLACE INTO phone_number (action_type, contact_id, contact_name, country_code, number) VALUES (?, ?, ?, ?, ?)";
insertPreparedStatement0 = KriptonDatabaseHelper.compile(_context, _sql);
}
KriptonContentValues _contentValues=contentValuesForUpdate(insertPreparedStatement0);
_contentValues.put("action_type", EnumUtils.write(bean.actionType));
_contentValues.put("contact_id", bean.contactId);
_contentValues.put("contact_name", bean.contactName);
_contentValues.put("country_code", bean.countryCode);
_contentValues.put("number", bean.number);
// log section BEGIN
if (_context.isLogEnabled()) {
// log for insert -- BEGIN
StringBuffer _columnNameBuffer=new StringBuffer();
StringBuffer _columnValueBuffer=new StringBuffer();
String _columnSeparator="";
for (String columnName:_contentValues.keys()) {
_columnNameBuffer.append(_columnSeparator+columnName);
_columnValueBuffer.append(_columnSeparator+":"+columnName);
_columnSeparator=", ";
}
Logger.info("INSERT OR REPLACE INTO phone_number (%s) VALUES (%s)", _columnNameBuffer.toString(), _columnValueBuffer.toString());
// log for content values -- BEGIN
Triple<String, Object, KriptonContentValues.ParamType> _contentValue;
for (int i = 0; i < _contentValues.size(); i++) {
_contentValue = _contentValues.get(i);
if (_contentValue.value1==null) {
Logger.info("==> :%s = <null>", _contentValue.value0);
} else {
Logger.info("==> :%s = '%s' (%s)", _contentValue.value0, StringUtils.checkSize(_contentValue.value1), _contentValue.value1.getClass().getCanonicalName());
}
}
// log for content values -- END
// log for insert -- END
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section END
// insert operation
long result = KriptonDatabaseHelper.insert(insertPreparedStatement0, _contentValues);
// if PK string, can not overwrite id (with a long) same thing if column type is UNMANAGED (user manage PK)
bean.id=result;
return (int)result;
// Specialized Insert - InsertType - END
}
/**
* <h2>Select SQL:</h2>
*
* <pre>SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number WHERE id = ${id}</pre>
*
* <h2>Mapped class:</h2>
* {@link PhoneNumber}
*
* <h2>Projected columns:</h2>
* <dl>
* <dt>id</dt><dd>is associated to bean's property <strong>id</strong></dd>
* <dt>action_type</dt><dd>is associated to bean's property <strong>actionType</strong></dd>
* <dt>contact_id</dt><dd>is associated to bean's property <strong>contactId</strong></dd>
* <dt>contact_name</dt><dd>is associated to bean's property <strong>contactName</strong></dd>
* <dt>country_code</dt><dd>is associated to bean's property <strong>countryCode</strong></dd>
* <dt>number</dt><dd>is associated to bean's property <strong>number</strong></dd>
* </dl>
*
* <h2>Query's parameters:</h2>
* <dl>
* <dt>:id</dt><dd>is binded to method's parameter <strong>id</strong></dd>
* </dl>
*
* @param id
* is binded to <code>:id</code>
* @return selected bean or <code>null</code>.
*/
@Override
public PhoneNumber selectById(long id) {
// common part generation - BEGIN
KriptonContentValues _contentValues=contentValues();
// query SQL is statically defined
String _sql=SELECT_BY_ID_SQL1;
// add where arguments
_contentValues.addWhereArgs(String.valueOf(id));
String[] _sqlArgs=_contentValues.whereArgsAsArray();
// log section for select BEGIN
if (_context.isLogEnabled()) {
// manage log
Logger.info(_sql);
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section for select END
try (Cursor _cursor = getDatabase().query(_sql, _sqlArgs)) {
// log section BEGIN
if (_context.isLogEnabled()) {
Logger.info("Rows found: %s",_cursor.getCount());
}
// log section END
// common part generation - END
// Specialized part - SelectBeanHelper - BEGIN
PhoneNumber resultBean=null;
if (_cursor.moveToFirst()) {
int index0=_cursor.getColumnIndex("id");
int index1=_cursor.getColumnIndex("action_type");
int index2=_cursor.getColumnIndex("contact_id");
int index3=_cursor.getColumnIndex("contact_name");
int index4=_cursor.getColumnIndex("country_code");
int index5=_cursor.getColumnIndex("number");
resultBean=new PhoneNumber();
resultBean.id=_cursor.getLong(index0);
if (!_cursor.isNull(index1)) { resultBean.actionType=ActionType.valueOf(_cursor.getString(index1)); }
if (!_cursor.isNull(index2)) { resultBean.contactId=_cursor.getString(index2); }
if (!_cursor.isNull(index3)) { resultBean.contactName=_cursor.getString(index3); }
if (!_cursor.isNull(index4)) { resultBean.countryCode=_cursor.getString(index4); }
if (!_cursor.isNull(index5)) { resultBean.number=_cursor.getString(index5); }
}
return resultBean;
}
// Specialized part - SelectBeanHelper - END
}
/**
* <h2>SQL delete</h2>
* <pre>DELETE FROM phone_number WHERE id = :id</pre>
*
* <h2>Where parameters:</h2>
* <dl>
* <dt>:id</dt><dd>is mapped to method's parameter <strong>id</strong></dd>
* </dl>
*
* @param id
* is used as where parameter <strong>:id</strong>
*
* @return <code>true</code> if record is deleted, <code>false</code> otherwise
*/
@Override
public boolean deleteById(long id) {
if (deleteByIdPreparedStatement1==null) {
// generate static SQL for statement
String _sql="DELETE FROM phone_number WHERE id = ?";
deleteByIdPreparedStatement1 = KriptonDatabaseHelper.compile(_context, _sql);
}
KriptonContentValues _contentValues=contentValuesForUpdate(deleteByIdPreparedStatement1);
_contentValues.addWhereArgs(String.valueOf(id));
// generation CODE_001 -- BEGIN
// generation CODE_001 -- END
// log section BEGIN
if (_context.isLogEnabled()) {
// display log
Logger.info("DELETE FROM phone_number WHERE id = ?");
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section END
int result = KriptonDatabaseHelper.updateDelete(deleteByIdPreparedStatement1, _contentValues);
return result!=0;
}
/**
* <h2>SQL delete:</h2>
* <pre>DELETE FROM phone_number WHERE id = ${bean.id}</pre>
*
* <h2>Parameters used in where conditions:</h2>
* <dl>
* <dt>:bean.id</dt><dd>is mapped to method's parameter <strong>bean.id</strong></dd>
* </dl>
*
* @param bean
* is used as <code>:bean</code>
*
* @return <code>true</code> if record is deleted, <code>false</code> otherwise
*/
@Override
public boolean updateById(PhoneNumber bean) {
if (updateByIdPreparedStatement2==null) {
// generate static SQL for statement
String _sql="DELETE FROM phone_number WHERE id = ?";
updateByIdPreparedStatement2 = KriptonDatabaseHelper.compile(_context, _sql);
}
KriptonContentValues _contentValues=contentValuesForUpdate(updateByIdPreparedStatement2);
_contentValues.addWhereArgs(String.valueOf(bean.id));
// generation CODE_001 -- BEGIN
// generation CODE_001 -- END
// log section BEGIN
if (_context.isLogEnabled()) {
// display log
Logger.info("DELETE FROM phone_number WHERE id = ?");
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section END
int result = KriptonDatabaseHelper.updateDelete(updateByIdPreparedStatement2, _contentValues);
return result!=0;
}
/**
* <h2>Select SQL:</h2>
*
* <pre>SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number WHERE number = ${number}</pre>
*
* <h2>Mapped class:</h2>
* {@link PhoneNumber}
*
* <h2>Projected columns:</h2>
* <dl>
* <dt>id</dt><dd>is associated to bean's property <strong>id</strong></dd>
* <dt>action_type</dt><dd>is associated to bean's property <strong>actionType</strong></dd>
* <dt>contact_id</dt><dd>is associated to bean's property <strong>contactId</strong></dd>
* <dt>contact_name</dt><dd>is associated to bean's property <strong>contactName</strong></dd>
* <dt>country_code</dt><dd>is associated to bean's property <strong>countryCode</strong></dd>
* <dt>number</dt><dd>is associated to bean's property <strong>number</strong></dd>
* </dl>
*
* <h2>Query's parameters:</h2>
* <dl>
* <dt>:number</dt><dd>is binded to method's parameter <strong>number</strong></dd>
* </dl>
*
* @param number
* is binded to <code>:number</code>
* @return selected bean or <code>null</code>.
*/
@Override
public PhoneNumber selectByNumber(String number) {
// common part generation - BEGIN
KriptonContentValues _contentValues=contentValues();
// query SQL is statically defined
String _sql=SELECT_BY_NUMBER_SQL2;
// add where arguments
_contentValues.addWhereArgs((number==null?"":number));
String[] _sqlArgs=_contentValues.whereArgsAsArray();
// log section for select BEGIN
if (_context.isLogEnabled()) {
// manage log
Logger.info(_sql);
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section for select END
try (Cursor _cursor = getDatabase().query(_sql, _sqlArgs)) {
// log section BEGIN
if (_context.isLogEnabled()) {
Logger.info("Rows found: %s",_cursor.getCount());
}
// log section END
// common part generation - END
// Specialized part - SelectBeanHelper - BEGIN
PhoneNumber resultBean=null;
if (_cursor.moveToFirst()) {
int index0=_cursor.getColumnIndex("id");
int index1=_cursor.getColumnIndex("action_type");
int index2=_cursor.getColumnIndex("contact_id");
int index3=_cursor.getColumnIndex("contact_name");
int index4=_cursor.getColumnIndex("country_code");
int index5=_cursor.getColumnIndex("number");
resultBean=new PhoneNumber();
resultBean.id=_cursor.getLong(index0);
if (!_cursor.isNull(index1)) { resultBean.actionType=ActionType.valueOf(_cursor.getString(index1)); }
if (!_cursor.isNull(index2)) { resultBean.contactId=_cursor.getString(index2); }
if (!_cursor.isNull(index3)) { resultBean.contactName=_cursor.getString(index3); }
if (!_cursor.isNull(index4)) { resultBean.countryCode=_cursor.getString(index4); }
if (!_cursor.isNull(index5)) { resultBean.number=_cursor.getString(index5); }
}
return resultBean;
}
// Specialized part - SelectBeanHelper - END
}
/**
* <h2>Select SQL:</h2>
*
* <pre>SELECT id, action_type, contact_id, contact_name, country_code, number FROM phone_number ORDER BY contact_name, number</pre>
*
* <h2>Mapped class:</h2>
* {@link PhoneNumber}
*
* <h2>Projected columns:</h2>
* <dl>
* <dt>id</dt><dd>is associated to bean's property <strong>id</strong></dd>
* <dt>action_type</dt><dd>is associated to bean's property <strong>actionType</strong></dd>
* <dt>contact_id</dt><dd>is associated to bean's property <strong>contactId</strong></dd>
* <dt>contact_name</dt><dd>is associated to bean's property <strong>contactName</strong></dd>
* <dt>country_code</dt><dd>is associated to bean's property <strong>countryCode</strong></dd>
* <dt>number</dt><dd>is associated to bean's property <strong>number</strong></dd>
* </dl>
*
* @return collection of bean or empty collection.
*/
@Override
public List<PhoneNumber> selectAll() {
// common part generation - BEGIN
KriptonContentValues _contentValues=contentValues();
// query SQL is statically defined
String _sql=SELECT_ALL_SQL3;
// add where arguments
String[] _sqlArgs=_contentValues.whereArgsAsArray();
// log section for select BEGIN
if (_context.isLogEnabled()) {
// manage log
Logger.info(_sql);
// log for where parameters -- BEGIN
int _whereParamCounter=0;
for (String _whereParamItem: _contentValues.whereArgs()) {
Logger.info("==> param%s: '%s'",(_whereParamCounter++), StringUtils.checkSize(_whereParamItem));
}
// log for where parameters -- END
}
// log section for select END
try (Cursor _cursor = getDatabase().query(_sql, _sqlArgs)) {
// log section BEGIN
if (_context.isLogEnabled()) {
Logger.info("Rows found: %s",_cursor.getCount());
}
// log section END
// common part generation - END
// Specialized part - SelectBeanListHelper - BEGIN
ArrayList<PhoneNumber> resultList=new ArrayList<PhoneNumber>(_cursor.getCount());
PhoneNumber resultBean=null;
if (_cursor.moveToFirst()) {
int index0=_cursor.getColumnIndex("id");
int index1=_cursor.getColumnIndex("action_type");
int index2=_cursor.getColumnIndex("contact_id");
int index3=_cursor.getColumnIndex("contact_name");
int index4=_cursor.getColumnIndex("country_code");
int index5=_cursor.getColumnIndex("number");
do
{
resultBean=new PhoneNumber();
resultBean.id=_cursor.getLong(index0);
if (!_cursor.isNull(index1)) { resultBean.actionType=ActionType.valueOf(_cursor.getString(index1)); }
if (!_cursor.isNull(index2)) { resultBean.contactId=_cursor.getString(index2); }
if (!_cursor.isNull(index3)) { resultBean.contactName=_cursor.getString(index3); }
if (!_cursor.isNull(index4)) { resultBean.countryCode=_cursor.getString(index4); }
if (!_cursor.isNull(index5)) { resultBean.number=_cursor.getString(index5); }
resultList.add(resultBean);
} while (_cursor.moveToNext());
}
return resultList;
}
// Specialized part - SelectBeanListHelper - END
}
public static void clearCompiledStatements() {
try {
if (insertPreparedStatement0!=null) {
insertPreparedStatement0.close();
insertPreparedStatement0=null;
}
if (deleteByIdPreparedStatement1!=null) {
deleteByIdPreparedStatement1.close();
deleteByIdPreparedStatement1=null;
}
if (updateByIdPreparedStatement2!=null) {
updateByIdPreparedStatement2.close();
updateByIdPreparedStatement2=null;
}
} catch(IOException e) {
e.printStackTrace();
}
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<window>
<id>2012</id>
<defaultcontrol>3</defaultcontrol>
<allowoverlay>no</allowoverlay>
<controls>
<control>
<type>image</type>
<id>0</id>
<width>1920</width>
<height>1080</height>
<texture>semi_trans_back_general_menu.png</texture>
<animation effect="fade" time="400">windowopen</animation>
<animation effect="fade" time="400">windowclose</animation>
<visible>!window.isvisible(602)+!window.isvisible(2005)</visible>
</control>
<control>
<description>group element</description>
<type>group</type>
<animation effect="fade" time="250">WindowOpen</animation>
<animation effect="fade" time="0">WindowClose</animation>
<animation effect="slide" start="0,200" end="0,0" tween="quadratic" easing="in" time="150" delay="0">WindowOpen</animation>
<control>
<id>0</id>
<type>image</type>
<posX>441</posX>
<posY>296</posY>
<width>1040</width>
<height>679</height>
<texture>context_background.png</texture>
</control>
<control>
<id>4</id>
<description>Heading text label</description>
<type>label</type>
<posX>560</posX>
<posY>386</posY>
<width>820</width>
<font>font22</font>
<textcolor>ff393939</textcolor>
<label>181</label>
</control>
<control>
<id>3</id>
<description>options listcontrol</description>
<type>listcontrol</type>
<onleft>3</onleft>
<onright>3</onright>
<posX>515</posX>
<posY>475</posY>
<width>890</width>
<height>450</height>
<textXOff2>875</textXOff2>
<textYOff2>16</textYOff2>
<spinPosX>600</spinPosX>
<spinPosY>840</spinPosY>
<spinColor>FFFFFFFF</spinColor>
<textXOff>35</textXOff>
<textYOff>16</textYOff>
<font>TitanLight12</font>
<font2>TitanLight12</font2>
<textcolor>FFFFFFFF</textcolor>
<textcolor2>FFFFFFFF</textcolor2>
<textcolorNoFocus>FF393939</textcolorNoFocus>
<textcolorNoFocus2>FF393939</textcolorNoFocus2>
<selectedColor>FF000000</selectedColor>
<textureFocus>context_item_selected.png</textureFocus>
<textureNoFocus>-</textureNoFocus>
<textureHeight>69</textureHeight>
<spaceBetweenItems>1</spaceBetweenItems>
<PinIconWidth>15</PinIconWidth>
<PinIconHeight>15</PinIconHeight>
<PinIconXOff>2000</PinIconXOff>
<PinIconYOff>15</PinIconYOff>
<unfocusedAlpha>255</unfocusedAlpha>
</control>
</control>
</controls>
</window> | {
"pile_set_name": "Github"
} |
// go run mksyscall.go -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build linux,mips64le
package unix
import (
"syscall"
"unsafe"
)
var _ syscall.Errno
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func FanotifyInit(flags uint, event_f_flags uint) (fd int, err error) {
r0, _, e1 := Syscall(SYS_FANOTIFY_INIT, uintptr(flags), uintptr(event_f_flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname *byte) (err error) {
_, _, e1 := Syscall6(SYS_FANOTIFY_MARK, uintptr(fd), uintptr(flags), uintptr(mask), uintptr(dirFd), uintptr(unsafe.Pointer(pathname)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fchmodat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ioctl(fd int, req uint, arg uintptr) (err error) {
_, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PPOLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(buf) > 0 {
_p1 = unsafe.Pointer(&buf[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unlinkat(dirfd int, path string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getcwd(buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETCWD, uintptr(_p0), uintptr(len(buf)), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) {
r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0)
wpid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func KeyctlInt(cmd int, arg2 int, arg3 int, arg4 int, arg5 int) (ret int, err error) {
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func KeyctlBuffer(cmd int, arg2 int, buf []byte, arg5 int) (ret int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(buf)), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlJoin(cmd int, arg2 string) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg2)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlSearch(cmd int, arg2 int, arg3 string, arg4 string, arg5 int) (ret int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg3)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(arg4)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(arg5), 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlIOV(cmd int, arg2 int, payload []Iovec, arg5 int) (err error) {
var _p0 unsafe.Pointer
if len(payload) > 0 {
_p0 = unsafe.Pointer(&payload[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(_p0), uintptr(len(payload)), uintptr(arg5), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlDH(cmd int, arg2 *KeyctlDHParams, buf []byte) (ret int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(unsafe.Pointer(arg2)), uintptr(_p0), uintptr(len(buf)), 0, 0)
ret = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(keyType)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(restriction)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func keyctlRestrictKeyring(cmd int, arg2 int) (err error) {
_, _, e1 := Syscall(SYS_KEYCTL, uintptr(cmd), uintptr(arg2), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
_, _, e1 := Syscall6(SYS_PTRACE, uintptr(request), uintptr(pid), uintptr(addr), uintptr(data), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(arg)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mount(source string, target string, fstype string, flags uintptr, data *byte) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(source)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(target)
if err != nil {
return
}
var _p2 *byte
_p2, err = BytePtrFromString(fstype)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Acct(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func AddKey(keyType string, description string, payload []byte, ringid int) (id int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(keyType)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(description)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(payload) > 0 {
_p2 = unsafe.Pointer(&payload[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_ADD_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(payload)), uintptr(ringid), 0)
id = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Adjtimex(buf *Timex) (state int, err error) {
r0, _, e1 := Syscall(SYS_ADJTIMEX, uintptr(unsafe.Pointer(buf)), 0, 0)
state = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Capget(hdr *CapUserHeader, data *CapUserData) (err error) {
_, _, e1 := Syscall(SYS_CAPGET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Capset(hdr *CapUserHeader, data *CapUserData) (err error) {
_, _, e1 := Syscall(SYS_CAPSET, uintptr(unsafe.Pointer(hdr)), uintptr(unsafe.Pointer(data)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chdir(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Chroot(path string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGetres(clockid int32, res *Timespec) (err error) {
_, _, e1 := Syscall(SYS_CLOCK_GETRES, uintptr(clockid), uintptr(unsafe.Pointer(res)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockGettime(clockid int32, time *Timespec) (err error) {
_, _, e1 := Syscall(SYS_CLOCK_GETTIME, uintptr(clockid), uintptr(unsafe.Pointer(time)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func ClockNanosleep(clockid int32, flags int, request *Timespec, remain *Timespec) (err error) {
_, _, e1 := Syscall6(SYS_CLOCK_NANOSLEEP, uintptr(clockid), uintptr(flags), uintptr(unsafe.Pointer(request)), uintptr(unsafe.Pointer(remain)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Close(fd int) (err error) {
_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func CopyFileRange(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
r0, _, e1 := Syscall6(SYS_COPY_FILE_RANGE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func DeleteModule(name string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(name)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_DELETE_MODULE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup(oldfd int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_DUP, uintptr(oldfd), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup3(oldfd int, newfd int, flags int) (err error) {
_, _, e1 := Syscall(SYS_DUP3, uintptr(oldfd), uintptr(newfd), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCreate1(flag int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE1, uintptr(flag), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
_, _, e1 := RawSyscall6(SYS_EPOLL_CTL, uintptr(epfd), uintptr(op), uintptr(fd), uintptr(unsafe.Pointer(event)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Eventfd(initval uint, flags int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Exit(code int) {
SyscallNoError(SYS_EXIT_GROUP, uintptr(code), 0, 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fallocate(fd int, mode uint32, off int64, len int64) (err error) {
_, _, e1 := Syscall6(SYS_FALLOCATE, uintptr(fd), uintptr(mode), uintptr(off), uintptr(len), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchdir(fd int) (err error) {
_, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchmod(fd int, mode uint32) (err error) {
_, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fdatasync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FDATASYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fgetxattr(fd int, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_FGETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func FinitModule(fd int, params string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(params)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FINIT_MODULE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flistxattr(fd int, dest []byte) (sz int, err error) {
var _p0 unsafe.Pointer
if len(dest) > 0 {
_p0 = unsafe.Pointer(&dest[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_FLISTXATTR, uintptr(fd), uintptr(_p0), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Flock(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fremovexattr(fd int, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FREMOVEXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsetxattr(fd int, attr string, dest []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_FSETXATTR, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fsync(fd int) (err error) {
_, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getdents(fd int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETDENTS64, uintptr(fd), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpgid(pid int) (pgid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0)
pgid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpid() (pid int) {
r0, _ := RawSyscallNoError(SYS_GETPID, 0, 0, 0)
pid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getppid() (ppid int) {
r0, _ := RawSyscallNoError(SYS_GETPPID, 0, 0, 0)
ppid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getpriority(which int, who int) (prio int, err error) {
r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0)
prio = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrandom(buf []byte, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_GETRANDOM, uintptr(_p0), uintptr(len(buf)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getsid(pid int) (sid int, err error) {
r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0)
sid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettid() (tid int) {
r0, _ := RawSyscallNoError(SYS_GETTID, 0, 0, 0)
tid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getxattr(path string, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(dest) > 0 {
_p2 = unsafe.Pointer(&dest[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InitModule(moduleImage []byte, params string) (err error) {
var _p0 unsafe.Pointer
if len(moduleImage) > 0 {
_p0 = unsafe.Pointer(&moduleImage[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
var _p1 *byte
_p1, err = BytePtrFromString(params)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_INIT_MODULE, uintptr(_p0), uintptr(len(moduleImage)), uintptr(unsafe.Pointer(_p1)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(pathname)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask))
watchdesc = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyInit1(flags int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_INIT1, uintptr(flags), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
r0, _, e1 := RawSyscall(SYS_INOTIFY_RM_WATCH, uintptr(fd), uintptr(watchdesc), 0)
success = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Kill(pid int, sig syscall.Signal) (err error) {
_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Klogctl(typ int, buf []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_SYSLOG, uintptr(typ), uintptr(_p0), uintptr(len(buf)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(dest) > 0 {
_p2 = unsafe.Pointer(&dest[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_LGETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0)
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listxattr(path string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Llistxattr(path string, dest []byte) (sz int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 unsafe.Pointer
if len(dest) > 0 {
_p1 = unsafe.Pointer(&dest[0])
} else {
_p1 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_LLISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest)))
sz = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lremovexattr(path string, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LREMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lsetxattr(path string, attr string, data []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(data) > 0 {
_p2 = unsafe.Pointer(&data[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_LSETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func MemfdCreate(name string, flags int) (fd int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(name)
if err != nil {
return
}
r0, _, e1 := Syscall(SYS_MEMFD_CREATE, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mkdirat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
_, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(putold)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) {
_, _, e1 := RawSyscall6(SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(newlimit)), uintptr(unsafe.Pointer(old)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error) {
_, _, e1 := Syscall6(SYS_PRCTL, uintptr(option), uintptr(arg2), uintptr(arg3), uintptr(arg4), uintptr(arg5), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error) {
r0, _, e1 := Syscall6(SYS_PSELECT6, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func read(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Removexattr(path string, attr string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Renameat2(olddirfd int, oldpath string, newdirfd int, newpath string, flags uint) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_RENAMEAT2, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func RequestKey(keyType string, description string, callback string, destRingid int) (id int, err error) {
var _p0 *byte
_p0, err = BytePtrFromString(keyType)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(description)
if err != nil {
return
}
var _p2 *byte
_p2, err = BytePtrFromString(callback)
if err != nil {
return
}
r0, _, e1 := Syscall6(SYS_REQUEST_KEY, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(destRingid), 0, 0)
id = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setdomainname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETDOMAINNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sethostname(p []byte) (err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_SETHOSTNAME, uintptr(_p0), uintptr(len(p)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpgid(pid int, pgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Settimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setns(fd int, nstype int) (err error) {
_, _, e1 := Syscall(SYS_SETNS, uintptr(fd), uintptr(nstype), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setpriority(which int, who int, prio int) (err error) {
_, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setxattr(path string, attr string, data []byte, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(attr)
if err != nil {
return
}
var _p2 unsafe.Pointer
if len(data) > 0 {
_p2 = unsafe.Pointer(&data[0])
} else {
_p2 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func signalfd(fd int, sigmask *Sigset_t, maskSize uintptr, flags int) (newfd int, err error) {
r0, _, e1 := Syscall6(SYS_SIGNALFD4, uintptr(fd), uintptr(unsafe.Pointer(sigmask)), uintptr(maskSize), uintptr(flags), 0, 0)
newfd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Statx(dirfd int, path string, flags int, mask int, stat *Statx_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_STATX, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mask), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sync() {
SyscallNoError(SYS_SYNC, 0, 0, 0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Syncfs(fd int) (err error) {
_, _, e1 := Syscall(SYS_SYNCFS, uintptr(fd), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Sysinfo(info *Sysinfo_t) (err error) {
_, _, e1 := RawSyscall(SYS_SYSINFO, uintptr(unsafe.Pointer(info)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_TEE, uintptr(rfd), uintptr(wfd), uintptr(len), uintptr(flags), 0, 0)
n = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Tgkill(tgid int, tid int, sig syscall.Signal) (err error) {
_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Times(tms *Tms) (ticks uintptr, err error) {
r0, _, e1 := RawSyscall(SYS_TIMES, uintptr(unsafe.Pointer(tms)), 0, 0)
ticks = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Umask(mask int) (oldmask int) {
r0, _ := RawSyscallNoError(SYS_UMASK, uintptr(mask), 0, 0)
oldmask = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Uname(buf *Utsname) (err error) {
_, _, e1 := RawSyscall(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unmount(target string, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(target)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Unshare(flags int) (err error) {
_, _, e1 := Syscall(SYS_UNSHARE, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func write(fd int, p []byte) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func exitThread(code int) (err error) {
_, _, e1 := Syscall(SYS_EXIT, uintptr(code), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readlen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writelen(fd int, p *byte, np int) (n int, err error) {
r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(p)), uintptr(np))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_READV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall(SYS_WRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PREADV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PWRITEV, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PREADV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovs) > 0 {
_p0 = unsafe.Pointer(&iovs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PWRITEV2, uintptr(fd), uintptr(_p0), uintptr(len(iovs)), uintptr(offs_l), uintptr(offs_h), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func munmap(addr uintptr, length uintptr) (err error) {
_, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Madvise(b []byte, advice int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(advice))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mprotect(b []byte, prot int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Mlockall(flags int) (err error) {
_, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Msync(b []byte, flags int) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlock(b []byte) (err error) {
var _p0 unsafe.Pointer
if len(b) > 0 {
_p0 = unsafe.Pointer(&b[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Munlockall() (err error) {
_, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func faccessat(dirfd int, path string, mode uint32) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func nameToHandleAt(dirFD int, pathname string, fh *fileHandle, mountID *_C_int, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(pathname)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_NAME_TO_HANDLE_AT, uintptr(dirFD), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(fh)), uintptr(unsafe.Pointer(mountID)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func openByHandleAt(mountFD int, fh *fileHandle, flags int) (fd int, err error) {
r0, _, e1 := Syscall(SYS_OPEN_BY_HANDLE_AT, uintptr(mountFD), uintptr(unsafe.Pointer(fh)), uintptr(flags))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Dup2(oldfd int, newfd int) (err error) {
_, _, e1 := Syscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollCreate(size int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_EPOLL_CREATE, uintptr(size), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
var _p0 unsafe.Pointer
if len(events) > 0 {
_p0 = unsafe.Pointer(&events[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fadvise(fd int, offset int64, length int64, advice int) (err error) {
_, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fchown(fd int, uid int, gid int) (err error) {
_, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstatfs(fd int, buf *Statfs_t) (err error) {
_, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ftruncate(fd int, length int64) (err error) {
_, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getegid() (egid int) {
r0, _ := RawSyscallNoError(SYS_GETEGID, 0, 0, 0)
egid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Geteuid() (euid int) {
r0, _ := RawSyscallNoError(SYS_GETEUID, 0, 0, 0)
euid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getgid() (gid int) {
r0, _ := RawSyscallNoError(SYS_GETGID, 0, 0, 0)
gid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Getuid() (uid int) {
r0, _ := RawSyscallNoError(SYS_GETUID, 0, 0, 0)
uid = int(r0)
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Lchown(path string, uid int, gid int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Listen(s int, n int) (err error) {
_, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(n), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pause() (err error) {
_, _, e1 := Syscall(SYS_PAUSE, 0, 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pread(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PREAD64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_PWRITE64, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(oldpath)
if err != nil {
return
}
var _p1 *byte
_p1, err = BytePtrFromString(newpath)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Seek(fd int, offset int64, whence int) (off int64, err error) {
r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence))
off = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setfsgid(gid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSGID, uintptr(gid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setfsuid(uid int) (err error) {
_, _, e1 := Syscall(SYS_SETFSUID, uintptr(uid), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setregid(rgid int, egid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresgid(rgid int, egid int, sgid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setresuid(ruid int, euid int, suid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setrlimit(resource int, rlim *Rlimit) (err error) {
_, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(resource), uintptr(unsafe.Pointer(rlim)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Setreuid(ruid int, euid int) (err error) {
_, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Shutdown(fd int, how int) (err error) {
_, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(fd), uintptr(how), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
n = int64(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Statfs(path string, buf *Statfs_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func SyncFileRange(fd int, off int64, n int64, flags int) (err error) {
_, _, e1 := Syscall6(SYS_SYNC_FILE_RANGE, uintptr(fd), uintptr(off), uintptr(n), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Truncate(path string, length int64) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Ustat(dev int, ubuf *Ustat_t) (err error) {
_, _, e1 := Syscall(SYS_USTAT, uintptr(dev), uintptr(unsafe.Pointer(ubuf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) {
_, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getgroups(n int, list *_Gid_t) (nn int, err error) {
r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
nn = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setgroups(n int, list *_Gid_t) (err error) {
_, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(n), uintptr(unsafe.Pointer(list)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) {
_, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) {
_, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socket(domain int, typ int, proto int) (fd int, err error) {
r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto))
fd = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) {
_, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) {
_, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) {
var _p0 unsafe.Pointer
if len(p) > 0 {
_p0 = unsafe.Pointer(&p[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) {
var _p0 unsafe.Pointer
if len(buf) > 0 {
_p0 = unsafe.Pointer(&buf[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
_, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) {
r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) {
r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset))
xaddr = uintptr(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func futimesat(dirfd int, path string, times *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_FUTIMESAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)))
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Gettimeofday(tv *Timeval) (err error) {
_, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Utime(path string, buf *Utimbuf) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func utimes(path string, times *[2]Timeval) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pipe2(p *[2]_C_int, flags int) (err error) {
_, _, e1 := RawSyscall(SYS_PIPE2, uintptr(unsafe.Pointer(p)), uintptr(flags), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstat(fd int, st *stat_t) (err error) {
_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(st)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func fstatat(dirfd int, path string, st *stat_t, flags int) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall6(SYS_NEWFSTATAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), uintptr(flags), 0, 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func lstat(path string, st *stat_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func stat(path string, st *stat_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
if err != nil {
return
}
_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func poll(fds *PollFd, nfds int, timeout int) (n int, err error) {
r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
| {
"pile_set_name": "Github"
} |
{
"additionalFeatures": "Adobe\u00ae Flash\u00ae Lite\u00ae 3, DNLA, CrystalTalk\u2122 PLUS technology",
"android": {
"os": "Android 2.1",
"ui": "MOTOBLUR\u2122"
},
"availability": [
"AT&T"
],
"battery": {
"standbyTime": "216 hours",
"talkTime": "6 hours",
"type": "Lithium Ion (Li-Ion) (1540 mAH)"
},
"camera": {
"features": [
"Video"
],
"primary": "3.0 megapixels"
},
"connectivity": {
"bluetooth": "Bluetooth 2.1",
"cell": "WCDMA 850/1900, GSM 850/900/1800/1900, HSDPA 7.2 Mbps (Category 7/8), EDGE Class 12, GPRS Class 12, HSUPA 2.0 Mbps",
"gps": true,
"infrared": false,
"wifi": "802.11 b/g/n"
},
"description": "MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122 with its large 3.7-inch touchscreen and web-browsing capabilities is sure to make an impression. And it keeps your life updated and secure through MOTOBLUR.",
"display": {
"screenResolution": "WVGA (800 x 480)",
"screenSize": "3.7 inches",
"touchScreen": true
},
"hardware": {
"accelerometer": true,
"audioJack": "3.5mm",
"cpu": "800 Mhz",
"fmRadio": true,
"physicalKeyboard": false,
"usb": "USB 2.0"
},
"id": "motorola-bravo-with-motoblur",
"images": [
"img/phones/motorola-bravo-with-motoblur.0.jpg",
"img/phones/motorola-bravo-with-motoblur.1.jpg",
"img/phones/motorola-bravo-with-motoblur.2.jpg"
],
"name": "MOTOROLA BRAVO\u2122 with MOTOBLUR\u2122",
"sizeAndWeight": {
"dimensions": [
"63.0 mm (w)",
"109.0 mm (h)",
"13.3 mm (d)"
],
"weight": "130.0 grams"
},
"storage": {
"flash": "",
"ram": ""
}
}
| {
"pile_set_name": "Github"
} |
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006-2017 Oracle and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* https://oss.oracle.com/licenses/CDDL+GPL-1.1
* or LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
package org.glassfish.webservices;
import com.sun.enterprise.deployment.*;
import com.sun.enterprise.deployment.util.DOLUtils;
import com.sun.enterprise.deployment.archivist.Archivist;
import org.glassfish.api.deployment.archive.ArchiveType;
import com.sun.enterprise.deployment.web.AppListenerDescriptor;
import com.sun.enterprise.util.io.FileUtils;
import com.sun.enterprise.deploy.shared.FileArchive;
import com.sun.enterprise.deploy.shared.ArchiveFactory;
import com.sun.tools.ws.util.xml.XmlUtil;
import org.glassfish.api.deployment.UndeployCommandParameters;
import org.glassfish.loader.util.ASClassLoaderUtil;
import org.glassfish.api.deployment.DeploymentContext;
import org.glassfish.api.deployment.MetaData;
import org.glassfish.api.deployment.archive.ReadableArchive;
import org.glassfish.api.deployment.archive.WritableArchive;
import org.glassfish.api.container.RequestDispatcher;
import org.glassfish.deployment.common.DeploymentException;
import org.glassfish.web.deployment.descriptor.AppListenerDescriptorImpl;
import org.glassfish.web.deployment.util.WebServerInfo;
import org.glassfish.webservices.deployment.WebServicesDeploymentMBean;
import org.glassfish.javaee.core.deployment.JavaEEDeployer;
import org.glassfish.internal.api.JAXRPCCodeGenFacade;
import org.jvnet.hk2.annotations.Service;
import javax.inject.Inject;
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.servlet.SingleThreadModel;
import java.io.*;
import java.net.*;
import java.nio.channels.FileChannel;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Webservices module deployer. This is loaded from WebservicesContainer
*
* @author Bhakti Mehta
* @author Rama Pulavarthi
*/
@Service
public class WebServicesDeployer extends JavaEEDeployer<WebServicesContainer,WebServicesApplication> {
public static final WebServiceDeploymentNotifier deploymentNotifier =
new WebServiceDeploymentNotifierImpl();
public static WebServiceDeploymentNotifier getDeploymentNotifier() {
return deploymentNotifier;
}
private static final Logger logger = LogUtils.getLogger();
private ResourceBundle rb = logger.getResourceBundle();
@Inject
private RequestDispatcher dispatcher;
@Inject
private ArchiveFactory archiveFactory;
/**
* Constructor
*/
public WebServicesDeployer() {
}
protected void cleanArtifacts(DeploymentContext deploymentContext) throws DeploymentException {
}
/**
* Prepares the application bits for running in the application server.
* For certain cases, this is exploding the jar file to a format the
* ContractProvider instance is expecting, generating non portable
* artifacts and other application specific tasks.
* Failure to prepare should throw an exception which will cause the overall
* deployment to fail.
*
* @param dc deployment context
* @return true if the prepare phase was successful
*
*/
@Override
public boolean prepare(DeploymentContext dc) {
try {
Application app = dc.getModuleMetaData(Application.class);
if (app==null) {
// hopefully the DOL gave a good message of the failure...
logger.log(Level.SEVERE, LogUtils.FAILED_LOADING_DD);
return false;
}
BundleDescriptor bundle = DOLUtils.getCurrentBundleForContext(dc);
String moduleCP = getModuleClassPath(dc);
final List<URL> moduleCPUrls = ASClassLoaderUtil.getURLsFromClasspath(moduleCP, File.pathSeparator, null);
final ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
URLClassLoader newCl = AccessController.doPrivileged(new PrivilegedAction<URLClassLoader>() {
@Override
public URLClassLoader run() {
return new URLClassLoader(ASClassLoaderUtil.convertURLListToArray(moduleCPUrls), oldCl);
}
});
Thread.currentThread().setContextClassLoader(newCl);
WebServicesDescriptor wsDesc = bundle.getWebServices();
for (WebService ws : wsDesc.getWebServices()) {
if ((new WsUtil()).isJAXWSbasedService(ws)){
setupJaxWSServiceForDeployment(dc, ws);
} else {
JAXRPCCodeGenFacade facade= habitat.getService(JAXRPCCodeGenFacade.class);
if (facade != null) {
facade.run(habitat, dc, moduleCP, false);
} else {
throw new DeploymentException(rb.getString(LogUtils.JAXRPC_CODEGEN_FAIL)) ;
}
}
}
doWebServicesDeployment(app,dc);
Thread.currentThread().setContextClassLoader(oldCl);
WebServicesContainer container = habitat.getService(WebServicesContainer.class);
WebServicesDeploymentMBean bean = container.getDeploymentBean();
WebServiceDeploymentNotifier notifier = getDeploymentNotifier();
bean.deploy(wsDesc,notifier);
return true;
} catch (Exception ex) {
RuntimeException re = new RuntimeException(ex.getMessage());
re.initCause(ex);
throw re;
}
}
protected void setupJaxWSServiceForDeployment(DeploymentContext dc, WebService ws) throws DeploymentException {
BundleDescriptor bundle = dc.getModuleMetaData(BundleDescriptor.class);
// for modules this is domains/<domain-name>/j2ee-modules/<module-name>
// for apps this is domains/<domain-name>/j2ee-apps/<app-name>/<foo_war> (in case of embedded wars)
// or domains/<domain-name>/j2ee-apps/<app-name>/<foo_jar> (in case of embedded jars)
File moduleDir = dc.getSourceDir();
//For modules this is domains/<domain-name>/generated/xml
//Check with Hong about j2ee-modules
File wsdlDir = dc.getScratchDir("xml");
mkDirs(wsdlDir);
//For modules this is domains/<domain-name>/generated/xml
//Check with Hong about j2ee-modules
File stubsDir = dc.getScratchDir("ejb");
mkDirs(stubsDir);
if (!DOLUtils.warType().equals(bundle.getModuleType()) &&
!DOLUtils.ejbType().equals(bundle.getModuleType())) {
// unknown module type with @WebService, just ignore...
return;
}
wsdlDir = new File(wsdlDir, bundle.getWsdlDir().replaceAll("/", "\\"+File.separator));
// Check if catalog file is present, if so get mapped WSDLs
String wsdlFileUri;
File wsdlFile;
try {
checkCatalog(bundle, ws, moduleDir);
} catch (DeploymentException e) {
logger.log(Level.SEVERE, LogUtils.ERROR_RESOLVING_CATALOG);
}
if (ws.hasWsdlFile()) {
// If wsdl file is an http URL, download that WSDL and all embedded relative wsdls, schemas
if (ws.getWsdlFileUri().startsWith("http")) {
try {
wsdlFileUri = downloadWsdlsAndSchemas( new URL(ws.getWsdlFileUri()), wsdlDir);
} catch(Exception e) {
throw new DeploymentException(e.toString(), e);
}
wsdlFile = new File(wsdlDir, wsdlFileUri);
} else {
wsdlFileUri = ws.getWsdlFileUri();
File wsdlFileAbs = new File(wsdlFileUri);
wsdlFile = wsdlFileAbs.isAbsolute()? wsdlFileAbs : new File(moduleDir, wsdlFileUri);
}
if (!wsdlFile.exists()) {
String errorMessage = format(logger.getResourceBundle().getString(LogUtils.WSDL_NOT_FOUND),
ws.getWsdlFileUri(), bundle.getModuleDescriptor().getArchiveUri());
logger.log(Level.SEVERE, errorMessage);
throw new DeploymentException(errorMessage);
}
}
}
/**
* Loads the meta date associated with the application.
*
* @parameters type type of metadata that this deployer has declared providing.
*/
@Override
public Object loadMetaData(Class type, DeploymentContext dc) {
//Moved the doWebServicesDeployment back to prepare after discussing with
//Jerome
//see this bug https://glassfish.dev.java.net/issues/show_bug.cgi?id=8080
return true;
}
/**
* Returns the meta data assocated with this Deployer
*
* @return the meta data for this Deployer
*/
@Override
public MetaData getMetaData() {
return new MetaData(false, null, new Class[] {Application.class});
}
/**
* This method downloads the main wsdl/schema and its imports in to the directory specified and returns the name of downloaded root
* document.
* @param httpUrl
* @param wsdlDir
* @return Returns the name of the root file downloaded with the invocation.
* @throws Exception
*/
private String downloadWsdlsAndSchemas( URL httpUrl, File wsdlDir) throws Exception {
// First make required directories and download this wsdl file
mkDirs(wsdlDir);
String fileName = httpUrl.toString().substring(httpUrl.toString().lastIndexOf("/")+1);
File toFile = new File(wsdlDir.getAbsolutePath()+File.separator+fileName);
downloadFile(httpUrl, toFile);
// Get a list of wsdl and schema relative imports in this wsdl
HashSet<Import> wsdlRelativeImports = new HashSet<Import>();
HashSet<Import> schemaRelativeImports = new HashSet<Import>();
HashSet<Import> wsdlIncludes = new HashSet<Import>();
HashSet<Import> schemaIncludes = new HashSet<Import>();
parseRelativeImports(httpUrl, wsdlRelativeImports, wsdlIncludes,
schemaRelativeImports, schemaIncludes);
wsdlRelativeImports.addAll(wsdlIncludes);
schemaRelativeImports.addAll(schemaIncludes);
// Download all schema relative imports
String urlWithoutFileName = httpUrl.toString().substring(0, httpUrl.toString().lastIndexOf("/"));
for(Import next : schemaRelativeImports) {
String location = next.getLocation();
location = location.replaceAll("/", "\\"+File.separator);
if(location.lastIndexOf(File.separator) != -1) {
File newDir = new File(wsdlDir.getAbsolutePath()+File.separator+
location.substring(0, location.lastIndexOf(File.separator)));
mkDirs(newDir);
}
downloadFile(new URL(urlWithoutFileName+"/"+next.getLocation()),
new File(wsdlDir.getAbsolutePath()+File.separator+location));
}
// Download all wsdl relative imports
for(Import next : wsdlRelativeImports) {
String newWsdlLocation = next.getLocation();
newWsdlLocation = newWsdlLocation.replaceAll("/", "\\"+File.separator);
File newWsdlDir;
if(newWsdlLocation.lastIndexOf(File.separator) != -1) {
newWsdlDir = new File(wsdlDir.getAbsolutePath() + File.separator +
newWsdlLocation.substring(0, newWsdlLocation.lastIndexOf(File.separator)));
} else {
newWsdlDir = wsdlDir;
}
downloadWsdlsAndSchemas( new URL(urlWithoutFileName+"/"+next.getLocation()), newWsdlDir);
}
return fileName;
}
// If catalog file is present, get the mapped WSDL for given WSDL and replace the value in
// the given WebService object
private void checkCatalog(BundleDescriptor bundle, WebService ws, File moduleDir)
throws DeploymentException {
// If no catalog file is present, return
File catalogFile = new File(moduleDir,
bundle.getDeploymentDescriptorDir() +
File.separator + "jax-ws-catalog.xml");
if(!catalogFile.exists()) {
return;
}
resolveCatalog(catalogFile, ws.getWsdlFileUri(), ws);
}
public URL resolveCatalog(File catalogFile, String wsdlFile, WebService ws) throws DeploymentException {
try {
URL retVal = null;
// Get an entity resolver
org.xml.sax.EntityResolver resolver =
XmlUtil.createEntityResolver(catalogFile.toURL());
org.xml.sax.InputSource source = resolver.resolveEntity(null, wsdlFile);
if(source != null) {
String mappedEntry = source.getSystemId();
// For entries with relative paths, Entity resolver always
// return file://<absolute path
if(mappedEntry.startsWith("file:")) {
File f = new File(mappedEntry.substring(mappedEntry.indexOf(":")+1));
if(!f.exists()) {
throw new DeploymentException(format(rb.getString(LogUtils.CATALOG_RESOLVER_ERROR), mappedEntry));
}
retVal = f.toURI().toURL();
if(ws != null) {
ws.setWsdlFileUri(f.getAbsolutePath());
ws.setWsdlFileUrl(retVal);
}
} else if(mappedEntry.startsWith("http")) {
retVal = new URL(mappedEntry);
if(ws != null) {
ws.setWsdlFileUrl(retVal);
}
}
}
return retVal;
} catch (Throwable t) {
throw new DeploymentException(format(rb.getString(LogUtils.CATALOG_ERROR),
catalogFile.getAbsolutePath(), t.getMessage()));
}
}
/**
* Copies file from source to destination
*
* @param src
* @param dest
* @throws IOException
*/
private static void copyFile(File src, File dest) throws IOException {
if (!dest.exists()) {
mkDirs(dest.getParentFile());
mkFile(dest);
}
FileChannel srcChannel = null;
FileChannel destChannel = null;
try {
srcChannel = new FileInputStream(src).getChannel();
destChannel = new FileOutputStream(dest).getChannel();
destChannel.transferFrom(srcChannel, 0, srcChannel.size());
}
finally {
if (srcChannel != null) {
srcChannel.close();
}
if (destChannel != null) {
destChannel.close();
}
}
}
public void downloadFile(URL httpUrl, File toFile) throws Exception {
InputStream is = null;
FileOutputStream os = null;
try {
if(!toFile.createNewFile()) {
throw new Exception(format(rb.getString(LogUtils.FILECREATION_ERROR), toFile.getAbsolutePath()));
}
is = httpUrl.openStream();
os = new FileOutputStream(toFile, true);
int readCount;
byte[] buffer = new byte[10240]; // Read 10KB at a time
while(true) {
readCount = is.read(buffer, 0, 10240);
if(readCount != -1) {
os.write(buffer, 0, readCount);
} else {
break;
}
}
os.flush();
} finally {
try {
if (is != null) {
is.close();
}
} finally {
if (os != null) {
os.close();
}
}
}
}
/**
* Collect all relative imports from a web service's main wsdl document.
*
* @param wsdlFileUrl
* @param wsdlRelativeImports output param in which wsdl relative imports
* will be added
*
* @param schemaRelativeImports output param in which schema relative
* imports will be added
* @param schemaIncludes output param in which schema includes will be added
*/
private void parseRelativeImports(URL wsdlFileUrl,
Collection wsdlRelativeImports,
Collection wsdlIncludes,
Collection schemaRelativeImports,
Collection schemaIncludes)
throws Exception {
// We will use our little parser rather than using JAXRPC's heavy weight WSDL parser
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
//Validation is not needed as we want to be too strict in processing wsdls that are generated by buggy tools.
factory.setExpandEntityReferences(false);
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
InputStream is = null;
try {
DocumentBuilder builder = factory.newDocumentBuilder();
is = wsdlFileUrl.openStream();
Document document = builder.parse(is);
procesSchemaImports(document, schemaRelativeImports);
procesWsdlImports(document, wsdlRelativeImports);
procesSchemaIncludes(document, schemaIncludes);
procesWsdlIncludes(document, wsdlIncludes);
} catch (SAXParseException spe) {
// Error generated by the parser
logger.log(Level.SEVERE, LogUtils.PARSING_ERROR,
new Object[] {spe.getLineNumber() ,spe.getSystemId()});
// Use the contained exception, if any
Exception x = spe;
if (spe.getException() != null) {
x = spe.getException();
}
logger.log(Level.SEVERE, LogUtils.ERROR_OCCURED, x);
} catch (Exception sxe) {
logger.log(Level.SEVERE, LogUtils.WSDL_PARSING_ERROR, sxe.getMessage());
} finally {
try {
if(is != null) {
is.close();
}
} catch (IOException io) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, LogUtils.EXCEPTION_THROWN, io.getMessage());
}
}
}
}
private void procesSchemaImports(Document document, Collection schemaImportCollection) throws SAXException,
ParserConfigurationException, IOException {
NodeList schemaImports =
document.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "import");
addImportsAndIncludes(schemaImports, schemaImportCollection, "namespace", "schemaLocation");
}
private void procesWsdlImports(Document document, Collection wsdlImportCollection) throws SAXException,
ParserConfigurationException, IOException {
NodeList wsdlImports =
document.getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/", "import");
addImportsAndIncludes(wsdlImports, wsdlImportCollection, "namespace", "location");
}
private void procesSchemaIncludes(Document document, Collection schemaIncludeCollection) throws SAXException,
ParserConfigurationException, IOException {
NodeList schemaIncludes =
document.getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "include");
addImportsAndIncludes(schemaIncludes, schemaIncludeCollection, null, "schemaLocation");
}
private void procesWsdlIncludes(Document document, Collection wsdlIncludesCollection) throws SAXException,
ParserConfigurationException, IOException {
NodeList wsdlIncludes =
document.getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/", "include");
addImportsAndIncludes(wsdlIncludes, wsdlIncludesCollection, null, "location");
}
private void addImportsAndIncludes(NodeList list, Collection result,
String namespace, String location) throws SAXException,
ParserConfigurationException, IOException {
for(int i=0; i<list.getLength(); i++) {
String givenLocation = null;
Node element = list.item(i);
NamedNodeMap attrs = element.getAttributes();
Node n= attrs.getNamedItem(location);
if(n != null) {
givenLocation = n.getNodeValue();
}
if(givenLocation == null || givenLocation.startsWith("http")) {
continue;
}
Import imp = new Import();
imp.setLocation(givenLocation);
if(namespace != null) {
n = attrs.getNamedItem(namespace);
if(n != null) {
imp.setNamespace(n.getNodeValue());
}
}
result.add(imp);
}
}
/**
* Processes all the web services in the module and prepares for deployment.
* The tasks include composing the endpoint publish url and generating WSDL in to the application repository
* directory.
*
* In JAX-WS, WSDL files are generated dynamically, hence skips the wsdl generation step unless explicitly requested
* for WSDL file publishing via DD.
*
* @param app
* @param dc
* @throws Exception
*/
private void doWebServicesDeployment(Application app, DeploymentContext dc)
throws Exception{
Collection<WebService> webServices = new HashSet<WebService>();
// when there are multiple sub modules in ear, we only want to handle the ones local to this deployment context
//First get the web services associated with module bundle descriptor.
WebServicesDescriptor wsDesc = dc.getModuleMetaData(WebServicesDescriptor.class);
if (wsDesc != null && wsDesc.getWebServices().size() > 0) {
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, LogUtils.WS_LOCAL,
new Object[] {wsDesc.getWebServices().size(), getWebServiceDescriptors(app).size()});
}
webServices.addAll(wsDesc.getWebServices());
}
//Now get the web services associated with extension descriptors,ex: EJB WS in war.
WebBundleDescriptor webBundleDesc = dc.getModuleMetaData(WebBundleDescriptor.class);
if (webBundleDesc != null) {
Collection<EjbBundleDescriptor> ejbBundleDescriptors = webBundleDesc.getExtensionsDescriptors(EjbBundleDescriptor.class);
for (EjbBundleDescriptor ejbBundleDescriptor : ejbBundleDescriptors) {
Collection wsInExtnDesc = ejbBundleDescriptor.getWebServices().getWebServices();
webServices.addAll(wsInExtnDesc);
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, LogUtils.WS_VIA_EXT, wsInExtnDesc);
}
}
}
// swap the deployment descriptors context-root with the one
// provided in the deployment request.
//do not do for ejb in war case
if (webBundleDesc!= null && webBundleDesc.getExtensionsDescriptors(EjbBundleDescriptor.class).size()==0) {
if (dc.getAppProps().get("context-root") != null &&
app.isVirtual() ) {
String contextRoot = ((String)dc.getAppProps().get("context-root"));
webBundleDesc.setContextRoot(contextRoot);
}
}
// Generate final wsdls for all web services and store them in
// the application repository directory.
for(WebService next : webServices) {
WsUtil wsUtil = new WsUtil();
// For JAXWS services, we rely on JAXWS RI to do WSL gen and publishing
// For JAXRPC we do it here in 109
//however it is needed for file publishing for jaxws
if(wsUtil.isJAXWSbasedService(next) && (!next.hasFilePublishing())) {
for(WebServiceEndpoint wsep : next.getEndpoints()) {
URL finalWsdlURL = wsep.composeFinalWsdlUrl(wsUtil.getWebServerInfoForDAS().getWebServerRootURL(wsep.isSecure()));
Set<ServiceReferenceDescriptor> serviceRefs = new HashSet<ServiceReferenceDescriptor>();
if (webBundleDesc != null) {
serviceRefs = webBundleDesc.getServiceReferenceDescriptors();
} else {
EjbBundleDescriptor ejbBundleDesc = dc.getModuleMetaData(EjbBundleDescriptor.class);
if (ejbBundleDesc != null) {
serviceRefs = ejbBundleDesc.getEjbServiceReferenceDescriptors();
} else {
logger.log(Level.SEVERE, LogUtils.UNSUPPORTED_MODULE_TYPE,
DOLUtils.getCurrentBundleForContext(dc).getModuleType());
}
}
//if there's service-ref to this service update its
// wsdl-file value to point to the just exposed URL
for (ServiceReferenceDescriptor srd : serviceRefs) {
if (srd.getServiceName().equals(wsep.getServiceName())
&& srd.getServiceNamespaceUri().equals(wsep.getWsdlService().getNamespaceURI())) {
srd.setWsdlFileUri(finalWsdlURL.toExternalForm() + "?WSDL");
}
}
}
} else {
// Even if deployer specified a wsdl file
// publish location, server can't assume it can access that
// file system. Plus, it's cleaner to depend on a file stored
// within the application repository rather than one directly
// exposed to the deployer. Name of final wsdl is derived based
// on the location of its associated module. This prevents us
// from having write the module to disk in order to store the
// modified runtime info.
URL url = next.getWsdlFileUrl();
if (url == null ) {
File f = new File(dc.getSourceDir(),next.getWsdlFileUri()) ;
url = f.toURL();
}
// Create the generated WSDL in the generated directory; for that create the directories first
File genXmlDir = dc.getScratchDir("xml");
String wsdlFileDir = next.getWsdlFileUri().substring(0, next.getWsdlFileUri().lastIndexOf('/'));
mkDirs(new File(genXmlDir, wsdlFileDir));
File genWsdlFile = new File(genXmlDir, next.getWsdlFileUri());
wsUtil.generateFinalWsdl(url, next, wsUtil.getWebServerInfoForDAS(), genWsdlFile);
}
}
//Swap the servlet class name with a real servlet processing the SOAP requests.
if (webBundleDesc != null) {
doWebServiceDeployment(webBundleDesc);
}
}
/**
* Prepares the servlet based web services specified in web.xml for deployment.
*
* Swap the application written servlet implementation class for
* one provided by the container. The original class is stored
* as runtime information since it will be used as the servant at
* dispatch time.
*/
private void doWebServiceDeployment(WebBundleDescriptor webBunDesc)
throws DeploymentException, MalformedURLException {
/**
* Combining code from <code>com.sun.enterprise.deployment.backend.WebServiceDeployer</code>
* in v2
*/
Collection<WebServiceEndpoint> endpoints =
webBunDesc.getWebServices().getEndpoints();
ClassLoader cl = webBunDesc.getClassLoader();
WsUtil wsutil = new WsUtil();
for(WebServiceEndpoint nextEndpoint : endpoints) {
WebComponentDescriptor webComp = nextEndpoint.getWebComponentImpl();
if( !nextEndpoint.hasServletImplClass() ) {
throw new DeploymentException( format(rb.getString(
LogUtils.DEPLOYMENT_BACKEND_CANNOT_FIND_SERVLET),
nextEndpoint.getEndpointName()));
}
if (nextEndpoint.hasEndpointAddressUri()) {
webComp.getUrlPatternsSet().clear();
webComp.addUrlPattern(nextEndpoint.getEndpointAddressUri());
}
if( !nextEndpoint.getWebService().hasFilePublishing() ) {
String publishingUri = nextEndpoint.getPublishingUri();
String publishingUrlPattern =
(publishingUri.charAt(0) == '/') ?publishingUri : "/" + publishingUri + "/*";
webComp.addUrlPattern(publishingUrlPattern);
}
String servletImplClass = nextEndpoint.getServletImplClass();
try {
Class servletImplClazz = cl.loadClass(servletImplClass);
String containerServlet;
if(wsutil.isJAXWSbasedService(nextEndpoint.getWebService())) {
containerServlet = "org.glassfish.webservices.JAXWSServlet";
addWSServletContextListener(webBunDesc);
} else {
containerServlet =
SingleThreadModel.class.isAssignableFrom(servletImplClazz) ?
"org.glassfish.webservices.SingleThreadJAXRPCServlet" :
"org.glassfish.webservices.JAXRPCServlet";
}
webComp.setWebComponentImplementation(containerServlet);
} catch(ClassNotFoundException cex) {
throw new DeploymentException( format(rb.getString(
LogUtils.DEPLOYMENT_BACKEND_CANNOT_FIND_SERVLET),
nextEndpoint.getEndpointName()));
}
/**
* Now trying to figure the address from <code>com.sun.enterprise.webservice.WsUtil.java</code>
*/
// Get a URL for the root of the webserver, where the host portion
// is a canonical host name. Since this will be used to compose the
// endpoint address that is written into WSDL, it's better to use
// hostname as opposed to IP address.
// The protocol and port will be based on whether the endpoint
// has a transport guarantee of INTEGRAL or CONFIDENTIAL.
// If yes, https will be used. Otherwise, http will be used.
WebServerInfo wsi = new WsUtil().getWebServerInfoForDAS();
URL rootURL = wsi.getWebServerRootURL(nextEndpoint.isSecure());
String contextRoot = webBunDesc.getContextRoot();
URL actualAddress = nextEndpoint.composeEndpointAddress(rootURL, contextRoot);
if (wsi.getHttpVS() != null && wsi.getHttpVS().getPort()!=0) {
logger.log(Level.INFO, LogUtils.ENDPOINT_REGISTRATION,
new Object[] {nextEndpoint.getEndpointName(), actualAddress});
}
}
}
private void addWSServletContextListener(WebBundleDescriptor webBunDesc) {
for(AppListenerDescriptor appListner: webBunDesc.getAppListenerDescriptors()) {
if(appListner.getListener().equals(WSServletContextListener.class.getName())) {
//already registered
return;
}
}
webBunDesc.addAppListenerDescriptor(new AppListenerDescriptorImpl(WSServletContextListener.class.getName()));
}
private String format(String key, String ... values){
return MessageFormat.format(key, (Object [])values);
}
public static void moveFile(String sourceFile, String destFile)
throws IOException {
FileUtils.copy(sourceFile, destFile);
FileUtils.deleteFile(new File(sourceFile));
}
@Override
public void unload(WebServicesApplication container, DeploymentContext context) {
final WebServiceDeploymentNotifier notifier = getDeploymentNotifier();
deletePublishedFiles(container.getPublishedFiles());
Application app = container.getApplication();
if ( app == null ) {
// load uses context.getModuleMetaData(Application.class) to get the Application. If there's a deployment
// failure then "container" may not have initialized the application and container.getApplication() returns
// null and we get NPE. So use context.getModuleMetaData(Application.class) always.
app = context.getModuleMetaData(Application.class);
}
if ( app != null ) {
for(WebService svc : getWebServiceDescriptors(app)) {
for(WebServiceEndpoint endpoint : svc.getEndpoints()) {
if (notifier != null) {
notifier.notifyUndeployed(endpoint);
}
}
}
}
}
@Override
public void clean(DeploymentContext dc) {
super.clean(dc);
WebServicesContainer container = habitat.getService(WebServicesContainer.class);
WebServicesDeploymentMBean bean = container.getDeploymentBean();
UndeployCommandParameters params = dc.getCommandParameters(UndeployCommandParameters.class);
if (params != null) {
bean.undeploy(params.name);
}
}
@Override
public WebServicesApplication load(WebServicesContainer container, DeploymentContext context) {
Set<String> publishedFiles = null;
Application app = context.getModuleMetaData(Application.class);
try {
publishedFiles = populateWsdlFilesForPublish(context, getWebServiceDescriptors(app));
} catch(Exception e) {
throw new RuntimeException(e);
}
return new WebServicesApplication(context, dispatcher, publishedFiles);
}
/**
* Populate the wsdl files entries to download (if any) (Only for webservices which
* use file publishing).
*
* TODO File publishing currently works only for wsdls packaged in the application for jax-ws.
* Need to publish the dynamically generated wsdls as well. Lazy creation of WSEndpoint objects prohibits it now.
*/
private Set<String> populateWsdlFilesForPublish(
DeploymentContext dc, Set<WebService> webservices) throws IOException {
Set<String> publishedFiles = new HashSet<String>();
for (WebService webService : webservices) {
if (!webService.hasFilePublishing()) {
continue;
}
copyExtraFilesToGeneratedFolder(dc);
BundleDescriptor bundle = webService.getBundleDescriptor();
ArchiveType moduleType = bundle.getModuleType();
//only EAR, WAR and EJB archives could contain wsdl files for publish
if (moduleType==null || !(moduleType.equals(DOLUtils.earType()) ||
moduleType.equals(DOLUtils.warType()) ||
moduleType.equals(DOLUtils.ejbType()))) {
return publishedFiles;
}
File sourceDir = dc.getScratchDir("xml");
File parent;
try {
URI clientPublishURI = webService.getClientPublishUrl().toURI();
if(!clientPublishURI.isOpaque()) {
parent = new File(clientPublishURI);
} else {
parent = new File(webService.getClientPublishUrl().getPath());
}
} catch (URISyntaxException e) {
logger.log(Level.WARNING, LogUtils.EXCEPTION_THROWN, e);
parent = new File(webService.getClientPublishUrl().getPath());
}
// Collect the names of all entries in or below the
// dedicated wsdl directory.
FileArchive archive = new FileArchive();
archive.open(sourceDir.toURI());
Enumeration entries = archive.entries(bundle.getWsdlDir());
while (entries.hasMoreElements()) {
String name = (String) entries.nextElement();
String wsdlName = stripWsdlDir(name, bundle);
File clientwsdl = new File(parent, wsdlName);
File fulluriFile = new File(sourceDir, name);
if (!fulluriFile.isDirectory()) {
publishFile(fulluriFile, clientwsdl);
publishedFiles.add(clientwsdl.getAbsolutePath());
}
}
}
return publishedFiles;
}
private void publishFile(File file, File publishLocation) throws IOException {
copyFile(file, publishLocation);
}
private void deletePublishedFiles(Set<String> publishedFiles) {
if (publishedFiles != null) {
for (String path: publishedFiles) {
File f = new File(path);
if (f.exists()) {
FileUtils.deleteFile(f);
}
}
}
}
/**
* This is to be used for file publishing only. In case of wsdlImports and wsdlIncludes
* we need to copy the nested wsdls from applications folder to the generated/xml folder
*
*/
private void copyExtraFilesToGeneratedFolder( DeploymentContext context) throws IOException{
Archivist archivist = habitat.getService(Archivist.class);
ReadableArchive archive = archiveFactory.openArchive(
context.getSourceDir());
WritableArchive archive2 = archiveFactory.createArchive(
context.getScratchDir("xml"));
// copy the additional webservice elements etc
archivist.copyExtraElements(archive, archive2);
}
/**
* Return the entry name without "WEB-INF/wsdl" or "META-INF/wsdl".
*/
private String stripWsdlDir(String entry, BundleDescriptor bundle) {
String wsdlDir = bundle.getWsdlDir();
return entry.substring(wsdlDir.length()+1);
}
/**
* Return a set of all com.sun.enterprise.deployment.WebService
* descriptors in the application.
*/
private Set<WebService> getWebServiceDescriptors(Application app) {
Set<WebService> webServiceDescriptors = new HashSet<WebService>();
for (BundleDescriptor next : app.getBundleDescriptors()) {
WebServicesDescriptor webServicesDesc =
next.getWebServices();
webServiceDescriptors.addAll(webServicesDesc.getWebServices());
}
return webServiceDescriptors;
}
private static void mkDirs(File f) {
if (!f.mkdirs() && logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, LogUtils.DIR_EXISTS, f);
}
}
private static void mkFile(File f) throws IOException {
if (!f.createNewFile() && logger.isLoggable(Level.FINE)) {
logger.log(Level.FINE, LogUtils.FILE_EXISTS, f);
}
}
}
| {
"pile_set_name": "Github"
} |
<?php
/**
* Created by PhpStorm.
* User: bruce
* Date: 2019-07-19
* Time: 20:32
*/
namespace uploader;
use Obs\ObsClient;
use Obs\ObsException;
class UploadHuawei extends Common {
//华为AccessKey
public $accessKey;
//华为AccessSecret
public $secretKey;
//华为存储空间名称
public $bucket;
//EndPoint
public $endpoint;
//华为对外开放域名
public $domain;
//目录
public $directory;
//上传目标服务器名称
public $uploadServer;
//config from config.php, using static because the parent class needs to use it.
public static $config;
//arguments from php client, the image absolute path
public $argv;
/**
* Upload constructor.
*
* @param $params
*/
public function __construct($params)
{
$ServerConfig = $params['config']['storageTypes'][$params['uploadServer']];
$this->accessKey = $ServerConfig['accessKey'];
$this->secretKey = $ServerConfig['secretKey'];
$this->bucket = $ServerConfig['bucket'];
$this->endpoint = $ServerConfig['endpoint'];
$this->domain = $ServerConfig['domain'];
//http://markdown.obs.cn-south-1.myhuaweicloud.com
$defaultDomain = 'https://' . $this->bucket . '.' . $this->endpoint;
!$this->domain && $this->domain = $defaultDomain;
if(!isset($ServerConfig['directory']) || ($ServerConfig['directory']=='' && $ServerConfig['directory']!==false)){
//如果没有设置,使用默认的按年/月/日方式使用目录
$this->directory = date('Y/m/d');
}else{
//设置了,则按设置的目录走
$this->directory = trim($ServerConfig['directory'], '/');
}
$this->uploadServer = ucfirst($params['uploadServer']);
$this->argv = $params['argv'];
static::$config = $params['config'];
}
/**
* Upload files to Huawei OBS(Object-Storage)
* @param $key
* @param $uploadFilePath
*
* @return array
*/
public function upload($key, $uploadFilePath){
try {
if($this->directory){
$key = $this->directory . '/' . $key;
}
$obsClient = ObsClient::factory([
'key' => $this->accessKey,
'secret' => $this->secretKey,
'endpoint' => $this->endpoint,
'socket_timeout' => 30,
'connect_timeout' => 30
]);
/*
* Step 1: initiate multipart upload
*/
$resp = $obsClient -> initiateMultipartUpload(['Bucket'=>$this->bucket, 'Key'=>$key]);
$uploadId = $resp['UploadId'];
/*
* Step 2: upload a part
*/
$fp = fopen($uploadFilePath, 'rb');
$resp = $obsClient->uploadPart([
'Bucket' => $this->bucket,
'Key' => $key,
'UploadId' => $uploadId,
'PartNumber' => 1,
'Body' => $fp,
]);
is_resource($fp) && fclose($fp);
$etag = $resp['ETag'];
/*
* Step 3: complete multipart upload
*/
$res = $obsClient->completeMultipartUpload([
'Bucket' => $this->bucket,
'Key' => $key,
'UploadId' => $uploadId,
'Parts' => [
['PartNumber' => 1,'ETag' => $etag]
],
]);
if(!isset($res['Key'])){
throw new ObsException(var_export($res, true));
}
$data = [
'code' => 0,
'msg' => 'success',
'key' => $key,
'domain' => $this->domain,
];
}catch (ObsException $e){
//上传出错,记录错误日志(为了保证统一处理那里不出错,虽然报错,但这里还是返回对应格式)
$data = [
'code' => -1,
'msg' => $e->getMessage(),
];
$this->writeLog(date('Y-m-d H:i:s').'(' . $this->uploadServer . ') => '.$e->getMessage() . "\n\n", 'error_log');
}
return $data;
}
} | {
"pile_set_name": "Github"
} |
// Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2016 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package proto
import (
"fmt"
"reflect"
"strings"
"sync"
"sync/atomic"
)
// Merge merges the src message into dst.
// This assumes that dst and src of the same type and are non-nil.
func (a *InternalMessageInfo) Merge(dst, src Message) {
mi := atomicLoadMergeInfo(&a.merge)
if mi == nil {
mi = getMergeInfo(reflect.TypeOf(dst).Elem())
atomicStoreMergeInfo(&a.merge, mi)
}
mi.merge(toPointer(&dst), toPointer(&src))
}
type mergeInfo struct {
typ reflect.Type
initialized int32 // 0: only typ is valid, 1: everything is valid
lock sync.Mutex
fields []mergeFieldInfo
unrecognized field // Offset of XXX_unrecognized
}
type mergeFieldInfo struct {
field field // Offset of field, guaranteed to be valid
// isPointer reports whether the value in the field is a pointer.
// This is true for the following situations:
// * Pointer to struct
// * Pointer to basic type (proto2 only)
// * Slice (first value in slice header is a pointer)
// * String (first value in string header is a pointer)
isPointer bool
// basicWidth reports the width of the field assuming that it is directly
// embedded in the struct (as is the case for basic types in proto3).
// The possible values are:
// 0: invalid
// 1: bool
// 4: int32, uint32, float32
// 8: int64, uint64, float64
basicWidth int
// Where dst and src are pointers to the types being merged.
merge func(dst, src pointer)
}
var (
mergeInfoMap = map[reflect.Type]*mergeInfo{}
mergeInfoLock sync.Mutex
)
func getMergeInfo(t reflect.Type) *mergeInfo {
mergeInfoLock.Lock()
defer mergeInfoLock.Unlock()
mi := mergeInfoMap[t]
if mi == nil {
mi = &mergeInfo{typ: t}
mergeInfoMap[t] = mi
}
return mi
}
// merge merges src into dst assuming they are both of type *mi.typ.
func (mi *mergeInfo) merge(dst, src pointer) {
if dst.isNil() {
panic("proto: nil destination")
}
if src.isNil() {
return // Nothing to do.
}
if atomic.LoadInt32(&mi.initialized) == 0 {
mi.computeMergeInfo()
}
for _, fi := range mi.fields {
sfp := src.offset(fi.field)
// As an optimization, we can avoid the merge function call cost
// if we know for sure that the source will have no effect
// by checking if it is the zero value.
if unsafeAllowed {
if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string
continue
}
if fi.basicWidth > 0 {
switch {
case fi.basicWidth == 1 && !*sfp.toBool():
continue
case fi.basicWidth == 4 && *sfp.toUint32() == 0:
continue
case fi.basicWidth == 8 && *sfp.toUint64() == 0:
continue
}
}
}
dfp := dst.offset(fi.field)
fi.merge(dfp, sfp)
}
// TODO: Make this faster?
out := dst.asPointerTo(mi.typ).Elem()
in := src.asPointerTo(mi.typ).Elem()
if emIn, err := extendable(in.Addr().Interface()); err == nil {
emOut, _ := extendable(out.Addr().Interface())
mIn, muIn := emIn.extensionsRead()
if mIn != nil {
mOut := emOut.extensionsWrite()
muIn.Lock()
mergeExtension(mOut, mIn)
muIn.Unlock()
}
}
if mi.unrecognized.IsValid() {
if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 {
*dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...)
}
}
}
func (mi *mergeInfo) computeMergeInfo() {
mi.lock.Lock()
defer mi.lock.Unlock()
if mi.initialized != 0 {
return
}
t := mi.typ
n := t.NumField()
props := GetProperties(t)
for i := 0; i < n; i++ {
f := t.Field(i)
if strings.HasPrefix(f.Name, "XXX_") {
continue
}
mfi := mergeFieldInfo{field: toField(&f)}
tf := f.Type
// As an optimization, we can avoid the merge function call cost
// if we know for sure that the source will have no effect
// by checking if it is the zero value.
if unsafeAllowed {
switch tf.Kind() {
case reflect.Ptr, reflect.Slice, reflect.String:
// As a special case, we assume slices and strings are pointers
// since we know that the first field in the SliceSlice or
// StringHeader is a data pointer.
mfi.isPointer = true
case reflect.Bool:
mfi.basicWidth = 1
case reflect.Int32, reflect.Uint32, reflect.Float32:
mfi.basicWidth = 4
case reflect.Int64, reflect.Uint64, reflect.Float64:
mfi.basicWidth = 8
}
}
// Unwrap tf to get at its most basic type.
var isPointer, isSlice bool
if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
isSlice = true
tf = tf.Elem()
}
if tf.Kind() == reflect.Ptr {
isPointer = true
tf = tf.Elem()
}
if isPointer && isSlice && tf.Kind() != reflect.Struct {
panic("both pointer and slice for basic type in " + tf.Name())
}
switch tf.Kind() {
case reflect.Int32:
switch {
case isSlice: // E.g., []int32
mfi.merge = func(dst, src pointer) {
// NOTE: toInt32Slice is not defined (see pointer_reflect.go).
/*
sfsp := src.toInt32Slice()
if *sfsp != nil {
dfsp := dst.toInt32Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []int64{}
}
}
*/
sfs := src.getInt32Slice()
if sfs != nil {
dfs := dst.getInt32Slice()
dfs = append(dfs, sfs...)
if dfs == nil {
dfs = []int32{}
}
dst.setInt32Slice(dfs)
}
}
case isPointer: // E.g., *int32
mfi.merge = func(dst, src pointer) {
// NOTE: toInt32Ptr is not defined (see pointer_reflect.go).
/*
sfpp := src.toInt32Ptr()
if *sfpp != nil {
dfpp := dst.toInt32Ptr()
if *dfpp == nil {
*dfpp = Int32(**sfpp)
} else {
**dfpp = **sfpp
}
}
*/
sfp := src.getInt32Ptr()
if sfp != nil {
dfp := dst.getInt32Ptr()
if dfp == nil {
dst.setInt32Ptr(*sfp)
} else {
*dfp = *sfp
}
}
}
default: // E.g., int32
mfi.merge = func(dst, src pointer) {
if v := *src.toInt32(); v != 0 {
*dst.toInt32() = v
}
}
}
case reflect.Int64:
switch {
case isSlice: // E.g., []int64
mfi.merge = func(dst, src pointer) {
sfsp := src.toInt64Slice()
if *sfsp != nil {
dfsp := dst.toInt64Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []int64{}
}
}
}
case isPointer: // E.g., *int64
mfi.merge = func(dst, src pointer) {
sfpp := src.toInt64Ptr()
if *sfpp != nil {
dfpp := dst.toInt64Ptr()
if *dfpp == nil {
*dfpp = Int64(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., int64
mfi.merge = func(dst, src pointer) {
if v := *src.toInt64(); v != 0 {
*dst.toInt64() = v
}
}
}
case reflect.Uint32:
switch {
case isSlice: // E.g., []uint32
mfi.merge = func(dst, src pointer) {
sfsp := src.toUint32Slice()
if *sfsp != nil {
dfsp := dst.toUint32Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []uint32{}
}
}
}
case isPointer: // E.g., *uint32
mfi.merge = func(dst, src pointer) {
sfpp := src.toUint32Ptr()
if *sfpp != nil {
dfpp := dst.toUint32Ptr()
if *dfpp == nil {
*dfpp = Uint32(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., uint32
mfi.merge = func(dst, src pointer) {
if v := *src.toUint32(); v != 0 {
*dst.toUint32() = v
}
}
}
case reflect.Uint64:
switch {
case isSlice: // E.g., []uint64
mfi.merge = func(dst, src pointer) {
sfsp := src.toUint64Slice()
if *sfsp != nil {
dfsp := dst.toUint64Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []uint64{}
}
}
}
case isPointer: // E.g., *uint64
mfi.merge = func(dst, src pointer) {
sfpp := src.toUint64Ptr()
if *sfpp != nil {
dfpp := dst.toUint64Ptr()
if *dfpp == nil {
*dfpp = Uint64(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., uint64
mfi.merge = func(dst, src pointer) {
if v := *src.toUint64(); v != 0 {
*dst.toUint64() = v
}
}
}
case reflect.Float32:
switch {
case isSlice: // E.g., []float32
mfi.merge = func(dst, src pointer) {
sfsp := src.toFloat32Slice()
if *sfsp != nil {
dfsp := dst.toFloat32Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []float32{}
}
}
}
case isPointer: // E.g., *float32
mfi.merge = func(dst, src pointer) {
sfpp := src.toFloat32Ptr()
if *sfpp != nil {
dfpp := dst.toFloat32Ptr()
if *dfpp == nil {
*dfpp = Float32(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., float32
mfi.merge = func(dst, src pointer) {
if v := *src.toFloat32(); v != 0 {
*dst.toFloat32() = v
}
}
}
case reflect.Float64:
switch {
case isSlice: // E.g., []float64
mfi.merge = func(dst, src pointer) {
sfsp := src.toFloat64Slice()
if *sfsp != nil {
dfsp := dst.toFloat64Slice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []float64{}
}
}
}
case isPointer: // E.g., *float64
mfi.merge = func(dst, src pointer) {
sfpp := src.toFloat64Ptr()
if *sfpp != nil {
dfpp := dst.toFloat64Ptr()
if *dfpp == nil {
*dfpp = Float64(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., float64
mfi.merge = func(dst, src pointer) {
if v := *src.toFloat64(); v != 0 {
*dst.toFloat64() = v
}
}
}
case reflect.Bool:
switch {
case isSlice: // E.g., []bool
mfi.merge = func(dst, src pointer) {
sfsp := src.toBoolSlice()
if *sfsp != nil {
dfsp := dst.toBoolSlice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []bool{}
}
}
}
case isPointer: // E.g., *bool
mfi.merge = func(dst, src pointer) {
sfpp := src.toBoolPtr()
if *sfpp != nil {
dfpp := dst.toBoolPtr()
if *dfpp == nil {
*dfpp = Bool(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., bool
mfi.merge = func(dst, src pointer) {
if v := *src.toBool(); v {
*dst.toBool() = v
}
}
}
case reflect.String:
switch {
case isSlice: // E.g., []string
mfi.merge = func(dst, src pointer) {
sfsp := src.toStringSlice()
if *sfsp != nil {
dfsp := dst.toStringSlice()
*dfsp = append(*dfsp, *sfsp...)
if *dfsp == nil {
*dfsp = []string{}
}
}
}
case isPointer: // E.g., *string
mfi.merge = func(dst, src pointer) {
sfpp := src.toStringPtr()
if *sfpp != nil {
dfpp := dst.toStringPtr()
if *dfpp == nil {
*dfpp = String(**sfpp)
} else {
**dfpp = **sfpp
}
}
}
default: // E.g., string
mfi.merge = func(dst, src pointer) {
if v := *src.toString(); v != "" {
*dst.toString() = v
}
}
}
case reflect.Slice:
isProto3 := props.Prop[i].proto3
switch {
case isPointer:
panic("bad pointer in byte slice case in " + tf.Name())
case tf.Elem().Kind() != reflect.Uint8:
panic("bad element kind in byte slice case in " + tf.Name())
case isSlice: // E.g., [][]byte
mfi.merge = func(dst, src pointer) {
sbsp := src.toBytesSlice()
if *sbsp != nil {
dbsp := dst.toBytesSlice()
for _, sb := range *sbsp {
if sb == nil {
*dbsp = append(*dbsp, nil)
} else {
*dbsp = append(*dbsp, append([]byte{}, sb...))
}
}
if *dbsp == nil {
*dbsp = [][]byte{}
}
}
}
default: // E.g., []byte
mfi.merge = func(dst, src pointer) {
sbp := src.toBytes()
if *sbp != nil {
dbp := dst.toBytes()
if !isProto3 || len(*sbp) > 0 {
*dbp = append([]byte{}, *sbp...)
}
}
}
}
case reflect.Struct:
switch {
case isSlice && !isPointer: // E.g. []pb.T
mergeInfo := getMergeInfo(tf)
zero := reflect.Zero(tf)
mfi.merge = func(dst, src pointer) {
// TODO: Make this faster?
dstsp := dst.asPointerTo(f.Type)
dsts := dstsp.Elem()
srcs := src.asPointerTo(f.Type).Elem()
for i := 0; i < srcs.Len(); i++ {
dsts = reflect.Append(dsts, zero)
srcElement := srcs.Index(i).Addr()
dstElement := dsts.Index(dsts.Len() - 1).Addr()
mergeInfo.merge(valToPointer(dstElement), valToPointer(srcElement))
}
if dsts.IsNil() {
dsts = reflect.MakeSlice(f.Type, 0, 0)
}
dstsp.Elem().Set(dsts)
}
case !isPointer:
mergeInfo := getMergeInfo(tf)
mfi.merge = func(dst, src pointer) {
mergeInfo.merge(dst, src)
}
case isSlice: // E.g., []*pb.T
mergeInfo := getMergeInfo(tf)
mfi.merge = func(dst, src pointer) {
sps := src.getPointerSlice()
if sps != nil {
dps := dst.getPointerSlice()
for _, sp := range sps {
var dp pointer
if !sp.isNil() {
dp = valToPointer(reflect.New(tf))
mergeInfo.merge(dp, sp)
}
dps = append(dps, dp)
}
if dps == nil {
dps = []pointer{}
}
dst.setPointerSlice(dps)
}
}
default: // E.g., *pb.T
mergeInfo := getMergeInfo(tf)
mfi.merge = func(dst, src pointer) {
sp := src.getPointer()
if !sp.isNil() {
dp := dst.getPointer()
if dp.isNil() {
dp = valToPointer(reflect.New(tf))
dst.setPointer(dp)
}
mergeInfo.merge(dp, sp)
}
}
}
case reflect.Map:
switch {
case isPointer || isSlice:
panic("bad pointer or slice in map case in " + tf.Name())
default: // E.g., map[K]V
mfi.merge = func(dst, src pointer) {
sm := src.asPointerTo(tf).Elem()
if sm.Len() == 0 {
return
}
dm := dst.asPointerTo(tf).Elem()
if dm.IsNil() {
dm.Set(reflect.MakeMap(tf))
}
switch tf.Elem().Kind() {
case reflect.Ptr: // Proto struct (e.g., *T)
for _, key := range sm.MapKeys() {
val := sm.MapIndex(key)
val = reflect.ValueOf(Clone(val.Interface().(Message)))
dm.SetMapIndex(key, val)
}
case reflect.Slice: // E.g. Bytes type (e.g., []byte)
for _, key := range sm.MapKeys() {
val := sm.MapIndex(key)
val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
dm.SetMapIndex(key, val)
}
default: // Basic type (e.g., string)
for _, key := range sm.MapKeys() {
val := sm.MapIndex(key)
dm.SetMapIndex(key, val)
}
}
}
}
case reflect.Interface:
// Must be oneof field.
switch {
case isPointer || isSlice:
panic("bad pointer or slice in interface case in " + tf.Name())
default: // E.g., interface{}
// TODO: Make this faster?
mfi.merge = func(dst, src pointer) {
su := src.asPointerTo(tf).Elem()
if !su.IsNil() {
du := dst.asPointerTo(tf).Elem()
typ := su.Elem().Type()
if du.IsNil() || du.Elem().Type() != typ {
du.Set(reflect.New(typ.Elem())) // Initialize interface if empty
}
sv := su.Elem().Elem().Field(0)
if sv.Kind() == reflect.Ptr && sv.IsNil() {
return
}
dv := du.Elem().Elem().Field(0)
if dv.Kind() == reflect.Ptr && dv.IsNil() {
dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty
}
switch sv.Type().Kind() {
case reflect.Ptr: // Proto struct (e.g., *T)
Merge(dv.Interface().(Message), sv.Interface().(Message))
case reflect.Slice: // E.g. Bytes type (e.g., []byte)
dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...)))
default: // Basic type (e.g., string)
dv.Set(sv)
}
}
}
}
default:
panic(fmt.Sprintf("merger not found for type:%s", tf))
}
mi.fields = append(mi.fields, mfi)
}
mi.unrecognized = invalidField
if f, ok := t.FieldByName("XXX_unrecognized"); ok {
if f.Type != reflect.TypeOf([]byte{}) {
panic("expected XXX_unrecognized to be of type []byte")
}
mi.unrecognized = toField(&f)
}
atomic.StoreInt32(&mi.initialized, 1)
}
| {
"pile_set_name": "Github"
} |
# Contribuir
**Sobre el desarrollo de este libro:**
Como regla general cualquier aportación de código/texto se realizará en la [rama "dev"](https://github.com/UlisesGascon/javascript-inspirate/tree/dev) ya sea por aporte directo o a través de [pull requests](https://github.com/UlisesGascon/javascript-inspirate/pulls).
Los capítulos del libro ([carpeta manuscript](https://github.com/UlisesGascon/javascript-inspirate/tree/master/manuscript)) no están escritos en Markdown.
Todo el libro esta escrito en [Markua](http://markua.com/) siguiendo las [recomendaciones de Leanpub](https://leanpub.com/help/manual). La renderización en formatos digitales (pdf, epub, etc..) se hace mediante una compilación en los servidores de Leanpub.
### Avisando de los errores
Solo necesitas [abrir un issue](https://github.com/UlisesGascon/javascript-inspirate/issues) con la [etiqueta Errores](https://github.com/UlisesGascon/javascript-inspirate/labels/Errores) para avisarnos.
Si además propones la solución al error... no dudes en hacer [referencia al issue](https://help.github.com/articles/closing-issues-via-commit-messages/) en tu pull request.
### Mejorando contenido
Solo necesitas [abrir un issue](https://github.com/UlisesGascon/javascript-inspirate/issues) con la [etiqueta Mejoras](https://github.com/UlisesGascon/javascript-inspirate/labels/Mejoras) para compartir tu idea.
### Traducciones
Por el momento el libro esta siendo traducido al inglés por [Roberto Moriyón](https://github.com/astur4) y [Nuria Sanz García](https://github.com/NuriaHill), para la coordinación estamos utilizando el [grupo de Slack](https://invitations-osweekends.herokuapp.com/) de [Open Source Weekends](http://osweekends.com/).
Si deseas empezar la traducción en otro idioma solo necesitas [abrir un issue](https://github.com/UlisesGascon/javascript-inspirate/issues) con la [etiqueta Traducción](https://github.com/UlisesGascon/javascript-inspirate/labels/Traducci%C3%B3n).
### Tu opinión es muy importante para mi
Puedes compartirme tu opinión de diversas formas:
- [Disqus (sobre el libro)](https://leanpub.com/javascript-inspirate/feedback).
- [Mensaje directo (email)](https://leanpub.com/javascript-inspirate/email_author/new).
- [Dejando tu testimonio en este issue](https://github.com/UlisesGascon/javascript-inspirate/issues/1).
- Compartiendo tus sensaciones en twitter con el hashtag [#JavascriptInspirate](https://twitter.com/search?f=tweets&q=%23javascriptInspirate).
### Otras formas de colaboración
Si crees que puedes colaborar de alguna forma que no esta en este documento...
**¡No lo dudes!** abre un [issue](https://github.com/UlisesGascon/javascript-inspirate/issues) con la [etiqueta opinión](https://github.com/UlisesGascon/javascript-inspirate/labels/Opini%C3%B3n), contacta conmigo por [Twitter](https://twitter.com/kom_256) o sencillamente [mándame un email](https://leanpub.com/javascript-inspirate/email_author/new).
| {
"pile_set_name": "Github"
} |
@model ScopeViewModel
<li class="list-group-item">
<label>
<input class="consent-scopecheck"
type="checkbox"
name="ScopesConsented"
id="[email protected]"
value="@Model.Name"
checked="@Model.Checked"
disabled="@Model.Required" />
@if (Model.Required)
{
<input type="hidden"
name="ScopesConsented"
value="@Model.Name" />
}
<strong>@Model.DisplayName</strong>
@if (Model.Emphasize)
{
<span class="glyphicon glyphicon-exclamation-sign"></span>
}
</label>
@if (Model.Required)
{
<span><em>(required)</em></span>
}
@if (Model.Description != null)
{
<div class="consent-description">
<label for="[email protected]">@Model.Description</label>
</div>
}
</li> | {
"pile_set_name": "Github"
} |
###########################################################
#
# py-selector
#
###########################################################
#
# PY-SELECTOR_VERSION, PY-SELECTOR_SITE and PY-SELECTOR_SOURCE define
# the upstream location of the source code for the package.
# PY-SELECTOR_DIR is the directory which is created when the source
# archive is unpacked.
# PY-SELECTOR_UNZIP is the command used to unzip the source.
# It is usually "zcat" (for .gz) or "bzcat" (for .bz2)
#
# You should change all these variables to suit your package.
# Please make sure that you add a description, and that you
# list all your packages' dependencies, seperated by commas.
#
# If you list yourself as MAINTAINER, please give a valid email
# address, and indicate your irc nick if it cannot be easily deduced
# from your name or email address. If you leave MAINTAINER set to
# "NSLU2 Linux" other developers will feel free to edit.
#
PY-SELECTOR_SITE=http://cheeseshop.python.org/packages/source/s/selector
PY-SELECTOR_VERSION=0.8.11
PY-SELECTOR_SOURCE=selector-$(PY-SELECTOR_VERSION).tar.gz
PY-SELECTOR_DIR=selector-$(PY-SELECTOR_VERSION)
PY-SELECTOR_UNZIP=zcat
PY-SELECTOR_MAINTAINER=NSLU2 Linux <[email protected]>
PY-SELECTOR_DESCRIPTION=WSGI delegation based on URL path and method.
PY-SELECTOR_SECTION=misc
PY-SELECTOR_PRIORITY=optional
PY24-SELECTOR_DEPENDS=python24
PY25-SELECTOR_DEPENDS=python25
PY-SELECTOR_CONFLICTS=
#
# PY-SELECTOR_IPK_VERSION should be incremented when the ipk changes.
#
PY-SELECTOR_IPK_VERSION=1
#
# PY-SELECTOR_CONFFILES should be a list of user-editable files
#PY-SELECTOR_CONFFILES=$(TARGET_PREFIX)/etc/py-selector.conf $(TARGET_PREFIX)/etc/init.d/SXXpy-selector
#
# PY-SELECTOR_PATCHES should list any patches, in the the order in
# which they should be applied to the source code.
#
#PY-SELECTOR_PATCHES=$(PY-SELECTOR_SOURCE_DIR)/configure.patch
#
# If the compilation of the package requires additional
# compilation or linking flags, then list them here.
#
PY-SELECTOR_CPPFLAGS=
PY-SELECTOR_LDFLAGS=
#
# PY-SELECTOR_BUILD_DIR is the directory in which the build is done.
# PY-SELECTOR_SOURCE_DIR is the directory which holds all the
# patches and ipkg control files.
# PY-SELECTOR_IPK_DIR is the directory in which the ipk is built.
# PY-SELECTOR_IPK is the name of the resulting ipk files.
#
# You should not change any of these variables.
#
PY-SELECTOR_BUILD_DIR=$(BUILD_DIR)/py-selector
PY-SELECTOR_SOURCE_DIR=$(SOURCE_DIR)/py-selector
PY24-SELECTOR_IPK_DIR=$(BUILD_DIR)/py-selector-$(PY-SELECTOR_VERSION)-ipk
PY24-SELECTOR_IPK=$(BUILD_DIR)/py-selector_$(PY-SELECTOR_VERSION)-$(PY-SELECTOR_IPK_VERSION)_$(TARGET_ARCH).ipk
PY25-SELECTOR_IPK_DIR=$(BUILD_DIR)/py25-selector-$(PY-SELECTOR_VERSION)-ipk
PY25-SELECTOR_IPK=$(BUILD_DIR)/py25-selector_$(PY-SELECTOR_VERSION)-$(PY-SELECTOR_IPK_VERSION)_$(TARGET_ARCH).ipk
.PHONY: py-selector-source py-selector-unpack py-selector py-selector-stage py-selector-ipk py-selector-clean py-selector-dirclean py-selector-check
#
# This is the dependency on the source code. If the source is missing,
# then it will be fetched from the site using wget.
#
$(DL_DIR)/$(PY-SELECTOR_SOURCE):
$(WGET) -P $(DL_DIR) $(PY-SELECTOR_SITE)/$(PY-SELECTOR_SOURCE)
#
# The source code depends on it existing within the download directory.
# This target will be called by the top level Makefile to download the
# source code's archive (.tar.gz, .bz2, etc.)
#
py-selector-source: $(DL_DIR)/$(PY-SELECTOR_SOURCE) $(PY-SELECTOR_PATCHES)
#
# This target unpacks the source code in the build directory.
# If the source archive is not .tar.gz or .tar.bz2, then you will need
# to change the commands here. Patches to the source code are also
# applied in this target as required.
#
# This target also configures the build within the build directory.
# Flags such as LDFLAGS and CPPFLAGS should be passed into configure
# and NOT $(MAKE) below. Passing it to configure causes configure to
# correctly BUILD the Makefile with the right paths, where passing it
# to Make causes it to override the default search paths of the compiler.
#
# If the compilation of the package requires other packages to be staged
# first, then do that first (e.g. "$(MAKE) <bar>-stage <baz>-stage").
#
$(PY-SELECTOR_BUILD_DIR)/.configured: $(DL_DIR)/$(PY-SELECTOR_SOURCE) $(PY-SELECTOR_PATCHES)
$(MAKE) py-setuptools-stage
rm -rf $(PY-SELECTOR_BUILD_DIR)
mkdir -p $(PY-SELECTOR_BUILD_DIR)
# 2.4
rm -rf $(BUILD_DIR)/$(PY-SELECTOR_DIR)
$(PY-SELECTOR_UNZIP) $(DL_DIR)/$(PY-SELECTOR_SOURCE) | tar -C $(BUILD_DIR) -xvf -
# cat $(PY-SELECTOR_PATCHES) | $(PATCH) -d $(BUILD_DIR)/$(PY-SELECTOR_DIR) -p1
mv $(BUILD_DIR)/$(PY-SELECTOR_DIR) $(PY-SELECTOR_BUILD_DIR)/2.4
(cd $(PY-SELECTOR_BUILD_DIR)/2.4; \
sed -i -e '/use_setuptools/d' setup.py; \
(echo "[build_scripts]"; \
echo "executable=$(TARGET_PREFIX)/bin/python2.4") >> setup.cfg \
)
# 2.5
rm -rf $(BUILD_DIR)/$(PY-SELECTOR_DIR)
$(PY-SELECTOR_UNZIP) $(DL_DIR)/$(PY-SELECTOR_SOURCE) | tar -C $(BUILD_DIR) -xvf -
# cat $(PY-SELECTOR_PATCHES) | $(PATCH) -d $(BUILD_DIR)/$(PY-SELECTOR_DIR) -p1
mv $(BUILD_DIR)/$(PY-SELECTOR_DIR) $(PY-SELECTOR_BUILD_DIR)/2.5
(cd $(PY-SELECTOR_BUILD_DIR)/2.5; \
sed -i -e '/use_setuptools/d' setup.py; \
(echo "[build_scripts]"; \
echo "executable=$(TARGET_PREFIX)/bin/python2.5") >> setup.cfg \
)
touch $@
py-selector-unpack: $(PY-SELECTOR_BUILD_DIR)/.configured
#
# This builds the actual binary.
#
$(PY-SELECTOR_BUILD_DIR)/.built: $(PY-SELECTOR_BUILD_DIR)/.configured
rm -f $@
cd $(PY-SELECTOR_BUILD_DIR)/2.4; \
PYTHONPATH=$(STAGING_LIB_DIR)/python2.4/site-packages \
$(HOST_STAGING_PREFIX)/bin/python2.4 setup.py build
cd $(PY-SELECTOR_BUILD_DIR)/2.5; \
PYTHONPATH=$(STAGING_LIB_DIR)/python2.5/site-packages \
$(HOST_STAGING_PREFIX)/bin/python2.5 setup.py build
touch $@
#
# This is the build convenience target.
#
py-selector: $(PY-SELECTOR_BUILD_DIR)/.built
#
# If you are building a library, then you need to stage it too.
#
$(PY-SELECTOR_BUILD_DIR)/.staged: $(PY-SELECTOR_BUILD_DIR)/.built
rm -f $@
# $(MAKE) -C $(PY-SELECTOR_BUILD_DIR) DESTDIR=$(STAGING_DIR) install
touch $@
py-selector-stage: $(PY-SELECTOR_BUILD_DIR)/.staged
#
# This rule creates a control file for ipkg. It is no longer
# necessary to create a seperate control file under sources/py-selector
#
$(PY24-SELECTOR_IPK_DIR)/CONTROL/control:
@$(INSTALL) -d $(@D)
@rm -f $@
@echo "Package: py-selector" >>$@
@echo "Architecture: $(TARGET_ARCH)" >>$@
@echo "Priority: $(PY-SELECTOR_PRIORITY)" >>$@
@echo "Section: $(PY-SELECTOR_SECTION)" >>$@
@echo "Version: $(PY-SELECTOR_VERSION)-$(PY-SELECTOR_IPK_VERSION)" >>$@
@echo "Maintainer: $(PY-SELECTOR_MAINTAINER)" >>$@
@echo "Source: $(PY-SELECTOR_SITE)/$(PY-SELECTOR_SOURCE)" >>$@
@echo "Description: $(PY-SELECTOR_DESCRIPTION)" >>$@
@echo "Depends: $(PY24-SELECTOR_DEPENDS)" >>$@
@echo "Conflicts: $(PY-SELECTOR_CONFLICTS)" >>$@
$(PY25-SELECTOR_IPK_DIR)/CONTROL/control:
@$(INSTALL) -d $(@D)
@rm -f $@
@echo "Package: py25-selector" >>$@
@echo "Architecture: $(TARGET_ARCH)" >>$@
@echo "Priority: $(PY-SELECTOR_PRIORITY)" >>$@
@echo "Section: $(PY-SELECTOR_SECTION)" >>$@
@echo "Version: $(PY-SELECTOR_VERSION)-$(PY-SELECTOR_IPK_VERSION)" >>$@
@echo "Maintainer: $(PY-SELECTOR_MAINTAINER)" >>$@
@echo "Source: $(PY-SELECTOR_SITE)/$(PY-SELECTOR_SOURCE)" >>$@
@echo "Description: $(PY-SELECTOR_DESCRIPTION)" >>$@
@echo "Depends: $(PY25-SELECTOR_DEPENDS)" >>$@
@echo "Conflicts: $(PY-SELECTOR_CONFLICTS)" >>$@
#
# This builds the IPK file.
#
# Binaries should be installed into $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/sbin or $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/bin
# (use the location in a well-known Linux distro as a guide for choosing sbin or bin).
# Libraries and include files should be installed into $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/{lib,include}
# Configuration files should be installed in $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/etc/py-selector/...
# Documentation files should be installed in $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/doc/py-selector/...
# Daemon startup scripts should be installed in $(PY-SELECTOR_IPK_DIR)$(TARGET_PREFIX)/etc/init.d/S??py-selector
#
# You may need to patch your application to make it use these locations.
#
$(PY24-SELECTOR_IPK): $(PY-SELECTOR_BUILD_DIR)/.built
rm -rf $(PY24-SELECTOR_IPK_DIR) $(BUILD_DIR)/py-selector_*_$(TARGET_ARCH).ipk
(cd $(PY-SELECTOR_BUILD_DIR)/2.4; \
PYTHONPATH=$(STAGING_LIB_DIR)/python2.4/site-packages \
$(HOST_STAGING_PREFIX)/bin/python2.4 setup.py install \
--root=$(PY24-SELECTOR_IPK_DIR) --prefix=$(TARGET_PREFIX))
$(MAKE) $(PY24-SELECTOR_IPK_DIR)/CONTROL/control
# echo $(PY-SELECTOR_CONFFILES) | sed -e 's/ /\n/g' > $(PY24-SELECTOR_IPK_DIR)/CONTROL/conffiles
cd $(BUILD_DIR); $(IPKG_BUILD) $(PY24-SELECTOR_IPK_DIR)
$(PY25-SELECTOR_IPK): $(PY-SELECTOR_BUILD_DIR)/.built
rm -rf $(PY25-SELECTOR_IPK_DIR) $(BUILD_DIR)/py25-selector_*_$(TARGET_ARCH).ipk
(cd $(PY-SELECTOR_BUILD_DIR)/2.5; \
PYTHONPATH=$(STAGING_LIB_DIR)/python2.5/site-packages \
$(HOST_STAGING_PREFIX)/bin/python2.5 setup.py install \
--root=$(PY25-SELECTOR_IPK_DIR) --prefix=$(TARGET_PREFIX))
$(MAKE) $(PY25-SELECTOR_IPK_DIR)/CONTROL/control
# echo $(PY-SELECTOR_CONFFILES) | sed -e 's/ /\n/g' > $(PY25-SELECTOR_IPK_DIR)/CONTROL/conffiles
cd $(BUILD_DIR); $(IPKG_BUILD) $(PY25-SELECTOR_IPK_DIR)
#
# This is called from the top level makefile to create the IPK file.
#
py-selector-ipk: $(PY24-SELECTOR_IPK) $(PY25-SELECTOR_IPK)
#
# This is called from the top level makefile to clean all of the built files.
#
py-selector-clean:
-$(MAKE) -C $(PY-SELECTOR_BUILD_DIR) clean
#
# This is called from the top level makefile to clean all dynamically created
# directories.
#
py-selector-dirclean:
rm -rf $(BUILD_DIR)/$(PY-SELECTOR_DIR) $(PY-SELECTOR_BUILD_DIR)
rm -rf $(PY24-SELECTOR_IPK_DIR) $(PY24-SELECTOR_IPK)
rm -rf $(PY25-SELECTOR_IPK_DIR) $(PY25-SELECTOR_IPK)
#
# Some sanity check for the package.
#
py-selector-check: $(PY24-SELECTOR_IPK) $(PY25-SELECTOR_IPK)
perl scripts/optware-check-package.pl --target=$(OPTWARE_TARGET) $(PY24-SELECTOR_IPK) $(PY25-SELECTOR_IPK)
| {
"pile_set_name": "Github"
} |
5.9587 3.7957
-19.195 -18.324
25.287 -21.803
-36.836 -0.46006
-2.4357 -39.008
4.3173 -40.151
40.999 0.15948
-30.435 -38.582
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="UTF-8"?>
<node>
<version>6</version>
<dict>
<key>title</key><string>New Page</string>
<key>expanded</key><false/>
<key>nodeid</key><string>87f7c354-eb3a-4a50-b973-4d848ef996a4</string>
<key>modified_time</key><integer>1207979466</integer>
<key>expanded2</key><false/>
<key>version</key><integer>6</integer>
<key>content_type</key><string>text/xhtml+xml</string>
<key>created_time</key><integer>1207979466</integer>
<key>info_sort_dir</key><integer>1</integer>
<key>order</key><integer>576</integer>
<key>info_sort</key><string>0</string>
</dict>
</node>
| {
"pile_set_name": "Github"
} |
JASC-PAL
0100
16
213 213 189
0 255 255
0 255 255
0 255 255
0 255 255
139 230 255
106 205 246
74 164 230
32 123 197
24 74 139
0 255 255
0 255 255
0 255 255
0 255 255
49 49 49
255 255 255
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gitonway.lee.niftynotification" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
| {
"pile_set_name": "Github"
} |
#
# Makefile for the kernfs pseudo filesystem
#
obj-y := mount.o inode.o dir.o file.o symlink.o
| {
"pile_set_name": "Github"
} |
<!DOCTYPE html>
<html class="minimal">
<title>Canvas test: 2d.path.arc.angle.5</title>
<script src="../tests.js"></script>
<link rel="stylesheet" href="../tests.css">
<link rel="prev" href="minimal.2d.path.arc.angle.4.html" title="2d.path.arc.angle.4">
<link rel="next" href="minimal.2d.path.arc.angle.6.html" title="2d.path.arc.angle.6">
<body>
<p id="passtext">Pass</p>
<p id="failtext">Fail</p>
<!-- TODO: handle "script did not run" case -->
<p class="output">These images should be identical:</p>
<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
<ul id="d"></ul>
<script>
_addTest(function(canvas, ctx) {
ctx.fillStyle = '#0f0';
ctx.fillRect(0, 0, 100, 50);
ctx.fillStyle = '#f00';
ctx.beginPath();
ctx.moveTo(100, 0);
ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false);
ctx.fill();
_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
});
</script>
| {
"pile_set_name": "Github"
} |
// Copyright 2019 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build purego appengine
package impl
import (
"reflect"
"google.golang.org/protobuf/encoding/protowire"
)
func sizeEnum(p pointer, f *coderFieldInfo, _ marshalOptions) (size int) {
v := p.v.Elem().Int()
return f.tagsize + protowire.SizeVarint(uint64(v))
}
func appendEnum(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
v := p.v.Elem().Int()
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(v))
return b, nil
}
func consumeEnum(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, _ unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
v, n := protowire.ConsumeVarint(b)
if n < 0 {
return out, protowire.ParseError(n)
}
p.v.Elem().SetInt(int64(v))
out.n = n
return out, nil
}
func mergeEnum(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
dst.v.Elem().Set(src.v.Elem())
}
var coderEnum = pointerCoderFuncs{
size: sizeEnum,
marshal: appendEnum,
unmarshal: consumeEnum,
merge: mergeEnum,
}
func sizeEnumNoZero(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
if p.v.Elem().Int() == 0 {
return 0
}
return sizeEnum(p, f, opts)
}
func appendEnumNoZero(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
if p.v.Elem().Int() == 0 {
return b, nil
}
return appendEnum(b, p, f, opts)
}
func mergeEnumNoZero(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
if src.v.Elem().Int() != 0 {
dst.v.Elem().Set(src.v.Elem())
}
}
var coderEnumNoZero = pointerCoderFuncs{
size: sizeEnumNoZero,
marshal: appendEnumNoZero,
unmarshal: consumeEnum,
merge: mergeEnumNoZero,
}
func sizeEnumPtr(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
return sizeEnum(pointer{p.v.Elem()}, f, opts)
}
func appendEnumPtr(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
return appendEnum(b, pointer{p.v.Elem()}, f, opts)
}
func consumeEnumPtr(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
if wtyp != protowire.VarintType {
return out, errUnknown
}
if p.v.Elem().IsNil() {
p.v.Elem().Set(reflect.New(p.v.Elem().Type().Elem()))
}
return consumeEnum(b, pointer{p.v.Elem()}, wtyp, f, opts)
}
func mergeEnumPtr(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
if !src.v.Elem().IsNil() {
v := reflect.New(dst.v.Type().Elem().Elem())
v.Elem().Set(src.v.Elem().Elem())
dst.v.Elem().Set(v)
}
}
var coderEnumPtr = pointerCoderFuncs{
size: sizeEnumPtr,
marshal: appendEnumPtr,
unmarshal: consumeEnumPtr,
merge: mergeEnumPtr,
}
func sizeEnumSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := p.v.Elem()
for i, llen := 0, s.Len(); i < llen; i++ {
size += protowire.SizeVarint(uint64(s.Index(i).Int())) + f.tagsize
}
return size
}
func appendEnumSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := p.v.Elem()
for i, llen := 0, s.Len(); i < llen; i++ {
b = protowire.AppendVarint(b, f.wiretag)
b = protowire.AppendVarint(b, uint64(s.Index(i).Int()))
}
return b, nil
}
func consumeEnumSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) {
s := p.v.Elem()
if wtyp == protowire.BytesType {
b, n := protowire.ConsumeBytes(b)
if n < 0 {
return out, protowire.ParseError(n)
}
for len(b) > 0 {
v, n := protowire.ConsumeVarint(b)
if n < 0 {
return out, protowire.ParseError(n)
}
rv := reflect.New(s.Type().Elem()).Elem()
rv.SetInt(int64(v))
s.Set(reflect.Append(s, rv))
b = b[n:]
}
out.n = n
return out, nil
}
if wtyp != protowire.VarintType {
return out, errUnknown
}
v, n := protowire.ConsumeVarint(b)
if n < 0 {
return out, protowire.ParseError(n)
}
rv := reflect.New(s.Type().Elem()).Elem()
rv.SetInt(int64(v))
s.Set(reflect.Append(s, rv))
out.n = n
return out, nil
}
func mergeEnumSlice(dst, src pointer, _ *coderFieldInfo, _ mergeOptions) {
dst.v.Elem().Set(reflect.AppendSlice(dst.v.Elem(), src.v.Elem()))
}
var coderEnumSlice = pointerCoderFuncs{
size: sizeEnumSlice,
marshal: appendEnumSlice,
unmarshal: consumeEnumSlice,
merge: mergeEnumSlice,
}
func sizeEnumPackedSlice(p pointer, f *coderFieldInfo, opts marshalOptions) (size int) {
s := p.v.Elem()
llen := s.Len()
if llen == 0 {
return 0
}
n := 0
for i := 0; i < llen; i++ {
n += protowire.SizeVarint(uint64(s.Index(i).Int()))
}
return f.tagsize + protowire.SizeBytes(n)
}
func appendEnumPackedSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions) ([]byte, error) {
s := p.v.Elem()
llen := s.Len()
if llen == 0 {
return b, nil
}
b = protowire.AppendVarint(b, f.wiretag)
n := 0
for i := 0; i < llen; i++ {
n += protowire.SizeVarint(uint64(s.Index(i).Int()))
}
b = protowire.AppendVarint(b, uint64(n))
for i := 0; i < llen; i++ {
b = protowire.AppendVarint(b, uint64(s.Index(i).Int()))
}
return b, nil
}
var coderEnumPackedSlice = pointerCoderFuncs{
size: sizeEnumPackedSlice,
marshal: appendEnumPackedSlice,
unmarshal: consumeEnumSlice,
merge: mergeEnumSlice,
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources></resources>
| {
"pile_set_name": "Github"
} |
require_relative '../../spec_helper'
require_relative '../fixtures/classes'
describe "Regexps with modifiers" do
it "supports /i (case-insensitive)" do
/foo/i.match("FOO").to_a.should == ["FOO"]
end
it "supports /m (multiline)" do
/foo.bar/m.match("foo\nbar").to_a.should == ["foo\nbar"]
/foo.bar/.match("foo\nbar").should be_nil
end
it "supports /x (extended syntax)" do
/\d +/x.match("abc123").to_a.should == ["123"] # Quantifiers can be separated from the expression they apply to
end
it "supports /o (once)" do
2.times do |i|
/#{i}/o.should == /0/
end
end
it "invokes substitutions for /o only once" do
ScratchPad.record []
o = Object.new
def o.to_s
ScratchPad << :to_s
"class_with_to_s"
end
eval "2.times { /#{o}/o }"
ScratchPad.recorded.should == [:to_s]
end
it "supports modifier combinations" do
/foo/imox.match("foo").to_a.should == ["foo"]
/foo/imoximox.match("foo").to_a.should == ["foo"]
-> { eval('/foo/a') }.should raise_error(SyntaxError)
end
it "supports (?~) (absent operator)" do
Regexp.new("(?~foo)").match("hello").to_a.should == ["hello"]
"foo".scan(Regexp.new("(?~foo)")).should == ["fo","o",""]
end
it "supports (?imx-imx) (inline modifiers)" do
/(?i)foo/.match("FOO").to_a.should == ["FOO"]
/foo(?i)/.match("FOO").should be_nil
# Interaction with /i
/(?-i)foo/i.match("FOO").should be_nil
/foo(?-i)/i.match("FOO").to_a.should == ["FOO"]
# Multiple uses
/foo (?i)bar (?-i)baz/.match("foo BAR baz").to_a.should == ["foo BAR baz"]
/foo (?i)bar (?-i)baz/.match("foo BAR BAZ").should be_nil
/(?m)./.match("\n").to_a.should == ["\n"]
/.(?m)/.match("\n").should be_nil
# Interaction with /m
/(?-m)./m.match("\n").should be_nil
/.(?-m)/m.match("\n").to_a.should == ["\n"]
# Multiple uses
/. (?m). (?-m)./.match(". \n .").to_a.should == [". \n ."]
/. (?m). (?-m)./.match(". \n \n").should be_nil
/(?x) foo /.match("foo").to_a.should == ["foo"]
/ foo (?x)/.match("foo").should be_nil
# Interaction with /x
/(?-x) foo /x.match("foo").should be_nil
/ foo (?-x)/x.match("foo").to_a.should == ["foo"]
# Multiple uses
/( foo )(?x)( bar )(?-x)( baz )/.match(" foo bar baz ").to_a.should == [" foo bar baz ", " foo ", "bar", " baz "]
/( foo )(?x)( bar )(?-x)( baz )/.match(" foo barbaz").should be_nil
# Parsing
/(?i-i)foo/.match("FOO").should be_nil
/(?ii)foo/.match("FOO").to_a.should == ["FOO"]
/(?-)foo/.match("foo").to_a.should == ["foo"]
-> { eval('/(?o)/') }.should raise_error(SyntaxError)
end
it "supports (?imx-imx:expr) (scoped inline modifiers)" do
/foo (?i:bar) baz/.match("foo BAR baz").to_a.should == ["foo BAR baz"]
/foo (?i:bar) baz/.match("foo BAR BAZ").should be_nil
/foo (?-i:bar) baz/i.match("foo BAR BAZ").should be_nil
/. (?m:.) ./.match(". \n .").to_a.should == [". \n ."]
/. (?m:.) ./.match(". \n \n").should be_nil
/. (?-m:.) ./m.match("\n \n \n").should be_nil
/( foo )(?x: bar )( baz )/.match(" foo bar baz ").to_a.should == [" foo bar baz ", " foo ", " baz "]
/( foo )(?x: bar )( baz )/.match(" foo barbaz").should be_nil
/( foo )(?-x: bar )( baz )/x.match("foo bar baz").to_a.should == ["foo bar baz", "foo", "baz"]
# Parsing
/(?i-i:foo)/.match("FOO").should be_nil
/(?ii:foo)/.match("FOO").to_a.should == ["FOO"]
/(?-:)foo/.match("foo").to_a.should == ["foo"]
-> { eval('/(?o:)/') }.should raise_error(SyntaxError)
end
it "supports . with /m" do
# Basic matching
/./m.match("\n").to_a.should == ["\n"]
end
it "supports ASCII/Unicode modifiers" do
eval('/(?a)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a"]
eval('/(?d)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a\u3042"]
eval('/(?u)[[:alpha:]]+/').match("a\u3042").to_a.should == ["a\u3042"]
eval('/(?a)\w+/').match("a\u3042").to_a.should == ["a"]
eval('/(?d)\w+/').match("a\u3042").to_a.should == ["a"]
eval('/(?u)\w+/').match("a\u3042").to_a.should == ["a\u3042"]
end
end
| {
"pile_set_name": "Github"
} |
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2020 Nextcloud GmbH
# This file is distributed under the same license as the Nextcloud latest User Manual package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Kervoas-Le Nabat Ewen <[email protected]>, 2020
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Nextcloud latest User Manual latest\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-09-14 14:29+0000\n"
"PO-Revision-Date: 2019-11-07 20:28+0000\n"
"Last-Translator: Kervoas-Le Nabat Ewen <[email protected]>, 2020\n"
"Language-Team: Breton (https://www.transifex.com/nextcloud/teams/64236/br/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: br\n"
"Plural-Forms: nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);\n"
#: ../../pim/sync_kde.rst:3
msgid "Synchronizing with KDE Kontact"
msgstr "Kemprennet gant KDE Kontact"
#: ../../pim/sync_kde.rst:5
msgid ""
"KOrganizer and KAddressBook can synchronize your calendar, contacts and "
"tasks with a Nextcloud server."
msgstr ""
"KOrganizer ha KAddressBook a c'hell kempredañ ho deizataer, darempredoù ha "
"oberennoù gant ar servijour Nextcloud."
#: ../../pim/sync_kde.rst:7
msgid "This can be done by following these steps:"
msgstr "Posuple eo ober ze en ur heuliañ ar pazennoù-mañ :"
#: ../../pim/sync_kde.rst:9
msgid ""
"Open KOrganizer and in the calendar list (bottom left) right-click and "
"choose ``Add Calendar``."
msgstr ""
"Digorit KOrganizer hag er roll deizataer (boutñs a gleiz) grit ur klik dehou"
" ha choazit \"Ouzhpennañ un deizataer\"."
#: ../../pim/sync_kde.rst:13
msgid "In the resulting list of resources, pick ``DAV groupware resource``."
msgstr "E-barz ar roll disoc'hoù traoù, choazit ``DAV groupware resource``."
#: ../../pim/sync_kde.rst:17
msgid ""
"Enter your username. As password, you need to generate an app-password/token"
" (`Learn more "
"<https://docs.nextcloud.com/server/stable/user_manual/session_management.html"
"#managing-devices>`_)."
msgstr ""
"Lakait ho anv implijer. Evel ger-tremenn, ret eo deoc'h krouiñ ur ger-tremen"
" meziant/jedouer ('Deskit muioc'h war "
"<https://docs.nextcloud.com/server/stable/user_manual/session_management.html"
"#managing-devices>`_)."
#: ../../pim/sync_kde.rst:21
msgid "Choose ``ownCloud`` or ``Nextcloud`` as Groupware server option."
msgstr "Choazit \"ownCloud\" pe \"Nextcloud\" evel dibab Groupware servijour."
#: ../../pim/sync_kde.rst:25
msgid ""
"Enter your Nextcloud server URL and, if needed, installation path (anything "
"that comes after the first /, for example ``mynextcloud`` in "
"``https://exampe.com/mynextcloud``). Then click next."
msgstr ""
"Lakait URL ar servijour Nextcloud ha, m'a o peus ezhomm, staliit an hent (ar"
" pezh a zeu war lec'h ar / kentañ, da skouer \"mynextcloud\" e "
"``https://exampe.com/mynextcloud``). Klikit war goude goude-se."
#: ../../pim/sync_kde.rst:29
msgid ""
"You can now test the connection, which can take some time for the initial "
"connection. If it does not work, you can go back and try to fix it with "
"other settings."
msgstr ""
"Posupl eo deoc'h amprouiñ ho kenstagadenn, pezh a c'hell kemer amzer evit ar"
" c'hempreadenn gentañ. M'a ne dro ket, posupl eo deoc'h klask en dro gant "
"arvertennoù all."
#: ../../pim/sync_kde.rst:35
msgid ""
"Pick a name for this resource, for example ``Work`` or ``Home``. By default,"
" both CalDAV (Calendar) and CardDAV (Contacts) are synced."
msgstr ""
"Choazit un anv evit an dra, fa skouer \"labour\" pe \"Ti\". Dre ziouer, "
"CalDav (Deizataer) ha CardDav (Darempredoù) a zo kemprennet."
#: ../../pim/sync_kde.rst:37
msgid ""
"You can set a manual refresh rate for your calendar and contacts resources. "
"By default this setting is set to 5 minutes and should be fine for the most "
"use cases. You may want to change this for saving your power or cellular "
"data plan, that you can update with a right-click on the item in the "
"calendar list and when you create a new appointment it is synced to "
"Nextcloud right away."
msgstr ""
"Galout a rit lakaat ur freskadenn otomatek evit ho deizataer ha darempredoù."
" Dre ziouer eo lakaet an arventenn-mañ da bep 5 munutenn ha mat eo evit "
"peurvuiañ an implijoù. Marteze ho peus c'hont cheñch-ze evit gwarn energiez "
"pe roadennoù, a vo posupl deoc'h adnevesaat en ur ober ur c'hlik dehoù war "
"an dra e roll an deizataer ha pa krouer un darvoud nevez e vez kempredet da "
"Nextcloud."
#: ../../pim/sync_kde.rst:41
msgid ""
"After a few seconds to minutes depending on your internet connection, you "
"will finde your calendars and contacts inside the KDE Kontact applications "
"KOrganizer and KAddressBook!"
msgstr ""
"Goude un neubeut eilennoù betek minutennoù hervez ho kenstagadur Internt, "
"kavet a vo ganeoc'h ho deizataer hag ho darempredoù e barzh ar meziant KDE "
"Kontact, Korganizer ha KAddressBook !"
| {
"pile_set_name": "Github"
} |
package android.support.v4.util;
public final class CircularArray<E> {
private int mCapacityBitmask;
private E[] mElements;
private int mHead;
private int mTail;
private void doubleCapacity() {
int n = this.mElements.length;
int r = n - this.mHead;
int newCapacity = n << 1;
if (newCapacity < 0) {
throw new RuntimeException("Max array capacity exceeded");
}
Object[] a = new Object[newCapacity];
System.arraycopy(this.mElements, this.mHead, a, 0, r);
System.arraycopy(this.mElements, 0, a, r, this.mHead);
this.mElements = a;
this.mHead = 0;
this.mTail = n;
this.mCapacityBitmask = newCapacity - 1;
}
public CircularArray() {
this(8);
}
public CircularArray(int minCapacity) {
if (minCapacity < 1) {
throw new IllegalArgumentException("capacity must be >= 1");
} else if (minCapacity > 1073741824) {
throw new IllegalArgumentException("capacity must be <= 2^30");
} else {
int arrayCapacity;
if (Integer.bitCount(minCapacity) != 1) {
arrayCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
} else {
arrayCapacity = minCapacity;
}
this.mCapacityBitmask = arrayCapacity - 1;
this.mElements = new Object[arrayCapacity];
}
}
public void addFirst(E e) {
this.mHead = (this.mHead - 1) & this.mCapacityBitmask;
this.mElements[this.mHead] = e;
if (this.mHead == this.mTail) {
doubleCapacity();
}
}
public void addLast(E e) {
this.mElements[this.mTail] = e;
this.mTail = (this.mTail + 1) & this.mCapacityBitmask;
if (this.mTail == this.mHead) {
doubleCapacity();
}
}
public E popFirst() {
if (this.mHead == this.mTail) {
throw new ArrayIndexOutOfBoundsException();
}
E result = this.mElements[this.mHead];
this.mElements[this.mHead] = null;
this.mHead = (this.mHead + 1) & this.mCapacityBitmask;
return result;
}
public E popLast() {
if (this.mHead == this.mTail) {
throw new ArrayIndexOutOfBoundsException();
}
int t = (this.mTail - 1) & this.mCapacityBitmask;
E result = this.mElements[t];
this.mElements[t] = null;
this.mTail = t;
return result;
}
public void clear() {
removeFromStart(size());
}
public void removeFromStart(int numOfElements) {
if (numOfElements > 0) {
if (numOfElements > size()) {
throw new ArrayIndexOutOfBoundsException();
}
int i;
int end = this.mElements.length;
if (numOfElements < end - this.mHead) {
end = this.mHead + numOfElements;
}
for (i = this.mHead; i < end; i++) {
this.mElements[i] = null;
}
int removed = end - this.mHead;
numOfElements -= removed;
this.mHead = (this.mHead + removed) & this.mCapacityBitmask;
if (numOfElements > 0) {
for (i = 0; i < numOfElements; i++) {
this.mElements[i] = null;
}
this.mHead = numOfElements;
}
}
}
public void removeFromEnd(int numOfElements) {
if (numOfElements > 0) {
if (numOfElements > size()) {
throw new ArrayIndexOutOfBoundsException();
}
int i;
int start = 0;
if (numOfElements < this.mTail) {
start = this.mTail - numOfElements;
}
for (i = start; i < this.mTail; i++) {
this.mElements[i] = null;
}
int removed = this.mTail - start;
numOfElements -= removed;
this.mTail -= removed;
if (numOfElements > 0) {
this.mTail = this.mElements.length;
int newTail = this.mTail - numOfElements;
for (i = newTail; i < this.mTail; i++) {
this.mElements[i] = null;
}
this.mTail = newTail;
}
}
}
public E getFirst() {
if (this.mHead != this.mTail) {
return this.mElements[this.mHead];
}
throw new ArrayIndexOutOfBoundsException();
}
public E getLast() {
if (this.mHead != this.mTail) {
return this.mElements[(this.mTail - 1) & this.mCapacityBitmask];
}
throw new ArrayIndexOutOfBoundsException();
}
public E get(int n) {
if (n >= 0 && n < size()) {
return this.mElements[(this.mHead + n) & this.mCapacityBitmask];
}
throw new ArrayIndexOutOfBoundsException();
}
public int size() {
return (this.mTail - this.mHead) & this.mCapacityBitmask;
}
public boolean isEmpty() {
return this.mHead == this.mTail;
}
}
| {
"pile_set_name": "Github"
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#FAFAFA</color>
<color name="colorPrimaryDark">#C2C2C2</color>
<color name="colorAccent">#009688</color>
<color name="black">#333333</color>
<color name="grey">#999999</color>
<color name="disabledAppBackground">#E0F2F1</color>
<color name="selectedAppBackground">#EEEEEE</color>
<color name="selectedAndDisabledAppBackground">#CEE1E0</color>
</resources>
| {
"pile_set_name": "Github"
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
//
// IntersectQueryOperator.cs
//
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
namespace System.Linq.Parallel
{
/// <summary>
/// Operator that yields the intersection of two data sources.
/// </summary>
/// <typeparam name="TInputOutput"></typeparam>
internal sealed class IntersectQueryOperator<TInputOutput> :
BinaryQueryOperator<TInputOutput, TInputOutput, TInputOutput>
{
private readonly IEqualityComparer<TInputOutput>? _comparer; // An equality comparer.
//---------------------------------------------------------------------------------------
// Constructs a new intersection operator.
//
internal IntersectQueryOperator(ParallelQuery<TInputOutput> left, ParallelQuery<TInputOutput> right, IEqualityComparer<TInputOutput>? comparer)
: base(left, right)
{
Debug.Assert(left != null && right != null, "child data sources cannot be null");
_comparer = comparer;
_outputOrdered = LeftChild.OutputOrdered;
SetOrdinalIndex(OrdinalIndexState.Shuffled);
}
internal override QueryResults<TInputOutput> Open(
QuerySettings settings, bool preferStriping)
{
// We just open our child operators, left and then right. Do not propagate the preferStriping value, but
// instead explicitly set it to false. Regardless of whether the parent prefers striping or range
// partitioning, the output will be hash-partitioned.
QueryResults<TInputOutput> leftChildResults = LeftChild.Open(settings, false);
QueryResults<TInputOutput> rightChildResults = RightChild.Open(settings, false);
return new BinaryQueryOperatorResults(leftChildResults, rightChildResults, this, settings, false);
}
public override void WrapPartitionedStream<TLeftKey, TRightKey>(
PartitionedStream<TInputOutput, TLeftKey> leftPartitionedStream, PartitionedStream<TInputOutput, TRightKey> rightPartitionedStream,
IPartitionedStreamRecipient<TInputOutput> outputRecipient, bool preferStriping, QuerySettings settings)
{
Debug.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount);
if (OutputOrdered)
{
WrapPartitionedStreamHelper<TLeftKey, TRightKey>(
ExchangeUtilities.HashRepartitionOrdered<TInputOutput, NoKeyMemoizationRequired, TLeftKey>(
leftPartitionedStream, null, null, _comparer, settings.CancellationState.MergedCancellationToken),
rightPartitionedStream, outputRecipient, settings.CancellationState.MergedCancellationToken);
}
else
{
WrapPartitionedStreamHelper<int, TRightKey>(
ExchangeUtilities.HashRepartition<TInputOutput, NoKeyMemoizationRequired, TLeftKey>(
leftPartitionedStream, null, null, _comparer, settings.CancellationState.MergedCancellationToken),
rightPartitionedStream, outputRecipient, settings.CancellationState.MergedCancellationToken);
}
}
//---------------------------------------------------------------------------------------
// This is a helper method. WrapPartitionedStream decides what type TLeftKey is going
// to be, and then call this method with that key as a generic parameter.
//
private void WrapPartitionedStreamHelper<TLeftKey, TRightKey>(
PartitionedStream<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> leftHashStream, PartitionedStream<TInputOutput, TRightKey> rightPartitionedStream,
IPartitionedStreamRecipient<TInputOutput> outputRecipient, CancellationToken cancellationToken)
{
int partitionCount = leftHashStream.PartitionCount;
PartitionedStream<Pair<TInputOutput, NoKeyMemoizationRequired>, int> rightHashStream =
ExchangeUtilities.HashRepartition<TInputOutput, NoKeyMemoizationRequired, TRightKey>(
rightPartitionedStream, null, null, _comparer, cancellationToken);
PartitionedStream<TInputOutput, TLeftKey> outputStream =
new PartitionedStream<TInputOutput, TLeftKey>(partitionCount, leftHashStream.KeyComparer, OrdinalIndexState.Shuffled);
for (int i = 0; i < partitionCount; i++)
{
if (OutputOrdered)
{
outputStream[i] = new OrderedIntersectQueryOperatorEnumerator<TLeftKey>(
leftHashStream[i], rightHashStream[i], _comparer, leftHashStream.KeyComparer, cancellationToken);
}
else
{
outputStream[i] = (QueryOperatorEnumerator<TInputOutput, TLeftKey>)(object)
new IntersectQueryOperatorEnumerator<TLeftKey>(leftHashStream[i], rightHashStream[i], _comparer, cancellationToken);
}
}
outputRecipient.Receive(outputStream);
}
//---------------------------------------------------------------------------------------
// Whether this operator performs a premature merge that would not be performed in
// a similar sequential operation (i.e., in LINQ to Objects).
//
internal override bool LimitsParallelism
{
get { return false; }
}
//---------------------------------------------------------------------------------------
// This enumerator performs the intersection operation incrementally. It does this by
// maintaining a history -- in the form of a set -- of all data already seen. It then
// only returns elements that are seen twice (returning each one only once).
//
private class IntersectQueryOperatorEnumerator<TLeftKey> : QueryOperatorEnumerator<TInputOutput, int>
{
private readonly QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> _leftSource; // Left data source.
private readonly QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, int> _rightSource; // Right data source.
private readonly IEqualityComparer<TInputOutput>? _comparer; // Comparer to use for equality/hash-coding.
private Set<TInputOutput>? _hashLookup; // The hash lookup, used to produce the intersection.
private readonly CancellationToken _cancellationToken;
private Shared<int>? _outputLoopCount;
//---------------------------------------------------------------------------------------
// Instantiates a new intersection operator.
//
internal IntersectQueryOperatorEnumerator(
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> leftSource,
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, int> rightSource,
IEqualityComparer<TInputOutput>? comparer, CancellationToken cancellationToken)
{
Debug.Assert(leftSource != null);
Debug.Assert(rightSource != null);
_leftSource = leftSource;
_rightSource = rightSource;
_comparer = comparer;
_cancellationToken = cancellationToken;
}
//---------------------------------------------------------------------------------------
// Walks the two data sources, left and then right, to produce the intersection.
//
internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TInputOutput currentElement, ref int currentKey)
{
Debug.Assert(_leftSource != null);
Debug.Assert(_rightSource != null);
// Build the set out of the right data source, if we haven't already.
if (_hashLookup == null)
{
_outputLoopCount = new Shared<int>(0);
_hashLookup = new Set<TInputOutput>(_comparer);
Pair<TInputOutput, NoKeyMemoizationRequired> rightElement = default(Pair<TInputOutput, NoKeyMemoizationRequired>);
int rightKeyUnused = default(int);
int i = 0;
while (_rightSource.MoveNext(ref rightElement, ref rightKeyUnused))
{
if ((i++ & CancellationState.POLL_INTERVAL) == 0)
_cancellationToken.ThrowIfCancellationRequested();;
_hashLookup.Add(rightElement.First);
}
}
// Now iterate over the left data source, looking for matches.
Pair<TInputOutput, NoKeyMemoizationRequired> leftElement = default(Pair<TInputOutput, NoKeyMemoizationRequired>);
TLeftKey keyUnused = default(TLeftKey)!;
while (_leftSource.MoveNext(ref leftElement, ref keyUnused))
{
Debug.Assert(_outputLoopCount != null);
if ((_outputLoopCount.Value++ & CancellationState.POLL_INTERVAL) == 0)
_cancellationToken.ThrowIfCancellationRequested();;
// If we found the element in our set, and if we haven't returned it yet,
// we can yield it to the caller. We also mark it so we know we've returned
// it once already and never will again.
if (_hashLookup.Remove(leftElement.First))
{
currentElement = leftElement.First;
#if DEBUG
currentKey = unchecked((int)0xdeadbeef);
#endif
return true;
}
}
return false;
}
protected override void Dispose(bool disposing)
{
Debug.Assert(_leftSource != null && _rightSource != null);
_leftSource.Dispose();
_rightSource.Dispose();
}
}
//---------------------------------------------------------------------------------------
// Returns an enumerable that represents the query executing sequentially.
//
internal override IEnumerable<TInputOutput> AsSequentialQuery(CancellationToken token)
{
IEnumerable<TInputOutput> wrappedLeftChild = CancellableEnumerable.Wrap(LeftChild.AsSequentialQuery(token), token);
IEnumerable<TInputOutput> wrappedRightChild = CancellableEnumerable.Wrap(RightChild.AsSequentialQuery(token), token);
return wrappedLeftChild.Intersect(wrappedRightChild, _comparer);
}
private class OrderedIntersectQueryOperatorEnumerator<TLeftKey> : QueryOperatorEnumerator<TInputOutput, TLeftKey>
{
private readonly QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> _leftSource; // Left data source.
private readonly QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, int> _rightSource; // Right data source.
private readonly IEqualityComparer<Wrapper<TInputOutput>> _comparer; // Comparer to use for equality/hash-coding.
private readonly IComparer<TLeftKey> _leftKeyComparer; // Comparer to use to determine ordering of order keys.
private Dictionary<Wrapper<TInputOutput>, Pair<TInputOutput, TLeftKey>>? _hashLookup; // The hash lookup, used to produce the intersection.
private readonly CancellationToken _cancellationToken;
//---------------------------------------------------------------------------------------
// Instantiates a new intersection operator.
//
internal OrderedIntersectQueryOperatorEnumerator(
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> leftSource,
QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, int> rightSource,
IEqualityComparer<TInputOutput>? comparer, IComparer<TLeftKey> leftKeyComparer,
CancellationToken cancellationToken)
{
Debug.Assert(leftSource != null);
Debug.Assert(rightSource != null);
_leftSource = leftSource;
_rightSource = rightSource;
_comparer = new WrapperEqualityComparer<TInputOutput>(comparer);
_leftKeyComparer = leftKeyComparer;
_cancellationToken = cancellationToken;
}
//---------------------------------------------------------------------------------------
// Walks the two data sources, left and then right, to produce the intersection.
//
internal override bool MoveNext([MaybeNullWhen(false), AllowNull] ref TInputOutput currentElement, ref TLeftKey currentKey)
{
Debug.Assert(_leftSource != null);
Debug.Assert(_rightSource != null);
// Build the set out of the left data source, if we haven't already.
int i = 0;
if (_hashLookup == null)
{
_hashLookup = new Dictionary<Wrapper<TInputOutput>, Pair<TInputOutput, TLeftKey>>(_comparer);
Pair<TInputOutput, NoKeyMemoizationRequired> leftElement = default(Pair<TInputOutput, NoKeyMemoizationRequired>);
TLeftKey leftKey = default(TLeftKey)!;
while (_leftSource.MoveNext(ref leftElement, ref leftKey))
{
if ((i++ & CancellationState.POLL_INTERVAL) == 0)
_cancellationToken.ThrowIfCancellationRequested();;
// For each element, we track the smallest order key for that element that we saw so far
Pair<TInputOutput, TLeftKey> oldEntry;
Wrapper<TInputOutput> wrappedLeftElem = new Wrapper<TInputOutput>(leftElement.First);
// If this is the first occurrence of this element, or the order key is lower than all keys we saw previously,
// update the order key for this element.
if (!_hashLookup.TryGetValue(wrappedLeftElem, out oldEntry) || _leftKeyComparer.Compare(leftKey, oldEntry.Second) < 0)
{
// For each "elem" value, we store the smallest key, and the element value that had that key.
// Note that even though two element values are "equal" according to the EqualityComparer,
// we still cannot choose arbitrarily which of the two to yield.
_hashLookup[wrappedLeftElem] = new Pair<TInputOutput, TLeftKey>(leftElement.First, leftKey);
}
}
}
// Now iterate over the right data source, looking for matches.
Pair<TInputOutput, NoKeyMemoizationRequired> rightElement = default(Pair<TInputOutput, NoKeyMemoizationRequired>);
int rightKeyUnused = default(int);
while (_rightSource.MoveNext(ref rightElement, ref rightKeyUnused))
{
if ((i++ & CancellationState.POLL_INTERVAL) == 0)
_cancellationToken.ThrowIfCancellationRequested();;
// If we found the element in our set, and if we haven't returned it yet,
// we can yield it to the caller. We also mark it so we know we've returned
// it once already and never will again.
Pair<TInputOutput, TLeftKey> entry;
Wrapper<TInputOutput> wrappedRightElem = new Wrapper<TInputOutput>(rightElement.First);
if (_hashLookup.TryGetValue(wrappedRightElem, out entry))
{
currentElement = entry.First;
currentKey = entry.Second;
_hashLookup.Remove(new Wrapper<TInputOutput>(entry.First));
return true;
}
}
return false;
}
protected override void Dispose(bool disposing)
{
Debug.Assert(_leftSource != null && _rightSource != null);
_leftSource.Dispose();
_rightSource.Dispose();
}
}
}
}
| {
"pile_set_name": "Github"
} |
Here is a complete grammar for Lox. The chapters that introduce each part of the
language include the grammar rules there, but this collects them all into one
place.
## Syntax Grammar
The syntactic grammar is used to parse the linear sequence of tokens into the
nested syntax tree structure. It starts with the first rule that matches an
entire Lox program (or a single REPL entry):
```ebnf
program → declaration* EOF ;
```
### Declarations
A program is a series of declarations, which are the statements that bind new
identifiers or any of the other statement types:
```ebnf
declaration → classDecl
| funDecl
| varDecl
| statement ;
classDecl → "class" IDENTIFIER ( "<" IDENTIFIER )?
"{" function* "}" ;
funDecl → "fun" function ;
varDecl → "var" IDENTIFIER ( "=" expression )? ";" ;
```
### Statements
The remaining statement rules produce side effects, but do not introduce
bindings:
```ebnf
statement → exprStmt
| forStmt
| ifStmt
| printStmt
| returnStmt
| whileStmt
| block ;
exprStmt → expression ";" ;
forStmt → "for" "(" ( varDecl | exprStmt | ";" )
expression? ";"
expression? ")" statement ;
ifStmt → "if" "(" expression ")" statement
( "else" statement )? ;
printStmt → "print" expression ";" ;
returnStmt → "return" expression? ";" ;
whileStmt → "while" "(" expression ")" statement ;
block → "{" declaration* "}" ;
```
Note that `block` is a statement rule, but is also used as a nonterminal in a
couple of other rules for things like function bodies.
### Expressions
Expressions produce values. Lox has a number of unary and binary operators with
different levels of precedence. Some grammars for languages do not directly
encode the precedence relationships and specify that elsewhere. Here, we use a
separate rule for each precedence level to make it explicit:
```ebnf
expression → assignment ;
assignment → ( call "." )? IDENTIFIER "=" assignment
| logic_or ;
logic_or → logic_and ( "or" logic_and )* ;
logic_and → equality ( "and" equality )* ;
equality → comparison ( ( "!=" | "==" ) comparison )* ;
comparison → addition ( ( ">" | ">=" | "<" | "<=" ) addition )* ;
addition → multiplication ( ( "-" | "+" ) multiplication )* ;
multiplication → unary ( ( "/" | "*" ) unary )* ;
unary → ( "!" | "-" ) unary | call ;
call → primary ( "(" arguments? ")" | "." IDENTIFIER )* ;
primary → "true" | "false" | "nil" | "this"
| NUMBER | STRING | IDENTIFIER | "(" expression ")"
| "super" "." IDENTIFIER ;
```
### Utility Rules
In order to keep the above rules a little cleaner, some of the grammar is
split out into a few reused helper rules:
```ebnf
function → IDENTIFIER "(" parameters? ")" block ;
parameters → IDENTIFIER ( "," IDENTIFIER )* ;
arguments → expression ( "," expression )* ;
```
## Lexical Grammar
The lexical grammar is used by the scanner to group characters into tokens.
Where the syntax is [context free][], the lexical grammar is [regular][] -- note
that there are no recursive rules.
[context free]: https://en.wikipedia.org/wiki/Context-free_grammar
[regular]: https://en.wikipedia.org/wiki/Regular_grammar
```ebnf
NUMBER → DIGIT+ ( "." DIGIT+ )? ;
STRING → "\"" <any char except "\"">* "\"" ;
IDENTIFIER → ALPHA ( ALPHA | DIGIT )* ;
ALPHA → "a" ... "z" | "A" ... "Z" | "_" ;
DIGIT → "0" ... "9" ;
```
| {
"pile_set_name": "Github"
} |
1 stdcall OleUIAddVerbMenuA(ptr str long long long long long long ptr)
2 stdcall OleUICanConvertOrActivateAs(ptr long long)
3 stdcall OleUIInsertObjectA(ptr)
4 stdcall OleUIPasteSpecialA(ptr)
5 stdcall OleUIEditLinksA(ptr)
6 stdcall OleUIChangeIconA(ptr)
7 stdcall OleUIConvertA(ptr)
8 stdcall OleUIBusyA(ptr)
9 stdcall OleUIUpdateLinksA(ptr long str long)
10 varargs OleUIPromptUserA(long ptr)
11 stdcall OleUIObjectPropertiesA(ptr)
12 stdcall OleUIChangeSourceA(ptr)
13 varargs OleUIPromptUserW(long ptr)
14 stdcall OleUIAddVerbMenuW(ptr wstr long long long long long long ptr)
15 stdcall OleUIBusyW(ptr)
16 stdcall OleUIChangeIconW(ptr)
17 stdcall OleUIChangeSourceW(ptr)
18 stdcall OleUIConvertW(ptr)
19 stdcall OleUIEditLinksW(ptr)
20 stdcall OleUIInsertObjectW(ptr)
21 stdcall OleUIObjectPropertiesW(ptr)
22 stdcall OleUIPasteSpecialW(ptr)
23 stdcall OleUIUpdateLinksW(ptr long wstr long)
| {
"pile_set_name": "Github"
} |
# Locally computed
sha256 4cb81f29cba23172d042e50bbab00cd64cd5670ad7350fd9d25301f63178e5f7 kodi-pvr-wmc-2.4.5-Leia.tar.gz
sha256 1a2f68003a1149b6f6480f4cc749089aed8cbf16529300cc8458c5c7925ce917 src/client.h
| {
"pile_set_name": "Github"
} |
/*
Copyright 2017 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
// SchemeBuilder collects the scheme builder functions for the Velero API
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
// AddToScheme applies the SchemeBuilder functions to a specified scheme
AddToScheme = SchemeBuilder.AddToScheme
)
// GroupName is the group name for the Velero API
const GroupName = "velero.io"
// SchemeGroupVersion is the GroupVersion for the Velero API
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
// Resource gets a Velero GroupResource for a specified resource
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
type typeInfo struct {
PluralName string
ItemType runtime.Object
ItemListType runtime.Object
}
func newTypeInfo(pluralName string, itemType, itemListType runtime.Object) typeInfo {
return typeInfo{
PluralName: pluralName,
ItemType: itemType,
ItemListType: itemListType,
}
}
// CustomResources returns a map of all custom resources within the Velero
// API group, keyed on Kind.
func CustomResources() map[string]typeInfo {
return map[string]typeInfo{
"Backup": newTypeInfo("backups", &Backup{}, &BackupList{}),
"Restore": newTypeInfo("restores", &Restore{}, &RestoreList{}),
"Schedule": newTypeInfo("schedules", &Schedule{}, &ScheduleList{}),
"DownloadRequest": newTypeInfo("downloadrequests", &DownloadRequest{}, &DownloadRequestList{}),
"DeleteBackupRequest": newTypeInfo("deletebackuprequests", &DeleteBackupRequest{}, &DeleteBackupRequestList{}),
"PodVolumeBackup": newTypeInfo("podvolumebackups", &PodVolumeBackup{}, &PodVolumeBackupList{}),
"PodVolumeRestore": newTypeInfo("podvolumerestores", &PodVolumeRestore{}, &PodVolumeRestoreList{}),
"ResticRepository": newTypeInfo("resticrepositories", &ResticRepository{}, &ResticRepositoryList{}),
"BackupStorageLocation": newTypeInfo("backupstoragelocations", &BackupStorageLocation{}, &BackupStorageLocationList{}),
"VolumeSnapshotLocation": newTypeInfo("volumesnapshotlocations", &VolumeSnapshotLocation{}, &VolumeSnapshotLocationList{}),
"ServerStatusRequest": newTypeInfo("serverstatusrequests", &ServerStatusRequest{}, &ServerStatusRequestList{}),
}
}
func addKnownTypes(scheme *runtime.Scheme) error {
for _, typeInfo := range CustomResources() {
scheme.AddKnownTypes(SchemeGroupVersion, typeInfo.ItemType, typeInfo.ItemListType)
}
metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
return nil
}
| {
"pile_set_name": "Github"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.