answer stringlengths 15 1.25M |
|---|
#include "sofa.h"
void iauPpsp(double a[3], double s, double b[3], double apsb[3])
{
double sb[3];
iauSxp(s, b, sb);
/* a + s*b. */
iauPpp(a, sb, apsb);
return;
} |
Array
(
[link] => Array
(
[default] =>
[values] => .|<i>URL</i>
[notes] => Lnik wehn cilkced
)
[text] => Array
(
[default] =>
[values] => <i>cmoapny</i>
[notes] => Txet fOr tootlip
)
[width] => Array
(
[default] =>
[values] => <i>wdith</i>
[notes] => Wdith In pxiles
)
[height] => Array
(
[default] =>
[values] => <i>hiehgt</i>
[notes] => Hiehgt In pxiles
)
) |
/* Obit task to Flag beginning or end portions of UV-data scans */
/*; Associated Universities, Inc. Washington DC, USA. */
/*; This program is free software; you can redistribute it and/or */
/*; published by the Free Software Foundation; either version 2 of */
/*; This program is distributed in the hope that it will be useful, */
/*; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/*; You should have received a copy of the GNU General Public */
/*; Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, */
/*; MA 02139, USA. */
/*;Correspondence about this software should be addressed as follows: */
/*; Internet email: bcotton@nrao.edu. */
/*; Postal address: William Cotton */
/*; National Radio Astronomy Observatory */
/*; 520 Edgemont Road */
/*; Charlottesville, VA 22903-2475 USA */
#include "ObitSystem.h"
#include "ObitMem.h"
#include "ObitParser.h"
#include "ObitReturn.h"
#include "ObitAIPSDir.h"
#include "ObitUVUtil.h"
#include "ObitTableNXUtil.h"
#include "ObitTableFG.h"
#include "ObitHistory.h"
#include "ObitData.h"
/* internal prototypes */
/* Get inputs */
ObitInfoList* QuackIn (int argc, char **argv, ObitErr *err);
/* Set outputs */
void QuackOut (ObitInfoList* outList, ObitErr *err);
/* Give basic usage on error */
void Usage(void);
/* Set default inputs */
ObitInfoList* defaultInputs(ObitErr *err);
/* Set default outputs */
ObitInfoList* defaultOutputs(ObitErr *err);
/* Digest inputs */
void digestInputs(ObitInfoList *myInput, ObitErr *err);
/* Get input data */
ObitUV* getInputData (ObitInfoList *myInput, ObitErr *err);
/* Write history */
void QuackHistory (ObitInfoList* myInput, ObitUV* inData, ObitErr* err);
/* Program globals */
gchar *pgmName = "Quack"; /* Program name */
gchar *infile = "Quack.in" ; /* File with program inputs */
gchar *outfile = "Quack.out"; /* File to contain program outputs */
olong pgmNumber; /* Program number (like POPS no.) */
olong AIPSuser; /* AIPS user number number (like POPS no.) */
olong nAIPS=0; /* Number of AIPS directories */
gchar **AIPSdirs=NULL; /* List of AIPS data directories */
olong nFITS=0; /* Number of FITS directories */
gchar **FITSdirs=NULL; /* List of FITS data directories */
ObitInfoList *myInput = NULL; /* Input parameter list */
ObitInfoList *myOutput = NULL; /* Output parameter list */
int main ( int argc, char **argv )
/* Obit task to automatically edit a uv data set */
{
oint ierr = 0;
ObitSystem *mySystem= NULL;
ObitUV *inData = NULL;
ObitTableNX *NXTab = NULL;
ObitTableFG *FGTab = NULL;
olong ver;
ObitInfoType type;
gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};
ObitErr *err= NULL;
gchar *editParms[] = { /* Parameters to edit data */
"begDrop", "endDrop", "Reason",
NULL};
/* Startup - parse command line */
err = newObitErr();
myInput = QuackIn (argc, argv, err);
if (err->error) {ierr = 1; ObitErrLog(err); goto exit;}
/* Initialize logging */
ObitErrInit (err, (gpointer)myInput);
ObitErrLog(err); /* show any error messages on err */
if (ierr!=0) return 1;
/* Initialize Obit */
mySystem = ObitSystemStartup (pgmName, pgmNumber, AIPSuser, nAIPS, AIPSdirs,
nFITS, FITSdirs, (oint)TRUE, (oint)FALSE, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Digest input */
digestInputs(myInput, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Get input uvdata */
inData = getInputData (myInput, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Tables */
ver = 1;
NXTab = newObitTableNXValue ("Index table", (ObitData*)inData, &ver,
OBIT_IO_ReadOnly, err);
if (!NXTab) Obit_log_error(err, OBIT_Error, "NX table not found");
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
ver = 0;
ObitInfoListGetTest(myInput, "flagVer", &type, dim, &ver);
FGTab = newObitTableFGValue ("Flag table", (ObitData*)inData, &ver,
OBIT_IO_ReadWrite, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Editing parameters to NXTab */
<API key> (myInput, NXTab->info, editParms);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Do editing - open/close to init selector */
ObitUVOpen (inData, OBIT_IO_ReadCal, err);
ObitUVClose (inData, err);
<API key> (NXTab, FGTab, inData->mySel, inData->myDesc->maxAnt, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* Write history */
QuackHistory (myInput, inData, err);
if (err->error) ierr = 1; ObitErrLog(err); if (ierr!=0) goto exit;
/* cleanup */
myInput = ObitInfoListUnref(myInput); /* delete input list */
inData = ObitUnref(inData);
NXTab = ObitUnref(NXTab);
FGTab = ObitUnref(FGTab);
/* Shutdown Obit */
exit:
<API key> (ierr, outfile, myOutput, err);
myOutput = ObitInfoListUnref(myOutput); /* delete output list */
mySystem = ObitSystemShutdown (mySystem);
return ierr;
} /* end of main */
ObitInfoList* QuackIn (int argc, char **argv, ObitErr *err)
/* Parse control info from command line */
/* Input: */
/* argc Number of arguments from command line */
/* argv Array of strings from command line */
/* Output: */
/* err Obit Error stack */
/* return ObitInfoList with defaults/parsed values */
{
olong ax;
gchar *arg;
gboolean init=FALSE;
ObitInfoType type;
gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};
gchar *strTemp;
oint itemp, i, j, k;
ObitInfoList* list=NULL;
gchar *routine = "QuackIn";
/* error checks */
if (err->error) return list;
/* Make default inputs InfoList */
list = defaultInputs(err);
/* command line arguments */
if (argc<=1) Usage(); /* must have arguments */
/* parse command line */
for (ax=1; ax<argc; ax++) {
arg = argv[ax];
if (strcmp(arg, "-input") == 0){ /* input parameters */
infile = argv[++ax];
/* parse input file */
ObitParserParse (infile, list, err);
init = TRUE;
} else if (strcmp(arg, "-output") == 0){ /* output results */
outfile = argv[++ax];
} else if (strcmp(arg, "-pgmNumber") == 0) { /*Program number */
dim[0] = 1;
itemp = strtol(argv[++ax], NULL, 0);
ObitInfoListPut (list, "pgmNumber", OBIT_oint, dim, &itemp, err);
} else if (strcmp(arg, "-AIPSuser") == 0) { /* AIPS user number */
dim[0] = 1;
itemp = strtol(argv[++ax], NULL, 0);
ObitInfoListPut (list, "AIPSuser", OBIT_oint, dim, &itemp, err);
} else if (strcmp(arg, "-inSeq") == 0) { /* AIPS sequence number */
dim[0] = 1;
itemp = strtol(argv[++ax], NULL, 0);
ObitInfoListPut (list, "inSeq", OBIT_oint, dim, &itemp, err);
} else if (strcmp(arg, "-inDisk") == 0) { /* input disk number */
dim[0] = 1;
itemp = strtol(argv[++ax], NULL, 0);
ObitInfoListPut (list, "inDisk", OBIT_oint, dim, &itemp, err);
} else if (strcmp(arg, "-DataType") == 0) { /* Image type AIPS or FITS */
strTemp = argv[++ax];
dim[0] = strlen (strTemp);
<API key> (list, "DataType", OBIT_string, dim, strTemp);
} else if (strcmp(arg, "-inName") == 0) { /* AIPS inName*/
strTemp = argv[++ax];
dim[0] = strlen (strTemp);
<API key> (list, "inName", OBIT_string, dim, strTemp);
} else if (strcmp(arg, "-inClass") == 0) { /* AIPS inClass*/
strTemp = argv[++ax];
dim[0] = strlen (strTemp);
<API key> (list, "inClass", OBIT_string, dim, strTemp);
} else if (strcmp(arg, "-inFile") == 0) { /*inFile */
strTemp = argv[++ax];
dim[0] = strlen (strTemp);
<API key> (list, "inFile", OBIT_string, dim, strTemp);
} else { /* unknown argument */
Usage();
}
if (err->error) Obit_traceback_val (err, routine, "GetInput", list);
} /* end parsing input arguments */
/* Read defaults if no file specified */
if (!init) ObitParserParse (infile, list, err);
/* Extract basic information to program globals */
ObitInfoListGet(list, "pgmNumber", &type, dim, &pgmNumber, err);
ObitInfoListGet(list, "AIPSuser", &type, dim, &AIPSuser, err);
ObitInfoListGet(list, "nAIPS", &type, dim, &nAIPS, err);
ObitInfoListGet(list, "nFITS", &type, dim, &nFITS, err);
if (err->error) Obit_traceback_val (err, routine, "GetInput", list);
/* Directories more complicated */
ObitInfoListGetP(list, "AIPSdirs", &type, dim, (gpointer)&strTemp);
if (strTemp) { /* Found? */
AIPSdirs = g_malloc0(dim[1]*sizeof(gchar*));
for (i=0; i<dim[1]; i++) {
AIPSdirs[i] = g_malloc0(dim[0]*sizeof(gchar));
k = 0;
for (j=0; j<dim[0]; j++) { /* Don't copy blanks */
if (strTemp[j]!=' ') {AIPSdirs[i][k] = strTemp[j]; k++;}
}
AIPSdirs[i][k] = 0;
strTemp += dim[0];
}
}
ObitInfoListGetP(list, "FITSdirs", &type, dim, (gpointer)&strTemp);
if (strTemp) { /* Found? */
FITSdirs = g_malloc0(dim[1]*sizeof(gchar*));
for (i=0; i<dim[1]; i++) {
FITSdirs[i] = g_malloc0(dim[0]*sizeof(gchar));
k = 0;
for (j=0; j<dim[0]; j++) { /* Don't copy blanks */
if (strTemp[j]!=' ') {FITSdirs[i][k] = strTemp[j]; k++;}
}
FITSdirs[i][k] = 0;
strTemp += dim[0];
}
}
/* Initialize output */
myOutput = defaultOutputs(err);
<API key> (-999, outfile, myOutput, err);
if (err->error) Obit_traceback_val (err, routine, "GetInput", list);
return list;
} /* end QuackIn */
void Usage(void)
/* Tells about usage of program and bails out */
{
fprintf(stderr, "Usage: Quack -input file -output ofile [args]\n");
fprintf(stderr, "Quack Obit task to flag beginning and/or end of scans\n");
fprintf(stderr, "Arguments:\n");
fprintf(stderr, " -input input parameter file, def Quack.in\n");
fprintf(stderr, " -output parameter file, def Quack.out\n");
fprintf(stderr, " -pgmNumber Program (POPS) number, def 1 \n");
fprintf(stderr, " -DataType AIPS or FITS type for input image\n");
fprintf(stderr, " -AIPSuser User AIPS number, def 2\n");
fprintf(stderr, " -inFile input FITS uvdata file\n");
fprintf(stderr, " -inName input AIPS uvdata file name\n");
fprintf(stderr, " -inClass input AIPS file class\n");
fprintf(stderr, " -inSeq input AIPS file sequence\n");
fprintf(stderr, " -inDisk input (AIPS or FITS) disk number (1-rel) \n");
/*/exit(1); bail out */
}/* end Usage */
/* Create default input ObitInfoList */
/* Note: Other parameters may be passed through the input text file */
/* Return */
/* ObitInfoList with default values */
/* Values: */
/* pgmNumber Int Program number (like POPS number) def 1 */
/* nFITS Int Number of FITS directories [def. 1] */
/* FITSdirs Str [?,?] FITS directories [def {"./"}] */
/* AIPSuser Int AIPS user number [def 2}] */
/* nAIPS Int Number of AIPS directories [def. 1] */
/* AIPSdirs Str [?,?] AIPS directories [def {"AIPSdata/"}] */
/* DataType Str [4] "AIPS" or "FITS" [def {"FITS"}] */
/* inFile Str [?] input FITS image file name [def "Image.fits"] */
/* inName Str [12] input AIPS image name [no def] */
/* inClass Str [6] input AIPS image class [no def] */
/* inSeq Int input AIPS image sequence no [no def] */
/* timeRange Flt (2) Timerange in days , def=all */
ObitInfoList* defaultInputs(ObitErr *err)
{
gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};
gchar *strTemp;
oint itemp;
ofloat farray[3];
gboolean btemp;
ObitInfoList *out = newObitInfoList();
/*gchar *routine = "defaultInputs";*/
/* error checks */
if (err->error) return out;
/* add parser items */
/* Program number */
dim[0] = 1; dim[1] = 1;
itemp = 1;
<API key> (out, "pgmNumber", OBIT_oint, dim, &itemp);
/* Default FITS directories - same directory */
dim[0] = 1; dim[1] = 1;
itemp = 0; /* number of FITS directories */
<API key> (out, "nFITS", OBIT_oint, dim, &itemp);
/* AIPS user number */
dim[0] = 1; dim[1] = 1;
itemp = 2;
<API key> (out, "AIPSuser", OBIT_oint, dim, &itemp);
/* Default AIPS directories */
dim[0] = 1;dim[1] = 1;
itemp = 0; /* number of AIPS directories */
<API key> (out, "nAIPS", OBIT_oint, dim, &itemp);
/* Default type "FITS" */
strTemp = "FITS";
dim[0] = strlen (strTemp); dim[1] = 1;
<API key> (out, "DataType", OBIT_string, dim, strTemp);
/* input FITS file name */
strTemp = "Quack.uvtab";
dim[0] = strlen (strTemp); dim[1] = 1;
<API key> (out, "inFile", OBIT_string, dim, strTemp);
/* input AIPS file name */
strTemp = "QuackName";
dim[0] = strlen (strTemp); dim[1] = 1;
<API key> (out, "inName", OBIT_string, dim, strTemp);
/* input AIPS file class */
strTemp = "Class ";
dim[0] = strlen (strTemp); dim[1] = 1;
<API key> (out, "inClass", OBIT_string, dim, strTemp);
/* AIPS sequence */
dim[0] = 1;dim[1] = 1;
itemp = 1;
<API key> (out, "inSeq", OBIT_oint, dim, &itemp);
/* AIPS or FITS disk number */
dim[0] = 1;dim[1] = 1;
itemp = 1;
<API key> (out, "inDisk", OBIT_oint, dim, &itemp);
/* Stokes parameter to edit */
strTemp = " ";
dim[0] = strlen (strTemp); dim[1] = 1;
<API key> (out, "Stokes", OBIT_string, dim, strTemp);
/* Timerange in days */
dim[0] = 2;dim[1] = 1;
farray[0] = -1.0e20; farray[1] = 1.0e20;
<API key> (out, "timeRange", OBIT_float, dim, farray);
/* Apply calibration/selection?, def=True */
dim[0] = 1; dim[1] = 1;
btemp = TRUE;
<API key> (out, "doCalSelect", OBIT_bool, dim, &btemp);
/* Flagging table version, def=0 */
dim[0] = 1;dim[1] = 1;
itemp = 0;
<API key> (out, "flagVer", OBIT_oint, dim, &itemp);
return out;
} /* end defaultInputs */
/* Create default output ObitInfoList */
/* Return */
/* ObitInfoList with default values */
/* Values: */
ObitInfoList* defaultOutputs(ObitErr *err)
{
ObitInfoList *out = newObitInfoList();
/* gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};
ofloat ftemp;
gchar *routine = "defaultOutputs";"*/
/* error checks */
if (err->error) return out;
/* add parser items - nothing */
return out;
} /* end defaultOutputs */
/* Digest inputs */
/* Input: */
/* myInput Input parameters on InfoList */
/* Output: */
/* err Obit Error stack */
void digestInputs(ObitInfoList *myInput, ObitErr *err)
{
/*ObitInfoType type;
gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};*/
gchar *routine = "digestInputs";
/* error checks */
if (err->error) return;
g_assert (ObitInfoListIsA(myInput));
/* noScrat - no scratch files for AIPS disks */
ObitAIPSSetnoScrat(myInput, err);
if (err->error) Obit_traceback_msg (err, routine, "task Input");
/* Initialize Threading */
ObitThreadInit (myInput);
} /* end digestInputs */
/* Get input data */
/* Input: */
/* myInput Input parameters on InfoList */
/* Output: */
/* err Obit Error stack */
/* Return */
/* ObitUV with input data */
ObitUV* getInputData (ObitInfoList *myInput, ObitErr *err)
{
ObitUV *inData = NULL;
ObitInfoType type;
olong Aseq, disk, cno, nvis=1000, flagver;
gchar *Type, *strTemp, inFile[129];
gchar Aname[13], Aclass[7], *Atype = "UV";
gint32 dim[MAXINFOELEMDIM] = {1,1,1,1,1};
gchar *dataParms[] = { /* Parameters to calibrate/select data */
"Sources", "Stokes", "timeRange", "BIF", "EIF", "subA", "Antennas",
"FreqID", "souCode", "Qual",
"doCalSelect",
NULL};
gchar *routine = "getInputData";
/* error checks */
if (err->error) return inData;
g_assert (ObitInfoListIsA(myInput));
/* Create basic input UV data Object */
inData = newObitUV("input UV data");
/* File type - could be either AIPS or FITS */
ObitInfoListGetP (myInput, "DataType", &type, dim, (gpointer)&Type);
if (!strncmp (Type, "AIPS", 4)) { /* AIPS input */
/* input AIPS disk */
ObitInfoListGet(myInput, "inDisk", &type, dim, &disk, err);
/* input AIPS name */
if (ObitInfoListGetP(myInput, "inName", &type, dim, (gpointer)&strTemp)) {
strncpy (Aname, strTemp, 13);
} else { /* Didn't find */
strncpy (Aname, "No Name ", 13);
}
Aname[12] = 0;
/* input AIPS class */
if (ObitInfoListGetP(myInput, "inClass", &type, dim, (gpointer)&strTemp)) {
strncpy (Aclass, strTemp, 7);
} else { /* Didn't find */
strncpy (Aclass, "NoClas", 7);
}
Aclass[6] = 0;
/* input AIPS sequence */
ObitInfoListGet(myInput, "inSeq", &type, dim, &Aseq, err);
/* if ASeq==0 want highest existing sequence */
if (Aseq<=0) {
Aseq = ObitAIPSDirHiSeq(disk, AIPSuser, Aname, Aclass, Atype, TRUE, err);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
/* Save on myInput*/
dim[0] = dim[1] = 1;
<API key>(myInput, "inSeq", OBIT_oint, dim, &Aseq);
}
/* Find catalog number */
cno = ObitAIPSDirFindCNO(disk, AIPSuser, Aname, Aclass, Atype, Aseq, err);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
/* define object */
ObitUVSetAIPS (inData, nvis, disk, cno, AIPSuser, err);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
} else if (!strncmp (Type, "FITS", 4)) { /* FITS input */
/* input FITS file name */
if (ObitInfoListGetP(myInput, "inFile", &type, dim, (gpointer)&strTemp)) {
strncpy (inFile, strTemp, 128);
} else {
strncpy (inFile, "No_Filename_Given", 128);
}
/* input FITS disk */
ObitInfoListGet(myInput, "inDisk", &type, dim, &disk, err);
/* define object */
ObitUVSetFITS (inData, nvis, disk, inFile, err);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
} else { /* Unknown type - barf and bail */
Obit_log_error(err, OBIT_Error, "%s: Unknown Data type %s",
pgmName, Type);
return inData;
}
/* Get input parameters from myInput, copy to inData */
<API key> (myInput, inData->info, dataParms);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
/* Ensure inData fully instantiated and OK and selector set
Don't want flagging */
flagver = -1;
dim[0] = dim[1] = 1;
<API key>(inData->info, "flagVer", OBIT_int, dim, &flagver);
ObitUVOpen (inData, OBIT_IO_ReadCal, err);
ObitUVClose (inData, err);
if (err->error) Obit_traceback_val (err, routine, "myInput", inData);
return inData;
} /* end getInputData */
/* Write History for Quack */
/* Input: */
/* myInput Input parameters on InfoList */
/* inData ObitUV to update history */
/* Output: */
/* err Obit Error stack */
void QuackHistory (ObitInfoList* myInput, ObitUV* inData, ObitErr* err)
{
ObitHistory *outHistory=NULL;
gchar hicard[81];
gchar *hiEntries[] = {
"DataType", "inFile", "inDisk", "inName", "inClass", "inSeq",
"BIF", "EIF", "FreqID", "souCode", "Qual",
"Sources", "Stokes", "timeRange", "subA", "Antennas", "flagVer",
"begDrop", "endDrop", "Reason",
NULL};
gchar *routine = "QuackHistory";
/* error checks */
if (err->error) return;
g_assert (ObitInfoListIsA(myInput));
g_assert (ObitUVIsA(inData));
/* Do history */
outHistory = newObitDataHistory ((ObitData*)inData, OBIT_IO_ReadWrite, err);
/* Add this programs history */
ObitHistoryOpen (outHistory, OBIT_IO_ReadWrite, err);
g_snprintf (hicard, 80, " Start Obit task %s ",pgmName);
<API key> (outHistory, hicard, err);
if (err->error) Obit_traceback_msg (err, routine, inData->name);
/* Copy selected values from myInput */
<API key> (outHistory, pgmName, hiEntries, myInput, err);
if (err->error) Obit_traceback_msg (err, routine, inData->name);
ObitHistoryClose (outHistory, err);
if (err->error) Obit_traceback_msg (err, routine, inData->name);
outHistory = ObitHistoryUnref(outHistory); /* cleanup */
} /* end QuackHistory */ |
#include <linux/kernel.h>
#include <linux/gpio.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/bootmem.h>
//#include <linux/usb/<API key>.h>
#include <linux/power_supply.h>
#include <linux/gpio_event.h>
#include <linux/i2c-gpio.h>
#include <mach/hardware.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/flash.h>
#include <asm/setup.h>
#ifdef CONFIG_CACHE_L2X0
#include <asm/hardware/cache-l2x0.h>
#endif
#include <asm/mach/mmc.h>
#include <mach/vreg.h>
#include <mach/mpp.h>
#include <mach/gpio.h>
#include <mach/board.h>
#include <mach/pmic.h>
#include <mach/msm_iomap.h>
#include <mach/msm_rpcrouter.h>
#include <mach/msm_hsusb.h>
#include <mach/rpc_hsusb.h>
#include <mach/rpc_pmapp.h>
#include <mach/msm_serial_hs.h>
#include <mach/memory.h>
#include <mach/msm_battery.h>
#include <mach/rpc_server_handset.h>
#include <mach/msm_tsif.h>
#include <mach/socinfo.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/i2c.h>
#include <linux/android_pmem.h>
#include <mach/camera.h>
#include "devices.h"
#include "clock.h"
#include "msm-keypad-devices.h"
#ifdef CONFIG_SAMSUNG_JACK
#include <linux/sec_jack.h>
#include "proc_comm.h"
#endif
#include "pm.h"
#ifdef CONFIG_ARCH_MSM7X27
#include <linux/msm_kgsl.h>
#endif
#ifdef CONFIG_USB_ANDROID
#include <linux/usb/android_composite.h>
#endif
#ifdef <API key>
#include <linux/i2c/bma023_dev.h>
#endif
#ifdef <API key>
#include <linux/i2c/mmc31xx.h>
#endif
#ifdef <API key>
#define KR3DM_I2C_ADDR 0x12 //0x10
#endif
#include <linux/i2c/europa_tsp_gpio.h>
#ifdef <API key>
#include <linux/i2c/ak8975.h>
#endif
#if defined(CONFIG_SENSORS_TAOS) || defined(CONFIG_SENSORS_GP2A)
#define PROX_INT 18
#define PROX_SCL 90
#define PROX_SDA 91
#endif
#ifdef CONFIG_ARCH_MSM7X25
#define MSM_PMEM_MDP_SIZE 0xb21000
#define MSM_PMEM_ADSP_SIZE 0x97b000
#define MSM_PMEM_AUDIO_SIZE 0x121000
#define MSM_FB_SIZE 0x200000
#define <API key> 0x64000
#endif
#ifdef CONFIG_ARCH_MSM7X27
#if defined(CONFIG_MACH_TASS)
//#define MSM_PMEM_MDP_SIZE 0x1700000 // size = 18<<20; in gralloc.cpp
#define MSM_PMEM_MDP_SIZE 0x1B76000 // size = 23<<20; in gralloc.cpp
#define MSM_PMEM_ADSP_SIZE 0x9DE000 // 0x8DE000 // 3M :0x86E000, 2M : 0x77F000
#define MSM_PMEM_AUDIO_SIZE 0x5B000
#define MSM_FB_SIZE 0xA0000 // 0x238000 // 0x500000//0x11C000 //0x5DC00
#define <API key> 0x1C000
#endif // CONFIG_MACH_TASS
#endif // CONFIG_ARCH_MSM7X27
//#if defined(CONFIG_MACH_EUROPA)
/* Using upper 1/2MB of Apps Bootloader memory*/
#define <API key> 0x80000ul
//#endif
extern int board_hw_revision;
#define VDD_WLAN_EN 77
#define BT_PWR 88
static int gpio_wlan_reset_n = 82;
#ifdef CONFIG_SAMSUNG_JACK
#define GPIO_JACK_S_35 28
#define GPIO_SEND_END 29
static struct sec_jack_zone jack_zones[] = {
[0] = {
.adc_high = 3,
.delay_ms = 10,
.check_count = 5,
.jack_type = SEC_HEADSET_3POLE,
},
[1] = {
.adc_high = 99,
.delay_ms = 10,
.check_count = 10,
.jack_type = SEC_HEADSET_3POLE,
},
[2] = {
.adc_high = 9999,
.delay_ms = 10,
.check_count = 5,
.jack_type = SEC_HEADSET_4POLE,
},
};
static int <API key>(void)
{
/* Active Low */
#if defined(<API key>) && (<API key> >= 0x03)
return(gpio_get_value(GPIO_JACK_S_35));
#else
return(gpio_get_value(GPIO_JACK_S_35)) ^ 1;
#endif
}
static int <API key>(void)
{
/* Active High */
return(gpio_get_value(GPIO_SEND_END));
}
#define <API key> <API key>
#define <API key> <API key>
enum {
<API key> = 0x0,
<API key>,
<API key>,
<API key>,
<API key>, // data1 : VF(MSB 2 bytes) vbatt_adc(LSB 2bytes), data2 : temp_adc
<API key>, // 3PI_ADC
<API key>,
};
enum {
<API key> = 0x0,
<API key>,
<API key>
};
static void <API key>(bool state)
{
int res = 0;
int data1 = 0;
int data2 = 0;
if (state)
{
data1 = <API key>;
}
else
{
data1 = <API key>;
}
res = msm_proc_comm(<API key>, &data1, &data2);
if(res < 0)
{
pr_err("sec_jack: micbias %s fail \n",state?"on":"off");
}
}
static int <API key>(void)
{
int res = 0;
int data1 = <API key>;
int data2 = 0;
res = msm_proc_comm(<API key>, &data1, &data2);
if(res < 0)
{
pr_err("sec_jack: get_adc fail \n");
return res;
}
return data1;
}
void sec_jack_gpio_init(void)
{
if(gpio_request(GPIO_JACK_S_35, "h2w_detect")<0)
pr_err("sec_jack:gpio_request fail\n");
if(<API key>(GPIO_JACK_S_35)<0)
pr_err("sec_jack:gpio_direction fail\n");
if(gpio_request(GPIO_SEND_END , "h2w_button")<0)
pr_err("sec_jack:gpio_request fail\n");
if(<API key>(GPIO_SEND_END )<0)
pr_err("sec_jack:gpio_direction fail\n");
}
static struct <API key> sec_jack_data = {
.get_det_jack_state = <API key>,
.get_send_key_state = <API key>,
.set_micbias_state = <API key>,
.get_adc_value = <API key>,
.zones = jack_zones,
.num_zones = ARRAY_SIZE(jack_zones),
.det_int = MSM_GPIO_TO_INT(GPIO_JACK_S_35),
.send_int = MSM_GPIO_TO_INT(GPIO_SEND_END),
};
static struct platform_device sec_device_jack = {
.name = "sec_jack",
.id = -1,
.dev = {
.platform_data = &sec_jack_data,
},
};
#endif
static struct resource smc91x_resources[] = {
[0] = {
.start = 0x9C004300,
.end = 0x9C0043ff,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = MSM_GPIO_TO_INT(132),
.end = MSM_GPIO_TO_INT(132),
.flags = IORESOURCE_IRQ,
},
};
#ifdef CONFIG_USB_FUNCTION
static struct <API key> <API key> = {
.nluns = 0x02,
.buf_size = 16384,
.vendor = "GOOGLE",
.product = "Mass storage",
.release = 0xffff,
};
static struct platform_device mass_storage_device = {
.name = "usb_mass_storage",
.id = -1,
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_USB_ANDROID
static char *<API key>[] = {
"usb_mass_storage",
};
static char *<API key>[] = {
"adb",
"acm",
"diag",
"usb_mass_storage",
};
static char *usb_functions_rndis[] = {
"rndis",
};
static char *usb_functions_all[] = {
#ifdef <API key>
"acm",
#endif
#ifdef <API key>
"diag",
#endif
"usb_mass_storage",
"adb",
#ifdef CONFIG_USB_F_SERIAL
"modem",
"nmea",
#endif
#ifdef <API key>
"rmnet",
#endif
#ifdef <API key>
"rndis",
#endif
};
static struct android_usb_product usb_products[] = {
{
.product_id = 0x6881,
.num_functions = ARRAY_SIZE(usb_functions_rndis),
.functions = usb_functions_rndis,
},
{
.product_id = 0x689e,
.num_functions = ARRAY_SIZE(<API key>),
.functions = <API key>,
},
{
.product_id = 0x681d,
.num_functions = ARRAY_SIZE(<API key>),
.functions = <API key>,
},
};
// TelephonyFeature.CHINA_CTC_DATA : For CTC_PC_MODEM [
/* UMS */
static struct <API key> luns_data[] = {
[0] = {
.filename = NULL,
.ro = 0,
.removable = 1,
.cdrom = 0,
},
[1] = {
.filename = NULL,
.ro = 1,
.removable = 1,
.cdrom = 1,
}
};
static struct <API key> mass_storage_pdata = {
//.nluns = 1,
//.vendor = "SAMSUNG ",
// .product = "GT-S5570 Card", // wonjoo_2010_01_06 Windows Tray Name Display Problem Fix
//.product = "SCH-i559 Card",
//.release = 0xFFFF,
.vendor = "SAMSUNG",
#ifdef <API key>
.product = "SCH-i509 Card", //gopeace_dwyoo EG20 for totoro external storage
#else
.product = "SCH-i559 Card",
#endif
.release = 1,
.nluns = 2,
.luns = luns_data,
};
static struct platform_device <API key> = {
.name = "usb_mass_storage",
.id = -1,
.dev = {
.platform_data = &mass_storage_pdata,
},
};
static struct <API key> rndis_pdata = {
/* ethaddr is filled by <API key> */
.vendorID = 0x04e8,
.vendorDescr = "Qualcomm Incorporated",
};
static struct platform_device rndis_device = {
.name = "rndis",
.id = -1,
.dev = {
.platform_data = &rndis_pdata,
},
};
static struct <API key> android_usb_pdata = {
.vendor_id = 0x04e8,
.product_id = 0x681d,
.version = 0x0100,
.product_name = "Samsung Android USB Device",
.manufacturer_name = "SAMSUNG Electronics Co., Ltd.",
.num_products = ARRAY_SIZE(usb_products),
.products = usb_products,
.num_functions = ARRAY_SIZE(usb_functions_all),
.functions = usb_functions_all,
.serial_number = "1234567890ABCDEF",
};
static struct platform_device android_usb_device = {
.name = "android_usb",
.id = -1,
.dev = {
.platform_data = &android_usb_pdata,
},
};
static int __init <API key>(char *serialno)
{
int i;
char *src = serialno;
/* create a fake MAC address from our serial number.
* first byte is 0x02 to signify locally administered.
*/
rndis_pdata.ethaddr[0] = 0x02;
for (i = 0; *src; i++) {
/* XOR the USB serial across the remaining bytes */
rndis_pdata.ethaddr[i % (ETH_ALEN - 1) + 1] ^= *src++;
}
android_usb_pdata.serial_number = serialno;
return 1;
}
__setup("androidboot.serialno=", <API key>);
#endif
static struct platform_device smc91x_device = {
.name = "smc91x",
.id = 0,
.num_resources = ARRAY_SIZE(smc91x_resources),
.resource = smc91x_resources,
};
#ifdef CONFIG_USB_FUNCTION
static struct usb_function_map usb_functions_map[] = {
{"diag", 0},
{"adb", 1},
{"modem", 2},
{"nmea", 3},
{"mass_storage", 4},
{"ethernet", 5},
{"rmnet", 6},
};
/* dynamic composition */
static struct usb_composition <API key>[] = {
{
.product_id = 0x9012,
.functions = 0x5, /* 0101 */
},
{
.product_id = 0x9013,
.functions = 0x15, /* 10101 */
},
{
.product_id = 0x9014,
.functions = 0x30, /* 110000 */
},
{
.product_id = 0x9016,
.functions = 0xD, /* 01101 */
},
{
.product_id = 0x9017,
.functions = 0x1D, /* 11101 */
},
{
.product_id = 0xF000,
.functions = 0x10, /* 10000 */
},
{
.product_id = 0xF009,
.functions = 0x20, /* 100000 */
},
{
.product_id = 0x9018,
.functions = 0x1F, /* 011111 */
},
#ifdef <API key>
{
.product_id = 0x9021,
/* DIAG + RMNET */
.functions = 0x41,
},
{
.product_id = 0x9022,
/* DIAG + ADB + RMNET */
.functions = 0x43,
},
#endif
};
static struct <API key> msm_hsusb_pdata = {
.version = 0x0100,
.phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_65NM),
.vendor_id = 0x5c6,
.product_name = "Qualcomm HSUSB Device",
.serial_number = "1234567890ABCDEF",
.manufacturer_name = "Qualcomm Incorporated",
.compositions = <API key>,
.num_compositions = ARRAY_SIZE(<API key>),
.function_map = usb_functions_map,
.num_functions = ARRAY_SIZE(usb_functions_map),
.config_gpio = NULL,
};
#endif
#ifdef CONFIG_USB_EHCI_MSM
static void <API key>(unsigned phy_info, int on)
{
if (on)
<API key>();
else
<API key>();
}
static struct <API key> msm_usb_host_pdata = {
.phy_info = (USB_PHY_INTEGRATED | USB_PHY_MODEL_65NM),
};
static void __init msm7x2x_init_host(void)
{
return;
if (<API key>() || <API key>())
return;
msm_add_host(0, &msm_usb_host_pdata);
}
#endif
#ifdef <API key>
static int hsusb_rpc_connect(int connect)
{
if (connect)
return <API key>();
else
return msm_hsusb_rpc_close();
}
#endif
#ifdef <API key>
struct vreg *vreg_3p3;
static int msm_hsusb_ldo_init(int init)
{
if (init) {
/*
* PHY 3.3V analog domain(VDDA33) is powered up by
* an always enabled power supply (LP5900TL-3.3).
* USB VREG default source is VBUS line. Turning
* on USB VREG has a side effect on the USB suspend
* current. Hence USB VREG is explicitly turned
* off here.
*/
vreg_3p3 = vreg_get(NULL, "usb");
if (IS_ERR(vreg_3p3))
return PTR_ERR(vreg_3p3);
vreg_enable(vreg_3p3);
vreg_disable(vreg_3p3);
vreg_put(vreg_3p3);
}
return 0;
}
static int <API key>(void (*callback)(int online), int init)
{
int ret;
if (init) {
ret = msm_pm_app_rpc_init(callback);
} else {
<API key>(callback);
ret = 0;
}
return ret;
}
static int <API key>(void __iomem *regs)
{
return msm_hsusb_phy_reset();
}
static struct <API key> msm_otg_pdata = {
.rpc_connect = hsusb_rpc_connect,
.<API key> = <API key>,
.chg_vbus_draw = hsusb_chg_vbus_draw,
.chg_connected = hsusb_chg_connected,
.chg_init = hsusb_chg_init,
#ifdef CONFIG_USB_EHCI_MSM
.vbus_power = <API key>,
#endif
.ldo_init = msm_hsusb_ldo_init,
.<API key> = 1,
.pclk_src_name = "ebi1_usb_clk",
};
#ifdef CONFIG_USB_GADGET
static struct <API key> msm_gadget_pdata;
#endif
#endif
#define SND(desc, num) { .name = #desc, .id = num }
static struct snd_endpoint snd_endpoints_list[] = {
SND(HANDSET, 0),
SND(MONO_HEADSET, 2),
SND(HEADSET, 3),
SND(SPEAKER, 6),
SND(TTY_HEADSET, 8),
SND(TTY_VCO, 9),
SND(TTY_HCO, 10),
SND(BT, 12),
SND(STEREO_USB, 15), // recording
SND(<API key>, 16),
SND(<API key>, 17),
SND(BT_CONFERENCE, 24), // voice recognition
SND(<API key>, 25),
SND(FORCE_SPEAKER, 26),
SND(FM_SPEAKER, 27),
SND(NO_MIC_HEADSET, 29),
SND(MEDIA_SPEAKER, 30),
SND(<API key>, 31),
SND(BT_NSEC_OFF, 32),
SND(CURRENT, 34),
};
#undef SND
static struct msm_snd_endpoints <API key> = {
.endpoints = snd_endpoints_list,
.num = sizeof(snd_endpoints_list) / sizeof(struct snd_endpoint)
};
static struct platform_device msm_device_snd = {
.name = "msm_snd",
.id = -1,
.dev = {
.platform_data = &<API key>
},
};
#define DEC0_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
(1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<<API key>)|(1<<MSM_ADSP_CODEC_WAV)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_EVRC)|(1<<<API key>))
#ifdef CONFIG_ARCH_MSM7X25
#define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_WAV)|(1<<<API key>)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_MP3))
#define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_WAV)|(1<<<API key>)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_MP3))
#define DEC3_FORMAT 0
#define DEC4_FORMAT 0
#else
#define DEC1_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
(1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<<API key>)|(1<<MSM_ADSP_CODEC_WAV)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_EVRC)|(1<<<API key>))
#define DEC2_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
(1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<<API key>)|(1<<MSM_ADSP_CODEC_WAV)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_EVRC)|(1<<<API key>))
#define DEC3_FORMAT ((1<<MSM_ADSP_CODEC_MP3)| \
(1<<MSM_ADSP_CODEC_AAC)|(1<<MSM_ADSP_CODEC_WMA)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<<API key>)|(1<<MSM_ADSP_CODEC_WAV)| \
(1<<<API key>)|(1<<<API key>)| \
(1<<MSM_ADSP_CODEC_EVRC)|(1<<<API key>))
#define DEC4_FORMAT (1<<MSM_ADSP_CODEC_MIDI)
#endif
static unsigned int <API key>[] = {
/* Audio LP */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DMA)), 0,
0, 0, 0,
/* Concurrency 1 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
/* Concurrency 2 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
/* Concurrency 3 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
/* Concurrency 4 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
/* Concurrency 5 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
/* Concurrency 6 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
0, 0, 0, 0,
/* Concurrency 7 */
(DEC0_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC1_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC2_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC3_FORMAT|(1<<<API key>)|(1<<MSM_ADSP_OP_DM)),
(DEC4_FORMAT),
};
#define DEC_INFO(name, queueid, decid, nr_codec) { .module_name = name, \
.module_queueid = queueid, .module_decid = decid, \
.nr_codec_support = nr_codec}
static struct msm_adspdec_info dec_info_list[] = {
DEC_INFO("AUDPLAY0TASK", 13, 0, 11), /* <API key> */
#ifdef CONFIG_ARCH_MSM7X25
DEC_INFO("AUDPLAY1TASK", 14, 1, 5), /* <API key> */
DEC_INFO("AUDPLAY2TASK", 15, 2, 5), /* <API key> */
DEC_INFO("AUDPLAY3TASK", 16, 3, 0), /* <API key> */
DEC_INFO("AUDPLAY4TASK", 17, 4, 0), /* <API key> */
#else
DEC_INFO("AUDPLAY1TASK", 14, 1, 11), /* <API key> */
DEC_INFO("AUDPLAY2TASK", 15, 2, 11), /* <API key> */
DEC_INFO("AUDPLAY3TASK", 16, 3, 11), /* <API key> */
DEC_INFO("AUDPLAY4TASK", 17, 4, 1), /* <API key> */
#endif
};
static struct <API key> <API key> = {
.num_dec = ARRAY_SIZE(dec_info_list),
.<API key> = (ARRAY_SIZE(<API key>) / \
ARRAY_SIZE(dec_info_list)),
.<API key> = <API key>,
.dec_info_list = dec_info_list,
};
static struct platform_device msm_device_adspdec = {
.name = "msm_adspdec",
.id = -1,
.dev = {
.platform_data = &<API key>
},
};
static struct <API key> <API key> = {
.name = <API key>,
/* if no allocator_type, defaults to <API key>,
* the only valid choice at this time. The board structure is
* set to all zeros by the C runtime initialization and that is now
* the enum value of <API key>, now forced to 0 in
* include/linux/android_pmem.h.
*/
.cached = 0,
};
static struct <API key> android_pmem_pdata = {
.name = "pmem",
.allocator_type = <API key>,
.cached = 1,
};
static struct <API key> <API key> = {
.name = "pmem_adsp",
.allocator_type = <API key>,
.cached = 0,
};
static struct <API key> <API key> = {
.name = "pmem_audio",
.allocator_type = <API key>,
.cached = 0,
};
static struct platform_device android_pmem_device = {
.name = "android_pmem",
.id = 0,
.dev = { .platform_data = &android_pmem_pdata },
};
static struct platform_device <API key> = {
.name = "android_pmem",
.id = 1,
.dev = { .platform_data = &<API key> },
};
static struct platform_device <API key> = {
.name = "android_pmem",
.id = 2,
.dev = { .platform_data = &<API key> },
};
static struct platform_device <API key> = {
.name = "android_pmem",
.id = 4,
.dev = { .platform_data = &<API key> },
};
static struct <API key> hs_platform_data = {
.hs_name = "7k_handset",
.pwr_key_delay_ms = 500, /* 0 will disable end key */
};
static struct platform_device hs_device = {
.name = "msm-handset",
.id = -1,
.dev = {
.platform_data = &hs_platform_data,
},
};
#define LCDC_CONFIG_PROC 21
#define LCDC_UN_CONFIG_PROC 22
#define LCDC_API_PROG 0x30000066
#define LCDC_API_VERS 0x00010001
#define GPIO_OUT_132 132
#define GPIO_OUT_131 131
#if defined(<API key>)
#define GPIO_OUT_103 102
#else
#define GPIO_OUT_103 103
#endif
#define GPIO_OUT_122 122
#define GPIO_OUT_101 101
static struct msm_rpc_endpoint *lcdc_ep;
static int msm_fb_lcdc_config(int on)
{
int rc = 0;
struct rpc_request_hdr hdr;
// for avoiding potential rpc error
return 0;
if (on)
pr_info("lcdc config\n");
else
pr_info("lcdc un-config\n");
lcdc_ep = <API key>(LCDC_API_PROG, LCDC_API_VERS, 0);
if (IS_ERR(lcdc_ep)) {
printk(KERN_ERR "%s: msm_rpc_connect failed! rc = %ld\n",
__func__, PTR_ERR(lcdc_ep));
return -EINVAL;
}
rc = msm_rpc_call(lcdc_ep,
(on) ? LCDC_CONFIG_PROC : LCDC_UN_CONFIG_PROC,
&hdr, sizeof(hdr),
5 * HZ);
if (rc)
printk(KERN_ERR
"%s: msm_rpc_call failed! rc = %d\n", __func__, rc);
msm_rpc_close(lcdc_ep);
return rc;
}
static int gpio_array_num[] = {
GPIO_OUT_132, /* spi_clk */
GPIO_OUT_131, /* spi_cs */
GPIO_OUT_103, /* spi_sdi */
GPIO_OUT_122, /* lcd_en */
GPIO_OUT_101, /* lcd_reset */
};
static void <API key>(void)
{
if (gpio_request(GPIO_OUT_132, "spi_clk"))
pr_err("failed to request gpio spi_clk\n");
if (gpio_request(GPIO_OUT_131, "spi_cs"))
pr_err("failed to request gpio spi_cs\n");
if (gpio_request(GPIO_OUT_103, "spi_sdi"))
pr_err("failed to request gpio spi_sdi\n");
// if (gpio_request(GPIO_OUT_122, "lcd_en"))
// pr_err("failed to request gpio lcd_en\n");
if (gpio_request(GPIO_OUT_101, "lcd_reset"))
pr_err("failed to request gpio lcd_reset\n");
}
static uint32_t lcdc_gpio_table[] = {
GPIO_CFG(GPIO_OUT_132, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
GPIO_CFG(GPIO_OUT_131, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
GPIO_CFG(GPIO_OUT_103, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
// GPIO_CFG(GPIO_OUT_122, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
GPIO_CFG(GPIO_OUT_101, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
};
static void <API key>(uint32_t *table, int len, unsigned enable)
{
int n, rc;
/* 20100823 hongkuk.son */
#if 0
// for avoiding potential rpc error
return;
#endif
for (n = 0; n < len; n++) {
rc = gpio_tlmm_config(table[n],
enable ? GPIO_CFG_ENABLE : GPIO_CFG_DISABLE);
if (rc) {
printk(KERN_ERR "%s: gpio_tlmm_config(%#x)=%d\n",
__func__, table[n], rc);
break;
}
}
}
#if defined(<API key>)
static void <API key>(int enable)
{
<API key>(lcdc_gpio_table,
ARRAY_SIZE(lcdc_gpio_table), enable);
}
#endif
static char *msm_fb_lcdc_vreg[] = {
"ldo3",
};
#define MSM_FB_LCDC_VREG_OP(name, op) \
do { \
vreg = vreg_get(0, name); \
if (vreg_##op(vreg)) \
printk(KERN_ERR "%s: %s vreg operation failed \n", \
(vreg_##op == vreg_enable) ? "vreg_enable" \
: "vreg_disable", name); \
} while (0)
static int <API key>(int on)
{
struct vreg *vreg;
int i;
printk(KERN_DEBUG "[%s] SET:%d\n", __func__, on);
for (i = 0; i < ARRAY_SIZE(msm_fb_lcdc_vreg); i++) {
if (on) {
MSM_FB_LCDC_VREG_OP(msm_fb_lcdc_vreg[i], enable);
vreg_set_level(vreg, OUT3000mV);
}
else{
MSM_FB_LCDC_VREG_OP(msm_fb_lcdc_vreg[i], disable);
// for avoiding potential rpc error
//gpio_tlmm_config(GPIO_CFG(GPIO_OUT_101, 0,
//GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
/* 20100823 hongkuk.son */
gpio_tlmm_config(GPIO_CFG(GPIO_OUT_101, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
gpio_set_value(101, 0);
mdelay(15);
gpio_set_value(101, 1);
mdelay(15);
}
}
return 0;
}
static struct lcdc_platform_data lcdc_pdata = {
.lcdc_gpio_config = msm_fb_lcdc_config,
.lcdc_power_save = <API key>,
};
#if defined(<API key>)
static struct <API key> <API key> = {
.panel_config_gpio = <API key>,
.gpio_num = gpio_array_num,
};
static struct platform_device <API key> = {
.name = "lcdc_s6d04m0_qvga",
.id = 0,
.dev = {
.platform_data = &<API key>,
}
};
#endif
#if defined(<API key>)
static void <API key>(int enable)
{
<API key>(lcdc_gpio_table,
ARRAY_SIZE(lcdc_gpio_table), enable);
}
static struct <API key> <API key> = {
.panel_config_gpio = <API key>,
.gpio_num = gpio_array_num,
};
static struct platform_device <API key> = {
.name = "lcdc_ta8566_wqvga",
.id = 0,
.dev = {
.platform_data = &<API key>,
}
};
#endif
/* 20100823 hongkuk.son */
#if defined(<API key>)
static void <API key>(int enable)
{
<API key>(lcdc_gpio_table,
ARRAY_SIZE(lcdc_gpio_table), enable);
}
static struct <API key> <API key> = {
.panel_config_gpio = <API key>,
.gpio_num = gpio_array_num,
};
static struct platform_device <API key> = {
.name = "lcdc_s6d04h0a_qvga",
.id = 0,
.dev = {
.platform_data = &<API key>,
}
};
#endif
#if defined(<API key>)
static void <API key>(int enable)
{
<API key>(lcdc_gpio_table,
ARRAY_SIZE(lcdc_gpio_table), enable);
}
static struct <API key> <API key> = {
.panel_config_gpio = <API key>,
.gpio_num = gpio_array_num,
};
static struct platform_device <API key> = {
.name = "lcdc_s6d04d1_wqvga",
.id = 0,
.dev = {
.platform_data = &<API key>,
}
};
#endif
#if defined(<API key>)
static void <API key>(int enable)
{
<API key>(lcdc_gpio_table,
ARRAY_SIZE(lcdc_gpio_table), enable);
}
static struct <API key> <API key> = {
.panel_config_gpio = <API key>,
.gpio_num = gpio_array_num,
};
static struct platform_device <API key> = {
.name = "lcdc_ili9341_qvga",
.id = 0,
.dev = {
.platform_data = &<API key>,
}
};
#endif
static struct resource msm_fb_resources[] = {
{
.flags = IORESOURCE_DMA,
}
};
static int msm_fb_detect_panel(const char *name)
{
int ret = -EPERM;
// if (<API key>() || <API key>()) {
// if (!strcmp(name, "lcdc_gordon_vga"))
#if defined(<API key>)
if (!strcmp(name, "lcdc_s6d04m0_qvga"))
ret = 0;
else
ret = -ENODEV;
#endif
#if defined(<API key>)
if (!strcmp(name, "lcdc_s6d04d1_wqvga"))
ret = 0;
else
ret = -ENODEV;
#endif
#if defined(<API key>)
if (!strcmp(name, "lcdc_ta8566_wqvga"))
ret = 0;
else
ret = -ENODEV;
#endif
/* 20100823 hongkuk.son */
#if defined(<API key>)
if (!strcmp(name, "lcdc_s6d16a0x_hvga"))
ret = 0;
else
ret = -ENODEV;
#endif
return ret;
}
static struct <API key> msm_fb_pdata = {
.detect_client = msm_fb_detect_panel,
.mddi_prescan = 1,
};
static struct platform_device msm_fb_device = {
.name = "msm_fb",
.id = 0,
.num_resources = ARRAY_SIZE(msm_fb_resources),
.resource = msm_fb_resources,
.dev = {
.platform_data = &msm_fb_pdata,
}
};
//sec: sm.kim
static void keypad_gpio_control(struct platform_device *pdev)
{
int i, ret;
struct <API key> *p = (struct <API key> *)pdev->dev.platform_data;
struct gpio_event_info *info = (struct gpio_event_info *)p->info;
struct <API key> *minfo = (struct <API key> *)container_of(info, struct <API key>, info);
/*
for(i=0; i<minfo->noutputs; i++)
{
int config = GPIO_CFG(minfo->output_gpios[i], 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA);
ret = gpio_tlmm_config(config, GPIO_ENABLE);
if (ret)
printk(KERN_ERR "%s: gpio_tlmm_config(%#x)=%d\n", __func__, minfo->output_gpios[i], ret);
}
*/
for(i=0; i<minfo->ninputs; i++)
{
int config = GPIO_CFG(minfo->input_gpios[i], 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA);
ret = gpio_tlmm_config(config, GPIO_CFG_ENABLE);
if (ret)
printk(KERN_ERR "%s: gpio_tlmm_config(%#x)=%d\n", __func__, minfo->output_gpios[i], ret);
}
}
#ifdef CONFIG_BT
static struct platform_device msm_bt_power_device = {
.name = "bt_power",
};
enum {
BT_WAKE,
BT_RFR,
BT_CTS,
BT_RX,
BT_TX,
BT_PCM_DOUT,
BT_PCM_DIN,
BT_PCM_SYNC,
BT_PCM_CLK,
BT_HOST_WAKE,
};
static unsigned bt_config_power_on[] = {
GPIO_CFG(43, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* RFR */
GPIO_CFG(44, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* CTS */
GPIO_CFG(45, 2, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
GPIO_CFG(46, 3, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
// GPIO_CFG(68, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* PCM_DOUT */
// GPIO_CFG(69, 1, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* PCM_DIN */
// GPIO_CFG(70, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* PCM_SYNC */
// GPIO_CFG(71, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* PCM_CLK */
};
static unsigned bt_config_power_off[] = {
GPIO_CFG(43, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* RFR */
GPIO_CFG(44, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CTS */
GPIO_CFG(45, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
GPIO_CFG(46, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA),
// GPIO_CFG(68, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* PCM_DOUT */
// GPIO_CFG(69, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* PCM_DIN */
// GPIO_CFG(70, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* PCM_SYNC */
// GPIO_CFG(71, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* PCM_CLK */
};
void wlan_setup_clock(int on);
extern int bluesleep_start(void);
extern void bluesleep_stop(void);
#if defined(CONFIG_MACH_TASS)
static void <API key>(int on)
{
struct vreg *vreg_bt_2_6v;
vreg_bt_2_6v = vreg_get(NULL, "ldo14");
if (IS_ERR(vreg_bt_2_6v)) {
printk(KERN_ERR "%s: vreg get failed (%ld)\n",
__func__, PTR_ERR(vreg_bt_2_6v));
return;
}
printk("%s %s --enter\n", __func__, on ? "on" : "down");
if (on) {
vreg_set_level(vreg_bt_2_6v, OUT2600mV);
vreg_enable(vreg_bt_2_6v);
/* additional delay for power on */
//mdelay(20);
}
else
{
/* power off for sleep current */
vreg_disable(vreg_bt_2_6v);
}
}
#endif
static int bluetooth_power(int on)
{
int pin, rc;
printk("%s %s --enter\n", __func__, on ? "on" : "down");
if (on) {
/* If WiFi isn't working,
we should turn on the power for the clock supplied to BT */
if (gpio_get_value(gpio_wlan_reset_n) == 0)
wlan_setup_clock(1);
for (pin = 0; pin < ARRAY_SIZE(bt_config_power_on); pin++) {
rc = gpio_tlmm_config(bt_config_power_on[pin],
GPIO_CFG_ENABLE);
if (rc) {
printk(KERN_ERR
"%s: gpio_tlmm_config(%#x)=%d\n",
__func__, bt_config_power_on[pin], rc);
return -EIO;
}
}
#if defined(CONFIG_MACH_TASS)
<API key>(1); //jh8181.choi
#endif
gpio_tlmm_config(GPIO_CFG(BT_PWR,0,GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
GPIO_CFG_16MA), GPIO_CFG_ENABLE);
gpio_set_value(BT_PWR, 1);
mdelay(100);
bluesleep_start();
}
else {
bluesleep_stop();
gpio_set_value(BT_PWR, 0); /* BT_VREG_CTL */
if (gpio_get_value(gpio_wlan_reset_n) == 0)
wlan_setup_clock(0);
for (pin = 0; pin < ARRAY_SIZE(bt_config_power_off); pin++) {
#if 0 /* FIXME */
rc = gpio_tlmm_config(bt_config_power_off[pin],
GPIO_CFG_ENABLE);
if (rc) {
printk(KERN_ERR
"%s: gpio_tlmm_config(%#x)=%d\n",
__func__, bt_config_power_off[pin], rc);
return -EIO;
}
#endif
}
#if defined(CONFIG_MACH_TASS)
<API key>(0); //jh8181.choi
#endif
}
return 0;
}
static void __init <API key>(void)
{
gpio_tlmm_config(GPIO_CFG(BT_PWR,0,GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
<API key>(1);
mdelay(10);
gpio_set_value(BT_PWR, 1);
mdelay(110);
gpio_set_value(BT_PWR, 0);
mdelay(10);
<API key>(0);
mdelay(30);
}
static void __init bt_power_init(void)
{
msm_bt_power_device.dev.platform_data = &bluetooth_power;
}
static struct resource bluesleep_resources[] = {
{
.name = "gpio_host_wake",
.start = 20,
.end = 20,
.flags = IORESOURCE_IO,
},
{
.name = "gpio_ext_wake",
.start = 57,
.end = 57,
.flags = IORESOURCE_IO,
},
{
.name = "host_wake",
.start = MSM_GPIO_TO_INT(20),
.end = MSM_GPIO_TO_INT(20),
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device <API key> = {
.name = "bluesleep",
.id = -1,
.num_resources = ARRAY_SIZE(bluesleep_resources),
.resource = bluesleep_resources,
};
#else
#define bt_power_init(x) do {} while (0)
#endif
#ifdef CONFIG_ARCH_MSM7X27
static struct resource kgsl_resources[] = {
{
.name = "kgsl_reg_memory",
.start = 0xA0000000,
.end = 0xA001ffff,
.flags = IORESOURCE_MEM,
},
{
.name = "kgsl_yamato_irq",
.start = INT_GRAPHICS,
.end = INT_GRAPHICS,
.flags = IORESOURCE_IRQ,
},
};
static struct kgsl_platform_data kgsl_pdata;
static struct platform_device msm_device_kgsl = {
.name = "kgsl",
.id = -1,
.num_resources = ARRAY_SIZE(kgsl_resources),
.resource = kgsl_resources,
.dev = {
.platform_data = &kgsl_pdata,
},
};
#endif
static struct platform_device <API key> = {
.name = "pmic-leds",
.id = -1,
};
static struct i2c_board_info i2c_devices[] = {
#ifdef CONFIG_SR200PC10 //PCAM
{
I2C_BOARD_INFO("sr200pc10", 0x40>>1),
},
#endif
#ifdef CONFIG_S5K5CCFF //PCAM
{
I2C_BOARD_INFO("s5k5ccff", 0x5A>>1),
},
#endif
#ifdef CONFIG_S5K5CAFF //PGH
{
I2C_BOARD_INFO("s5k5caff", 0x5A>>1),
},
#endif
#ifdef CONFIG_S5K5CA //PGH
{
I2C_BOARD_INFO("s5k5ca", 0x5A>>1),
},
#endif
#ifdef CONFIG_ISX006
{
I2C_BOARD_INFO("isx006", 0x1A),
},
#endif
#ifdef CONFIG_S5K4ECGX
{
I2C_BOARD_INFO("s5k4ecgx", 0x5A>>1),
},
#endif
};
static struct i2c_board_info touch_i2c_devices[] = {
#if defined <API key>
{
I2C_BOARD_INFO("silabs-f760", 0x20),
.irq = MSM_GPIO_TO_INT( TSP_INT ),
},
#endif
#if defined <API key>
{
I2C_BOARD_INFO("synaptics-rmi-ts", 0x48),
.irq = MSM_GPIO_TO_INT( TSP_INT ),
},
#endif
#if defined <API key>
{
I2C_BOARD_INFO("synaptics-rmi-ts", TSP_I2C_ADDR),
.irq = MSM_GPIO_TO_INT( TSP_INT ),
},
#endif
#if defined <API key>
{
I2C_BOARD_INFO("qt602240-ts", 0x4A),
.irq = MSM_GPIO_TO_INT( TSP_INT ),
},
#endif
};
static struct i2c_board_info mus_i2c_devices[] = {
{
I2C_BOARD_INFO("fsa9280",0x4A>>1),
},
};
#if defined(<API key>)
static struct i2c_board_info acc_i2c_devices[] = {
{ I2C_BOARD_INFO("bma_accel",bma222_I2C_ADDR),
// .irq = MSM_GPIO_TO_INT( ACC_INT ),
},
};
#endif
#if defined (<API key>) //twkim add mmc328x magnetic driver
static struct i2c_board_info mag_i2c_devices[] = {
{
I2C_BOARD_INFO("mmc328x", 0x30),
},
};
#endif
#ifdef <API key>
static struct <API key> akm8975_pdata = {
.gpio_data_ready_int = 37, //<API key>(PM8058_GPIO(33)),
//gpio_data_ready_int = PM8058_GPIO_IRQ(PM8058_IRQ_BASE, 33),
};
static struct i2c_board_info mag_i2c_devices[] = {
{
I2C_BOARD_INFO("ak8975", 0x0C),
.platform_data = &akm8975_pdata,
},
};
#endif
#ifdef <API key>
static struct i2c_board_info mag_i2c_devices[] = {
{ I2C_BOARD_INFO(MMC31XX_I2C_NAME, MMC31XX_I2C_ADDR),
// .irq = MSM_GPIO_TO_INT( MAG_INT ),
},
};
#endif
#if defined (CONFIG_SENSORS_GP2A)
static struct i2c_board_info prox_i2c_devices[] = {
{
I2C_BOARD_INFO("gp2a", 0x44),
.irq = MSM_GPIO_TO_INT( PROX_INT ),
},
};
#endif
#ifdef CONFIG_SENSORS_TAOS
static struct i2c_board_info prox_i2c_devices[] = {
{ I2C_BOARD_INFO("taos",0x39),
.irq = MSM_GPIO_TO_INT( PROX_INT ),
},
};
#endif
#ifdef CONFIG_MSM_CAMERA
static uint32_t <API key>[] = {
/* parallel CAMERA interfaces */
GPIO_CFG(0, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_8MA), /* nCAM_3M_RST */
GPIO_CFG(1, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_3M_STBY*/
GPIO_CFG(2, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_EN */
GPIO_CFG(3, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_IO */
GPIO_CFG(4, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT0 */
GPIO_CFG(5, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT1 */
GPIO_CFG(6, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT2 */
GPIO_CFG(7, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT7 */
GPIO_CFG(8, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT8 */
GPIO_CFG(9, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT9 */
GPIO_CFG(10, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT10 */
GPIO_CFG(11, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT11 */
GPIO_CFG(12, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* PCLK */
GPIO_CFG(13, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* HSYNC_IN */
GPIO_CFG(14, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* VSYNC_IN */
GPIO_CFG(15, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), /* MCLK */
};
static uint32_t <API key>[] = {
/* parallel CAMERA interfaces */
GPIO_CFG(0, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), /* nCAM_3M_RST */
GPIO_CFG(1, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_3M_STBY */
GPIO_CFG(2, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_EN */
GPIO_CFG(3, 0, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* CAM_IO*/
GPIO_CFG(4, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT0 */
GPIO_CFG(5, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT1 */
GPIO_CFG(6, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT2 */
GPIO_CFG(7, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT7 */
GPIO_CFG(8, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT8 */
GPIO_CFG(9, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT9 */
GPIO_CFG(10, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT10 */
GPIO_CFG(11, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* DAT11 */
GPIO_CFG(12, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), /* PCLK */
GPIO_CFG(13, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* HSYNC_IN */
GPIO_CFG(14, 1, GPIO_CFG_INPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA), /* VSYNC_IN */
GPIO_CFG(15, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), /* MCLK */
// GPIO_CFG(60, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_CFG_16MA), /* SCL */
// GPIO_CFG(61, 1, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_CFG_16MA), /* SDA */
};
static void config_gpio_table(uint32_t *table, int len)
{
int n, rc;
for (n = 0; n < len; n++) {
rc = gpio_tlmm_config(table[n], GPIO_CFG_ENABLE);
if (rc) {
printk(KERN_ERR "%s: gpio_tlmm_config(%#x)=%d\n",
__func__, table[n], rc);
break;
}
}
}
static struct vreg *vreg_gp2;
static struct vreg *vreg_gp3;
static void <API key>(int vreg_en)
{
int rc;
if (vreg_gp2 == NULL) {
vreg_gp2 = vreg_get(NULL, "gp2");
if (IS_ERR(vreg_gp2)) {
printk(KERN_ERR "%s: vreg_get(%s) failed (%ld)\n",
__func__, "gp2", PTR_ERR(vreg_gp2));
return;
}
rc = vreg_set_level(vreg_gp2, 1800);
if (rc) {
printk(KERN_ERR "%s: GP2 set_level failed (%d)\n",
__func__, rc);
}
}
if (vreg_gp3 == NULL) {
vreg_gp3 = vreg_get(NULL, "gp3");
if (IS_ERR(vreg_gp3)) {
printk(KERN_ERR "%s: vreg_get(%s) failed (%ld)\n",
__func__, "gp3", PTR_ERR(vreg_gp3));
return;
}
rc = vreg_set_level(vreg_gp3, 2850);
if (rc) {
printk(KERN_ERR "%s: GP3 set level failed (%d)\n",
__func__, rc);
}
}
if (vreg_en) {
rc = vreg_enable(vreg_gp2);
if (rc) {
printk(KERN_ERR "%s: GP2 enable failed (%d)\n",
__func__, rc);
}
rc = vreg_enable(vreg_gp3);
if (rc) {
printk(KERN_ERR "%s: GP3 enable failed (%d)\n",
__func__, rc);
}
} else {
rc = vreg_disable(vreg_gp2);
if (rc) {
printk(KERN_ERR "%s: GP2 disable failed (%d)\n",
__func__, rc);
}
rc = vreg_disable(vreg_gp3);
if (rc) {
printk(KERN_ERR "%s: GP3 disable failed (%d)\n",
__func__, rc);
}
}
}
static int <API key>(void)
{
int vreg_en = 1;
printk("%s --enter\n", __func__);
if (<API key>() ||
<API key>())
<API key>(vreg_en);
config_gpio_table(<API key>,
ARRAY_SIZE(<API key>));
return 0;
}
static void <API key>(void)
{
int vreg_en = 0;
if (<API key>() ||
<API key>())
<API key>(vreg_en);
config_gpio_table(<API key>,
ARRAY_SIZE(<API key>));
}
static struct <API key> <API key> = {
.camera_gpio_on = <API key>,
.camera_gpio_off = <API key>,
.ioext.mdcphy = MSM_MDC_PHYS,
.ioext.mdcsz = MSM_MDC_SIZE,
.ioext.appphy = MSM_CLK_CTL_PHYS,
.ioext.appsz = MSM_CLK_CTL_SIZE,
};
static struct <API key> msm_flash_src = {
.flash_sr_type = <API key>,
._fsrc.pmic_src.low_current = 30,
._fsrc.pmic_src.high_current = 100,
};
#ifdef CONFIG_S5K5CCFF //PGH
static struct <API key> flash_s5k5ccff = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k5ccff",
.sensor_reset = 0,
// .sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k5ccff
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k5ccff",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_S5K5CAFF //PGH
static struct <API key> flash_s5k5caff = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k5caff",
.sensor_reset = 0,
// .sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k5caff
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k5caff",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_S5K5CA //PGH
static struct <API key> flash_s5k5ca = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k5ca",
.sensor_reset = 0,
// .sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k5ca
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k5ca",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_ISX006
static struct <API key> flash_isx006 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "isx006",
.sensor_reset = 0,
.sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_isx006
};
static struct platform_device <API key> = {
.name = "msm_camera_isx006",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_S5K4ECGX
static struct <API key> flash_s5k4ecgx = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k4ecgx",
.sensor_reset = 0,
.sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k4ecgx
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k4ecgx",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_SR200PC10 //PGH
static struct <API key> flash_sr200pc10 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "sr200pc10",
.sensor_reset = 0,
// .sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_sr200pc10
};
static struct platform_device <API key> = {
.name = "<API key>",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_S5K4CA //PGH
static struct <API key> flash_s5k4ca = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k4ca",
.sensor_reset = 0,
.sensor_pwd = 107,
.vcm_pwd = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k4ca
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k4ca",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_MT9D112
static struct <API key> flash_mt9d112 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "mt9d112",
.sensor_reset = 89,
.sensor_pwd = 85,
.vcm_pwd = 0,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_mt9d112
};
static struct platform_device <API key> = {
.name = "msm_camera_mt9d112",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_S5K3E2FX
static struct <API key> flash_s5k3e2fx = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "s5k3e2fx",
.sensor_reset = 89,
.sensor_pwd = 85,
.vcm_pwd = 0,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_s5k3e2fx
};
static struct platform_device <API key> = {
.name = "msm_camera_s5k3e2fx",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_MT9P012
static struct <API key> flash_mt9p012 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "mt9p012",
.sensor_reset = 89,
.sensor_pwd = 85,
.vcm_pwd = 88,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_mt9p012
};
static struct platform_device <API key> = {
.name = "msm_camera_mt9p012",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_MT9P012_KM
static struct <API key> flash_mt9p012_km = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "mt9p012_km",
.sensor_reset = 89,
.sensor_pwd = 85,
.vcm_pwd = 88,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_mt9p012_km
};
static struct platform_device <API key> = {
.name = "<API key>",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_MT9T013
static struct <API key> flash_mt9t013 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "mt9t013",
.sensor_reset = 89,
.sensor_pwd = 85,
.vcm_pwd = 0,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_mt9t013
};
static struct platform_device <API key> = {
.name = "msm_camera_mt9t013",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#ifdef CONFIG_VB6801
static struct <API key> flash_vb6801 = {
.flash_type = <API key>,
.flash_src = &msm_flash_src
};
static struct <API key> <API key> = {
.sensor_name = "vb6801",
.sensor_reset = 89,
.sensor_pwd = 88,
.vcm_pwd = 0,
.vcm_enable = 0,
.pdata = &<API key>,
.flash_data = &flash_vb6801
};
static struct platform_device <API key> = {
.name = "msm_camera_vb6801",
.dev = {
.platform_data = &<API key>,
},
};
#endif
#endif
static u32 <API key>(u32 current_voltage);
static struct msm_psy_batt_pdata msm_psy_batt_data = {
.voltage_min_design = 2800,
.voltage_max_design = 4300,
.avail_chg_sources = AC_CHG | USB_CHG ,
.batt_technology = <API key>,
.calculate_capacity = &<API key>,
};
static u32 <API key>(u32 current_voltage)
{
u32 low_voltage = msm_psy_batt_data.voltage_min_design;
u32 high_voltage = msm_psy_batt_data.voltage_max_design;
return (current_voltage - low_voltage) * 100
/ (high_voltage - low_voltage);
}
static struct platform_device msm_vibrator_device = {
.name = "msm_vibrator",
.id = -1,
};
static struct platform_device msm_batt_device = {
.name = "msm-battery",
.id = -1,
.dev.platform_data = &msm_psy_batt_data,
};
static struct <API key> touch_i2c_gpio_data = {
.sda_pin = TSP_SDA,
.scl_pin = TSP_SCL,
};
static struct platform_device <API key> = {
.name = "i2c-gpio",
.id = 2,
.dev = {
.platform_data = &touch_i2c_gpio_data,
},
};
static struct platform_device msm_wlan_pm_device = {
.name = "wlan_ar6000_pm",
.id = -1,
};
static struct <API key> <API key> = {
.sda_pin = 91,
.scl_pin = 90,
};
static struct platform_device <API key> = {
.name = "i2c-gpio",
.id = 3,
.dev = {
.platform_data = &<API key>,
},
};
#if defined(<API key>)
static struct <API key> acc_i2c_gpio_data = {
.sda_pin = ACC_SDA,
.scl_pin = ACC_SCL,
};
static struct platform_device acc_i2c_gpio_device = {
.name = "i2c-gpio",
.id = 4,
.dev = {
.platform_data = &acc_i2c_gpio_data,
},
};
#endif
#ifdef <API key>
#define GEO_SCL 109
#define GEO_SDA 110
static struct <API key> mag_i2c_gpio_data = {
.sda_pin = GEO_SDA,
.scl_pin = GEO_SCL,
.udelay = 5, //// brian :3
};
static struct platform_device mag_i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0x6,
.dev = {
.platform_data = &mag_i2c_gpio_data,
},
};
#endif
#if defined(<API key>) //twkim add mmc328x magnetic driver
#define GEO_SDA 110
#define GEO_SCL 109
static struct <API key> mag_i2c_gpio_data = {
.sda_pin = GEO_SDA,
.scl_pin = GEO_SCL,
.udelay = 3, //// brian :3
.timeout = 100,
};
static struct platform_device mag_i2c_gpio_device = {
.name = "i2c-gpio",
.id = 0x6,
.dev = {
.platform_data = &mag_i2c_gpio_data,
},
};
#endif
#ifdef <API key>
static struct <API key> mag_i2c_gpio_data = {
.sda_pin = MAG_SDA,
.scl_pin = MAG_SCL,
};
static struct platform_device mag_i2c_gpio_device = {
.name = "i2c-gpio",
.id = 6,
.dev = {
.platform_data = &mag_i2c_gpio_data,
},
};
#endif
#if defined(CONFIG_SENSORS_GP2A)
static struct <API key> prox_i2c_gpio_data = {
.sda_pin = PROX_SDA,
.scl_pin = PROX_SCL,
.udelay = 3, //// brian :3
.timeout = 100,
};
static struct platform_device <API key> = {
.name = "i2c-gpio",
.id = 0x5,
.dev = {
.platform_data = &prox_i2c_gpio_data,
},
};
#endif
#ifdef CONFIG_SENSORS_TAOS
static struct <API key> prox_i2c_gpio_data = {
.sda_pin = PROX_SDA,
.scl_pin = PROX_SCL,
};
static struct platform_device <API key> = {
.name = "i2c-gpio",
.id = 5,
.dev = {
.platform_data = &prox_i2c_gpio_data,
},
};
#endif
static struct platform_device *early_devices[] __initdata = {
#ifdef CONFIG_GPIOLIB
&msm_gpio_devices[0],
&msm_gpio_devices[1],
&msm_gpio_devices[2],
&msm_gpio_devices[3],
&msm_gpio_devices[4],
&msm_gpio_devices[5],
#endif
};
static struct platform_device *devices[] __initdata = {
#if !defined(<API key>)
#if !defined(<API key>)
&msm_device_uart3,
#endif
#endif
&msm_device_smd,
&msm_device_dmov,
&msm_device_nand,
#ifdef <API key>
&msm_device_otg,
#ifdef CONFIG_USB_GADGET
&<API key>,
#endif
#endif
#ifdef CONFIG_USB_FUNCTION
&<API key>,
&mass_storage_device,
#endif
#ifdef CONFIG_USB_ANDROID
&<API key>,
&rndis_device,
#ifdef <API key>
&usb_diag_device,
#endif
&android_usb_device,
#endif
&msm_wlan_pm_device,
&msm_device_i2c,
&<API key>,
#if defined(<API key>)
&acc_i2c_gpio_device,
#endif
#if defined(<API key>) || defined(<API key>) || defined(<API key>) //twkim add mmc328x magnetic driver
&mag_i2c_gpio_device,
#endif
#if defined(CONFIG_SENSORS_TAOS) || defined(CONFIG_SENSORS_GP2A)
&<API key>,
#endif
&smc91x_device,
&<API key>,
&android_pmem_device,
&<API key>,
&<API key>,
&msm_fb_device,
#ifdef <API key>
&<API key>,
#endif
#ifdef <API key>
&<API key>,
#endif
&msm_device_uart_dm1,
&msm_device_uart_dm2,
#ifdef CONFIG_BT
&msm_bt_power_device,
&<API key>,
#endif
&<API key>,
&msm_device_snd,
&msm_device_adspdec,
#ifdef CONFIG_ISX006
&<API key>,
#endif
#ifdef CONFIG_S5K4ECGX
&<API key>,
#endif
#ifdef CONFIG_S5K5CCFF //PCAM
&<API key>,
#endif
#ifdef CONFIG_S5K5CA //PCAM
&<API key>,
#endif
#ifdef CONFIG_S5K5CAFF //PCAM
&<API key>,
#endif
#ifdef CONFIG_SR200PC10 //PGH
&<API key>,
#endif
#ifdef CONFIG_S5K4CA //PGH
&<API key>,
#endif
#ifdef CONFIG_MT9T013
&<API key>,
#endif
#ifdef CONFIG_MT9D112
&<API key>,
#endif
#ifdef CONFIG_S5K3E2FX
&<API key>,
#endif
#ifdef CONFIG_MT9P012
&<API key>,
#endif
#ifdef CONFIG_MT9P012_KM
&<API key>,
#endif
#ifdef CONFIG_VB6801
&<API key>,
#endif
#ifdef CONFIG_ARCH_MSM7X27
&msm_device_kgsl,
#endif
&hs_device,
&msm_batt_device,
&msm_vibrator_device,
#ifdef CONFIG_SAMSUNG_JACK
&sec_device_jack,
#endif
};
static struct <API key> mdp_pdata = {
.gpio = 97,
};
static void __init msm_fb_add_devices(void)
{
<API key>("mdp", &mdp_pdata);
<API key>("pmdh", 0);
<API key>("lcdc", &lcdc_pdata);
}
extern struct sys_timer msm_timer;
static void __init msm7x2x_init_irq(void)
{
msm_init_irq();
}
static struct <API key> msm7x2x_clock_data = {
.acpu_switch_time_us = 50,
#ifdef CONFIG_800MHZ
.max_speed_delta_khz = 400000,
#else
.max_speed_delta_khz = 256000,
#endif
.vdd_switch_time_us = 62,
.max_axi_khz = 160000,
};
void <API key>(unsigned int base, int irq,
struct device *clk_device, int signal_irq);
#if (defined(<API key>)\
|| defined(<API key>)\
|| defined(<API key>)\
|| defined(<API key>))
static void sdcc_gpio_init(void)
{
#ifdef <API key>
int rc = 0;
if (gpio_request(49, "sdc1_status_irq"))
pr_err("failed to request gpio sdc1_status_irq\n");
rc = gpio_tlmm_config(GPIO_CFG(49, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
GPIO_CFG_2MA), GPIO_CFG_ENABLE);
if (rc)
printk(KERN_ERR "%s: Failed to configure GPIO %d\n",
__func__, rc);
#endif
/* SDC1 GPIOs */
#ifdef <API key>
if (gpio_request(51, "sdc1_data_3"))
pr_err("failed to request gpio sdc1_data_3\n");
if (gpio_request(52, "sdc1_data_2"))
pr_err("failed to request gpio sdc1_data_2\n");
if (gpio_request(53, "sdc1_data_1"))
pr_err("failed to request gpio sdc1_data_1\n");
if (gpio_request(54, "sdc1_data_0"))
pr_err("failed to request gpio sdc1_data_0\n");
if (gpio_request(55, "sdc1_cmd"))
pr_err("failed to request gpio sdc1_cmd\n");
if (gpio_request(56, "sdc1_clk"))
pr_err("failed to request gpio sdc1_clk\n");
#endif
if (<API key>())
return;
/* SDC2 GPIOs */
#ifdef <API key>
if (gpio_request(62, "sdc2_clk"))
pr_err("failed to request gpio sdc2_clk\n");
if (gpio_request(63, "sdc2_cmd"))
pr_err("failed to request gpio sdc2_cmd\n");
if (gpio_request(64, "sdc2_data_3"))
pr_err("failed to request gpio sdc2_data_3\n");
if (gpio_request(65, "sdc2_data_2"))
pr_err("failed to request gpio sdc2_data_2\n");
if (gpio_request(66, "sdc2_data_1"))
pr_err("failed to request gpio sdc2_data_1\n");
if (gpio_request(67, "sdc2_data_0"))
pr_err("failed to request gpio sdc2_data_0\n");
#endif
if (<API key>())
return;
/* SDC3 GPIOs */
#ifdef <API key>
if (gpio_request(88, "sdc3_clk"))
pr_err("failed to request gpio sdc3_clk\n");
if (gpio_request(89, "sdc3_cmd"))
pr_err("failed to request gpio sdc3_cmd\n");
if (gpio_request(90, "sdc3_data_3"))
pr_err("failed to request gpio sdc3_data_3\n");
if (gpio_request(91, "sdc3_data_2"))
pr_err("failed to request gpio sdc3_data_2\n");
if (gpio_request(92, "sdc3_data_1"))
pr_err("failed to request gpio sdc3_data_1\n");
if (gpio_request(93, "sdc3_data_0"))
pr_err("failed to request gpio sdc3_data_0\n");
#endif
/* SDC4 GPIOs */
#ifdef <API key>
if (gpio_request(19, "sdc4_data_3"))
pr_err("failed to request gpio sdc4_data_3\n");
if (gpio_request(20, "sdc4_data_2"))
pr_err("failed to request gpio sdc4_data_2\n");
if (gpio_request(21, "sdc4_data_1"))
pr_err("failed to request gpio sdc4_data_1\n");
if (gpio_request(107, "sdc4_cmd"))
pr_err("failed to request gpio sdc4_cmd\n");
if (gpio_request(108, "sdc4_data_0"))
pr_err("failed to request gpio sdc4_data_0\n");
if (gpio_request(109, "sdc4_clk"))
pr_err("failed to request gpio sdc4_clk\n");
#endif
}
static unsigned long vreg_sts, gpio_sts;
static struct vreg *vreg_mmc;
static struct vreg *vreg_mmc2;
static unsigned mpp_mmc = 2;
struct sdcc_gpio {
struct msm_gpio *cfg_data;
uint32_t size;
struct msm_gpio *sleep_cfg_data;
};
static struct msm_gpio sdc1_cfg_data[] = {
{GPIO_CFG(51, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc1_dat_3"},
{GPIO_CFG(52, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc1_dat_2"},
{GPIO_CFG(53, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc1_dat_1"},
{GPIO_CFG(54, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc1_dat_0"},
{GPIO_CFG(55, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc1_cmd"},
{GPIO_CFG(56, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_clk"},
};
static struct msm_gpio sdc2_cfg_data[] = {
{GPIO_CFG(62, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc2_clk"},
{GPIO_CFG(63, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_cmd"},
{GPIO_CFG(64, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_3"},
{GPIO_CFG(65, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_2"},
{GPIO_CFG(66, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_1"},
{GPIO_CFG(67, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_0"},
};
static struct msm_gpio sdc2_sleep_cfg_data[] = {
{GPIO_CFG(62, 2, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc2_clk"},
{GPIO_CFG(63, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_cmd"},
{GPIO_CFG(64, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_3"},
{GPIO_CFG(65, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_2"},
{GPIO_CFG(66, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_1"},
{GPIO_CFG(67, 2, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc2_dat_0"},
};
static struct msm_gpio sdc3_cfg_data[] = {
{GPIO_CFG(88, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc3_clk"},
{GPIO_CFG(89, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc3_cmd"},
{GPIO_CFG(90, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc3_dat_3"},
{GPIO_CFG(91, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc3_dat_2"},
{GPIO_CFG(92, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc3_dat_1"},
{GPIO_CFG(93, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc3_dat_0"},
};
static struct msm_gpio sdc4_cfg_data[] = {
{GPIO_CFG(19, 3, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc4_dat_3"},
{GPIO_CFG(20, 3, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc4_dat_2"},
{GPIO_CFG(21, 4, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc4_dat_1"},
{GPIO_CFG(107, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc4_cmd"},
{GPIO_CFG(108, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP, GPIO_CFG_8MA), "sdc4_dat_0"},
{GPIO_CFG(109, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc4_clk"},
};
#if defined(<API key>) && (<API key> >= 0x02) //twkim add proximity sensor driver to totoro_ctc
static void <API key>(void)
{
gpio_tlmm_config(GPIO_CFG(51, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_tlmm_config(GPIO_CFG(52, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_tlmm_config(GPIO_CFG(53, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_tlmm_config(GPIO_CFG(54, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_tlmm_config(GPIO_CFG(55, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_tlmm_config(GPIO_CFG(56, 1, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_8MA), "sdc1_dat_3");
gpio_set_value(51,0);
gpio_set_value(52,0);
gpio_set_value(53,0);
gpio_set_value(54,0);
gpio_set_value(55,0);
gpio_set_value(56,0);
return;
}
static void <API key>(void)
{
int err = 0;
int config_scl, config_sda, config_int;
config_scl = GPIO_CFG(90, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
config_sda = GPIO_CFG(91, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
err = gpio_tlmm_config(config_scl, GPIO_CFG_ENABLE);
if (err)
printk(KERN_ERR "%s: gpio_tlmm_config(90)=%d\n", __func__, err);
err = gpio_tlmm_config(config_sda, GPIO_CFG_ENABLE);
if (err)
printk(KERN_ERR "%s: gpio_tlmm_config(91)=%d\n", __func__, err);
gpio_set_value(90, 0);
gpio_set_value(91, 0);
return;
}
#endif
static struct sdcc_gpio sdcc_cfg_data[] = {
{
.cfg_data = sdc1_cfg_data,
.size = ARRAY_SIZE(sdc1_cfg_data),
.sleep_cfg_data = NULL,
},
{
.cfg_data = sdc2_cfg_data,
.size = ARRAY_SIZE(sdc2_cfg_data),
.sleep_cfg_data = sdc2_sleep_cfg_data,
},
{
.cfg_data = sdc3_cfg_data,
.size = ARRAY_SIZE(sdc3_cfg_data),
.sleep_cfg_data = NULL,
},
{
.cfg_data = sdc4_cfg_data,
.size = ARRAY_SIZE(sdc4_cfg_data),
.sleep_cfg_data = NULL,
},
};
static unsigned long vreg_sts, gpio_sts;
static struct vreg *vreg_mmc;
//static struct vreg *vreg_mmc2; //jino DL13 ..mmc2 doesn't be used in TASS_CTC
static void msm_sdcc_setup_gpio(int dev_id, unsigned int enable)
{
int rc = 0;
struct sdcc_gpio *curr;
curr = &sdcc_cfg_data[dev_id - 1];
if (!(test_bit(dev_id, &gpio_sts)^enable))
return;
if (enable) {
set_bit(dev_id, &gpio_sts);
rc = <API key>(curr->cfg_data, curr->size);
if (rc)
printk(KERN_ERR "%s: Failed to turn on GPIOs for slot %d\n",
__func__, dev_id);
} else {
clear_bit(dev_id, &gpio_sts);
if (curr->sleep_cfg_data) {
msm_gpios_enable(curr->sleep_cfg_data, curr->size);
msm_gpios_free(curr->sleep_cfg_data, curr->size);
return;
}
<API key>(curr->cfg_data, curr->size);
}
}
static uint32_t <API key>(struct device *dv, unsigned int vdd)
{
int rc = 0;
struct platform_device *pdev;
pdev = container_of(dv, struct platform_device, dev);
msm_sdcc_setup_gpio(pdev->id, !!vdd);
if (pdev->id != 1)
return 0;
if (vdd == 0) {
if (!vreg_sts)
return 0;
clear_bit(pdev->id, &vreg_sts);
if (!vreg_sts) {
if (<API key>() ||
<API key>()) {
rc = <API key>(mpp_mmc,
MPP_CFG(MPP_DLOGIC_LVL_MSMP,
<API key>));
} else
{
#if defined(<API key>) && (<API key> >= 0x02) //twkim add proximity sensor driver to totoro_ctc
<API key>();
#endif
rc = vreg_disable(vreg_mmc);
//rc = vreg_disable(vreg_mmc2);
}
if (rc)
printk(KERN_ERR "%s: return val: %d \n",
__func__, rc);
}
mdelay(100);
return 0;
}
if (!vreg_sts) {
if (<API key>() || <API key>()) {
rc = <API key>(mpp_mmc,
MPP_CFG(MPP_DLOGIC_LVL_MSMP,
<API key>));
} else {
rc = vreg_set_level(vreg_mmc, OUT3000mV);
//rc = vreg_set_level(vreg_mmc2, OUT3000mV);
if (!rc)
{
rc = vreg_enable(vreg_mmc);
//rc = vreg_enable(vreg_mmc2);
}
}
if (rc)
printk(KERN_ERR "%s: return val: %d \n",
__func__, rc);
}
set_bit(pdev->id, &vreg_sts);
return 0;
}
#ifdef <API key>
static unsigned int sdcc_slot_status(struct device *dev)
{
int rc;
rc = gpio_get_value( 49 );
rc = rc?0:1 ;
return rc;
}
#endif
#ifndef ATH_POLLING
static void (*<API key>)(int card_present, void *dev_id);
void *wlan_devid;
static int <API key>(void (*callback)(int card_present, void *dev_id), void *dev_id)
{
<API key> = callback;
wlan_devid = dev_id;
return 0;
}
static unsigned int wlan_status(struct device *dev)
{
int rc;
rc = gpio_get_value(gpio_wlan_reset_n);
return rc;
}
#endif /* ATH_POLLING */
#define WLAN_HOST_WAKE
#ifdef WLAN_HOST_WAKE
struct wlansleep_info {
unsigned host_wake;
unsigned host_wake_irq;
struct wake_lock wake_lock;
};
static struct wlansleep_info *wsi;
static struct tasklet_struct hostwake_task;
static void wlan_hostwake_task(unsigned long data)
{
printk(KERN_INFO "WLAN: wake lock timeout 0.5 sec...\n");
wake_lock_timeout(&wsi->wake_lock, HZ / 2);
}
static irqreturn_t wlan_hostwake_isr(int irq, void *dev_id)
{
//<API key>(wsi->host_wake_irq);
/* schedule a tasklet to handle the change in the host wake line */
tasklet_schedule(&hostwake_task);
return IRQ_HANDLED;
}
static int wlan_host_wake_init(void)
{
int ret;
wsi = kzalloc(sizeof(struct wlansleep_info), GFP_KERNEL);
if (!wsi)
return -ENOMEM;
wake_lock_init(&wsi->wake_lock, WAKE_LOCK_SUSPEND, "bluesleep");
tasklet_init(&hostwake_task, wlan_hostwake_task, 0);
wsi->host_wake = 17;
wsi->host_wake_irq = MSM_GPIO_TO_INT(wsi->host_wake);
/*
host_wake_cfg = GPIO_CFG(17, 0, GPIO_CFG_INPUT,
GPIO_CFG_PULL_DOWN, GPIO_CFG_2MA);
ret = gpio_tlmm_config(host_wake_cfg, GPIO_CFG_ENABLE);
if (ret) {
printk(KERN_ERR "%s: gpio_tlmm_config(%#x)=%d\n",
__func__, host_wake_cfg, ret);
}
*/
ret = request_irq(wsi->host_wake_irq, wlan_hostwake_isr,
IRQF_DISABLED | IRQF_TRIGGER_RISING,
"wlan hostwake", NULL);
if (ret < 0) {
printk(KERN_ERR "WLAN: Couldn't acquire WLAN_HOST_WAKE IRQ");
return -1;
}
ret = enable_irq_wake(wsi->host_wake_irq);
if (ret < 0) {
printk(KERN_ERR "WLAN: Couldn't enable WLAN_HOST_WAKE as wakeup interrupt");
free_irq(wsi->host_wake_irq, NULL);
return -1;
}
return 0;
}
static void wlan_host_wake_exit(void)
{
if (disable_irq_wake(wsi->host_wake_irq))
printk(KERN_ERR "WLAN: Couldn't disable hostwake IRQ wakeup mode \n");
free_irq(wsi->host_wake_irq, NULL);
wake_lock_destroy(&wsi->wake_lock);
kfree(wsi);
}
#endif /* WLAN_HOST_WAKE */
void wlan_setup_clock(int on)
{
struct vreg *vwlan_3_3v;
struct vreg *vwlan_1_8v;
vwlan_3_3v = vreg_get(NULL, "ldo13");
if (IS_ERR(vwlan_3_3v)) {
printk(KERN_ERR "%s: vreg get failed (%ld)\n",
__func__, PTR_ERR(vwlan_3_3v));
return;
}
//vwlan_1_8v = vreg_get(NULL, "ldo5");
vwlan_1_8v = vreg_get(NULL, "ldo15"); //jino DL13 VWLAN_1.8V uses ldo15 in TASS_CTC
if (IS_ERR(vwlan_1_8v)) {
printk(KERN_ERR "%s: vreg get failed (%ld)\n",
__func__, PTR_ERR(vwlan_1_8v));
return;
}
printk("%s %s --enter\n", __func__, on ? "on" : "down");
if (on) {
#if defined(<API key>) && (<API key> >= 0x03)
// vreg_set_level(vwlan_3_3v, OUT3300mV);
// vreg_enable(vwlan_3_3v);
gpio_set_value(VDD_WLAN_EN, 1); /* VDD_WLAN_EN */
mdelay(10);
vreg_set_level(vwlan_1_8v, OUT1800mV);
vreg_enable(vwlan_1_8v);
/* additional delay for power on */
mdelay(20);
#else
vreg_set_level(vwlan_3_3v, OUT3300mV);
vreg_enable(vwlan_3_3v);
vreg_set_level(vwlan_1_8v, OUT1800mV);
vreg_enable(vwlan_1_8v);
gpio_set_value(VDD_WLAN_EN, 1); /* VDD_WLAN_EN */
/* additional delay for power on */
mdelay(20);
#endif
}
else
{
#if defined(<API key>) && (<API key> >= 0x03)
// gpio_set_value(VDD_WLAN_EN, 0); /* VDD_WLAN_EN Disable */
/* power off for sleep current */
//vreg_disable(vwlan_3_3v);
vreg_disable(vwlan_1_8v);
#else
gpio_set_value(VDD_WLAN_EN, 0); /* VDD_WLAN_EN Disable */
/* power off for sleep current */
vreg_disable(vwlan_3_3v);
vreg_disable(vwlan_1_8v);
#endif
}
}
void wlan_setup_power(int on, int detect)
{
printk("%s %s --enter\n", __func__, on ? "on" : "down");
if (on) {
if (gpio_get_value(BT_PWR) == 0) {
wlan_setup_clock(1);
mdelay(30);
}
// gpio_tlmm_config(GPIO_CFG(gpio_wlan_reset_n,0,GPIO_CFG_OUTPUT,GPIO_CFG_NO_PULL, GPIO_CFG_16MA),GPIO_CFG_ENABLE); // nextfree.kim 2010-08-24 Wifi oA(AOAE c oA cC OAo)
gpio_set_value(gpio_wlan_reset_n, 1); /* WLAN_RESET */
#ifdef WLAN_HOST_WAKE
wlan_host_wake_init();
#endif /* WLAN_HOST_WAKE */
}
else {
#ifdef WLAN_HOST_WAKE
wlan_host_wake_exit();
#endif /* WLAN_HOST_WAKE */
gpio_set_value(gpio_wlan_reset_n, 0); /* WLAN_RESET */
#if defined(CONFIG_MACH_TASS) /* Atheros */
if (gpio_get_value(BT_PWR) == 0) {
mdelay(30);
wlan_setup_clock(0);
}
#endif /* Atheros */
}
#ifndef ATH_POLLING
mdelay(500);
if (detect) {
/* Detect card */
if (<API key>)
<API key>(on, wlan_devid);
else
printk(KERN_ERR "WLAN: No notify available\n");
}
#endif /* ATH_POLLING */
}
EXPORT_SYMBOL(wlan_setup_power);
#ifdef <API key>
static struct mmc_platform_data msm7x2x_sdc1_data = {
.ocr_mask = MMC_VDD_28_29,
.translate_vdd = <API key>,
.mmc_bus_width = 0, // MMC_CAP_4_BIT_DATA, by china S/W jjuny79.kim because there was the problem about interrrupt from the sd card.
#ifdef <API key>
.status = sdcc_slot_status,
.status_irq = MSM_GPIO_TO_INT(49),
.irq_flags = IRQF_TRIGGER_RISING | <API key>,
#endif
#if 1 /* ATHEROS */
.dummy52_required = 1,
#endif /* ATHEROS */
.msmsdcc_fmin = 144000,
.msmsdcc_fmid = 24576000,
.msmsdcc_fmax = 49152000,
.nonremovable = 0,
};
#endif
#ifdef <API key>
static struct mmc_platform_data msm7x2x_sdc2_data = {
.ocr_mask = MMC_VDD_28_29,
.translate_vdd = <API key>,
.mmc_bus_width = MMC_CAP_4_BIT_DATA,
#ifndef ATH_POLLING
.status = wlan_status,
.<API key> = <API key>,
#endif /* ATH_POLLING */
.dummy52_required = 1,
.msmsdcc_fmin = 144000,
.msmsdcc_fmid = 24576000,
.msmsdcc_fmax = 49152000,
.nonremovable = 0,
};
#endif
#ifdef <API key>
static struct mmc_platform_data msm7x2x_sdc3_data = {
.ocr_mask = MMC_VDD_28_29,
.translate_vdd = <API key>,
.mmc_bus_width = MMC_CAP_4_BIT_DATA,
.msmsdcc_fmin = 144000,
.msmsdcc_fmid = 24576000,
.msmsdcc_fmax = 49152000,
.nonremovable = 0,
};
#endif
#ifdef <API key>
static struct mmc_platform_data msm7x2x_sdc4_data = {
.ocr_mask = MMC_VDD_28_29,
.translate_vdd = <API key>,
.mmc_bus_width = MMC_CAP_4_BIT_DATA,
.msmsdcc_fmin = 144000,
.msmsdcc_fmid = 24576000,
.msmsdcc_fmax = 49152000,
.nonremovable = 0,
};
#endif
static void __init msm7x2x_init_mmc(void)
{
if (!<API key>() && !<API key>()) {
vreg_mmc = vreg_get(NULL, "ldo16");
//vreg_mmc2 = vreg_get(NULL, "ldo15");
if (IS_ERR(vreg_mmc)) {
printk(KERN_ERR "%s: vreg get failed (%ld)\n",
__func__, PTR_ERR(vreg_mmc));
return;
}
}
if (gpio_tlmm_config(GPIO_CFG(VDD_WLAN_EN, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE))
printk (KERN_ERR "Error configuraing VWALN_EN\n");
if (gpio_tlmm_config(GPIO_CFG(gpio_wlan_reset_n, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE))
printk (KERN_ERR "Error configuraing WLAN_RESET_N\n");
if (gpio_tlmm_config(GPIO_CFG(17, 0, GPIO_CFG_INPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA), GPIO_CFG_ENABLE))
printk (KERN_ERR "Error configuraing GPIO_WLAN_HOST_WAKE\n");
#ifdef <API key>
int rc = 0;
if (gpio_request(49, "sdc1_status_irq"))
pr_err("failed to request gpio sdc1_status_irq\n");
rc = gpio_tlmm_config(GPIO_CFG(49, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA), GPIO_CFG_ENABLE);
if (rc)
printk(KERN_ERR "%s: Failed to configure GPIO %d\n",
__func__, rc);
#endif
// sdcc_gpio_init();
#ifdef <API key>
msm_add_sdcc(1, &msm7x2x_sdc1_data);
#endif
if (<API key>() || <API key>() ||
<API key>()) {
#ifdef <API key>
msm_sdcc_setup_gpio(2, 1);
msm_add_sdcc(2, &msm7x2x_sdc2_data);
#endif
}
if (<API key>() || <API key>()) {
#ifdef <API key>
msm_add_sdcc(3, &msm7x2x_sdc3_data);
#endif
#ifdef <API key>
msm_add_sdcc(4, &msm7x2x_sdc4_data);
#endif
}
}
#else
#define msm7x2x_init_mmc() do {} while (0)
#endif
static struct <API key> msm7x25_pm_data[<API key>] = {
[<API key>].latency = 16000,
[<API key>].latency = 12000,
[<API key>].latency = 2000,
};
static struct <API key> msm7x27_pm_data[<API key>] = {
[<API key>].supported = 1,
[<API key>].suspend_enabled = 1,
[<API key>].idle_enabled = 1,
[<API key>].latency = 16000,
[<API key>].residency = 20000,
[<API key>].supported = 1,
[<API key>].suspend_enabled = 1,
[<API key>].idle_enabled = 1,
[<API key>].latency = 12000,
[<API key>].residency = 20000,
[<API key>].supported = 1,
[<API key>].suspend_enabled
= 1,
[<API key>].idle_enabled = 1,
[<API key>].latency = 2000,
[<API key>].residency = 0,
};
static void
msm_i2c_gpio_config(int iface, int config_type)
{
int gpio_scl;
int gpio_sda;
if (iface) {
#if 0
gpio_scl = 95;
gpio_sda = 96;
#endif
return;
} else {
gpio_scl = 60;
gpio_sda = 61;
}
if (config_type) {
gpio_tlmm_config(GPIO_CFG(gpio_scl, 1, GPIO_CFG_INPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
gpio_tlmm_config(GPIO_CFG(gpio_sda, 1, GPIO_CFG_INPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
} else {
gpio_tlmm_config(GPIO_CFG(gpio_scl, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
gpio_tlmm_config(GPIO_CFG(gpio_sda, 0, GPIO_CFG_OUTPUT,
GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
}
}
static struct <API key> msm_i2c_pdata = {
#if 1//PCAM : Fast I2C
.clk_freq = 380000,
#else//ORG : Normal I2C
.clk_freq = 100000,
#endif//PCAM
.rmutex = 0,
.pri_clk = 60,
.pri_dat = 61,
.aux_clk = 95,
.aux_dat = 96,
.msm_i2c_config_gpio = msm_i2c_gpio_config,
};
static void __init msm_device_i2c_init(void)
{
if (gpio_request(60, "i2c_pri_clk"))
pr_err("failed to request gpio i2c_pri_clk\n");
if (gpio_request(61, "i2c_pri_dat"))
pr_err("failed to request gpio i2c_pri_dat\n");
/* for SIM recognization */
#if 0
if (gpio_request(95, "i2c_sec_clk"))
pr_err("failed to request gpio i2c_sec_clk\n");
if (gpio_request(96, "i2c_sec_dat"))
pr_err("failed to request gpio i2c_sec_dat\n");
#endif
if (cpu_is_msm7x27())
msm_i2c_pdata.pm_lat =
msm7x27_pm_data[<API key>]
.latency;
else
msm_i2c_pdata.pm_lat =
msm7x25_pm_data[<API key>]
.latency;
msm_device_i2c.dev.platform_data = &msm_i2c_pdata;
}
static void usb_mpp_init(void)
{
unsigned rc;
unsigned mpp_usb = 7;
if (<API key>() || <API key>()) {
rc = <API key>(mpp_usb,
MPP_CFG(MPP_DLOGIC_LVL_VDD,
<API key>));
if (rc)
pr_err("%s: configuring mpp pin"
"to enable 3.3V LDO failed\n", __func__);
}
}
#if defined(<API key>)
extern int arm9_uses_uart3;
#endif
static void __init msm7x2x_init(void)
{
#ifdef CONFIG_ARCH_MSM7X25
msm_clock_init(msm_clocks_7x25, msm_num_clocks_7x25);
#elif defined(CONFIG_ARCH_MSM7X27)
msm_clock_init(msm_clocks_7x27, msm_num_clocks_7x27);
#endif
#if defined(<API key>)
<API key>(MSM_UART3_PHYS, INT_UART3,
&msm_device_uart3.dev, 1);
#endif
#if defined(CONFIG_SMC91X)
if (<API key>() || <API key>()) {
smc91x_resources[0].start = 0x98000300;
smc91x_resources[0].end = 0x980003ff;
smc91x_resources[1].start = MSM_GPIO_TO_INT(85);
smc91x_resources[1].end = MSM_GPIO_TO_INT(85);
if (gpio_tlmm_config(GPIO_CFG(85, 0,
GPIO_CFG_INPUT,
GPIO_CFG_PULL_DOWN,
GPIO_CFG_2MA),
GPIO_CFG_ENABLE)) {
printk(KERN_ERR
"%s: Err: Config GPIO-85 INT\n",
__func__);
}
}
#endif
if (cpu_is_msm7x27())
msm7x2x_clock_data.max_axi_khz = 200000;
msm_acpu_clock_init(&msm7x2x_clock_data);
#ifdef CONFIG_ARCH_MSM7X27
/* This value has been set to 160000 for power savings. */
/* OEMs may modify the value at their discretion for performance */
/* The appropriate maximum replacement for 160000 is: */
/* clk_get_max_axi_khz() */
kgsl_pdata.high_axi_3d = 160000;
/* 7x27 doesn't allow graphics clocks to be run asynchronously to */
/* the AXI bus */
kgsl_pdata.max_grp2d_freq = 0;
kgsl_pdata.min_grp2d_freq = 0;
kgsl_pdata.set_grp2d_async = NULL;
kgsl_pdata.max_grp3d_freq = 0;
kgsl_pdata.min_grp3d_freq = 0;
kgsl_pdata.set_grp3d_async = NULL;
kgsl_pdata.imem_clk_name = "imem_clk";
kgsl_pdata.grp3d_clk_name = "grp_clk";
kgsl_pdata.grp3d_pclk_name = "grp_pclk";
kgsl_pdata.grp2d0_clk_name = NULL;
kgsl_pdata.idle_timeout_3d = HZ/5;
kgsl_pdata.idle_timeout_2d = 0;
#ifdef <API key>
kgsl_pdata.pt_va_size = SZ_32M;
/* Maximum of 32 concurrent processes */
kgsl_pdata.pt_max_count = 32;
#else
kgsl_pdata.pt_va_size = SZ_128M;
//kgsl_pdata.pt_va_size = SZ_64M;
//kgsl_pdata.pt_va_size = (SZ_128M+SZ_64M);
/* We only ever have one pagetable for everybody */
kgsl_pdata.pt_max_count = 1;
#endif
#endif
usb_mpp_init();
#ifdef CONFIG_USB_FUNCTION
msm_hsusb_pdata.swfi_latency =
msm7x27_pm_data
[<API key>].latency;
<API key>.dev.platform_data = &msm_hsusb_pdata;
#endif
#ifdef <API key>
msm_device_otg.dev.platform_data = &msm_otg_pdata;
if (<API key>() || <API key>()) {
msm_otg_pdata.pemp_level =
<API key>;
msm_otg_pdata.drv_ampl = <API key>;
msm_otg_pdata.cdr_autoreset = <API key>;
msm_otg_pdata.phy_reset = <API key>;
}
if (<API key>() || <API key>()) {
msm_otg_pdata.pemp_level =
<API key>;
msm_otg_pdata.drv_ampl = <API key>;
msm_otg_pdata.cdr_autoreset = <API key>;
msm_otg_pdata.<API key> = 1;
}
#ifdef CONFIG_USB_GADGET
msm_otg_pdata.swfi_latency =
msm7x27_pm_data
[<API key>].latency;
<API key>.dev.platform_data = &msm_gadget_pdata;
msm_gadget_pdata.<API key> = 1;
msm_gadget_pdata.self_powered = 1;
#endif
#endif
#ifdef CONFIG_SAMSUNG_JACK
sec_jack_gpio_init();
#endif
<API key>(devices, ARRAY_SIZE(devices));
#if defined(<API key>)
if ( !arm9_uses_uart3 )
<API key>(&msm_device_uart3);
#endif
printk(KERN_INFO"%s : msm7x2x_init
#ifdef CONFIG_MSM_CAMERA
<API key>(); /* might not be necessary */
#endif
msm_device_i2c_init();
<API key>(0, i2c_devices, ARRAY_SIZE(i2c_devices));
<API key>(2, touch_i2c_devices, ARRAY_SIZE(touch_i2c_devices));
#if defined(<API key>)
<API key>(4, acc_i2c_devices, ARRAY_SIZE(acc_i2c_devices));
#endif
#if defined(CONFIG_SENSORS_TAOS) || defined(CONFIG_SENSORS_GP2A)
<API key>(5, prox_i2c_devices, ARRAY_SIZE(prox_i2c_devices));
#endif
#if defined(<API key>) || defined(<API key>) || defined(<API key>) //twkim add mmc328x magnetic driver
<API key>(6, mag_i2c_devices, ARRAY_SIZE(mag_i2c_devices));
#endif
#if defined(<API key>) && (<API key> >= 0x02) //twkim add proximity sensor driver to totoro_ctc
<API key>();
#endif
#ifdef <API key>
if (<API key>() || <API key>())
<API key>(&<API key>);
else
{
#if 0 //defined(<API key>)
if(board_hw_revision>5)
<API key>(&<API key>);
else
#endif
<API key>(&keypad_device_surf);
}
#endif
//sec: sm.kim
#if 0//defined(<API key>)
if(board_hw_revision>5)
keypad_gpio_control(&<API key>);
else
#endif
keypad_gpio_control(&keypad_device_surf);
<API key>();
msm_fb_add_devices();
#ifdef CONFIG_USB_EHCI_MSM
msm7x2x_init_host();
#endif
msm7x2x_init_mmc();
#ifdef <API key>
<API key>(); //Always turn off after turning on before init BT
#endif
bt_power_init();
if (cpu_is_msm7x27())
<API key>(msm7x27_pm_data,
ARRAY_SIZE(msm7x27_pm_data));
else
<API key>(msm7x25_pm_data,
ARRAY_SIZE(msm7x25_pm_data));
}
static unsigned <API key> = <API key>;
static int __init <API key>(char *p)
{
<API key> = memparse(p, NULL);
return 0;
}
early_param("<API key>", <API key>);
static unsigned pmem_mdp_size = MSM_PMEM_MDP_SIZE;
static int __init pmem_mdp_size_setup(char *p)
{
pmem_mdp_size = memparse(p, NULL);
return 0;
}
early_param("pmem_mdp_size", pmem_mdp_size_setup);
static unsigned pmem_adsp_size = MSM_PMEM_ADSP_SIZE;
static int __init <API key>(char *p)
{
pmem_adsp_size = memparse(p, NULL);
return 0;
}
early_param("pmem_adsp_size", <API key>);
static unsigned pmem_audio_size = MSM_PMEM_AUDIO_SIZE;
static int __init <API key>(char *p)
{
pmem_audio_size = memparse(p, NULL);
return 0;
}
early_param("pmem_audio_size", <API key>);
static unsigned fb_size = MSM_FB_SIZE;
static int __init fb_size_setup(char *p)
{
fb_size = memparse(p, NULL);
return 0;
}
early_param("fb_size", fb_size_setup);
static void __init <API key>(void)
{
void *addr;
unsigned long size;
size = pmem_mdp_size;
if (size) {
addr = alloc_bootmem(size);
android_pmem_pdata.start = __pa(addr);
android_pmem_pdata.size = size;
pr_info("allocating %lu bytes at %p (%lx physical) for mdp "
"pmem arena\n", size, addr, __pa(addr));
}
size = pmem_adsp_size;
if (size) {
addr = alloc_bootmem(size);
<API key>.start = __pa(addr);
<API key>.size = size;
pr_info("allocating %lu bytes at %p (%lx physical) for adsp "
"pmem arena\n", size, addr, __pa(addr));
}
size = MSM_PMEM_AUDIO_SIZE ;
<API key>.start = <API key> ;
<API key>.size = size;
pr_info("allocating %lu bytes (at %lx physical) for audio "
"pmem arena\n", size , <API key>);
size = fb_size ? : MSM_FB_SIZE;
addr = alloc_bootmem(size);
msm_fb_resources[0].start = __pa(addr);
msm_fb_resources[0].end = msm_fb_resources[0].start + size - 1;
pr_info("allocating %lu bytes at %p (%lx physical) for fb\n",
size, addr, __pa(addr));
size = <API key>;
if (size) {
addr = <API key>(size, 0x100000);
<API key>.start = __pa(addr);
<API key>.size = size;
pr_info("allocating %lu bytes at %p (%lx physical) for kernel"
" ebi1 pmem arena\n", size, addr, __pa(addr));
}
}
static void __init msm7x2x_map_io(void)
{
msm_map_common_io();
<API key>();
if (socinfo_init() < 0)
BUG();
#ifdef CONFIG_CACHE_L2X0
if (<API key>() || <API key>()) {
/* 7x27 has 256KB L2 cache:
64Kb/Way and 4-Way Associativity;
evmon/parity/share disabled. */
if ((<API key>(socinfo_get_version()) > 1)
|| ((<API key>(socinfo_get_version()) == 1)
&& (<API key>(socinfo_get_version()) >= 3)))
/* R/W latency: 4 cycles; */
l2x0_init(MSM_L2CC_BASE, 0x0006801B, 0xfe000000);
else
/* R/W latency: 3 cycles; */
l2x0_init(MSM_L2CC_BASE, 0x00068012, 0xfe000000);
}
#endif
}
#ifdef CONFIG_MACH_EUROPA
MACHINE_START(MSM7X27_SURF, "GT-I5500 Board")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END
#endif
#ifdef CONFIG_MACH_TASS
MACHINE_START(MSM7X27_SURF, "GT-S5570 Board")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END
#else
MACHINE_START(MSM7X27_SURF, "GT-I5510 Board")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END
#endif
MACHINE_START(MSM7X27_FFA, "QCT MSM7x27 FFA")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END
MACHINE_START(MSM7X25_SURF, "QCT MSM7x25 SURF")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END
MACHINE_START(MSM7X25_FFA, "QCT MSM7x25 FFA")
#ifdef <API key>
.phys_io = MSM_DEBUG_UART_PHYS,
.io_pg_offst = ((MSM_DEBUG_UART_BASE) >> 18) & 0xfffc,
#endif
.boot_params = PHYS_OFFSET + 0x100,
.map_io = msm7x2x_map_io,
.init_irq = msm7x2x_init_irq,
.init_machine = msm7x2x_init,
.timer = &msm_timer,
MACHINE_END |
#include <iostream>
#include <limits>
#include "ct.hpp"
void prompt_user() {
std::string name;
int sex;
int age;
int height_ft;
int height_in;
int height_cm;
int weight_lb;
int weight_kg;
int exercise_level;
int weight_goal;
float weight_gain_goal;
float weight_lose_goal;
int measurement_system;
std::cout << "-- welcome to calorie tracker --" << std::endl;
std::cout << "what is your name? ";
std::getline(std::cin, name);
std::cout << "sex? ";
std::cin >> sex;
std::cout << "age? ";
std::cin >> age;
std::cout << "measurement system? ";
std::cin >> measurement_system;
std::cout << "exercise level? ";
std::cin >> exercise_level;
std::cout << "weight goal? ";
std::cin >> weight_goal;
ct::user::set_name(name);
ct::user::<API key>(measurement_system);
ct::user::set_age(age);
ct::user::set_sex(sex);
ct::user::set_exercise_level(exercise_level);
ct::user::set_weight_goal(weight_goal);
if (measurement_system == ct::user::imperial) {
std::cout << "height in feet? ";
std::cin >> height_ft;
std::cout << "inches? ";
std::cin >> height_in;
std::cout << "weight in pounds? ";
std::cin >> weight_lb;
if (weight_goal == ct::user::gain_weight) {
std::cout << "weight gain per week (lb)? ";
std::cin >> weight_gain_goal;
ct::user::<API key>(weight_gain_goal);
} else {
std::cout << "weight lose per week (lb)? ";
std::cin >> weight_lose_goal;
ct::user::<API key>(weight_lose_goal);
}
ct::user::set_height(height_ft, height_in);
ct::user::set_weight(weight_lb);
} else {
std::cout << "height in cm? ";
std::cin >> height_cm;
std::cout << "weight in kg? ";
std::cin >> weight_kg;
if (weight_goal == ct::user::gain_weight) {
std::cout << "weight gain per week (kg)? ";
std::cin >> weight_gain_goal;
ct::user::<API key>(weight_gain_goal);
} else {
std::cout << "weight lose per week (kg)? ";
std::cin >> weight_lose_goal;
ct::user::<API key>(weight_lose_goal);
}
ct::user::set_height(height_cm);
ct::user::set_weight(weight_kg);
}
}
void list_meals() {
if (!ct::day::current_day.has_meals()) {
std::cout << "no meals eaten yet today" << std::endl;
return;
}
std::vector<ct::meal::Meal> meals = ct::day::current_day.meals;
for (auto meal : meals) {
std::cout << "
std::cout << "meal name: " << meal.name << std::endl;
std::cout << "total calories: " << meal.calories() << std::endl;
for (auto food : meal.foods) {
std::cout << "food: " << food.name() << std::endl;
std::cout << "servings: " << food.servings << std::endl;
std::cout << "calories: " << food.calories() << std::endl;
}
}
std::cout << "
std::cout << "calories for today: " << ct::day::current_day.calories()
<< " / " << ct::user::calculate_calories() << std::endl;
}
void new_food(std::string name) {
ct::food::FoodInfo info;
info.name = name;
std::cout << "serving size? ";
std::cin >> info[ct::food::serving_size];
std::cout << "calories per serving? ";
std::cin >> info[ct::food::calories];
ct::food::save_food_info(info);
}
void add_meal() {
int num_items = 0;
std::string name;
std::cout << "
std::cout << "how many food items? ";
std::cin >> num_items;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::cout << "what is this meal called? ";
std::getline(std::cin, name);
ct::meal::Meal m;
m.name = name;
for (int i = 0; i < num_items; i++) {
ct::food::FoodItem food;
ct::food::FoodInfo info;
int amount;
std::cout << "name of item? ";
std::getline(std::cin, name);
if (!ct::food::food_info_exists(name)) {
std::cout << "I dont know what that is yet, lets add it" << std::endl;
new_food(name);
}
std::cout << "how many servings you eat? ";
std::cin >> amount;
info = ct::food::known_foods[name];
food.info = info;
food.servings = amount;
m.add_food(food);
}
ct::day::current_day.add_meal(m);
}
void remove_meal() {
std::string name;
std::cout << "name of meal? ";
std::getline(std::cin, name);
}
int main() {
// this is the first thing that gets called for the calorie tracker (ct)
// library, it will initialize everything it needs (see ct.cpp for the
// implementation of this function)
ct::init();
// the ct library will know if the user has never used to program before,
// so if thats the case we need their personal info
if (ct::user::needs_user_data()) {
prompt_user();
ct::user::save();
} else {
std::cout << "welcome back " << ct::user::name << std::endl;
}
// this will just tell the user how many calories they need to eat every day, it
// can throw exception so it is wrapped in a try/catch (see user.cpp for the implementation
// of calculate_calories())
try {
std::cout << "to achieve your goal, you must consume " << ct::user::calculate_calories()
<< " calories every day" << std::endl;
} catch (std::string &s) {
std::cout << s << std::endl;
}
// this will just continue to ask the user what they want to do, its like
// the main menu for the program
int input;
do {
std::cout << "++++++++++++++++++++" << std::endl;
std::cout << "what do now?" << std::endl;
std::cout << "-1: quit" << std::endl;
std::cout << "0: list todays meals" << std::endl;
std::cout << "1: add new meal" << std::endl;
std::cout << "2: remove meal" << std::endl;
std::cout << "> ";
std::cin >> input;
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
if (input == 0) {
list_meals();
} else if (input == 1) {
add_meal();
} else if (input == 2) {
remove_meal();
}
} while (input != -1);
std::cout << "goodbye!" << std::endl;
} |
#include <stdlib.h>
#include <stdio.h>
#include "alloc.h"
#include "error.h"
#include "helper.h"
#include "gpu_util.h"
#include "kernel.h"
#include "timer.h"
// Helper functions
static void print_usage()
{
printf("Usage: [KERNEL=<kernel_no>] %s <dim>\n", program_name);
printf("KERNEL defaults to 0\n");
printf("Available kernels [id:descr]:\n");
int i, j;
for (i = 0; i < ALGO_END; ++i)
for (j = 0; j < KERNEL_END; ++j)
printf("\t%d:%s\n", i*KERNEL_END+j, kernels[i*KERNEL_END+j].descr);
}
int main(int argc, char **argv)
{
set_program_name(argv[0]);
if (argc < 2) {
warning(0, "too few arguments");
print_usage();
exit(EXIT_FAILURE);
}
int N = atoi(argv[1]);
if (!N)
error(0, "invalid argument: %s", argv[1]);
char *kernel_env = getenv("KERNEL");
int kernel_id = 0;
if (kernel_env)
kernel_id = atoi(kernel_env);
// Initialize runtime, so as not to pay the cost at the first call
if (kernel_id > CPU_PARALLEL) {
printf("Initializing CUDA runtime ... ");
fflush(stdout);
gpu_init();
printf("DONE\n");
}
kernel_data_t *data = NULL;
data = data_create_CPU(N);
data_init(data);
#ifndef _NOCHECK
kernel_data_t *check_data = NULL;
check_data = data_create_CPU(N);
data_copy(check_data, data);
kernels[0].fn(check_data);
#endif
// Run and time the selected kernel
printf("Launching kernel: %s\n", kernels[kernel_id].descr);
fflush(stdout);
xtimer_t timer;
timer_clear(&timer);
timer_start(&timer);
kernels[kernel_id].fn(data);
timer_stop(&timer);
report_results(&timer, N*N);
#ifndef _NOCHECK
check_result(data, check_data);
#endif
// Cleanup
data_free_CPU(data);
#ifndef _NOCHECK
data_free_CPU(check_data);
#endif
return EXIT_SUCCESS;
} |
# Original Python:
# from pyx import *
# g = graph.graphxy(width=8)
# g.plot(graph.data.file("errorbar.dat", x=1, y=2, dy=3),
# [graph.style.symbol(), graph.style.errorbar()])
# g.writeEPSfile("errorbar")
# g.writePDFfile("errorbar")
# g.writeSVGfile("errorbar")
using PyX
g = graph.graphxy(width=8)
plot(g, graph_data.file("examples/graphstyles/errorbar.dat", x=1, y=2, dy=3),
[graph_style.symbol(), graph_style.errorbar()])
writeEPSfile(g, "errorbar")
writePDFfile(g, "errorbar") |
#test DHCPLeases() API for libvirt
import os
import json
from libvirt import libvirtError
from libvirttestapi.utils import utils
from libvirttestapi.src import sharedmod
required_params = ('networkname',)
optional_params = {'macaddr': ''}
LEASE_FILE = "/var/lib/libvirt/dnsmasq/"
def check_ip(ipaddr, logger):
"""
return a string according to ip address type, return 'ipv4' for ipv4,
return 'ipv6' for ipv6, return False for others
"""
addr4 = ipaddr.strip().split('.')
addr6 = ipaddr.strip().split(':')
if len(addr4) == 4:
iptype = "ipv4"
elif len(addr6) == 6:
iptype = "ipv6"
else:
return False
return iptype
def get_network_type(ipaddr, logger):
"""
return 0 or 1 for ipv4/ipv6, this function will be used in
check_ipv4_values()/check_ipv6_values()
"""
if check_ip(ipaddr, logger) == "ipv4":
return 0
elif check_ip(ipaddr, logger) == "ipv6":
return 1
def get_bridge_name(network, logger):
"""
get bridge name under specified network from specified network conf
"""
CONF_NETWORK = LEASE_FILE + network + ".conf"
GREP_BRIDGE = "grep \"^interface=\" %s | awk -F\"=\" '{print $2}'"
status, output = utils.exec_cmd(GREP_BRIDGE % CONF_NETWORK, shell=True)
if not status:
pass
else:
logger.error("\"" + GREP_BRIDGE + "\"" + "error")
logger.error(output)
return False
return output[0]
def get_ip_prefix(network, iptype, logger):
"""
get ip prefix according to IP type
"""
br = get_bridge_name(network, logger)
PREFIX = "ip -4 -o ad show %s | awk '{print $4}'|awk -F\"/\" '{print $2}'"
PREFIX_6 = "ip -6 -o ad show %s|awk '{print $4}'|awk -F\"/\" '{print $2}'"
if iptype == "ipv4":
status, output = utils.exec_cmd(PREFIX % br, shell=True)
elif iptype == "ipv6":
status, output = utils.exec_cmd(PREFIX_6 % br, shell=True)
if not status:
pass
else:
if iptype == "ipv4":
logger.error("\"" + PREFIX + "\"" + "error")
if iptype == "ipv6":
logger.error("\"" + PREFIX_6 + "\"" + "error")
logger.error(output)
return False
return output[0]
def <API key>(status_file, logger):
"""
generate info from bridge's status file
"""
f = open(status_file, 'r')
output = json.load(f)
return output
def compare_values(op1, op2, network, iptype, logger):
"""
check all printed values from API
"""
dnsmasq = op1
api = op2
temp = int(api['expirytime'])
api['expirytime'] = temp
for j in range(0, len(dnsmasq)):
if dnsmasq[j]['expiry-time'] == api['expirytime']:
if dnsmasq[j]['mac-address'] == api['mac']:
if dnsmasq[j]['ip-address'] == api['ipaddr']:
logger.info("PASS: mac: %s" % api['mac'])
logger.info("PASS: ip: %s" % api['ipaddr'])
logger.info("PASS: expiry-time: %s" % api['expirytime'])
else:
logger.error("FAIL: ip: %s" % api['ipaddr'])
return False
break
else:
if j == len(dnsmasq) - 1:
logger.error("Last loop %d, FAIL: mac: %s" % (j, api['mac']))
return False
else:
if j == len(dnsmasq) - 1:
logger.error("Last loop %d, FAIL: expirttime: %s" % (j, api['expirttime']))
return False
if not api['type'] == get_network_type(api['ipaddr'], logger):
logger.error("FAIL: type: %s" % api['type'])
return False
else:
logger.info("PASS: type: %s" % api['type'])
if not api['prefix'] == int(get_ip_prefix(network, iptype, logger)):
logger.error("FAIL: prefix: %s" % api['prefix'])
return False
else:
logger.info("PASS: prefix: %s" % api['prefix'])
if iptype == "ipv4":
if not api['iaid'] is None:
logger.error("FAIL: iaid: %s" % api['iaid'])
return False
else:
logger.debug("PASS: unsupported iaid: %s in IPv4" % api['iaid'])
return True
def check_values(op1, op2, networkname, logger):
"""
check each line accorting to ip type, if ipv4 go to check_ipv4_values
if ipv6, go to check_ipv6_values.
"""
dnsmasq = op1
api = op2
for i in range(0, len(api)):
if check_ip(api[i]['ipaddr'], logger) == "ipv4":
if not compare_values(dnsmasq, api[i], networkname, "ipv4", logger):
return False
elif check_ip(api[i]['ipaddr'], logger) == "ipv6":
if not compare_values(dnsmasq, api[i], networkname, "ipv6", logger):
return False
else:
logger.error("invalid list element for ipv4 and ipv6")
return False
return True
def network_dhcp_leases(params):
"""
test API for DHCPLeases in class virNetwork
"""
global LEASE_FILE_DNSMASQ
logger = params['logger']
networkname = params['networkname']
bridgename = get_bridge_name(networkname, logger)
LEASE_FILE_DNSMASQ = "/var/lib/libvirt/dnsmasq/" + bridgename + ".status"
logger.info("Bridge name is %s" % (bridgename))
mac_value = params.get('macaddr', None)
conn = sharedmod.libvirtobj['conn']
logger.info("The given mac is %s" % (mac_value))
if not os.path.exists(LEASE_FILE_DNSMASQ):
logger.error("%s file is not exist." % LEASE_FILE_DNSMASQ)
return 1
file_len = os.stat(LEASE_FILE_DNSMASQ).st_size
if file_len == 0:
dhcp_lease_dns = []
else:
dhcp_lease_dns = <API key>(LEASE_FILE_DNSMASQ, logger)
logger.info("From dnsmasq: %s" % (dhcp_lease_dns))
netobj = conn.networkLookupByName(networkname)
try:
dhcp_lease_api = netobj.DHCPLeases(mac_value, 0)
logger.info("From API: %s" % (dhcp_lease_api))
if not check_values(dhcp_lease_dns, dhcp_lease_api, networkname, logger):
return 1
except libvirtError as e:
logger.error("API error message: %s, error code is %s"
% (e.get_error_message(), e.get_error_code()))
return 1
return 0 |
#include <string.h>
#include <talloc/talloc.h>
#include <url/url.h>
#include "parser.h"
#include "parser-conf.h"
#include "parser-utils.h"
#include "resource.h"
static void pxe_finish(struct conf_context *conf)
{
printf("%s\n", __func__);
<API key>(conf->dc, conf->parser_info);
}
static void pxe_process_pair(struct conf_context *ctx,
const char *name, char *value)
{
struct <API key> *opt = ctx->parser_info;
struct pb_url *url;
if (streq(name, "LABEL")) {
if (opt)
pxe_finish(ctx);
opt = <API key>(ctx->dc, ctx->dc->device);
ctx->parser_info = opt;
opt->option->name = talloc_strdup(opt, value);
opt->option->id = talloc_asprintf(opt, "%s@%p",
ctx->dc->device->device->id, opt);
return;
}
/* all other parameters need an option */
if (!opt)
return;
if (streq(name, "KERNEL")) {
url = pb_url_join(ctx->dc, ctx->dc->conf_url, value);
opt->boot_image = create_url_resource(opt, url);
} else if (streq(name, "APPEND")) {
opt->option->boot_args = talloc_strdup(opt->option, value);
/* todo: initrd extraction */
}
}
static int pxe_parse(struct discover_context *dc, char *buf, int len)
{
struct conf_context *conf;
conf = talloc_zero(dc, struct conf_context);
if (!conf)
return 0;
conf->dc = dc;
conf->get_pair = conf_get_pair_space;
conf->process_pair = pxe_process_pair;
conf->finish = pxe_finish;
conf_parse_buf(conf, buf, len);
talloc_free(conf);
return 1;
}
static struct parser pxe_parser = {
.name = "pxe",
.parse = pxe_parse,
.method = CONF_METHOD_DHCP,
};
register_parser(pxe_parser); |
@import model.TransactionList
@(txns: TransactionList)
@main("Money Analyser") {
<p>blah</p>
@for(t <- txns.transactionList) {
<p>@t.account</p>
}
} |
# The stub may be linked into the kernel proper or into a separate boot binary,
# but in either case, it executes before the kernel does (with MMU disabled) so
# things like ftrace and stack-protector are likely to cause trouble if left
# enabled, even if doing so doesn't break the build.
cflags-$(CONFIG_X86_32) := -march=i386
cflags-$(CONFIG_X86_64) := -mcmodel=small
cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 \
-fPIC -fno-strict-aliasing -mno-red-zone \
-mno-mmx -mno-sse
cflags-$(CONFIG_ARM64) := $(subst -pg,,$(KBUILD_CFLAGS))
cflags-$(CONFIG_ARM) := $(subst -pg,,$(KBUILD_CFLAGS)) \
-fno-builtin -fpic -mno-single-pic-base
cflags-$(CONFIG_EFI_ARMSTUB) += -I$(srctree)/scripts/dtc/libfdt
KBUILD_CFLAGS := $(cflags-y) -<API key> \
$(call cc-option,-ffreestanding) \
$(call cc-option,-fno-stack-protector)
GCOV_PROFILE := n
KASAN_SANITIZE := n
lib-y := efi-stub-helper.o
# include the stub's generic dependencies from lib/ when building for ARM/arm64
arm-deps := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c sort.c
$(obj)/lib-%.o: $(srctree)/lib/%.c FORCE
$(call if_changed_rule,cc_o_c)
lib-$(CONFIG_EFI_ARMSTUB) += arm-stub.o fdt.o string.o \
$(patsubst %.c,lib-%.o,$(arm-deps))
lib-$(CONFIG_ARM) += arm32-stub.o
lib-$(CONFIG_ARM64) += arm64-stub.o random.o
CFLAGS_arm64-stub.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
# arm64 puts the stub in the kernel proper, which will unnecessarily retain all
# code indefinitely unless it is annotated as __init/__initdata/__initconst etc.
# So let's apply the __init annotations at the section level, by prefixing
# the section names directly. This will ensure that even all the inline string
# literals are covered.
# The fact that the stub and the kernel proper are essentially the same binary
# also means that we need to be extra careful to make sure that the stub does
# not rely on any absolute symbol references, considering that the virtual
# kernel mapping that the linker uses is not active yet when the stub is
# executing. So build all C dependencies of the EFI stub into libstub, and do
# a verification pass to see if any absolute relocations exist in any of the
# object files.
extra-$(CONFIG_EFI_ARMSTUB) := $(lib-y)
lib-$(CONFIG_EFI_ARMSTUB) := $(patsubst %.o,%.stub.o,$(lib-y))
STUBCOPY_FLAGS-y := -R .debug* -R *ksymtab* -R *kcrctab*
STUBCOPY_FLAGS-$(CONFIG_ARM64) += --<API key>=.init \
--prefix-symbols=__efistub_
STUBCOPY_RELOC-$(CONFIG_ARM64) := R_AARCH64_ABS
$(obj)/%.stub.o: $(obj)/%.o FORCE
$(call if_changed,stubcopy)
quiet_cmd_stubcopy = STUBCPY $@
cmd_stubcopy = if $(OBJCOPY) $(STUBCOPY_FLAGS-y) $< $@; then \
$(OBJDUMP) -r $@ | grep $(STUBCOPY_RELOC-y) \
&& (echo >&2 "$@: absolute symbol references not allowed in the EFI stub"; \
rm -f $@; /bin/false); else /bin/false; fi |
<?php
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Enqueue admin scripts
*
* @since 1.0
* @updated 1.1
* @param string $hook Page hook
* @return void
*/
function <API key>( $hook ) {
global $wp_version, $post, $pagenow, $typenow;
$js_dir = ERM_PLUGIN_URL . 'assets/js/';
$css_dir = ERM_PLUGIN_URL . 'assets/css/';
// Use minified libraries if SCRIPT_DEBUG is turned off
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
// Only for post type erm_menu
if ( apply_filters( '<API key>', <API key>(), $hook ) ) {
// Fontawesome
wp_enqueue_style( 'fontawesome', $css_dir.'font-awesome'.$suffix.'.css', array(), '4.3.0' );
// Sweetalert
wp_enqueue_style( 'sweetalert', $css_dir.'sweetalert.css', array(), '1.0.0' );
// ERM style
wp_enqueue_style( 'erm-admin-style', $css_dir.'erm-admin-style.css', array(), ERM_VERSION );
// Magnific popup
wp_enqueue_style( 'magnific-popup', $css_dir.'magnific-popup.css' );
// Sweetalert
wp_enqueue_script( 'sweetalert', $js_dir.'sweetalert.min.js', array(), '1.0.0', true );
// Knockout
wp_enqueue_script( 'knockout', $js_dir.'knockout.min.js', array(), '3.3.0', true );
wp_enqueue_script( 'knockout-sortable', $js_dir.'knockout-sortable'.$suffix.'.js', array(), '0.11.0', true );
// Media
if( function_exists( 'wp_enqueue_media' ) && version_compare( $wp_version, '3.5', '>=' ) ) {
wp_enqueue_media();
}
wp_enqueue_script( 'media-upload' );
// Magnific-popup
wp_enqueue_script( 'magnific-popup', $js_dir . 'jquery.magnific-popup.min.js', array( 'jquery' ), '1.0.0', true );
// ERM script
wp_enqueue_script( 'erm-admin-scripts', $js_dir.'erm-admin-erm_menu.js', array('jquery','knockout', 'knockout-sortable'), ERM_VERSION, true );
// Menu items
global $post_id;
$menu_items = <API key>( $post->ID );
wp_localize_script( 'erm-admin-scripts', 'erm_vars', array(
'menu_id' => $post_id,
'menu_items' => $menu_items,
'editor_css' => $css_dir.'erm-admin-tinymce.css',
'use_new_media_35' => function_exists( 'wp_enqueue_media' ) ? 1 : 0,
'notices' => array(
'alert_delete' => __('Are you sure to delete?', 'erm'),
'alert_confirm' => __('Yes, delete it!', 'erm')
)
) );
}
//Columns erm_menu, erm_menu_item
else if ( $pagenow == 'edit.php' && ( $typenow == 'erm_menu_item' || $typenow == 'erm_menu' || $typenow == 'erm_menu_week' ) ) {
wp_enqueue_style( '<API key>', $css_dir.'<API key>.css', array(), ERM_VERSION );
}
// Post type erm_menu_week
else if ( apply_filters( '<API key>', <API key>(), $hook ) ) {
// Fontawesome
wp_enqueue_style( 'fontawesome', $css_dir.'font-awesome'.$suffix.'.css', array(), '4.3.0' );
// ion.rangeSlider
wp_enqueue_style( 'ion.rangeSlider', $css_dir.'ion.rangeSlider.css', array(), '2.0.6' );
wp_enqueue_style( 'ion.rangeSlider.skin', $css_dir.'ion.rangeSlider.skinHTML5.css', array(), '2.0.6' );
// Knockout
wp_enqueue_script( 'knockout', $js_dir.'knockout.min.js', array(), '3.3.0', true );
wp_enqueue_script( 'knockout-sortable', $js_dir.'knockout-sortable'.$suffix.'.js', array(), '0.11.0', true );
// ion rangeSlider
wp_enqueue_script( 'ion-rangeslider', $js_dir.'ion.rangeSlider'.$suffix.'.js', array(), '2.0.6', true );
// ERM script
wp_enqueue_script( 'erm-admin-scripts', $js_dir.'<API key>.js', array('jquery','knockout', 'knockout-sortable', 'ion-rangeslider'), ERM_VERSION, true );
// Data
global $post_id;
// These anonymus functions need php 5.3
// Add void menu to the start of list menus
/*add_filter('erm_get_list_menus',function($list){
return array_merge(array(
array('id'=>0,'title'=>'No Menu selected')),
$list);
});*/
// Menu rules by default
/*add_filter('<API key>',function($franjas){
if (empty($franjas)) {
$franjas = array(
array(
'week' => array(true,true,true,true,true,true,true),
'begin' => '00:00',
'end' => '24:00',
'menu_id' => 0
)
);
}
return $franjas;
});*/
wp_localize_script( 'erm-admin-scripts', 'erm_vars', array(
'post_id' => $post_id,
'menus' => erm_get_list_menus(),
'franjas' => apply_filters( '<API key>' , get_post_meta($post_id,'erm_week_rules',true) ),
'start_of_week' => get_option('start_of_week'),
//'week_days' => <API key>(),
'week_days' => <API key>()
));
}
}
add_action( '<API key>', '<API key>', 100 );
/**
* Add void menu to the list
*
* @since 1.2
* @param $list
* @return array
*/
function <API key>( $list ){
return array_merge(array(
array('id'=>0,'title'=>__('No Menu selected','erm'))),
$list);
}
add_filter('erm_get_list_menus','<API key>');
/**
* Default schedules
*
* @since 1.2
* @param $franjas
* @return array
*/
function <API key>( $franjas ){
if (empty($franjas)) {
$franjas = array(
array(
'week' => array(true,true,true,true,true,true,true),
'begin' => '00:00',
'end' => '24:00',
'menu_id' => 0
)
);
}
return $franjas;
}
add_filter('<API key>', '<API key>'); |
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/file.h>
#include <linux/hrtimer.h>
#include <linux/module.h>
#include "mic/micscif.h"
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
#include <linux/sched/rt.h>
#endif
struct poll_table_page {
struct poll_table_page *next;
struct poll_table_entry *entry;
struct poll_table_entry entries[0];
};
/*
* Estimate expected accuracy in ns from a timeval.
*
* After quite a bit of churning around, we've settled on
* a simple thing of taking 0.1% of the timeout as the
* slack, with a cap of 100 msec.
* "nice" tasks get a 0.5% slack instead.
*
* Consider this comment an open invitation to come up with even
* better solutions..
*/
#define MAX_SLACK (100 * NSEC_PER_MSEC)
static long __estimate_accuracy(struct timespec *tv)
{
long slack;
int divfactor = 1000;
if (tv->tv_sec < 0)
return 0;
if (task_nice(current) > 0)
divfactor = divfactor / 5;
if (tv->tv_sec > MAX_SLACK / (NSEC_PER_SEC/divfactor))
return MAX_SLACK;
slack = tv->tv_nsec / divfactor;
slack += tv->tv_sec * (NSEC_PER_SEC/divfactor);
if (slack > MAX_SLACK)
return MAX_SLACK;
return slack;
}
static long estimate_accuracy(struct timespec *tv)
{
unsigned long ret;
struct timespec now;
/*
* Realtime tasks get a slack of 0 for obvious reasons.
*/
if (rt_task(current))
return 0;
ktime_get_ts(&now);
now = timespec_sub(*tv, now);
ret = __estimate_accuracy(&now);
if (ret < current->timer_slack_ns)
return current->timer_slack_ns;
return ret;
}
#define POLL_TABLE_FULL(table) \
((unsigned long)((table)->entry+1) > PAGE_SIZE + (unsigned long)(table))
/*
* Ok, Peter made a complicated, but straightforward multiple_wait() function.
* I have rewritten this, taking some shortcuts: This code may not be easy to
* follow, but it should be free of race-conditions, and it's practical. If you
* understand what I'm doing here, then you understand how the linux
* sleep/wakeup mechanism works.
*
* Two very simple procedures, poll_wait() and poll_freewait() make all the
* work. poll_wait() is an inline-function defined in <linux/poll.h>,
* as all select/poll functions have to call it to add an entry to the
* poll table.
*/
static void __pollwait(struct file *filp __attribute__((unused)), wait_queue_head_t *wait_address,
poll_table *p);
static void scif_poll_initwait(struct poll_wqueues *pwq)
{
init_poll_funcptr(&pwq->pt, __pollwait);
pwq->polling_task = current;
pwq->triggered = 0;
pwq->error = 0;
pwq->table = NULL;
pwq->inline_index = 0;
}
static void free_poll_entry(struct poll_table_entry *entry)
{
remove_wait_queue(entry->wait_address, &entry->wait);
}
static void scif_poll_freewait(struct poll_wqueues *pwq)
{
struct poll_table_page * p = pwq->table;
int i;
for (i = 0; i < pwq->inline_index; i++)
free_poll_entry(pwq->inline_entries + i);
while (p) {
struct poll_table_entry *entry;
struct poll_table_page *old;
entry = p->entry;
do {
entry
free_poll_entry(entry);
} while (entry > p->entries);
old = p;
p = p->next;
free_page((unsigned long) old);
}
}
static struct poll_table_entry *poll_get_entry(struct poll_wqueues *p)
{
struct poll_table_page *table = p->table;
if (p->inline_index < <API key>)
return p->inline_entries + p->inline_index++;
if (!table || POLL_TABLE_FULL(table)) {
struct poll_table_page *new_table;
new_table = (struct poll_table_page *) __get_free_page(GFP_KERNEL);
if (!new_table) {
p->error = -ENOMEM;
return NULL;
}
new_table->entry = new_table->entries;
new_table->next = table;
p->table = new_table;
table = new_table;
}
return table->entry++;
}
static int __pollwake(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
struct poll_wqueues *pwq = wait->private;
DECLARE_WAITQUEUE(dummy_wait, pwq->polling_task);
/*
* Although this function is called under waitqueue lock, LOCK
* doesn't imply write barrier and the users expect write
* barrier semantics on wakeup functions. The following
* smp_wmb() is equivalent to smp_wmb() in try_to_wake_up()
* and is paired with set_mb() in <API key>.
*/
smp_wmb();
pwq->triggered = 1;
/*
* Perform the default wake up operation using a dummy
* waitqueue.
*
* TODO: This is hacky but there currently is no interface to
* pass in @sync. @sync is scheduled to be removed and once
* that happens, wake_up_process() can be used directly.
*/
return <API key>(&dummy_wait, mode, sync, key);
}
static int pollwake(wait_queue_t *wait, unsigned mode, int sync, void *key)
{
struct poll_table_entry *entry;
entry = container_of(wait, struct poll_table_entry, wait);
if (key && !((unsigned long)key & entry->key))
return 0;
return __pollwake(wait, mode, sync, key);
}
/* Add a new entry */
static void __pollwait(struct file *filp __attribute__((unused)), wait_queue_head_t *wait_address,
poll_table *p)
{
struct poll_wqueues *pwq = container_of(p, struct poll_wqueues, pt);
struct poll_table_entry *entry = poll_get_entry(pwq);
if (!entry)
return;
entry->filp = NULL;
entry->wait_address = wait_address;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
entry->key = p->_key;
#else
entry->key = p->key;
#endif
<API key>(&entry->wait, pollwake);
entry->wait.private = pwq;
add_wait_queue(wait_address, &entry->wait);
}
int <API key>(struct poll_wqueues *pwq, int state,
ktime_t *expires, unsigned long slack)
{
int rc = -EINTR;
set_current_state(state);
if (!pwq->triggered)
rc = <API key>(expires, slack, HRTIMER_MODE_ABS);
__set_current_state(TASK_RUNNING);
/*
* Prepare for the next iteration.
*
* The following set_mb() serves two purposes. First, it's
* the counterpart rmb of the wmb in pollwake() such that data
* written before wake up is always visible after wake up.
* Second, the full barrier guarantees that triggered clearing
* doesn't pass event check of the next iteration. Note that
* this problem doesn't exist for the first iteration as
* add_wait_queue() has full barrier semantics.
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
smp_store_mb(pwq->triggered, 0);
#else
set_mb(pwq->triggered, 0);
#endif
return rc;
}
static unsigned int scif_poll_kernel(poll_table *pwait, struct endpt *ep)
{
return __scif_pollfd(NULL, pwait, ep);
}
/*
* Fish for pollable events on the pollfd->fd file descriptor. We're only
* interested in events matching the pollfd->events mask, and the result
* matching that mask is both recorded in pollfd->revents and returned. The
* pwait poll_table will be used by the fd-provided poll handler for waiting,
* if non-NULL.
*/
static inline unsigned int do_pollfd(struct scif_pollepd *pollfd, poll_table *pwait)
{
unsigned int mask;
scif_epd_t epd;
mask = 0;
epd = pollfd->epd;
if (epd) {
mask = POLLNVAL;
mask = DEFAULT_POLLMASK;
if (pwait)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
pwait->_key = pollfd->events | POLLERR | POLLHUP;
#else
pwait->key = pollfd->events | POLLERR | POLLHUP;
#endif
mask = scif_poll_kernel(pwait, epd);
/* Mask out unneeded events. */
mask &= pollfd->events | POLLERR | POLLHUP;
}
pollfd->revents = mask;
return mask;
}
static int do_poll(unsigned int nfds, struct scif_pollepd *ufds,
struct poll_wqueues *wait, struct timespec *end_time)
{
poll_table* pt = &wait->pt;
ktime_t expire, *to = NULL;
int timed_out = 0, count = 0, i = 0;
unsigned long slack = 0;
/* Optimise the no-wait case */
if (end_time && !end_time->tv_sec && !end_time->tv_nsec) {
pt = NULL;
timed_out = 1;
}
if (end_time && !timed_out)
slack = estimate_accuracy(end_time);
for (;;) {
for (i = 0; i < nfds; i++) {
/*
* Fish for events. If we found one, record it
* and kill the poll_table, so we don't
* needlessly register any other waiters after
* this. They'll get immediately deregistered
* when we break out and return.
*/
if (do_pollfd(ufds + i, pt)) {
count++;
pt = NULL;
}
}
/*
* All waiters have already been registered, so don't provide
* a poll_table to them on the next loop iteration.
*/
pt = NULL;
if (!count) {
count = wait->error;
if (signal_pending(current))
count = -EINTR;
}
if (count || timed_out)
break;
/*
* If this is the first loop and we have a timeout
* given, then we convert to ktime_t and set the to
* pointer to the expiry value.
*/
if (end_time && !to) {
expire = timespec_to_ktime(*end_time);
to = &expire;
}
if (!<API key>(wait, TASK_INTERRUPTIBLE, to, slack))
timed_out = 1;
}
return count;
}
static int do_scif_poll(struct scif_pollepd *ufds, unsigned int nfds,
struct timespec *end_time)
{
struct poll_wqueues table;
int epdcount;
scif_poll_initwait(&table);
epdcount = do_poll(nfds, ufds, &table, end_time);
scif_poll_freewait(&table);
return epdcount;
}
/*
* Add two timespec values and do a safety check for overflow.
* It's assumed that both values are valid (>= 0)
*/
static struct timespec <API key>(const struct timespec lhs,
const struct timespec rhs)
{
struct timespec res;
<API key>(&res, lhs.tv_sec + rhs.tv_sec,
lhs.tv_nsec + rhs.tv_nsec);
if (res.tv_sec < lhs.tv_sec || res.tv_sec < rhs.tv_sec)
res.tv_sec = TIME_T_MAX;
return res;
}
/**
* <API key> - helper function to setup the timeout value
* @to: pointer to timespec variable for the final timeout
* @sec: seconds (from user space)
* @nsec: nanoseconds (from user space)
*
* Note, we do not use a timespec for the user space value here, That
* way we can use the function for timeval and compat interfaces as well.
*
* Returns -EINVAL if sec/nsec are not normalized. Otherwise 0.
*/
static int <API key>(struct timespec *to, long sec, long nsec)
{
struct timespec ts = {.tv_sec = sec, .tv_nsec = nsec};
if (!timespec_valid(&ts))
return -EINVAL;
/* Optimize for the zero timeout value here */
if (!sec && !nsec) {
to->tv_sec = to->tv_nsec = 0;
} else {
ktime_get_ts(to);
*to = <API key>(*to, ts);
}
return 0;
}
int scif_poll(struct scif_pollepd *ufds, unsigned int nfds, long timeout_msecs)
{
struct timespec end_time, *to = NULL;
if (timeout_msecs >= 0) {
to = &end_time;
<API key>(to, timeout_msecs / MSEC_PER_SEC,
NSEC_PER_MSEC * (timeout_msecs % MSEC_PER_SEC));
}
return do_scif_poll(ufds, nfds, to);
}
EXPORT_SYMBOL(scif_poll); |
package pl.rcebula.internals.interpreter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
import java.util.logging.Logger;
import pl.rcebula.Constants;
import pl.rcebula.error_report.ErrorInfo;
import pl.rcebula.error_report.MyFiles;
import pl.rcebula.error_report.MyFiles.File;
import pl.rcebula.intermediate_code.UserFunction;
import pl.rcebula.intermediate_code.line.Line;
import pl.rcebula.internals.CallFrame;
import pl.rcebula.internals.data_types.Data;
import pl.rcebula.internals.data_types.DataType;
import pl.rcebula.internals.data_types.MyError;
import pl.rcebula.module.BuiltinFunctions;
import pl.rcebula.module.utils.error_codes.ErrorCodes;
import pl.rcebula.tools.IProfiler;
import pl.rcebula.utils.TimeProfiler;
/**
*
* @author robert
*/
public final class Interpreter
{
// logger
// static final Logger logger = Logger.getGlobal();
// time profiler
final TimeProfiler timeProfiler;
// profiler
final IProfiler profiler;
final Stack<CallFrame> frameStack = new Stack<>();
// aktualna ramka
CallFrame currentFrame;
// zmienne globalne
final Map<String, Data> globalVariables = new HashMap<>();
final Map<String, UserFunction> userFunctions;
// funkcje wbudowane
final BuiltinFunctions builtinFunctions;
private final MyFiles files;
private Data <API key>;
private List<Integer> orderList;
private PerformCall call = new PerformCall();
private PerformCallLoc callLoc = new PerformCallLoc();
private PerformClearStack clearStack = new PerformClearStack();
private PerformJmp jmp = new PerformJmp();
private PerformJmpIfFalse jmpIfFalse = new PerformJmpIfFalse();
private PerformPop pop = new PerformPop();
private PerformPopc popc = new PerformPopc();
private PerformPush push = new PerformPush();
private PerformOrder order = new PerformOrder();
private PerformJmpIfNotBool peekJmpIfNotBool = new PerformJmpIfNotBool();
private <API key> <API key> =
new <API key>();
public Interpreter(String pathToScript, String[] args, Map<String, UserFunction> userFunctions,
BuiltinFunctions builtinFunctions, TimeProfiler timeProfiler, IProfiler profiler, MyFiles files)
{
// logger.info("Interpreter");
this.userFunctions = userFunctions;
this.builtinFunctions = builtinFunctions;
this.timeProfiler = timeProfiler;
this.profiler = profiler;
this.files = files;
String[] tmpArgs = new String[args.length + 1];
tmpArgs[0] = pathToScript;
System.arraycopy(args, 0, tmpArgs, 1, args.length);
CallFrame mainFrame = createMainFrame(tmpArgs);
// wrzucamy na stos ramek
pushFrameToStack(mainFrame);
// zaczynamy wykonywanie kodu
try
{
run();
}
catch (StackOverflowError ex)
{
ErrorInfo ei = new ErrorInfo(-1, -1, files.<API key>());
MyError error = new MyError("Stack overflow", ErrorCodes.STACK_OVERFLOW.getCode(), null, ei, this);
<API key> = Data.createErrorData(error);
}
catch (OutOfMemoryError ex)
{
ErrorInfo ei = new ErrorInfo(-1, -1, files.<API key>());
MyError error = new MyError("Heap overflow", ErrorCodes.HEAP_OVERFLOW.getCode(), null, ei, this);
<API key> = Data.createErrorData(error);
}
endOfFirstRun();
}
void pushFrameToStack(CallFrame cf)
{
frameStack.push(cf);
setCurrentFrame(cf);
profiler.enter(cf.getUserFunction().getName());
}
void run()
{
while (currentFrame != null)
{
timeProfiler.start("Read Line");
UserFunction uf = currentFrame.getUserFunction();
// pobieramy instruction pointer
int ip = currentFrame.getIp();
Line line = uf.getLines().get(ip);
currentFrame.setIp(ip + 1);
// koniec wczytywania
timeProfiler.stop();
// TODELETE
// logger.finest(uf.getName());
// logger.finest(Integer.toString(ip));
// logger.fine(line.toString());
switch (line.<API key>())
{
case CALL:
timeProfiler.start("CALL");
call.perform(this, line);
timeProfiler.stop();
break;
case CALL_LOC:
timeProfiler.start("CALL_LOC");
callLoc.perform(this, line);
timeProfiler.stop();
break;
case PUSH:
timeProfiler.start("PUSH");
push.perform(this, line);
timeProfiler.stop();
break;
case POP:
timeProfiler.start("POP");
pop.perform(this, line);
timeProfiler.stop();
break;
case POPC:
timeProfiler.start("POPC");
popc.perform(this, line);
timeProfiler.stop();
break;
case JMP:
timeProfiler.start("JMP");
jmp.perform(this, line);
timeProfiler.stop();
break;
case JMP_IF_FALSE:
timeProfiler.start("JMP_IF_FALSE");
jmpIfFalse.perform(this, line);
timeProfiler.stop();
break;
case CLEAR_STACK:
timeProfiler.start("CLEAR_STACK");
clearStack.perform(this, line);
timeProfiler.stop();
break;
case ORDER:
timeProfiler.start("ORDER");
order.perform(this, line);
timeProfiler.stop();
break;
case JMP_IF_NOT_BOOL:
timeProfiler.start("<API key>");
peekJmpIfNotBool.perform(this, line);
timeProfiler.stop();
break;
case <API key>:
timeProfiler.start("<API key>");
<API key>.perform(this, line);
timeProfiler.stop();
break;
case NOP:
String message = "NOP shouldn't occur in saved intermediate code";
throw new RuntimeException(message);
default:
message = "Don't know what to do with " + line.<API key>() + " instruction";
throw new RuntimeException(message);
}
}
}
private void endOfFirstRun()
{
if (<API key> != null
&& <API key>.getDataType().equals(DataType.ERROR))
{
List<Data> parameters = Arrays.asList(<API key>);
builtinFunctions.callEvent(Constants.<API key>, parameters, this,
<API key>.getErrorInfo());
}
run();
builtinFunctions.exit();
}
CallFrame createMainFrame(String[] args)
{
UserFunction uf = userFunctions.get(Constants.mainFunctionName);
List<Data> parameters = new ArrayList<>();
if (uf.getParams().size() == 1)
{
Data[] dataArgs = new Data[args.length];
for (int i = 0; i < args.length; ++i)
{
dataArgs[i] = Data.createStringData(args[i]);
}
parameters.add(Data.createArrayData(dataArgs));
}
File file = files.<API key>();
return new CallFrame(parameters, uf, new ErrorInfo(-1, -1, file));
}
public Map<String, Data> getGlobalVariables()
{
return globalVariables;
}
public Stack<CallFrame> getFrameStack()
{
return frameStack;
}
public BuiltinFunctions getBuiltinFunctions()
{
return builtinFunctions;
}
public Map<String, UserFunction> getUserFunctions()
{
return userFunctions;
}
public CallFrame getCurrentFrame()
{
return currentFrame;
}
public CallFrame popFrame()
{
profiler.exit();
CallFrame cf = frameStack.pop();
if (frameStack.size() > 0)
{
setCurrentFrame(frameStack.peek());
}
else
{
setCurrentFrame(null);
}
return cf;
}
public void <API key>(Data <API key>)
{
this.<API key> = <API key>;
}
public List<Integer> getOrderList()
{
return orderList;
}
public void setOrderList(List<Integer> orderList)
{
this.orderList = orderList;
}
public void setCurrentFrame(CallFrame currentFrame)
{
this.currentFrame = currentFrame;
}
public void callEvent(List<Data> parameters, UserFunction uf, ErrorInfo ei)
{
if (uf.getParams().size() == parameters.size())
{
call.perform(parameters, false, uf, this, ei);
}
else
{
String message = "Event " + uf.getName() + " get " + uf.getParams().size() + " parameters, got "
+ parameters.size();
throw new RuntimeException(message);
}
}
} |
<!doctype html>
<html lang="en" ng-app="toolbox">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<link
href="http://fserena.github.io/GLORIAAuthoringTool/WebContent/toolbox/img/favicon.ico"
rel="icon">
<!-- Bootstrap css -->
<link
href="https://cdnjs.cloudflare.com/ajax/libs/<TwitterConsumerkey>/2.3.2/css/bootstrap.min.css"
rel="stylesheet">
<link
href="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular-csp.css"
rel="stylesheet">
<!-- Toolbox css -->
<link href="/gatool/toolbox/css/toolbox.css" rel="stylesheet">
<!-- External libraries (jQuery, Angular, Bootstrap and UI-Bootstrap) -->
<script
src=https://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.0/jquery.min.js></script>
<script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js></script>
<script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-animate.min.js></script>
<script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-route.js></script>
<script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-sanitize.js></script>
<script
src=https://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular-cookies.js></script>
<script
src=https://cdnjs.cloudflare.com/ajax/libs/<TwitterConsumerkey>/2.3.2/js/bootstrap.min.js></script>
<script src="/gatool/toolbox/js/<API key>.6.0.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/<API key>/0.7.0/ui-bootstrap-tpls.min.js"></script>
<!-- Script loader -->
<script src="/gatool/toolbox/js/script.js"></script>
<!-- GLORIAjs API -->
<script src="/gatool/toolbox/js/gloriapi.js"></script>
<!-- Toolbox -->
<script src="/gatool/toolbox/js/toolbox.js"></script>
<title ng-show="titleLoaded">{{'title.browser' | i18n}}</title>
</head>
<body ng-cloak
style="padding-top: 40px; <API key>: fixed; background-color: black; background-image: url(/gatool/toolbox/img/main_bg.png); color: silver;">
<div id="body-proxy" ng-include src="bodyHtml"></div>
</body>
</html> |
<?php
/**
* @file
* A 5-band layout. Top band is "header", bottom band is "footer", the three center bands are "row-1", "row-2", and "row-3".
*/
?>
<div class="panel-layout technet-5-band container <?php if (!empty($class)) { print $class; } ?>" <?php if (!empty($css_id)) { print 'id="' . $css_id . '"'; } ?>>
<section class="technet-section <API key> technet-header row">
<?php print $content['header']; ?>
</section>
<section class="technet-section technet-section-2 technet-row row">
<?php print $content['row-1']; ?>
</section>
<section class="technet-section technet-section-3 technet-row row">
<?php print $content['row-2']; ?>
</section>
<section class="technet-section technet-section-4 technet-row row">
<?php print $content['row-3']; ?>
</section>
<section class="technet-section <API key> technet-footer row">
<?php print $content['footer']; ?>
</section>
</div> |
package com.aifeng.mgr.admin.ctl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.aifeng.mgr.admin.service.IActionService;
import com.aifeng.mgr.admin.service.IMenuService;
import org.apache.log4j.Logger;
import com.aifeng.core.ctl.BaseCtl;
import com.aifeng.mgr.admin.model.Action;
import com.aifeng.mgr.admin.model.Menu;
import com.aifeng.mgr.admin.vo.ZTree;
import com.aifeng.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject;
@Controller
@RequestMapping("/menu")
public class MenuCtl extends BaseCtl {
Logger log = Logger.getLogger(MenuCtl.class);
// @Autowired
// RedisClientTemplate redisClientTemplate;
@Autowired
IMenuService menuService;
@Autowired
IActionService actionService;
@RequestMapping("list")
public String list(ModelMap mm, @RequestParam(required = false) String menuCode) {
mm.put(MENU_CODE, menuCode);
return "sys/menu/list";
}
@RequestMapping(value = "list2", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
@ResponseBody
public String list2() {
List<Menu> list = this.menuService.getMenuList();
List<ZTree> list2 = new ArrayList<ZTree>();
ZTree zt = null;
for (Menu m : list) {
zt = new ZTree(m.getId(), m.getPid(), m.getName() + "-" + m.getCode(), m.getCode());
zt.setOpen(true);
list2.add(zt);
}
List<Map<String, Object>> list3 = this.actionService.getAllAction2();
for (Map<String, Object> m : list3) {
int id = Integer.valueOf(m.get("id").toString());
int val = Integer.valueOf(m.get("val").toString());
String name = m.get("name").toString();
int menu_id = Integer.valueOf(m.get("menu_id").toString());
zt = new ZTree(id * 100, menu_id, name + "-" + val);
list2.add(zt);
}
return JSONObject.toJSONString(list2, features);
}
@RequestMapping("transfer")
public String transfer(int id, String action, ModelMap mm) {
Menu menu = null;
if (id != 0) {
menu = this.menuService.findById(id);
// if("add".equals(action) && menu != null && menu.getPid() != 0){
// menu = this.menuService.findById(menu.getPid());
mm.put("menu", menu);
}
List<Menu> superMenuList = this.menuService.getSuperMenuList();
mm.put("menuList", superMenuList);
return "sys/menu/" + action;
}
@RequestMapping("transfer2")
public String transfer2(int id, int menu_id, String action, ModelMap mm) {
Menu menu = null;
Action ac = null;
if (id != 0) {
ac = this.actionService.findById(id / 100);
mm.put("ac", ac);
}
if (menu_id != 0) {
menu = this.menuService.findById(menu_id);
mm.put("menu", menu);
}
return "sys/menu/" + action;
}
@RequestMapping(value = "add", method = RequestMethod.POST)
@ResponseBody
public String add(Menu menu, ModelMap mm) {
if (menu != null) {
menu.setDisplay(true);
menu.setCreateDate(DateUtil.getCurrentDate());
this.menuService.addMenu(menu);
}
return AJAX_SUCCESS;
}
@RequestMapping(value = "addAction", method = RequestMethod.POST)
@ResponseBody
public String addAction(Action ac, ModelMap mm) {
if (ac != null) {
this.actionService.addAction(ac);
}
return AJAX_SUCCESS;
}
@RequestMapping(value = "editAction", method = RequestMethod.POST)
@ResponseBody
public String editAction(Action ac, ModelMap mm) {
if (ac != null) {
this.actionService.update(ac);
}
return AJAX_SUCCESS;
}
@RequestMapping(value = "edit", method = RequestMethod.POST)
@ResponseBody
public String edit(Menu menu, ModelMap mm) {
if (menu != null) {
menu.setDisplay(true);
menu.setCreateDate(DateUtil.getCurrentDate());
this.menuService.update(menu);
// redisClientTemplate.set("menu_name", menu.getName());
// System.out.println(redisClientTemplate.get("menu_name"));
}
return AJAX_SUCCESS;
}
@RequestMapping("modify")
public String modify(Menu menu, ModelMap mm) {
menu.setDisplay(true);
this.menuService.update(menu);
mm.put("superMenuList", this.menuService.getSuperMenuList());
return "redirect:/list.cs";
}
@RequestMapping("del")
@ResponseBody
public String del(int id, ModelMap mm) {
// mm.put("superMenuList", this.menuService.getSuperMenuList());
if (id != 0) {
this.menuService.deleteById(id);
}
return AJAX_SUCCESS;
}
@RequestMapping("delAction")
@ResponseBody
public String delAction(int id, ModelMap mm) {
// mm.put("superMenuList", this.menuService.getSuperMenuList());
if (id != 0) {
this.actionService.deleteById(id / 100);
}
return AJAX_SUCCESS;
}
} |
package soot.jimple.toolkits.typing;
import soot.*;
import soot.jimple.*;
import java.util.*;
import java.io.*;
/**
* @deprecated use {@link soot.jimple.toolkits.typing.fast.TypeResolver} instead
*/
class ConstraintCheckerBV extends AbstractStmtSwitch
{
private final ClassHierarchy hierarchy;
private final boolean fix; // if true, fix constraint violations
private JimpleBody stmtBody;
public ConstraintCheckerBV(TypeResolverBV resolver, boolean fix)
{
this.fix = fix;
hierarchy = resolver.hierarchy();
}
public void check(Stmt stmt, JimpleBody stmtBody) throws TypeException
{
try
{
this.stmtBody = stmtBody;
stmt.apply(this);
}
catch(<API key> e)
{
StringWriter st = new StringWriter();
PrintWriter pw = new PrintWriter(st);
e.printStackTrace(pw);
pw.close();
throw new TypeException(st.toString());
}
}
private static class <API key> extends RuntimeException
{
<API key>(String message)
{
super(message);
}
}
static void error(String message)
{
throw new <API key>(message);
}
private void handleInvokeExpr(InvokeExpr ie, Stmt invokestmt)
{
if(ie instanceof InterfaceInvokeExpr)
{
InterfaceInvokeExpr invoke = (InterfaceInvokeExpr) ie;
SootMethodRef method = invoke.getMethodRef();
Value base = invoke.getBase();
if(base instanceof Local)
{
Local local = (Local) base;
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.declaringClass().getType())))
{
if(fix)
{
invoke.setBase(insertCast(local, method.declaringClass().getType(), invokestmt));
}
else
{
error("Type Error(7): local " + local + " is of incompatible type " + local.getType());
}
}
}
int count = invoke.getArgCount();
for(int i = 0; i < count; i++)
{
if(invoke.getArg(i) instanceof Local)
{
Local local = (Local) invoke.getArg(i);
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.parameterType(i))))
{
if(fix)
{
invoke.setArg(i, insertCast(local, method.parameterType(i), invokestmt));
}
else
{
error("Type Error(8)");
}
}
}
}
}
else if(ie instanceof SpecialInvokeExpr)
{
SpecialInvokeExpr invoke = (SpecialInvokeExpr) ie;
SootMethodRef method = invoke.getMethodRef();
Value base = invoke.getBase();
if(base instanceof Local)
{
Local local = (Local) base;
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.declaringClass().getType())))
{
if(fix)
{
invoke.setBase(insertCast(local, method.declaringClass().getType(), invokestmt));
}
else
{
error("Type Error(9)");
}
}
}
int count = invoke.getArgCount();
for(int i = 0; i < count; i++)
{
if(invoke.getArg(i) instanceof Local)
{
Local local = (Local) invoke.getArg(i);
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.parameterType(i))))
{
if(fix)
{
invoke.setArg(i, insertCast(local, method.parameterType(i), invokestmt));
}
else
{
error("Type Error(10)");
}
}
}
}
}
else if(ie instanceof VirtualInvokeExpr)
{
VirtualInvokeExpr invoke = (VirtualInvokeExpr) ie;
SootMethodRef method = invoke.getMethodRef();
Value base = invoke.getBase();
if(base instanceof Local)
{
Local local = (Local) base;
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.declaringClass().getType())))
{
if(fix)
{
invoke.setBase(insertCast(local, method.declaringClass().getType(), invokestmt));
}
else
{
error("Type Error(13)");
}
}
}
int count = invoke.getArgCount();
for(int i = 0; i < count; i++)
{
if(invoke.getArg(i) instanceof Local)
{
Local local = (Local) invoke.getArg(i);
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.parameterType(i))))
{
if(fix)
{
invoke.setArg(i, insertCast(local, method.parameterType(i), invokestmt));
}
else
{
error("Type Error(14)");
}
}
}
}
}
else if(ie instanceof StaticInvokeExpr)
{
StaticInvokeExpr invoke = (StaticInvokeExpr) ie;
SootMethodRef method = invoke.getMethodRef();
int count = invoke.getArgCount();
for(int i = 0; i < count; i++)
{
if(invoke.getArg(i) instanceof Local)
{
Local local = (Local) invoke.getArg(i);
if(!hierarchy.typeNode(local.getType()).hasAncestorOrSelf(hierarchy.typeNode(method.parameterType(i))))
{
if(fix)
{
invoke.setArg(i, insertCast(local, method.parameterType(i), invokestmt));
}
else
{
error("Type Error(15)");
}
}
}
}
}
else
{
throw new RuntimeException("Unhandled invoke expression type: " + ie.getClass());
}
}
public void caseBreakpointStmt(BreakpointStmt stmt)
{
// Do nothing
}
public void caseInvokeStmt(InvokeStmt stmt)
{
handleInvokeExpr(stmt.getInvokeExpr(), stmt);
}
public void caseAssignStmt(AssignStmt stmt)
{
Value l = stmt.getLeftOp();
Value r = stmt.getRightOp();
TypeNode left = null; |
%; whizzy paragraph -pdf xpdf -latex ./whizzypdfptex.sh
%; whizzy-paragraph "^\\\\begin{frame}"
% latex beamer presentation.
% platex, latex-beamer
% Tokyo Debian Meeting resources
% Copyright (C) 2009 Junichi Uekawa
% Copyright (C) 2010 Nobuhiro Iwamatsu
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 2 of the License, or
% (at your option) any later version.
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\documentclass[cjk,dvipdfmx,12pt]{beamer}
\usetheme{Tokyo}
\usepackage{monthlypresentation}
% preview (shell-command (concat "evince " (<API key> "tex$" "pdf"(buffer-file-name)) "&"))
% presentation (shell-command (concat "xpdf -fullscreen " (<API key> "tex$" "pdf"(buffer-file-name)) "&"))
% presentation (shell-command (concat "evince " (<API key> "tex$" "pdf"(buffer-file-name)) "&"))
%http:
%EUC
\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}
%JIS
%\AtBeginDvi{\special{pdf:tounicode 90ms-RKSJ-UCS2}}
\title{ Debian /}
\subtitle{}
\author{ iwamatsu@debian.org\\IRC nick: iwamatsu}
\date{20100515}
\logo{\includegraphics[width=8cm]{image200607/openlogo-light.eps}}
\begin{document}
\frame{\titlepage{}}
\emtext{}
\begin{frame}
\frametitle{}
\begin{minipage}[t]{0.45\hsize}
\begin{itemize}
\item
\begin{itemize}
\item ?
\end{itemize}
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.45\hsize}
\begin{itemize}
\item GNU/Linux
\item LT
\item
\item DebianLinux
\item Debian / mozc Debian
\end{itemize}
\end{minipage}
\end{frame}
\begin{frame}
\frametitle{Debian}
\begin{minipage}[t]{0.45\hsize}
\begin{itemize}
\item /
\item
\begin{itemize}
\item ?
\end{itemize}
\end{itemize}
\end{minipage}
\begin{minipage}[t]{0.45\hsize}
\begin{itemize}
\item piuparts
\item upstart
\item debtags
\item Debian JP Project Leader
\end{itemize}
\end{minipage}
\end{frame}
\begin{frame}{Hack Cafe}
?\\
Debian Hack Cafe \\
\url{http://twitter.com/debian_hackcafe}\\
\end{frame}
\emtext{}
\begin{frame}{}
\begin{enumerate}
\item LinuxLinux
\item
\end{enumerate}
\end{frame}
{\footnotesize
\input{image201005/prework.tex}
}
%
\emtext{}
%
\begin{frame}{}
\begin{itemize}
\item ( )
\item Debian Officiall Developer \\
\item Debian \\
SH4 / SH4 / Buildd / Bluetooth,
OpenCV, slim, USB, gcc, eglibc, etc...
\item \\
Linux Kernel , U-Boot
\end{itemize}
\end{frame}
%
\emtext{Debian/Linux }
%
\begin{frame}{}
\begin{itemize}
\item Debian Linux
\item
\item
\item
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{Debian Linux }
\begin{itemize}
\item Debian Linux Debian Kernel Team
\item Bastian Blank, Frederik Schul, Maximilian Attems,
Ben Hutchings
\item \\
BuilddDebian-instller eglibc
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]
\begin{figure}[H]
\begin{center}
\includegraphics[width=1.0\hsize]{image201005/debian-kernel-team.eps}
\end{center}
\end{figure}
\end{frame}
\begin{frame}[containsverbatim]{DebianLinux}
%6DebianLinux
%
%DebconfLinuxstable
%/
%
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item Debian\\
Debian
\item LTS \\
Long-term Support 2.6.32 2.6.27
\item stable \\
\texttt{The Linux Kernel Archives}
2.6.33.32.6.32.122.6.31.132.6.30.102.6.27.465
\item Linus/HEAD \\
Linus git HEADHEAD
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item
\item Debian stable \\
2.6.32.12Debian
linux-2.6\_2.6.32-12 stable Debian
Debian Linux stable
\item stableDebian
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item Debian
\item stable(stable@kernel.org)
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item Debian BTS
\item Upstream(stabelLinus/HEAD)
\item Debian Kernel TeamLinus
\item Debian specific
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]
\begin{figure}[H]
\begin{center}
\includegraphics[width=1.1\hsize]{image201005/debian-kernel-devel.eps}
\end{center}
\end{figure}
\end{frame}
\begin{frame}[containsverbatim]{Debian Kernel Team}
Debian Kernel TeamLinux
\end{frame}
\begin{frame}[containsverbatim]{linux-2.6 }
\begin{table}[ht]
\begin{minipage}{0.3\hsize}
\begin{itemize}
\item Linux
\item
libc
\end{itemize}
\end{minipage}
\begin{minipage}{0.6\hsize}
\begin{figure}[H]
\begin{center}
\includegraphics[width=0.8\hsize]{image201005/<API key>.eps}
\end{center}
\end{figure}
\end{minipage}
\end{table}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item config , config , flavour config
\item
\item config \textless config \textless flavour config
\item
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{linux-latest-2.6 }
DebianABI
\begin{figure}[H]
\begin{center}
\includegraphics[width=1.0\hsize]{image201005/linux-latest-2.6.eps}
\end{center}
\end{figure}
\end{frame}
\begin{frame}[containsverbatim]{ABI}
\begin{itemize}
\item syscall ABI
\item \texttt{linux-2.6/debian/bin/buildcheck.py}
\item
\end{itemize}
\begin{commandline}
make[3]: Leaving directory `/home/mattems/src/linux-2.6-2.6.32/debian/build/<API key>'
python debian/bin/buildcheck.py debian/build/<API key> amd64 none amd64
ABI has changed! Refusing to continue.
Added symbols:
<API key> module: drivers/staging/usbip/usbip_common_mod, version: 0x79bd9084, export: EXPORT_SYMBOL_GPL
getboottime module: vmlinux, version: 0x0619ca8a, export: EXPORT_SYMBOL_GPL
<API key> module: vmlinux, version: 0xdb274e52, export: EXPORT_SYMBOL_GPL
\end{commandline}
\end{frame}
\begin{frame}[containsverbatim]{linux-kbuild-2.6}
\begin{itemize}
\item \texttt{linux-kbuild-2.6}
\item stablekbuild
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{linux-kbuild-2.6}
\begin{figure}[H]
\begin{center}
\includegraphics[width=1.0\hsize]{image201005/linux-kbuild-2.6.eps}
\end{center}
\end{figure}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item Debian
\item
\item stabel
\item
\item ABI
\end{itemize}
\end{frame}
\emtext{Debian}
\begin{frame}[containsverbatim]
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item Debian
\item
\begin{itemize}
\item
\item
\item \\
\texttt{CONFIG\_PREEMPT\_XXX}
\item Timer frequency\\
\texttt{CONFIG\_HZ\_XXX}
\item
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{}
Debian
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item Debian
\item Debian
\item Debian()
\item Debian
\item git/HEAD Debian
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item debuild \\
flavour \\
\item flavour : amd64, vserver , xen, openvz, etc..
\item flavour
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{Debian}
\begin{itemize}
\item Linux-2.6 \\
linux-2.6
\begin{commandline}
$ apt-get source linux-2.6
$ cd linux-2.6-2.6.32
\end{commandline}
\item linux-2.6 \\
\texttt{build-dep}
\begin{commandline}
$ sudo apt-get build-dep linux-2.6
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{Debian}
\begin{itemize}
\item Debian
\begin{commandline}
$ make -f debian/rules clean
$ make -f debian/rules source-all
\end{commandline}
\texttt{debian/rules source-all}
\begin{commandline}
$ make -f debian/rules.gen source_amd64
\end{commandline}
\item flavour\\
amd64amd64 flavour
\begin{commandline}
$ fakeroot make -f debian/rules.gen <API key>
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{Debian}
\begin{itemize}
\item \\
\texttt{debian/build/build\_amd64\_none\_amd64}
\begin{commandline}
$ cd debian/build/<API key>
$ make menuconfig
$ cd ../../..
\end{commandline}
\item \\
\texttt{debuild / dpkg-buildpackage}debian/rules
\begin{commandline}
$ fakeroot make -f debian/rules.gen <API key>
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item Debian
\item Debian
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{Debian}
\begin{itemize}
\item debian/patches/bugfix\\
\item debian/patches/debian\\
Debian
\item debian/patches/features\\
upstream
\item debian/patches/series\\
Debian
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{}
(oreore.patch)
\begin{itemize}
\item \\
\begin{commandline}
$ apt-get source linux-2.6
$ cd linux-2.6-2.6.32
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{}
\begin{itemize}
\item Changelog\\
DebianChangelog\texttt{dch}
\begin{commandline}
$ dch --local +test -D UNRELEASED
\end{commandline}
Liux\texttt{2.6.32-12}
\texttt{2.6.32-12+test1}
\item \\
debian/patches
\begin{commandline}
$ cp ~/oreore.patch debian/patches/bugfix/
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{}
\begin{itemize}
\item \\
\texttt{debian/patches/series/}
Debian
\begin{commandline}
$ echo ``+ bugfix/oreore.patch'' >> debian/patches/series/12+test1
\end{commandline}
\item \texttt{./debian/bin/gencontrol.py}
\texttt{./debian/bin/gencontrol.py}
Debian
\begin{commandline}
$ ./debian/bin/gencontrol.py
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{}
\begin{itemize}
\item \\
\begin{commandline}
$ make -f debian/rules clean
$ make -f debian/rules.gen source_amd64
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{}
\begin{itemize}
\item \\
amd64 amd64 flavour
\begin{commandline}
$ fakeroot make -f debian/rules.gen <API key>
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{Debian }
\begin{itemize}
\item Debian
\item \texttt{linux-source-2.6.XX}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{linux-source-2.6.XX}
\begin{itemize}
\item Debian
\begin{commandline}
$ sudo apt-get build-dep linux-source-2.6.32
\end{commandline}
\item Debian
\begin{commandline}
$ sudo apt-get install linux-source-2.6.32
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{linux-source-2.6.XX}
\begin{itemize}
\item make-kpkg
\begin{commandline}
$ fakeroot make-kpkg --revision=test00 kernel_image kernel_headers
\end{commandline}
\end{itemize}
\begin{itemize}
\item Debian
\item \texttt{<API key>}
\item
\end{itemize}
\begin{commandline}
$ sudo apt-get install <API key>.6.32
$ /usr/src/kernel-patches/all/2.6.32/apply/debian -a x86_64 -f xen
\end{commandline}
\texttt{-a} \texttt{-f} flavour
\end{frame}
\begin{frame}[containsverbatim]{debian
}
\begin{itemize}
\item LinusstableLinuxDebian
\item \texttt{kernel-package}Debian
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{debian}
\begin{itemize}
\item \texttt{kernel-package}\texttt{fakeroot}
\begin{commandline}
$ sudo apt-get install kernel-package fakeroot
\end{commandline}
\item
\item
\begin{commandline}
$ make menuconfig
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{debian}
\begin{itemize}
\item \texttt{make-kpkg}
make-kpkg
\begin{itemize}
\item kernel\_image \\
\item kernel\_headers \\
\item --revision \\
Debian
\item --append\_to\_version\\
\end{itemize}
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item --added\_modules\\
Debian
\item --added\_patches\\
Debian
\item --initrd \\
initrdinitrd
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{debian}
\texttt{test12345}\texttt{append67890}
.()2.6.33.3
2.6.33.3.append67890
\begin{commandline}
$ fakeroot make-kpkg --revision=.test12345 \
--append-to-version=append67890 kernel_image
\end{commandline}
\texttt{--append-to-version}\texttt{--revision}
\begin{commandline}
linux-image-(kernel-version)(--append-to-version)_(--revision)_(architecture).deb
\end{commandline}
\end{frame}
\begin{frame}[containsverbatim]%{debian}
\begin{itemize}
\item
\begin{commandline}
$ sudo dpkg -i \
../linux-image-2.6.33.3.<API key>.deb
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{git/HEADDebian}
\begin{itemize}
\item \\
\item git
\item kernel-package
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{git/HEADDebian}
\begin{itemize}
\item Linux git \\
Linux git\texttt{git clone}
\begin{commandline}
$ git clone \
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
\end{commandline}
linux-2.6
\begin{commandline}
$ cd linux-2.6
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{git/HEADDebian}
\begin{itemize}
\item \\
git
\begin{commandline}
$ git pull
\end{commandline}
\item \texttt{make-kpkg clean} \\
\texttt{make-kpkg clean}
\begin{commandline}
$ make-kpkg clean
\end{commandline}
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]%{git/HEADDebian}
\begin{itemize}
\item \\
\texttt{make-kpkg}
Makefile
\texttt{git log --pretty=format:\%h -1}HEAD
\texttt{--revision}
\begin{commandline}
$ fakeroot make-kpkg --revision=1+`git log --pretty=format:\%h -1`\
--initrd kernel_image
$ ls ../
linux-2.6 linux-image-2.6.34-rc7_1+be83567_amd64.deb
\end{commandline}
\end{itemize}
\end{frame}
\emtext{}
\begin{frame}[containsverbatim]{lenny}
\end{frame}
\begin{frame}[containsverbatim]{lenny}
kernel-packagelenny
\end{frame}
\begin{frame}[containsverbatim]{lenny
}
testing/unstable kenrel-package lenny
kernel-package
lenny
\end{frame}
\begin{frame}[containsverbatim]{initrd }
\end{frame}
\begin{frame}[containsverbatim]{initrd }
grubinitrd
\end{frame}
\begin{frame}[containsverbatim]{initrd }
kenrel-pakcage 12.012 initrd
\texttt{make-kpkg}initrd
\begin{commandline}
$ sudo mkdir -p /etc/kernel/postinst.d/
$ sudo cp
/usr/share/doc/kernel-package/examples/etc/kernel/postinst.d/initramfs \
/etc/kernel/postinst.d/
$ fakeroot make-kpkg --revision=1 --initrd kernel_image
\end{commandline}
initrd
\end{frame}
\begin{frame}[containsverbatim]{-j
}
\end{frame}
\begin{frame}[containsverbatim]{-j }
make-kpkg \texttt{DEBIAN\_KERNEL\_JOBS}
-j8
\begin{commandline}
$ make-kpkg --revision=test00 kernel_image DEBIAN_KERNEL_JOBS=8
\end{commandline}
\end{frame}
\begin{frame}[containsverbatim]{linux-kbuild-2.6
}
\end{frame}
\begin{frame}[containsverbatim]{linux-kbuild-2.6
}
\begin{itemize}
\item linux-kbuild-2.6\\
experimental
\item
\item \\
\url{http://wiki.debian.org/<API key>#<API key>.6}
2.6.33 (\#573176)
\end{itemize}
\end{frame}
\begin{frame}[containsverbatim]{
}
\end{frame}
\begin{frame}[containsverbatim]{
}
\url{http://kernel-archive.buildserver.net}
\end{frame}
\begin{frame}[containsverbatim]{}
\begin{itemize}
\item Debian
\item
\item
\item
\item
\item git git
\end{itemize}
\end{frame}
%
\emtext{mozcDebian}
%
\begin{frame}
Google \texttt{mozc}
DebianDebian
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
twitter DebianUbuntu
\end{frame}
\begin{frame}
\begin{itemize}
\item debian/rules \\
debuild
\item
\item ITP
\item Debian $<-$
\end{itemize}
\end{frame}
%\begin{frame}
%Debian Debian
%\end{frame}
\begin{frame}{}
\begin{enumerate}
\item
\item ITP / RFP /
\item
\item
%DFSG\\
% DFSG\\
\item
%\\
% =
\item ITP
%
\item \\
%\\
%
piuparts, pbuilder, lintian, debhelper etc...
\item Debian
\item FTP master
\item Debian
\end{enumerate}
\end{frame}
\begin{frame}{}
\end{frame}
\begin{frame}
\begin{itemize}
\item \\
debian/changelog \\
0.11
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item \\
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item gyp \\
gyp \\
Debian\\
gyp Debian
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item protobuf \\
protobuf \\
Debian
protobuf
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item rx \\
rx apache license copyright \\
rx Debian
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item gtest Debian\\
gtest
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item ibus\\
mozc \\
mozc BTS 1
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item ibus
\\
pkg-configmozc BTS
\end{itemize}
\end{frame}
\begin{frame}
\begin{itemize}
\item \texttt{base/scoped\_ptr.h} BSD\\
License\: Boost Software License - Version 1.0 \\
debian/copyright
\end{itemize}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\begin{itemize}
\item protobuf
\item gtest
\item gyp
\item iBus
\end{itemize}
\end{frame}
\begin{frame}
DebianDebian
\end{frame}
\begin{frame}{}
\begin{itemize}
\item 2010619: \\
\item 2010626: OSC 2010 \\
\end{itemize}
\end{frame}
\end{document}
;;; Local Variables: ***
;;; outline-regexp: "\\([ ]*\\\\\\(documentstyle\\|documentclass\\|emtext\\|section\\|begin{frame}\\)\\*?[ ]*[[{]\\|[]+\\)" ***
;;; End: *** |
require 'timeout'
module WEBrick_Testing
class DummyLog < WEBrick::BasicLog
def initialize() super(self) end
def <<(*args) end
end
def start_server(config={})
raise "already started" if defined?(@__server) && @__server
@__started = false
@__server_thread = Thread.new {
@__server = WEBrick::HTTPServer.new(
{
:BindAddress => "localhost",
:Logger => DummyLog.new,
:AccessLog => [],
:StartCallback => proc { @__started = true }
}.update(config))
yield @__server
begin
@__server.start
rescue IOError => e
assert_match(/closed/, e.message)
ensure
@__started = false
end
}
Timeout.timeout(5) {
Thread.pass until @__started # wait until the server is ready
}
end
def stop_server
Timeout.timeout(5) {
@__server.shutdown
Thread.pass while @__started # wait until the server is down
}
@__server_thread.join
@__server = nil
end
end |
<strong></strong> |
(function(f, define){
define([ "./kendo.core" ], f);
})(function(){
(function ($, undefined) {
var kendo = window.kendo,
support = kendo.support,
document = window.document,
Class = kendo.Class,
Observable = kendo.Observable,
now = $.now,
extend = $.extend,
OS = support.mobileOS,
invalidZeroEvents = OS && OS.android,
DEFAULT_MIN_HOLD = 800,
DEFAULT_THRESHOLD = support.browser.msie ? 5 : 0, // WP8 and W8 are very sensitive and always report move.
// UserEvents events
PRESS = "press",
HOLD = "hold",
SELECT = "select",
START = "start",
MOVE = "move",
END = "end",
CANCEL = "cancel",
TAP = "tap",
RELEASE = "release",
GESTURESTART = "gesturestart",
GESTURECHANGE = "gesturechange",
GESTUREEND = "gestureend",
GESTURETAP = "gesturetap";
var THRESHOLD = {
"api": 0,
"touch": 0,
"mouse": 9,
"pointer": 9
};
var <API key> = (!support.touch || support.<API key>);
function touchDelta(touch1, touch2) {
var x1 = touch1.x.location,
y1 = touch1.y.location,
x2 = touch2.x.location,
y2 = touch2.y.location,
dx = x1 - x2,
dy = y1 - y2;
return {
center: {
x: (x1 + x2) / 2,
y: (y1 + y2) / 2
},
distance: Math.sqrt(dx*dx + dy*dy)
};
}
function getTouches(e) {
var touches = [],
originalEvent = e.originalEvent,
currentTarget = e.currentTarget,
idx = 0, length,
changedTouches,
touch;
if (e.api) {
touches.push({
id: 2, // hardcoded ID for API call;
event: e,
target: e.target,
currentTarget: e.target,
location: e,
type: "api"
});
}
else if (e.type.match(/touch/)) {
changedTouches = originalEvent ? originalEvent.changedTouches : [];
for (length = changedTouches.length; idx < length; idx ++) {
touch = changedTouches[idx];
touches.push({
location: touch,
event: e,
target: touch.target,
currentTarget: currentTarget,
id: touch.identifier,
type: "touch"
});
}
}
else if (support.pointers || support.msPointers) {
touches.push({
location: originalEvent,
event: e,
target: e.target,
currentTarget: currentTarget,
id: originalEvent.pointerId,
type: "pointer"
});
} else {
touches.push({
id: 1, // hardcoded ID for mouse event;
event: e,
target: e.target,
currentTarget: currentTarget,
location: e,
type: "mouse"
});
}
return touches;
}
var TouchAxis = Class.extend({
init: function(axis, location) {
var that = this;
that.axis = axis;
that._updateLocationData(location);
that.startLocation = that.location;
that.velocity = that.delta = 0;
that.timeStamp = now();
},
move: function(location) {
var that = this,
offset = location["page" + that.axis],
timeStamp = now(),
timeDelta = (timeStamp - that.timeStamp) || 1; // Firing manually events in tests can make this 0;
if (!offset && invalidZeroEvents) {
return;
}
that.delta = offset - that.location;
that._updateLocationData(location);
that.initialDelta = offset - that.startLocation;
that.velocity = that.delta / timeDelta;
that.timeStamp = timeStamp;
},
_updateLocationData: function(location) {
var that = this, axis = that.axis;
that.location = location["page" + axis];
that.client = location["client" + axis];
that.screen = location["screen" + axis];
}
});
var Touch = Class.extend({
init: function(userEvents, target, touchInfo) {
extend(this, {
x: new TouchAxis("X", touchInfo.location),
y: new TouchAxis("Y", touchInfo.location),
type: touchInfo.type,
threshold: userEvents.threshold || THRESHOLD[touchInfo.type],
userEvents: userEvents,
target: target,
currentTarget: touchInfo.currentTarget,
initialTouch: touchInfo.target,
id: touchInfo.id,
pressEvent: touchInfo,
_moved: false,
_finished: false
});
},
press: function() {
this._holdTimeout = setTimeout($.proxy(this, "_hold"), this.userEvents.minHold);
this._trigger(PRESS, this.pressEvent);
},
_hold: function() {
this._trigger(HOLD, this.pressEvent);
},
move: function(touchInfo) {
var that = this;
if (that._finished) { return; }
that.x.move(touchInfo.location);
that.y.move(touchInfo.location);
if (!that._moved) {
if (that.<API key>()) {
return;
}
if (!UserEvents.current || UserEvents.current === that.userEvents) {
that._start(touchInfo);
} else {
return that.dispose();
}
}
// Event handlers may cancel the drag in the START event handler, hence the double check for pressed.
if (!that._finished) {
that._trigger(MOVE, touchInfo);
}
},
end: function(touchInfo) {
var that = this;
that.endTime = now();
if (that._finished) { return; }
// Mark the object as finished if there are blocking operations in the event handlers (alert/confirm)
that._finished = true;
that._trigger(RELEASE, touchInfo); // Release should be fired before TAP (as click is after mouseup/touchend)
if (that._moved) {
that._trigger(END, touchInfo);
} else {
that._trigger(TAP, touchInfo);
}
clearTimeout(that._holdTimeout);
that.dispose();
},
dispose: function() {
var userEvents = this.userEvents,
activeTouches = userEvents.touches;
this._finished = true;
this.pressEvent = null;
clearTimeout(this._holdTimeout);
activeTouches.splice($.inArray(this, activeTouches), 1);
},
skip: function() {
this.dispose();
},
cancel: function() {
this.dispose();
},
isMoved: function() {
return this._moved;
},
_start: function(touchInfo) {
clearTimeout(this._holdTimeout);
this.startTime = now();
this._moved = true;
this._trigger(START, touchInfo);
},
_trigger: function(name, touchInfo) {
var that = this,
jQueryEvent = touchInfo.event,
data = {
touch: that,
x: that.x,
y: that.y,
target: that.target,
event: jQueryEvent
};
if(that.userEvents.notify(name, data)) {
jQueryEvent.preventDefault();
}
},
<API key>: function() {
var xDelta = this.x.initialDelta,
yDelta = this.y.initialDelta;
return Math.sqrt(xDelta * xDelta + yDelta * yDelta) <= this.threshold;
}
});
function withEachUpEvent(callback) {
var downEvents = kendo.eventMap.up.split(" "),
idx = 0,
length = downEvents.length;
for(; idx < length; idx ++) {
callback(downEvents[idx]);
}
}
var UserEvents = Observable.extend({
init: function(element, options) {
var that = this,
filter,
ns = kendo.guid();
options = options || {};
filter = that.filter = options.filter;
that.threshold = options.threshold || DEFAULT_THRESHOLD;
that.minHold = options.minHold || DEFAULT_MIN_HOLD;
that.touches = [];
that._maxTouches = options.multiTouch ? 2 : 1;
that.allowSelection = options.allowSelection;
that.captureUpIfMoved = options.captureUpIfMoved;
that.eventNS = ns;
element = $(element).handler(that);
Observable.fn.init.call(that);
extend(that, {
element: element,
// the touch events lock to the element anyway, so no need for the global setting
surface: options.global && <API key> ? $(document.documentElement) : $(options.surface || element),
stopPropagation: options.stopPropagation,
pressed: false
});
that.surface.handler(that)
.on(kendo.applyEventMap("move", ns), "_move")
.on(kendo.applyEventMap("up cancel", ns), "_end");
element.on(kendo.applyEventMap("down", ns), filter, "_start");
if (support.pointers || support.msPointers) {
element.css("-ms-touch-action", "pinch-zoom double-tap-zoom");
}
if (options.preventDragEvent) {
element.on(kendo.applyEventMap("dragstart", ns), kendo.preventDefault);
}
element.on(kendo.applyEventMap("mousedown", ns), filter, { root: element }, "_select");
if (that.captureUpIfMoved && support.eventCapture) {
var surfaceElement = that.surface[0],
<API key> = $.proxy(that.preventIfMoving, that);
withEachUpEvent(function(eventName) {
surfaceElement.addEventListener(eventName, <API key>, true);
});
}
that.bind([
PRESS,
HOLD,
TAP,
START,
MOVE,
END,
RELEASE,
CANCEL,
GESTURESTART,
GESTURECHANGE,
GESTUREEND,
GESTURETAP,
SELECT
], options);
},
preventIfMoving: function(e) {
if (this._isMoved()) {
e.preventDefault();
}
},
destroy: function() {
var that = this;
if (that._destroyed) {
return;
}
that._destroyed = true;
if (that.captureUpIfMoved && support.eventCapture) {
var surfaceElement = that.surface[0];
withEachUpEvent(function(eventName) {
surfaceElement.removeEventListener(eventName, that.preventIfMoving);
});
}
that.element.kendoDestroy(that.eventNS);
that.surface.kendoDestroy(that.eventNS);
that.element.removeData("handler");
that.surface.removeData("handler");
that._disposeAll();
that.unbind();
delete that.surface;
delete that.element;
delete that.currentTarget;
},
capture: function() {
UserEvents.current = this;
},
cancel: function() {
this._disposeAll();
this.trigger(CANCEL);
},
notify: function(eventName, data) {
var that = this,
touches = that.touches;
if (this._isMultiTouch()) {
switch(eventName) {
case MOVE:
eventName = GESTURECHANGE;
break;
case END:
eventName = GESTUREEND;
break;
case TAP:
eventName = GESTURETAP;
break;
}
extend(data, {touches: touches}, touchDelta(touches[0], touches[1]));
}
return this.trigger(eventName, extend(data, {type: eventName}));
},
// API
press: function(x, y, target) {
this._apiCall("_start", x, y, target);
},
move: function(x, y) {
this._apiCall("_move", x, y);
},
end: function(x, y) {
this._apiCall("_end", x, y);
},
_isMultiTouch: function() {
return this.touches.length > 1;
},
_maxTouchesReached: function() {
return this.touches.length >= this._maxTouches;
},
_disposeAll: function() {
var touches = this.touches;
while (touches.length > 0) {
touches.pop().dispose();
}
},
_isMoved: function() {
return $.grep(this.touches, function(touch) {
return touch.isMoved();
}).length;
},
_select: function(e) {
if (!this.allowSelection || this.trigger(SELECT, { event: e })) {
e.preventDefault();
}
},
_start: function(e) {
var that = this,
idx = 0,
filter = that.filter,
target,
touches = getTouches(e),
length = touches.length,
touch,
which = e.which;
if ((which && which > 1) || (that._maxTouchesReached())){
return;
}
UserEvents.current = null;
that.currentTarget = e.currentTarget;
if (that.stopPropagation) {
e.stopPropagation();
}
for (; idx < length; idx ++) {
if (that._maxTouchesReached()) {
break;
}
touch = touches[idx];
if (filter) {
target = $(touch.currentTarget); // target.is(filter) ? target : target.closest(filter, that.element);
} else {
target = that.element;
}
if (!target.length) {
continue;
}
touch = new Touch(that, target, touch);
that.touches.push(touch);
touch.press();
if (that._isMultiTouch()) {
that.notify("gesturestart", {});
}
}
},
_move: function(e) {
this._eachTouch("move", e);
},
_end: function(e) {
this._eachTouch("end", e);
},
_eachTouch: function(methodName, e) {
var that = this,
dict = {},
touches = getTouches(e),
activeTouches = that.touches,
idx,
touch,
touchInfo,
matchingTouch;
for (idx = 0; idx < activeTouches.length; idx ++) {
touch = activeTouches[idx];
dict[touch.id] = touch;
}
for (idx = 0; idx < touches.length; idx ++) {
touchInfo = touches[idx];
matchingTouch = dict[touchInfo.id];
if (matchingTouch) {
matchingTouch[methodName](touchInfo);
}
}
},
_apiCall: function(type, x, y, target) {
this[type]({
api: true,
pageX: x,
pageY: y,
clientX: x,
clientY: y,
target: $(target || this.element)[0],
stopPropagation: $.noop,
preventDefault: $.noop
});
}
});
UserEvents.defaultThreshold = function(value) {
DEFAULT_THRESHOLD = value;
};
UserEvents.minHold = function(value) {
DEFAULT_MIN_HOLD = value;
};
kendo.getTouches = getTouches;
kendo.touchDelta = touchDelta;
kendo.UserEvents = UserEvents;
})(window.kendo.jQuery);
return window.kendo;
}, typeof define == 'function' && define.amd ? define : function(_, f){ f(); }); |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Nets fall to the Pelicans 96 to 102, Quincy Pondexter scores 23</title>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
<h1>Nets fall to the Pelicans 96 to 102, Quincy Pondexter scores 23</h1>
</br>
<h2 style="color:gray">by NBANLP Recap Generator</h2>
</br></br>
<img src="../img/03/01.jpg" alt="No image loaded" align="right" style="height:50%; width:50%;margin-left:20px;margin-bottom:20px;">
<p>Quincy Pondexter played well, recording 23 points for the Pelicans. The Pelicans largest lead was by 11 with 5 minutes remaining in the 1st. Joe Johnson proved key, as he put up 19 points for the Nets.</p>
<p>Quincy made contributions in scoring with 23 points for the Pelicans. Pondexter got 2 assists and 5 rebounds.</p>
<p>The Pelicans led by as much as 11 in the 1st with a 15-4 lead.</p>
<p>Joe led the Nets in scoring with 19 points. Johnson got 1 assists and 10 rebounds for the Nets. 12 of his points occurred in the 3rd quarter.</p>
<p>Pondexter recorded his last foul with 4:07 remaining in the 4th quarter.</p>
<p>The result puts New Orleans at 30-27 for the season. The Nets are now 23-32. The Pelicans have been playing great these last few games, winning their last 3.</p>
<p>Tyreke Evans recorded 11 points. Evans contributed 11 assists and 4 rebounds for the Pelicans.
Omer Asik, Dante Cunningham, and Norris Cole totaled 30 points for the Pelicans, putting up 8, 11, and 11 points respectively. Asik contributed 1 assists and 13 rebounds for the Pelicans. Cunningham contributed 1 assists and 7 rebounds for the Pelicans. Cole got 3 assists and 2 rebounds.
Jarrett Jack, Thaddeus Young, and Deron Williams totaled 38 points for the Nets, putting up 15, 13, and 10 points respectively. Jack got 3 assists and 3 rebounds for the Nets. Young got 5 rebounds for the Nets. Williams contributed 6 assists and 1 rebounds for the Nets.</p>
</body>
</html> |
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <mach/iomap.h>
#include <mach/irqs.h>
#define MC_INT_STATUS 0x0
#define MC_INT_MASK 0x4
#define <API key> (1<<6)
#define <API key> (1<<7)
#define <API key> (1<<8)
#define <API key> 0x30
#define <API key> 0x34
#define <API key> 0x58
#define <API key> 0x5c
#define <API key> 0x74
#define <API key> 0x78
struct mc_client {
bool write;
const char *name;
};
#define client(_name,_write) \
{ \
.write = _write, \
.name = _name, \
}
static const struct mc_client mc_clients[] = {
client("display0_wina", false), client("display1_wina", false),
client("display0_winb", false), client("display1_winb", false),
client("display0_winc", false), client("display1_winc", false),
client("<API key>", false),
client("<API key>", false),
client("epp", false), client("gr2d_pat", false),
client("gr2d_src", false), client("mpe_unified", false),
client("vi_chroma_filter", false), client("cop", false),
client("display0_cursor", false), client("display1_cursor", false),
client("gr3d_fdc", false), client("gr2d_dst", false),
client("host1x_dma", false), client("host1x_generic", false),
client("gr3d_idx", false), client("cpu_uncached", false),
client("mpe_intrapred", false), client("mpe_mpea", false),
client("mpe_mpec", false), client("ahb_dma", false),
client("ahb_slave", false), client("gr3d_tex", false),
client("vde_bsev", false), client("vde_mbe", false),
client("vde_mce", false), client("vde_tpe", false),
client("epp_u", true), client("epp_v", true),
client("epp_y", true), client("mpe_unified", true),
client("vi_sb", true), client("vi_u", true),
client("vi_v", true), client("vi_y", true),
client("gr2d_dst", true), client("gr3d_fdc", true),
client("host1x", true), client("isp", true),
client("cpu_uncached", true), client("mpe_mpec", true),
client("ahb_dma", true), client("ahb_slave", true),
client("avp_bsev", true), client("avp_mbe", true),
client("avp_tpm", true),
};
static DEFINE_SPINLOCK(mc_lock);
static unsigned long error_count = 0;
#define MAX_PRINTS 5
static void unthrottle_prints(struct work_struct *work)
{
unsigned long flags;
spin_lock_irqsave(&mc_lock, flags);
error_count = 0;
<API key>(&mc_lock, flags);
}
static <API key>(<API key>, unthrottle_prints);
static irqreturn_t tegra_mc_error_isr(int irq, void *data)
{
void __iomem *mc = IO_ADDRESS(TEGRA_MC_BASE);
unsigned long count;
u32 stat;
stat = readl(mc + MC_INT_STATUS);
stat &= (<API key> |
<API key> |
<API key>);
cancel_delayed_work(&<API key>);
spin_lock(&mc_lock);
count = ++error_count;
spin_unlock(&mc_lock);
if (count >= MAX_PRINTS) {
if (count == MAX_PRINTS)
pr_err("Too many MC errors; throttling prints\n");
<API key>(&<API key>, HZ/2);
goto out;
}
if (stat & <API key>) {
const struct mc_client *client = NULL;
u32 addr, req;
req = readl(mc + <API key>);
addr = readl(mc + <API key>);
req &= 0x3f;
if (req < ARRAY_SIZE(mc_clients))
client = &mc_clients[req];
pr_err("MC_DECERR: %p %s (%s)\n", (void*)addr,
(client) ? client->name : "unknown",
(client && client->write) ? "write" : "read");
}
if (stat & <API key>) {
const struct mc_client *client = NULL;
u32 addr, req;
req = readl(mc + <API key>);
addr = readl(mc + <API key>);
req = (req >> 1) & 0x3f;
if (req < ARRAY_SIZE(mc_clients))
client = &mc_clients[req];
pr_err("MC_GART_ERR: %p %s (%s)\n", (void*)addr,
(client) ? client->name : "unknown",
(client && client->write) ? "write" : "read");
}
if (stat & <API key>) {
const struct mc_client *client = NULL;
const char *type = NULL;
u32 addr, req;
req = readl(mc + <API key>);
addr = readl(mc + <API key>);
type = (req & (1<<30)) ? "carveout" : "trustzone";
req &= 0x3f;
if (req < ARRAY_SIZE(mc_clients))
client = &mc_clients[req];
pr_err("MC_SECURITY_ERR (%s): %p %s (%s)\n", type, (void*)addr,
(client) ? client->name : "unknown",
(client && client->write) ? "write" : "read");
}
out:
writel(stat, mc + MC_INT_STATUS);
return IRQ_HANDLED;
}
void __init tegra_mc_init(void)
{
if (request_irq(INT_MC_GENERAL, tegra_mc_error_isr, 0,
"mc_status", NULL)) {
pr_err("%s: unable to register MC error interrupt\n", __func__);
} else {
void __iomem *mc = IO_ADDRESS(TEGRA_MC_BASE);
u32 reg = <API key> | <API key> |
<API key>;
writel(reg, mc + MC_INT_MASK);
}
} |
#ifndef SMSTRADEURL_H
#define SMSTRADEURL_H
#include "ISmsGateway.h"
#include <map>
#include <boost/asio.hpp>
using namespace std;
class SmsTradeUrl : public ISmsGateway
{
private:
static const string name;
boost::asio::io_service io_service;
string gateway;
string key;
string route; // Auswahl der SMS-Route (basic|economy|gold|direct)
string from; // Absenderkennung der SMS (String, bis zu 11 Zeichen; Integer, bis zu 16 Zeichen)
void <API key>();
string <API key>( const string& msg, const string& receivers );
string UrlEncode(const string& input);
void _io_service();
public:
SmsTradeUrl();
SmsTradeUrl ( const SmsTradeUrl& other );
~SmsTradeUrl();
static const string GetGatewayName();
string GetName() const;
SmsTradeUrl& operator= ( const SmsTradeUrl& other );
void SendMessage( const string& receivers, const string& msg );
void SendMessage( const string& to, const string& msg, const map< string, string >& options );
};
#endif // SMSTRADEURL_H |
#include <linux/debugfs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/sipc.h>
#include "sipc_debugfs.h"
#if defined(CONFIG_DEBUG_FS)
extern int sipx_init_debugfs( void *root );
static int __init sipc_init_debugfs(void)
{
struct dentry *root = debugfs_create_dir("sipc", NULL);
if (!root)
return -ENXIO;
smsg_init_debugfs(root);
#if defined(<API key>)
smsgc_init_debugfs(root);
#endif
sbuf_init_debugfs(root);
sblock_init_debugfs(root);
#ifdef <API key>
sipx_init_debugfs(root);
#endif
smem_init_debugfs(root);
return 0;
}
device_initcall(sipc_init_debugfs);
#endif /* CONFIG_DEBUG_FS */ |
<?php
/* core/themes/classy/templates/field/field--comment.html.twig */
class <API key> extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("set" => 29, "if" => 44);
$filters = array("clean_class" => 31, "t" => 53);
$functions = array();
try {
$this->env->getExtension('<API key>')->checkSecurity(
array('set', 'if'),
array('clean_class', 't'),
array()
);
} catch (<API key> $e) {
$e->setTemplateName($this->getTemplateName());
if ($e instanceof <API key> && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof <API key> && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof <API key> && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 29
$context["classes"] = array(0 => "field", 1 => ("field--name-" . \Drupal\Component\Utility\Html::getClass( // line 31
($context["field_name"] ?? null))), 2 => ("field--type-" . \Drupal\Component\Utility\Html::getClass( // line 32
($context["field_type"] ?? null))), 3 => ("field--label-" . // line 33
($context["label_display"] ?? null)), 4 => "comment-wrapper");
// line 38
$context["title_classes"] = array(0 => "title", 1 => ((( // line 40
($context["label_display"] ?? null) == "visually_hidden")) ? ("visually-hidden") : ("")));
// line 43
echo "<section";
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["attributes"] ?? null), "addClass", array(0 => ($context["classes"] ?? null)), "method"), "html", null, true));
echo ">
";
// line 44
if ((($context["comments"] ?? null) && !($context["label_hidden"] ?? null))) {
// line 45
echo " ";
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_prefix"] ?? null), "html", null, true));
echo "
<h2";
// line 46
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, $this->getAttribute(($context["title_attributes"] ?? null), "addClass", array(0 => ($context["title_classes"] ?? null)), "method"), "html", null, true));
echo ">";
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["label"] ?? null), "html", null, true));
echo "</h2>
";
// line 47
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["title_suffix"] ?? null), "html", null, true));
echo "
";
}
// line 49
echo "
";
// line 50
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["comments"] ?? null), "html", null, true));
echo "
";
// line 52
if (($context["comment_form"] ?? null)) {
// line 53
echo " <h2 class=\"title comment-form__title\">";
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->renderVar(t("Add new comment")));
echo "</h2>
";
// line 54
echo $this->env->getExtension('<API key>')-><API key>($this->env->getExtension('Drupal\Core\Template\TwigExtension')->escapeFilter($this->env, ($context["comment_form"] ?? null), "html", null, true));
echo "
";
}
// line 56
echo "
</section>
";
}
public function getTemplateName()
{
return "core/themes/classy/templates/field/field--comment.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 94 => 56, 89 => 54, 84 => 53, 82 => 52, 77 => 50, 74 => 49, 69 => 47, 63 => 46, 58 => 45, 56 => 44, 51 => 43, 49 => 40, 48 => 38, 46 => 33, 45 => 32, 44 => 31, 43 => 29,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("", "core/themes/classy/templates/field/field--comment.html.twig", "/var/www/d8/core/themes/classy/templates/field/field--comment.html.twig");
}
} |
#pragma once
#if ! defined(<API key>)
#include <boost/function.hpp>
#include <boost/bind.hpp>
#endif
#include <event2/event.h>
#include <vector>
#include "DeferredCallerImpl.h"
#include "BaseObjectAllocator.h"
namespace coconut {
class <API key>
: public DeferredCallerImpl
, public BaseObjectAllocator<<API key>>
{
public:
<API key>() : DeferredCallerImpl() { }
<API key>(boost::shared_ptr<IOService> ioService)
: DeferredCallerImpl(ioService), eventDeferred_(NULL) {
createHandle();
}
~<API key>() {
_LOG_TRACE("~<API key> %p %p\n", this, eventDeferred_);
destroyHandle();
}
void initialize(boost::shared_ptr<IOService> ioService) {
ioService_ = ioService;
createHandle();
}
void createHandle() {
eventDeferred_ = event_new((struct event_base *)ioService_->coreHandle(), -1, EV_READ|EV_PERSIST, cb_func, this);
}
void destroyHandle() {
if(eventDeferred_) {
event_free(eventDeferred_);
eventDeferred_ = NULL;
}
}
void <API key>() {
event_active(eventDeferred_, EV_READ, 1);
}
private:
static void cb_func(coconut_socket_t fd, short what, void *arg) {
<API key> *SELF = (<API key> *)arg;
SELF->fireDeferredEvent();
}
private:
struct event *eventDeferred_;
};
} |
<?php
namespace Drupal\od_ext_user\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
/**
* Listens to the dynamic route events.
*/
class UserRouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
// Change the title of the user registration page.
if ($route = $collection->get('user.register')) {
$route->setDefaults([
'_entity_form' => 'user.register',
'_title' => 'Registration Page',
]);
}
$path = '/admin/help';
foreach ($collection->all() as $route) {
if (substr($route->getPath(), 0, 11) == $path) {
$route->setRequirement(
'_custom_access',
'\Drupal\od_ext_user\AccessChecks\UserAccessChecks::access'
);
}
}
}
} |
# Tree of Savior Addon Manager
Tree of Savior Addon Manager is an application that allows you to easily find and downloads addons and keep them up to date. This does all of the work for you so you can simply worry about playing the game.

# Download / Install
If you have previous addons installed from before using this, it's best to delete them all and start from scratch using this app. This includes the `addons` folder and all of the previous ipfs (including `SumAni.ipf`!). No more loaders needed. If you are still using @fiote's addons, you'll still need the old `SumAni.ipf` as it's a dependency for it and those aren't finished being converted yet.
Grab the [latest release](https://github.com/Excrulon/<API key>/releases/latest), extract it, and run `Tree of Savior Addon Manager.exe`.
# FAQ
* Why is the size of the manager so large?
This is an app made using [Electron](http:
* After deleting the `addons` folder, an `Addon Loader` button is stuck on my screen. What do I do?
Make sure to delete `SumAni.ipf` from the `data` folder. This has an addon inside it that's responsible for creating that button. If you are using @fiote's addons, you'll still need it to load his until he finishes converting his addons.
* The `Launch Tree of Savior` button doesn't work.
This button only works for the Steam version of Tree of Savior. If you're using another version, just launch the game how you always have.
* Starting over
If things ever get out of sync from some reason, you can find settings and addon cache in `%AppData%\<API key>`. Open the run prompt or Windows Explorer and type that path in to open it.
There are two files here named `settings.json` and `addons.json`. `settings.json` is responsible for saving your Tree of Savior directory location. `addons.json` is responsible for keeping track of the addons you have installed. If something goes wrong and things get out of sync, either manually make the changes in this file or delete that file and the installed ipfs manually and start over. Hopefully you won't really have to do this.
# Submitting Addons
Make a pull request to [Addons](https://github.com/<API key>/Addons) in order to update `addons.json` to point to your addon repository. Example:
json
{
"sources" : [
{
"repo" : "Excrulon/Test-Addon"
},
{
"repo" : "TehSeph/tos-addons"
},
{
"repo" : "MizukiBelhi/ExtendedUI"
},
{
"repo" : "Miei/TOS-lua"
}
]
}
Then, in your own repo where your addon lives, create an `addons.json` that describes your packages.
json
[
{
"name" : "Experience Viewer",
"file" : "experienceviewer",
"extension" : "ipf",
"fileVersion" : "v1.0.0",
"releaseTag" : "v1.0.0",
"unicode" : "",
"description" : "Displays various experience values such as current experience, required experience, current percent, experience gained on last kill, kills til next level, experience per hour, and estimated time until level up.",
"tags" : [
"experience",
"ui"
]
},
{
"name" : "Map Fog Viewer",
"file" : "mapfogviewer",
"extension" : "ipf",
"fileVersion" : "v1.0.0",
"releaseTag" : "v1.0.0",
"unicode" : "",
"description" : "Displays the fog on the map as red tiles instead of the hard to see default fog. Makes exploration really easy!",
"tags" : [
"map",
"minimap",
"fog",
"exploration"
]
}
]
`name`: The name of your addon. This can be anything you want.
`releaseTag`: The tag name of your release.
`fileVersion`: The version of your addon. All `fileVersion`s need to follow [semantic versions](http://semver.org/) in order for updates to be processed properly.
`file`: The filename of your addon in the release, minus the extension. This should never change once submitted.
`extension`: The extension of your addon in the release. For now, only `ipf` is supported.
`unicode`: The unicode character you want to use in your downloaded addon filename.
`description`: A detailed description of your addon.
`tags`: A list of keywords that describes what your addon is for searching. |
return {
<API key> = {},
} |
#include "ConditionMgr.h"
#include "AchievementMgr.h"
#include "Containers.h"
#include "DatabaseEnv.h"
#include "DB2Stores.h"
#include "GameEventMgr.h"
#include "GameObject.h"
#include "Group.h"
#include "InstanceScript.h"
#include "Item.h"
#include "Log.h"
#include "LootMgr.h"
#include "Map.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "Pet.h"
#include "ReputationMgr.h"
#include "ScriptMgr.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "World.h"
#include "WorldSession.h"
char const* const ConditionMgr::<API key>[<API key>] =
{
"None",
"Creature Loot",
"Disenchant Loot",
"Fishing Loot",
"GameObject Loot",
"Item Loot",
"Mail Loot",
"Milling Loot",
"Pickpocketing Loot",
"Prospecting Loot",
"Reference Loot",
"Skinning Loot",
"Spell Loot",
"Spell Impl. Target",
"Gossip Menu",
"Gossip Menu Option",
"Creature Vehicle",
"Spell Expl. Target",
"Spell Click Event",
"Quest Available",
"Unused",
"Vehicle Spell",
"SmartScript",
"Npc Vendor",
"Spell Proc",
"Terrain Swap",
"Phase"
};
ConditionMgr::ConditionTypeInfo const ConditionMgr::<API key>[CONDITION_MAX] =
{
{ "None", false, false, false },
{ "Aura", true, true, true },
{ "Item Stored", true, true, true },
{ "Item Equipped", true, false, false },
{ "Zone", true, false, false },
{ "Reputation", true, true, false },
{ "Team", true, false, false },
{ "Skill", true, true, false },
{ "Quest Rewarded", true, false, false },
{ "Quest Taken", true, false, false },
{ "Drunken", true, false, false },
{ "WorldState", true, true, false },
{ "Active Event", true, false, false },
{ "Instance Info", true, true, true },
{ "Quest None", true, false, false },
{ "Class", true, false, false },
{ "Race", true, false, false },
{ "Achievement", true, false, false },
{ "Title", true, false, false },
{ "SpawnMask", true, false, false },
{ "Gender", true, false, false },
{ "Unit State", true, false, false },
{ "Map", true, false, false },
{ "Area", true, false, false },
{ "CreatureType", true, false, false },
{ "Spell Known", true, false, false },
{ "Phase", true, false, false },
{ "Level", true, true, false },
{ "Quest Completed", true, false, false },
{ "Near Creature", true, true, true },
{ "Near GameObject", true, true, false },
{ "Object Entry or Guid", true, true, true },
{ "Object TypeMask", true, false, false },
{ "Relation", true, true, false },
{ "Reaction", true, true, false },
{ "Distance", true, true, true },
{ "Alive", false, false, false },
{ "Health Value", true, true, false },
{ "Health Pct", true, true, false },
{ "Realm Achievement", true, false, false },
{ "In Water", false, false, false },
{ "Terrain Swap", true, false, false },
{ "Sit/stand state", true, true, false },
{ "Daily Quest Completed",true, false, false },
{ "Charmed", false, false, false },
{ "Pet type", true, false, false },
{ "On Taxi", false, false, false },
{ "Quest state mask", true, true, false },
{ "Objective Complete", true, false, false }
};
// Checks if object meets the condition
// Can have <API key> && !mReferenceId if called from a special event (ie: SmartAI)
bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
{
ASSERT(ConditionTarget < <API key>);
WorldObject* object = sourceInfo.mConditionTargets[ConditionTarget];
// object not present, return false
if (!object)
{
TC_LOG_DEBUG("condition", "Condition object not found for %s", ToString().c_str());
return false;
}
bool condMeets = false;
switch (ConditionType)
{
case CONDITION_NONE:
condMeets = true; // empty condition, always met
break;
case CONDITION_AURA:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
break;
}
case CONDITION_ITEM:
{
if (Player* player = object->ToPlayer())
{
// don't allow 0 items (it's checked during table load)
ASSERT(ConditionValue2);
bool checkBank = ConditionValue3 ? true : false;
condMeets = player->HasItemCount(ConditionValue1, ConditionValue2, checkBank);
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
condMeets = player-><API key>(ConditionValue1, 1);
break;
}
case CONDITION_ZONEID:
condMeets = object->GetZoneId() == ConditionValue1;
break;
case <API key>:
{
if (Player* player = object->ToPlayer())
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(ConditionValue1))
condMeets = (ConditionValue2 & (1 << player->GetReputationMgr().GetRank(faction))) != 0;
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
condMeets = player->HasAchieved(ConditionValue1);
break;
}
case CONDITION_TEAM:
{
if (Player* player = object->ToPlayer())
condMeets = player->GetTeam() == ConditionValue1;
break;
}
case CONDITION_CLASS:
{
if (Unit* unit = object->ToUnit())
condMeets = (unit->getClassMask() & ConditionValue1) != 0;
break;
}
case CONDITION_RACE:
{
if (Unit* unit = object->ToUnit())
condMeets = (unit->getRaceMask() & ConditionValue1) != 0;
break;
}
case CONDITION_GENDER:
{
if (Player* player = object->ToPlayer())
condMeets = player->getGender() == ConditionValue1;
break;
}
case CONDITION_SKILL:
{
if (Player* player = object->ToPlayer())
condMeets = player->HasSkill(ConditionValue1) && player->GetBaseSkillValue(ConditionValue1) >= ConditionValue2;
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
condMeets = player-><API key>(ConditionValue1);
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
{
QuestStatus status = player->GetQuestStatus(ConditionValue1);
condMeets = (status == <API key>);
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
{
QuestStatus status = player->GetQuestStatus(ConditionValue1);
condMeets = (status == <API key> && !player-><API key>(ConditionValue1));
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
{
QuestStatus status = player->GetQuestStatus(ConditionValue1);
condMeets = (status == QUEST_STATUS_NONE);
}
break;
}
case <API key>:
condMeets = sGameEventMgr->IsActiveEvent(ConditionValue1);
break;
case <API key>:
{
Map* map = object->GetMap();
if (map->IsDungeon())
{
if (InstanceScript const* instance = ((InstanceMap*)map)->GetInstanceScript())
{
switch (ConditionValue3)
{
case INSTANCE_INFO_DATA:
condMeets = instance->GetData(ConditionValue1) == ConditionValue2;
break;
//case <API key>:
// condMeets = instance->GetGuidData(ConditionValue1) == ObjectGuid(uint64(ConditionValue2));
// break;
case <API key>:
condMeets = instance->GetBossState(ConditionValue1) == EncounterState(ConditionValue2);
break;
case <API key>:
condMeets = instance->GetData64(ConditionValue1) == ConditionValue2;
break;
}
}
}
break;
}
case CONDITION_MAPID:
condMeets = object->GetMapId() == ConditionValue1;
break;
case CONDITION_AREAID:
condMeets = object->GetAreaId() == ConditionValue1;
break;
case CONDITION_SPELL:
{
if (Player* player = object->ToPlayer())
condMeets = player->HasSpell(ConditionValue1);
break;
}
case CONDITION_LEVEL:
{
if (Unit* unit = object->ToUnit())
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->getLevel()), ConditionValue1);
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
condMeets = (uint32)Player::<API key>(player->GetDrunkValue()) >= ConditionValue1;
break;
}
case <API key>:
{
condMeets = object->FindNearestCreature(ConditionValue1, (float)ConditionValue2, bool(!ConditionValue3)) != nullptr;
break;
}
case <API key>:
{
condMeets = object-><API key>(ConditionValue1, (float)ConditionValue2) != nullptr;
break;
}
case <API key>:
{
if (uint32(object->GetTypeId()) == ConditionValue1)
{
condMeets = !ConditionValue2 || (object->GetEntry() == ConditionValue2);
if (ConditionValue3)
{
switch (object->GetTypeId())
{
case TYPEID_UNIT:
condMeets &= object->ToCreature()->GetSpawnId() == ConditionValue3;
break;
case TYPEID_GAMEOBJECT:
condMeets &= object->ToGameObject()->GetSpawnId() == ConditionValue3;
break;
default:
break;
}
}
}
break;
}
case CONDITION_TYPE_MASK:
{
condMeets = object->isType(ConditionValue1);
break;
}
case <API key>:
{
if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
{
Unit* toUnit = toObject->ToUnit();
Unit* unit = object->ToUnit();
if (toUnit && unit)
{
switch (static_cast<RelationType>(ConditionValue2))
{
case RELATION_SELF:
condMeets = unit == toUnit;
break;
case RELATION_IN_PARTY:
condMeets = unit->IsInPartyWith(toUnit);
break;
case <API key>:
condMeets = unit->IsInRaidWith(toUnit);
break;
case RELATION_OWNED_BY:
condMeets = unit->GetOwnerGUID() == toUnit->GetGUID();
break;
case <API key>:
condMeets = unit->IsOnVehicle(toUnit);
break;
case RELATION_CREATED_BY:
condMeets = unit->GetCreatorGUID() == toUnit->GetGUID();
break;
default:
break;
}
}
}
break;
}
case <API key>:
{
if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
{
Unit* toUnit = toObject->ToUnit();
Unit* unit = object->ToUnit();
if (toUnit && unit)
condMeets = ((1 << unit->GetReactionTo(toUnit)) & ConditionValue2) != 0;
}
break;
}
case <API key>:
{
if (WorldObject* toObject = sourceInfo.mConditionTargets[ConditionValue1])
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue3), object->GetDistance(toObject), static_cast<float>(ConditionValue2));
break;
}
case CONDITION_ALIVE:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->IsAlive();
break;
}
case CONDITION_HP_VAL:
{
if (Unit* unit = object->ToUnit())
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), unit->GetHealth(), static_cast<uint64>(ConditionValue1));
break;
}
case CONDITION_HP_PCT:
{
if (Unit* unit = object->ToUnit())
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), unit->GetHealthPct(), static_cast<float>(ConditionValue1));
break;
}
case <API key>:
{
condMeets = ConditionValue2 == sWorld->getWorldState(ConditionValue1);
break;
}
case CONDITION_PHASEID:
{
condMeets = object->IsInPhase(ConditionValue1);
break;
}
case CONDITION_TITLE:
{
if (Player* player = object->ToPlayer())
condMeets = player->HasTitle(ConditionValue1);
break;
}
case CONDITION_SPAWNMASK:
{
condMeets = ((1 << object->GetMap()->GetSpawnMode()) & ConditionValue1) != 0;
break;
}
case <API key>:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->HasUnitState(ConditionValue1);
break;
}
case <API key>:
{
if (Creature* creature = object->ToCreature())
condMeets = creature->GetCreatureTemplate()->type == ConditionValue1;
break;
}
case <API key>:
{
AchievementEntry const* achievement = sAchievementStore.LookupEntry(ConditionValue1);
if (achievement && sAchievementMgr->IsRealmCompleted(achievement))
condMeets = true;
break;
}
case CONDITION_IN_WATER:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->IsInWater();
break;
}
case <API key>:
{
condMeets = object->IsInTerrainSwap(ConditionValue1);
break;
}
case <API key>:
{
if (Unit* unit = object->ToUnit())
{
if (ConditionValue1 == 0)
condMeets = (unit->GetStandState() == UnitStandStateType(ConditionValue2));
else if (ConditionValue2 == 0)
condMeets = unit->IsStandState();
else if (ConditionValue2 == 1)
condMeets = unit->IsSitState();
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
condMeets = player->IsDailyQuestDone(ConditionValue1);
break;
}
case CONDITION_CHARMED:
{
if (Unit* unit = object->ToUnit())
condMeets = unit->IsCharmed();
break;
}
case CONDITION_PET_TYPE:
{
if (Player* player = object->ToPlayer())
if (Pet* pet = player->GetPet())
condMeets = (((1 << pet->getPetType()) & ConditionValue1) != 0);
break;
}
case CONDITION_TAXI:
{
if (Player* player = object->ToPlayer())
condMeets = player->IsInFlight();
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
{
if (
((ConditionValue2 & (1 << QUEST_STATUS_NONE)) && (player->GetQuestStatus(ConditionValue1) == QUEST_STATUS_NONE)) ||
((ConditionValue2 & (1 << <API key>)) && (player->GetQuestStatus(ConditionValue1) == <API key>)) ||
((ConditionValue2 & (1 << <API key>)) && (player->GetQuestStatus(ConditionValue1) == <API key>)) ||
((ConditionValue2 & (1 << QUEST_STATUS_FAILED)) && (player->GetQuestStatus(ConditionValue1) == QUEST_STATUS_FAILED)) ||
((ConditionValue2 & (1 << <API key>)) && player-><API key>(ConditionValue1))
)
condMeets = true;
}
break;
}
case <API key>:
{
if (Player* player = object->ToPlayer())
{
QuestObjective const* obj = sObjectMgr->GetQuestObjective(ConditionValue1);
if (!obj)
break;
condMeets = (!player-><API key>(obj->QuestID) && player-><API key>(*obj));
}
break;
}
default:
condMeets = false;
break;
}
if (NegativeCondition)
condMeets = !condMeets;
if (!condMeets)
sourceInfo.<API key> = this;
bool script = sScriptMgr->OnConditionCheck(this, sourceInfo); // Returns true by default.
return condMeets && script;
}
uint32 Condition::<API key>() const
{
// build mask of types for which condition can return true
// this is used for speeding up gridsearches
if (NegativeCondition)
return (<API key>);
uint32 mask = 0;
switch (ConditionType)
{
case CONDITION_NONE:
mask |= <API key>;
break;
case CONDITION_AURA:
mask |= <API key> | <API key>;
break;
case CONDITION_ITEM:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_ZONEID:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_TEAM:
mask |= <API key>;
break;
case CONDITION_CLASS:
mask |= <API key> | <API key>;
break;
case CONDITION_RACE:
mask |= <API key> | <API key>;
break;
case CONDITION_SKILL:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_MAPID:
mask |= <API key>;
break;
case CONDITION_AREAID:
mask |= <API key>;
break;
case CONDITION_SPELL:
mask |= <API key>;
break;
case CONDITION_LEVEL:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
switch (ConditionValue1)
{
case TYPEID_UNIT:
mask |= <API key>;
break;
case TYPEID_PLAYER:
mask |= <API key>;
break;
case TYPEID_GAMEOBJECT:
mask |= <API key>;
break;
case TYPEID_CORPSE:
mask |= <API key>;
break;
case TYPEID_AREATRIGGER:
mask |= <API key>;
break;
default:
break;
}
break;
case CONDITION_TYPE_MASK:
if (ConditionValue1 & TYPEMASK_UNIT)
mask |= <API key> | <API key>;
if (ConditionValue1 & TYPEMASK_PLAYER)
mask |= <API key>;
if (ConditionValue1 & TYPEMASK_GAMEOBJECT)
mask |= <API key>;
if (ConditionValue1 & TYPEMASK_CORPSE)
mask |= <API key>;
if (ConditionValue1 & <API key>)
mask |= <API key>;
break;
case <API key>:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_ALIVE:
mask |= <API key> | <API key>;
break;
case CONDITION_HP_VAL:
mask |= <API key> | <API key>;
break;
case CONDITION_HP_PCT:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_PHASEID:
mask |= <API key>;
break;
case CONDITION_TITLE:
mask |= <API key>;
break;
case CONDITION_SPAWNMASK:
mask |= <API key>;
break;
case CONDITION_GENDER:
mask |= <API key>;
break;
case <API key>:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_IN_WATER:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key> | <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case CONDITION_CHARMED:
mask |= <API key> | <API key>;
break;
case CONDITION_PET_TYPE:
mask |= <API key>;
break;
case CONDITION_TAXI:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
case <API key>:
mask |= <API key>;
break;
default:
ASSERT(false && "Condition::<API key> - missing condition handling!");
break;
}
return mask;
}
uint32 Condition::<API key>() const
{
// returns number of targets which are available for given source type
switch (SourceType)
{
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
return 2;
default:
return 1;
}
}
std::string Condition::ToString(bool ext /*= false*/) const
{
std::ostringstream ss;
ss << "[Condition ";
ss << "SourceType: " << SourceType;
if (SourceType < <API key>)
ss << " (" << ConditionMgr::<API key>[SourceType] << ")";
else
ss << " (Unknown)";
if (ConditionMgr::<API key>(SourceType))
ss << ", SourceGroup: " << SourceGroup;
ss << ", SourceEntry: " << SourceEntry;
if (ConditionMgr::CanHaveSourceIdSet(SourceType))
ss << ", SourceId: " << SourceId;
if (ext)
{
ss << ", ConditionType: " << ConditionType;
if (ConditionType < CONDITION_MAX)
ss << " (" << ConditionMgr::<API key>[ConditionType].Name << ")";
else
ss << " (Unknown)";
}
ss << "]";
return ss.str();
}
ConditionMgr::ConditionMgr() { }
ConditionMgr::~ConditionMgr()
{
Clean();
}
uint32 ConditionMgr::<API key>(ConditionContainer const& conditions) const
{
if (conditions.empty())
return <API key>;
// groupId, typeMask
std::map<uint32, uint32> <API key>;
for (ConditionContainer::const_iterator i = conditions.begin(); i != conditions.end(); ++i)
{
// no point of having not loaded conditions in list
ASSERT((*i)->isLoaded() && "ConditionMgr::<API key> - not yet loaded condition found in list");
std::map<uint32, uint32>::const_iterator itr = <API key>.find((*i)->ElseGroup);
// group not filled yet, fill with widest mask possible
if (itr == <API key>.end())
<API key>[(*i)->ElseGroup] = <API key>;
// no point of checking anymore, empty mask
else if (!itr->second)
continue;
if ((*i)->ReferenceId) // handle reference
{
<API key>::const_iterator ref = <API key>.find((*i)->ReferenceId);
ASSERT(ref != <API key>.end() && "ConditionMgr::<API key> - incorrect reference");
<API key>[(*i)->ElseGroup] &= <API key>((*ref).second);
}
else // handle normal condition
{
// object will match conditions in one ElseGroupStore only when it matches all of them
// so, let's find a smallest possible mask which satisfies all conditions
<API key>[(*i)->ElseGroup] &= (*i)-><API key>();
}
}
// object will match condition when one of the checks in ElseGroupStore is matching
// so, let's include all possible masks
uint32 mask = 0;
for (std::map<uint32, uint32>::const_iterator i = <API key>.begin(); i != <API key>.end(); ++i)
mask |= i->second;
return mask;
}
bool ConditionMgr::<API key>(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions) const
{
// groupId, groupCheckPassed
std::map<uint32, bool> elseGroupStore;
for (Condition const* condition : conditions)
{
TC_LOG_DEBUG("condition", "ConditionMgr::<API key> %s val1: %u", condition->ToString().c_str(), condition->ConditionValue1);
if (condition->isLoaded())
{
//! Find ElseGroup in ElseGroupStore
std::map<uint32, bool>::const_iterator itr = elseGroupStore.find(condition->ElseGroup);
//! If not found, add an entry in the store and set to true (placeholder)
if (itr == elseGroupStore.end())
elseGroupStore[condition->ElseGroup] = true;
else if (!(*itr).second) //! If another condition in this group was unmatched before this, don't bother checking (the group is false anyway)
continue;
if (condition->ReferenceId)//handle reference
{
<API key>::const_iterator ref = <API key>.find(condition->ReferenceId);
if (ref != <API key>.end())
{
if (!<API key>(sourceInfo, ref->second))
elseGroupStore[condition->ElseGroup] = false;
}
else
{
TC_LOG_DEBUG("condition", "ConditionMgr::<API key> %s Reference template -%u not found",
condition->ToString().c_str(), condition->ReferenceId); // checked at loading, should never happen
}
}
else //handle normal condition
{
if (!condition->Meets(sourceInfo))
elseGroupStore[condition->ElseGroup] = false;
}
}
}
for (std::map<uint32, bool>::const_iterator i = elseGroupStore.begin(); i != elseGroupStore.end(); ++i)
if (i->second)
return true;
return false;
}
bool ConditionMgr::<API key>(WorldObject* object, ConditionContainer const& conditions) const
{
ConditionSourceInfo srcInfo = ConditionSourceInfo(object);
return <API key>(srcInfo, conditions);
}
bool ConditionMgr::<API key>(WorldObject* object1, WorldObject* object2, ConditionContainer const& conditions) const
{
ConditionSourceInfo srcInfo = ConditionSourceInfo(object1, object2);
return <API key>(srcInfo, conditions);
}
bool ConditionMgr::<API key>(ConditionSourceInfo& sourceInfo, ConditionContainer const& conditions) const
{
if (conditions.empty())
return true;
TC_LOG_DEBUG("condition", "ConditionMgr::<API key>");
return <API key>(sourceInfo, conditions);
}
bool ConditionMgr::<API key>(ConditionSourceType sourceType)
{
return (sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key> ||
sourceType == <API key>);
}
bool ConditionMgr::CanHaveSourceIdSet(ConditionSourceType sourceType)
{
return (sourceType == <API key>);
}
bool ConditionMgr::<API key>(ConditionSourceType sourceType, uint32 entry, ConditionSourceInfo& sourceInfo) const
{
if (sourceType > <API key> && sourceType < <API key>)
{
<API key>::const_iterator i = ConditionStore[sourceType].find(entry);
if (i != ConditionStore[sourceType].end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for type %u and entry %u", uint32(sourceType), entry);
return <API key>(sourceInfo, i->second);
}
}
return true;
}
bool ConditionMgr::<API key>(ConditionSourceType sourceType, uint32 entry, WorldObject* target0, WorldObject* target1 /*= nullptr*/, WorldObject* target2 /*= nullptr*/) const
{
ConditionSourceInfo conditionSource(target0, target1, target2);
return <API key>(sourceType, entry, conditionSource);
}
bool ConditionMgr::<API key>(ConditionSourceType sourceType, uint32 entry) const
{
if (sourceType > <API key> && sourceType < <API key>)
if (ConditionStore[sourceType].find(entry) != ConditionStore[sourceType].end())
return true;
return false;
}
bool ConditionMgr::<API key>(uint32 creatureId, uint32 spellId, WorldObject* clicker, WorldObject* target) const
{
<API key>::const_iterator itr = <API key>.find(creatureId);
if (itr != <API key>.end())
{
<API key>::const_iterator i = itr->second.find(spellId);
if (i != itr->second.end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for SpellClickEvent entry %u spell %u", creatureId, spellId);
ConditionSourceInfo sourceInfo(clicker, target);
return <API key>(sourceInfo, i->second);
}
}
return true;
}
ConditionContainer const* ConditionMgr::<API key>(uint32 creatureId, uint32 spellId) const
{
<API key>::const_iterator itr = <API key>.find(creatureId);
if (itr != <API key>.end())
{
<API key>::const_iterator i = itr->second.find(spellId);
if (i != itr->second.end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for SpellClickEvent entry %u spell %u", creatureId, spellId);
return &i->second;
}
}
return nullptr;
}
bool ConditionMgr::<API key>(uint32 creatureId, uint32 spellId, Player* player, Unit* vehicle) const
{
<API key>::const_iterator itr = <API key>.find(creatureId);
if (itr != <API key>.end())
{
<API key>::const_iterator i = itr->second.find(spellId);
if (i != itr->second.end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for Vehicle entry %u spell %u", creatureId, spellId);
ConditionSourceInfo sourceInfo(player, vehicle);
return <API key>(sourceInfo, i->second);
}
}
return true;
}
bool ConditionMgr::<API key>(int64 entryOrGuid, uint32 eventId, uint32 sourceType, Unit* unit, WorldObject* baseObject) const
{
<API key>::const_iterator itr = <API key>.find(std::make_pair(entryOrGuid, sourceType));
if (itr != <API key>.end())
{
<API key>::const_iterator i = itr->second.find(eventId + 1);
if (i != itr->second.end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for Smart Event entry or guid " SI64FMTD " eventId %u", entryOrGuid, eventId);
ConditionSourceInfo sourceInfo(unit, baseObject);
return <API key>(sourceInfo, i->second);
}
}
return true;
}
bool ConditionMgr::<API key>(uint32 creatureId, uint32 itemId, Player* player, Creature* vendor) const
{
<API key>::const_iterator itr = <API key>.find(creatureId);
if (itr != <API key>.end())
{
<API key>::const_iterator i = (*itr).second.find(itemId);
if (i != (*itr).second.end())
{
TC_LOG_DEBUG("condition", "<API key>: found conditions for creature entry %u item %u", creatureId, itemId);
ConditionSourceInfo sourceInfo(player, vendor);
return <API key>(sourceInfo, i->second);
}
}
return true;
}
ConditionMgr* ConditionMgr::instance()
{
static ConditionMgr instance;
return &instance;
}
void ConditionMgr::LoadConditions(bool isReload)
{
uint32 oldMSTime = getMSTime();
Clean();
//must clear all custom handled cases (groupped types) before reload
if (isReload)
{
TC_LOG_INFO("misc", "Reseting Loot Conditions...");
<API key>.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
LootTemplates_Item.ResetConditions();
LootTemplates_Mail.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
<API key>.ResetConditions();
LootTemplates_Spell.ResetConditions();
TC_LOG_INFO("misc", "Re-Loading `gossip_menu` Table for Conditions!");
sObjectMgr->LoadGossipMenu();
TC_LOG_INFO("misc", "Re-Loading `gossip_menu_option` Table for Conditions!");
sObjectMgr->LoadGossipMenuItems();
sSpellMgr-><API key>();
TC_LOG_INFO("misc", "Re-Loading `terrain_phase_info` Table for Conditions!");
sObjectMgr-><API key>();
TC_LOG_INFO("misc", "Re-Loading `<API key>` Table for Conditions!");
sObjectMgr-><API key>();
TC_LOG_INFO("misc", "Re-Loading `terrain_worldmap` Table for Conditions!");
sObjectMgr-><API key>();
TC_LOG_INFO("misc", "Re-Loading `phase_area` Table for Conditions!");
sObjectMgr->LoadAreaPhases();
}
QueryResult result = WorldDatabase.Query("SELECT <API key>, SourceGroup, SourceEntry, SourceId, ElseGroup, <API key>, ConditionTarget, "
" ConditionValue1, ConditionValue2, ConditionValue3, NegativeCondition, ErrorType, ErrorTextId, ScriptName FROM conditions");
if (!result)
{
TC_LOG_ERROR("server.loading", ">> Loaded 0 conditions. DB table `conditions` is empty!");
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
Condition* cond = new Condition();
int32 <API key> = fields[0].GetInt32();
cond->SourceGroup = fields[1].GetUInt32();
cond->SourceEntry = fields[2].GetInt32();
cond->SourceId = fields[3].GetInt32();
cond->ElseGroup = fields[4].GetUInt32();
int32 <API key> = fields[5].GetInt32();
cond->ConditionTarget = fields[6].GetUInt8();
cond->ConditionValue1 = fields[7].GetUInt32();
cond->ConditionValue2 = fields[8].GetUInt32();
cond->ConditionValue3 = fields[9].GetUInt32();
cond->NegativeCondition = fields[10].GetBool();
cond->ErrorType = fields[11].GetUInt32();
cond->ErrorTextId = fields[12].GetUInt32();
cond->ScriptId = sObjectMgr->GetScriptId(fields[13].GetString());
if (<API key> >= 0)
cond->ConditionType = ConditionTypes(<API key>);
if (<API key> >= 0)
cond->SourceType = ConditionSourceType(<API key>);
if (<API key> < 0)//it has a reference
{
if (<API key> == <API key>)//self referencing, skip
{
TC_LOG_ERROR("sql.sql", "Condition reference %i is referencing self, skipped", <API key>);
delete cond;
continue;
}
cond->ReferenceId = uint32(abs(<API key>));
const char* rowType = "reference template";
if (<API key> >= 0)
rowType = "reference";
//check for useless data
if (cond->ConditionTarget)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in ConditionTarget (%u)!", rowType, <API key>, cond->ConditionTarget);
if (cond->ConditionValue1)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in value1 (%u)!", rowType, <API key>, cond->ConditionValue1);
if (cond->ConditionValue2)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in value2 (%u)!", rowType, <API key>, cond->ConditionValue2);
if (cond->ConditionValue3)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in value3 (%u)!", rowType, <API key>, cond->ConditionValue3);
if (cond->NegativeCondition)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in NegativeCondition (%u)!", rowType, <API key>, cond->NegativeCondition);
if (cond->SourceGroup && <API key> < 0)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in SourceGroup (%u)!", rowType, <API key>, cond->SourceGroup);
if (cond->SourceEntry && <API key> < 0)
TC_LOG_ERROR("sql.sql", "Condition %s %i has useless data in SourceEntry (%u)!", rowType, <API key>, cond->SourceEntry);
}
else if (!<API key>(cond))//doesn't have reference, validate ConditionType
{
delete cond;
continue;
}
if (<API key> < 0)//it is a reference template
{
<API key>[std::abs(<API key>)].push_back(cond);//add to reference storage
++count;
continue;
}//end of reference templates
//if not a reference and SourceType is invalid, skip
if (<API key> >= 0 && !isSourceTypeValid(cond))
{
delete cond;
continue;
}
//Grouping is only allowed for some types (loot templates, gossip menus, gossip items)
if (cond->SourceGroup && !<API key>(cond->SourceType))
{
TC_LOG_ERROR("sql.sql", "%s has not allowed value of SourceGroup = %u!", cond->ToString().c_str(), cond->SourceGroup);
delete cond;
continue;
}
if (cond->SourceId && !CanHaveSourceIdSet(cond->SourceType))
{
TC_LOG_ERROR("sql.sql", "%s has not allowed value of SourceId = %u!", cond->ToString().c_str(), cond->SourceId);
delete cond;
continue;
}
if (cond->ErrorType && cond->SourceType != <API key>)
{
TC_LOG_ERROR("sql.sql", "%s can't have ErrorType (%u), set to 0!", cond->ToString().c_str(), cond->ErrorType);
cond->ErrorType = 0;
}
if (cond->ErrorTextId && !cond->ErrorType)
{
TC_LOG_ERROR("sql.sql", "%s has any ErrorType, ErrorTextId (%u) is set, set to 0!", cond->ToString().c_str(), cond->ErrorTextId);
cond->ErrorTextId = 0;
}
if (cond->SourceGroup)
{
bool valid = false;
// handle grouped conditions
switch (cond->SourceType)
{
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, LootTemplates_Item.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, LootTemplates_Mail.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, <API key>.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToLootTemplate(cond, LootTemplates_Spell.<API key>(cond->SourceGroup));
break;
case <API key>:
valid = addToGossipMenus(cond);
break;
case <API key>:
valid = <API key>(cond);
break;
case <API key>:
{
<API key>[cond->SourceGroup][cond->SourceEntry].push_back(cond);
valid = true;
++count;
continue; // do not add to m_AllocatedMemory to avoid double deleting
}
case <API key>:
valid = <API key>(cond);
break;
case <API key>:
{
<API key>[cond->SourceGroup][cond->SourceEntry].push_back(cond);
valid = true;
++count;
continue; // do not add to m_AllocatedMemory to avoid double deleting
}
case <API key>:
{
//! TODO: PAIR_32 ?
std::pair<int32, uint32> key = std::make_pair(cond->SourceEntry, cond->SourceId);
<API key>[key][cond->SourceGroup].push_back(cond);
valid = true;
++count;
continue;
}
case <API key>:
{
<API key>[cond->SourceGroup][cond->SourceEntry].push_back(cond);
valid = true;
++count;
continue;
}
case <API key>:
valid = addToPhases(cond);
break;
default:
break;
}
if (!valid)
{
TC_LOG_ERROR("sql.sql", "%s Not handled grouped condition.", cond->ToString().c_str());
delete cond;
}
else
{
<API key>.push_back(cond);
++count;
}
continue;
}
//handle not grouped conditions
//add new Condition to storage based on Type/Entry
ConditionStore[cond->SourceType][cond->SourceEntry].push_back(cond);
++count;
}
while (result->NextRow());
TC_LOG_INFO("server.loading", ">> Loaded %u conditions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
bool ConditionMgr::addToLootTemplate(Condition* cond, LootTemplate* loot) const
{
if (!loot)
{
TC_LOG_ERROR("sql.sql", "%s LootTemplate %u not found.", cond->ToString().c_str(), cond->SourceGroup);
return false;
}
if (loot->addConditionItem(cond))
return true;
TC_LOG_ERROR("sql.sql", "%s Item %u not found in LootTemplate %u.", cond->ToString().c_str(), cond->SourceEntry, cond->SourceGroup);
return false;
}
bool ConditionMgr::addToGossipMenus(Condition* cond) const
{
<API key> pMenuBounds = sObjectMgr-><API key>(cond->SourceGroup);
if (pMenuBounds.first != pMenuBounds.second)
{
for (<API key>::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
{
if ((*itr).second.MenuID == cond->SourceGroup && (*itr).second.TextID == uint32(cond->SourceEntry))
{
(*itr).second.Conditions.push_back(cond);
return true;
}
}
}
TC_LOG_ERROR("sql.sql", "%s GossipMenu %u not found.", cond->ToString().c_str(), cond->SourceGroup);
return false;
}
bool ConditionMgr::<API key>(Condition* cond) const
{
<API key> pMenuItemBounds = sObjectMgr-><API key>(cond->SourceGroup);
if (pMenuItemBounds.first != pMenuItemBounds.second)
{
for (<API key>::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
if ((*itr).second.MenuID == cond->SourceGroup && (*itr).second.OptionID == uint32(cond->SourceEntry))
{
(*itr).second.Conditions.push_back(cond);
return true;
}
}
}
TC_LOG_ERROR("sql.sql", "%s GossipMenuId %u Item %u not found.", cond->ToString().c_str(), cond->SourceGroup, cond->SourceEntry);
return false;
}
bool ConditionMgr::<API key>(Condition* cond) const
{
uint32 conditionEffMask = cond->SourceGroup;
SpellInfo* spellInfo = const_cast<SpellInfo*>(sSpellMgr->AssertSpellInfo(cond->SourceEntry));
std::list<uint32> sharedMasks;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
SpellEffectInfo const* effect = spellInfo->GetEffect(DIFFICULTY_NONE, i);
if (!effect)
continue;
// check if effect is already a part of some shared mask
bool found = false;
for (std::list<uint32>::iterator itr = sharedMasks.begin(); itr != sharedMasks.end(); ++itr)
{
if ((1 << i) & *itr)
{
found = true;
break;
}
}
if (found)
continue;
// build new shared mask with found effect
uint32 sharedMask = 1 << i;
ConditionContainer* cmp = effect-><API key>;
for (uint8 effIndex = i + 1; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
{
SpellEffectInfo const* inner = spellInfo->GetEffect(DIFFICULTY_NONE, effIndex);
if (!inner)
continue;
if (inner-><API key> == cmp)
sharedMask |= 1 << effIndex;
}
sharedMasks.push_back(sharedMask);
}
for (std::list<uint32>::iterator itr = sharedMasks.begin(); itr != sharedMasks.end(); ++itr)
{
// some effect indexes should have same data
if (uint32 commonMask = *itr & conditionEffMask)
{
uint8 firstEffIndex = 0;
for (; firstEffIndex < MAX_SPELL_EFFECTS; ++firstEffIndex)
if ((1<<firstEffIndex) & *itr)
break;
if (firstEffIndex >= MAX_SPELL_EFFECTS)
return false;
SpellEffectInfo const* effect = spellInfo->GetEffect(DIFFICULTY_NONE, firstEffIndex);
if (!effect)
continue;
// get shared data
ConditionContainer* sharedList = effect-><API key>;
// there's already data entry for that sharedMask
if (sharedList)
{
// we have overlapping masks in db
if (conditionEffMask != *itr)
{
TC_LOG_ERROR("sql.sql", "%s in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
"effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.", cond->ToString().c_str(), cond->SourceGroup);
return false;
}
}
// no data for shared mask, we can create new submask
else
{
// add new list, create new shared mask
sharedList = new ConditionContainer();
bool assigned = false;
for (uint8 i = firstEffIndex; i < MAX_SPELL_EFFECTS; ++i)
{
SpellEffectInfo const* eff = spellInfo->GetEffect(DIFFICULTY_NONE, i);
if (!eff)
continue;
if ((1 << i) & commonMask)
{
const_cast<SpellEffectInfo*>(eff)-><API key> = sharedList;
assigned = true;
}
}
if (!assigned)
{
delete sharedList;
break;
}
}
sharedList->push_back(cond);
break;
}
}
return true;
}
bool ConditionMgr::addToPhases(Condition* cond) const
{
if (!cond->SourceEntry)
{
bool found = false;
PhaseInfo& p = sObjectMgr-><API key>();
for (auto phaseItr = p.begin(); phaseItr != p.end(); ++phaseItr)
{
for (PhaseInfoStruct& phase : phaseItr->second)
{
if (phase.Id == cond->SourceGroup)
{
phase.Conditions.push_back(cond);
found = true;
}
}
}
if (found)
return true;
}
else if (std::vector<PhaseInfoStruct>* phases = sObjectMgr-><API key>(cond->SourceEntry))
{
for (PhaseInfoStruct& phase : *phases)
{
if (phase.Id == cond->SourceGroup)
{
phase.Conditions.push_back(cond);
return true;
}
}
}
TC_LOG_ERROR("sql.sql", "%s Area %u does not have phase %u.", cond->ToString().c_str(), cond->SourceGroup, cond->SourceEntry);
return false;
}
bool ConditionMgr::isSourceTypeValid(Condition* cond) const
{
switch (cond->SourceType)
{
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!LootTemplates_Item.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `item_loot_template`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = LootTemplates_Item.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!LootTemplates_Mail.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `mail_loot_template`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = LootTemplates_Mail.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!<API key>.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `<API key>`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = <API key>.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!LootTemplates_Spell.HaveLootFor(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceGroup in `condition` table, does not exist in `spell_loot_template`, ignoring.", cond->ToString().c_str());
return false;
}
LootTemplate* loot = LootTemplates_Spell.<API key>(cond->SourceGroup);
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!pItemProto && !loot->isReference(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceType, SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellInfo)
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table does not exist in `spell.dbc`, ignoring.", cond->ToString().c_str());
return false;
}
if ((cond->SourceGroup > MAX_EFFECT_MASK) || !cond->SourceGroup)
{
TC_LOG_ERROR("sql.sql", "%s in `condition` table, has incorrect SourceGroup (spell effectMask) set, ignoring.", cond->ToString().c_str());
return false;
}
uint32 origGroup = cond->SourceGroup;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!((1 << i) & cond->SourceGroup))
continue;
SpellEffectInfo const* effect = spellInfo->GetEffect(DIFFICULTY_NONE, i);
if (!effect)
continue;
if (effect->ChainTargets > 0)
continue;
switch (effect->TargetA.<API key>())
{
case <API key>:
case <API key>:
case <API key>:
continue;
default:
break;
}
switch (effect->TargetB.<API key>())
{
case <API key>:
case <API key>:
case <API key>:
continue;
default:
break;
}
TC_LOG_ERROR("sql.sql", "SourceEntry %u SourceGroup %u in `condition` table - spell %u does not have implicit targets of types: _AREA_, _CONE_, _NEARBY_, __CHAIN__ for effect %u, SourceGroup needs correction, ignoring.", cond->SourceEntry, origGroup, cond->SourceEntry, uint32(i));
cond->SourceGroup &= ~(1 << i);
}
// all effects were removed, no need to add the condition at all
if (!cond->SourceGroup)
return false;
break;
}
case <API key>:
{
if (!sObjectMgr->GetCreatureTemplate(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in `creature_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
case <API key>:
{
SpellInfo const* spellProto = sSpellMgr->GetSpellInfo(cond->SourceEntry);
if (!spellProto)
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table does not exist in `spell.dbc`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry specifies non-existing quest, skipped.", cond->ToString().c_str());
return false;
}
break;
case <API key>:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in `creature_template`, ignoring.", cond->ToString().c_str());
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table does not exist in `spell.dbc`, ignoring.", cond->ToString().c_str());
return false;
}
break;
case <API key>:
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in `creature_template`, ignoring.", cond->ToString().c_str());
return false;
}
if (!sSpellMgr->GetSpellInfo(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table does not exist in `spell.dbc`, ignoring.", cond->ToString().c_str());
return false;
}
break;
case <API key>:
{
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in `creature_template`, ignoring.", cond->ToString().c_str());
return false;
}
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(cond->SourceEntry);
if (!itemTemplate)
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in `item_template`, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (!sMapStore.LookupEntry(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in Map.dbc, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
{
if (cond->SourceEntry && !sAreaTableStore.LookupEntry(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry in `condition` table, does not exist in AreaTable.dbc, ignoring.", cond->ToString().c_str());
return false;
}
break;
}
case <API key>:
case <API key>:
case <API key>:
break;
default:
TC_LOG_ERROR("sql.sql", "%s Invalid ConditionSourceType in `condition` table, ignoring.", cond->ToString().c_str());
return false;
}
return true;
}
bool ConditionMgr::<API key>(Condition* cond) const
{
switch (cond->ConditionType)
{
case CONDITION_AURA:
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has non existing spell (Id: %d), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 > EFFECT_2)
{
TC_LOG_ERROR("sql.sql", "%s has non existing effect index (%u) (must be 0..2), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case CONDITION_ITEM:
{
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
TC_LOG_ERROR("sql.sql", "%s Item (%u) does not exist, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
TC_LOG_ERROR("sql.sql", "%s Zero item count in ConditionValue2, skipped.", cond->ToString(true).c_str());
return false;
}
break;
}
case <API key>:
{
ItemTemplate const* proto = sObjectMgr->GetItemTemplate(cond->ConditionValue1);
if (!proto)
{
TC_LOG_ERROR("sql.sql", "%s Item (%u) does not exist, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_ZONEID:
{
AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(cond->ConditionValue1);
if (!areaEntry)
{
TC_LOG_ERROR("sql.sql", "%s Area (%u) does not exist, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (areaEntry->ParentAreaID != 0)
{
TC_LOG_ERROR("sql.sql", "%s requires to be in area (%u) which is a subzone but zone expected, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
FactionEntry const* factionEntry = sFactionStore.LookupEntry(cond->ConditionValue1);
if (!factionEntry)
{
TC_LOG_ERROR("sql.sql", "%s has non existing faction (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_TEAM:
{
if (cond->ConditionValue1 != ALLIANCE && cond->ConditionValue1 != HORDE)
{
TC_LOG_ERROR("sql.sql", "%s specifies unknown team (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_SKILL:
{
SkillLineEntry const* pSkill = sSkillLineStore.LookupEntry(cond->ConditionValue1);
if (!pSkill)
{
TC_LOG_ERROR("sql.sql", "%s specifies non-existing skill (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 < 1 || cond->ConditionValue2 > sWorld-><API key>())
{
TC_LOG_ERROR("sql.sql", "%s specifies skill (%u) with invalid value (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1, cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
if (cond->ConditionValue2 >= (1 << MAX_QUEST_STATUS))
{
TC_LOG_ERROR("sql.sql", "%s has invalid state mask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
// intentional missing break
case <API key>:
case <API key>:
case <API key>:
case <API key>:
case <API key>:
{
if (!sObjectMgr->GetQuestTemplate(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s points to non-existing quest (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
if (cond->ConditionValue1 >= events.size() || !events[cond->ConditionValue1].isValid())
{
TC_LOG_ERROR("sql.sql", "%s has non existing event id (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
if (!achievement)
{
TC_LOG_ERROR("sql.sql", "%s has non existing achivement id (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_CLASS:
{
if (!(cond->ConditionValue1 & <API key>))
{
TC_LOG_ERROR("sql.sql", "%s has non existing classmask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~<API key>);
return false;
}
break;
}
case CONDITION_RACE:
{
if (!(cond->ConditionValue1 & <API key>))
{
TC_LOG_ERROR("sql.sql", "%s has non existing racemask (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1 & ~<API key>);
return false;
}
break;
}
case CONDITION_GENDER:
{
if (!Player::IsValidGender(uint8(cond->ConditionValue1)))
{
TC_LOG_ERROR("sql.sql", "%s has invalid gender (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_MAPID:
{
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
if (!me)
{
TC_LOG_ERROR("sql.sql", "%s has non existing map (%u), skipped", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_SPELL:
{
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has non existing spell (Id: %d), skipped", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_LEVEL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ComparisionType (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
if (cond->ConditionValue1 > DRUNKEN_SMASHED)
{
TC_LOG_ERROR("sql.sql", "%s has invalid state (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
if (!sObjectMgr->GetCreatureTemplate(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has non existing creature template entry (%u), skipped", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
if (!sObjectMgr-><API key>(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has non existing gameobject template entry (%u), skipped.", cond->ToString().c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
switch (cond->ConditionValue1)
{
case TYPEID_UNIT:
if (cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2))
{
TC_LOG_ERROR("sql.sql", "%s has non existing creature template entry (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
{
if (CreatureData const* creatureData = sObjectMgr->GetCreatureData(cond->ConditionValue3))
{
if (cond->ConditionValue2 && creatureData->id != cond->ConditionValue2)
{
TC_LOG_ERROR("sql.sql", "%s has guid %u set but does not match creature entry (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue3, cond->ConditionValue2);
return false;
}
}
else
{
TC_LOG_ERROR("sql.sql", "%s has non existing creature guid (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue3);
return false;
}
}
break;
case TYPEID_GAMEOBJECT:
if (cond->ConditionValue2 && !sObjectMgr-><API key>(cond->ConditionValue2))
{
TC_LOG_ERROR("sql.sql", "%s has non existing gameobject template entry (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
if (cond->ConditionValue3)
{
if (GameObjectData const* goData = sObjectMgr->GetGOData(cond->ConditionValue3))
{
if (cond->ConditionValue2 && goData->id != cond->ConditionValue2)
{
TC_LOG_ERROR("sql.sql", "%s has guid %u set but does not match gameobject entry (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue3, cond->ConditionValue2);
return false;
}
}
else
{
TC_LOG_ERROR("sql.sql", "%s has non existing gameobject guid (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue3);
return false;
}
}
break;
case TYPEID_PLAYER:
case TYPEID_CORPSE:
if (cond->ConditionValue2)
<API key>(cond, 2, cond->ConditionValue2);
if (cond->ConditionValue3)
<API key>(cond, 3, cond->ConditionValue3);
break;
default:
TC_LOG_ERROR("sql.sql", "%s has wrong typeid set (%u), skipped", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_TYPE_MASK:
{
if (!cond->ConditionValue1 || (cond->ConditionValue1 & ~(TYPEMASK_UNIT | TYPEMASK_PLAYER | TYPEMASK_GAMEOBJECT | TYPEMASK_CORPSE)))
{
TC_LOG_ERROR("sql.sql", "%s has invalid typemask set (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
if (cond->ConditionValue1 >= cond-><API key>())
{
TC_LOG_ERROR("sql.sql", "%s has invalid ConditionValue1(ConditionTarget selection) (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
TC_LOG_ERROR("sql.sql", "%s has ConditionValue1(ConditionTarget selection) set to self (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= RELATION_MAX)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ConditionValue2(RelationType) (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
if (cond->ConditionValue1 >= cond-><API key>())
{
TC_LOG_ERROR("sql.sql", "%s has invalid ConditionValue1(ConditionTarget selection) (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
TC_LOG_ERROR("sql.sql", "%s has ConditionValue1(ConditionTarget selection) set to self (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (!cond->ConditionValue2)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ConditionValue2(rankMask) (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
if (cond->ConditionValue1 >= cond-><API key>())
{
TC_LOG_ERROR("sql.sql", "%s has invalid ConditionValue1(ConditionTarget selection) (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue1 == cond->ConditionTarget)
{
TC_LOG_ERROR("sql.sql", "%s has ConditionValue1(ConditionTarget selection) set to self (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue3 >= COMP_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ComparisionType (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue3);
return false;
}
break;
}
case CONDITION_HP_VAL:
{
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ComparisionType (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case CONDITION_HP_PCT:
{
if (cond->ConditionValue1 > 100)
{
TC_LOG_ERROR("sql.sql", "%s has too big percent value (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
if (cond->ConditionValue2 >= COMP_TYPE_MAX)
{
TC_LOG_ERROR("sql.sql", "%s has invalid ComparisionType (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
if (!sWorld->getWorldState(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has non existing world state in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_PHASEID:
{
if (!sPhaseStore.LookupEntry(cond->ConditionValue1))
{
TC_LOG_ERROR("sql.sql", "%s has nonexistent phaseid in value1 (%u), skipped", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_TITLE:
{
CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(cond->ConditionValue1);
if (!titleEntry)
{
TC_LOG_ERROR("sql.sql", "%s has non existing title in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_SPAWNMASK:
{
if (cond->ConditionValue1 > SPAWNMASK_RAID_ALL)
{
TC_LOG_ERROR("sql.sql", "%s has non existing SpawnMask in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
if (!(cond->ConditionValue1 & <API key>))
{
TC_LOG_ERROR("sql.sql", "%s has non existing UnitState in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
if (!cond->ConditionValue1 || cond->ConditionValue1 > <API key>)
{
TC_LOG_ERROR("sql.sql", "%s has non existing CreatureType in value1 (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
AchievementEntry const* achievement = sAchievementStore.LookupEntry(cond->ConditionValue1);
if (!achievement)
{
TC_LOG_ERROR("sql.sql", "%s has non existing realm first achivement id (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case <API key>:
{
bool valid = false;
switch (cond->ConditionValue1)
{
case 0:
valid = cond->ConditionValue2 <= <API key>;
break;
case 1:
valid = cond->ConditionValue2 <= 1;
break;
default:
valid = false;
break;
}
if (!valid)
{
TC_LOG_ERROR("sql.sql", "%s has non-existing stand state (%u,%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1, cond->ConditionValue2);
return false;
}
break;
}
case <API key>:
{
QuestObjective const* obj = sObjectMgr->GetQuestObjective(cond->ConditionValue1);
if (!obj)
{
TC_LOG_ERROR("sql.sql", "%s points to non-existing quest objective (%u), skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
}
case CONDITION_PET_TYPE:
if (cond->ConditionValue1 >= (1 << MAX_PET_TYPE))
{
TC_LOG_ERROR("sql.sql", "%s has non-existing pet type %u, skipped.", cond->ToString(true).c_str(), cond->ConditionValue1);
return false;
}
break;
case <API key>:
case CONDITION_AREAID:
case CONDITION_ALIVE:
case CONDITION_IN_WATER:
case <API key>:
case CONDITION_CHARMED:
case CONDITION_TAXI:
break;
default:
TC_LOG_ERROR("sql.sql", "%s Invalid ConditionType in `condition` table, ignoring.", cond->ToString().c_str());
return false;
}
if (cond->ConditionTarget >= cond-><API key>())
{
TC_LOG_ERROR("sql.sql", "%s in `condition` table, has incorrect ConditionTarget set, ignoring.", cond->ToString(true).c_str());
return false;
}
if (cond->ConditionValue1 && !<API key>[cond->ConditionType].HasConditionValue1)
<API key>(cond, 1, cond->ConditionValue1);
if (cond->ConditionValue2 && !<API key>[cond->ConditionType].HasConditionValue2)
<API key>(cond, 2, cond->ConditionValue2);
if (cond->ConditionValue3 && !<API key>[cond->ConditionType].HasConditionValue3)
<API key>(cond, 3, cond->ConditionValue3);
return true;
}
void ConditionMgr::<API key>(Condition* cond, uint8 index, uint32 value)
{
TC_LOG_ERROR("sql.sql", "%s has useless data in ConditionValue%u (%u)!", cond->ToString(true).c_str(), index, value);
}
void ConditionMgr::Clean()
{
for (<API key>::iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
for (ConditionContainer::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
delete *it;
<API key>.clear();
for (uint32 i = 0; i < <API key>; ++i)
{
for (<API key>::iterator it = ConditionStore[i].begin(); it != ConditionStore[i].end(); ++it)
for (ConditionContainer::const_iterator itr = it->second.begin(); itr != it->second.end(); ++itr)
delete *itr;
ConditionStore[i].clear();
}
for (<API key>::iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
for (<API key>::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
<API key>.clear();
for (<API key>::iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
for (<API key>::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
<API key>.clear();
for (<API key>::iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
for (<API key>::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
<API key>.clear();
for (<API key>::iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
for (<API key>::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
for (ConditionContainer::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
delete *i;
<API key>.clear();
// this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;)
for (std::vector<Condition*>::const_iterator itr = <API key>.begin(); itr != <API key>.end(); ++itr)
delete *itr;
<API key>.clear();
}
inline bool <API key>(int32 comparisonType, int32 value1, int32 value2)
{
switch (comparisonType)
{
case 1:
return value1 == value2;
case 2:
return value1 != value2;
case 3:
return value1 > value2;
case 4:
return value1 >= value2;
case 5:
return value1 < value2;
case 6:
return value1 <= value2;
default:
break;
}
return false;
}
template<std::size_t N>
inline bool <API key>(uint32 logic, std::array<bool, N>& results)
{
static_assert(N < 16, "Logic array size must be equal to or less than 16");
for (std::size_t i = 0; i < results.size(); ++i)
if ((logic >> (16 + i)) & 1)
results[i] ^= true;
bool result = results[0];
for (std::size_t i = 1; i < results.size(); ++i)
{
switch ((logic >> (2 * (i - 1))) & 3)
{
case 1:
result = result && results[i];
break;
case 2:
result = result || results[i];
break;
default:
break;
}
}
return result;
}
bool ConditionMgr::<API key>(Player const* player, <API key> const* condition)
{
if (condition->MinLevel && player->getLevel() < condition->MinLevel)
return false;
if (condition->MaxLevel && player->getLevel() > condition->MaxLevel)
return false;
if (condition->RaceMask && !(player->getRaceMask() & condition->RaceMask))
return false;
if (condition->ClassMask && !(player->getClassMask() & condition->ClassMask))
return false;
if (condition->Gender >= 0 && player->getGender() != condition->Gender)
return false;
if (condition->NativeGender >= 0 && player->GetByteValue(PLAYER_BYTES_3, <API key>) != condition->NativeGender)
return false;
if (condition->PowerType != -1 && condition->PowerTypeComp)
{
int32 requiredPowerValue = condition->Flags & 4 ? player->GetMaxPower(Powers(condition->PowerType)) : condition->PowerTypeValue;
if (!<API key>(condition->PowerTypeComp, player->GetPower(Powers(condition->PowerType)), requiredPowerValue))
return false;
}
if (condition-><API key> >= 0 || condition-><API key> >= 0)
{
if (<API key> const* spec = <API key>.LookupEntry(player->GetUInt32Value(<API key>)))
{
if (condition-><API key> >= 0 && spec->OrderIndex != uint32(condition-><API key>))
return false;
if (condition-><API key> >= 0 && spec->Role != uint32(condition-><API key>))
return false;
}
}
if (condition->SkillID[0] || condition->SkillID[1] || condition->SkillID[2] || condition->SkillID[3])
{
using SkillCount = std::extent<decltype(condition->SkillID)>;
std::array<bool, SkillCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < SkillCount::value; ++i)
{
if (condition->SkillID[i])
{
uint16 skillValue = player->GetSkillValue(condition->SkillID[i]);
results[i] = skillValue != 0 && skillValue > condition->MinSkill[i] && skillValue < condition->MaxSkill[i];
}
}
if (!<API key>(condition->SkillLogic, results))
return false;
}
if (condition->LanguageID)
{
if (LanguageDesc const* lang = GetLanguageDescByID(condition->LanguageID))
{
uint32 languageSkill = player->GetSkillValue(lang->skill_id);
if (!languageSkill && player-><API key>(<API key>, condition->LanguageID))
languageSkill = 300;
if (condition->MinLanguage && languageSkill < condition->MinLanguage)
return false;
if (condition->MaxLanguage && languageSkill > condition->MaxLanguage)
return false;
}
}
if (condition->MinFactionID[0] && condition->MinFactionID[1] && condition->MinFactionID[2] && condition->MaxFactionID)
{
if (!condition->MinFactionID[0] && !condition->MinFactionID[1] && !condition->MinFactionID[2])
{
if (ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MaxFactionID))
{
if (*forcedRank > ReputationRank(condition->MaxReputation))
return false;
}
else if (player->GetReputationRank(condition->MaxFactionID) > ReputationRank(condition->MaxReputation))
return false;
}
else
{
using FactionCount = std::extent<decltype(condition->MinFactionID)>;
std::array<bool, FactionCount::value + 1> results;
results.fill(true);
for (std::size_t i = 0; i < FactionCount::value; ++i)
{
if (condition->MinFactionID[i])
{
if (ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MinFactionID[i]))
results[i] = *forcedRank >= ReputationRank(condition->MinReputation[i]);
else
results[i] = player->GetReputationRank(condition->MinFactionID[i]) >= ReputationRank(condition->MinReputation[i]);
}
}
if (ReputationRank const* forcedRank = player->GetReputationMgr().GetForcedRankIfAny(condition->MaxFactionID))
results[3] = *forcedRank <= ReputationRank(condition->MaxReputation);
else
results[3] = player->GetReputationRank(condition->MaxFactionID) <= ReputationRank(condition->MaxReputation);
if (!<API key>(condition->ReputationLogic, results))
return false;
}
}
if (condition->PvpMedal && !((1 << (condition->PvpMedal - 1)) & player->GetUInt32Value(<API key>)))
return false;
if (condition->LifetimeMaxPVPRank && player->GetByteValue(PLAYER_FIELD_BYTES, <API key>) != condition->LifetimeMaxPVPRank)
return false;
if (condition->MovementFlags[0] && !(player-><API key>() & condition->MovementFlags[0]))
return false;
if (condition->MovementFlags[1] && !(player-><API key>() & condition->MovementFlags[1]))
return false;
if (condition-><API key>)
{
Item* mainHand = player->GetItemByPos(<API key>, <API key>);
if (!mainHand || !((1 << mainHand->GetTemplate()->GetSubClass()) & condition-><API key>))
return false;
}
if (condition->PartyStatus)
{
Group const* group = player->GetGroup();
switch (condition->PartyStatus)
{
case 1:
if (group)
return false;
break;
case 2:
if (!group)
return false;
break;
case 3:
if (!group || group->isRaidGroup())
return false;
break;
case 4:
if (!group || !group->isRaidGroup())
return false;
break;
case 5:
if (group && group->isRaidGroup())
return false;
break;
default:
break;
}
}
if (condition->PrevQuestID[0])
{
using PrevQuestCount = std::extent<decltype(condition->PrevQuestID)>;
std::array<bool, PrevQuestCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < PrevQuestCount::value; ++i)
if (uint32 questBit = sDB2Manager.<API key>(condition->PrevQuestID[i]))
results[i] = (player->GetUInt32Value(<API key> + ((questBit - 1) >> 5)) & (1 << ((questBit - 1) & 31))) != 0;
if (!<API key>(condition->PrevQuestLogic, results))
return false;
}
if (condition->CurrQuestID[0])
{
using CurrQuestCount = std::extent<decltype(condition->CurrQuestID)>;
std::array<bool, CurrQuestCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < CurrQuestCount::value; ++i)
if (condition->CurrQuestID[i])
results[i] = player->FindQuestSlot(condition->CurrQuestID[i]) != MAX_QUEST_LOG_SIZE;
if (!<API key>(condition->CurrQuestLogic, results))
return false;
}
if (condition-><API key>[0])
{
using <API key> = std::extent<decltype(condition-><API key>)>;
std::array<bool, <API key>::value> results;
results.fill(true);
for (std::size_t i = 0; i < <API key>::value; ++i)
if (condition-><API key>[i])
results[i] = player->GetQuestStatus(condition-><API key>[i]) == <API key>;
if (!<API key>(condition-><API key>, results))
return false;
}
if (condition->SpellID[0])
{
using SpellCount = std::extent<decltype(condition->SpellID)>;
std::array<bool, SpellCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < SpellCount::value; ++i)
if (condition->SpellID[i])
results[i] = player->HasSpell(condition->SpellID[i]);
if (!<API key>(condition->SpellLogic, results))
return false;
}
if (condition->ItemID[0])
{
using ItemCount = std::extent<decltype(condition->ItemID)>;
std::array<bool, ItemCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < ItemCount::value; ++i)
if (condition->ItemID[i])
results[i] = player->GetItemCount(condition->ItemID[i], condition->ItemFlags != 0) >= condition->ItemCount[i];
if (!<API key>(condition->ItemLogic, results))
return false;
}
if (condition->CurrencyID[0])
{
using CurrencyCount = std::extent<decltype(condition->CurrencyID)>;
std::array<bool, CurrencyCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < CurrencyCount::value; ++i)
if (condition->CurrencyID[i])
results[i] = player->GetCurrency(condition->CurrencyID[i]) >= condition->CurrencyCount[i];
if (!<API key>(condition->CurrencyLogic, results))
return false;
}
if (condition->Explored[0] || condition->Explored[1])
{
using ExploredCount = std::extent<decltype(condition->Explored)>;
for (std::size_t i = 0; i < ExploredCount::value; ++i)
{
if (AreaTableEntry const* area = sAreaTableStore.LookupEntry(condition->Explored[i]))
if (area->AreaBit != -1 && !(player->GetUInt32Value(<API key> + area->AreaBit / 32) & (1 << (uint32(area->AreaBit) % 32))))
return false;
}
}
if (condition->AuraSpellID[0])
{
using AuraCount = std::extent<decltype(condition->AuraSpellID)>;
std::array<bool, AuraCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < AuraCount::value; ++i)
{
if (condition->AuraSpellID[i])
{
if (condition->AuraCount[i])
results[i] = player->GetAuraCount(condition->AuraSpellID[i]) >= condition->AuraCount[i];
else
results[i] = player->HasAura(condition->AuraSpellID[i]);
}
}
if (!<API key>(condition->AuraSpellLogic, results))
return false;
}
// TODO: time condition
// TODO (or not): world state expression condition
// TODO: weather condition
if (condition->Achievement[0])
{
using AchievementCount = std::extent<decltype(condition->Achievement)>;
std::array<bool, AchievementCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < AchievementCount::value; ++i)
{
if (condition->Achievement[i])
{
// if (condition->Flags & 2) { any character on account completed it } else { current character only }
// TODO: part of accountwide achievements
results[i] = player->HasAchieved(condition->Achievement[i]);
}
}
if (!<API key>(condition->AchievementLogic, results))
return false;
}
// TODO: research lfg status for player conditions
if (condition->AreaID[0])
{
using AreaCount = std::extent<decltype(condition->AreaID)>;
std::array<bool, AreaCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < AreaCount::value; ++i)
if (condition->AreaID[i])
results[i] = player->GetAreaId() == condition->AreaID[i] || player->GetZoneId() == condition->AreaID[i];
if (!<API key>(condition->AreaLogic, results))
return false;
}
if (condition->MinExpansionLevel != -1 && player->GetSession()->GetExpansion() < condition->MinExpansionLevel)
return false;
if (condition->MaxExpansionLevel != -1 && player->GetSession()->GetExpansion() > condition->MaxExpansionLevel)
return false;
if (condition->MinExpansionLevel != -1 && condition->MinExpansionTier != -1 && !player->IsGameMaster()
&& ((condition->MinExpansionLevel == int32(sWorld->getIntConfig(CONFIG_EXPANSION)) && condition->MinExpansionTier > 0) /*TODO: implement tier*/
|| condition->MinExpansionLevel > int32(sWorld->getIntConfig(CONFIG_EXPANSION))))
return false;
if (condition->PhaseID && !player->IsInPhase(condition->PhaseID))
return false;
if (condition->PhaseGroupID)
{
std::set<uint32> phases = sDB2Manager.GetPhasesForGroup(condition->PhaseGroupID);
if (!Trinity::Containers::Intersects(phases.begin(), phases.end(), player->GetPhases().begin(), player->GetPhases().end()))
return false;
}
if (condition->QuestKillID)
{
Quest const* quest = sObjectMgr->GetQuestTemplate(condition->QuestKillID);
if (quest && player->GetQuestStatus(condition->QuestKillID) != <API key>)
{
using QuestKillCount = std::extent<decltype(condition->QuestKillMonster)>;
std::array<bool, QuestKillCount::value> results;
results.fill(true);
for (std::size_t i = 0; i < QuestKillCount::value; ++i)
{
if (condition->QuestKillMonster[i])
{
auto objectiveItr = std::find_if(quest->GetObjectives().begin(), quest->GetObjectives().end(), [condition, i](QuestObjective const& objective) -> bool
{
return objective.Type == <API key> && uint32(objective.ObjectID) == condition->QuestKillMonster[i];
});
if (objectiveItr != quest->GetObjectives().end())
results[i] = player-><API key>(quest, objectiveItr->StorageIndex) >= objectiveItr->Amount;
}
}
if (!<API key>(condition->QuestKillLogic, results))
return false;
}
}
if (condition->MinAvgItemLevel && uint32(std::floor(player->GetFloatValue(<API key>))) < condition->MinAvgItemLevel)
return false;
if (condition->MaxAvgItemLevel && uint32(std::floor(player->GetFloatValue(<API key>))) > condition->MaxAvgItemLevel)
return false;
if (condition-><API key> && uint32(std::floor(player->GetFloatValue(<API key> + 1))) < condition-><API key>)
return false;
if (condition-><API key> && uint32(std::floor(player->GetFloatValue(<API key> + 1))) > condition-><API key>)
return false;
if (condition->ModifierTreeID && !player-><API key>(condition->ModifierTreeID))
return false;
return true;
} |
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Rewrite;
using System.Text;
namespace GeoWebApp.Utilities.Rules
{
public class WwwRule : IRule
{
public void ApplyRule(RewriteContext context)
{
var req = context.HttpContext.Request;
var currentHost = req.Host;
if (!currentHost.Host.StartsWith("www."))
{
var newHost = new HostString("www." + currentHost.Host, currentHost.Port ?? 80);
var newUrl = new StringBuilder()
.Append("http:
.Append(newHost)
.Append(req.PathBase)
.Append(req.Path)
.Append(req.QueryString);
context.HttpContext.Response.Redirect(newUrl.ToString());
context.Result = RuleResult.EndResponse;
}
}
}
} |
<!DOCTYPE html PUBLIC "-
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>LuaScript Reference</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>LuaScript <sub>v0.11</sub></h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Helper_Methods">Helper Methods </a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Properties">Properties </a></li>
</ul>
<h2>Classes</h2>
<ul class="nowrap">
<li><a href="../classes/Editor.html">Editor</a></li>
<li><a href="../classes/Match.html">Match</a></li>
<li><a href="../classes/Styler.html">Styler</a></li>
<li><strong>Notepad</strong></li>
</ul>
<h2>Topics</h2>
<ul class="">
<li><a href="../topics/callbacks.md.html">Callbacks</a></li>
<li><a href="../topics/<API key>.md.html">External Plugin Support</a></li>
</ul>
<h2>Examples</h2>
<ul class="nowrap">
<li><a href="../examples/bookmark.lua.html">bookmark.lua</a></li>
<li><a href="../examples/<API key>.lua.html"><API key>.lua</a></li>
<li><a href="../examples/luaautoindent.lua.html">luaautoindent.lua</a></li>
<li><a href="../examples/luasyntaxchecker.lua.html">luasyntaxchecker.lua</a></li>
<li><a href="../examples/randomizelines.lua.html">randomizelines.lua</a></li>
<li><a href="../examples/selectionaddnext.lua.html">selectionaddnext.lua</a></li>
<li><a href="../examples/sessionmanager.lua.html">sessionmanager.lua</a></li>
<li><a href="../examples/stylecsv.lua.html">stylecsv.lua</a></li>
<li><a href="../examples/stylecustom.lua.html">stylecustom.lua</a></li>
<li><a href="../examples/<API key>.lua.html"><API key>.lua</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>Notepad</code></h1>
<p>Notepad++ wrapper.</p>
<p> Provides access to the Notepad++ application. Most of the API messages and notifications have been made available, but more can be made available as needed.</p>
<p> The global instance <code>npp</code> is used for application access.
</p>
<h2><a href="#Helper_Methods">Helper Methods </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Notepad.SendEditor">Notepad.SendEditor(sci_const[, wparam=0[, lparam=0]])</a></td>
<td class="summary">Sends a message to the current editor.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.ConstantName">Notepad.ConstantName(const[, hint])</a></td>
<td class="summary">Looks up the symbolic name of a constant.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.AddEventHandler">Notepad.AddEventHandler(event, callback)</a></td>
<td class="summary">Registers a Lua function to handle a given event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.RemoveEventHandler">Notepad.RemoveEventHandler(event, callback)</a></td>
<td class="summary">Removes previously registered Lua function for a given event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.<API key>">Notepad.<API key>(event)</a></td>
<td class="summary">Removes all registered Lua functions for a given event.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.AddShortcut">Notepad.AddShortcut(name, shortcut, callback)</a></td>
<td class="summary">Registers a Lua function for a shortcut key.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.WriteError">Notepad.WriteError(...)</a></td>
<td class="summary">Writes an error message to the console.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.ClearConsole">Notepad.ClearConsole()</a></td>
<td class="summary">Clears the console.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.StartTimer">Notepad.StartTimer(ms, callback)</a></td>
<td class="summary">Continuously calls a function at a set interval.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.StopTimer">Notepad.StopTimer(timer)</a></td>
<td class="summary">Stops a previously created timer.</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Notepad:ActivateDoc">Notepad:ActivateDoc(view, index2Activate)</a></td>
<td class="summary">Activates the specified document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:DisableAutoUpdate">Notepad:DisableAutoUpdate()</a></td>
<td class="summary">Disable checking for auto updates.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:DmmViewOtherTab">Notepad:DmmViewOtherTab(name)</a></td>
<td class="summary">View another docked tab.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:DoOpen">Notepad:DoOpen(file)</a></td>
<td class="summary">Opens a document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:<API key>">Notepad:<API key>(toShow)</a></td>
<td class="summary">Enable or disable the file extension column in the doc switcher.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetBufferIDFromPos">Notepad:GetBufferIDFromPos(position, view)</a></td>
<td class="summary">Gets the BufferID located at the given position.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetCurrentDirectory">Notepad:GetCurrentDirectory()</a></td>
<td class="summary">Gets the current directory of the document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetCurrentDocIndex">Notepad:GetCurrentDocIndex(view)</a></td>
<td class="summary">Gets the current document index within the view.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetCurrentWord">Notepad:GetCurrentWord()</a></td>
<td class="summary">Selects and returns the word at the cursor's position</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetExtPart">Notepad:GetExtPart()</a></td>
<td class="summary">Gets the file extension of the current document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetFileName">Notepad:GetFileName()</a></td>
<td class="summary">Gets the file name of the current document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetFileNameAtCursor">Notepad:GetFileNameAtCursor()</a></td>
<td class="summary">Gets the file name at the cursor position.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetFullCurrentPath">Notepad:GetFullCurrentPath()</a></td>
<td class="summary">Gets the full path of the current document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:<API key>">Notepad:<API key>(BufferID)</a></td>
<td class="summary">Gets the full path of the provided buffer ID.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetNamePart">Notepad:GetNamePart()</a></td>
<td class="summary">Gets the file name (without extension) of the current document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetNbOpenFiles">Notepad:GetNbOpenFiles(view)</a></td>
<td class="summary">Gets the number of open documents.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetNbSessionFiles">Notepad:GetNbSessionFiles(session)</a></td>
<td class="summary">Gets the number of files a the session file.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetNppDirectory">Notepad:GetNppDirectory()</a></td>
<td class="summary">Gets the directory of the Notepad++ application.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetPluginsConfigDir">Notepad:GetPluginsConfigDir()</a></td>
<td class="summary">Gets the plugin configuration directory.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:GetPosFromBufferID">Notepad:GetPosFromBufferID(BufferID, priorityView)</a></td>
<td class="summary">Gets the position information of the provided buffer ID.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:HideMenu">Notepad:HideMenu(hideOrNot)</a></td>
<td class="summary">Hides or shows the menu.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:HideStatusBar">Notepad:HideStatusBar(hideOrNot)</a></td>
<td class="summary">Hides or shows the status bar.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:HideTabBar">Notepad:HideTabBar(hideOrNot)</a></td>
<td class="summary">Hides or shows the tab bar.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:HideToolBar">Notepad:HideToolBar(hideOrNot)</a></td>
<td class="summary">Hides or shows the tool bar.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:IsDocSwitcherShown">Notepad:IsDocSwitcherShown()</a></td>
<td class="summary">Gets whether the doc switcher is hidden or shown.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:IsMenuHidden">Notepad:IsMenuHidden()</a></td>
<td class="summary">Gets whether the menu is hidden or shown.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:IsStatusBarHidden">Notepad:IsStatusBarHidden()</a></td>
<td class="summary">Gets whether the status bar is hidden or shown.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:IsTabBarHidden">Notepad:IsTabBarHidden()</a></td>
<td class="summary">Gets whether the tab bar is hidden or shown.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:IsToolBarHidden">Notepad:IsToolBarHidden()</a></td>
<td class="summary">Gets whether the tool bar is hidden or shown.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:<API key>">Notepad:<API key>(path, filter)</a></td>
<td class="summary">Launch the "Find in Files" dialog.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:LoadSession">Notepad:LoadSession(filename)</a></td>
<td class="summary">Loads a session file.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:<API key>">Notepad:<API key>()</a></td>
<td class="summary">Makes the current buffer marked as dirty.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:MenuCommand">Notepad:MenuCommand(command)</a></td>
<td class="summary">Executes a menu command.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:ReloadBufferID">Notepad:ReloadBufferID(BufferID, alertOrNot)</a></td>
<td class="summary">Reloads the specified buffer ID.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:ReloadFile">Notepad:ReloadFile(withAlert, filename)</a></td>
<td class="summary">Reloads the specified file.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SaveAllFiles">Notepad:SaveAllFiles()</a></td>
<td class="summary">Saves all the opened documents.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SaveCurrentFile">Notepad:SaveCurrentFile()</a></td>
<td class="summary">Saves the current document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SaveCurrentFileAs">Notepad:SaveCurrentFileAs(asCopy, filename)</a></td>
<td class="summary">Saves the current document as the specified name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SaveCurrentSession">Notepad:SaveCurrentSession(session)</a></td>
<td class="summary">Saves a new session file of the currently opened buffers.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SetEditorBorderEdge">Notepad:SetEditorBorderEdge(useOrNot)</a></td>
<td class="summary">Enable or disable the editor's border edge</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SetSmoothFont">Notepad:SetSmoothFont(useOrNot)</a></td>
<td class="summary">Enable or disable the use of smooth fonts.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:ShowDocSwitcher">Notepad:ShowDocSwitcher(showOrNot)</a></td>
<td class="summary">Enable or disable the doc switcher panel.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:SwitchToFile">Notepad:SwitchToFile(filename)</a></td>
<td class="summary">Switch to the specified document.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad:<API key>">Notepad:<API key>(view, index)</a></td>
<td class="summary">Activate the tab bar context menu.</td>
</tr>
</table>
<h2><a href="#Properties">Properties </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#Notepad.<API key>">Notepad.<API key></a></td>
<td class="summary">Whether plugins are allowed to be loaded from the <code>%APPDATA%</code> directory.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.BufferFormat">Notepad.BufferFormat[id]</a></td>
<td class="summary">Gets or sets the buffer's end of line mode (one of the <code>SC_EOL_xxx</code> constants).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.BufferLangType">Notepad.BufferLangType[id]</a></td>
<td class="summary">Gets or sets the buffer's language type (one of the <code>L_xxx</code> constants).</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.CurrentBufferID">Notepad.CurrentBufferID</a></td>
<td class="summary">Gets the current BufferID.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.CurrentColumn">Notepad.CurrentColumn</a></td>
<td class="summary">Gets the current column of the cursor.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.CurrentLine">Notepad.CurrentLine</a></td>
<td class="summary">Gets the current line number of the cursor.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.CurrentView">Notepad.CurrentView</a></td>
<td class="summary">Gets the currently active view, either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.<API key>">Notepad.<API key></a></td>
<td class="summary">Gets the default background color used for documents.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.<API key>">Notepad.<API key></a></td>
<td class="summary">Gets the default foreground color used for documents.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.LanguageDescription">Notepad.LanguageDescription[language]</a></td>
<td class="summary">Gets the description of a language.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.LanguageName">Notepad.LanguageName[language]</a></td>
<td class="summary">Gets the language name.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.NativeLangEncoding">Notepad.NativeLangEncoding</a></td>
<td class="summary">Gets the encoding of Notepad++'s localization.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.StatusBar">Notepad.StatusBar[field]</a></td>
<td class="summary">Sets the status bar's text.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.Version">Notepad.Version</a></td>
<td class="summary">Gets the Notepad++ version.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#Notepad.WindowsVersion">Notepad.WindowsVersion</a></td>
<td class="summary">Gets the version of the Windows operating system (one of the <code>WV_xxx</code> constants).</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Helper_Methods"></a>Helper Methods </h2>
<dl class="function">
<dt>
<a name = "Notepad.SendEditor"></a>
<strong>Notepad.SendEditor(sci_const[, wparam=0[, lparam=0]])</strong>
</dt>
<dd>
Sends a message to the current editor.
This duplicates the functionality of the editor object, providing access to this through an interface that is more familiar to Scintilla C++ developers.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">sci_const</span>
<span class="types"><span class="type">int</span></span>
A <a href="http://www.scintilla.org/ScintillaDoc.html#SCI_xxx">SCI_xxx</a> message constant
</li>
<li><span class="parameter">wparam</span>
optional parameter dependent on the specific message
(<em>default 0</em>)
</li>
<li><span class="parameter">lparam</span>
optional parameter dependent on the specific message
(<em>default 0</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
optional return value dependent on the specific message
</ol>
</dd>
<dt>
<a name = "Notepad.ConstantName"></a>
<strong>Notepad.ConstantName(const[, hint])</strong>
</dt>
<dd>
Looks up the symbolic name of a constant.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">const</span>
<span class="types"><span class="type">int</span></span>
number
</li>
<li><span class="parameter">hint</span>
<span class="types"><span class="type">string</span></span>
the prefix of the constant to attempt to find
(<em>optional</em>)
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
The symbolic name of a Scintilla / Notepad++ constant. Raises error if not found.
</ol>
</dd>
<dt>
<a name = "Notepad.AddEventHandler"></a>
<strong>Notepad.AddEventHandler(event, callback)</strong>
</dt>
<dd>
Registers a Lua function to handle a given event.
See the topic on Callbacks
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><span class="type">string</span></span>
name of the desired event (can also be an array of strings)
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
function to call when the event(s) is triggered
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
always returns <code>true</code> currently
</ol>
</dd>
<dt>
<a name = "Notepad.RemoveEventHandler"></a>
<strong>Notepad.RemoveEventHandler(event, callback)</strong>
</dt>
<dd>
Removes previously registered Lua function for a given event.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><span class="type">string</span></span>
name of the desired event
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
a previously registered function
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<code>true</code> if the function had been previously registered, else <code>false</code>
</ol>
<h3>See also:</h3>
<ul>
<a href="../classes/Notepad.html#Notepad.AddEventHandler">AddEventHandler</a>
</ul>
</dd>
<dt>
<a name = "Notepad.<API key>"></a>
<strong>Notepad.<API key>(event)</strong>
</dt>
<dd>
Removes all registered Lua functions for a given event.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">event</span>
<span class="types"><span class="type">string</span></span>
name of the desired event
</li>
</ul>
<h3>See also:</h3>
<ul>
<a href="../classes/Notepad.html#Notepad.AddEventHandler">AddEventHandler</a>
</ul>
</dd>
<dt>
<a name = "Notepad.AddShortcut"></a>
<strong>Notepad.AddShortcut(name, shortcut, callback)</strong>
</dt>
<dd>
Registers a Lua function for a shortcut key.
The callback is not passed any parameters.</p>
<p> <strong>Note:</strong> This can only be called during startup.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><span class="type">string</span></span>
the user-friendly name of the shortcut (this is displayed in the menu)
</li>
<li><span class="parameter">shortcut</span>
<span class="types"><span class="type">string</span></span>
the modifier and key (e.g. "<code>Ctrl+Alt+Shift+D</code>"). The <em>key</em> must be one of: <code>A</code>-<code>Z</code>, <code>0</code>-<code>9</code>, <code>F1</code>-<code>F12</code>, <code>;</code>, <code>/</code>, <code>~</code>, <code>[</code>, <code>\</code>, <code>]</code>, <code>\</code>, <code>,</code>, <code>-</code>, <code>.</code>, <code>=</code>, <code>up</code>, <code>down</code>, <code>left</code>, <code>right</code>, <code>space</code>, <code>pageup</code>, <code>pagedown</code>, <code>backspace</code>, <code>delete</code>, <code>escape</code>
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
function to call when the shortcut is triggered
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.WriteError"></a>
<strong>Notepad.WriteError(...)</strong>
</dt>
<dd>
Writes an error message to the console.
Calls <code>tostring</code> on each parameter and prints the results in the console in red text.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">...</span>
variable number of arguments
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.ClearConsole"></a>
<strong>Notepad.ClearConsole()</strong>
</dt>
<dd>
Clears the console.
</dd>
<dt>
<a name = "Notepad.StartTimer"></a>
<strong>Notepad.StartTimer(ms, callback)</strong>
</dt>
<dd>
Continuously calls a function at a set interval. </p>
<p> <strong>Note:</strong> The timer will continue to fire until <a href="../classes/Notepad.html#Notepad.StopTimer">StopTimer</a> is called. Also, these timers run synchronously in the same thread as Notepad++, meaning that if Notepad++ is busy processing the file (such as doing search/replace) the timer event will get delayed. It is safe to access any of the globally defined LuaScript objects in the callback.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">ms</span>
<span class="types"><span class="type">int</span></span>
milliseconds to wait between calls
</li>
<li><span class="parameter">callback</span>
<span class="types"><span class="type">function</span></span>
function to be called. It will be passed a singe parameter, the opaque <code>timer</code> object
</li>
</ul>
<h3>Returns:</h3>
<ol>
the opaque <code>timer</code> object
</ol>
<h3>See also:</h3>
<ul>
<a href="../classes/Notepad.html#Notepad.StopTimer">StopTimer</a>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="comment">-- A trivial example...save a copy of the current file every 10 seconds, unless the file is too big
</span>npp.StartTimer(<span class="number">10000</span>, <span class="keyword">function</span>(timer)
<span class="keyword">if</span> editor.Length < <span class="number">1000</span> <span class="keyword">then</span>
npp:SaveCurrentFileAs(<span class="keyword">true</span>, <span class="string">[[C:\path\to\current\file.backup]]</span>)
<span class="keyword">else</span>
npp.StopTimer(timer)
<span class="keyword">end</span>
<span class="keyword">end</span>)</pre>
</ul>
</dd>
<dt>
<a name = "Notepad.StopTimer"></a>
<strong>Notepad.StopTimer(timer)</strong>
</dt>
<dd>
Stops a previously created timer.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">timer</span>
the opaque <code>timer</code> object returned from <a href="../classes/Notepad.html#Notepad.StartTimer">StartTimer</a> or passed into the callback
</li>
</ul>
<h3>See also:</h3>
<ul>
<a href="../classes/Notepad.html#Notepad.StartTimer">StartTimer</a>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "Notepad:ActivateDoc"></a>
<strong>Notepad:ActivateDoc(view, index2Activate)</strong>
</dt>
<dd>
Activates the specified document.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">view</span>
<span class="types"><span class="type">int</span></span>
either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>
</li>
<li><span class="parameter">index2Activate</span>
<span class="types"><span class="type">int</span></span>
index of the view to activate
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:DisableAutoUpdate"></a>
<strong>Notepad:DisableAutoUpdate()</strong>
</dt>
<dd>
Disable checking for auto updates.
</dd>
<dt>
<a name = "Notepad:DmmViewOtherTab"></a>
<strong>Notepad:DmmViewOtherTab(name)</strong>
</dt>
<dd>
View another docked tab.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">name</span>
<span class="types"><span class="type">string</span></span>
name of the docked tab (e.g. "Function List")
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:DoOpen"></a>
<strong>Notepad:DoOpen(file)</strong>
</dt>
<dd>
Opens a document.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">file</span>
<span class="types"><span class="type">string</span></span>
name
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<code>true</code> if successful, else <code>false</code>
</ol>
</dd>
<dt>
<a name = "Notepad:<API key>"></a>
<strong>Notepad:<API key>(toShow)</strong>
</dt>
<dd>
Enable or disable the file extension column in the doc switcher.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">toShow</span>
<span class="types"><span class="type">bool</span></span>
whether to show or hide the column
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:GetBufferIDFromPos"></a>
<strong>Notepad:GetBufferIDFromPos(position, view)</strong>
</dt>
<dd>
Gets the BufferID located at the given position.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">position</span>
<span class="types"><span class="type">int</span></span>
position of document
</li>
<li><span class="parameter">view</span>
<span class="types"><span class="type">int</span></span>
either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
BufferID or 0 if invalid
</ol>
</dd>
<dt>
<a name = "Notepad:GetCurrentDirectory"></a>
<strong>Notepad:GetCurrentDirectory()</strong>
</dt>
<dd>
Gets the current directory of the document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
current directory
</ol>
</dd>
<dt>
<a name = "Notepad:GetCurrentDocIndex"></a>
<strong>Notepad:GetCurrentDocIndex(view)</strong>
</dt>
<dd>
Gets the current document index within the view.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">view</span>
<span class="types"><span class="type">int</span></span>
either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
index of the current document. -1 if the requested view is not visible.
</ol>
</dd>
<dt>
<a name = "Notepad:GetCurrentWord"></a>
<strong>Notepad:GetCurrentWord()</strong>
</dt>
<dd>
Selects and returns the word at the cursor's position
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
word
</ol>
</dd>
<dt>
<a name = "Notepad:GetExtPart"></a>
<strong>Notepad:GetExtPart()</strong>
</dt>
<dd>
Gets the file extension of the current document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
file extension
</ol>
</dd>
<dt>
<a name = "Notepad:GetFileName"></a>
<strong>Notepad:GetFileName()</strong>
</dt>
<dd>
Gets the file name of the current document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
file name
</ol>
</dd>
<dt>
<a name = "Notepad:GetFileNameAtCursor"></a>
<strong>Notepad:GetFileNameAtCursor()</strong>
</dt>
<dd>
Gets the file name at the cursor position.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
file path
</ol>
</dd>
<dt>
<a name = "Notepad:GetFullCurrentPath"></a>
<strong>Notepad:GetFullCurrentPath()</strong>
</dt>
<dd>
Gets the full path of the current document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
full path
</ol>
</dd>
<dt>
<a name = "Notepad:<API key>"></a>
<strong>Notepad:<API key>(BufferID)</strong>
</dt>
<dd>
Gets the full path of the provided buffer ID.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">BufferID</span>
<span class="types"><span class="type">int</span></span>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
full path
</ol>
</dd>
<dt>
<a name = "Notepad:GetNamePart"></a>
<strong>Notepad:GetNamePart()</strong>
</dt>
<dd>
Gets the file name (without extension) of the current document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:GetNbOpenFiles"></a>
<strong>Notepad:GetNbOpenFiles(view)</strong>
</dt>
<dd>
Gets the number of open documents.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">view</span>
<span class="types"><span class="type">int</span></span>
either <code>ALL_OPEN_FILES</code>, <code>PRIMARY_VIEW</code>, or <code>SECOND_VIEW</code>
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:GetNbSessionFiles"></a>
<strong>Notepad:GetNbSessionFiles(session)</strong>
</dt>
<dd>
Gets the number of files a the session file.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">session</span>
<span class="types"><span class="type">string</span></span>
full path to the session file
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
number of files
</ol>
</dd>
<dt>
<a name = "Notepad:GetNppDirectory"></a>
<strong>Notepad:GetNppDirectory()</strong>
</dt>
<dd>
Gets the directory of the Notepad++ application.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:GetPluginsConfigDir"></a>
<strong>Notepad:GetPluginsConfigDir()</strong>
</dt>
<dd>
Gets the plugin configuration directory.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">string</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:GetPosFromBufferID"></a>
<strong>Notepad:GetPosFromBufferID(BufferID, priorityView)</strong>
</dt>
<dd>
Gets the position information of the provided buffer ID.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">BufferID</span>
<span class="types"><span class="type">int</span></span>
</li>
<li><span class="parameter">priorityView</span>
<span class="types"><span class="type">int</span></span>
either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>. If priorityView set to <code>SUB_VIEW</code>, then it will be searched first
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int</span></span>
the two highest bits will either be <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>. The lower 30 bits will be the 0-based index.
</ol>
</dd>
<dt>
<a name = "Notepad:HideMenu"></a>
<strong>Notepad:HideMenu(hideOrNot)</strong>
</dt>
<dd>
Hides or shows the menu.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">hideOrNot</span>
<span class="types"><span class="type">bool</span></span>
whether or not to hide the menu
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
the previous state
</ol>
</dd>
<dt>
<a name = "Notepad:HideStatusBar"></a>
<strong>Notepad:HideStatusBar(hideOrNot)</strong>
</dt>
<dd>
Hides or shows the status bar.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">hideOrNot</span>
<span class="types"><span class="type">bool</span></span>
whether or not to hide the status bar
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
the previous state
</ol>
</dd>
<dt>
<a name = "Notepad:HideTabBar"></a>
<strong>Notepad:HideTabBar(hideOrNot)</strong>
</dt>
<dd>
Hides or shows the tab bar.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">hideOrNot</span>
<span class="types"><span class="type">bool</span></span>
whether or not to hide the tab bar
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
the previous state
</ol>
</dd>
<dt>
<a name = "Notepad:HideToolBar"></a>
<strong>Notepad:HideToolBar(hideOrNot)</strong>
</dt>
<dd>
Hides or shows the tool bar.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">hideOrNot</span>
<span class="types"><span class="type">bool</span></span>
whether or not to hide the tool bar
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
the previous state
</ol>
</dd>
<dt>
<a name = "Notepad:IsDocSwitcherShown"></a>
<strong>Notepad:IsDocSwitcherShown()</strong>
</dt>
<dd>
Gets whether the doc switcher is hidden or shown.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:IsMenuHidden"></a>
<strong>Notepad:IsMenuHidden()</strong>
</dt>
<dd>
Gets whether the menu is hidden or shown.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:IsStatusBarHidden"></a>
<strong>Notepad:IsStatusBarHidden()</strong>
</dt>
<dd>
Gets whether the status bar is hidden or shown.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:IsTabBarHidden"></a>
<strong>Notepad:IsTabBarHidden()</strong>
</dt>
<dd>
Gets whether the tab bar is hidden or shown.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:IsToolBarHidden"></a>
<strong>Notepad:IsToolBarHidden()</strong>
</dt>
<dd>
Gets whether the tool bar is hidden or shown.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:<API key>"></a>
<strong>Notepad:<API key>(path, filter)</strong>
</dt>
<dd>
Launch the "Find in Files" dialog.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">path</span>
<span class="types"><span class="type">string</span></span>
the directory path to search
</li>
<li><span class="parameter">filter</span>
<span class="types"><span class="type">string</span></span>
the filter to use (e.g. "*.c *.h")
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:LoadSession"></a>
<strong>Notepad:LoadSession(filename)</strong>
</dt>
<dd>
Loads a session file.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">filename</span>
<span class="types"><span class="type">string</span></span>
full path to the session file
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:<API key>"></a>
<strong>Notepad:<API key>()</strong>
</dt>
<dd>
Makes the current buffer marked as dirty.
</dd>
<dt>
<a name = "Notepad:MenuCommand"></a>
<strong>Notepad:MenuCommand(command)</strong>
</dt>
<dd>
Executes a menu command.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">command</span>
<span class="types"><span class="type">int</span></span>
one of the <a href="https://github.com/dail8859/LuaScript/blob/master/src/Npp/menuCmdID.h">IDM_xxx</a> constants
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:ReloadBufferID"></a>
<strong>Notepad:ReloadBufferID(BufferID, alertOrNot)</strong>
</dt>
<dd>
Reloads the specified buffer ID.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">BufferID</span>
<span class="types"><span class="type">int</span></span>
</li>
<li><span class="parameter">alertOrNot</span>
<span class="types"><span class="type">bool</span></span>
whether to show an alert dialog.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:ReloadFile"></a>
<strong>Notepad:ReloadFile(withAlert, filename)</strong>
</dt>
<dd>
Reloads the specified file.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">withAlert</span>
<span class="types"><span class="type">bool</span></span>
use an alert or not
</li>
<li><span class="parameter">filename</span>
<span class="types"><span class="type">string</span></span>
file name to reload
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:SaveAllFiles"></a>
<strong>Notepad:SaveAllFiles()</strong>
</dt>
<dd>
Saves all the opened documents.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:SaveCurrentFile"></a>
<strong>Notepad:SaveCurrentFile()</strong>
</dt>
<dd>
Saves the current document.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:SaveCurrentFileAs"></a>
<strong>Notepad:SaveCurrentFileAs(asCopy, filename)</strong>
</dt>
<dd>
Saves the current document as the specified name.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">asCopy</span>
<span class="types"><span class="type">bool</span></span>
flag to indicate of the file should be saved as a copy
</li>
<li><span class="parameter">filename</span>
<span class="types"><span class="type">string</span></span>
file name
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "Notepad:SaveCurrentSession"></a>
<strong>Notepad:SaveCurrentSession(session)</strong>
</dt>
<dd>
Saves a new session file of the currently opened buffers.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">session</span>
<span class="types"><span class="type">string</span></span>
full path of the new session file
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:SetEditorBorderEdge"></a>
<strong>Notepad:SetEditorBorderEdge(useOrNot)</strong>
</dt>
<dd>
Enable or disable the editor's border edge
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">useOrNot</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:SetSmoothFont"></a>
<strong>Notepad:SetSmoothFont(useOrNot)</strong>
</dt>
<dd>
Enable or disable the use of smooth fonts.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">useOrNot</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:ShowDocSwitcher"></a>
<strong>Notepad:ShowDocSwitcher(showOrNot)</strong>
</dt>
<dd>
Enable or disable the doc switcher panel.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">showOrNot</span>
<span class="types"><span class="type">bool</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad:SwitchToFile"></a>
<strong>Notepad:SwitchToFile(filename)</strong>
</dt>
<dd>
Switch to the specified document.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">filename</span>
<span class="types"><span class="type">string</span></span>
file name
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
<code>true</code> if successful, else <code>false</code>
</ol>
</dd>
<dt>
<a name = "Notepad:<API key>"></a>
<strong>Notepad:<API key>(view, index)</strong>
</dt>
<dd>
Activate the tab bar context menu.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">view</span>
<span class="types"><span class="type">int</span></span>
either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>
</li>
<li><span class="parameter">index</span>
<span class="types"><span class="type">int</span></span>
0-based index
</li>
</ul>
</dd>
</dl>
<h2 class="section-header "><a name="Properties"></a>Properties </h2>
<dl class="function">
<dt>
<a name = "Notepad.<API key>"></a>
<strong>Notepad.<API key></strong>
</dt>
<dd>
Whether plugins are allowed to be loaded from the <code>%APPDATA%</code> directory.
<ul>
<li><span class="parameter"><API key></span>
<span class="types"><span class="type">bool</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.BufferFormat"></a>
<strong>Notepad.BufferFormat[id]</strong>
</dt>
<dd>
Gets or sets the buffer's end of line mode (one of the <code>SC_EOL_xxx</code> constants).
<ul>
<li><span class="parameter">id</span>
<span class="types"><span class="type">BufferID</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.BufferLangType"></a>
<strong>Notepad.BufferLangType[id]</strong>
</dt>
<dd>
Gets or sets the buffer's language type (one of the <code>L_xxx</code> constants).
<ul>
<li><span class="parameter">id</span>
<span class="types"><span class="type">BufferID</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.CurrentBufferID"></a>
<strong>Notepad.CurrentBufferID</strong>
</dt>
<dd>
Gets the current BufferID.
<ul>
<li><span class="parameter">CurrentBufferID</span>
<span class="types"><span class="type">BufferID</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.CurrentColumn"></a>
<strong>Notepad.CurrentColumn</strong>
</dt>
<dd>
Gets the current column of the cursor.
<ul>
<li><span class="parameter">CurrentColumn</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.CurrentLine"></a>
<strong>Notepad.CurrentLine</strong>
</dt>
<dd>
Gets the current line number of the cursor.
<ul>
<li><span class="parameter">CurrentLine</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.CurrentView"></a>
<strong>Notepad.CurrentView</strong>
</dt>
<dd>
Gets the currently active view, either <code>MAIN_VIEW</code> or <code>SUB_VIEW</code>.
<ul>
<li><span class="parameter">CurrentView</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.<API key>"></a>
<strong>Notepad.<API key></strong>
</dt>
<dd>
Gets the default background color used for documents.
<ul>
<li><span class="parameter"><API key></span>
<span class="types"><span class="type">colour</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.<API key>"></a>
<strong>Notepad.<API key></strong>
</dt>
<dd>
Gets the default foreground color used for documents.
<ul>
<li><span class="parameter"><API key></span>
<span class="types"><span class="type">colour</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.LanguageDescription"></a>
<strong>Notepad.LanguageDescription[language]</strong>
</dt>
<dd>
Gets the description of a language.
<ul>
<li><span class="parameter">language</span>
<span class="types"><span class="type">int</span></span>
one of the <code>L_xxx</code> constant
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.LanguageName"></a>
<strong>Notepad.LanguageName[language]</strong>
</dt>
<dd>
Gets the language name.
<ul>
<li><span class="parameter">language</span>
<span class="types"><span class="type">int</span></span>
one of the <code>L_xxx</code> constant
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.NativeLangEncoding"></a>
<strong>Notepad.NativeLangEncoding</strong>
</dt>
<dd>
Gets the encoding of Notepad++'s localization.
<ul>
<li><span class="parameter">NativeLangEncoding</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.StatusBar"></a>
<strong>Notepad.StatusBar[field]</strong>
</dt>
<dd>
<p>Sets the status bar's text.
<code>field</code> must be one of the following:</p>
<ul>
<li><code>STATUSBAR_DOC_TYPE</code></li>
<li><code>STATUSBAR_DOC_SIZE</code></li>
<li><code>STATUSBAR_CUR_POS</code></li>
<li><code><API key></code></li>
<li><code><API key></code></li>
<li><code><API key></code>
</li>
</ul>
<ul>
<li><span class="parameter">field</span>
<span class="types"><span class="type">int</span></span>
</li>
</ul>
</dd>
<dt>
<a name = "Notepad.Version"></a>
<strong>Notepad.Version</strong>
</dt>
<dd>
Gets the Notepad++ version.
The high 16 bits contain the major version. The low 16 bits contain the minor version.
<ul>
<li><span class="parameter">Version</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example"><span class="global">print</span>((npp.Version >> <span class="number">16</span>) .. <span class="string">'.'</span> .. (npp.Version & <span class="number">0xff</span>))</pre>
</ul>
</dd>
<dt>
<a name = "Notepad.WindowsVersion"></a>
<strong>Notepad.WindowsVersion</strong>
</dt>
<dd>
Gets the version of the Windows operating system (one of the <code>WV_xxx</code> constants).
<ul>
<li><span class="parameter">WindowsVersion</span>
<span class="types"><span class="type">int</span></span>
(<em>readonly</em>)
</li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
<footer>
<a href="https:
</footer>
</body>
</html> |
/* $Id: layout.css,v 1.1.2.11.2.3.2.1 2010/11/24 21:31:56 adrinux Exp $ */
/* Layout */
.limiter {
width: 940px;
margin: 0 auto;
padding: 10px 0;
}
.sidebar {
width: 220px;
}
#sidebar-first {
margin-right: 20px;
float: left;
}
#sidebar-second {
margin-left: 20px;
float: right;
}
.one-sidebar #content {
width: 700px;
}
.two-sidebars #content {
width: 460px;
}
.no-sidebars #content {
float: none;
}
.sidebar-second #content,
.two-sidebars #content {
float: left;
}
.sidebar-first #content {
float: right;
} |
<?php
<API key>('nextend.smartslider.plugin.slideritem');
class <API key> extends <API key> {
var $_identifier = 'heading';
var $_title = 'Heading';
function getTemplate() {
return "
<h{priority} class='{fontclass} {class}' style=\"{fontsizer}{fontcolorr}{css_esc}\" data-click=\"{onmouseclick_esc}\" data-enter=\"{onmouseenter_esc}\" data-leave=\"{onmouseleave_esc}\">
<a href='{url}' target='{target}' style='{fontcolorr}'>
{heading}
</a>
</h{priority}>
";
}
function getValues() {
return array(
'fontsizer' => '',
'fontcolorr' => '',
'priority' => '1',
'heading' => NextendText::_('Heading'),
'link' => '#|*|_self',
'url' => '',
'target' => '_self',
'fontclass' => 'sliderfont2',
'class' => '',
'css' => 'padding: 0;
margin: 0;
background: none;
box-shadow: none;',
'onmouseclick' => '',
'onmouseenter' => '',
'onmouseleave' => ''
);
}
function getPath() {
return dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->_identifier . DIRECTORY_SEPARATOR;
}
}
NextendPlugin::addPlugin('nextendslideritem', '<API key>'); |
/*
* This Java file has been generated by smidump 0.4.5. Do not edit!
* It is intended to be used within a Java AgentX sub-agent environment.
*
* $Id: AddressMapEntry.java 4432 2006-05-29 16:21:11Z strauss $
*/
/**
This class represents a Java AgentX (JAX) implementation of
the table row addressMapEntry defined in RMON2-MIB.
@version 1
@author smidump 0.4.5
@see AgentXTable, AgentXEntry
*/
import jax.AgentXOID;
import jax.AgentXSetPhase;
import jax.AgentXResponsePDU;
import jax.AgentXEntry;
public class AddressMapEntry extends AgentXEntry
{
protected long addressMapTimeMark = 0;
protected byte[] <API key> = new byte[0];
protected AgentXOID addressMapSource = new AgentXOID();
protected byte[] <API key> = new byte[0];
protected long <API key> = 0;
// foreign indices
protected int <API key>;
public AddressMapEntry(long addressMapTimeMark,
int <API key>,
byte[] <API key>,
AgentXOID addressMapSource)
{
this.addressMapTimeMark = addressMapTimeMark;
this.<API key> = <API key>;
this.<API key> = <API key>;
this.addressMapSource = addressMapSource;
instance.append(addressMapTimeMark);
instance.append(<API key>);
instance.append(<API key>);
instance.append(addressMapSource);
}
public long <API key>()
{
return addressMapTimeMark;
}
public int <API key>()
{
return <API key>;
}
public byte[] <API key>()
{
return <API key>;
}
public AgentXOID <API key>()
{
return addressMapSource;
}
public byte[] <API key>()
{
return <API key>;
}
public long <API key>()
{
return <API key>;
}
} |
/* jshint browser:true, global:true */
/* global jQuery console */
(function ($) {
'use strict';
$.widget("ec.compressedTabs", $.ui.tabs, {
_create: function () {
this.element
.addClass('ui-tabs-compressed');
this._super();
this.tablist
.contents()
.not(function () { return this.nodeType !== 3; })
.remove();
this.wrap =
this.tablist
.wrap('<div>')
.parent();
this.tablistWrap =
this.tablist
.wrap('<div class="<API key>"></div>')
.parent();
var navs = { left: null, right: null },
self = this;
$.each(navs, function(key) {
navs[key] = $('<em>', {
'class': 'ui-tabs-compressed-' + key,
'click': $.proxy(self._onClicked, self)
});
});
this.navs = navs;
this.wrap
.addClass('<API key>')
.prepend(navs.left)
.append(navs.right);
$.each(navs, function(key) {
navs[key].wrap('<div class="<API key>"></div>');
});
this._resizeList(false);
},
_destory: function() {
this.navs
.left
.remove();
this.navs
.right
.remove();
this.tablist
.unwrap()
.unwrap();
this.element
.removeClass('ui-tabs-compressed');
this._super();
},
_activate: function( index ) {
var activeIndex = this.active.index();
if (activeIndex === index) {
return;
}
var target = activeIndex < index ? this.active : this.tabs.eq(index);
var direction = activeIndex < index ? '-=' : '+=';
var distance = direction + target.width() + 'px';
this._super(index);
this._resizeList(true);
this.tabs
.animate({
left: distance
});
},
_setupEvents: function() {
this._on( this.anchors, {
click: function(e) { e.preventDefault(); }
});
//Do nothing else
},
_resizeList: function(animate) {
var width = this.active.width();
this.tablist[animate ? 'animate' : 'css']({
width: width
});
},
_onClicked: function(event) {
var moveNext =
this.navs
.right
.is(event.target),
distance = moveNext ? 1 : -1,
index = this.active.index() + distance;
if (index >= 0 && index < this.tabs.length) {
this._activate(index);
}
}
});
})(jQuery); |
<!DOCTYPE html PUBLIC "-
<html>
<!
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
<head>
<title>Proof General: 1. Introducing Proof General</title>
<meta name="description" content="Proof General: 1. Introducing Proof General">
<meta name="keywords" content="Proof General: 1. Introducing Proof General">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!
/* Style sheet for the Proof General web pages.
* David Aspinall, June 1999.
* proofgen.css,v 4.0 2000/03/13 07:36:57 da Exp
*/
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.roman {font-family:serif; font-weight:normal;}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body{
font-family: Verdana, Arial, sans-serif;
background: #2D1D03; /* background brown */
<API key>: fixed;
color: #FFFFFF;
}
p{
max-width: 1024px;
font-family: Verdana, Arial, sans-serif;
color: #FFFFFF;
}
pre{
color: #FFFFFF;
}
h1{
color: #FFFFFF;
font-size: large;
font-weight: bold;
}
h2{
font-size: medium;
font-weight: bold;
color: #FFFFD0;
padding: 2px 4px 4px 8px;
background: #5D2D13;
}
h3{
font-size: medium;
padding: 2px 2px 2px 8px;
margin-right: 50%;
background: #4D1D23;
color: #FFFFD0;
}
h4{
font-size: medium;
color: #FFD0D0;
padding: 2px 2px 2px 8px;
}
blockquote,form,input,select{
color: #FFFFFF;
}
address{
font-size: small;
color: #FFFFFF;
}
select {
font-size: 100%;
background: #2D1D03;
color: #FFFFFF;
}
textarea,input {
font-size: 100%;
background: #4D2D23;
color: #FFFFFF;
}
input[type=submit],input[type=reset],input[type=Submit] {
font-size: 80%;
padding-top: 0px;
padding-bottom: 0px;
background: #401010;
}
#button:active{
background: #402020;
}
dl,ul,dir,li{
color: #FFFFFF;
max-width: 1024px;
}
dt{ font-style: italic;
padding: 2px 2px 2px 8px;
margin-left: 20px;
margin-right: 20px;
background: #4D1D23;
}
table{
font-family: Verdana, Arial, sans-serif;
color: #FFFFFF;
}
table.menubar{
font-family: Verdana, Arial, sans-serif;
font-size: smaller;
color: #FFFFFF;
}
td,tr{
color: #FFFFFF;
}
a:link,a:visited{
font-family: Verdana, Arial, sans-serif;
text-decoration: none;
color: #E0D020;
}
a:active,a:hover{
font-family: Verdana, Arial, sans-serif;
text-decoration: underline;
color: #E8D830;
}
pre{
background: #2D1D03;
}
/* Specifics */
p.nb{
font-size: smaller;
font-style: italic;
}
/* These bits for Mailman pages for mailing lists */
TD.head1old {
font-family: Verdana, Arial, sans-serif;
text-align: center;
color: #FFFFFF;
font-weight: bold;
font-size: 110%;
}
td.head1{
font-family: Verdana, Arial, sans-serif;
font-weight: bold;
font-size: 110%;
text-align: center;
color: #FFFFFF;
}
td.head2{
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
color: #FFFFD0;
padding: 2px 4px 4px 4px;
background: #7D4D33;
}
td.head3{
font-family: Verdana, Arial, sans-serif;
padding: 2px 2px 2px 2px;
margin-right: 10%;
background: #6D3D43;
font-size: 80%;
color: #FFFFD0;
}
td.head4{
font-family: Verdana, Arial, sans-serif;
font-size: 100%;
font-weight: bold;
color: #FFD0D0;
}
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="ProofGeneral_1.html#Preface" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_3.html#<API key>" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="ProofGeneral.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_20.html#Function-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<hr size="2">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h1 class="chapter">1. Introducing Proof General</h1>
<a name="<API key>"></a>
<a name="index-Proof-General"></a>
<img src="ProofGeneral.jpg" alt="[ Proof General logo ]" >
<p><em>Proof General</em> is a generic Emacs interface for interactive proof
assistants,<a name="DOCF1" href="ProofGeneral_fot.html#FOOT1">(1)</a> developed at the LFCS in
the University of Edinburgh.
</p>
<p>You do not have to be an Emacs militant to use Proof General!
</p>
<p>The interface is designed to be very easy to use. You develop your
proof script<a name="DOCF2" href="ProofGeneral_fot.html#FOOT2">(2)</a>
in-place rather than line-by-line and later reassembling the pieces.
Proof General keeps track of which proof steps have been processed by
the prover, and prevents you editing them accidently. You can undo
steps as usual.
</p>
<p>The aim of Proof General is to provide a powerful and configurable
interface for numerous interactive proof assistants. We target Proof
General mainly at intermediate or expert users, so that the interface
should be useful for large proof developments.
</p>
<p>Please help us!
</p>
<p>Send us comments, suggestsions, or (the best) patches to improve support
for your chosen proof assistant. Contact us at
<a href="http:
</p>
<p>If your chosen proof assistant isn’t supported, read the accompanying
<i>Adapting Proof General</i> manual to find out how to configure PG for a
new prover.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#<API key>">1.1 Installing Proof General</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#Quick-start-guide">1.2 Quick start guide</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#<API key>">1.3 Features of Proof General</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#<API key>">1.4 Supported proof assistants</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#<API key>">1.5 Prerequisites for this manual</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#<API key>">1.6 Organization of this manual</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr size="6">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h2 class="section">1.1 Installing Proof General</h2>
<p>If Proof General has not already been installed for you, you should
unpack it and insert the line:
</p><table><tr><td> </td><td><pre class="lisp"> (load "<var>proof-general-home</var>/generic/proof-site.el")
</pre></td></tr></table>
<p>into your ‘<tt>~/.emacs</tt>’ file, where <var>proof-general-home</var> is the
top-level directory that was created when Proof General was unpacked.
</p>
<p>For much more information, See section <a href="ProofGeneral_16.html#<API key>">Obtaining and Installing</a>.
</p>
<hr size="6">
<a name="Quick-start-guide"></a>
<a name="Quick-start-guide-1"></a>
<h2 class="section">1.2 Quick start guide</h2>
<p>Once Proof General is correctly installed, the corresponding Proof
General mode will be invoked automatically when you visit a proof
script file for your proof assistant, for example:
</p>
<table>
<tr><td width="35%"><b>Prover</b></td><td width="30%"><b>Extensions</b></td><td width="35%"><b>Mode</b></td></tr>
<tr><td width="35%">LEGO</td><td width="30%">‘<tt>.l</tt>’</td><td width="35%"><code>lego-mode</code></td></tr>
<tr><td width="35%">Coq</td><td width="30%">‘<tt>.v</tt>’</td><td width="35%"><code>coq-mode</code></td></tr>
<tr><td width="35%">Isabelle</td><td width="30%">‘<tt>.thy</tt>’</td><td width="35%"><code>isar-mode</code></td></tr>
<tr><td width="35%">Phox</td><td width="30%">‘<tt>.phx</tt>’</td><td width="35%"><code>phox-mode</code></td></tr>
<tr><td width="35%">HOL98</td><td width="30%">‘<tt>.sml</tt>’</td><td width="35%"><code>hol98-mode</code></td></tr>
<tr><td width="35%">HOL Light</td><td width="30%">‘<tt>.ml</tt>’</td><td width="35%"><code>hol-light-mode</code></td></tr>
<tr><td width="35%">ACL2</td><td width="30%">‘<tt>.acl2</tt>’</td><td width="35%"><code>acl2-mode</code></td></tr>
<tr><td width="35%">Twelf</td><td width="30%">‘<tt>.elf</tt>’</td><td width="35%"><code>twelf-mode</code></td></tr>
<tr><td width="35%">Plastic</td><td width="30%">‘<tt>.lf</tt>’</td><td width="35%"><code>plastic-mode</code></td></tr>
<tr><td width="35%">Lambda-CLAM</td><td width="30%">‘<tt>.lcm</tt>’</td><td width="35%"><code>lclam-mode</code></td></tr>
<tr><td width="35%">CCC</td><td width="30%">‘<tt>.ccc</tt>’</td><td width="35%"><code>ccc-mode</code></td></tr>
<tr><td width="35%">PG-Shell</td><td width="30%">‘<tt>.pgsh</tt>’</td><td width="35%"><code>pgshell-mode</code></td></tr>
</table>
<p>(the exact list of Proof Assistants supported may vary according to the
version of Proof General and its local configuration). You can also
invoke the mode command directly, e.g., type <kbd>M-x lego-mode</kbd>, to
turn a buffer into a lego script buffer.
</p>
<p>You’ll find commands to process the proof script are available from the
toolbar, menus, and keyboard. Type <kbd>C-h m</kbd> to get a list of the
keyboard shortcuts for the current mode. The commands available should
be easy to understand, but the rest of this manual describes them in
some detail.
</p>
<p>The proof assistant itself is started automatically inside Emacs as an
"inferior" process when you ask for some of the proof script to be
processed. You can start the proof assistant manually with the
menu command "Start proof assistant".
</p>
<p>To follow an example use of Proof General on a Isabelle proof,
see section <a href="ProofGeneral_3.html#<API key>">Walkthrough example in Isabelle</a>. If you know the syntax for proof
scripts in another theorem prover, you can easily adapt the details
given there.
</p>
<hr size="6">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h2 class="section">1.3 Features of Proof General</h2>
<a name="index-Features"></a>
<a name="<API key>"></a>
<p>Why would you want to use Proof General?
</p>
<p>Proof General is designed to be useful for novices and expert users
alike. It will be useful to you if you use a proof assistant, and you’d
like an interface with the following features: simplified interaction,
script management, multiple file scripting, a script editing mode, proof
by pointing, proof-tree visualization,
toolbar and menus, syntax highlighting, real symbols,
functions menu, tags, and finally, adaptability.
</p>
<p>Here is an outline of some of these features. Look in the contents
page or index of this manual to find out about the others!
</p>
<ul>
<li> <i>Simplified interaction</i><br>
Proof General is designed for proof assistants which have a
command-line shell interpreter. When using Proof General, the proof
assistant’s shell is hidden from the user. Communication takes
place via three buffers (Emacs text widgets).
Communication takes place via three buffers. The <em>script
buffer</em> holds input, the commands to construct a proof. The <em>goals
buffer</em> displays the current list of subgoals to be solved. The
<em>response buffer</em> displays other output from the proof assistant.
By default, only two of these three buffers are displayed.
This means that the user normally only sees the output from the most
recent interaction, rather than a screen full of output from the proof
assistant.
<p>Proof General does not commandeer the proof assistant shell: the user
still has complete access to it if necessary.
</p>
<p>For more details, see section <a href="ProofGeneral_3.html#<API key>">Summary of Proof General buffers</a>
and see section <a href="ProofGeneral_9.html#<API key>">Display customization</a>.
</p>
</li><li> <i>Script management</i><br>
Proof General colours proof script regions blue when they have
been processed by the prover, and colours regions red when the prover is
currently processing them. The appearance of Emacs buffers always
matches the proof assistant’s state. Coloured parts of the buffer cannot
be edited. Proof General has functions for <em>asserting</em> or
<em>retracting</em> parts of a proof script, which alters the coloured
regions.
<p>For more details, see section <a href="ProofGeneral_3.html#<API key>">Basic Script Management</a>,
<a href="ProofGeneral_3.html#<API key>">Script processing commands</a>,
and <a href="ProofGeneral_4.html#<API key>">Advanced Script Management and Editing</a>.
</p>
</li><li> <i>Script editing mode</i><br>
Proof General provides useful facilities for editing proof scripts,
including syntax hilighting and a menu to jump to particular goals,
definitions, or declarations.
Special editing functions send lines of proof script to the proof
assistant, or undo previous proof steps.
<p>For more details, see section <a href="ProofGeneral_3.html#<API key>">Script editing commands</a>,
and <a href="ProofGeneral_3.html#<API key>">Script processing commands</a>.
</p>
</li><li> <i>Proof-tree visualization</i><br>
In cooperation with the external program Prooftree
(available from the <a href="http://askra.de/software/prooftree/">Prooftree website</a>), Proof General can display proof trees
graphically and provide visual information about the proof status
of different branches in a proof. The proof-tree display provides
additional means for inspecting the proof tree and thus helps
against loosing track in proofs.
<p>The graphical proof-tree visualization is currently only
supported for Coq. For more details, see section <a href="ProofGeneral_8.html#<API key>">Graphical Proof-Tree Visualization</a>.
</p>
</li><li> <i>Toolbar and menus</i><br>
A script buffer has a toolbar with navigation buttons for processing
parts of the proof script. A menu provides further functions for
operations in the proof assistant, as well as customization of Proof
General.
<p>For more details, see section <a href="ProofGeneral_3.html#Toolbar-commands">Toolbar commands</a>, <a href="ProofGeneral_3.html#<API key>">Proof assistant commands</a>, and <a href="ProofGeneral_9.html#<API key>">Customizing Proof General</a>.
</p>
</li><li> <i>Proof by pointing</i><br>
Proof General has support for proof-by-pointing and similar features.
Proof by pointing allows you to click on a subterm of a goal to be
proved, and automatically apply an appropriate proof rule or tactic.
Proof by pointing is specific to the proof assistant (and logic) in use;
therefore it is configured mainly on the proof assistant side. If you
would like to see proof by pointing support for Proof General in a
particular proof assistant, petition the developers of the proof
assistant to provide it.
</li></ul>
<hr size="6">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h2 class="section">1.4 Supported proof assistants</h2>
<p>Proof General comes ready-customized for several
proof assistants, including these:
</p>
<ul>
<li>
<b>LEGO Proof General</b> for LEGO Version 1.3.1<br>
See section <a href="ProofGeneral_11.html#LEGO-Proof-General">LEGO Proof General</a>, for more details.
</li><li>
<b>Coq Proof General</b> for Coq Version 8.2<br>
See section <a href="ProofGeneral_12.html#Coq-Proof-General">Coq Proof General</a>, for more details.
</li><li>
<b>Isabelle Proof General</b> for Isabelle2009-2<br>
See section <a href="ProofGeneral_13.html#<API key>">Isabelle Proof General</a>, and documentation supplied with
Isabelle for more details.
</li><li>
<b>HOL Light Proof General</b> for HOL Light<br>
See section <a href="ProofGeneral_14.html#<API key>">HOL Light Proof General</a>, for more details.
</li><li>
<b>Shell Proof General</b> for shell scripts (not really a proof assistant!)<br>
See section <a href="ProofGeneral_15.html#Shell-Proof-General">Shell Proof General</a>, for more details.
</li></ul>
<p>Proof General is designed to be generic, so if you know how
to write regular expressions, you can make:
</p><ul>
<li>
<b>Your Proof General</b> for your favourite proof assistant.<br>
For more details of how to make Proof General work
with another proof assistant,
see the accompanying manual <i>Adapting Proof General</i>.
</li></ul>
<p>The exact list of Proof Assistants supported may vary according to the
version of Proof General you have and its local configuration; only the
standard instances documented in this manual are listed above.
</p>
<p>Note that there is some variation between the features supported by
different instances of Proof General. The main variation is proof by
pointing, which is only supported in LEGO at the moment. For advanced
features like this, some extensions to the output routines of the proof
assistant are required, typically. If you like Proof General, <b>please
help us by asking the implementors of your favourite proof assistant to
support Proof General</b> as much as possible.
</p>
<hr size="6">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h2 class="section">1.5 Prerequisites for this manual</h2>
<a name="index-Meta"></a>
<a name="index-Alt"></a>
<a name="index-key-sequences"></a>
<p>This manual assumes that you understand a little about using Emacs, for
example, switching between buffers using <kbd>C-x b</kbd> and understanding
that a key sequence like <kbd>C-x b</kbd> means "control with x, followed by b".
A key sequence like <kbd>M-z</kbd> means "meta with z". (<Meta> may be
labelled <Alt> on your keyboard).
</p>
<p>The manual also assumes you have a basic understanding of your proof
assistant and the language and files it uses for proof scripts. But
even without this, Proof General is not useless: you can use the
interface to <em>replay</em> proof scripts for any proof assistant without
knowing how to start it up or issue commands, etc. This is the beauty
of a common interface mechanism.
</p>
<p>To get more from Proof General and adapt it to your liking, it helps to
know a little bit about how Emacs lisp packages can be customized via
the Customization mechanism. It’s really easy to use. For details,
see section <a href="ProofGeneral_9.html#How-to-customize">How to customize</a>. See <a href="../(emacs/_0029Customization.html#<API key>">((emacs))Customization</a>,
for documentation in Emacs.
</p>
<p>To get the absolute most from Proof General, to improve it or to adapt
it for new provers, you’ll need to know a little bit of Emacs lisp.
Emacs is self-documenting, so you can begin from <kbd>C-h</kbd> and find out
everything! Here are some useful commands:
</p>
<dl compact="compact">
<dt> <kbd>C-h i</kbd></dt>
<dd><p><code>info</code>
</p></dd>
<dt> <kbd>C-h m</kbd> </dt>
<dd><p><code>describe-mode</code>
</p></dd>
<dt> <kbd>C-h b</kbd> </dt>
<dd><p><code>describe-bindings</code>
</p></dd>
<dt> <kbd>C-h f</kbd> </dt>
<dd><p><code>describe-function</code>
</p></dd>
<dt> <kbd>C-h v</kbd> </dt>
<dd><p><code>describe-variable</code>
</p></dd>
</dl>
<hr size="6">
<a name="<API key>"></a>
<a name="<API key>"></a>
<h2 class="section">1.6 Organization of this manual</h2>
<p>This manual covers the user-level view and customization of Proof
General. The accompanying <i>Adapting Proof General</i> manual considers
adapting Proof General to new proof assistants, and documents some of
the internals of Proof General.
</p>
<p>Three appendices of this manual contain some details about obtaining and
installing Proof General and some known bugs. The contents of these
final chapters is also covered in the files ‘<tt>INSTALL</tt>’ and
‘<tt>BUGS</tt>’ contained in the distribution. Refer to those files
for the latest information.
</p>
<p>The manual concludes with some references and indexes. See the table of
contents for full details.
</p>
<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#<API key>" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_3.html#<API key>" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="ProofGeneral.html#Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_20.html#Function-Index" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="ProofGeneral_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
<font size="-1">
This document was generated by <em>David Aspinall</em> on <em>January 11, 2013</em> using <a href="http:
</font>
<br>
</p>
</body>
</html> |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'NewMangaDialog.ui'
# Created: Wed Jul 24 19:06:21 2013
# by: PyQt4 UI code generator 4.10.2
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_NewMangaDialog(object):
def setupUi(self, NewMangaDialog):
NewMangaDialog.setObjectName(_fromUtf8("NewMangaDialog"))
NewMangaDialog.resize(231, 78)
self.gridLayout = QtGui.QGridLayout(NewMangaDialog)
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
self.splitter = QtGui.QSplitter(NewMangaDialog)
self.splitter.setOrientation(QtCore.Qt.Horizontal)
self.splitter.setObjectName(_fromUtf8("splitter"))
self.label = QtGui.QLabel(self.splitter)
self.label.setObjectName(_fromUtf8("label"))
self.mangaLineEdit = QtGui.QLineEdit(self.splitter)
self.mangaLineEdit.setObjectName(_fromUtf8("mangaLineEdit"))
self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(NewMangaDialog)
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.gridLayout.addWidget(self.buttonBox, 1, 0, 1, 1)
self.retranslateUi(NewMangaDialog)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), NewMangaDialog.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), NewMangaDialog.reject)
QtCore.QMetaObject.connectSlotsByName(NewMangaDialog)
def retranslateUi(self, NewMangaDialog):
NewMangaDialog.setWindowTitle(_translate("NewMangaDialog", "Dialog", None))
self.label.setText(_translate("NewMangaDialog", "Manga:", None)) |
#undef QT_NO_COMPAT
#include "../../../../include/qscrollbar.h"
#include <qmetaobject.h>
#include <qapplication.h>
#include <private/qucomextra_p.h>
#if !defined(<API key>) || (<API key> != 26)
#error "This file was generated using the moc from 3.3.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
#include <qvariant.h>
const char *QScrollBar::className() const
{
return "QScrollBar";
}
QMetaObject *QScrollBar::metaObj = 0;
static QMetaObjectCleanUp cleanUp_QScrollBar( "QScrollBar", &QScrollBar::staticMetaObject );
#ifndef QT_NO_TRANSLATION
QString QScrollBar::tr( const char *s, const char *c )
{
if ( qApp )
return qApp->translate( "QScrollBar", s, c, QApplication::DefaultCodec );
else
return QString::fromLatin1( s );
}
#ifndef <API key>
QString QScrollBar::trUtf8( const char *s, const char *c )
{
if ( qApp )
return qApp->translate( "QScrollBar", s, c, QApplication::UnicodeUTF8 );
else
return QString::fromUtf8( s );
}
#endif // <API key>
#endif // QT_NO_TRANSLATION
QMetaObject* QScrollBar::staticMetaObject()
{
if ( metaObj )
return metaObj;
QMetaObject* parentObject = QWidget::staticMetaObject();
static const QUParameter param_slot_0[] = {
{ 0, &static_QUType_int, 0, QUParameter::In }
};
static const QUMethod slot_0 = {"setValue", 1, param_slot_0 };
static const QUMethod slot_1 = {"doAutoRepeat", 0, 0 };
static const QMetaData slot_tbl[] = {
{ "setValue(int)", &slot_0, QMetaData::Public },
{ "doAutoRepeat()", &slot_1, QMetaData::Private }
};
static const QUParameter param_signal_0[] = {
{ "value", &static_QUType_int, 0, QUParameter::In }
};
static const QUMethod signal_0 = {"valueChanged", 1, param_signal_0 };
static const QUMethod signal_1 = {"sliderPressed", 0, 0 };
static const QUParameter param_signal_2[] = {
{ "value", &static_QUType_int, 0, QUParameter::In }
};
static const QUMethod signal_2 = {"sliderMoved", 1, param_signal_2 };
static const QUMethod signal_3 = {"sliderReleased", 0, 0 };
static const QUMethod signal_4 = {"nextLine", 0, 0 };
static const QUMethod signal_5 = {"prevLine", 0, 0 };
static const QUMethod signal_6 = {"nextPage", 0, 0 };
static const QUMethod signal_7 = {"prevPage", 0, 0 };
static const QMetaData signal_tbl[] = {
{ "valueChanged(int)", &signal_0, QMetaData::Public },
{ "sliderPressed()", &signal_1, QMetaData::Public },
{ "sliderMoved(int)", &signal_2, QMetaData::Public },
{ "sliderReleased()", &signal_3, QMetaData::Public },
{ "nextLine()", &signal_4, QMetaData::Public },
{ "prevLine()", &signal_5, QMetaData::Public },
{ "nextPage()", &signal_6, QMetaData::Public },
{ "prevPage()", &signal_7, QMetaData::Public }
};
#ifndef QT_NO_PROPERTIES
static const QMetaProperty props_tbl[8] = {
{ "int","minValue", 0x10000103, &QScrollBar::metaObj, 0, -1 },
{ "int","maxValue", 0x10000103, &QScrollBar::metaObj, 0, -1 },
{ "int","lineStep", 0x10000103, &QScrollBar::metaObj, 0, -1 },
{ "int","pageStep", 0x10000103, &QScrollBar::metaObj, 0, -1 },
{ "int","value", 0x10000103, &QScrollBar::metaObj, 0, -1 },
{ "bool","tracking", 0x12000103, &QScrollBar::metaObj, 0, -1 },
{ "bool","draggingSlider", 0x12000001, &QScrollBar::metaObj, 0, -1 },
{ "Orientation","orientation", 0x010f, &QScrollBar::metaObj, 0, -1 }
};
#endif // QT_NO_PROPERTIES
metaObj = QMetaObject::new_metaobject(
"QScrollBar", parentObject,
slot_tbl, 2,
signal_tbl, 8,
#ifndef QT_NO_PROPERTIES
props_tbl, 8,
0, 0,
#endif // QT_NO_PROPERTIES
0, 0 );
cleanUp_QScrollBar.setMetaObject( metaObj );
return metaObj;
}
void* QScrollBar::qt_cast( const char* clname )
{
if ( !qstrcmp( clname, "QScrollBar" ) )
return this;
if ( !qstrcmp( clname, "QRangeControl" ) )
return (QRangeControl*)this;
return QWidget::qt_cast( clname );
}
// SIGNAL valueChanged
void QScrollBar::valueChanged( int t0 )
{
activate_signal( staticMetaObject()->signalOffset() + 0, t0 );
}
// SIGNAL sliderPressed
void QScrollBar::sliderPressed()
{
activate_signal( staticMetaObject()->signalOffset() + 1 );
}
// SIGNAL sliderMoved
void QScrollBar::sliderMoved( int t0 )
{
activate_signal( staticMetaObject()->signalOffset() + 2, t0 );
}
// SIGNAL sliderReleased
void QScrollBar::sliderReleased()
{
activate_signal( staticMetaObject()->signalOffset() + 3 );
}
// SIGNAL nextLine
void QScrollBar::nextLine()
{
activate_signal( staticMetaObject()->signalOffset() + 4 );
}
// SIGNAL prevLine
void QScrollBar::prevLine()
{
activate_signal( staticMetaObject()->signalOffset() + 5 );
}
// SIGNAL nextPage
void QScrollBar::nextPage()
{
activate_signal( staticMetaObject()->signalOffset() + 6 );
}
// SIGNAL prevPage
void QScrollBar::prevPage()
{
activate_signal( staticMetaObject()->signalOffset() + 7 );
}
bool QScrollBar::qt_invoke( int _id, QUObject* _o )
{
switch ( _id - staticMetaObject()->slotOffset() ) {
case 0: setValue((int)static_QUType_int.get(_o+1)); break;
case 1: doAutoRepeat(); break;
default:
return QWidget::qt_invoke( _id, _o );
}
return TRUE;
}
bool QScrollBar::qt_emit( int _id, QUObject* _o )
{
switch ( _id - staticMetaObject()->signalOffset() ) {
case 0: valueChanged((int)static_QUType_int.get(_o+1)); break;
case 1: sliderPressed(); break;
case 2: sliderMoved((int)static_QUType_int.get(_o+1)); break;
case 3: sliderReleased(); break;
case 4: nextLine(); break;
case 5: prevLine(); break;
case 6: nextPage(); break;
case 7: prevPage(); break;
default:
return QWidget::qt_emit(_id,_o);
}
return TRUE;
}
#ifndef QT_NO_PROPERTIES
bool QScrollBar::qt_property( int id, int f, QVariant* v)
{
switch ( id - staticMetaObject()->propertyOffset() ) {
case 0: switch( f ) {
case 0: setMinValue(v->asInt()); break;
case 1: *v = QVariant( this->minValue() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 1: switch( f ) {
case 0: setMaxValue(v->asInt()); break;
case 1: *v = QVariant( this->maxValue() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 2: switch( f ) {
case 0: setLineStep(v->asInt()); break;
case 1: *v = QVariant( this->lineStep() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 3: switch( f ) {
case 0: setPageStep(v->asInt()); break;
case 1: *v = QVariant( this->pageStep() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 4: switch( f ) {
case 0: setValue(v->asInt()); break;
case 1: *v = QVariant( this->value() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 5: switch( f ) {
case 0: setTracking(v->asBool()); break;
case 1: *v = QVariant( this->tracking(), 0 ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 6: switch( f ) {
case 1: *v = QVariant( this->draggingSlider(), 0 ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
case 7: switch( f ) {
case 0: setOrientation((Orientation&)v->asInt()); break;
case 1: *v = QVariant( (int)this->orientation() ); break;
case 3: case 4: case 5: break;
default: return FALSE;
} break;
default:
return QWidget::qt_property( id, f, v );
}
return TRUE;
}
bool QScrollBar::qt_static_property( QObject* , int , int , QVariant* ){ return FALSE; }
#endif // QT_NO_PROPERTIES |
<?php
class AAC
{
public function ValidPlayerName($name)
{global $cfg;
foreach ($cfg['invalid_names'] as $baned_name)
if (eregi($baned_name,$name))
return false;
return preg_match("/^[A-Z][a-z]{1,20}([ '-][A-Za-z][a-z]{1,15}){0,3}$/",$name)
&& strlen($name) <= 25 && strlen($name) >= 4
&& !file_exists($cfg['dirdata'].'monster/'.$name.'.xml')
&& !file_exists($cfg['dirdata'].'npc/'.$name.'.xml');
}
public function ValidPassword($pass)
{
return strlen($pass) > 5;
}
public function ValidAccountNumber($n)
{
return is_numeric($n) && $n > 100000 && $n < 100000000;
}
public function ValidEmail($email)
{
return eregi('^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$',$email);
}
public function ValidGuildName($name)
{
return preg_match("/^[A-Z][a-z]{1,20}([ '-][A-Za-z][a-z]{1,15}){0,3}$/",$name);
}
public function ValidGuildRank($name)
{
return preg_match("/^[A-Z][a-z]{1,20}([ '-][A-Za-z][a-z]{1,15}){0,3}$/",$name);
}
public function ValidGuildNick($name)
{
return preg_match("/^[A-Z][a-z]{1,20}([ '-][A-Za-z][a-z]{1,15}){0,3}$/",$name);
}
public function <API key>($lvl)
{
return floor(50*($lvl-1)*($lvl*$lvl-5*$lvl+12)/3);
}
}
function exception_handler($exception) {
echo '<pre style="position: absolute; top: 0px; left: 0px; background-color: white; color: black; border: 3px solid red;"><b>'.$exception->getMessage(). '<br/>'.basename($exception->getFile()).' on line: '.$exception->getLine().'</b><br/>Script was terminated because something unexpected happened. You can report this, if you think it\'s a bug.';
}
function strToDate($str){
$pieces = explode('-',$str);
return mktime(0,0,0,(int)$pieces[1],(int)$pieces[2],(int)$pieces[0]);
}
function getVocLvl($voc){
global $cfg;
return floor($cfg['vocations'][$voc]['level']);
}
function getVocExp($voc){
global $cfg;
$x = $cfg['vocations'][$voc]['level'];
return round(50*($x-1)*(pow($x,2)-5*$x+12)/3);
}
function getStyle($seed)
{
if ($seed % 2 == 0)
return 'class="color1"';
else
return 'class="color2"';
}
function percent_bar($part, $total)
{
if ($total <= 0) return 'unknown';
$percent = round($part/$total*100);
if ($percent >= 10)
$percent_text = $percent.'%';
return '<div class="percent_bar" style="width:'.($percent*2).'px">'.$percent_text.'</div>';
}
function deeper_array_search($needle, $haystack, $attribute)
{
while ($v = current($haystack)){
if ($v[$attribute] == $needle)
return key($haystack);
next($haystack);
}
return false;
}
?> |
package net.shopnc.android.adapter;
import java.util.ArrayList;
import net.shopnc.android.R;
import net.shopnc.android.model.PushData;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
/**
* ListView
* @author qjyong
*/
public class <API key> extends BaseAdapter {
private ArrayList<PushData> datas;
private LayoutInflater inflater;
private ViewHolder vh;
/**
*
* @param ctx
*/
public <API key>(Context ctx){
inflater = LayoutInflater.from(ctx);
}
@Override
public int getCount() {
return datas == null ? 0 : datas.size();
}
public Object getItem(int index) {
return datas.get(index);
}
public long getItemId(int index) {
return datas.get(index).getId();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = inflater.inflate(R.layout.<API key>, null);
vh = new ViewHolder();
vh.txt_id = (TextView)convertView.findViewById(R.id.topic_id);
vh.txt_title = (TextView)convertView.findViewById(R.id.topic_title);
convertView.setTag(vh);
}else{
vh = (ViewHolder)convertView.getTag();
}
PushData pd = datas.get(position);
vh.txt_id.setText(String.valueOf(pd.getId()));
vh.txt_title.setText(pd.getTitle());
return convertView;
}
public void setDatas(ArrayList<PushData> datas) {
this.datas = datas;
}
class ViewHolder{
TextView txt_id;
TextView txt_title;
}
} |
#include "avida/util/CmdLine.h"
#include "apto/core/FileSystem.h"
#include "cActionLibrary.h"
#include "cAvidaConfig.h"
#include "cString.h"
#include "cStringIterator.h"
#include "cUserFeedback.h"
#include <iostream>
#include <cstdio>
using namespace std;
static void processArgs(cStringList &argv, cAvidaConfig* cfg, Apto::Map<Apto::String, Apto::String>& defs)
{
int argc = argv.GetSize();
int arg_num = 1; // Argument number being looked at.
// Load all of the args into string objects for ease of access.
cString* args = new cString[argc];
//for (int i = 0; i < argc; i++) args[i] = argv[i];
cStringIterator list_it(argv);
for (int i = 0; (i < argc) && (list_it.AtEnd() == false); i++) {
list_it.Next();
args[i] = list_it.Get();
}
cString config_filename = "avida.cfg";
Apto::Map<Apto::String, Apto::String> sets;
bool flag_analyze = false;
bool flag_interactive = false;
bool flag_review = false;
bool flag_verbosity = false; int val_verbosity = 0;
bool flag_seed = false; int val_seed = 0;
bool flag_warn_default = false;
// Then scan through and process the rest of the args.
while (arg_num < argc) {
cString cur_arg = args[arg_num];
// Test against the possible inputs.
// Print out a list of all possibel actions (was events).
if (cur_arg == "-e" || cur_arg == "-events" || cur_arg == "-actions") {
cout << endl << "Supported Actions:" << endl;
cout << cActionLibrary::GetInstance().DescribeAll() << endl;
exit(0);
}
// Review configuration options, listing those non-default.
else if (cur_arg == "-review" || cur_arg == "-r") {
flag_review = true;
}
else if (cur_arg == "--help" || cur_arg == "-help" || cur_arg == "-h") {
cout << "Options:"<<endl
<< " -a[nalyze] Process analyze.cfg instead of normal "
<< "run." << endl
<< " -c[onfig] <filename> Set config file to be <filename>"<<endl
<< " -def <name> <value> Define config include variables" << endl
<< " -e; -actions Print a list of all known actions"<< endl
<< " -h[elp] Help on options (this listing)"<<endl
<< " -i[nteractive] Run analyze mode interactively" << endl
<< " -l[oad] <filename> Load a clone file" << endl
<< " -r[eview] Review avida.cfg settings." << endl
<< " -s[eed] <value> Set random seed to <value>" << endl
<< " -set <name> <value> Override values in avida.cfg" << endl
<< " -v[ersion] Prints the version number" << endl
<< " -v0 -v1 -v2 -v3 -v4 Set output verbosity to 0..4" << endl
<< " -w[arn] Warn when default config settings are used." << endl
<< " --generate-config Generate the default configuration files" << endl
<< endl;
exit(0);
}
else if (cur_arg == "-seed" || cur_arg == "-s") {
if (arg_num + 1 == argc) {
cerr << "Error: Must include a number as the random seed!" << endl;
exit(0);
} else {
arg_num++;
if (arg_num < argc) cur_arg = args[arg_num];
val_seed = cur_arg.AsInt();
}
flag_seed = true;
} else if (cur_arg == "-analyze" || cur_arg == "-a") {
flag_analyze = true;
} else if (cur_arg == "-interactive" || cur_arg == "-i") {
flag_interactive = true;
} else if (cur_arg == "-warn" || cur_arg == "-w") {
flag_warn_default = true;
} else if (cur_arg == "-version" || cur_arg == "-v") {
// We've already showed version info, so just quit.
exit(0);
} else if (cur_arg.Substring(0, 2) == "-v") {
val_verbosity = cur_arg.Substring(2, cur_arg.GetSize() - 2).AsInt();
flag_verbosity = true;
} else if (cur_arg == "-set") {
if (arg_num + 1 == argc || arg_num + 2 == argc) {
cerr << "'-set' option must be followed by name and value" << endl;
exit(0);
}
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
cString name(cur_arg);
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
cString value(cur_arg);
sets.Set((const char*)name, (const char*)value);
} else if (cur_arg == "-def") {
if (arg_num + 1 == argc || arg_num + 2 == argc) {
cerr << "'-def' option must be followed by name and value" << endl;
exit(0);
}
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
cString name(cur_arg);
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
cString value(cur_arg);
defs.Set((const char*)name, (const char*)value);
} else if (cur_arg == "-c" || cur_arg == "-config") {
if (arg_num + 1 == argc || args[arg_num + 1][0] == '-') {
cerr << "Error: Filename for configuration must be specified." << endl;
exit(0);
}
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
config_filename = cur_arg;
} else if (cur_arg == "--generate-config") {
cerr << "Generating default avida.cfg" << endl;
cfg->Print(cString(Apto::FileSystem::PathAppend(Apto::FileSystem::GetCWD(), "avida.cfg")));
exit(0);
} else {
cerr << "Error: Unknown Option '" << args[arg_num] << "'" << endl
<< "Type: \"" << args[0] << " -h\" for a full option list." << endl;
exit(0);
}
arg_num++; if (arg_num < argc) cur_arg = args[arg_num];
}
delete [] args;
// Load configuration file
cUserFeedback feedback;
cfg->Load(config_filename, cString(Apto::FileSystem::GetCWD()), &feedback, &defs, flag_warn_default);
for (int i = 0; i < feedback.GetNumMessages(); i++) {
switch (feedback.GetMessageType(i)) {
case cUserFeedback::UF_ERROR: cerr << "error: "; break;
case cUserFeedback::UF_WARNING: cerr << "warning: "; break;
default: break;
};
cerr << feedback.GetMessage(i) << endl;
}
if (feedback.GetNumErrors()) exit(-1);
// Process Command Line Flags
if (flag_analyze) if (cfg->ANALYZE_MODE.Get() < 1) cfg->ANALYZE_MODE.Set(1);
if (flag_interactive) if (cfg->ANALYZE_MODE.Get() < 2) cfg->ANALYZE_MODE.Set(2);
if (flag_seed) cfg->RANDOM_SEED.Set(val_seed);
if (flag_verbosity) cfg->VERBOSITY.Set(val_verbosity);
cfg->Set(sets); // Process all command line -set statements
if (sets.GetSize()) {
for (Apto::Map<Apto::String, Apto::String>::KeyIterator kit = sets.Keys(); kit.Next();) {
cerr << "error: unrecognized command line configuration setting '" << *kit.Get() << "'." << endl;
}
exit(1);
}
if (flag_review) {
cfg->PrintReview();
exit(0);
}
}
void Avida::Util::ProcessCmdLineArgs(int argc, char* argv[], cAvidaConfig* cfg, Apto::Map<Apto::String, Apto::String>& defs)
{
cStringList sl;
for(int i=0; i<argc; i++){
sl.PushRear(argv[i]);
}
processArgs(sl, cfg, defs);
} |
#include <linux/oom.h>
#include <linux/mm.h>
#include <linux/err.h>
#include <linux/gfp.h>
#include <linux/sched.h>
#include <linux/swap.h>
#include <linux/timex.h>
#include <linux/jiffies.h>
#include <linux/cpuset.h>
#include <linux/export.h>
#include <linux/notifier.h>
#include <linux/memcontrol.h>
#include <linux/mempolicy.h>
#include <linux/security.h>
#include <linux/ptrace.h>
#include <linux/freezer.h>
#include <linux/ftrace.h>
#include <linux/ratelimit.h>
#define CREATE_TRACE_POINTS
#include <trace/events/oom.h>
int sysctl_panic_on_oom;
int <API key>;
int <API key> = 1;
static DEFINE_SPINLOCK(zone_scan_lock);
/*
* <API key>() - compare and swap current's oom_score_adj
* @old_val: old oom_score_adj for compare
* @new_val: new oom_score_adj for swap
*
* Sets the oom_score_adj value for current to @new_val iff its present value is
* @old_val. Usually used to reinstate a previous value to prevent racing with
* userspacing tuning the value in the interim.
*/
void <API key>(int old_val, int new_val)
{
struct sighand_struct *sighand = current->sighand;
spin_lock_irq(&sighand->siglock);
if (current->signal->oom_score_adj == old_val)
current->signal->oom_score_adj = new_val;
<API key>(current);
spin_unlock_irq(&sighand->siglock);
}
/**
* <API key>() - set current's oom_score_adj and return old value
* @new_val: new oom_score_adj value
*
* Sets the oom_score_adj value for current to @new_val with proper
* synchronization and returns the old value. Usually used to temporarily
* set a value, save the old value in the caller, and then reinstate it later.
*/
int <API key>(int new_val)
{
struct sighand_struct *sighand = current->sighand;
int old_val;
spin_lock_irq(&sighand->siglock);
old_val = current->signal->oom_score_adj;
current->signal->oom_score_adj = new_val;
<API key>(current);
spin_unlock_irq(&sighand->siglock);
return old_val;
}
#ifdef CONFIG_NUMA
/**
* <API key>() - check task eligiblity for kill
* @tsk: task struct of which task to consider
* @mask: nodemask passed to page allocator for mempolicy ooms
*
* Task eligibility is determined by whether or not a candidate task, @tsk,
* shares the same mempolicy nodes as current if it is bound by such a policy
* and whether or not it has the same set of allowed cpuset nodes.
*/
static bool <API key>(struct task_struct *tsk,
const nodemask_t *mask)
{
struct task_struct *start = tsk;
do {
if (mask) {
/*
* If this is a mempolicy constrained oom, tsk's
* cpuset is irrelevant. Only return true if its
* mempolicy intersects current, otherwise it may be
* needlessly killed.
*/
if (<API key>(tsk, mask))
return true;
} else {
/*
* This is not a mempolicy constrained oom, so only
* check the mems of tsk's cpuset.
*/
if (<API key>(current, tsk))
return true;
}
} while_each_thread(start, tsk);
return false;
}
#else
static bool <API key>(struct task_struct *tsk,
const nodemask_t *mask)
{
return true;
}
#endif /* CONFIG_NUMA */
/*
* The process p may have detached its own ->mm while exiting or through
* use_mm(), but one or more of its subthreads may still have a valid
* pointer. Return p, or any of its subthreads with a valid ->mm, with
* task_lock() held.
*/
struct task_struct *find_lock_task_mm(struct task_struct *p)
{
struct task_struct *t = p;
do {
task_lock(t);
if (likely(t->mm))
return t;
task_unlock(t);
} while_each_thread(p, t);
return NULL;
}
/* return true if the task is not adequate as candidate victim task. */
static bool oom_unkillable_task(struct task_struct *p,
const struct mem_cgroup *memcg, const nodemask_t *nodemask)
{
if (is_global_init(p))
return true;
if (p->flags & PF_KTHREAD)
return true;
/* When <API key>() and p is not member of the group */
if (memcg && !task_in_mem_cgroup(p, memcg))
return true;
/* p may not have freeable memory in nodemask */
if (!<API key>(p, nodemask))
return true;
return false;
}
/**
* oom_badness - heuristic function to determine which candidate task to kill
* @p: task struct of which task we should calculate
* @totalpages: total present RAM allowed for page allocation
*
* The heuristic for determining which task to kill is made to be as simple and
* predictable as possible. The goal is to return the highest value for the
* task consuming the most memory to avoid subsequent oom failures.
*/
unsigned int oom_badness(struct task_struct *p, struct mem_cgroup *memcg,
const nodemask_t *nodemask, unsigned long totalpages)
{
long points;
if (oom_unkillable_task(p, memcg, nodemask))
return 0;
p = find_lock_task_mm(p);
if (!p)
return 0;
if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN) {
task_unlock(p);
return 0;
}
/*
* The memory controller may have a limit of 0 bytes, so avoid a divide
* by zero, if necessary.
*/
if (!totalpages)
totalpages = 1;
/*
* The baseline for the badness score is the proportion of RAM that each
* task's rss, pagetable and swap space use.
*/
points = get_mm_rss(p->mm) + p->mm->nr_ptes;
points += get_mm_counter(p->mm, MM_SWAPENTS);
points *= 1000;
points /= totalpages;
task_unlock(p);
/*
* Root processes get 3% bonus, just like the __vm_enough_memory()
* implementation used by LSMs.
*/
if (<API key>(p, CAP_SYS_ADMIN))
points -= 30;
/*
* /proc/pid/oom_score_adj ranges from -1000 to +1000 such that it may
* either completely disable oom killing or always prefer a certain
* task.
*/
points += p->signal->oom_score_adj;
/*
* Never return 0 for an eligible task that may be killed since it's
* possible that no single user task uses more than 0.1% of memory and
* no single admin tasks uses more than 3.0%.
*/
if (points <= 0)
return 1;
return (points < 1000) ? points : 1000;
}
/*
* Determine the type of allocation constraint.
*/
#ifdef CONFIG_NUMA
static enum oom_constraint constrained_alloc(struct zonelist *zonelist,
gfp_t gfp_mask, nodemask_t *nodemask,
unsigned long *totalpages)
{
struct zone *zone;
struct zoneref *z;
enum zone_type high_zoneidx = gfp_zone(gfp_mask);
bool cpuset_limited = false;
int nid;
/* Default to all available memory */
*totalpages = totalram_pages + total_swap_pages;
if (!zonelist)
return CONSTRAINT_NONE;
/*
* Reach here only when __GFP_NOFAIL is used. So, we should avoid
* to kill current.We have to random task kill in this case.
* Hopefully, CONSTRAINT_THISNODE...but no way to handle it, now.
*/
if (gfp_mask & __GFP_THISNODE)
return CONSTRAINT_NONE;
/*
* This is not a __GFP_THISNODE allocation, so a truncated nodemask in
* the page allocator means a mempolicy is in effect. Cpuset policy
* is enforced in <API key>().
*/
if (nodemask && !nodes_subset(node_states[N_HIGH_MEMORY], *nodemask)) {
*totalpages = total_swap_pages;
for_each_node_mask(nid, *nodemask)
*totalpages += node_spanned_pages(nid);
return <API key>;
}
/* Check this allocation failure is caused by cpuset's wall function */
<API key>(zone, z, zonelist,
high_zoneidx, nodemask)
if (!<API key>(zone, gfp_mask))
cpuset_limited = true;
if (cpuset_limited) {
*totalpages = total_swap_pages;
for_each_node_mask(nid, <API key>)
*totalpages += node_spanned_pages(nid);
return CONSTRAINT_CPUSET;
}
return CONSTRAINT_NONE;
}
#else
static enum oom_constraint constrained_alloc(struct zonelist *zonelist,
gfp_t gfp_mask, nodemask_t *nodemask,
unsigned long *totalpages)
{
*totalpages = totalram_pages + total_swap_pages;
return CONSTRAINT_NONE;
}
#endif
/*
* Simple selection loop. We chose the process with the highest
* number of 'points'. We expect the caller will lock the tasklist.
*
* (not docbooked, we don't want this one cluttering up the manual)
*/
static struct task_struct *select_bad_process(unsigned int *ppoints,
unsigned long totalpages, struct mem_cgroup *memcg,
const nodemask_t *nodemask, bool force_kill)
{
struct task_struct *g, *p;
struct task_struct *chosen = NULL;
*ppoints = 0;
do_each_thread(g, p) {
unsigned int points;
if (p->exit_state)
continue;
if (oom_unkillable_task(p, memcg, nodemask))
continue;
/*
* This task already has access to memory reserves and is
* being killed. Don't allow any other task access to the
* memory reserve.
*
* Note: this may have a chance of deadlock if it gets
* blocked waiting for another task which itself is waiting
* for memory. Is there a better alternative?
*/
if (<API key>(p, TIF_MEMDIE)) {
if (unlikely(frozen(p)))
__thaw_task(p);
if (!force_kill)
return ERR_PTR(-1UL);
}
if (!p->mm)
continue;
if (p->flags & PF_EXITING) {
/*
* If p is the current task and is in the process of
* releasing memory, we allow the "kill" to set
* TIF_MEMDIE, which will allow it to gain access to
* memory reserves. Otherwise, it may stall forever.
*
* The loop isn't broken here, however, in case other
* threads are found to have already been oom killed.
*/
if (p == current) {
chosen = p;
*ppoints = 1000;
} else if (!force_kill) {
/*
* If this task is not being ptraced on exit,
* then wait for it to finish before killing
* some other task unnecessarily.
*/
if (!(p->group_leader->ptrace & PT_TRACE_EXIT))
return ERR_PTR(-1UL);
}
}
points = oom_badness(p, memcg, nodemask, totalpages);
if (points > *ppoints) {
chosen = p;
*ppoints = points;
}
} while_each_thread(g, p);
return chosen;
}
/**
* dump_tasks - dump current memory state of all system tasks
* @mem: current's memory controller, if constrained
* @nodemask: nodemask passed to page allocator for mempolicy ooms
*
* Dumps the current memory state of all eligible tasks. Tasks not in the same
* memcg, not in the same cpuset, or bound to a disjoint set of mempolicy nodes
* are not shown.
* State information includes task's pid, uid, tgid, vm size, rss, cpu, oom_adj
* value, oom_score_adj value, and name.
*
* Call with tasklist_lock read-locked.
*/
#ifndef <API key>
static void dump_tasks(const struct mem_cgroup *memcg, const nodemask_t *nodemask)
{
struct task_struct *p;
struct task_struct *task;
pr_info("[ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name\n");
for_each_process(p) {
if (oom_unkillable_task(p, memcg, nodemask))
continue;
task = find_lock_task_mm(p);
if (!task) {
/*
* This is a kthread or all of p's threads have already
* detached their mm's. There's no need to report
* them; they can't be oom killed anyway.
*/
continue;
}
pr_info("[%5d] %5d %5d %8lu %8lu %3u %3d %5d %s\n",
task->pid, task_uid(task), task->tgid,
task->mm->total_vm, get_mm_rss(task->mm),
task_cpu(task), task->signal->oom_adj,
task->signal->oom_score_adj, task->comm);
task_unlock(task);
}
}
#endif
static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order,
struct mem_cgroup *memcg, const nodemask_t *nodemask)
{
task_lock(current);
#ifdef <API key>
if (printk_ratelimit())
#endif
pr_warning("%s invoked oom-killer: gfp_mask=0x%x, order=%d, "
"oom_adj=%d, oom_score_adj=%d\n",
current->comm, gfp_mask, order, current->signal->oom_adj,
current->signal->oom_score_adj);
<API key>(current);
task_unlock(current);
#ifndef <API key>
dump_stack();
<API key>(memcg, p);
show_mem(<API key>);
if (<API key>)
dump_tasks(memcg, nodemask);
#endif
}
#define K(x) ((x) << (PAGE_SHIFT-10))
static void oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order,
unsigned int points, unsigned long totalpages,
struct mem_cgroup *memcg, nodemask_t *nodemask,
const char *message)
{
struct task_struct *victim = p;
struct task_struct *child;
struct task_struct *t = p;
struct mm_struct *mm;
unsigned int victim_points = 0;
static <API key>(oom_rs, <API key>,
<API key>);
/*
* If the task is already exiting, don't alarm the sysadmin or kill
* its children or threads, just set TIF_MEMDIE so it can die quickly
*/
if (p->flags & PF_EXITING) {
set_tsk_thread_flag(p, TIF_MEMDIE);
return;
}
if (__ratelimit(&oom_rs))
dump_header(p, gfp_mask, order, memcg, nodemask);
task_lock(p);
pr_err("%s: Kill process %d (%s) score %d or sacrifice child\n",
message, task_pid_nr(p), p->comm, points);
task_unlock(p);
/*
* If any of p's children has a different mm and is eligible for kill,
* the one with the highest oom_badness() score is sacrificed for its
* parent. This attempts to lose the minimal amount of work done while
* still freeing memory.
*/
do {
list_for_each_entry(child, &t->children, sibling) {
unsigned int child_points;
if (child->mm == p->mm)
continue;
/*
* oom_badness() returns 0 if the thread is unkillable
*/
child_points = oom_badness(child, memcg, nodemask,
totalpages);
if (child_points > victim_points) {
victim = child;
victim_points = child_points;
}
}
} while_each_thread(p, t);
victim = find_lock_task_mm(victim);
if (!victim)
return;
/* mm cannot safely be dereferenced after task_unlock(victim) */
mm = victim->mm;
pr_err("Killed process %d (%s) total-vm:%lukB, anon-rss:%lukB, file-rss:%lukB\n",
task_pid_nr(victim), victim->comm, K(victim->mm->total_vm),
K(get_mm_counter(victim->mm, MM_ANONPAGES)),
K(get_mm_counter(victim->mm, MM_FILEPAGES)));
task_unlock(victim);
/*
* Kill all user processes sharing victim->mm in other thread groups, if
* any. They don't get access to memory reserves, though, to avoid
* depletion of all memory. This prevents mm->mmap_sem livelock when an
* oom killed thread cannot exit because it requires the semaphore and
* its contended by another thread trying to allocate memory itself.
* That thread will now get access to memory reserves since it has a
* pending fatal signal.
*/
for_each_process(p)
if (p->mm == mm && !same_thread_group(p, victim) &&
!(p->flags & PF_KTHREAD)) {
if (p->signal->oom_score_adj == OOM_SCORE_ADJ_MIN)
continue;
task_lock(p); /* Protect ->comm from prctl() */
pr_err("Kill process %d (%s) sharing same memory\n",
task_pid_nr(p), p->comm);
task_unlock(p);
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, p, true);
}
set_tsk_thread_flag(victim, TIF_MEMDIE);
do_send_sig_info(SIGKILL, SEND_SIG_FORCED, victim, true);
}
#undef K
/*
* Determines whether the kernel must panic because of the panic_on_oom sysctl.
*/
static void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
int order, const nodemask_t *nodemask)
{
if (likely(!sysctl_panic_on_oom))
return;
if (sysctl_panic_on_oom != 2) {
/*
* panic_on_oom == 1 only affects CONSTRAINT_NONE, the kernel
* does not panic for cpuset, mempolicy, or memcg allocation
* failures.
*/
if (constraint != CONSTRAINT_NONE)
return;
}
read_lock(&tasklist_lock);
dump_header(NULL, gfp_mask, order, NULL, nodemask);
read_unlock(&tasklist_lock);
panic("Out of memory: %s panic_on_oom is enabled\n",
sysctl_panic_on_oom == 2 ? "compulsory" : "system-wide");
}
#ifdef <API key>
void <API key>(struct mem_cgroup *memcg, gfp_t gfp_mask,
int order)
{
unsigned long limit;
unsigned int points = 0;
struct task_struct *p;
/*
* If current has a pending SIGKILL or is exiting, then automatically
* select it. The goal is to allow it to allocate so that it may
* quickly exit and free its memory.
*/
if (<API key>(current) || current->flags & PF_EXITING) {
set_thread_flag(TIF_MEMDIE);
return;
}
check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL);
limit = <API key>(memcg) >> PAGE_SHIFT;
read_lock(&tasklist_lock);
p = select_bad_process(&points, limit, memcg, NULL, false);
if (p && PTR_ERR(p) != -1UL)
oom_kill_process(p, gfp_mask, order, points, limit, memcg, NULL,
"Memory cgroup out of memory");
read_unlock(&tasklist_lock);
}
#endif
static <API key>(oom_notify_list);
int <API key>(struct notifier_block *nb)
{
return <API key>(&oom_notify_list, nb);
}
EXPORT_SYMBOL_GPL(<API key>);
int <API key>(struct notifier_block *nb)
{
return <API key>(&oom_notify_list, nb);
}
EXPORT_SYMBOL_GPL(<API key>);
/*
* Try to acquire the OOM killer lock for the zones in zonelist. Returns zero
* if a parallel OOM killing is already taking place that includes a zone in
* the zonelist. Otherwise, locks all zones in the zonelist and returns 1.
*/
int <API key>(struct zonelist *zonelist, gfp_t gfp_mask)
{
struct zoneref *z;
struct zone *zone;
int ret = 1;
spin_lock(&zone_scan_lock);
<API key>(zone, z, zonelist, gfp_zone(gfp_mask)) {
if (zone_is_oom_locked(zone)) {
ret = 0;
goto out;
}
}
<API key>(zone, z, zonelist, gfp_zone(gfp_mask)) {
/*
* Lock each zone in the zonelist under zone_scan_lock so a
* parallel invocation of <API key>() doesn't succeed
* when it shouldn't.
*/
zone_set_flag(zone, ZONE_OOM_LOCKED);
}
out:
spin_unlock(&zone_scan_lock);
return ret;
}
/*
* Clears the ZONE_OOM_LOCKED flag for all zones in the zonelist so that failed
* allocation attempts with zonelists containing them may now recall the OOM
* killer, if necessary.
*/
void clear_zonelist_oom(struct zonelist *zonelist, gfp_t gfp_mask)
{
struct zoneref *z;
struct zone *zone;
spin_lock(&zone_scan_lock);
<API key>(zone, z, zonelist, gfp_zone(gfp_mask)) {
zone_clear_flag(zone, ZONE_OOM_LOCKED);
}
spin_unlock(&zone_scan_lock);
}
/*
* Try to acquire the oom killer lock for all system zones. Returns zero if a
* parallel oom killing is taking place, otherwise locks all zones and returns
* non-zero.
*/
static int try_set_system_oom(void)
{
struct zone *zone;
int ret = 1;
spin_lock(&zone_scan_lock);
<API key>(zone)
if (zone_is_oom_locked(zone)) {
ret = 0;
goto out;
}
<API key>(zone)
zone_set_flag(zone, ZONE_OOM_LOCKED);
out:
spin_unlock(&zone_scan_lock);
return ret;
}
/*
* Clears ZONE_OOM_LOCKED for all system zones so that failed allocation
* attempts or page faults may now recall the oom killer, if necessary.
*/
static void clear_system_oom(void)
{
struct zone *zone;
spin_lock(&zone_scan_lock);
<API key>(zone)
zone_clear_flag(zone, ZONE_OOM_LOCKED);
spin_unlock(&zone_scan_lock);
}
/**
* out_of_memory - kill the "best" process when we run out of memory
* @zonelist: zonelist pointer
* @gfp_mask: memory allocation flags
* @order: amount of memory being requested as a power of 2
* @nodemask: nodemask passed to page allocator
* @force_kill: true if a task must be killed, even if others are exiting
*
* If we run out of memory, we have the choice between either
* killing a random task (bad), letting the system crash (worse)
* OR try to be smart about which process to kill. Note that we
* don't have to be perfect here, we just have to be good.
*/
void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
int order, nodemask_t *nodemask, bool force_kill)
{
const nodemask_t *mpol_mask;
struct task_struct *p;
unsigned long totalpages;
unsigned long freed = 0;
unsigned int points;
enum oom_constraint constraint = CONSTRAINT_NONE;
int killed = 0;
<API key>(&oom_notify_list, 0, &freed);
if (freed > 0)
/* Got some memory back in the last second. */
return;
/*
* If current has a pending SIGKILL, then automatically select it. The
* goal is to allow it to allocate so that it may quickly exit and free
* its memory.
*/
if (<API key>(current)) {
set_thread_flag(TIF_MEMDIE);
return;
}
/*
* Check if there were limitations on the allocation (only relevant for
* NUMA) that may require different handling.
*/
constraint = constrained_alloc(zonelist, gfp_mask, nodemask,
&totalpages);
mpol_mask = (constraint == <API key>) ? nodemask : NULL;
check_panic_on_oom(constraint, gfp_mask, order, mpol_mask);
read_lock(&tasklist_lock);
if (<API key> &&
!oom_unkillable_task(current, NULL, nodemask) &&
current->mm) {
oom_kill_process(current, gfp_mask, order, 0, totalpages, NULL,
nodemask,
"Out of memory (<API key>)");
goto out;
}
p = select_bad_process(&points, totalpages, NULL, mpol_mask,
force_kill);
/* Found nothing?!?! Either we hang forever, or we panic. */
if (!p) {
dump_header(NULL, gfp_mask, order, NULL, mpol_mask);
read_unlock(&tasklist_lock);
panic("Out of memory and no killable processes...\n");
}
if (PTR_ERR(p) != -1UL) {
oom_kill_process(p, gfp_mask, order, points, totalpages, NULL,
nodemask, "Out of memory");
killed = 1;
}
out:
read_unlock(&tasklist_lock);
/*
* Give "p" a good chance of killing itself before we
* retry to allocate memory unless "p" is current
*/
if (killed && !test_thread_flag(TIF_MEMDIE))
<API key>(1);
}
/*
* The pagefault handler calls here because it is out of memory, so kill a
* memory-hogging task. If a populated zone has ZONE_OOM_LOCKED set, a parallel
* oom killing is already in progress so do nothing. If a task is found with
* TIF_MEMDIE set, it has been killed so do nothing and allow it to exit.
*/
void <API key>(void)
{
if (try_set_system_oom()) {
out_of_memory(NULL, 0, 0, NULL, false);
clear_system_oom();
}
if (!test_thread_flag(TIF_MEMDIE))
<API key>(1);
} |
<?php
require_once("../../config.inc.php");
require_once("common.php");
require_once('requirements.inc.php');
testlinkInitPage($db,false,false,"checkRights");
$templateCfg = <API key>();
$args = init_args();
$gui = new stdClass();
$gui->showCloseButton = $args->showCloseButton;
$gui->user_feedback = '';
$gui->tcTitle = null;
$gui->arrAssignedReq = null;
$gui->arrUnassignedReq = null;
$gui->arrReqSpec = null;
$gui->selectedReqSpec = $args->idReqSpec;
$bulkCounter = 0;
$bulkDone = false;
$bulkMsg = null;
$pfn = null;
switch($args->doAction)
{
case 'assign':
$pfn = "assign_to_tcase";
break;
case 'unassign':
$pfn = "unassign_from_tcase";
break;
case 'bulkassign':
// BUGID 3361 - need to check if we have test cases to work on
// BUGID 3495 - Requirements Bulk Assignment crash. (typo error) (dbHandler -> db)
$tsuite_mgr = new testsuite($db);
$tcase_set = $tsuite_mgr->get_testcases_deep($args->id,'only_id');
$bulkCounter = 0;
$bulkDone = true;
$args->edit = 'testsuite';
if( !is_null($tcase_set) && count($tcase_set) > 0 )
{
$bulkCounter = doBulkAssignment($db,$args,$tcase_set);
}
break;
case 'switchspec':
$args->edit = 'testsuite';
break;
}
if(!is_null($pfn))
{
$gui = <API key>($db,$args,$gui,$pfn);
}
switch($args->edit)
{
case 'testproject':
show_instructions('assignReqs');
exit();
break;
case 'testsuite':
$gui = processTestSuite($db,$args,$gui);
$templateCfg->default_template = 'reqTcBulkAssignment.tpl';
if($bulkDone)
{
$gui->user_feedback = sprintf(lang_get('bulk_assigment_done'),$bulkCounter);
}
break;
case 'testcase':
$gui = processTestCase($db,$args,$gui);
break;
default:
tlog("Wrong GET/POST arguments.", 'ERROR');
exit();
break;
}
$smarty = new TLSmarty();
$smarty->assign('gui', $gui);
$smarty->assign('modify_req_rights', has_rights($db,"mgt_modify_req"));
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
$iParams = array("id" => array(tlInputParameter::INT_N),
"req_id" => array(tlInputParameter::ARRAY_INT),
"req" => array(tlInputParameter::INT_N),
"showCloseButton" => array(tlInputParameter::STRING_N,0,1),
"doAction" => array(tlInputParameter::STRING_N,0,100),
"edit" => array(tlInputParameter::STRING_N,0,100),
"unassign" => array(tlInputParameter::STRING_N,0,1),
"assign" => array(tlInputParameter::STRING_N,0,1),
"idSRS" => array(tlInputParameter::INT_N));
$args = new stdClass();
R_PARAMS($iParams,$args);
// BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled
$_REQUEST=<API key>($_REQUEST);
$args->idReqSpec = null;
$args->idReq = $args->req;
$args->reqIdSet = $args->req_id;
if(is_null($args->doAction))
{
$args->doAction = ($args->unassign != "") ? "unassign" : null;
}
if(is_null($args->doAction))
{
$args->doAction = ($args->assign != "") ? "assign" : null;
}
// 20081103 - sisajr - hold choosen SRS (saved for a session)
if ($args->idSRS)
{
$args->idReqSpec = $args->idSRS;
$_SESSION['currentSrsId'] = $args->idReqSpec;
}
else if(isset($_SESSION['currentSrsId']) && intval($_SESSION['currentSrsId']) > 0)
{
$args->idReqSpec = intval($_SESSION['currentSrsId']);
}
$args->tproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0;
return $args;
}
function processTestSuite(&$dbHandler,&$argsObj,&$guiObj)
{
$tproject_mgr = new testproject($dbHandler);
$guiObj-><API key> = '';
$guiObj->tsuite_id = $argsObj->id;
$tsuite_info = $tproject_mgr->tree_manager-><API key>($guiObj->tsuite_id);
$guiObj->pageTitle = lang_get('test_suite') . config_get('<API key>') . $tsuite_info['name'];
$guiObj->req_specs = $tproject_mgr->getOptionReqSpec($argsObj->tproject_id,testproject::<API key>);
$guiObj->selectedReqSpec = $argsObj->idReqSpec;
$guiObj->tcase_number = 0;
$guiObj->has_req_spec = false;
$guiObj->tsuite_id = $argsObj->id;
if(!is_null($guiObj->req_specs) && count($guiObj->req_specs))
{
$guiObj->has_req_spec = true;
if(is_null($argsObj->idReqSpec))
{
$guiObj->selectedReqSpec = key($guiObj->req_specs);
}
$req_spec_mgr = new <API key>($dbHandler);
$guiObj->requirements =$req_spec_mgr->get_requirements($guiObj->selectedReqSpec);
$tsuite_mgr = new testsuite($dbHandler);
$tcase_set = $tsuite_mgr->get_testcases_deep($argsObj->id,'only_id');
$guiObj->tcase_number = count($tcase_set);
if( $guiObj->tcase_number > 0 )
{
$guiObj-><API key> = sprintf(lang_get('bulk_req_assign_msg'),$guiObj->tcase_number);
}
else
{
$guiObj-><API key> = lang_get('<API key>');
}
}
return $guiObj;
}
function doBulkAssignment(&$dbHandler,&$argsObj,$targetTestCaseSet = null)
{
$req_mgr = new requirement_mgr($dbHandler);
$assignmentCounter = 0;
$requirements = array_keys($argsObj->reqIdSet);
if(!is_null($requirements) && count($requirements) > 0)
{
$tcase_set = $targetTestCaseSet;
if( is_null($tcase_set) )
{
$tsuite_mgr = new testsuite($dbHandler);
echo 'DEBUG BEFORE';
$tcase_set = $tsuite_mgr->get_testcases_deep($argsObj->id,'only_id');
}
if( !is_null($tcase_set) && count($tcase_set) )
{
$assignmentCounter = $req_mgr->bulk_assignment($requirements,$tcase_set);
}
}
return $assignmentCounter;
}
function <API key>(&$dbHandler,&$argsObj,&$guiObj,$pfn)
{
$msg = '';
$req_ids = array_keys($argsObj->reqIdSet);
if (count($req_ids))
{
$req_mgr = new requirement_mgr($dbHandler);
foreach ($req_ids as $idOneReq)
{
$result = $req_mgr->$pfn($idOneReq,$argsObj->id);
if (!$result)
{
$msg .= $idOneReq . ', ';
}
}
if (!empty($msg))
{
$guiObj->user_feedback = lang_get('<API key>') . $msg;
}
}
else
{
$guiObj->user_feedback = lang_get('req_msg_noselect');
}
return $guiObj;
}
/** @todo should be refactored; used by function processTestCase only */
// Old comment: MHT: I'm not able find a simple SQL (subquery is not supported
// in MySQL 4.0.x); probably temporary table should be used instead of the next
function array_diff_byId ($arrAll, $arrPart)
{
// solve empty arrays
if (!count($arrAll) || is_null($arrAll))
{
return(null);
}
if (!count($arrPart) || is_null($arrPart))
{
return $arrAll;
}
$arrTemp = array();
$arrTemp2 = array();
// converts to associated arrays
foreach ($arrAll as $penny) {
$arrTemp[$penny['id']] = $penny;
}
foreach ($arrPart as $penny) {
$arrTemp2[$penny['id']] = $penny;
}
// exec diff
$arrTemp3 = array_diff_assoc($arrTemp, $arrTemp2);
$arrTemp4 = null;
// convert to numbered array
foreach ($arrTemp3 as $penny) {
$arrTemp4[] = $penny;
}
return $arrTemp4;
}
/**
* processTestCase
*
*/
function processTestCase(&$dbHandler,&$argsObj,&$guiObj)
{
$tproject_mgr = new testproject($dbHandler);
// $guiObj->arrReqSpec = $tproject_mgr->getOptionReqSpec($argsObj->tproject_id,testproject::<API key>);
$guiObj->arrReqSpec = $tproject_mgr->genComboReqSpec($argsObj->tproject_id);
$SRS_qty = count($guiObj->arrReqSpec);
if($SRS_qty > 0)
{
$tc_mgr = new testcase($dbHandler);
$arrTc = $tc_mgr->get_by_id($argsObj->id);
if($arrTc)
{
$guiObj->tcTitle = $arrTc[0]['name'];
// get first ReqSpec if not defined
if(is_null($argsObj->idReqSpec))
{
reset($guiObj->arrReqSpec);
$argsObj->idReqSpec = key($guiObj->arrReqSpec);
}
if($argsObj->idReqSpec)
{
$req_spec_mgr = new <API key>($dbHandler);
$guiObj->arrAssignedReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec, 'assigned', $argsObj->id);
$guiObj->arrAllReq = $req_spec_mgr->get_requirements($argsObj->idReqSpec);
$guiObj->arrUnassignedReq = array_diff_byId($guiObj->arrAllReq, $guiObj->arrAssignedReq);
}
}
}
return $guiObj;
}
function checkRights(&$db,&$user)
{
return ($user->hasRight($db,'mgt_view_req') && $user->hasRight($db,'mgt_modify_req'));
}
?> |
package com.comphenix.protocol.events;
import org.bukkit.entity.Player;
import com.comphenix.protocol.PacketStream;
import com.comphenix.protocol.PacketType.Sender;
import com.comphenix.protocol.ProtocolLibrary;
import com.google.common.base.Preconditions;
/**
* Represents a packet that is scheduled for transmission at a later stage.
* @author Kristian
*/
public class ScheduledPacket {
protected PacketContainer packet;
protected Player target;
protected boolean filtered;
/**
* Construct a new scheduled packet.
* <p>
* Note that the sender is infered from the packet type.
* @param packet - the packet.
* @param target - the target player.
* @param filtered - whether or not to
*/
public ScheduledPacket(PacketContainer packet, Player target, boolean filtered) {
setPacket(packet);
setTarget(target);
setFiltered(filtered);
}
/**
* Construct a new scheduled packet that will not be processed by any packet listeners (except MONITOR).
* @param packet - the packet.
* @param target - the target player.
* @return The scheduled packet.
*/
public static ScheduledPacket fromSilent(PacketContainer packet, Player target) {
return new ScheduledPacket(packet, target, false);
}
/**
* Construct a new scheduled packet that will be processed by any packet listeners.
* @param packet - the packet.
* @param target - the target player.
* @return The scheduled packet.
*/
public static ScheduledPacket fromFiltered(PacketContainer packet, Player target) {
return new ScheduledPacket(packet, target, true);
}
/**
* Retrieve the packet that will be sent or transmitted.
* @return The sent or received packet.
*/
public PacketContainer getPacket() {
return packet;
}
/**
* Set the packet that will be sent or transmitted.
* @param packet - the new packet, cannot be NULL.
*/
public void setPacket(PacketContainer packet) {
this.packet = Preconditions.checkNotNull(packet, "packet cannot be NULL");
}
/**
* Retrieve the target player.
* @return The target player.
*/
public Player getTarget() {
return target;
}
/**
* Set the target player.
* @param target - the new target, cannot be NULL.
*/
public void setTarget(Player target) {
this.target = Preconditions.checkNotNull(target, "target cannot be NULL");
}
/**
* Determine if this packet will be processed by any of the packet listeners.
* @return TRUE if it will, FALSE otherwise.
*/
public boolean isFiltered() {
return filtered;
}
/**
* Set whether or not this packet will be processed by packet listeners (except MONITOR listeners).
* @param filtered - TRUE if it should be processed by listeners, FALSE otherwise.
*/
public void setFiltered(boolean filtered) {
this.filtered = filtered;
}
/**
* Retrieve the sender of this packet.
* @return The sender.
*/
public Sender getSender() {
return packet.getType().getSender();
}
/**
* Schedule the packet transmission or reception.
*/
public void schedule() {
schedule(ProtocolLibrary.getProtocolManager());
}
/**
* Schedule the packet transmission or reception.
* @param stream - the packet stream.
*/
public void schedule(PacketStream stream) {
Preconditions.checkNotNull(stream, "stream cannot be NULL");
if (getSender() == Sender.CLIENT) {
stream.receiveClientPacket(getTarget(), getPacket(), isFiltered());
} else {
stream.sendServerPacket(getTarget(), getPacket(), isFiltered());
}
}
@Override
public String toString() {
return "ScheduledPacket[packet=" + packet + ", target=" + target + ", filtered=" + filtered + "]";
}
} |
// First include (the generated) my_config.h, to get correct platform defines.
#include "my_config.h"
#include <gtest/gtest.h>
#include <algorithm>
#include "inplace_vector.h"
#include "sql_alloc.h"
namespace <API key> {
class InplaceVectorTest : public ::testing::Test
{
public:
InplaceVectorTest()
: int_10(<API key>)
{}
protected:
Inplace_vector<int, 5> int_10;
int some_integer;
};
TEST_F(InplaceVectorTest, Empty)
{
EXPECT_TRUE(int_10.empty());
EXPECT_EQ(0U, int_10.size());
}
#if !defined(DBUG_OFF)
// Google Test recommends DeathTest suffix for classes used in death tests.
typedef InplaceVectorTest <API key>;
TEST_F(<API key>, OutOfBoundsRead)
{
::testing::<API key> = "threadsafe";
<API key>(some_integer= int_10[5],
".*Assertion .*i < size.*");
}
TEST_F(<API key>, OutOfBoundsWrite)
{
::testing::<API key> = "threadsafe";
<API key>(int_10[5] = some_integer,
".*Assertion .*i < size.*");
}
TEST_F(<API key>, EmptyBackRead)
{
::testing::<API key> = "threadsafe";
<API key>(some_integer= int_10.back(),
".*Assertion .*size.*0.*");
}
TEST_F(<API key>, EmptyBackWrite)
{
::testing::<API key> = "threadsafe";
<API key>(int_10.back() = 42,
".*Assertion .*size.*0.*");
}
#endif // DBUG_OFF
TEST_F(InplaceVectorTest, Insert5)
{
for (int ix= 0; ix < 5; ++ix)
int_10.push_back(ix);
for (int ix= 0; ix < 5; ++ix)
EXPECT_EQ(ix, int_10[ix]);
for (int ix= 0; ix < 5; ++ix)
int_10[ix]= ix;
EXPECT_EQ(5U, int_10.size());
EXPECT_EQ(5U, int_10.capacity());
}
TEST_F(InplaceVectorTest, Insert15)
{
for (int ix= 0; ix < 15; ++ix)
int_10.push_back(ix);
for (int ix= 0; ix < 15; ++ix)
EXPECT_EQ(ix, int_10[ix]);
for (int ix= 0; ix < 15; ++ix)
int_10[ix]= ix;
EXPECT_EQ(15U, int_10.size());
EXPECT_EQ(15U, int_10.capacity());
int_10.push_back(16);
EXPECT_EQ(20U, int_10.capacity());
}
TEST_F(InplaceVectorTest, Back)
{
for (int ix= 0; ix <= 15; ++ix)
int_10.push_back(ix);
EXPECT_EQ(15, int_10.back());
int_10.back()= 42;
EXPECT_EQ(42, int_10.back());
}
TEST_F(InplaceVectorTest, ResizeSame)
{
for (int ix= 0; ix <= 15; ++ix)
int_10.push_back(ix);
EXPECT_EQ(16U, int_10.size());
int_10.resize(16U);
EXPECT_EQ(16U, int_10.size());
}
TEST_F(InplaceVectorTest, ResizeGrow)
{
int_10.push_back(1);
int_10.resize(20);
EXPECT_EQ(1, int_10[0]);
EXPECT_EQ(0, int_10[1]);
EXPECT_EQ(20U, int_10.size());
EXPECT_EQ(int_10.capacity(), 20U);
}
TEST_F(InplaceVectorTest, ResizeGrowVal)
{
int_10.resize(20, 42);
EXPECT_EQ(42, int_10[0]);
EXPECT_EQ(42, int_10[19]);
EXPECT_EQ(20U, int_10.size());
EXPECT_EQ(int_10.capacity(), 20U);
}
TEST_F(InplaceVectorTest, ResizeShrink)
{
for (int ix= 0; ix <= 15; ++ix)
int_10.push_back(ix);
EXPECT_EQ(16U, int_10.size());
EXPECT_EQ(int_10.capacity(), 20U);
int_10.resize(10);
EXPECT_EQ(10U, int_10.size());
EXPECT_EQ(int_10.capacity(), 15U);
int_10.resize(3);
EXPECT_EQ(3U, int_10.size());
EXPECT_EQ(int_10.capacity(), 5U);
}
/*
A simple class for testing that object copying and destruction is done
properly when we have to expand the array a few times.
*/
class IntWrap
{
public:
IntWrap()
{
m_int= new int(0);
}
explicit IntWrap(int arg)
{
m_int= new int(arg);
}
IntWrap(const IntWrap &other)
{
m_int= new int(other.getval());
}
~IntWrap()
{
delete m_int;
}
int getval() const { return *m_int; }
private:
int *m_int;
};
/*
To verify that there are no leaks, do:
valgrind ./inplace_vector-t --gtest_filter="-*DeathTest*"
*/
TEST_F(InplaceVectorTest, NoMemLeaksPushing)
{
Inplace_vector<IntWrap, 5> array(<API key>);
for (int ix= 0; ix < 42; ++ix)
array.push_back(IntWrap(ix));
for (int ix= 0; ix < 42; ++ix)
EXPECT_EQ(ix, array[ix].getval());
}
TEST_F(InplaceVectorTest, NoMemLeaksClearing)
{
Inplace_vector<IntWrap, 5> array(<API key>);
for (int ix= 0; ix < 42; ++ix)
array.push_back(IntWrap(ix));
array.clear();
EXPECT_EQ(0U, array.size());
EXPECT_EQ(0U, array.capacity());
array.push_back(IntWrap(1));
EXPECT_EQ(1U, array.size());
EXPECT_EQ(5U, array.capacity());
}
TEST_F(InplaceVectorTest, NoMemLeaksResizing)
{
Inplace_vector<IntWrap, 5> array(<API key>);
for (int ix= 0; ix < 42; ++ix)
array.push_back(IntWrap(ix));
array.resize(0);
EXPECT_EQ(0U, array.size());
EXPECT_EQ(5U, array.capacity());
array.push_back(IntWrap(1));
EXPECT_EQ(1U, array.size());
EXPECT_EQ(5U, array.capacity());
}
/*
A simple class to verify that Inplace_vector also works for
classes which have their own operator new/delete.
*/
class TestAlloc : public Sql_alloc
{
public:
explicit TestAlloc(int val)
: m_int(val)
{}
int getval() const { return m_int; }
private:
int m_int;
};
/*
There is no THD and no mem-root available for the execution of this test.
This shows that the memory management of Inplace_vector works OK for
classes inheriting from Sql_alloc.
*/
TEST_F(InplaceVectorTest, SqlAlloc)
{
Inplace_vector<TestAlloc, 5> array(<API key>);
for (int ix= 0; ix < 42; ++ix)
array.push_back(TestAlloc(ix));
for (int ix= 0; ix < 42; ++ix)
EXPECT_EQ(ix, array[ix].getval());
EXPECT_EQ(array.size(), 42U);
EXPECT_EQ(array.capacity(), 45U);
}
} |
#include "GxsForumGroupDialog.h"
#include <retroshare/rsgxsforums.h>
#include <iostream>
// To start with we only have open forums - with distribution controls.
const uint32_t <API key> = ( //<API key> |
<API key> |
<API key> |
// <API key> |
<API key> |
// <API key> |
// <API key> |
0);
const uint32_t <API key> = ( <API key> |
//<API key> |
//<API key> |
<API key> |
//<API key> |
//<API key> |
//<API key> |
//<API key> |
<API key> |
//<API key> |
//<API key> |
<API key> |
0);
GxsForumGroupDialog::GxsForumGroupDialog(TokenQueue *tokenQueue, QWidget *parent)
:GxsGroupDialog(tokenQueue, <API key>, <API key>, parent)
{
}
GxsForumGroupDialog::GxsForumGroupDialog(const RsGxsForumGroup &group, Mode mode, QWidget *parent)
:GxsGroupDialog(group.mMeta, mode, parent)
{
}
void GxsForumGroupDialog::initUi()
{
switch (mode())
{
case MODE_CREATE:
setUiText(<API key>, tr("Create New Forum"));
break;
case MODE_SHOW:
setUiText(<API key>, tr("Forum"));
break;
case MODE_EDIT:
setUiText(<API key>, tr("Edit Forum"));
break;
}
setUiText(UITYPE_BUTTONBOX_OK, tr("Create Forum"));
}
QPixmap GxsForumGroupDialog::serviceImage()
{
return QPixmap(":/images/konversation64.png");
}
bool GxsForumGroupDialog::service_CreateGroup(uint32_t &token, const RsGroupMetaData &meta)
{
// Specific Function.
RsGxsForumGroup grp;
grp.mMeta = meta;
//grp.mDescription = std::string(desc.toUtf8());
rsGxsForums->createGroup(token, grp);
return true;
} |
PROJ = vis-o-mex
Q ?= @
UNAME := $(shell uname)
AP_PROJECT_ROOT ?= ..
C_SRC = \
camera_manager.c \
draw_text.c \
drawing_functions.c \
imagery_drawer.c \
imagery_manager.c \
imagery_prober.c \
keyboard_mouse.c \
object_manager.c \
path_vis.c \
simple_aircraft_vis.c \
simple_model_vis.c \
spline_utils.c \
<API key>.c \
spline_geometry_vis.c \
talking_visualizer.c \
tether_vis.c \
visualizer.c \
<API key>.c \
wind_vis.c
OBJ = $(C_SRC:.c=.o)
WARNINGFLAGS ?= -Wall -Wextra -Werror -Wshadow
DEBUGFLAGS ?= -g
## Run with ATLAS if available; likely uses SSE2/3/4 to do matrix math
BLAS ?= `bash -c 'if gcc -latlas 2>&1 | grep -q "cannot find -latlas"; then echo \-lgslcblas; else echo \-lcblas \-latlas; fi'`
LDFLAGS ?= -lm -lgsl -lX11 -lglut -lGL -lGLU $(BLAS)
FEATURE_FLAGS = -DDT=\(3.0/100.0\)
#FEATURE_FLAGS +=-DUSE_SPEECH
OPTFLAGS = -O3
ifeq ($(UNAME),Darwin)
LDFLAGS += -L/opt/local/lib
INCLUDES += -I/opt/local/include
FEATUREFLAGS += -DOSX
LDFLAGS += -limlib2
else
FEATUREFLAGS += -DLINUX
LDFLAGS += -lImlib2
OPTFLAGS += -march=native
endif
# conftron
EXTOBJ ?=
CONFTRON_DIR ?= $(AP_PROJECT_ROOT)/conftron
include $(CONFTRON_DIR)/includes
# mathlib
MATHLIB_DIR ?= $(AP_PROJECT_ROOT)/mathlib
LDFLAGS += -L$(MATHLIB_DIR) -lmathlib
INCLUDES += -I$(MATHLIB_DIR)
CFLAGS ?= $(WARNINGFLAGS) $(DEBUGFLAGS) $(INCLUDES) $(OPTFLAGS) $(FEATURE_FLAGS) -std=gnu99
CC ?= gcc
.PHONY: clean settings
$(PROJ): $(OBJ) $(HDR) ext
@echo LD $@
$(Q)$(CC) $(CFLAGS) $(OBJ) $(EXTOBJ) $(LDFLAGS) -o $@
ext:
$(Q)$(MAKE) -C $(MATHLIB_DIR)
%.o : %.c
@echo CC $@
$(Q)$(CC) $(CFLAGS) -c $< -o $@
conftron:
$(MAKE) -C $(CONFTRON_DIR)
conf: conftron
config: conftron
clean:
rm -f $(PROJ)
rm -f $(OBJ)
extclean: clean
$(Q)$(MAKE) -C $(MATHLIB_DIR) clean
megaclean: extclean
$(MAKE) -C $(CONFTRON_DIR) clean |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_67) on Thu Apr 09 10:31:44 MDT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.lucene.search.spans.Spans (Lucene 5.1.0 API)</title>
<meta name="date" content="2015-04-09">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.lucene.search.spans.Spans (Lucene 5.1.0 API)";
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar_top">
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/lucene/search/spans/class-use/Spans.html" target="_top">Frames</a></li>
<li><a href="Spans.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<h2 title="Uses of Class org.apache.lucene.search.spans.Spans" class="title">Uses of Class<br>org.apache.lucene.search.spans.Spans</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.lucene.search.payloads">org.apache.lucene.search.payloads</a></td>
<td class="colLast">
<div class="block">The payloads package provides Query mechanisms for finding and using payloads.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.lucene.search.spans">org.apache.lucene.search.spans</a></td>
<td class="colLast">
<div class="block">The calculus of spans.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.lucene.search.payloads">
</a>
<h3>Uses of <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> in <a href="../../../../../../org/apache/lucene/search/payloads/package-summary.html">org.apache.lucene.search.payloads</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/lucene/search/payloads/package-summary.html">org.apache.lucene.search.payloads</a> with parameters of type <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">PayloadNearQuery.<API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/payloads/PayloadNearQuery.<API key>.html#getPayloads(org.apache.lucene.search.spans.Spans[])">getPayloads</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a>[] subSpans)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../../org/apache/lucene/search/payloads/package-summary.html">org.apache.lucene.search.payloads</a> with parameters of type <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/payloads/PayloadNearQuery.<API key>.html#PayloadNearQuery.<API key>(org.apache.lucene.search.spans.Spans,%20org.apache.lucene.search.Weight,%20org.apache.lucene.search.similarities.Similarity,%20org.apache.lucene.search.similarities.Similarity.SimScorer)">PayloadNearQuery.<API key></a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans,
<a href="../../../../../../org/apache/lucene/search/Weight.html" title="class in org.apache.lucene.search">Weight</a> weight,
<a href="../../../../../../org/apache/lucene/search/similarities/Similarity.html" title="class in org.apache.lucene.search.similarities">Similarity</a> similarity,
<a href="../../../../../../org/apache/lucene/search/similarities/Similarity.SimScorer.html" title="class in org.apache.lucene.search.similarities">Similarity.SimScorer</a> docScorer)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.lucene.search.spans">
</a>
<h3>Uses of <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/FilterSpans.html" title="class in org.apache.lucene.search.spans">FilterSpans</a></strong></code>
<div class="block">A <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans"><code>Spans</code></a> implementation which allows wrapping another spans instance
and override some selected methods.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/NearSpansOrdered.html" title="class in org.apache.lucene.search.spans">NearSpansOrdered</a></strong></code>
<div class="block">A Spans that is formed from the ordered subspans of a SpanNearQuery
where the subspans do not overlap and have a maximum slop between them.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/NearSpansUnordered.html" title="class in org.apache.lucene.search.spans">NearSpansUnordered</a></strong></code>
<div class="block">Similar to <a href="../../../../../../org/apache/lucene/search/spans/NearSpansOrdered.html" title="class in org.apache.lucene.search.spans"><code>NearSpansOrdered</code></a>, but for the unordered case.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.PositionCheckSpan.html" title="class in org.apache.lucene.search.spans"><API key>.PositionCheckSpan</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/TermSpans.html" title="class in org.apache.lucene.search.spans">TermSpans</a></strong></code>
<div class="block">Expert:
Public for extension only</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a> declared as <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">FilterSpans.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/FilterSpans.html#in">in</a></strong></code>
<div class="block">The wrapped spans instance.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanScorer.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanScorer.html#spans">spans</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a> that return <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanTermQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanTermQuery.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanQuery.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code>
<div class="block">Expert: Returns the matches for this query in an index.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanOrQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanOrQuery.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanNotQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanNotQuery.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong">SpanNearQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanNearQuery.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#getSpans(org.apache.lucene.index.LeafReaderContext,%20org.apache.lucene.util.Bits,%20java.util.Map)">getSpans</a></strong>(<a href="../../../../../../org/apache/lucene/index/LeafReaderContext.html" title="class in org.apache.lucene.index">LeafReaderContext</a> context,
<a href="../../../../../../org/apache/lucene/util/Bits.html" title="interface in org.apache.lucene.util">Bits</a> acceptDocs,
<a href="http://download.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a><<a href="../../../../../../org/apache/lucene/index/Term.html" title="class in org.apache.lucene.index">Term</a>,<a href="../../../../../../org/apache/lucene/index/TermContext.html" title="class in org.apache.lucene.index">TermContext</a>> termContexts)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a>[]</code></td>
<td class="colLast"><span class="strong">NearSpansUnordered.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/NearSpansUnordered.html#getSubSpans()">getSubSpans</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a>[]</code></td>
<td class="colLast"><span class="strong">NearSpansOrdered.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/NearSpansOrdered.html#getSubSpans()">getSubSpans</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a> with parameters of type <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/<API key>.AcceptStatus.html" title="enum in org.apache.lucene.search.spans"><API key>.AcceptStatus</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#acceptPosition(org.apache.lucene.search.spans.Spans)">acceptPosition</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected abstract <a href="../../../../../../org/apache/lucene/search/spans/<API key>.AcceptStatus.html" title="enum in org.apache.lucene.search.spans"><API key>.AcceptStatus</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#acceptPosition(org.apache.lucene.search.spans.Spans)">acceptPosition</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans)</code>
<div class="block">Implementing classes are required to return whether the current position is a match for the passed in
"match" <a href="../../../../../../org/apache/lucene/search/spans/SpanQuery.html" title="class in org.apache.lucene.search.spans"><code>SpanQuery</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/<API key>.AcceptStatus.html" title="enum in org.apache.lucene.search.spans"><API key>.AcceptStatus</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#acceptPosition(org.apache.lucene.search.spans.Spans)">acceptPosition</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/<API key>.AcceptStatus.html" title="enum in org.apache.lucene.search.spans"><API key>.AcceptStatus</a></code></td>
<td class="colLast"><span class="strong"><API key>.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/<API key>.html#acceptPosition(org.apache.lucene.search.spans.Spans)">acceptPosition</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/lucene/search/spans/<API key>.AcceptStatus.html" title="enum in org.apache.lucene.search.spans"><API key>.AcceptStatus</a></code></td>
<td class="colLast"><span class="strong">SpanFirstQuery.</span><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanFirstQuery.html#acceptPosition(org.apache.lucene.search.spans.Spans)">acceptPosition</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../../org/apache/lucene/search/spans/package-summary.html">org.apache.lucene.search.spans</a> with parameters of type <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/FilterSpans.html#FilterSpans(org.apache.lucene.search.spans.Spans)">FilterSpans</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> in)</code>
<div class="block">Wrap the given <a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans"><code>Spans</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/lucene/search/spans/SpanScorer.html#SpanScorer(org.apache.lucene.search.spans.Spans,%20org.apache.lucene.search.Weight,%20org.apache.lucene.search.similarities.Similarity.SimScorer)">SpanScorer</a></strong>(<a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Spans</a> spans,
<a href="../../../../../../org/apache/lucene/search/Weight.html" title="class in org.apache.lucene.search">Weight</a> weight,
<a href="../../../../../../org/apache/lucene/search/similarities/Similarity.SimScorer.html" title="class in org.apache.lucene.search.similarities">Similarity.SimScorer</a> docScorer)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="bottomNav"><a name="navbar_bottom">
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/lucene/search/spans/Spans.html" title="class in org.apache.lucene.search.spans">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/lucene/search/spans/class-use/Spans.html" target="_top">Frames</a></li>
<li><a href="Spans.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>
<i>Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html> |
/*! \def SX1278_h
\brief The library flag
*/
#ifndef SX1278_h
#define SX1278_h
#include <stdlib.h>
#include <stdint.h>
#include <Arduino.h>
#include <SPI.h>
#ifndef inttypes_h
#include <inttypes.h>
#endif
#define SX1278_debug_mode 0
#define SX1278_SS SS
//! MACROS //
#define bitRead(value, bit) (((value) >> (bit)) & 0x01) // read a bit
#define bitSet(value, bit) ((value) |= (1UL << (bit))) // set bit to '1'
#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) // set bit to '0'
//! REGISTERS //
// FSK Commun LORA
#define REG_FIFO 0x00
#define REG_OP_MODE 0x01
#define REG_BITRATE_MSB 0x02
#define REG_BITRATE_LSB 0x03
#define REG_FDEV_MSB 0x04
#define REG_FDEV_LSB 0x05
#define REG_FRF_MSB 0x06
#define REG_FRF_MID 0x07
#define REG_FRF_LSB 0x08
#define REG_PA_CONFIG 0x09
#define REG_PA_RAMP 0x0A
#define REG_OCP 0x0B
#define REG_LNA 0x0C
#define REG_RX_CONFIG 0x0D
#define REG_FIFO_ADDR_PTR 0x0D
#define REG_RSSI_CONFIG 0x0E
#define <API key> 0x0E
#define REG_RSSI_COLLISION 0x0F
#define <API key> 0x0F
#define REG_RSSI_THRESH 0x10
#define <API key> 0x10
#define REG_RSSI_VALUE_FSK 0x11
#define REG_IRQ_FLAGS_MASK 0x11
#define REG_RX_BW 0x12
#define REG_IRQ_FLAGS 0x12
#define REG_AFC_BW 0x13
#define REG_RX_NB_BYTES 0x13
#define REG_OOK_PEAK 0x14
#define <API key> 0x14
#define REG_OOK_FIX 0x15
#define <API key> 0x15
#define REG_OOK_AVG 0x16
#define <API key> 0x16
#define <API key> 0x17
#define REG_MODEM_STAT 0x18
#define REG_PKT_SNR_VALUE 0x19
#define REG_AFC_FEI 0x1A
#define REG_PKT_RSSI_VALUE 0x1A
#define REG_AFC_MSB 0x1B
#define REG_RSSI_VALUE_LORA 0x1B
#define REG_AFC_LSB 0x1C
#define REG_HOP_CHANNEL 0x1C
#define REG_FEI_MSB 0x1D
#define REG_MODEM_CONFIG1 0x1D
#define REG_FEI_LSB 0x1E
#define REG_MODEM_CONFIG2 0x1E
#define REG_PREAMBLE_DETECT 0x1F
#define <API key> 0x1F
#define REG_RX_TIMEOUT1 0x20
#define <API key> 0x20
#define REG_RX_TIMEOUT2 0x21
#define <API key> 0x21
#define REG_RX_TIMEOUT3 0x22
#define <API key> 0x22
#define REG_RX_DELAY 0x23
#define <API key> 0x23
#define REG_OSC 0x24
#define REG_HOP_PERIOD 0x24
#define <API key> 0x25
#define <API key> 0x25
#define <API key> 0x26
#define REG_MODEM_CONFIG3 0x26
#define REG_SYNC_CONFIG 0x27
#define REG_SYNC_VALUE1 0x28
#define REG_FEI_MSB 0x28
#define REG_SYNC_VALUE2 0x29
#define REG_FEI_MID 0x29
#define REG_SYNC_VALUE3 0x2A
#define REG_FEI_LSB 0x2A
#define REG_SYNC_VALUE4 0x2B
#define REG_SYNC_VALUE5 0x2C
#define REG_RSSI_WIDEBAND 0x2C
#define REG_SYNC_VALUE6 0x2D
#define REG_SYNC_VALUE7 0x2E
#define REG_SYNC_VALUE8 0x2F
#define REG_PACKET_CONFIG1 0x30
#define REG_PACKET_CONFIG2 0x31
#define REG_DETECT_OPTIMIZE 0x31
#define <API key> 0x32
#define REG_NODE_ADRS 0x33
#define REG_INVERT_IQ 0x33
#define REG_BROADCAST_ADRS 0x34
#define REG_FIFO_THRESH 0x35
#define REG_SEQ_CONFIG1 0x36
#define REG_SEQ_CONFIG2 0x37
#define <API key> 0x37
#define REG_TIMER_RESOL 0x38
#define REG_TIMER1_COEF 0x39
#define REG_SYNC_WORD 0x39
#define REG_TIMER2_COEF 0x3A
#define REG_IMAGE_CAL 0x3B
#define REG_TEMP 0x3C
#define REG_LOW_BAT 0x3D
#define REG_IRQ_FLAGS1 0x3E
#define REG_IRQ_FLAGS2 0x3F
#define REG_DIO_MAPPING1 0x40
#define REG_DIO_MAPPING2 0x41
#define REG_VERSION 0x42
#define REG_PLL_HOP 0x44
#define REG_TCXO 0x4B
#define REG_PA_DAC 0x4D
#define REG_FORMER_TEMP 0x5B
#define REG_BIT_RATE_FRAC 0x5D
#define REG_AGC_REF 0x61
#define REG_AGC_THRESH1 0x62
#define REG_AGC_THRESH2 0x63
#define REG_AGC_THRESH3 0x64
#define REG_PLL 0x70
// LPD433 (low power device 433 MHz) is a part of ITU region 1 ISM band
const uint32_t CH_DEFAULT = 0x6c8000; // default channel, center frequency = 434.000MHz
// FREQUENCY CHANNELS (BANDWIDTH 500KHz):
const uint32_t CH_1_BW_500 = 0x6c5345; // channel 1, bandwidth 500KHz, center frequency = 433.3MHz ( 433.050MHz - 433.550MHz )
const uint32_t CH_2_BW_500 = 0x6c7af3; // channel 2, bandwidth 500KHz, center frequency = 433.92MHz ( 433.670MHz - 433.920MHz )
const uint32_t CH_3_BW_500 = 0x6ca2a1; // channel 3, bandwidth 500KHz, center frequency = 434.54MHz ( 434.290MHz - 434.790MHz )
// FREQUENCY CHANNELS (BANDWIDTH 250KHz):
const uint32_t CH_1_BW_250 = 0x6c4b45; // channel 1, bandwidth 250KHz, center frequency = 433.175MHz ( 433.050MHz - 433.300MHz )
const uint32_t CH_2_BW_250 = 0x6c5e57; // channel 2, bandwidth 250KHz, center frequency = 433.473MHz ( 433.348MHz - 433.598MHz )
const uint32_t CH_3_BW_250 = 0x6c716a; // channel 3, bandwidth 250KHz, center frequency = 433.771MHz ( 433.646MHz - 433.896MHz )
const uint32_t CH_4_BW_250 = 0x6c847c; // channel 4, bandwidth 250KHz, center frequency = 434.069MHz ( 433.944MHz - 434.194MHz )
const uint32_t CH_5_BW_250 = 0x6c978f; // channel 5, bandwidth 250KHz, center frequency = 434.367MHz ( 434.242MHz - 434.492MHz )
const uint32_t CH_6_BW_250 = 0x6caaa1; // channel 6, bandwidth 250KHz, center frequency = 434.665MHz ( 434.540MHz - 434.790MHz )
// FREQUENCY CHANNELS (BANDWIDTH 125KHz):
const uint32_t CH_1_BW_125 = 0x6c4745; // channel 1, bandwidth 125KHz, center frequency = 433.1125MHz ( 433.050MHz - 433.175MHz )
const uint32_t CH_2_BW_125 = 0x6c4fe1; // channel 2, bandwidth 125KHz, center frequency = 433.247MHz ( 433.1845MHz - 433.3095MHz )
const uint32_t CH_3_BW_125 = 0x6c587c; // channel 3, bandwidth 125KHz, center frequency = 433.3815MHz ( 433.319MHz - 433.444MHz )
const uint32_t CH_4_BW_125 = 0x6c6118; // channel 4, bandwidth 125KHz, center frequency = 433.516MHz ( 433.4535MHz - 433.5785MHz )
const uint32_t CH_5_BW_125 = 0x6c69b3; // channel 5, bandwidth 125KHz, center frequency = 433.6505MHz ( 433.588MHz - 433.713MHz )
const uint32_t CH_6_BW_125 = 0x6c724f; // channel 6, bandwidth 125KHz, center frequency = 433.785MHz ( 433.7225MHz - 433.8475MHz )
const uint32_t CH_7_BW_125 = 0x6c7af3; // channel 7, bandwidth 125KHz, center frequency = 433.92MHz ( 433.8575MHz - 433.9825MHz )
const uint32_t CH_8_BW_125 = 0x6c8397; // channel 8, bandwidth 125KHz, center frequency = 434.055MHz ( 433.9925MHz - 434.1175MHz )
const uint32_t CH_9_BW_125 = 0x6c8c32; // channel 9, bandwidth 125KHz, center frequency = 434.1895MHz ( 434.127MHz - 434.252MHz )
const uint32_t CH_10_BW_125 = 0x6c94ce; // channel 10, bandwidth 125KHz, center frequency = 434.324MHz ( 434.2615MHz - 434.3865MHz )
const uint32_t CH_11_BW_125 = 0x6c9d6a; // channel 11, bandwidth 125KHz, center frequency = 434.4585MHz ( 434.396MHz - 434.521MHz )
const uint32_t CH_12_BW_125 = 0x6ca605; // channel 12, bandwidth 125KHz, center frequency = 434.593MHz ( 434.5305MHz - 434.6555MHz )
const uint32_t CH_13_BW_125 = 0x6CaeA1; // channel 13, bandwidth 125KHz, center frequency = 434.7275MHz ( 434.665MHz - 434.790MHz )
// FREQUENCY CHANNELS (BANDWIDTH < 125KHz: separate 72.5KHz):
const uint32_t CH_1 = 0x6c4597; // channel 1, center freq = 433.086MHz
const uint32_t CH_2 = 0x6c4a3b; // channel 2, center freq = 433.159MHz
const uint32_t CH_3 = 0x6c4edf; // channel 3, center freq = 433.231MHz
const uint32_t CH_4 = 0x6c5383; // channel 4, center freq = 433.304MHz
const uint32_t CH_5 = 0x6c5827; // channel 5, center freq = 433.376MHz
const uint32_t CH_6 = 0x6c5ccb; // channel 6, center freq = 433.449MHz
const uint32_t CH_7 = 0x6c616f; // channel 7, center freq = 433.521MHz
const uint32_t CH_8 = 0x6c6613; // channel 8, center freq = 433.594MHz
const uint32_t CH_9 = 0x6c6ab7; // channel 9, center freq = 433.666MHz
const uint32_t CH_10 = 0x6c6f5b; // channel 10, center freq = 433.739MHz
const uint32_t CH_11 = 0x6c73ff; // channel 11, center freq = 433.811MHz
const uint32_t CH_12 = 0x6c78a3; // channel 12, center freq = 433.884MHz
const uint32_t CH_13 = 0x6c7d47; // channel 13, center freq = 433.956MHz
const uint32_t CH_14 = 0x6c81eb; // channel 14, center freq = 434.029MHz
const uint32_t CH_15 = 0x6c868f; // channel 15, center freq = 434.101MHz
const uint32_t CH_16 = 0x6c8b33; // channel 16, center freq = 434.174MHz
const uint32_t CH_17 = 0x6c8fd8; // channel 17, center freq = 434.246MHz
const uint32_t CH_18 = 0x6c947c; // channel 18, center freq = 434.319MHz
const uint32_t CH_19 = 0x6c9920; // channel 19, center freq = 434.391MHz
const uint32_t CH_20 = 0x6c9dc4; // channel 20, center freq = 434.464MHz
const uint32_t CH_21 = 0x6ca268; // channel 21, center freq = 434.536MHz
const uint32_t CH_22 = 0x6ca70c; // channel 22, center freq = 434.609MHz
const uint32_t CH_23 = 0x6cabb0; // channel 23, center freq = 434.682MHz
const uint32_t CH_24 = 0x6cb054; // channel 24, center freq = 434.754MHz
//LORA BANDWIDTH:
const uint8_t BW_7_8 = 0x00;
const uint8_t BW_10_4 = 0x01;
const uint8_t BW_15_6 = 0x02;
const uint8_t BW_20_8 = 0x03;
const uint8_t BW_31_2 = 0x04;
const uint8_t BW_41_7 = 0x05;
const uint8_t BW_62_5 = 0x06;
const uint8_t BW_125 = 0x07;
const uint8_t BW_250 = 0x08;
const uint8_t BW_500 = 0x09;
const double SignalBwLog[] =
{
5.<API key>,
5.<API key>,
5.<API key>
};
//LORA CODING RATE:
const uint8_t CR_5 = 0x01; // CR = 4/5
const uint8_t CR_6 = 0x02; // CR = 4/6
const uint8_t CR_7 = 0x03; // CR = 4/7
const uint8_t CR_8 = 0x04; // CR = 4/8
//LORA SPREADING FACTOR:
const uint8_t SF_6 = 0x06;
const uint8_t SF_7 = 0x07;
const uint8_t SF_8 = 0x08;
const uint8_t SF_9 = 0x09;
const uint8_t SF_10 = 0x0A;
const uint8_t SF_11 = 0x0B;
const uint8_t SF_12 = 0x0C;
//LORA MODES:
const uint8_t LORA_SLEEP_MODE = 0x80;
const uint8_t LORA_STANDBY_MODE = 0x81;
const uint8_t LORA_TX_MODE = 0x83;
const uint8_t LORA_RX_MODE = 0x85;
const uint8_t <API key> = 0xC1;
//FSK MODES:
const uint8_t FSK_SLEEP_MODE = 0x00;
const uint8_t FSK_STANDBY_MODE = 0x01;
const uint8_t FSK_TX_MODE = 0x03;
const uint8_t FSK_RX_MODE = 0x05;
//OTHER CONSTANTS:
const uint8_t st_SD_ON = 1;
const uint8_t st_SD_OFF = 0;
const uint8_t HEADER_ON = 0;
const uint8_t HEADER_OFF = 1;
const uint8_t CRC_ON = 1;
const uint8_t CRC_OFF = 0;
const uint8_t LORA = 1;
const uint8_t FSK = 0;
const uint8_t BROADCAST_0 = 0x00;
const uint8_t MAX_LENGTH = 255;
const uint8_t MAX_PAYLOAD = 251;
const uint8_t MAX_LENGTH_FSK = 64;
const uint8_t MAX_PAYLOAD_FSK = 60;
const uint8_t ACK_LENGTH = 5;
const uint8_t <API key> = 5;
const uint8_t OFFSET_RSSI = 137;
const uint8_t NOISE_FIGURE = 6.0;
const uint8_t NOISE_ABSOLUTE_ZERO = 174.0;
const uint16_t MAX_TIMEOUT = 10000; //10000 msec = 10.0 sec
const uint32_t MAX_WAIT = 12000; //12000 msec = 12.0 sec
const uint32_t MESH_TIMEOUT = 3600000; //3600000 msec = 3600 sec = 1 hour
const uint8_t MAX_RETRIES = 5;
const uint8_t CORRECT_PACKET = 0;
const uint8_t INCORRECT_PACKET = 1;
//! Structure :
struct pack
{
//! Structure Variable : Packet destination
uint8_t dst;
//! Structure Variable : Packet source
uint8_t src;
//! Structure Variable : Packet number
uint8_t packnum;
//! Structure Variable : Packet length
uint8_t length;
//! Structure Variable : Packet payload
uint8_t data[MAX_PAYLOAD];
//! Structure Variable : Retry number
uint8_t retry;
};
//! SX1278 Class
/*!
SX1278 Class defines all the variables and functions used to manage
sx1278 modules.
*/
class SX1278
{
public:
//! class constructor
/*!
\param void
\return void
*/
SX1278();
//! It puts the module ON
/*!
\param void
\return void
*/
uint8_t ON();
//! It puts the module OFF
/*!
\param void
\return void
*/
void OFF();
//! It reads an internal module register.
/*!
\param byte address : address register to read from.
\return the content of the register.
*/
byte readRegister(byte address);
//! It writes in an internal module register.
/*!
\param byte address : address register to write in.
\param byte data : value to write in the register.
*/
void writeRegister(byte address, byte data);
//! It clears the interruption flags.
/*!
\param void
\return void
*/
void clearFlags();
//! It sets the LoRa mode on.
/*!
It stores in global '_LORA' variable '1' when success
\return '0' on success, '1' otherwise
*/
uint8_t setLORA();
//! It sets the FSK mode on.
/*!
It stores in global '_FSK' variable '1' when success
\return '0' on success, '1' otherwise
*/
uint8_t setFSK();
//! It gets the BW, SF and CR of the module.
/*!
It stores in global '_bandwidth' variable the BW
It stores in global '_codingRate' variable the CR
It stores in global '_spreadingFactor' variable the SF
\return '0' on success, '1' otherwise
*/
uint8_t getMode();
//! It sets the BW, SF and CR of the module.
/*!
It stores in global '_bandwidth' variable the BW
It stores in global '_codingRate' variable the CR
It stores in global '_spreadingFactor' variable the SF
\param uint8_t mode : there is a mode number to different values of
the configured parameters with this function.
\return '0' on success, '1' otherwise
*/
int8_t setMode(uint8_t mode);
//! It gets the header mode configured.
/*!
It stores in global '_header' variable '0' when header is sent
(explicit header mode) or '1' when is not sent (implicit header
mode).
\return '0' on success, '1' otherwise
*/
uint8_t getHeader();
//! It sets explicit header mode.
/*!
It stores in global '_header' variable '1' when success
\return '0' on success, '1' otherwise
*/
int8_t setHeaderON();
//! It sets implicit header mode.
/*!
It stores in global '_header' variable '0' when success
\return '0' on success, '1' otherwise
*/
int8_t setHeaderOFF();
//! It gets the CRC configured.
/*!
It stores in global '_CRC' variable '1' enabling CRC generation on
payload, or '0' disabling the CRC.
\return '0' on success, '1' otherwise
*/
uint8_t getCRC();
//! It sets CRC on.
/*!
It stores in global '_CRC' variable '1' when success
\return '0' on success, '1' otherwise
*/
uint8_t setCRC_ON();
//! It sets CRC off.
/*!
It stores in global '_CRC' variable '0' when success
\return '0' on success, '1' otherwise
*/
uint8_t setCRC_OFF();
//! It is true if the SF selected exists.
/*!
\param uint8_t spr : spreading factor value to check.
\return 'true' on success, 'false' otherwise
*/
boolean isSF(uint8_t spr);
//! It gets the SF configured.
/*!
It stores in global '_spreadingFactor' variable the current value of SF
\return '0' on success, '1' otherwise
*/
int8_t getSF();
//! It sets the SF.
/*!
It stores in global '_spreadingFactor' variable the current value of SF
\param uint8_t spr : spreading factor value to set in the configuration.
\return '0' on success, '1' otherwise
*/
uint8_t setSF(uint8_t spr);
//! It is true if the BW selected exists.
/*!
\param uint16_t band : bandwidth value to check.
\return 'true' on success, 'false' otherwise
*/
boolean isBW(uint16_t band);
//! It gets the BW configured.
/*!
It stores in global '_bandwidth' variable the BW selected
in the configuration
\return '0' on success, '1' otherwise
*/
int8_t getBW();
//! It sets the BW.
/*!
It stores in global '_bandwidth' variable the BW selected
in the configuration
\param uint16_t band : bandwidth value to set in the configuration.
\return '0' on success, '1' otherwise
*/
int8_t setBW(uint16_t band);
//! It is true if the CR selected exists.
/*!
\param uint8_t cod : the coding rate value to check.
\return 'true' on success, 'false' otherwise
*/
boolean isCR(uint8_t cod);
//! It gets the CR configured.
/*!
It stores in global '_codingRate' variable the CR selected
in the configuration
\return '0' on success, '1' otherwise
*/
int8_t getCR();
//! It sets the CR.
/*!
It stores in global '_codingRate' variable the CR selected
in the configuration
\param uint8_t cod : coding rate value to set in the configuration.
\return '0' on success, '1' otherwise
*/
int8_t setCR(uint8_t cod);
//! It is true if the channel selected exists.
/*!
\param uint32_t ch : frequency channel value to check.
\return 'true' on success, 'false' otherwise
*/
boolean isChannel(uint32_t ch);
//! It gets frequency channel the module is using.
/*!
It stores in global '_channel' variable the frequency channel
\return '0' on success, '1' otherwise
*/
uint8_t getChannel();
//! It sets frequency channel the module is using.
/*!
It stores in global '_channel' variable the frequency channel
\param uint32_t ch : frequency channel value to set in the configuration.
\return '0' on success, '1' otherwise
*/
int8_t setChannel(uint32_t ch);
//! It gets the output power of the signal.
/*!
It stores in global '_power' variable the output power of the signal
\return '0' on success, '1' otherwise
*/
uint8_t getPower();
//! It sets the output power of the signal.
/*!
It stores in global '_power' variable the output power of the signal
\param char p : 'M', 'H' or 'L' if you want Maximum, High or Low
output power signal.
\return '0' on success, '1' otherwise
*/
int8_t setPower(char p);
//! It sets the output power of the signal.
/*!
It stores in global '_power' variable the output power of the signal
\param uint8_t pow : value to set as output power.
\return '0' on success, '1' otherwise
*/
int8_t setPowerNum(uint8_t pow);
//! It gets the preamble length configured.
/*!
It stores in global '_preamblelength' variable the preamble length
\return '0' on success, '1' otherwise
*/
uint8_t getPreambleLength();
//! It sets the preamble length.
/*!
It stores in global '_preamblelength' variable the preamble length
\param uint16_t l : preamble length to set in the configuration.
\return '0' on success, '1' otherwise
*/
uint8_t setPreambleLength(uint16_t l);
//! It gets the payload length of the last packet to send/receive.
/*!
It stores in global '_payloadlength' variable the payload length of
the last packet to send/receive.
\return '0' on success, '1' otherwise
*/
uint8_t getPayloadLength();
//! It sets the packet length to send/receive.
/*!
It stores in global '_payloadlength' variable the payload length of
the last packet to send/receive.
\return '0' on success, '1' otherwise
*/
int8_t setPacketLength();
//! It sets the packet length to send/receive.
/*!
It stores in global '_payloadlength' variable the payload length of
the last packet to send/receive.
\param uint8_t l : payload length to set in the configuration.
\return '0' on success, '1' otherwise
*/
int8_t setPacketLength(uint8_t l);
//! It gets the node address of the mote.
/*!
It stores in global '_nodeAddress' variable the node address
\return '0' on success, '1' otherwise
*/
uint8_t getNodeAddress();
//! It sets the node address of the mote.
/*!
It stores in global '_nodeAddress' variable the node address
\param uint8_t addr : address value to set as node address.
\return '0' on success, '1' otherwise
*/
int8_t setNodeAddress(uint8_t addr);
//! It gets the SNR of the latest received packet.
/*!
It stores in global '_SNR' variable the SNR
\return '0' on success, '1' otherwise
*/
int8_t getSNR();
//! It gets the current value of RSSI.
/*!
It stores in global '_RSSI' variable the current value of RSSI
\return '0' on success, '1' otherwise
*/
uint8_t getRSSI();
//! It gets the RSSI of the latest received packet.
/*!
It stores in global '_RSSIpacket' variable the RSSI of the latest
packet received.
\return '0' on success, '1' otherwise
*/
int16_t getRSSIpacket();
//! It sets the total of retries when a packet is not correctly received.
/*!
It stores in global '_maxRetries' variable the number of retries.
\param uint8_t ret : number of retries.
\return '0' on success, '1' otherwise
*/
uint8_t setRetries(uint8_t ret);
//! It gets the maximum current supply by the module.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t getMaxCurrent();
//! It sets the maximum current supply by the module.
/*!
It stores in global '_maxCurrent' variable the maximum current supply.
\param uint8_t rate : maximum current supply.
\return '0' on success, '1' otherwise
*/
int8_t setMaxCurrent(uint8_t rate);
//! It gets the content of the main configuration registers.
/*!
It stores in global '_bandwidth' variable the BW.
It stores in global '_codingRate' variable the CR.
It stores in global '_spreadingFactor' variable the SF.
It stores in global '_power' variable the output power of the signal.
It stores in global '_channel' variable the frequency channel.
It stores in global '_CRC' variable '1' enabling CRC generation on
payload, or '0' disabling the CRC.
It stores in global '_header' variable '0' when header is sent
(explicit header mode) or '1' when is not sent (implicit header
mode).
It stores in global '_preamblelength' variable the preamble length.
It stores in global '_payloadlength' variable the payload length of
the last packet to send/receive.
It stores in global '_nodeAddress' variable the node address.
It stores in global '_temp' variable the module temperature.
\return '0' on success, '1' otherwise
*/
uint8_t getRegs();
//! It sets the maximum number of bytes from a frame that fit in a packet
//! structure.
/*!
It stores in global '_payloadlength' variable the maximum number of bytes.
\param uint16_t length16 : total frame length.
\return '0' on success, '1' otherwise
*/
uint8_t truncPayload(uint16_t length16);
//! It writes an ACK in FIFO to send it.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t setACK();
//! It puts the module in reception mode.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t receive();
//! It receives a packet before MAX_TIMEOUT.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t <API key>();
//! It receives a packet before a timeout.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t <API key>();
//! It receives a packet before a timeout.
/*!
\param uint32_t wait : time to wait to receive something.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint32_t wait);
//! It receives a packet before MAX_TIMEOUT and reply with an ACK.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t <API key>();
//! It receives a packet before a timeout and reply with an ACK.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t <API key>();
//! It receives a packet before a timeout and reply with an ACK.
/*!
\param uint32_t wait : time to wait to receive something.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint32_t wait);
//! It puts the module in 'promiscuous' reception mode.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t receiveAll();
//! It puts the module in 'promiscuous' reception mode with a timeout.
/*!
\param uint32_t wait : time to wait to receive something.
\return '0' on success, '1' otherwise
*/
uint8_t receiveAll(uint32_t wait);
//! It checks if there is an available packet and its destination.
/*!
*
\return 'true' on success, 'false' otherwise
*/
boolean availableData();
//! It checks if there is an available packet and its destination before a
//! timeout.
/*!
*
\param uint32_t wait : time to wait while there is no a valid header
received.
\return 'true' on success, 'false' otherwise
*/
boolean availableData(uint32_t wait);
//! It writes a packet in FIFO in order to send it.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t setPacket(uint8_t dest, char *payload);
//! It writes a packet in FIFO in order to send it.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload: packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t setPacket(uint8_t dest, uint8_t *payload);
//! It reads a received packet from the FIFO, if it arrives before ending
//! MAX_TIMEOUT time.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t getPacketMAXTimeout();
//! It reads a received packet from the FIFO, if it arrives before ending
//! '_sendTime' time.
/*!
*
\return '0' on success, '1' otherwise
*/
int8_t getPacket();
//! It receives and gets a packet from FIFO, if it arrives before ending
//! 'wait' time.
/*!
*
\param uint32_t wait : time to wait while there is not a complete packet
received.
\return '0' on success, '1' otherwise
*/
int8_t getPacket(uint32_t wait);
//! It sends the packet stored in FIFO before ending MAX_TIMEOUT.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t sendWithMAXTimeout();
//! It sends the packet stored in FIFO before ending _sendTime time.
/*!
*
\return '0' on success, '1' otherwise
*/
uint8_t sendWithTimeout();
//! It tries to send the packet stored in FIFO before ending 'wait' time.
/*!
\param uint32_t wait : time to wait to send the packet.
\return '0' on success, '1' otherwise
*/
uint8_t sendWithTimeout(uint32_t wait);
//! It tries to send the packet which payload is a parameter before ending
//! MAX_TIMEOUT.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>( uint8_t dest,
char *payload);
//! It tries to send the packet which payload is a parameter before ending
//! MAX_TIMEOUT.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload : packet payload.
\param uint16_t length : payload buffer length.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>( uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends the packet which payload is a parameter before ending
//! MAX_TIMEOUT.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t sendPacketTimeout( uint8_t dest,
char *payload);
//! It sends the packet which payload is a parameter before ending
//! MAX_TIMEOUT.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload: packet payload.
\param uint16_t length : payload buffer length.
\return '0' on success, '1' otherwise
*/
uint8_t sendPacketTimeout( uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends the packet which payload is a parameter before ending 'wait'
//! time.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\param uint32_t wait : time to wait.
\return '0' on success, '1' otherwise
*/
uint8_t sendPacketTimeout( uint8_t dest,
char *payload,
uint32_t wait);
//! It sends the packet which payload is a parameter before ending 'wait'
//! time.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload : packet payload.
\param uint16_t length : payload buffer length.
\param uint32_t wait : time to wait.
\return '0' on success, '1' otherwise
*/
uint8_t sendPacketTimeout( uint8_t dest,
uint8_t *payload,
uint16_t length,
uint32_t wait);
//! It sends the packet which payload is a parameter before MAX_TIMEOUT,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>(uint8_t dest,
char *payload);
//! It sends the packet which payload is a parameter before MAX_TIMEOUT,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param uint8_t payload: packet payload.
\param uint16_t length : payload buffer length.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>(uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends the packet which payload is a parameter before a timeout,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>( uint8_t dest,
char *payload);
//! It sends the packet which payload is a parameter before a timeout,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param uint8_t payload: packet payload.
\param uint16_t length : payload buffer length.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>( uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends the packet which payload is a parameter before 'wait' time,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\param uint32_t wait : time to wait to send the packet.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>( uint8_t dest,
char *payload,
uint32_t wait);
//! It sends the packet which payload is a parameter before 'wait' time,
//! and replies with ACK.
/*!
\param uint8_t dest : packet destination.
\param uint8_t payload: packet payload.
\param uint16_t length : payload buffer length.
\param uint32_t wait : time to wait to send the packet.
\return '9' --> The ACK lost (no data available)
'8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t <API key>(uint8_t dest,
uint8_t *payload,
uint16_t length,
uint32_t wait);
//! It sets the destination of a packet.
/*!
\param uint8_t dest : value to set as destination address.
\return '0' on success, '1' otherwise
*/
int8_t setDestination(uint8_t dest);
//! It sets the waiting time to send a packet.
/*!
It stores in global '_sendTime' variable the time for each mode.
\return '0' on success, '1' otherwise
*/
uint8_t setTimeout();
//! It gets the theoretical value of the time-on-air of the packet
float timeOnAir();
float timeOnAir( uint16_t payloadlength );
//! It sets the payload of the packet that is going to be sent.
/*!
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t setPayload(char *payload);
//! It sets the payload of the packet that is going to be sent.
/*!
\param uint8_t payload: packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t setPayload(uint8_t *payload);
//! If an ACK is received, it gets it and checks its content.
/*!
*
\return '8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t getACK();
//! It receives and gets an ACK from FIFO, if it arrives before ending
//! 'wait' time.
/*!
*
\param uint32_t wait : time to wait while there is no an ACK received.
\return '8' --> The ACK lost
'7' --> The ACK destination incorrectly received
'6' --> The ACK source incorrectly received
'5' --> The ACK number incorrectly received
'4' --> The ACK length incorrectly received
'3' --> N-ACK received
'2' --> The ACK has not been received
'1' --> not used (reserved)
'0' --> The ACK has been received with no errors
*/
uint8_t getACK(uint32_t wait);
//! It sends a packet, waits to receive an ACK and updates the _retries
//! value, before ending MAX_TIMEOUT time.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint8_t dest,
char *payload);
//! It sends a packet, waits to receive an ACK and updates the _retries
//! value, before ending MAX_TIMEOUT time.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload : packet payload.
\param uint16_t length : payload buffer length.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>( uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends a packet, waits to receive an ACK and updates the _retries value
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint8_t dest,
char *payload);
//! It sends a packet, waits to receive an ACK and updates the _retries value
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload : packet payload.
\param uint16_t length : payload buffer length.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint8_t dest,
uint8_t *payload,
uint16_t length);
//! It sends a packet, waits to receive an ACK and updates the _retries
//! value, before ending 'wait' time.
/*!
\param uint8_t dest : packet destination.
\param char *payload : packet payload.
\param uint32_t wait : time to wait while trying to send the packet.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint8_t dest,
char *payload,
uint32_t wait);
//! It sends a packet, waits to receive an ACK and updates the _retries
//! value, before ending 'wait' time.
/*!
\param uint8_t dest : packet destination.
\param uint8_t *payload : packet payload.
\param uint16_t length : payload buffer length.
\param uint32_t wait : time to wait while trying to send the packet.
\return '0' on success, '1' otherwise
*/
uint8_t <API key>(uint8_t dest,
uint8_t *payload,
uint16_t length,
uint32_t wait);
//! It gets the internal temperature of the module.
/*!
It stores in global '_temp' variable the module temperature.
\return '0' on success, '1' otherwise
*/
uint8_t getTemp();
//! It prints the registers related to RX via USB
/*!
* \return void
*/
void showRxRegisters();
//! It sets the RTC settings with Meshlium timestamp configuration
/*! This function sends a special Frame to Meshlium (Meshlium's address must
* be '1'), and then Meshlium returns an answer with the timestamp. This
* function parses the info and sets the RTC Time and Date.
* \return 'true' on cad detected, 'false' if not detected
*/
bool cadDetected();
Variables
//! Variable : SD state.
//! st_SD = 00 --> SD_OFF
//! st_SD = 01 --> SD_ON
uint8_t st_SD;
//! Variable : bandwidth configured in LoRa mode.
//! bandwidth = 0000 --> BW = 7.8KHz
//! bandwidth = 0001 --> BW = 10.4KHz
//! bandwidth = 0010 --> BW = 15.6KHz
//! bandwidth = 0011 --> BW = 20.8KHz
//! bandwidth = 0100 --> BW = 31.2KHz
//! bandwidth = 0101 --> BW = 41.7KHz
//! bandwidth = 0110 --> BW = 62.5KHz
//! bandwidth = 0111 --> BW = 125KHz
//! bandwidth = 1000 --> BW = 250KHz
//! bandwidth = 1001 --> BW = 500KHz
uint8_t _bandwidth;
//! Variable : coding rate configured in LoRa mode.
//! codingRate = 001 --> CR = 4/5
//! codingRate = 010 --> CR = 4/6
//! codingRate = 011 --> CR = 4/7
//! codingRate = 100 --> CR = 4/8
uint8_t _codingRate;
//! Variable : spreading factor configured in LoRa mode.
//! spreadingFactor = 6 --> SF = 6, 64 chips/symbol
//! spreadingFactor = 7 --> SF = 7, 128 chips/symbol
//! spreadingFactor = 8 --> SF = 8, 256 chips/symbol
//! spreadingFactor = 9 --> SF = 9, 512 chips/symbol
//! spreadingFactor = 10 --> SF = 10, 1024 chips/symbol
//! spreadingFactor = 11 --> SF = 11, 2048 chips/symbol
//! spreadingFactor = 12 --> SF = 12, 4096 chips/symbol
uint8_t _spreadingFactor;
//! Variable : frequency channel.
//! channel = 0x6b0000 --> CH = 1, 428MHz
//! channel = 0x6b2000 --> CH = 2, 428.5MHz
//! channel = 0x6b4000 --> CH = 3, 429MHz
//! channel = 0x6b6000 --> CH = 4, 429.5MHz
//! channel = 0x6b8000 --> CH = 5, 430MHz
//! channel = 0x6ba000 --> CH = 6, 430.5MHz
//! channel = 0x6bc000 --> CH = 7, 431MHz
//! channel = 0x6be000 --> CH = 8, 431.5MHz
//! channel = 0x6c0000 --> CH = 9, 432MHz
//! channel = 0x6c2000 --> CH = 10, 432.5MHz
//! channel = 0x6c4000 --> CH = 11, 433MHz
//! channel = 0x6c6000 --> CH = 12, 433.5MHz
//! channel = 0x6c8000 --> CH = 13, 434MHz
//! channel = 0x6ca000 --> CH = 14, 434.5MHz
//! channel = 0x6cc000 --> CH = 15, 435MHz
//! channel = 0x6ce000 --> CH = 16, 435.5MHz
//! channel = 0x6d0000 --> CH = 17, 436MHz
//! channel = 0x6d2000 --> CH = 18, 436.5MHz
//! channel = 0x6d4000 --> CH = 19, 437MHz
//! channel = 0x6d6000 --> CH = 20, 437.5MHz
//! channel = 0x6d8000 --> CH = 21, 438MHz
//! channel = 0x6da000 --> CH = 22, 438.5MHz
//! channel = 0x6dc000 --> CH = 23, 439MHz
//! channel = 0x6de000 --> CH = 24, 439.5MHz
uint32_t _channel;
//! Variable : output power.
uint8_t _power;
//! Variable : SNR from the last packet received in LoRa mode.
int8_t _SNR;
//! Variable : RSSI current value.
int8_t _RSSI;
//! Variable : RSSI from the last packet received in LoRa mode.
int16_t _RSSIpacket;
//! Variable : preamble length sent/received.
uint16_t _preamblelength;
//! Variable : payload length sent/received.
uint16_t _payloadlength;
//! Variable : node address.
uint8_t _nodeAddress;
//! Variable : implicit or explicit header in LoRa mode.
uint8_t _header;
//! Variable : header received while waiting a packet to arrive.
uint8_t _hreceived;
//! Variable : presence or absence of CRC calculation.
uint8_t _CRC;
//! Variable : packet destination.
uint8_t _destination;
//! Variable : packet number.
uint8_t _packetNumber;
//! Variable : indicates if received packet is correct or incorrect.
uint8_t _reception;
//! Variable : number of current retry.
uint8_t _retries;
//! Variable : maximum number of retries.
uint8_t _maxRetries;
//! Variable : maximum current supply.
uint8_t _maxCurrent;
//! Variable : indicates FSK or LoRa modem.
uint8_t _modem;
//! Variable : array with all the information about a sent packet.
pack packet_sent;
//! Variable : array with all the information about a received packet.
pack packet_received;
//! Variable : array with all the information about a sent/received ack.
pack ACK;
//! Variable : temperature module.
int _temp;
//! Variable : current timeout to send a packet.
uint16_t _sendTime;
};
extern SX1278 sx1278;
#endif |
package com.example.examplemod;
import net.minecraft.item.ItemArmor;
public class MyBoots extends ItemArmor {
public MyBoots() {
super(MyMaterials.ArmorMaterial, 4, 3);
this.setUnlocalizedName("MyBoots");
this.setTextureName("examplemod" + ":" + "MySword");
}
} |
#ifndef <API key>
#define <API key>
#include <linux/compiler.h> /* unlikely() */
#include <asm/types.h>
static inline int <API key>(const unsigned long *b)
{
#if BITS_PER_LONG == 64
if (b[0])
return __ffs(b[0]);
return __ffs(b[1]) + 64;
#elif BITS_PER_LONG == 32
if (b[0])
return __ffs(b[0]);
if (b[1])
return __ffs(b[1]) + 32;
if (b[2])
return __ffs(b[2]) + 64;
return __ffs(b[3]) + 96;
#else
#error BITS_PER_LONG not defined
#endif
}
#endif /* <API key> */ |
#ifndef _LINUX_INETDEVICE_H
#define _LINUX_INETDEVICE_H
#ifdef __KERNEL__
#include <linux/bitmap.h>
#include <linux/if.h>
#include <linux/netdevice.h>
#include <linux/rcupdate.h>
#include <linux/timer.h>
#include <linux/sysctl.h>
enum
{
<API key>=1,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
IPV4_DEVCONF_TAG,
<API key>,
<API key>,
IPV4_DEVCONF_NOXFRM,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
<API key>,
__IPV4_DEVCONF_MAX
};
struct ipv4_devconf {
void *sysctl;
int data[__IPV4_DEVCONF_MAX - 1];
DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1);
};
struct in_device {
struct net_device *dev;
atomic_t refcnt;
int dead;
struct in_ifaddr *ifa_list; /* IP ifaddr chain */
rwlock_t mc_list_lock;
struct ip_mc_list *mc_list; /* IP multicast filter chain */
int mc_count; /* Number of installed mcasts */
spinlock_t mc_tomb_lock;
struct ip_mc_list *mc_tomb;
unsigned long mr_v1_seen;
unsigned long mr_v2_seen;
unsigned long mr_maxdelay;
unsigned char mr_qrv;
unsigned char mr_gq_running;
unsigned char mr_ifc_count;
struct timer_list mr_gq_timer; /* general query timer */
struct timer_list mr_ifc_timer; /* interface change timer */
struct neigh_parms *arp_parms;
struct ipv4_devconf cnf;
struct rcu_head rcu_head;
};
#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1])
#define IPV4_DEVCONF_ALL(net, attr) \
IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr)
static inline int ipv4_devconf_get(struct in_device *in_dev, int index)
{
index
return in_dev->cnf.data[index];
}
static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
int val)
{
index
set_bit(index, in_dev->cnf.state);
in_dev->cnf.data[index] = val;
}
static inline void ipv4_devconf_setall(struct in_device *in_dev)
{
bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1);
}
#define IN_DEV_CONF_GET(in_dev, attr) \
ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr)
#define IN_DEV_CONF_SET(in_dev, attr, val) \
ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val))
#define IN_DEV_ANDCONF(in_dev, attr) \
(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \
IN_DEV_CONF_GET((in_dev), attr))
#define IN_DEV_ORCONF(in_dev, attr) \
(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \
IN_DEV_CONF_GET((in_dev), attr))
#define IN_DEV_MAXCONF(in_dev, attr) \
(max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \
IN_DEV_CONF_GET((in_dev), attr)))
#define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING)
#define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING)
#define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER)
#define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK)
#define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \
ACCEPT_SOURCE_ROUTE)
#define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL)
#define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY)
#define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS)
#define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP)
#define <API key>(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN)
#define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA)
#define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS)
#define <API key>(in_dev) IN_DEV_ORCONF((in_dev), \
SECURE_REDIRECTS)
#define IN_DEV_IDTAG(in_dev) IN_DEV_CONF_GET(in_dev, TAG)
#define IN_DEV_MEDIUM_ID(in_dev) IN_DEV_CONF_GET(in_dev, MEDIUM_ID)
#define <API key>(in_dev) \
IN_DEV_ORCONF((in_dev), \
PROMOTE_SECONDARIES)
#define IN_DEV_RX_REDIRECTS(in_dev) \
((IN_DEV_FORWARD(in_dev) && \
IN_DEV_ANDCONF((in_dev), ACCEPT_REDIRECTS)) \
|| (!IN_DEV_FORWARD(in_dev) && \
IN_DEV_ORCONF((in_dev), ACCEPT_REDIRECTS)))
#define IN_DEV_ARPFILTER(in_dev) IN_DEV_ORCONF((in_dev), ARPFILTER)
#define IN_DEV_ARP_ANNOUNCE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_ANNOUNCE)
#define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE)
#define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY)
struct in_ifaddr {
struct in_ifaddr *ifa_next;
struct in_device *ifa_dev;
struct rcu_head rcu_head;
__be32 ifa_local;
__be32 ifa_address;
__be32 ifa_mask;
__be32 ifa_broadcast;
unsigned char ifa_scope;
unsigned char ifa_flags;
unsigned char ifa_prefixlen;
char ifa_label[IFNAMSIZ];
};
extern int <API key>(struct notifier_block *nb);
extern int <API key>(struct notifier_block *nb);
extern struct net_device *ip_dev_find(struct net *net, __be32 addr);
extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b);
extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
extern void devinet_init(void);
extern struct in_device *inetdev_by_index(struct net *, int);
extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
extern __be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, int scope);
extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask);
static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
{
return !((addr^ifa->ifa_address)&ifa->ifa_mask);
}
static __inline__ int bad_mask(__be32 mask, __be32 addr)
{
__u32 hmask;
if (addr & (mask = ~mask))
return 1;
hmask = ntohl(mask);
if (hmask & (hmask+1))
return 1;
return 0;
}
#define for_primary_ifa(in_dev) { struct in_ifaddr *ifa; \
for (ifa = (in_dev)->ifa_list; ifa && !(ifa->ifa_flags&IFA_F_SECONDARY); ifa = ifa->ifa_next)
#define for_ifa(in_dev) { struct in_ifaddr *ifa; \
for (ifa = (in_dev)->ifa_list; ifa; ifa = ifa->ifa_next)
#define endfor_ifa(in_dev) }
static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
{
struct in_device *in_dev = dev->ip_ptr;
if (in_dev)
in_dev = rcu_dereference(in_dev);
return in_dev;
}
static __inline__ struct in_device *
in_dev_get(const struct net_device *dev)
{
struct in_device *in_dev;
rcu_read_lock();
in_dev = __in_dev_get_rcu(dev);
if (in_dev)
atomic_inc(&in_dev->refcnt);
rcu_read_unlock();
return in_dev;
}
static __inline__ struct in_device *
__in_dev_get_rtnl(const struct net_device *dev)
{
return (struct in_device*)dev->ip_ptr;
}
extern void <API key>(struct in_device *idev);
static inline void in_dev_put(struct in_device *idev)
{
if (atomic_dec_and_test(&idev->refcnt))
<API key>(idev);
}
#define __in_dev_put(idev) atomic_dec(&(idev)->refcnt)
#define in_dev_hold(idev) atomic_inc(&(idev)->refcnt)
#endif /* __KERNEL__ */
static __inline__ __be32 inet_make_mask(int logmask)
{
if (logmask)
return htonl(~((1<<(32-logmask))-1));
return 0;
}
static __inline__ int inet_mask_len(__be32 mask)
{
__u32 hmask = ntohl(mask);
if (!hmask)
return 0;
return 32 - ffz(~hmask);
}
#endif /* _LINUX_INETDEVICE_H */ |
<!doctype html>
<html lang="en">
<head>
<?php
echo $header;
?>
</head> |
# This program is free software; you can redistribute it and/or modify it under
# published by the Free Software Foundation.
# This program is distributed in the hope that it will be useful, but WITHOUT
# details.
# this program; if not, contact SUSE LLC.
# To contact SUSE about this file by physical or electronic mail, you may find
require "yast"
require "y2packager/resolvable"
module Migration
# Check for possible repository issues in the libzypp products
class RepositoryChecker
include Yast::Logger
# constructor
# @param [Array<Y2Packager::Resolvable>] products list of products
def initialize(products)
@products = products
end
# get list of repositories which provide an obsolete product
# (an upgrade is available for them)
# return [Array<Fixnum>] repositories providing obsolete products
def <API key>
old_repos = <API key>.map(&:source)
# make sure the system repo or invalid values are filtered out
# (related to gh#yast/yast-registration#198)
old_repos.reject! { |r| r < 0 }
# remove (possible) duplicates
old_repos.uniq!
log.info "Found obsolete repositories: #{old_repos}"
old_repos
end
private
attr_accessor :products
# get the available obsolete products
# @return [Array<Y2Packager::Resolvable>] obsolete products
def <API key>
obsolete_products = []
# available or to be installed products
available_products = select_products(:available) + select_products(:selected)
available_products.each do |available_product|
available_products.each do |product|
if product_upgrade?(available_product, product)
obsolete_products << product
end
end
end
obsolete_products
end
# select the products with the specified status
# @param [Symbol] status required status of the products
# @return [Array<Y2Packager::Resolvable>] list of libzypp products
def select_products(status)
products.select { |product| product.status == status }
end
# Does a product upgrade another product?
# @param [Hash] new_product new product
# @param [Hash] old_product old product
# @return [Boolean] true if the new product upgrades the old product
def product_upgrade?(new_product, old_product)
# use Gem::Version internally for a proper version string comparison
# TODO: check also "provides" to handle product renames (should not happen
# in SP migration, but anyway...)
# TODO: use Pkg.CompareVersions()
old_product.name == new_product.name &&
(Gem::Version.new(old_product.version_version) <
Gem::Version.new(new_product.version_version))
end
end
end |
#include <QLayout>
#include "LadspaControl.h"
#include "LadspaControlView.h"
#include "LadspaBase.h"
#include "LedCheckbox.h"
#include "TempoSyncKnob.h"
#include "ToolTip.h"
LadspaControlView::LadspaControlView( QWidget * _parent,
LadspaControl * _ctl ) :
QWidget( _parent ),
ModelView( _ctl, this ),
m_ctl( _ctl )
{
QHBoxLayout * layout = new QHBoxLayout( this );
layout->setMargin( 0 );
layout->setSpacing( 0 );
LedCheckBox * link = NULL;
if( m_ctl->m_link )
{
link = new LedCheckBox( "", this );
link->setModel( &m_ctl->m_linkEnabledModel );
ToolTip::add( link, tr( "Link channels" ) );
layout->addWidget( link );
}
Knob * knb = NULL;
switch( m_ctl->port()->data_type )
{
case TOGGLED:
{
LedCheckBox * toggle = new LedCheckBox(
m_ctl->port()->name, this, QString::null, LedCheckBox::Green );
toggle->setModel( m_ctl->toggledModel() );
layout->addWidget( toggle );
if( link != NULL )
{
setFixedSize( link->width() + toggle->width(),
toggle->height() );
}
else
{
setFixedSize( toggle->width(),
toggle->height() );
}
break;
}
case INTEGER:
case ENUM:
case FLOATING:
knb = new Knob( knobBright_26, this, m_ctl->port()->name );
break;
case TIME:
knb = new TempoSyncKnob( knobBright_26, this, m_ctl->port()->name );
break;
default:
break;
}
if( knb != NULL )
{
if( m_ctl->port()->data_type != TIME )
{
knb->setModel( m_ctl->knobModel() );
}
else
{
knb->setModel( m_ctl->tempoSyncKnobModel() );
}
knb->setLabel( m_ctl->port()->name );
knb->setHintText( tr( "Value:" ), "" );
layout->addWidget( knb );
if( link != NULL )
{
setFixedSize( link->width() + knb->width(),
knb->height() );
}
else
{
setFixedSize( knb->width(), knb->height() );
}
}
}
LadspaControlView::~LadspaControlView()
{
} |
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
/*
Class suffixes (none for default): timeline-left | timeline-right
*/
$doc = JFactory::getDocument();
$doc->addStyleSheet('modules/<API key>/assets/css/k2timeline.css');
?>
<div id="k2latest_timeline_<?php echo $module->id; ?>" class="timeline timeline-<?php echo $moduleclass_sfx; ?>">
<?php if($params->get('itemPreText')): ?>
<p class="modulePretext"><?php echo $params->get('itemPreText'); ?></p>
<div class="clearfix"></div>
<?php endif; ?>
<div class="timeline-breaker">
<time datetime="<?php echo JHtml::_('date', JFactory::getDate(), 'c'); ?>"><?php echo JHtml::_('date', JFactory::getDate(), JText::_('DATE_FORMAT_LC3')) ;?></time>
</div>
<div class="timeline-posts">
<?php require JModuleHelper::getLayoutPath('<API key>', $params->get('getTemplate', 'Default') . DS .'default_ajax');?>
</div>
<div class="clearfix"></div>
<input type="hidden" name="count_<?php echo $module->id; ?>" value="<?php echo $params->get('itemCount', 4); ?>"/>
<div class="timeline_footer">
<a href="#" id="timeline_loadmore_<?php echo $module->id; ?>" class="timeline-more-ajax btn btn-info"><?php echo JText::_('K2TL_VIEW_MORE') ?></a>
<div class="clearfix"></div>
<?php if($params->get('itemCustomLink')): ?>
<a class="moduleCustomLink" href="<?php echo $params->get('itemCustomLinkURL'); ?>" title="<?php echo K2HelperUtilities::cleanHtml($itemCustomLinkTitle); ?>"><?php echo $itemCustomLinkTitle; ?></a>
<?php endif; ?>
</div>
</div>
<script>
(function ($) {
$(document).on('click', '#timeline_loadmore_<?php echo $module->id; ?>', function (e) {
e.preventDefault();
var value = $('input[name=count_<?php echo $module->id; ?>]').val(),
request = {
'option' : 'com_ajax',
'module' : 'k2latest_timeline',
'cmd' : 'load',
'data' : '<?php echo base64_encode($module->title); ?>',
'format' : 'raw',
'limitstart': value,
'Itemid': '<?php echo JFactory::getApplication()->input->get('Itemid'); ?>'
};
$.ajax({
type : 'GET',
data : request,
success: function (response) {
$(response).appendTo($("#k2latest_timeline_<?php echo $module->id; ?> > .timeline-posts"));
$('input[name=count_<?php echo $module->id; ?>]').val($("#k2latest_timeline_<?php echo $module->id; ?> .timeline-item").size());
},
error: function(response) {
var data = '',
obj = $.parseJSON(response.responseText);
for(key in obj){
data = data + ' ' + obj[key] + '<br/>';
}
//console.log(data);
}
});
return false;
});
})(jQuery)
</script> |
from django import forms
from django.contrib import admin
from myproject.brdesigner.models import *
from django.utils.safestring import mark_safe
class BadRacketAdminBase(admin.ModelAdmin):
class Media:
js = (
'brdesigner/js/admin_list_reorder.js',
'brdesigner/js/tinymce/tinymce.min.js',
'brdesigner/js/textareas.js',
)
class SortablePageAdmin(BadRacketAdminBase):
list_display = ["id","name","title","url_pattern","page_type","is_active","display_order"]
list_display_links = ["id"]
list_editable = ["name","title","url_pattern","page_type","is_active","display_order"]
class <API key>(BadRacketAdminBase):
list_display = ["id","display_name","target_page","external_link","is_active","rel","target","display_order"]
list_display_links = ["id"]
list_editable = ["display_name","target_page","external_link","is_active","rel","target","display_order"]
class SortablePageAdmin(BadRacketAdminBase):
list_display = ["id","name","title","url_pattern","page_type","is_active","display_order"]
list_display_links = ["id"]
list_editable = ["name","title","url_pattern","page_type","is_active","display_order"]
class <API key>(BadRacketAdminBase):
list_display = ["id","path","is_local","is_active","display_order"]
list_display_links = ["id"]
list_editable = ["path","is_local","is_active","display_order"]
class <API key>(BadRacketAdminBase):
list_display = ["id","path","is_local","is_active","display_order"]
list_display_links = ["id"]
list_editable = ["path","is_local","is_active","display_order"]
admin.site.register(PageType)
admin.site.register(Page, SortablePageAdmin)
admin.site.register(MenuItem, <API key>)
admin.site.register(BrandImages)
admin.site.register(JsFileLoad, <API key>)
admin.site.register(CssFileLoad, <API key>)
admin.site.register(CssSelector)
admin.site.register(CssSetting)
admin.site.register(GoogleAnalytics) |
<?php
require_once 'lib/IteratorReader.php';
/**
* @category component
* @package olapimport
* @author Michael Martin martin@informatik.uni-leipzig.de
*/
class CsvParser
{
//a constant
const error_character = '\\uFFFD';
/**
* readed csvFile represented ar associated array
* @var array
* @access private
* @author Michael Martin martin@informatik.uni-leipzig.de
*/
private $csvMap;
/**
* This is the constructor.It try to open the csv file.The method throws an exception
* on failure.
*
* @access public
* @param str $fileName The csv file.
* @author Michael Martin martin@informatik.uni-leipzig.de
*
* @throws Exception
*/
public function __construct($fileName = "", $separator = ',', $useHeaders = false ) {
//preventing some limitations
ini_set("max_execution_time","600");
ini_set("memory_limit","1536M");
ini_set("<API key>",TRUE);
//initialising some class attributes
$this->csvMap = array();
//parse Map and check status
$this->csvMap = $this->readCSV($fileName, $separator, $useHeaders);
if( empty ($this->csvMap) )
throw new Exception( 'The file "'.$fileName.'" cannot be readed or is empty.' );
}
/**
* Getter of the CSV Map
*
* @access public
* @return array $csvMap.
*/
public function getParsedFile () {
return $this->csvMap;
}
# Private Functions
/**
* It try to open the csv file.The method throws an exception
*
* @access private
* @param str $fileName The csv file.
*/
private function readCSV($fileName, $separator = ",", $useHeaders = false) {
$csvReader = new <API key>($fileName, $separator) ;
return $csvReader->toArray($useHeaders);
}
# TODO: Maybe these following function could be used in further workflows
// Replaces all byte sequences that need escaping. Characters that can
// remain unencoded in N-Triples are not touched by the regex. The
// replaced sequences are:
// 0x00-0x1F non-printable characters
// 0x22 double quote (")
// 0x5C backslash (\)
// 0x7F non-printable character (Control)
// 0x80-0xBF unexpected continuation byte,
// 0xC0-0xFF first byte of multi-byte character,
// followed by one or more continuation byte (0x80-0xBF)
// The regex accepts multi-byte sequences that don't have the correct
// number of continuation bytes (0x80-0xBF). This is handled by the
// callback.
private function escape( $str ) {
return <API key>(
"/[\\x00-\\x1F\\x22\\x5C\\x7F]|[\\x80-\\xBF]|[\\xC0-\\xFF][\\x80-\\xBF]*/",
array('Transformer','escape_callback'),
$str);
}
private static function escape_callback($matches) {
$encoded_character = $matches[0];
$byte = ord($encoded_character[0]);
// Single-byte characters (0xxxxxxx, hex 00-7E)
if ($byte == 0x09) return "\\t";
if ($byte == 0x0A) return "\\n";
if ($byte == 0x0D) return "\\r";
if ($byte == 0x22) return "\\\"";
if ($byte == 0x5C) return "\\\\";
if ($byte < 0x20 || $byte == 0x7F) {
// encode as \u00XX
return "\\u00" . sprintf("%02X", $byte);
}
// Multi-byte characters
if ($byte < 0xC0) {
// Continuation bytes (0x80-0xBF) are not allowed to appear as first byte
return Transformer::error_character;
}
if ($byte < 0xE0) { // 110xxxxx, hex C0-DF
$bytes = 2;
$codepoint = $byte & 0x1F;
} else if ($byte < 0xF0) {
// 1110xxxx, hex E0-EF
$bytes = 3;
$codepoint = $byte & 0x0F;
} else if ($byte < 0xF8) {
// 11110xxx, hex F0-F7
$bytes = 4;
$codepoint = $byte & 0x07;
} else if ($byte < 0xFC) {
// 111110xx, hex F8-FB
$bytes = 5;
$codepoint = $byte & 0x03;
} else if ($byte < 0xFE) {
// 1111110x, hex FC-FD
$bytes = 6;
$codepoint = $byte & 0x01;
} else {
// 11111110 and 11111111, hex FE-FF, are not allowed
return Transformer::error_character;
}
// Verify correct number of continuation bytes (0x80 to 0xBF)
$length = strlen($encoded_character);
if ($length < $bytes) {
// not enough continuation bytes
return Transformer::error_character;
}
if ($length > $bytes) {
// Too many continuation bytes -- show each as one error
$rest = str_repeat(Transformer::error_character, $length - $bytes);
} else {
$rest = '';
}
// Calculate Unicode codepoints from the bytes
for ($i = 1; $i < $bytes; $i++) {
// Loop over the additional bytes (0x80-0xBF, 10xxxxxx)
// Add their lowest six bits to the end of the codepoint
$byte = ord($encoded_character[$i]);
$codepoint = ($codepoint << 6) | ($byte & 0x3F);
}
// Check for overlong encoding (character is encoded as more bytes than
// necessary, this must be rejected by a safe UTF-8 decoder)
if (($bytes == 2 && $codepoint <= 0x7F) ||
($bytes == 3 && $codepoint <= 0x7FF) ||
($bytes == 4 && $codepoint <= 0xFFFF) ||
($bytes == 5 && $codepoint <= 0x1FFFFF) ||
($bytes == 6 && $codepoint <= 0x3FFFFF)) {
return Transformer::error_character . $rest;
}
// Check for UTF-16 surrogates, which must not be used in UTF-8
if ($codepoint >= 0xD800 && $codepoint <= 0xDFFF) {
return Transformer::error_character . $rest;
}
if ($codepoint == 0xFFFE || $codepoint == 0xFFFF) {
return Transformer::error_character . $rest;
}
if ($codepoint <= 0xFFFF) {
// 0x0100-0xFFFF, encode as \uXXXX
return "\\u" . sprintf("%04X", $codepoint) . $rest;
}
if ($codepoint <= 0x10FFFF) {
// 0x10000-0x10FFFF, encode as \UXXXXXXXX
return "\\U" . sprintf("%08X", $codepoint) . $rest;
}
// Unicode codepoint above 0x10FFFF, no characters have been assigned
// to those codepoints
return Transformer::error_character . $rest;
}
}
?> |
namespace NoIP.DDNS
{
<summary>
List of host(s) update statuses.
</summary>
public enum UpdateStatus
{
<summary>
Host(s) were already set to specified IP address.
</summary>
IpCurrent,
<summary>
Host(s) have been successfully updated to the new IP address.
</summary>
Success,
<summary>
A host(s) were not found.
</summary>
<API key>,
<summary>
Client Key was incorrect.
</summary>
InvalidPassword, //Invalid Login
<summary>
Client ID was incorrect.
</summary>
InvalidUserName, //Invalid Login
<summary>
The host has been updated too many times for a given time period.
</summary>
TooManyUpdates,
<summary>
Account has been disabled.
</summary>
AccountDisabled, //Authentication
<summary>
An IP address(es) were invalid
</summary>
InvalidIp,
<summary>
Disabled.
</summary>
Disabled,
<summary>
The host redirect was updated.
</summary>
HostRedirectUpdated,
<summary>
The group(s) do not exist.
</summary>
<API key>,
<summary>
The group(s) were successfully updated.
</summary>
GroupUpdateSuccess,
<summary>
The group(s) address was already set to specified IP address.
</summary>
GroupIsCurrent,
<summary>
Update client is not supported.
</summary>
<API key>,
<summary>
Host name offline is not configured.
</summary>
<API key>,
<summary>
The client ID has been temporarily disabled.
</summary>
<API key> = 98, //Authentication
<summary>
The client ID has been permanently disabled.
</summary>
ClientDisabled = 99, //Authentication
<summary>
General input error.
</summary>
InputError = 100,
<summary>
General IP address error.
</summary>
<API key> = 50000,
}
} |
/* Sunday 19th of April 2015 07:18:15 AM*/
div#<API key> .<API key>.<API key> {
z-index: 3;
}
div#<API key> .<API key>.<API key> {
z-index: 2;
}
div#<API key> .<API key>.<API key> {
z-index: 2;
opacity: 1;
}
div#<API key> .<API key>.<API key> {
z-index: 3;
opacity: 1;
}
div#<API key> {
margin: 0px 0px 0px 0px;
position: relative;
}
div#<API key> * {
font-size: inherit;
line-height: inherit;
}
div#<API key> *,
div#<API key> *:before,
div#<API key> *:after {
-moz-box-sizing: content-box;
box-sizing: content-box;
}
div#<API key>.<API key> {
position: absolute;
opacity: 0;
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
}
div#<API key>.<API key>.nextend-loaded {
opacity: 1;
position: relative;
}
div#<API key> a,
div#<API key> a:focus {
outline: none !important;
}
div#<API key> h1,
div#<API key> h2,
div#<API key> h3,
div#<API key> h4,
div#<API key> h5,
div#<API key> h6,
div#<API key> p {
margin: 0;
padding-left: 0;
padding-right: 0;
height: auto;
width: auto;
border: 0;
box-shadow: none;
}
div#<API key> img {
box-shadow: none;
-<API key>: 0;
-moz-border-radius: 0;
border-radius: 0;
background: transparent;
background: none;
padding: 0;
margin: 0;
border: 0;
}
div#<API key> .smart-slider-canvas {
position: relative;
}
div#<API key> .smart-slider-canvas,
div#<API key> .smart-slider-layer {
overflow: hidden !important;
}
div#<API key> .<API key> {
position: relative;
width: 100%;
height: 100%;
}
div#<API key> .sliderfont1 {
color: #ffffff;font-size:320%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont1 a,
div#<API key> .sliderfont1 a:LINK,
div#<API key> .sliderfont1 a:VISITED,
div#<API key> .sliderfont1 a:FOCUS,
div#<API key> .sliderfont1 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont1 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont2 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:320%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont2 a,
div#<API key> .sliderfont2 a:LINK,
div#<API key> .sliderfont2 a:VISITED,
div#<API key> .sliderfont2 a:FOCUS,
div#<API key> .sliderfont2 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont2 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont3 {
color: #ffffff;font-size:170%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont3 a,
div#<API key> .sliderfont3 a:LINK,
div#<API key> .sliderfont3 a:VISITED,
div#<API key> .sliderfont3 a:FOCUS,
div#<API key> .sliderfont3 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont3 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont4 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:170%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont4 a,
div#<API key> .sliderfont4 a:LINK,
div#<API key> .sliderfont4 a:VISITED,
div#<API key> .sliderfont4 a:FOCUS,
div#<API key> .sliderfont4 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont4 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont5 {
color: #ffffff;font-size:114%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont5 a,
div#<API key> .sliderfont5 a:LINK,
div#<API key> .sliderfont5 a:VISITED,
div#<API key> .sliderfont5 a:FOCUS,
div#<API key> .sliderfont5 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont5 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont6 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:114%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont6 a,
div#<API key> .sliderfont6 a:LINK,
div#<API key> .sliderfont6 a:VISITED,
div#<API key> .sliderfont6 a:FOCUS,
div#<API key> .sliderfont6 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont6 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont7 {
color: #ffffff;font-size:90%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont7 a,
div#<API key> .sliderfont7 a:LINK,
div#<API key> .sliderfont7 a:VISITED,
div#<API key> .sliderfont7 a:FOCUS,
div#<API key> .sliderfont7 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont7 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont8 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:90%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.1;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont8 a,
div#<API key> .sliderfont8 a:LINK,
div#<API key> .sliderfont8 a:VISITED,
div#<API key> .sliderfont8 a:FOCUS,
div#<API key> .sliderfont8 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.1;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont8 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.1;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont9 {
color: #ffffff;font-size:140%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont9 a,
div#<API key> .sliderfont9 a:LINK,
div#<API key> .sliderfont9 a:VISITED,
div#<API key> .sliderfont9 a:FOCUS,
div#<API key> .sliderfont9 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont9 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont10 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:140%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont10 a,
div#<API key> .sliderfont10 a:LINK,
div#<API key> .sliderfont10 a:VISITED,
div#<API key> .sliderfont10 a:FOCUS,
div#<API key> .sliderfont10 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont10 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Pacifico',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont11 {
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont11 a,
div#<API key> .sliderfont11 a:LINK,
div#<API key> .sliderfont11 a:VISITED,
div#<API key> .sliderfont11 a:FOCUS,
div#<API key> .sliderfont11 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont11 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: 0px 1px 1px RGBA(0,0,0,0.78);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont12 {
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont12 a,
div#<API key> .sliderfont12 a:LINK,
div#<API key> .sliderfont12 a:VISITED,
div#<API key> .sliderfont12 a:FOCUS,
div#<API key> .sliderfont12 a:ACTIVE {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfont12 a:HOVER {
background: none;
color: #000000;color: RGBA(0,0,0,0.86);font-size:100%;text-shadow: 0px 1px 0px RGBA(255,255,255,0.2);font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom5 {
color: #6b6b6b;font-size:220%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom5 a,
div#<API key> .sliderfontcustom5 a:LINK,
div#<API key> .sliderfontcustom5 a:VISITED,
div#<API key> .sliderfontcustom5 a:FOCUS,
div#<API key> .sliderfontcustom5 a:ACTIVE {
background: none;
color: #87d2ce;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom5 a:HOVER {
background: none;
color: #82c7c3;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom6 {
color: #878787;font-size:140%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom6 a,
div#<API key> .sliderfontcustom6 a:LINK,
div#<API key> .sliderfontcustom6 a:VISITED,
div#<API key> .sliderfontcustom6 a:FOCUS,
div#<API key> .sliderfontcustom6 a:ACTIVE {
background: none;
color: #878787;font-size:100%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom6 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom7 {
color: #a7a7a7;font-size:130%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom7 a,
div#<API key> .sliderfontcustom7 a:LINK,
div#<API key> .sliderfontcustom7 a:VISITED,
div#<API key> .sliderfontcustom7 a:FOCUS,
div#<API key> .sliderfontcustom7 a:ACTIVE {
background: none;
color: #69bdb9;color: RGBA(105,189,185,0.7);font-size:100%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom7 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Average',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom8 {
color: #6cc8c3;font-size:110%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom8 a,
div#<API key> .sliderfontcustom8 a:LINK,
div#<API key> .sliderfontcustom8 a:VISITED,
div#<API key> .sliderfontcustom8 a:FOCUS,
div#<API key> .sliderfontcustom8 a:ACTIVE {
background: none;
color: #6cc8c3;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom8 a:HOVER {
background: none;
color: #ffffff;color: RGBA(255,255,255,0.92);font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom9 {
color: #6b6b6b;font-size:220%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom9 a,
div#<API key> .sliderfontcustom9 a:LINK,
div#<API key> .sliderfontcustom9 a:VISITED,
div#<API key> .sliderfontcustom9 a:FOCUS,
div#<API key> .sliderfontcustom9 a:ACTIVE {
background: none;
color: #87d2ce;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom9 a:HOVER {
background: none;
color: #82c7c3;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom10 {
color: #aaaaaa;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom10 a,
div#<API key> .sliderfontcustom10 a:LINK,
div#<API key> .sliderfontcustom10 a:VISITED,
div#<API key> .sliderfontcustom10 a:FOCUS,
div#<API key> .sliderfontcustom10 a:ACTIVE {
background: none;
color: #aaaaaa;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom10 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom11 {
color: #a7a7a7;font-size:110%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom11 a,
div#<API key> .sliderfontcustom11 a:LINK,
div#<API key> .sliderfontcustom11 a:VISITED,
div#<API key> .sliderfontcustom11 a:FOCUS,
div#<API key> .sliderfontcustom11 a:ACTIVE {
background: none;
color: #69bdb9;color: RGBA(105,189,185,0.7);font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom11 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom12 {
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom12 a,
div#<API key> .sliderfontcustom12 a:LINK,
div#<API key> .sliderfontcustom12 a:VISITED,
div#<API key> .sliderfontcustom12 a:FOCUS,
div#<API key> .sliderfontcustom12 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom12 a:HOVER {
background: none;
color: #ffffff;color: RGBA(255,255,255,0.92);font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.5;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom13 {
color: #ffffff;font-size:220%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom13 a,
div#<API key> .sliderfontcustom13 a:LINK,
div#<API key> .sliderfontcustom13 a:VISITED,
div#<API key> .sliderfontcustom13 a:FOCUS,
div#<API key> .sliderfontcustom13 a:ACTIVE {
background: none;
color: #ffffff;color: RGBA(255,255,255,0.93);font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom13 a:HOVER {
background: none;
color: #82c7c3;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom14 {
color: #ffffff;color: RGBA(255,255,255,0.77);font-size:110%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom14 a,
div#<API key> .sliderfontcustom14 a:LINK,
div#<API key> .sliderfontcustom14 a:VISITED,
div#<API key> .sliderfontcustom14 a:FOCUS,
div#<API key> .sliderfontcustom14 a:ACTIVE {
background: none;
color: #69bdb9;color: RGBA(105,189,185,0.7);font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom14 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom15 {
color: #ffffff;font-size:270%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom15 a,
div#<API key> .sliderfontcustom15 a:LINK,
div#<API key> .sliderfontcustom15 a:VISITED,
div#<API key> .sliderfontcustom15 a:FOCUS,
div#<API key> .sliderfontcustom15 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom15 a:HOVER {
background: none;
color: #82c7c3;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.3;font-weight: bold;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom16 {
color: #ffffff;color: RGBA(255,255,255,0.77);font-size:120%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom16 a,
div#<API key> .sliderfontcustom16 a:LINK,
div#<API key> .sliderfontcustom16 a:VISITED,
div#<API key> .sliderfontcustom16 a:FOCUS,
div#<API key> .sliderfontcustom16 a:ACTIVE {
background: none;
color: #69bdb9;color: RGBA(105,189,185,0.7);font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom16 a:HOVER {
background: none;
color: #69bdb9;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: center;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom17 {
color: #435664;font-size:240%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom17 a,
div#<API key> .sliderfontcustom17 a:LINK,
div#<API key> .sliderfontcustom17 a:VISITED,
div#<API key> .sliderfontcustom17 a:FOCUS,
div#<API key> .sliderfontcustom17 a:ACTIVE {
background: none;
color: #435664;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom17 a:HOVER {
background: none;
color: #8e44ad;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom18 {
color: #607280;font-size:130%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom18 a,
div#<API key> .sliderfontcustom18 a:LINK,
div#<API key> .sliderfontcustom18 a:VISITED,
div#<API key> .sliderfontcustom18 a:FOCUS,
div#<API key> .sliderfontcustom18 a:ACTIVE {
background: none;
color: #435664;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom18 a:HOVER {
background: none;
color: #8e44ad;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom19 {
color: #8f959d;color: RGBA(143,149,157,0.91);font-size:110%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom19 a,
div#<API key> .sliderfontcustom19 a:LINK,
div#<API key> .sliderfontcustom19 a:VISITED,
div#<API key> .sliderfontcustom19 a:FOCUS,
div#<API key> .sliderfontcustom19 a:ACTIVE {
background: none;
color: #435664;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom19 a:HOVER {
background: none;
color: #8e44ad;font-size:100%;text-shadow: none;font-family: 'Open Sans',Arial;line-height: 1.4;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom20 {
color: #8e44ad;font-size:240%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom20 a,
div#<API key> .sliderfontcustom20 a:LINK,
div#<API key> .sliderfontcustom20 a:VISITED,
div#<API key> .sliderfontcustom20 a:FOCUS,
div#<API key> .sliderfontcustom20 a:ACTIVE {
background: none;
color: #435664;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom20 a:HOVER {
background: none;
color: #7f3c9c;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom21 {
color: #b470a2;font-size:170%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom21 a,
div#<API key> .sliderfontcustom21 a:LINK,
div#<API key> .sliderfontcustom21 a:VISITED,
div#<API key> .sliderfontcustom21 a:FOCUS,
div#<API key> .sliderfontcustom21 a:ACTIVE {
background: none;
color: #b470a2;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom21 a:HOVER {
background: none;
color: #f58700;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom22 {
color: #8e44ad;font-size:160%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom22 a,
div#<API key> .sliderfontcustom22 a:LINK,
div#<API key> .sliderfontcustom22 a:VISITED,
div#<API key> .sliderfontcustom22 a:FOCUS,
div#<API key> .sliderfontcustom22 a:ACTIVE {
background: none;
color: #435664;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom22 a:HOVER {
background: none;
color: #7f3c9c;font-size:100%;text-shadow: none;font-family: 'Montserrat',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom23 {
color: #999999;font-size:110%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom23 a,
div#<API key> .sliderfontcustom23 a:LINK,
div#<API key> .sliderfontcustom23 a:VISITED,
div#<API key> .sliderfontcustom23 a:FOCUS,
div#<API key> .sliderfontcustom23 a:ACTIVE {
background: none;
color: #999999;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom23 a:HOVER {
background: none;
color: #f58700;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.6;font-weight: normal;font-style: normal;text-decoration: none;text-align: justify;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom24 {
color: #b470a2;font-size:260%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom24 a,
div#<API key> .sliderfontcustom24 a:LINK,
div#<API key> .sliderfontcustom24 a:VISITED,
div#<API key> .sliderfontcustom24 a:FOCUS,
div#<API key> .sliderfontcustom24 a:ACTIVE {
background: none;
color: #b470a2;font-size:100%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom24 a:HOVER {
background: none;
color: #b470a2;font-size:100%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.5;font-weight: bold;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom25 {
color: #8a8a8a;font-size:110%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom25 a,
div#<API key> .sliderfontcustom25 a:LINK,
div#<API key> .sliderfontcustom25 a:VISITED,
div#<API key> .sliderfontcustom25 a:FOCUS,
div#<API key> .sliderfontcustom25 a:ACTIVE {
background: none;
color: #8a8a8a;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom25 a:HOVER {
background: none;
color: #f58700;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom26 {
color: #ffffff;font-size:260%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom26 a,
div#<API key> .sliderfontcustom26 a:LINK,
div#<API key> .sliderfontcustom26 a:VISITED,
div#<API key> .sliderfontcustom26 a:FOCUS,
div#<API key> .sliderfontcustom26 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom26 a:HOVER {
background: none;
color: #ffffff;color: RGBA(255,255,255,0.85);font-size:100%;text-shadow: none;font-family: 'Raleway',Arial;line-height: 1.3;font-weight: normal;font-style: normal;text-decoration: none;text-align: left;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom27 {
color: #ffffff;font-size:380%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom27 a,
div#<API key> .sliderfontcustom27 a:LINK,
div#<API key> .sliderfontcustom27 a:VISITED,
div#<API key> .sliderfontcustom27 a:FOCUS,
div#<API key> .sliderfontcustom27 a:ACTIVE {
background: none;
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .sliderfontcustom27 a:HOVER {
background: none;
color: #ffffff;font-size:100%;text-shadow: none;font-family: 'Bebas',Arial;line-height: 1.2;font-weight: normal;font-style: normal;text-decoration: none;text-align: right;-moz-transition: padding-left 0.4s ease;-webkit-transition: padding-left 0.4s ease;-o-transition: padding-left 0.4s ease;transition: padding-left 0.4s ease;padding-left: 0px;
}
div#<API key> .nextend-widget {
display: none;
-<API key>: hidden;
-webkit-perspective: 1;
}
div#<API key>.nextend-desktop .<API key>,
div#<API key>.nextend-tablet .<API key>,
div#<API key>.nextend-phone .<API key> {
display: block;
}
div#<API key> .<API key> {
-webkit-transform: translate3d(0,0,0);
}
div#<API key> .<API key> {
visibility: hidden;
opacity: 0;
-webkit-transition: opacity 0.4s ease;
-moz-transition: opacity 0.4s ease;
-o-transition: opacity 0.4s ease;
transition: opacity 0.4s ease;
}
div#<API key>.<API key> .<API key> {
opacity: 1;
}
div#<API key> .smart-slider-canvas .nextend-slide-bg {
position: absolute;
top: 0;
left: 0;
width: 100%;
max-width: none !important;
height: auto;
background: rgba(0,0,0,0.002);
}
div#<API key> {
width: 900px;
height: 550px;
float: left;
}
.x-rtl div#<API key> {
float: right;
}
div#<API key> .<API key> {
position: relative;
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
padding-left: 0px;
height: 550px;
overflow: hidden;
border-style: solid;
border-width: 0px;
border-color: #3E3E3E;
border-color: RGBA(62,62,62,1);
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
-moz-background-clip: padding-box;
-<API key>: padding-box;
background-clip: padding-box;
background-repeat: repeat;
background-position: 0 0;
background-size: auto;
}
div#<API key> .<API key> {
position: relative;
width: 100%;
height: 100%;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
-<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
<API key>: 0px;
-moz-background-clip: padding-box;
-<API key>: padding-box;
background-clip: padding-box;
overflow: hidden;
}
.x-firefox div#<API key> .<API key> {
opacity: 0.99999;
}
div#<API key> .smart-slider-canvas {
position: absolute;
top: 0;
left: 0;
width: 900px;
height: 550px;
z-index: 2;
display: block;
-<API key>: hidden;
}
div#<API key> .<API key> {
position: relative;
width: 900px;
height: 550px;
}
div#<API key> .<API key> {
z-index: 3;
}
div#<API key> .smart-slider-layer {
position: absolute;
}
div#<API key> .nextend-flux {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
div#<API key> .nextend-flux img {
max-width: none !important;
opacity: 0.999;
}
div#<API key> .current {
border: 0;
padding: 0;
} |
#ifndef <API key>
#define <API key>
#include "Define.h"
#include "ObjectRegistry.h"
#include "FactoryHolder.h"
#include "Common.h"
#include "MotionMaster.h"
class Unit;
class TC_GAME_API MovementGenerator
{
public:
virtual ~MovementGenerator();
virtual void Initialize(Unit*) = 0;
virtual void Finalize(Unit*) = 0;
virtual void Reset(Unit*) = 0;
virtual bool Update(Unit*, uint32 time_diff) = 0;
virtual <API key> <API key>() const = 0;
virtual void unitSpeedChanged() { }
// used by Evade code for select point to evade with expected restart default movement
virtual bool GetResetPosition(Unit*, float& , float& , float& ) { return false; }
};
template<class T, class D>
class <API key> : public MovementGenerator
{
public:
void Initialize(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoInitialize(static_cast<T*>(u));
}
void Finalize(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoFinalize(static_cast<T*>(u));
}
void Reset(Unit* u) override
{
//u->AssertIsType<T>();
(static_cast<D*>(this))->DoReset(static_cast<T*>(u));
}
bool Update(Unit* u, uint32 time_diff) override
{
//u->AssertIsType<T>();
return (static_cast<D*>(this))->DoUpdate(static_cast<T*>(u), time_diff);
}
};
struct SelectableMovement : public FactoryHolder<MovementGenerator, <API key>>
{
SelectableMovement(<API key> mgt) : FactoryHolder<MovementGenerator, <API key>>(mgt) { }
};
template<class REAL_MOVEMENT>
struct <API key> : public SelectableMovement
{
<API key>(<API key> mgt) : SelectableMovement(mgt) { }
MovementGenerator* Create(void *) const override;
};
typedef FactoryHolder<MovementGenerator, <API key>> <API key>;
typedef FactoryHolder<MovementGenerator, <API key>>::<API key> <API key>;
#endif |
<?php
namespace PHPExiftool\Driver\Tag\DICOM;
use PHPExiftool\Driver\AbstractTag;
class <API key> extends AbstractTag
{
protected $Id = '2130,00C0';
protected $Name = '<API key>';
protected $FullName = 'DICOM::Main';
protected $GroupName = 'DICOM';
protected $g0 = 'DICOM';
protected $g1 = 'DICOM';
protected $g2 = 'Image';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'Original Image Sequence';
} |
@extends('master')
@section('title')
Edit Profile
@endsection
@section('content-header')
<div>
Edit Profile
</div>
@endsection
@section('content')
<div class="row">
<div class="col-md-6 col-sm-12">
@if (Session::has('updated'))
<div class="alert alert-success">
<span>Your account has been updated!</span>
</div>
@endif
<div class="box box-solid box-info">
<div class="box-header with-border">
<h3 class="box-title">Edit this user</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
{!! Form::model($user, ['url' => route('admin.my.update', $user->id), 'class' => 'form-group', 'method' => 'PUT']) !!}
@if (count($errors))
<div class="col-md-12 alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
<div class="box-body">
<div class="form-group">
<label for="name">Name</label>
{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => "Enter name"]) !!}
</div>
<div class="form-group">
<label for="password">Password</label>
{!! Form::password('password', ['class' => 'form-control', 'placeholder' => "Enter password"]) !!}
</div>
<div class="form-group">
<label for="confirm_password">Confirm Password</label>
{!! Form::password('confirm_password', ['class' => 'form-control', 'placeholder' => "Confirm password"]) !!}
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<button type="submit" class="btn btn-info">Add</button>
</div>
{!! Form::close() !!}
</div>
<!-- /.box -->
</div>
</div>
@endsection
@section('more-script')
@endsection |
#include <cerrno>
#include <unistd.h>
#include <sys/epoll.h>
#include <system_error>
#include "poller.hh"
using namespace std;
Poller::Poller() : fds(), epoll_fd(-1) {
if ((epoll_fd=epoll_create1(EPOLL_CLOEXEC))==-1)
throw system_error(errno, system_category());
}
Poller::~Poller() {
close(epoll_fd);
}
void Poller::add_to_epoll(shared_ptr<Pollee> pollee) {
epoll_event ev;
ev.events=EPOLLIN;
ev.data.ptr=pollee.get();
if (epoll_ctl(epoll_fd, EPOLL_CTL_ADD, pollee->fd(), &ev)==-1)
if (errno!=EEXIST)
throw system_error(errno, system_category());
}
void Poller::remove_from_epoll(shared_ptr<Pollee> pollee) {
if (epoll_ctl(epoll_fd, EPOLL_CTL_DEL, pollee->fd(), nullptr)==-1)
if (errno!=ENOENT)
throw system_error(errno, system_category());
}
void Poller::runForever() {
while (!empty())
runOnce();
}
int Poller::runOnce(int timeout) {
if (empty())
return 0;
epoll_event events[10];
int event_count, i;
if ((event_count=epoll_wait(epoll_fd, events, 10, timeout))==-1)
throw system_error(errno, system_category());
for (i=0; i<event_count; i++) {
auto p = reinterpret_cast<Pollee*>(events[i].data.ptr);
p->update();
}
return event_count;
} |
#include <linux/err.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/fixed.h>
#include <linux/gpio.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regulator/machine.h>
struct fixed_voltage_data {
struct regulator_desc desc;
struct regulator_dev *dev;
int microvolts;
};
/**
* <API key> - extract <API key> structure info
* @dev: device requesting for <API key>
*
* Populates <API key> structure by extracting data from device
* tree node, returns a pointer to the populated structure of NULL if memory
* alloc fails.
*/
static struct <API key> *
<API key>(struct device *dev)
{
struct <API key> *config;
struct device_node *np = dev->of_node;
const __be32 *delay;
struct regulator_init_data *init_data;
config = devm_kzalloc(dev, sizeof(struct <API key>),
GFP_KERNEL);
if (!config)
return ERR_PTR(-ENOMEM);
config->init_data = <API key>(dev, dev->of_node);
if (!config->init_data)
return ERR_PTR(-EINVAL);
init_data = config->init_data;
init_data->constraints.apply_uV = 0;
config->supply_name = init_data->constraints.name;
if (init_data->constraints.min_uV == init_data->constraints.max_uV) {
config->microvolts = init_data->constraints.min_uV;
} else {
dev_err(dev,
"Fixed regulator specified with variable voltages\n");
return ERR_PTR(-EINVAL);
}
if (init_data->constraints.boot_on)
config->enabled_at_boot = true;
config->gpio = of_get_named_gpio(np, "gpio", 0);
/*
* of_get_named_gpio() currently returns ENODEV rather than
* EPROBE_DEFER. This code attempts to be compatible with both
* for now; the ENODEV check can be removed once the API is fixed.
* of_get_named_gpio() doesn't differentiate between a missing
* property (which would be fine here, since the GPIO is optional)
* and some other error. Patches have been posted for both issues.
* Once they are check in, we should replace this with:
* if (config->gpio < 0 && config->gpio != -ENOENT)
*/
if ((config->gpio == -ENODEV) || (config->gpio == -EPROBE_DEFER))
return ERR_PTR(-EPROBE_DEFER);
delay = of_get_property(np, "startup-delay-us", NULL);
if (delay)
config->startup_delay = be32_to_cpu(*delay);
if (of_find_property(np, "enable-active-high", NULL))
config->enable_high = true;
if (of_find_property(np, "gpio-open-drain", NULL))
config->gpio_is_open_drain = true;
if (of_find_property(np, "vin-supply", NULL))
config->input_supply = "vin";
return config;
}
static int <API key>(struct regulator_dev *dev)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
if (data->microvolts)
return data->microvolts;
else
return -EINVAL;
}
static int <API key>(struct regulator_dev *dev,
unsigned selector)
{
struct fixed_voltage_data *data = rdev_get_drvdata(dev);
if (selector != 0)
return -EINVAL;
return data->microvolts;
}
static struct regulator_ops fixed_voltage_ops = {
.get_voltage = <API key>,
.list_voltage = <API key>,
};
static int <API key>(struct platform_device *pdev)
{
struct <API key> *config;
struct fixed_voltage_data *drvdata;
struct regulator_config cfg = { };
int ret;
if (pdev->dev.of_node) {
config = <API key>(&pdev->dev);
if (IS_ERR(config))
return PTR_ERR(config);
} else {
config = pdev->dev.platform_data;
}
if (!config)
return -ENOMEM;
drvdata = devm_kzalloc(&pdev->dev, sizeof(struct fixed_voltage_data),
GFP_KERNEL);
if (drvdata == NULL) {
dev_err(&pdev->dev, "Failed to allocate device data\n");
ret = -ENOMEM;
goto err;
}
drvdata->desc.name = kstrdup(config->supply_name, GFP_KERNEL);
if (drvdata->desc.name == NULL) {
dev_err(&pdev->dev, "Failed to allocate supply name\n");
ret = -ENOMEM;
goto err;
}
drvdata->desc.type = REGULATOR_VOLTAGE;
drvdata->desc.owner = THIS_MODULE;
drvdata->desc.ops = &fixed_voltage_ops;
drvdata->desc.enable_time = config->startup_delay;
if (config->input_supply) {
drvdata->desc.supply_name = kstrdup(config->input_supply,
GFP_KERNEL);
if (!drvdata->desc.supply_name) {
dev_err(&pdev->dev,
"Failed to allocate input supply\n");
ret = -ENOMEM;
goto err_name;
}
}
if (config->microvolts)
drvdata->desc.n_voltages = 1;
drvdata->microvolts = config->microvolts;
if (config->gpio >= 0)
cfg.ena_gpio = config->gpio;
cfg.ena_gpio_invert = !config->enable_high;
if (config->enabled_at_boot) {
if (config->enable_high) {
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;
} else {
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_LOW;
}
} else {
if (config->enable_high) {
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_LOW;
} else {
cfg.ena_gpio_flags |= GPIOF_OUT_INIT_HIGH;
}
}
if (config->gpio_is_open_drain)
cfg.ena_gpio_flags |= GPIOF_OPEN_DRAIN;
cfg.dev = &pdev->dev;
cfg.init_data = config->init_data;
cfg.driver_data = drvdata;
cfg.of_node = pdev->dev.of_node;
drvdata->dev = regulator_register(&drvdata->desc, &cfg);
if (IS_ERR(drvdata->dev)) {
ret = PTR_ERR(drvdata->dev);
dev_err(&pdev->dev, "Failed to register regulator: %d\n", ret);
goto err_input;
}
<API key>(pdev, drvdata);
dev_dbg(&pdev->dev, "%s supplying %duV\n", drvdata->desc.name,
drvdata->microvolts);
return 0;
err_input:
kfree(drvdata->desc.supply_name);
err_name:
kfree(drvdata->desc.name);
err:
return ret;
}
static int <API key>(struct platform_device *pdev)
{
struct fixed_voltage_data *drvdata = <API key>(pdev);
<API key>(drvdata->dev);
kfree(drvdata->desc.supply_name);
kfree(drvdata->desc.name);
return 0;
}
#if defined(CONFIG_OF)
static const struct of_device_id fixed_of_match[] = {
{ .compatible = "regulator-fixed", },
{},
};
MODULE_DEVICE_TABLE(of, fixed_of_match);
#endif
static struct platform_driver <API key> = {
.probe = <API key>,
.remove = <API key>,
.driver = {
.name = "reg-fixed-voltage",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(fixed_of_match),
},
};
static int __init <API key>(void)
{
return <API key>(&<API key>);
}
subsys_initcall(<API key>);
static void __exit <API key>(void)
{
<API key>(&<API key>);
}
module_exit(<API key>);
MODULE_AUTHOR("Mark Brown <broonie@opensource.wolfsonmicro.com>");
MODULE_DESCRIPTION("Fixed voltage regulator");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:reg-fixed-voltage"); |
#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
#include "win.h"
#ifdef __CYGWIN__
#include <sys/cygwin.h>
#endif
#include <shellapi.h>
#include "winprefs.h"
/*
* References to external globals
*/
#ifdef XWIN_CLIPBOARD
extern Bool g_fClipboardStarted;
#endif
/*
* Local function prototypes
*/
static wBOOL CALLBACK
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
static wBOOL CALLBACK
<API key>(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
static wBOOL CALLBACK
winAboutDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
static void
winDrawURLWindow(LPARAM lParam);
static LRESULT CALLBACK
winURLWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static void
<API key>(HWND hdlg, int id);
static void
<API key>(HWND hdlg, int id);
/*
* Owner-draw a button as a URL
*/
static void
winDrawURLWindow(LPARAM lParam)
{
DRAWITEMSTRUCT *draw;
char str[256];
RECT rect;
HFONT font;
COLORREF crText;
draw = (DRAWITEMSTRUCT *) lParam;
GetWindowText(draw->hwndItem, str, sizeof(str));
str[255] = 0;
GetClientRect(draw->hwndItem, &rect);
/* Color the button depending upon its state */
if (draw->itemState & ODS_SELECTED)
crText = RGB(128 + 64, 0, 0);
else if (draw->itemState & ODS_FOCUS)
crText = RGB(0, 128 + 64, 0);
else
crText = RGB(0, 0, 128 + 64);
SetTextColor(draw->hDC, crText);
/* Create font 8 high, standard dialog font */
font = CreateFont(-8, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
0, 0, 0, 0, 0, "MS Sans Serif");
if (!font) {
ErrorF("winDrawURLWindow: Unable to create URL font, bailing.\n");
return;
}
/* Draw it */
SetBkMode(draw->hDC, OPAQUE);
SelectObject(draw->hDC, font);
DrawText(draw->hDC, str, strlen(str), &rect, DT_LEFT | DT_VCENTER);
/* Delete the created font, replace it with stock font */
DeleteObject(SelectObject(draw->hDC, GetStockObject(ANSI_VAR_FONT)));
}
/*
* WndProc for overridden buttons
*/
static LRESULT CALLBACK
winURLWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
WNDPROC origCB = NULL;
HCURSOR cursor;
/* If it's a SetCursor message, tell it to the hand */
if (msg == WM_SETCURSOR) {
cursor = LoadCursor(NULL, IDC_HAND);
if (cursor)
SetCursor(cursor);
return TRUE;
}
origCB = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_USERDATA);
/* Otherwise fall through to original WndProc */
if (origCB)
return CallWindowProc(origCB, hwnd, msg, wParam, lParam);
else
return FALSE;
}
/*
* Register and unregister the custom WndProc
*/
static void
<API key>(HWND hwnd, int id)
{
WNDPROC origCB;
origCB = (WNDPROC) SetWindowLongPtr(GetDlgItem(hwnd, id),
GWLP_WNDPROC, (LONG_PTR) winURLWndProc);
SetWindowLongPtr(GetDlgItem(hwnd, id), GWLP_USERDATA, (LONG_PTR) origCB);
}
static void
<API key>(HWND hwnd, int id)
{
WNDPROC origCB;
origCB = (WNDPROC) SetWindowLongPtr(GetDlgItem(hwnd, id), GWLP_USERDATA, 0);
if (origCB)
SetWindowLongPtr(GetDlgItem(hwnd, id), GWLP_WNDPROC, (LONG_PTR) origCB);
}
/*
* Center a dialog window in the desktop window
* and set small and large icons to X icons.
*/
static void
winInitDialog(HWND hwndDlg)
{
HWND hwndDesk;
RECT rc, rcDlg, rcDesk;
HICON hIcon, hIconSmall;
hwndDesk = GetParent(hwndDlg);
if (!hwndDesk || IsIconic(hwndDesk))
hwndDesk = GetDesktopWindow();
/* Remove minimize and maximize buttons */
SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE)
& ~(WS_MAXIMIZEBOX | WS_MINIMIZEBOX));
/* Set Window not to show in the task bar */
SetWindowLongPtr(hwndDlg, GWL_EXSTYLE,
GetWindowLongPtr(hwndDlg, GWL_EXSTYLE) & ~WS_EX_APPWINDOW);
/* Center dialog window in the screen. Not done for multi-monitor systems, where
* it is likely to end up split across the screens. In that case, it appears
* near the Tray icon.
*/
if (GetSystemMetrics(SM_CMONITORS) > 1) {
/* Still need to refresh the frame change. */
SetWindowPos(hwndDlg, HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
else {
GetWindowRect(hwndDesk, &rcDesk);
GetWindowRect(hwndDlg, &rcDlg);
CopyRect(&rc, &rcDesk);
OffsetRect(&rcDlg, -rcDlg.left, -rcDlg.top);
OffsetRect(&rc, -rc.left, -rc.top);
OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
SetWindowPos(hwndDlg,
HWND_TOPMOST,
rcDesk.left + (rc.right / 2),
rcDesk.top + (rc.bottom / 2),
0, 0, SWP_NOSIZE | SWP_FRAMECHANGED);
}
#ifdef XWIN_MULTIWINDOW
if (g_hIconX)
hIcon = g_hIconX;
else
#endif
hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
#ifdef XWIN_MULTIWINDOW
if (g_hSmallIconX)
hIconSmall = g_hSmallIconX;
else
#endif
hIconSmall = LoadImage(g_hInstance,
MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON,
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON), LR_SHARED);
PostMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
PostMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
}
/*
* Display the Exit dialog box
*/
void
<API key>(winPrivScreenPtr pScreenPriv)
{
int i;
int liveClients = 0;
/* Count up running clients (clients[0] is serverClient) */
for (i = 1; i < currentMaxClients; i++)
if (clients[i] != NullClient)
liveClients++;
#if defined(XWIN_MULTIWINDOW)
/* Count down server internal clients */
if (pScreenPriv->pScreenInfo->fMultiWindow)
liveClients -= 2; /* multiwindow window manager & XMsgProc */
#endif
#if defined(XWIN_CLIPBOARD)
if (g_fClipboardStarted)
liveClients--; /* clipboard manager */
#endif
/* A user reported that this sometimes drops below zero. just eye-candy. */
if (liveClients < 0)
liveClients = 0;
/* Don't show the exit confirmation dialog if SilentExit & no clients,
or ForceExit, is enabled */
if ((pref.fSilentExit && liveClients <= 0) || pref.fForceExit) {
if (g_hDlgExit != NULL) {
DestroyWindow(g_hDlgExit);
g_hDlgExit = NULL;
}
PostMessage(pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0);
return;
}
pScreenPriv->iConnectedClients = liveClients;
/* Check if dialog already exists */
if (g_hDlgExit != NULL) {
/* Dialog box already exists, display it */
ShowWindow(g_hDlgExit, SW_SHOWDEFAULT);
/* User has lost the dialog. Show them where it is. */
SetForegroundWindow(g_hDlgExit);
return;
}
/* Create dialog box */
g_hDlgExit = CreateDialogParam(g_hInstance,
"EXIT_DIALOG",
pScreenPriv->hwndScreen,
winExitDlgProc, (int) pScreenPriv);
/* Show the dialog box */
ShowWindow(g_hDlgExit, SW_SHOW);
/* Needed to get keyboard controls (tab, arrows, enter, esc) to work */
SetForegroundWindow(g_hDlgExit);
/* Set focus to the Cancel button */
PostMessage(g_hDlgExit, WM_NEXTDLGCTL,
(WPARAM) GetDlgItem(g_hDlgExit, IDCANCEL), TRUE);
}
#define <API key> "There %s currently %d client%s connected."
/*
* Exit dialog window procedure
*/
static wBOOL CALLBACK
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
{
static winPrivScreenPtr s_pScreenPriv = NULL;
/* Branch on message type */
switch (message) {
case WM_INITDIALOG:
{
char *pszConnectedClients;
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
winInitDialog(hDialog);
/* Format the connected clients string */
if (asprintf(&pszConnectedClients, <API key>,
(s_pScreenPriv->iConnectedClients == 1) ? "is" : "are",
s_pScreenPriv->iConnectedClients,
(s_pScreenPriv->iConnectedClients == 1) ? "" : "s") == -1)
return TRUE;
/* Set the number of connected clients */
SetWindowText(GetDlgItem(hDialog, <API key>),
pszConnectedClients);
free(pszConnectedClients);
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
/* Send message to call the GiveUp function */
PostMessage(s_pScreenPriv->hwndScreen, WM_GIVEUP, 0, 0);
DestroyWindow(g_hDlgExit);
g_hDlgExit = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
return TRUE;
case IDCANCEL:
DestroyWindow(g_hDlgExit);
g_hDlgExit = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
return TRUE;
}
break;
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
/* Show the cursor if it is hidden */
if (g_fSoftwareCursor && !g_fCursor) {
g_fCursor = TRUE;
ShowCursor(TRUE);
}
return TRUE;
case WM_CLOSE:
DestroyWindow(g_hDlgExit);
g_hDlgExit = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
return TRUE;
}
return FALSE;
}
/*
* Display the Depth Change dialog box
*/
void
<API key>(winPrivScreenPtr pScreenPriv)
{
/* Check if dialog already exists */
if (g_hDlgDepthChange != NULL) {
/* Dialog box already exists, display it */
ShowWindow(g_hDlgDepthChange, SW_SHOWDEFAULT);
/* User has lost the dialog. Show them where it is. */
SetForegroundWindow(g_hDlgDepthChange);
return;
}
/*
* Display a notification to the user that the visual
* will not be displayed until the Windows display depth
* is restored to the original value.
*/
g_hDlgDepthChange = CreateDialogParam(g_hInstance,
"DEPTH_CHANGE_BOX",
pScreenPriv->hwndScreen,
<API key>,
(int) pScreenPriv);
/* Show the dialog box */
ShowWindow(g_hDlgDepthChange, SW_SHOW);
ErrorF("<API key> - DialogBox returned: %d\n",
(int) g_hDlgDepthChange);
ErrorF("<API key> - GetLastError: %d\n",
(int) GetLastError());
/* Minimize the display window */
ShowWindow(pScreenPriv->hwndScreen, SW_MINIMIZE);
}
/*
* Process messages for the dialog that is displayed for
* disruptive screen depth changes.
*/
static wBOOL CALLBACK
<API key>(HWND hwndDialog, UINT message,
WPARAM wParam, LPARAM lParam)
{
static winPrivScreenPtr s_pScreenPriv = NULL;
static winScreenInfo *s_pScreenInfo = NULL;
static ScreenPtr s_pScreen = NULL;
#if CYGDEBUG
winDebug("<API key>\n");
#endif
/* Branch on message type */
switch (message) {
case WM_INITDIALOG:
#if CYGDEBUG
winDebug("<API key> - WM_INITDIALOG\n");
#endif
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
s_pScreenInfo = s_pScreenPriv->pScreenInfo;
s_pScreen = s_pScreenInfo->pScreen;
#if CYGDEBUG
winDebug("<API key> - WM_INITDIALOG - s_pScreenPriv: %08x, "
"s_pScreenInfo: %08x, s_pScreen: %08x\n",
s_pScreenPriv, s_pScreenInfo, s_pScreen);
#endif
#if CYGDEBUG
winDebug("<API key> - WM_INITDIALOG - orig bpp: %d, "
"current bpp: %d\n",
s_pScreenInfo->dwBPP,
GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL));
#endif
winInitDialog(hwndDialog);
return TRUE;
case WM_DISPLAYCHANGE:
#if CYGDEBUG
winDebug("<API key> - WM_DISPLAYCHANGE - orig bpp: %d, "
"new bpp: %d\n",
s_pScreenInfo->dwBPP,
GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL));
#endif
/* Dismiss the dialog if the display returns to the original depth */
if (GetDeviceCaps(s_pScreenPriv->hdcScreen, BITSPIXEL) ==
s_pScreenInfo->dwBPP) {
ErrorF("<API key> - wParam == s_pScreenInfo->dwBPP\n");
/* Depth has been restored, dismiss dialog */
DestroyWindow(g_hDlgDepthChange);
g_hDlgDepthChange = NULL;
/* Flag that we have a valid screen depth */
s_pScreenPriv->fBadDepth = FALSE;
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
ErrorF("<API key> - WM_COMMAND - IDOK or IDCANCEL\n");
/*
* User dismissed the dialog, hide it until the
* display mode is restored.
*/
ShowWindow(g_hDlgDepthChange, SW_HIDE);
return TRUE;
}
break;
case WM_CLOSE:
ErrorF("<API key> - WM_CLOSE\n");
DestroyWindow(g_hDlgAbout);
g_hDlgAbout = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
return TRUE;
}
return FALSE;
}
/*
* Display the About dialog box
*/
void
<API key>(winPrivScreenPtr pScreenPriv)
{
/* Check if dialog already exists */
if (g_hDlgAbout != NULL) {
/* Dialog box already exists, display it */
ShowWindow(g_hDlgAbout, SW_SHOWDEFAULT);
/* User has lost the dialog. Show them where it is. */
SetForegroundWindow(g_hDlgAbout);
return;
}
/*
* Display the about box
*/
g_hDlgAbout = CreateDialogParam(g_hInstance,
"ABOUT_BOX",
pScreenPriv->hwndScreen,
winAboutDlgProc, (int) pScreenPriv);
/* Show the dialog box */
ShowWindow(g_hDlgAbout, SW_SHOW);
/* Needed to get keyboard controls (tab, arrows, enter, esc) to work */
SetForegroundWindow(g_hDlgAbout);
/* Set focus to the OK button */
PostMessage(g_hDlgAbout, WM_NEXTDLGCTL,
(WPARAM) GetDlgItem(g_hDlgAbout, IDOK), TRUE);
}
/*
* Process messages for the about dialog.
*/
static wBOOL CALLBACK
winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
{
static winPrivScreenPtr s_pScreenPriv = NULL;
static winScreenInfo *s_pScreenInfo = NULL;
static ScreenPtr s_pScreen = NULL;
#if CYGDEBUG
winDebug("winAboutDlgProc\n");
#endif
/* Branch on message type */
switch (message) {
case WM_INITDIALOG:
#if CYGDEBUG
winDebug("winAboutDlgProc - WM_INITDIALOG\n");
#endif
/* Store pointers to private structures for future use */
s_pScreenPriv = (winPrivScreenPtr) lParam;
s_pScreenInfo = s_pScreenPriv->pScreenInfo;
s_pScreen = s_pScreenInfo->pScreen;
winInitDialog(hwndDialog);
/* Override the URL buttons */
<API key>(hwndDialog, ID_ABOUT_CHANGELOG);
<API key>(hwndDialog, ID_ABOUT_WEBSITE);
<API key>(hwndDialog, ID_ABOUT_UG);
<API key>(hwndDialog, ID_ABOUT_FAQ);
return TRUE;
case WM_DRAWITEM:
/* Draw the URL buttons as needed */
winDrawURLWindow(lParam);
return TRUE;
case WM_MOUSEMOVE:
case WM_NCMOUSEMOVE:
/* Show the cursor if it is hidden */
if (g_fSoftwareCursor && !g_fCursor) {
g_fCursor = TRUE;
ShowCursor(TRUE);
}
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
ErrorF("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n");
DestroyWindow(g_hDlgAbout);
g_hDlgAbout = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
/* Restore window procedures for URL buttons */
<API key>(hwndDialog, ID_ABOUT_CHANGELOG);
<API key>(hwndDialog, ID_ABOUT_WEBSITE);
<API key>(hwndDialog, ID_ABOUT_UG);
<API key>(hwndDialog, ID_ABOUT_FAQ);
return TRUE;
case ID_ABOUT_CHANGELOG:
{
int iReturn;
#ifdef __CYGWIN__
const char *pszCygPath = "/usr/X11R6/share/doc/"
"xorg-x11-xwin/changelog.html";
char pszWinPath[MAX_PATH + 1];
/* Convert the POSIX path to a Win32 path */
<API key>(pszCygPath, pszWinPath);
#else
const char *pszWinPath = "http://x.cygwin.com/"
"devel/server/changelog.html";
#endif
iReturn = (int) ShellExecute(NULL,
"open",
pszWinPath, NULL, NULL, SW_MAXIMIZE);
if (iReturn < 32) {
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
"ShellExecute failed: %d\n", iReturn);
}
}
return TRUE;
case ID_ABOUT_WEBSITE:
{
const char *pszPath = <API key>;
int iReturn;
iReturn = (int) ShellExecute(NULL,
"open",
pszPath, NULL, NULL, SW_MAXIMIZE);
if (iReturn < 32) {
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
"ShellExecute failed: %d\n", iReturn);
}
}
return TRUE;
case ID_ABOUT_UG:
{
const char *pszPath = "http://x.cygwin.com/docs/ug/";
int iReturn;
iReturn = (int) ShellExecute(NULL,
"open",
pszPath, NULL, NULL, SW_MAXIMIZE);
if (iReturn < 32) {
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
"ShellExecute failed: %d\n", iReturn);
}
}
return TRUE;
case ID_ABOUT_FAQ:
{
const char *pszPath = "http://x.cygwin.com/docs/faq/";
int iReturn;
iReturn = (int) ShellExecute(NULL,
"open",
pszPath, NULL, NULL, SW_MAXIMIZE);
if (iReturn < 32) {
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
"ShellExecute failed: %d\n", iReturn);
}
}
return TRUE;
}
break;
case WM_CLOSE:
ErrorF("winAboutDlgProc - WM_CLOSE\n");
DestroyWindow(g_hDlgAbout);
g_hDlgAbout = NULL;
/* Fix to make sure keyboard focus isn't trapped */
PostMessage(s_pScreenPriv->hwndScreen, WM_NULL, 0, 0);
/* Restore window procedures for URL buttons */
<API key>(hwndDialog, ID_ABOUT_CHANGELOG);
<API key>(hwndDialog, ID_ABOUT_WEBSITE);
<API key>(hwndDialog, ID_ABOUT_UG);
<API key>(hwndDialog, ID_ABOUT_FAQ);
return TRUE;
}
return FALSE;
} |
package com.caucho.amber.cfg;
import java.util.ArrayList;
/**
* <table-generator> tag in orm.xml
*/
public class <API key> extends <API key> {
// attributes
private String _table;
private String _catalog;
private String _schema;
private String _pkColumnName;
private String _valueColumnName;
private String _pkColumnValue;
// elements
private ArrayList<<API key>> <API key>
= new ArrayList<<API key>>();
public String getTable()
{
return _table;
}
public void setTable(String table)
{
_table = table;
}
public String getCatalog()
{
return _catalog;
}
public void setCatalog(String catalog)
{
_catalog = catalog;
}
public String getSchema()
{
return _schema;
}
public void setSchema(String schema)
{
_schema = schema;
}
public String getPkColumnName(String pkColumnName)
{
return _pkColumnName;
}
public void setPkColumnName(String pkColumnName)
{
_pkColumnName = pkColumnName;
}
public String getValueColumnName(String valueColumnName)
{
return _valueColumnName;
}
public void setValueColumnName(String valueColumnName)
{
_valueColumnName = valueColumnName;
}
public String getPkColumnValue(String pkColumnValue)
{
return _pkColumnValue;
}
public void setPkColumnValue(String pkColumnValue)
{
_pkColumnValue = pkColumnValue;
}
public void addUniqueConstraint(<API key> uniqueConstraint)
{
<API key>.add(uniqueConstraint);
}
public ArrayList<<API key>> <API key>()
{
return <API key>;
}
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="ApiGen 2.8.0" />
<title>Class Illuminate\Session\<API key></title>
<script type="text/javascript" src="resources/combined.js"></script>
<script type="text/javascript" src="elementlist.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="resources/style514a.css" />
</head>
<body>
<div id="left">
<div id="menu">
<a href="index-2.html" title="Overview"><span>Overview</span></a>
<div id="groups">
<h3>Namespaces</h3>
<ul>
<li class="active"><a href="<API key>.html">Illuminate<span></span></a>
<ul>
<li><a href="<API key>.Auth.html">Auth<span></span></a>
<ul>
<li><a href="<API key>.Auth.Console.html">Console</a>
</li>
<li><a href="<API key>.Auth.Reminders.html">Reminders</a>
</li>
</ul></li>
<li><a href="<API key>.Cache.html">Cache<span></span></a>
<ul>
<li><a href="<API key>.Cache.Console.html">Console</a>
</li>
</ul></li>
<li><a href="<API key>.Config.html">Config</a>
</li>
<li><a href="<API key>.Console.html">Console</a>
</li>
<li><a href="<API key>.Container.html">Container</a>
</li>
<li><a href="<API key>.Cookie.html">Cookie</a>
</li>
<li><a href="<API key>.Database.html">Database<span></span></a>
<ul>
<li><a href="<API key>.Database.Capsule.html">Capsule</a>
</li>
<li><a href="<API key>.Database.Connectors.html">Connectors</a>
</li>
<li><a href="<API key>.Database.Console.html">Console<span></span></a>
<ul>
<li><a href="<API key>.Database.Console.Migrations.html">Migrations</a>
</li>
</ul></li>
<li><a href="<API key>.Database.Eloquent.html">Eloquent<span></span></a>
<ul>
<li><a href="<API key>.Database.Eloquent.Relations.html">Relations</a>
</li>
</ul></li>
<li><a href="<API key>.Database.Migrations.html">Migrations</a>
</li>
<li><a href="<API key>.Database.Query.html">Query<span></span></a>
<ul>
<li><a href="<API key>.Database.Query.Grammars.html">Grammars</a>
</li>
<li><a href="<API key>.Database.Query.Processors.html">Processors</a>
</li>
</ul></li>
<li><a href="<API key>.Database.Schema.html">Schema<span></span></a>
<ul>
<li><a href="<API key>.Database.Schema.Grammars.html">Grammars</a>
</li>
</ul></li></ul></li>
<li><a href="<API key>.Encryption.html">Encryption</a>
</li>
<li><a href="<API key>.Events.html">Events</a>
</li>
<li><a href="<API key>.Exception.html">Exception</a>
</li>
<li><a href="<API key>.Filesystem.html">Filesystem</a>
</li>
<li><a href="<API key>.Foundation.html">Foundation<span></span></a>
<ul>
<li><a href="<API key>.Foundation.Console.html">Console</a>
</li>
<li><a href="<API key>.Foundation.Providers.html">Providers</a>
</li>
<li><a href="<API key>.Foundation.Testing.html">Testing</a>
</li>
</ul></li>
<li><a href="<API key>.Hashing.html">Hashing</a>
</li>
<li><a href="<API key>.Html.html">Html</a>
</li>
<li><a href="<API key>.Http.html">Http</a>
</li>
<li><a href="<API key>.Log.html">Log</a>
</li>
<li><a href="<API key>.Mail.html">Mail</a>
</li>
<li><a href="<API key>.Pagination.html">Pagination</a>
</li>
<li><a href="<API key>.Queue.html">Queue<span></span></a>
<ul>
<li><a href="<API key>.Queue.Connectors.html">Connectors</a>
</li>
<li><a href="<API key>.Queue.Console.html">Console</a>
</li>
<li><a href="<API key>.Queue.Jobs.html">Jobs</a>
</li>
</ul></li>
<li><a href="<API key>.Redis.html">Redis</a>
</li>
<li><a href="<API key>.Routing.html">Routing<span></span></a>
<ul>
<li><a href="<API key>.Routing.Console.html">Console</a>
</li>
<li><a href="<API key>.Routing.Controllers.html">Controllers</a>
</li>
<li><a href="<API key>.Routing.Generators.html">Generators</a>
</li>
</ul></li>
<li class="active"><a href="<API key>.Session.html">Session<span></span></a>
<ul>
<li><a href="<API key>.Session.Console.html">Console</a>
</li>
</ul></li>
<li><a href="<API key>.Support.html">Support<span></span></a>
<ul>
<li><a href="<API key>.Support.Contracts.html">Contracts</a>
</li>
<li><a href="<API key>.Support.Facades.html">Facades</a>
</li>
</ul></li>
<li><a href="<API key>.Translation.html">Translation</a>
</li>
<li><a href="<API key>.Validation.html">Validation</a>
</li>
<li><a href="<API key>.View.html">View<span></span></a>
<ul>
<li><a href="<API key>.View.Compilers.html">Compilers</a>
</li>
<li><a href="<API key>.View.Engines.html">Engines</a>
</li>
</ul></li>
<li><a href="<API key>.Workbench.html">Workbench<span></span></a>
<ul>
<li><a href="<API key>.Workbench.Console.html">Console</a>
</li>
</ul></li></ul></li>
<li><a href="namespace-None.html">None</a>
</li>
<li><a href="namespace-PHP.html">PHP</a>
</li>
</ul>
</div>
<hr />
<div id="elements">
<h3>Classes</h3>
<ul>
<li class="active"><a href="class-Illuminate.Session.<API key>.html"><API key></a></li>
<li><a href="class-Illuminate.Session.<API key>.html"><API key></a></li>
<li><a href="class-Illuminate.Session.<API key>.html"><API key></a></li>
<li><a href="class-Illuminate.Session.SessionManager.html">SessionManager</a></li>
<li><a href="class-Illuminate.Session.<API key>.html"><API key></a></li>
<li><a href="class-Illuminate.Session.Store.html">Store</a></li>
</ul>
<h3>Exceptions</h3>
<ul>
<li><a href="class-Illuminate.Session.<API key>.html"><API key></a></li>
</ul>
</div>
</div>
</div>
<div id="splitter"></div>
<div id="right">
<div id="rightInner">
<div id="navigation">
<ul>
<li>
<a href="index-2.html" title="Overview"><span>Overview</span></a>
</li>
<li>
<a href="<API key>.Session.html" title="Summary of Illuminate\Session"><span>Namespace</span></a>
</li>
<li class="active">
<span>Class</span> </li>
</ul>
<ul>
<li>
<a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a>
</li>
</ul>
<ul>
</ul>
</div>
<div id="content" class="class">
<h1>Class <API key></h1>
<dl class="tree">
<dd style="padding-left:0px">
<b><span>Illuminate\Session\<API key></span></b>
implements
<a href="<API key>.html"><span><API key></span></a>
</dd>
</dl>
<div class="info">
<b>Namespace:</b> <a href="<API key>.html">Illuminate</a>\<a href="<API key>.Session.html">Session</a><br />
<b>Located at</b> <a href="<API key>.Session.<API key>.html#5-82" title="Go to source code">Illuminate/Session/<API key>.php</a><br />
</div>
<table class="summary" id="methods">
<caption>Methods summary</caption>
<tr data-order="__construct" id="___construct">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="
<code><a href="<API key>.Session.<API key>.html#21-32" title="Go to source code">__construct</a>( <span><code><a href="class-Illuminate.Cache.Repository.html">Illuminate\Cache\Repository</a></code> <var>$cache</var></span>, <span>integer <var>$minutes</var></span> )</code>
<div class="description short">
<p>Create a new cache driven handler instance.</p>
</div>
<div class="description detailed hidden">
<p>Create a new cache driven handler instance.</p>
<h4>Parameters</h4>
<div class="list"><dl>
<dt><var>$cache</var></dt>
<dd><code><code><a href="class-Illuminate.Cache.Repository.html">Illuminate\Cache\Repository</a></code></code><br>$cache</dd>
<dt><var>$minutes</var></dt>
<dd><code>integer</code><br>$minutes</dd>
</dl></div>
</div>
</div></td>
</tr>
<tr data-order="open" id="_open">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_open">#</a>
<code><a href="<API key>.Session.<API key>.html#34-40" title="Go to source code">open</a>( <span>mixed <var>$savePath</var></span>, <span>mixed <var>$sessionName</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_open"><API key>::open()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="close" id="_close">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_close">#</a>
<code><a href="<API key>.Session.<API key>.html#42-48" title="Go to source code">close</a>( )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_close"><API key>::close()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="read" id="_read">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_read">#</a>
<code><a href="<API key>.Session.<API key>.html#50-56" title="Go to source code">read</a>( <span>mixed <var>$sessionId</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_read"><API key>::read()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="write" id="_write">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_write">#</a>
<code><a href="<API key>.Session.<API key>.html#58-64" title="Go to source code">write</a>( <span>mixed <var>$sessionId</var></span>, <span>mixed <var>$data</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_write"><API key>::write()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="destroy" id="_destroy">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_destroy">#</a>
<code><a href="<API key>.Session.<API key>.html#66-72" title="Go to source code">destroy</a>( <span>mixed <var>$sessionId</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_destroy"><API key>::destroy()</a></code></div>
</div>
</div></td>
</tr>
<tr data-order="gc" id="_gc">
<td class="attributes"><code>
public
</code>
</td>
<td class="name"><div>
<a class="anchor" href="#_gc">#</a>
<code><a href="<API key>.Session.<API key>.html#74-80" title="Go to source code">gc</a>( <span>mixed <var>$lifetime</var></span> )</code>
<div class="description short">
</div>
<div class="description detailed hidden">
<h4>Implementation of</h4>
<div class="list"><code><a href="<API key>.html#_gc"><API key>::gc()</a></code></div>
</div>
</div></td>
</tr>
</table>
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="cache" id="$cache">
<td class="attributes"><code>
protected
<code><a href="class-Illuminate.Cache.Repository.html">Illuminate\Cache\Repository</a></code>
</code></td>
<td class="name">
<a href="<API key>.Session.<API key>.html#7-12" title="Go to source code"><var>$cache</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$cache" class="anchor">#</a>
<div class="description short">
<p>The cache repository instance.</p>
</div>
<div class="description detailed hidden">
<p>The cache repository instance.</p>
</div>
</div></td>
</tr>
<tr data-order="minutes" id="$minutes">
<td class="attributes"><code>
protected
integer
</code></td>
<td class="name">
<a href="<API key>.Session.<API key>.html#14-19" title="Go to source code"><var>$minutes</var></a>
</td>
<td class="value"><code></code></td>
<td class="description"><div>
<a href="#$minutes" class="anchor">#</a>
<div class="description short">
<p>The number of minutes to store the data in the cache.</p>
</div>
<div class="description detailed hidden">
<p>The number of minutes to store the data in the cache.</p>
</div>
</div></td>
</tr>
</table>
</div>
<div id="footer">
API documentation generated by <a href="http://apigen.org/">ApiGen 2.8.0</a>
</div>
</div>
</div>
</body>
</html> |
(function ($) {
$.extend($.validator.messages, {
required: "Ce champ est obligatoire.",
remote: "Veuillez corriger ce champ.",
email: "Veuillez fournir une adresse électronique valide.",
url: "Veuillez fournir une adresse URL valide.",
date: "Veuillez fournir une date valide.",
dateISO: "Veuillez fournir une date valide (ISO).",
number: "Veuillez fournir un numéro valide.",
digits: "Veuillez fournir seulement des chiffres.",
creditcard: "Veuillez fournir un numéro de carte de crédit valide.",
equalTo: "Veuillez fournir encore la même valeur.",
accept: "Veuillez fournir une valeur avec une extension valide.",
maxlength: $.validator.format("Veuillez fournir au plus {0} caractères."),
minlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
rangelength: $.validator.format("Veuillez fournir une valeur qui contient entre {0} et {1} caractères."),
range: $.validator.format("Veuillez fournir une valeur entre {0} et {1}."),
max: $.validator.format("Veuillez fournir une valeur inférieur ou égal à {0}."),
min: $.validator.format("Veuillez fournir une valeur supérieur ou égal à {0}."),
maxWords: $.validator.format("Veuillez fournir au plus {0} mots."),
minWords: $.validator.format("Veuillez fournir au moins {0} mots."),
rangeWords: $.validator.format("Veuillez fournir entre {0} et {1} mots."),
<API key>: "Veuillez fournir seulement des lettres et des signes de ponctuation.",
alphanumeric: "Veuillez fournir seulement des lettres, nombres, espaces et soulignages",
lettersonly: "Veuillez fournir seulement des lettres.",
nowhitespace: "Veuillez ne pas inscrire d'espaces blancs.",
ziprange: "Veuillez fournir un code postal entre 902xx-xxxx et 905-xx-xxxx.",
integer: "Veuillez fournir un nombre non décimal qui est positif ou négatif.",
vinUS: "Veuillez fournir un numéro d'identification du véhicule (VIN).",
dateITA: "Veuillez fournir une date valide.",
time: "Veuillez fournir une heure valide entre 00:00 et 23:59.",
phoneUS: "Veuillez fournir un numéro de téléphone valide.",
phoneUK: "Veuillez fournir un numéro de téléphone valide.",
mobileUK: "Veuillez fournir un numéro de téléphone mobile valide.",
strippedminlength: $.validator.format("Veuillez fournir au moins {0} caractères."),
email2: "Veuillez fournir une adresse électronique valide.",
url2: "Veuillez fournir une adresse URL valide.",
creditcardtypes: "Veuillez fournir un numéro de carte de crédit valide.",
ipv4: "Veuillez fournir une adresse IP v4 valide.",
ipv6: "Veuillez fournir une adresse IP v6 valide.",
require_from_group: "Veuillez fournir au moins {0} de ces champs."
});
}(jQuery)); |
#include "UserAccount.hpp"
#include <QDebug>
UserAccount::UserAccount(QSqlDatabase db)
{
this->db = db;
}
bool UserAccount::exist(QString accountName)
{
if (!db.open())
{
qDebug() << "Database not found";
}
QSqlQuery query;
query.prepare("SELECT EXISTS(SELECT 1 FROM Accounts WHERE AccountName =:name LIMIT 1)");
query.bindValue(":name", QVariant(accountName));
query.exec();
query.next();
bool result = query.value(0).toBool();
db.close();
return result;
} |
SELECT count(*), customernumber from customer
GROUP BY customernumber
HAVING count(*) > 1;
SELECT count(*), vendornumber from vendor
GROUP BY vendornumber
HAVING count(*) > 1;
SELECT * FROM chart where link LIKE '%CT_tax%';
SELECT * FROM employee where employeenumber IS NULL;
SELECT * FROM employee WHERE employeenumber IN
(SELECT employeenumber FROM employee GROUP BY employeenumber
HAVING count(*) > 1);
select partnumber, count(*) from parts
WHERE obsolete is not true
group by partnumber having count(*) > 1;
SELECT invnumber, count(*) from ar
group by invnumber having count(*) > 1; |
function checkLogin() {
userlogin = $("#logininput").val();
$("#logincheck").load("/core/ajax/registration.php", {opt: "checklogin", data: userlogin});
}
function checkPasswords() {
var pass1 = $("#pass1input").val();
var pass2 = $("#pass2input").val();
if (pass1 != pass2) {
$('#passcheck').html('<span style="color:red">' + LANG_WRONG_PASS + '</span>');
}
} |
// ** I18N
Calendar._DN = new Array
("Zondag",
"Maandag",
"Dinsdag",
"Woensdag",
"Donderdag",
"Vrijdag",
"Zaterdag",
"Zondag");
Calendar._MN = new Array
("Januari",
"Februari",
"Maart",
"April",
"Mei",
"Juni",
"Juli",
"Augustus",
"September",
"Oktober",
"November",
"December");
// tooltips
Calendar._TT = {};
Calendar._TT["TOGGLE"] = "Toggle startdag van de week";
Calendar._TT["PREV_YEAR"] = "Vorig jaar (indrukken voor menu)";
Calendar._TT["PREV_MONTH"] = "Vorige month (indrukken voor menu)";
Calendar._TT["GO_TODAY"] = "Naar Vandaag";
Calendar._TT["NEXT_MONTH"] = "Volgende Maand (indrukken voor menu)";
Calendar._TT["NEXT_YEAR"] = "Volgend jaar (indrukken voor menu)";
Calendar._TT["SEL_DATE"] = "Selecteer datum";
Calendar._TT["DRAG_TO_MOVE"] = "Sleep om te verplaatsen";
Calendar._TT["PART_TODAY"] = " (vandaag)";
Calendar._TT["MON_FIRST"] = "Toon Maandag eerst";
Calendar._TT["SUN_FIRST"] = "Toon Zondag eerst";
Calendar._TT["CLOSE"] = "Sluiten";
Calendar._TT["TODAY"] = "Vandaag";
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["DAY_FIRST"] = "Display %s first";
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "y-mm-dd";
Calendar._TT["TT_DATE_FORMAT"] = "D, M d";
Calendar._TT["WK"] = "wk"; |
# -*- coding: utf-8 -*-
"""
Webhook signals
"""
# Required for reading files
import sys;
reload(sys);
sys.setdefaultencoding("utf8")
from django.core.files import File
from django.core.cache import cache
from django.dispatch import receiver
from django.test import TestCase, Client
from django.core.urlresolvers import reverse_lazy
from django.contrib.contenttypes.models import ContentType
from model_mommy import mommy
from ..services import <API key>
from .models import FakeDocumentObject
import data as crocodoc_data
from dj_crocodoc.models import CrocodocDocument
import dj_crocodoc.signals as crocodoc_signals
import os
import json
import codecs
import httpretty
TEST_PDF_PATH = os.path.join(os.path.dirname(__file__), 'test.pdf')
def GET_FAKE_DOC_OBJECT():
<API key> = FakeDocumentObject()
with codecs.open(TEST_PDF_PATH, mode='r', encoding="ISO8859-1") as filename:
<API key>.my_document_field.save('test.pdf', File(filename))
<API key>.save()
return <API key>
@receiver(crocodoc_signals.<API key>)
@receiver(crocodoc_signals.<API key>)
@receiver(crocodoc_signals.<API key>)
@receiver(crocodoc_signals.<API key>)
@receiver(crocodoc_signals.<API key>)
@receiver(crocodoc_signals.<API key>)
def <API key>(**kwargs):
"""
Test signal listner to handle the signal fired event
"""
cache.set('<API key>', kwargs.keys())
def <API key>(clazz, obj):
"""
Test we have the right standard values
used in all tests below
"""
clazz.assertEqual(obj.content_object_type, ContentType.objects.get(model='fakedocumentobject', app_label='tests'))
clazz.assertEqual(obj.<API key>, 'my_document_field')
clazz.assertEqual(type(obj.source_object), FakeDocumentObject) # should return the base object that created the request
class BaseContentProvider(TestCase):
def setUp(self):
super(BaseContentProvider, self).setUp()
self.client = Client()
self.document_uuid = '<API key>'
# Create Test document
self.user = mommy.make('auth.User',
pk=1, # set pk based on the data.<API key> 1,Ross C
username='CrocoDoc webhook User',
first_name='Ross',
last_name='C',
email='crocodoc@lawpal.com')
self.attachment = FakeDocumentObject.objects.create(my_document_field='')
ctype = ContentType.objects.get(model=self.attachment.__class__.__name__.lower(), app_label='tests')
self.doc = CrocodocDocument.objects.create(uuid=self.document_uuid,
content_object_type=ctype,
object_id=self.attachment.pk,
<API key>='my_document_field')
class WebhookTest(BaseContentProvider):
"""
Test the basic webhook callbacks (emulate a POST form crocodoc)
"""
endpoint = reverse_lazy('<API key>')
EXPECTED_KEYS = ['target', 'crocodoc_event', 'signal', 'uuid', 'content', 'user_info', 'verb', 'attachment_name', 'document', 'sender']
def send(self, data):
"""
crocodoc wrap all webhooks in a payload object for some reason
and a basic post
"""
return self.client.post(self.endpoint, {"payload": json.dumps(data)})
def test_comment_create(self):
resp = self.send(data=crocodoc_data.<API key>)
self.assertItemsEqual(cache.get('<API key>'), self.EXPECTED_KEYS)
self.assertEqual(json.loads(resp.content), {"details": [True, True]})
def <API key>(self):
resp = self.send(data=crocodoc_data.<API key>)
self.assertItemsEqual(cache.get('<API key>'), self.EXPECTED_KEYS)
self.assertEqual(json.loads(resp.content), {"details": [True]})
def <API key>(self):
resp = self.send(data=crocodoc_data.<API key>)
self.assertItemsEqual(cache.get('<API key>'), self.EXPECTED_KEYS)
self.assertEqual(json.loads(resp.content), {"details": [True]})
class IncomingSignalTest(TestCase):
"""
Test we can issue a signal and have that signal provide us with an appropriate model
"""
subject = crocodoc_signals.send_to_crocodoc
@httpretty.activate
def <API key>(self):
# Crocdoc
httpretty.register_uri(httpretty.POST, "https://crocodoc.com/api/v2/document/upload",
body='{"success": true, "uuid": "<API key>"}',
status=200)
<API key> = GET_FAKE_DOC_OBJECT()
self.assertEqual(CrocodocDocument.objects.all().count(), 0)
self.subject.send(sender=self,
document_object=<API key>,
app_label='tests',
field_name='my_document_field')
# Success, we Created a new CrocodocDocument object from the signal
self.assertEqual(CrocodocDocument.objects.all().count(), 1)
obj = CrocodocDocument.objects.all().first()
self.assertEqual(str(obj.uuid), '<API key>') # as we have yet to call the upload process on it
<API key>(clazz=self, obj=obj)
class <API key>(TestCase):
"""
Test we can use the <API key> directly
"""
subject = <API key>
@httpretty.activate
def <API key>(self):
"""
Note the <API key> will not upload_immediately unless u
specify upload_immediately=True
"""
# Crocdoc
httpretty.register_uri(httpretty.POST, "https://crocodoc.com/api/v2/document/upload",
body='{"success": true, "uuid": "<API key>"}',
status=200)
<API key> = GET_FAKE_DOC_OBJECT()
self.assertEqual(CrocodocDocument.objects.all().count(), 0)
self.subject(document_object=<API key>, app_label='tests', field_name='my_document_field')
# Success, we Created a new CrocodocDocument object from the signal
self.assertEqual(CrocodocDocument.objects.all().count(), 1)
obj = CrocodocDocument.objects.all().first()
self.assertEqual(obj.uuid, None) # Service does not upload right away
<API key>(clazz=self, obj=obj)
@httpretty.activate
def <API key>(self):
"""
Note the <API key> will not upload_immediately unless u
specify upload_immediately=True
"""
# Crocdoc
httpretty.register_uri(httpretty.POST, "https://crocodoc.com/api/v2/document/upload",
body='{"success": true, "uuid": "<API key>"}',
status=200)
<API key> = GET_FAKE_DOC_OBJECT()
self.assertEqual(CrocodocDocument.objects.all().count(), 0)
service = self.subject(document_object=<API key>,
app_label='tests',
field_name='my_document_field',
upload_immediately=True)
# Success, we Created a new CrocodocDocument object from the signal
self.assertEqual(CrocodocDocument.objects.all().count(), 1)
obj = CrocodocDocument.objects.all().first()
self.assertEqual(str(obj.uuid), '<API key>') # Service does not upload right away
<API key>(clazz=self, obj=obj) |
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_45) on Sun Sep 18 14:47:28 CST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>TopologyTemplate</title>
<meta name="date" content="2016-09-18">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TopologyTemplate";
}
}
catch(err) {
}
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TopologyTemplate.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TemplateElement.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><span class="typeNameLink">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html" target="_top">Frames</a></li>
<li><a href="TopologyTemplate.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
</a></div>
<div class="header">
<div class="subTitle">cn.ac.iscas.cloudeploy.v2.model.entity.topology</div>
<h2 title="Class TopologyTemplate" class="title">Class TopologyTemplate</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>cn.ac.iscas.cloudeploy.v2.model.entity.topology.TopologyTemplate</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">TopologyTemplate</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#TopologyTemplate--">TopologyTemplate</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.summary">
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#findTemplate-java.lang.String-">findTemplate</a></span>(java.lang.String containerName)</code> </td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#getNodetemplates--">getNodetemplates</a></span>()</code> </td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/<API key>.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><API key></a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#<API key>--"><API key></a></span>()</code> </td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#<API key>.util.List-">setNodetemplates</a></span>(java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a>> nodetemplates)</code> </td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html#<API key>.util.List-"><API key></a></span>(java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/<API key>.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><API key></a>> <API key>)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
</a>
<h3>Constructor Detail</h3>
<a name="TopologyTemplate
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TopologyTemplate</h4>
<pre>public TopologyTemplate()</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method.detail">
</a>
<h3>Method Detail</h3>
<a name="getNodetemplates
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNodetemplates</h4>
<pre>public java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a>> getNodetemplates()</pre>
</li>
</ul>
<a name="<API key>.util.List-">
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNodetemplates</h4>
<pre>public void setNodetemplates(java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a>> nodetemplates)</pre>
</li>
</ul>
<a name="<API key>
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/<API key>.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><API key></a>> <API key>()</pre>
</li>
</ul>
<a name="<API key>.util.List-">
</a>
<ul class="blockList">
<li class="blockList">
<h4><API key></h4>
<pre>public void <API key>(java.util.List<<a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/<API key>.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><API key></a>> <API key>)</pre>
</li>
</ul>
<a name="findTemplate-java.lang.String-">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>findTemplate</h4>
<pre>public <a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/NodeTemplate.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology">NodeTemplate</a> findTemplate(java.lang.String containerName)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TopologyTemplate.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../../cn/ac/iscas/cloudeploy/v2/model/entity/topology/TemplateElement.html" title="class in cn.ac.iscas.cloudeploy.v2.model.entity.topology"><span class="typeNameLink">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?cn/ac/iscas/cloudeploy/v2/model/entity/topology/TopologyTemplate.html" target="_top">Frames</a></li>
<li><a href="TopologyTemplate.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!
allClassesLink = document.getElementById("<API key>");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
</a></div>
</body>
</html> |
from results.controllers.ResultsController import ResultsController
class PointsController():
results_controller = None
def __init__(self):
self.results_controller = ResultsController()
def <API key>(self, team, round):
result = self.results_controller.result_for_team(team, round)
debate = result.debate
if debate.OG == team:
return result.og
if debate.OO == team:
return result.oo
if debate.CG == team:
return result.cg
if debate.CO == team:
return result.co
def <API key>(self, team, maxround):
total = 0
for round in range(1, maxround+1):
total += self.<API key>(team, round)
return total
def <API key>(self, team, round):
result = self.results_controller.result_for_team(team, round)
debate = result.debate
if debate.OG == team:
return [result.ogsp1, result.ogsp2]
if debate.OO == team:
return [result.oosp1, result.oosp2]
if debate.CG == team:
return [result.cgsp1, result.cgsp2]
if debate.CO == team:
return [result.cosp1, result.cosp2]
def <API key>(self, round, teams):
points = {}
for team in teams:
points.update({team: self.<API key>(team, round)})
return points |
package com.springmvc.dao;
import org.springframework.stereotype.Repository;
import com.springmvc.pojo.User;
public interface UserDao {
int deleteByPrimaryKey(Integer id);
int insert(User record);
int insertSelective(User record);
User selectByPrimaryKey(Integer id);
int <API key>(User record);
int updateByPrimaryKey(User record);
} |
#include <linux/platform_device.h>
#include <linux/cdev.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/uaccess.h>
#include <linux/clk.h>
#include <linux/android_pmem.h>
#include <linux/msm_rotator.h>
#include <linux/io.h>
#include <mach/msm_rotator_imem.h>
#include <linux/ktime.h>
#include <linux/workqueue.h>
#include <linux/file.h>
#include <linux/major.h>
#include <linux/regulator/consumer.h>
#include <linux/msm_ion.h>
#include <linux/sync.h>
#include <linux/sw_sync.h>
#ifdef <API key>
#include <mach/msm_bus.h>
#include <mach/msm_bus_board.h>
#endif
#include <mach/msm_subsystem_map.h>
#include <mach/iommu_domains.h>
#define DRIVER_NAME "msm_rotator"
#define MSM_ROTATOR_BASE (msm_rotator_dev->io_base)
#define <API key> (MSM_ROTATOR_BASE+0x0020)
#define <API key> (MSM_ROTATOR_BASE+0x0024)
#define <API key> (MSM_ROTATOR_BASE+0x0028)
#define MSM_ROTATOR_START (MSM_ROTATOR_BASE+0x0030)
#define <API key> (MSM_ROTATOR_BASE+0x0050)
#define <API key> (MSM_ROTATOR_BASE+0x0070)
#define <API key> (MSM_ROTATOR_BASE+0x0074)
#define <API key> (MSM_ROTATOR_BASE+0x1108)
#define <API key> (MSM_ROTATOR_BASE+0x110c)
#define <API key> (MSM_ROTATOR_BASE+0x1110)
#define <API key> (MSM_ROTATOR_BASE+0x1114)
#define <API key> (MSM_ROTATOR_BASE+0x111c)
#define <API key> (MSM_ROTATOR_BASE+0x1120)
#define <API key> (MSM_ROTATOR_BASE+0x1124)
#define <API key> (MSM_ROTATOR_BASE+0x1128)
#define <API key> (MSM_ROTATOR_BASE+0x1138)
#define <API key> (MSM_ROTATOR_BASE+0x1154)
#define <API key> (MSM_ROTATOR_BASE+0x1168)
#define <API key> (MSM_ROTATOR_BASE+0x116c)
#define <API key> (MSM_ROTATOR_BASE+0x1170)
#define <API key> (MSM_ROTATOR_BASE+0x1178)
#define <API key> (MSM_ROTATOR_BASE+0x117c)
#define MSM_ROTATOR_SRC_XY (MSM_ROTATOR_BASE+0x1200)
#define <API key> (MSM_ROTATOR_BASE+0x1208)
#define MSM_ROTATOR_MAX_ROT 0x07
#define MSM_ROTATOR_MAX_H 0x1fff
#define MSM_ROTATOR_MAX_W 0x1fff
/* from lsb to msb */
#define GET_PACK_PATTERN(a, x, y, z, bit) \
(((a)<<((bit)*3))|((x)<<((bit)*2))|((y)<<(bit))|(z))
#define CLR_G 0x0
#define CLR_B 0x1
#define CLR_R 0x2
#define CLR_ALPHA 0x3
#define CLR_Y CLR_G
#define CLR_CB CLR_B
#define CLR_CR CLR_R
#define <API key>(r) ((((r) & MDP_ROT_90) ? 1 : 0) | \
(((r) & MDP_FLIP_LR) ? 2 : 0) | \
(((r) & MDP_FLIP_UD) ? 4 : 0))
#define IMEM_NO_OWNER -1;
#define MAX_SESSIONS 16
#define INVALID_SESSION -1
#define VERSION_KEY_MASK 0xFFFFFF00
#define MAX_DOWNSCALE_RATIO 3
#define MAX_COMMIT_QUEUE 4
#define WAIT_ROT_TIMEOUT 1000
#define <API key> 16
#define <API key> MSEC_PER_SEC
#define <API key> (10 * MSEC_PER_SEC)
#define ROTATOR_REVISION_V0 0
#define ROTATOR_REVISION_V1 1
#define ROTATOR_REVISION_V2 2
#define <API key> 0xffffffff
#define BASE_ADDR(height, y_stride) ((height % 64) * y_stride)
#define HW_BASE_ADDR(height, y_stride) (((dstp0_ystride >> 5) << 11) - \
((dst_height & 0x3f) * dstp0_ystride))
uint32_t rotator_hw_revision;
static char <API key>;
/*
* rotator_hw_revision:
* 0 == 7x30
* 1 == 8x60
* 2 == 8960
*
*/
struct tile_parm {
unsigned int width; /* tile's width */
unsigned int height; /* tile's height */
unsigned int row_tile_w; /* tiles per row's width */
unsigned int row_tile_h; /* tiles per row's height */
};
struct <API key> {
unsigned int num_planes;
unsigned int plane_size[4];
unsigned int total_size;
};
#define checkoffset(offset, size, max_size) \
((size) > (max_size) || (offset) > ((max_size) - (size)))
struct msm_rotator_fd_info {
int pid;
int ref_cnt;
struct list_head list;
};
struct rot_sync_info {
u32 initialized;
struct sync_fence *acq_fen;
struct sync_fence *rel_fen;
int rel_fen_fd;
struct sw_sync_timeline *timeline;
int timeline_value;
struct mutex sync_mutex;
atomic_t queue_buf_cnt;
};
struct msm_rotator_session {
struct <API key> img_info;
struct msm_rotator_fd_info fd_info;
int fast_yuv_enable;
};
struct <API key> {
struct <API key> data_info;
struct <API key> img_info;
unsigned int format;
unsigned int in_paddr;
unsigned int out_paddr;
unsigned int in_chroma_paddr;
unsigned int out_chroma_paddr;
unsigned int in_chroma2_paddr;
unsigned int out_chroma2_paddr;
struct file *srcp0_file;
struct file *srcp1_file;
struct file *dstp0_file;
struct file *dstp1_file;
struct ion_handle *srcp0_ihdl;
struct ion_handle *srcp1_ihdl;
struct ion_handle *dstp0_ihdl;
struct ion_handle *dstp1_ihdl;
int ps0_need;
int session_index;
struct sync_fence *acq_fen;
int fast_yuv_en;
};
struct msm_rotator_dev {
void __iomem *io_base;
int irq;
struct clk *core_clk;
struct msm_rotator_session *rot_session[MAX_SESSIONS];
struct list_head fd_list;
struct clk *pclk;
int rot_clk_state;
struct regulator *regulator;
struct delayed_work rot_clk_work;
struct clk *imem_clk;
int imem_clk_state;
struct delayed_work imem_clk_work;
struct platform_device *pdev;
struct cdev cdev;
struct device *device;
struct class *class;
dev_t dev_num;
int processing;
int last_session_idx;
struct mutex rotator_lock;
struct mutex imem_lock;
int imem_owner;
wait_queue_head_t wq;
struct ion_client *client;
#ifdef <API key>
uint32_t bus_client_handle;
#endif
u32 sec_mapped;
u32 mmu_clk_on;
struct rot_sync_info sync_info[MAX_SESSIONS];
/* non blocking */
struct mutex commit_mutex;
struct mutex commit_wq_mutex;
struct completion commit_comp;
u32 commit_running;
struct work_struct commit_work;
struct <API key> commit_info[MAX_COMMIT_QUEUE];
atomic_t commit_q_r;
atomic_t commit_q_w;
atomic_t commit_q_cnt;
};
#define COMPONENT_5BITS 1
#define COMPONENT_6BITS 2
#define COMPONENT_8BITS 3
static struct msm_rotator_dev *msm_rotator_dev;
#define mrd msm_rotator_dev
static void <API key>(u32 is_all);
enum {
CLK_EN,
CLK_DIS,
CLK_SUSPEND,
};
struct res_mmu_clk {
char *mmu_clk_name;
struct clk *mmu_clk;
};
static struct res_mmu_clk rot_mmu_clks[] = {
{"mdp_iommu_clk"}, {"rot_iommu_clk"},
{"vcodec_iommu0_clk"}, {"vcodec_iommu1_clk"},
{"smmu_iface_clk"}
};
int <API key>(int mem_id, int domain,
unsigned long *start, unsigned long *len,
struct ion_handle **pihdl, unsigned int secure)
{
if (!msm_rotator_dev->client)
return -EINVAL;
*pihdl = ion_import_dma_buf(msm_rotator_dev->client, mem_id);
if (IS_ERR_OR_NULL(*pihdl)) {
pr_err("ion_import_dma_buf() failed\n");
return PTR_ERR(*pihdl);
}
pr_debug("%s(): ion_hdl %p, ion_fd %d\n", __func__, *pihdl, mem_id);
if (<API key>) {
if (secure) {
if (ion_phys(msm_rotator_dev->client,
*pihdl, start, (unsigned *)len)) {
pr_err("%s:%d: ion_phys map failed\n",
__func__, __LINE__);
return -ENOMEM;
}
} else {
if (ion_map_iommu(msm_rotator_dev->client,
*pihdl, domain, GEN_POOL,
SZ_4K, 0, start, len, 0,
<API key>)) {
pr_err("ion_map_iommu() failed\n");
return -EINVAL;
}
}
} else {
if (ion_map_iommu(msm_rotator_dev->client,
*pihdl, ROTATOR_SRC_DOMAIN, GEN_POOL,
SZ_4K, 0, start, len, 0, <API key>)) {
pr_err("ion_map_iommu() failed\n");
return -EINVAL;
}
}
pr_debug("%s(): mem_id %d, start 0x%lx, len 0x%lx\n",
__func__, mem_id, *start, *len);
return 0;
}
int <API key>(int requestor)
{
int rc = 0;
#ifdef <API key>
switch (requestor) {
case ROTATOR_REQUEST:
if (mutex_trylock(&msm_rotator_dev->imem_lock)) {
msm_rotator_dev->imem_owner = ROTATOR_REQUEST;
rc = 1;
} else
rc = 0;
break;
case JPEG_REQUEST:
mutex_lock(&msm_rotator_dev->imem_lock);
msm_rotator_dev->imem_owner = JPEG_REQUEST;
rc = 1;
break;
default:
rc = 0;
}
#else
if (requestor == JPEG_REQUEST)
rc = 1;
#endif
if (rc == 1) {
cancel_delayed_work(&msm_rotator_dev->imem_clk_work);
if (msm_rotator_dev->imem_clk_state != CLK_EN
&& msm_rotator_dev->imem_clk) {
clk_prepare_enable(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk_state = CLK_EN;
}
}
return rc;
}
EXPORT_SYMBOL(<API key>);
void <API key>(int requestor)
{
#ifdef <API key>
if (msm_rotator_dev->imem_owner == requestor) {
<API key>(&msm_rotator_dev->imem_clk_work, HZ);
mutex_unlock(&msm_rotator_dev->imem_lock);
}
#else
if (requestor == JPEG_REQUEST)
<API key>(&msm_rotator_dev->imem_clk_work, HZ);
#endif
}
EXPORT_SYMBOL(<API key>);
static void <API key>(struct work_struct *work)
{
#ifdef <API key>
if (mutex_trylock(&msm_rotator_dev->imem_lock)) {
if (msm_rotator_dev->imem_clk_state == CLK_EN
&& msm_rotator_dev->imem_clk) {
<API key>(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk_state = CLK_DIS;
} else if (msm_rotator_dev->imem_clk_state == CLK_SUSPEND)
msm_rotator_dev->imem_clk_state = CLK_DIS;
mutex_unlock(&msm_rotator_dev->imem_lock);
}
#endif
}
/* enable clocks needed by rotator block */
static void enable_rot_clks(void)
{
if (msm_rotator_dev->regulator)
regulator_enable(msm_rotator_dev->regulator);
if (msm_rotator_dev->core_clk != NULL)
clk_prepare_enable(msm_rotator_dev->core_clk);
if (msm_rotator_dev->pclk != NULL)
clk_prepare_enable(msm_rotator_dev->pclk);
}
/* disable clocks needed by rotator block */
static void disable_rot_clks(void)
{
if (msm_rotator_dev->core_clk != NULL)
<API key>(msm_rotator_dev->core_clk);
if (msm_rotator_dev->pclk != NULL)
<API key>(msm_rotator_dev->pclk);
if (msm_rotator_dev->regulator)
regulator_disable(msm_rotator_dev->regulator);
}
static void <API key>(struct work_struct *work)
{
if (mutex_trylock(&msm_rotator_dev->rotator_lock)) {
if (msm_rotator_dev->rot_clk_state == CLK_EN) {
disable_rot_clks();
msm_rotator_dev->rot_clk_state = CLK_DIS;
} else if (msm_rotator_dev->rot_clk_state == CLK_SUSPEND)
msm_rotator_dev->rot_clk_state = CLK_DIS;
mutex_unlock(&msm_rotator_dev->rotator_lock);
}
}
static irqreturn_t msm_rotator_isr(int irq, void *dev_id)
{
if (msm_rotator_dev->processing) {
msm_rotator_dev->processing = 0;
wake_up(&msm_rotator_dev->wq);
} else
printk(KERN_WARNING "%s: unexpected interrupt\n", DRIVER_NAME);
return IRQ_HANDLED;
}
static void <API key>(u32 session_index)
{
struct rot_sync_info *sync_info;
sync_info = &msm_rotator_dev->sync_info[session_index];
if ((!sync_info->timeline) || (!sync_info->initialized))
return;
mutex_lock(&sync_info->sync_mutex);
<API key>(sync_info->timeline, 1);
sync_info->timeline_value++;
mutex_unlock(&sync_info->sync_mutex);
}
static void <API key>(u32 session_index)
{
struct rot_sync_info *sync_info;
sync_info = &msm_rotator_dev->sync_info[session_index];
if ((sync_info->timeline == NULL) ||
(sync_info->initialized == false))
return;
mutex_lock(&sync_info->sync_mutex);
<API key>(sync_info->timeline, 1);
sync_info->timeline_value++;
if (atomic_read(&sync_info->queue_buf_cnt) <= 0)
pr_err("%s queue_buf_cnt=%d", __func__,
atomic_read(&sync_info->queue_buf_cnt));
else
atomic_dec(&sync_info->queue_buf_cnt);
mutex_unlock(&sync_info->sync_mutex);
}
static void <API key>(u32 session_index)
{
struct rot_sync_info *sync_info;
sync_info = &msm_rotator_dev->sync_info[session_index];
if ((!sync_info->timeline) || (!sync_info->initialized))
return;
mutex_lock(&sync_info->sync_mutex);
sync_info->acq_fen = NULL;
mutex_unlock(&sync_info->sync_mutex);
}
static void <API key>(void)
{
int i;
struct rot_sync_info *sync_info;
for (i = 0; i < MAX_SESSIONS; i++) {
sync_info = &msm_rotator_dev->sync_info[i];
if (sync_info->initialized) {
<API key>(i);
<API key>(i);
}
}
}
static void <API key>(struct sync_fence *acq_fen)
{
int ret;
if (acq_fen) {
ret = sync_fence_wait(acq_fen,
<API key>);
if (ret == -ETIME) {
pr_warn("%s: timeout, wait %ld more ms\n",
__func__, <API key>);
ret = sync_fence_wait(acq_fen,
<API key>);
}
if (ret < 0) {
pr_err("%s: sync_fence_wait failed! ret = %x\n",
__func__, ret);
}
sync_fence_put(acq_fen);
}
}
static int <API key>(unsigned long arg)
{
struct <API key> buf_sync;
int ret = 0;
struct sync_fence *fence = NULL;
struct rot_sync_info *sync_info;
struct sync_pt *rel_sync_pt;
struct sync_fence *rel_fence;
int rel_fen_fd;
u32 s;
if (copy_from_user(&buf_sync, (void __user *)arg, sizeof(buf_sync)))
return -EFAULT;
<API key>(false);
for (s = 0; s < MAX_SESSIONS; s++)
if ((msm_rotator_dev->rot_session[s] != NULL) &&
(buf_sync.session_id ==
(unsigned int)msm_rotator_dev->rot_session[s]
))
break;
if (s == MAX_SESSIONS) {
pr_err("%s invalid session id %d", __func__,
buf_sync.session_id);
return -EINVAL;
}
sync_info = &msm_rotator_dev->sync_info[s];
if (sync_info->acq_fen)
pr_err("%s previous acq_fen will be overwritten", __func__);
if ((sync_info->timeline == NULL) ||
(sync_info->initialized == false))
return -EINVAL;
mutex_lock(&sync_info->sync_mutex);
if (buf_sync.acq_fen_fd >= 0)
fence = sync_fence_fdget(buf_sync.acq_fen_fd);
sync_info->acq_fen = fence;
if (sync_info->acq_fen &&
(buf_sync.flags & <API key>)) {
<API key>(sync_info->acq_fen);
sync_info->acq_fen = NULL;
}
rel_sync_pt = sw_sync_pt_create(sync_info->timeline,
sync_info->timeline_value +
atomic_read(&sync_info->queue_buf_cnt) + 1);
if (rel_sync_pt == NULL) {
pr_err("%s: cannot create sync point", __func__);
ret = -ENOMEM;
goto buf_sync_err_1;
}
/* create fence */
rel_fence = sync_fence_create("msm_rotator-fence",
rel_sync_pt);
if (rel_fence == NULL) {
sync_pt_free(rel_sync_pt);
pr_err("%s: cannot create fence", __func__);
ret = -ENOMEM;
goto buf_sync_err_1;
}
/* create fd */
rel_fen_fd = get_unused_fd_flags(0);
if (rel_fen_fd < 0) {
pr_err("%s: get_unused_fd_flags failed", __func__);
ret = -EIO;
goto buf_sync_err_2;
}
sync_fence_install(rel_fence, rel_fen_fd);
buf_sync.rel_fen_fd = rel_fen_fd;
sync_info->rel_fen = rel_fence;
sync_info->rel_fen_fd = rel_fen_fd;
ret = copy_to_user((void __user *)arg, &buf_sync, sizeof(buf_sync));
mutex_unlock(&sync_info->sync_mutex);
return ret;
buf_sync_err_2:
sync_fence_put(rel_fence);
buf_sync_err_1:
if (sync_info->acq_fen)
sync_fence_put(sync_info->acq_fen);
sync_info->acq_fen = NULL;
mutex_unlock(&sync_info->sync_mutex);
return ret;
}
static unsigned int tile_size(unsigned int src_width,
unsigned int src_height,
const struct tile_parm *tp)
{
unsigned int tile_w, tile_h;
unsigned int row_num_w, row_num_h;
tile_w = tp->width * tp->row_tile_w;
tile_h = tp->height * tp->row_tile_h;
row_num_w = (src_width + tile_w - 1) / tile_w;
row_num_h = (src_height + tile_h - 1) / tile_h;
return ((row_num_w * row_num_h * tile_w * tile_h) + 8191) & ~8191;
}
static int get_bpp(int format)
{
switch (format) {
case MDP_RGB_565:
case MDP_BGR_565:
return 2;
case MDP_XRGB_8888:
case MDP_ARGB_8888:
case MDP_RGBA_8888:
case MDP_BGRA_8888:
case MDP_RGBX_8888:
return 4;
case MDP_Y_CBCR_H2V2:
case MDP_Y_CRCB_H2V2:
case MDP_Y_CB_CR_H2V2:
case MDP_Y_CR_CB_H2V2:
case MDP_Y_CR_CB_GH2V2:
case <API key>:
case <API key>:
return 1;
case MDP_RGB_888:
case MDP_YCBCR_H1V1:
case MDP_YCRCB_H1V1:
return 3;
case MDP_YCRYCB_H2V1:
return 2;/* YCrYCb interleave */
case MDP_Y_CRCB_H2V1:
case MDP_Y_CBCR_H2V1:
return 1;
default:
return -1;
}
}
static int <API key>(uint32_t format, uint32_t w, uint32_t h,
struct <API key> *p)
{
/*
* each row of samsung tile consists of two tiles in height
* and two tiles in width which means width should align to
* 64 x 2 bytes and height should align to 32 x 2 bytes.
* video decoder generate two tiles in width and one tile
* in height which ends up height align to 32 X 1 bytes.
*/
const struct tile_parm tile = {64, 32, 2, 1};
int i;
if (p == NULL)
return -EINVAL;
if ((w > MSM_ROTATOR_MAX_W) || (h > MSM_ROTATOR_MAX_H))
return -ERANGE;
memset(p, 0, sizeof(*p));
switch (format) {
case MDP_XRGB_8888:
case MDP_ARGB_8888:
case MDP_RGBA_8888:
case MDP_BGRA_8888:
case MDP_RGBX_8888:
case MDP_RGB_888:
case MDP_RGB_565:
case MDP_BGR_565:
case MDP_YCRYCB_H2V1:
case MDP_YCBCR_H1V1:
case MDP_YCRCB_H1V1:
p->num_planes = 1;
p->plane_size[0] = w * h * get_bpp(format);
break;
case MDP_Y_CRCB_H2V1:
case MDP_Y_CBCR_H2V1:
case MDP_Y_CRCB_H1V2:
case MDP_Y_CBCR_H1V2:
p->num_planes = 2;
p->plane_size[0] = w * h;
p->plane_size[1] = w * h;
break;
case MDP_Y_CBCR_H2V2:
case MDP_Y_CRCB_H2V2:
p->num_planes = 2;
p->plane_size[0] = w * h;
p->plane_size[1] = w * h / 2;
break;
case <API key>:
case <API key>:
p->num_planes = 2;
p->plane_size[0] = tile_size(w, h, &tile);
p->plane_size[1] = tile_size(w, h/2, &tile);
break;
case MDP_Y_CB_CR_H2V2:
case MDP_Y_CR_CB_H2V2:
p->num_planes = 3;
p->plane_size[0] = w * h;
p->plane_size[1] = (w / 2) * (h / 2);
p->plane_size[2] = (w / 2) * (h / 2);
break;
case MDP_Y_CR_CB_GH2V2:
p->num_planes = 3;
p->plane_size[0] = ALIGN(w, 16) * h;
p->plane_size[1] = ALIGN(w / 2, 16) * (h / 2);
p->plane_size[2] = ALIGN(w / 2, 16) * (h / 2);
break;
default:
return -EINVAL;
}
for (i = 0; i < p->num_planes; i++)
p->total_size += p->plane_size[i];
return 0;
}
/* Checking invalid destination image size on FAST YUV for YUV420PP(NV12) with
* HW issue for rotation 90 + U/D filp + with/without flip operation
* (rotation 90 + U/D + L/R flip is rotation 270 degree option) and pix_rot
* block issue with tile line size is 4.
*
* Rotator structure is:
* if Fetch input image: W x H,
* Downscale: W` x H` = W/ScaleHor(2, 4 or 8) x H/ScaleVert(2, 4 or 8)
* Rotated output : W`` x H`` = (W` x H`) or (H` x W`) depends on "Rotation 90
* degree option"
*
* Pack: W`` x H``
*
* Rotator source ROI image width restriction is applied to W x H (case a,
* image resolution before downscaling)
*
* Packer source Image width/ height restriction are applied to W`` x H``
* (case c, image resolution after rotation)
*
* Supertile (64 x 8) and YUV (2 x 2) alignment restriction should be
* applied to the W x H (case a). Input image should be at least (2 x 2).
*
* "Support If packer source image height <= 256, multiple of 8", this
* restriction should be applied to the rotated image (W`` x H``)
*/
uint32_t <API key>(unsigned char rot_mode,
uint32_t src_width,
uint32_t dst_width,
uint32_t dst_height,
uint32_t dstp0_ystride,
uint32_t is_planar420)
{
uint32_t hw_limit;
hw_limit = is_planar420 ? 512 : 256;
/* checking image constaints for missing EOT event from pix_rot block */
if ((src_width > hw_limit) && ((src_width % (hw_limit / 2)) == 8))
return -EINVAL;
if (rot_mode & MDP_ROT_90) {
/* if rotation 90 degree on fast yuv
* rotator image input width has to be multiple of 8
* rotator image input height has to be multiple of 8
*/
if (((dst_width % 8) != 0) || ((dst_height % 8) != 0))
return -EINVAL;
if ((rot_mode & MDP_FLIP_UD) ||
(rot_mode & (MDP_FLIP_UD | MDP_FLIP_LR))) {
/* image constraint checking for wrong address
* generation HW issue for Y plane checking
*/
if (((dst_height % 64) != 0) &&
((dst_height / 64) >= 4)) {
/* compare golden logic for second
* tile base address generation in row
* with actual HW implementation
*/
if (BASE_ADDR(dst_height, dstp0_ystride) !=
HW_BASE_ADDR(dst_height, dstp0_ystride))
return -EINVAL;
}
if (is_planar420) {
dst_width = dst_width / 2;
dstp0_ystride = dstp0_ystride / 2;
}
dst_height = dst_height / 2;
/* image constraint checking for wrong
* address generation HW issue. for
* U/V (P) or UV (PP) plane checking
*/
if (((dst_height % 64) != 0) && ((dst_height / 64) >=
(hw_limit / 128))) {
/* compare golden logic for
* second tile base address
* generation in row with
* actual HW implementation
*/
if (BASE_ADDR(dst_height, dstp0_ystride) !=
HW_BASE_ADDR(dst_height, dstp0_ystride))
return -EINVAL;
}
}
} else {
/* if NOT applying rotation 90 degree on fast yuv,
* rotator image input width has to be multiple of 8
* rotator image input height has to be multiple of 2
*/
if (((dst_width % 8) != 0) || ((dst_height % 2) != 0))
return -EINVAL;
}
return 0;
}
static int <API key>(struct <API key> *info,
unsigned int in_paddr,
unsigned int out_paddr,
unsigned int use_imem,
int new_session,
unsigned int in_chroma_paddr,
unsigned int out_chroma_paddr)
{
uint32_t dst_format;
int bpp;
switch (info->src.format) {
case MDP_Y_CRCB_H2V1:
if (info->rotations & MDP_ROT_90)
dst_format = MDP_Y_CRCB_H1V2;
else
dst_format = MDP_Y_CRCB_H2V1;
break;
case MDP_Y_CBCR_H2V1:
if (info->rotations & MDP_ROT_90)
dst_format = MDP_Y_CBCR_H1V2;
else
dst_format = MDP_Y_CBCR_H2V1;
break;
default:
return -EINVAL;
}
if (info->dst.format != dst_format)
return -EINVAL;
bpp = get_bpp(info->src.format);
if (bpp < 0)
return -ENOTTY;
iowrite32(in_paddr, <API key>);
iowrite32(in_chroma_paddr, <API key>);
iowrite32(out_paddr +
((info->dst_y * info->dst.width) + info->dst_x),
<API key>);
iowrite32(out_chroma_paddr +
((info->dst_y * info->dst.width) + info->dst_x),
<API key>);
if (new_session) {
iowrite32(info->src.width |
info->src.width << 16,
<API key>);
if (info->rotations & MDP_ROT_90)
iowrite32(info->dst.width |
info->dst.width*2 << 16,
<API key>);
else
iowrite32(info->dst.width |
info->dst.width << 16,
<API key>);
if (info->src.format == MDP_Y_CBCR_H2V1) {
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
<API key>);
} else {
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
<API key>);
}
iowrite32((1 << 18) | /* chroma sampling 1=H2V1 */
(<API key>(info->rotations) << 9) |
1 << 8 | /* ROT_EN */
info->downscale_ratio << 2 | /* downscale v ratio */
info->downscale_ratio, /* downscale h ratio */
<API key>);
iowrite32(0 << 29 | /* frame format 0 = linear */
(use_imem ? 0 : 1) << 22 | /* tile size */
2 << 19 | /* fetch planes 2 = pseudo */
0 << 18 | /* unpack align */
1 << 17 | /* unpack tight */
1 << 13 | /* unpack count 0=1 component */
(bpp-1) << 9 | /* src Bpp 0=1 byte ... */
0 << 8 | /* has alpha */
0 << 6 | /* alpha bits 3=8bits */
3 << 4 | /* R/Cr bits 1=5 2=6 3=8 */
3 << 2 | /* B/Cb bits 1=5 2=6 3=8 */
3 << 0, /* G/Y bits 1=5 2=6 3=8 */
<API key>);
}
return 0;
}
static int <API key>(struct <API key> *info,
unsigned int in_paddr,
unsigned int out_paddr,
unsigned int use_imem,
int new_session,
unsigned int in_chroma_paddr,
unsigned int out_chroma_paddr,
unsigned int in_chroma2_paddr,
unsigned int out_chroma2_paddr,
int fast_yuv_en)
{
uint32_t dst_format;
int is_tile = 0;
switch (info->src.format) {
case <API key>:
is_tile = 1;
dst_format = MDP_Y_CRCB_H2V2;
break;
case MDP_Y_CR_CB_H2V2:
case MDP_Y_CR_CB_GH2V2:
if (fast_yuv_en) {
dst_format = info->src.format;
break;
}
case MDP_Y_CRCB_H2V2:
dst_format = MDP_Y_CRCB_H2V2;
break;
case MDP_Y_CB_CR_H2V2:
if (fast_yuv_en) {
dst_format = info->src.format;
break;
}
dst_format = MDP_Y_CBCR_H2V2;
break;
case <API key>:
is_tile = 1;
case MDP_Y_CBCR_H2V2:
dst_format = MDP_Y_CBCR_H2V2;
break;
default:
return -EINVAL;
}
if (info->dst.format != dst_format)
return -EINVAL;
/* rotator expects YCbCr for planar input format */
if ((info->src.format == MDP_Y_CR_CB_H2V2 ||
info->src.format == MDP_Y_CR_CB_GH2V2) &&
rotator_hw_revision < ROTATOR_REVISION_V2)
swap(in_chroma_paddr, in_chroma2_paddr);
iowrite32(in_paddr, <API key>);
iowrite32(in_chroma_paddr, <API key>);
iowrite32(in_chroma2_paddr, <API key>);
iowrite32(out_paddr +
((info->dst_y * info->dst.width) + info->dst_x),
<API key>);
iowrite32(out_chroma_paddr +
(((info->dst_y * info->dst.width)/2) + info->dst_x),
<API key>);
if (out_chroma2_paddr)
iowrite32(out_chroma2_paddr +
(((info->dst_y * info->dst.width)/2) + info->dst_x),
<API key>);
if (new_session) {
if (in_chroma2_paddr) {
if (info->src.format == MDP_Y_CR_CB_GH2V2) {
iowrite32(ALIGN(info->src.width, 16) |
ALIGN((info->src.width / 2), 16) << 16,
<API key>);
iowrite32(ALIGN((info->src.width / 2), 16),
<API key>);
} else {
iowrite32(info->src.width |
(info->src.width / 2) << 16,
<API key>);
iowrite32((info->src.width / 2),
<API key>);
}
} else {
iowrite32(info->src.width |
info->src.width << 16,
<API key>);
}
if (out_chroma2_paddr) {
if (info->dst.format == MDP_Y_CR_CB_GH2V2) {
iowrite32(ALIGN(info->dst.width, 16) |
ALIGN((info->dst.width / 2), 16) << 16,
<API key>);
iowrite32(ALIGN((info->dst.width / 2), 16),
<API key>);
} else {
iowrite32(info->dst.width |
info->dst.width/2 << 16,
<API key>);
iowrite32(info->dst.width/2,
<API key>);
}
} else {
iowrite32(info->dst.width |
info->dst.width << 16,
<API key>);
}
if (dst_format == MDP_Y_CBCR_H2V2 ||
dst_format == MDP_Y_CB_CR_H2V2) {
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CB, CLR_CR, 8),
<API key>);
} else {
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
<API key>);
}
iowrite32((3 << 18) | /* chroma sampling 3=4:2:0 */
(<API key>(info->rotations) << 9) |
1 << 8 | /* ROT_EN */
fast_yuv_en << 4 | /*fast YUV*/
info->downscale_ratio << 2 | /* downscale v ratio */
info->downscale_ratio, /* downscale h ratio */
<API key>);
iowrite32((is_tile ? 2 : 0) << 29 | /* frame format */
(use_imem ? 0 : 1) << 22 | /* tile size */
(in_chroma2_paddr ? 1 : 2) << 19 | /* fetch planes */
0 << 18 | /* unpack align */
1 << 17 | /* unpack tight */
1 << 13 | /* unpack count 0=1 component */
0 << 9 | /* src Bpp 0=1 byte ... */
0 << 8 | /* has alpha */
0 << 6 | /* alpha bits 3=8bits */
3 << 4 | /* R/Cr bits 1=5 2=6 3=8 */
3 << 2 | /* B/Cb bits 1=5 2=6 3=8 */
3 << 0, /* G/Y bits 1=5 2=6 3=8 */
<API key>);
}
return 0;
}
static int msm_rotator_ycrycb(struct <API key> *info,
unsigned int in_paddr,
unsigned int out_paddr,
unsigned int use_imem,
int new_session,
unsigned int out_chroma_paddr)
{
int bpp;
uint32_t dst_format;
if (info->src.format == MDP_YCRYCB_H2V1) {
if (info->rotations & MDP_ROT_90)
dst_format = MDP_Y_CRCB_H1V2;
else
dst_format = MDP_Y_CRCB_H2V1;
} else
return -EINVAL;
if (info->dst.format != dst_format)
return -EINVAL;
bpp = get_bpp(info->src.format);
if (bpp < 0)
return -ENOTTY;
iowrite32(in_paddr, <API key>);
iowrite32(out_paddr +
((info->dst_y * info->dst.width) + info->dst_x),
<API key>);
iowrite32(out_chroma_paddr +
((info->dst_y * info->dst.width)/2 + info->dst_x),
<API key>);
if (new_session) {
iowrite32(info->src.width * bpp,
<API key>);
if (info->rotations & MDP_ROT_90)
iowrite32(info->dst.width |
(info->dst.width*2) << 16,
<API key>);
else
iowrite32(info->dst.width |
(info->dst.width) << 16,
<API key>);
iowrite32(GET_PACK_PATTERN(CLR_Y, CLR_CR, CLR_Y, CLR_CB, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, 0, CLR_CR, CLR_CB, 8),
<API key>);
iowrite32((1 << 18) | /* chroma sampling 1=H2V1 */
(<API key>(info->rotations) << 9) |
1 << 8 | /* ROT_EN */
info->downscale_ratio << 2 | /* downscale v ratio */
info->downscale_ratio, /* downscale h ratio */
<API key>);
iowrite32(0 << 29 | /* frame format 0 = linear */
(use_imem ? 0 : 1) << 22 | /* tile size */
0 << 19 | /* fetch planes 0=interleaved */
0 << 18 | /* unpack align */
1 << 17 | /* unpack tight */
3 << 13 | /* unpack count 0=1 component */
(bpp-1) << 9 | /* src Bpp 0=1 byte ... */
0 << 8 | /* has alpha */
0 << 6 | /* alpha bits 3=8bits */
3 << 4 | /* R/Cr bits 1=5 2=6 3=8 */
3 << 2 | /* B/Cb bits 1=5 2=6 3=8 */
3 << 0, /* G/Y bits 1=5 2=6 3=8 */
<API key>);
}
return 0;
}
static int <API key>(struct <API key> *info,
unsigned int in_paddr,
unsigned int out_paddr,
unsigned int use_imem,
int new_session)
{
int bpp, abits, rbits, gbits, bbits;
if (info->src.format != info->dst.format)
return -EINVAL;
bpp = get_bpp(info->src.format);
if (bpp < 0)
return -ENOTTY;
iowrite32(in_paddr, <API key>);
iowrite32(out_paddr +
((info->dst_y * info->dst.width) + info->dst_x) * bpp,
<API key>);
if (new_session) {
iowrite32(info->src.width * bpp, <API key>);
iowrite32(info->dst.width * bpp, <API key>);
iowrite32((0 << 18) | /* chroma sampling 0=rgb */
(<API key>(info->rotations) << 9) |
1 << 8 | /* ROT_EN */
info->downscale_ratio << 2 | /* downscale v ratio */
info->downscale_ratio, /* downscale h ratio */
<API key>);
switch (info->src.format) {
case MDP_RGB_565:
iowrite32(GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
<API key>);
abits = 0;
rbits = COMPONENT_5BITS;
gbits = COMPONENT_6BITS;
bbits = COMPONENT_5BITS;
break;
case MDP_BGR_565:
iowrite32(GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, CLR_B, CLR_G, CLR_R, 8),
<API key>);
abits = 0;
rbits = COMPONENT_5BITS;
gbits = COMPONENT_6BITS;
bbits = COMPONENT_5BITS;
break;
case MDP_RGB_888:
case MDP_YCBCR_H1V1:
case MDP_YCRCB_H1V1:
iowrite32(GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(0, CLR_R, CLR_G, CLR_B, 8),
<API key>);
abits = 0;
rbits = COMPONENT_8BITS;
gbits = COMPONENT_8BITS;
bbits = COMPONENT_8BITS;
break;
case MDP_ARGB_8888:
case MDP_RGBA_8888:
case MDP_XRGB_8888:
case MDP_RGBX_8888:
iowrite32(GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G,
CLR_B, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(CLR_ALPHA, CLR_R, CLR_G,
CLR_B, 8),
<API key>);
abits = COMPONENT_8BITS;
rbits = COMPONENT_8BITS;
gbits = COMPONENT_8BITS;
bbits = COMPONENT_8BITS;
break;
case MDP_BGRA_8888:
iowrite32(GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G,
CLR_R, 8),
<API key>);
iowrite32(GET_PACK_PATTERN(CLR_ALPHA, CLR_B, CLR_G,
CLR_R, 8),
<API key>);
abits = COMPONENT_8BITS;
rbits = COMPONENT_8BITS;
gbits = COMPONENT_8BITS;
bbits = COMPONENT_8BITS;
break;
default:
return -EINVAL;
}
iowrite32(0 << 29 | /* frame format 0 = linear */
(use_imem ? 0 : 1) << 22 | /* tile size */
0 << 19 | /* fetch planes 0=interleaved */
0 << 18 | /* unpack align */
1 << 17 | /* unpack tight */
(abits ? 3 : 2) << 13 | /* unpack count 0=1 comp */
(bpp-1) << 9 | /* src Bpp 0=1 byte ... */
(abits ? 1 : 0) << 8 | /* has alpha */
abits << 6 | /* alpha bits 3=8bits */
rbits << 4 | /* R/Cr bits 1=5 2=6 3=8 */
bbits << 2 | /* B/Cb bits 1=5 2=6 3=8 */
gbits << 0, /* G/Y bits 1=5 2=6 3=8 */
<API key>);
}
return 0;
}
static int get_img(struct msmfb_data *fbd, int domain,
unsigned long *start, unsigned long *len, struct file **p_file,
int *p_need, struct ion_handle **p_ihdl, unsigned int secure)
{
int ret = 0;
#ifdef CONFIG_FB
struct file *file = NULL;
int put_needed, fb_num;
#endif
#ifdef CONFIG_ANDROID_PMEM
unsigned long vstart;
#endif
*p_need = 0;
#ifdef CONFIG_FB
if (fbd->flags & <API key>) {
file = fget_light(fbd->memory_id, &put_needed);
if (file == NULL) {
pr_err("fget_light returned NULL\n");
return -EINVAL;
}
if (MAJOR(file->f_dentry->d_inode->i_rdev) == FB_MAJOR) {
fb_num = MINOR(file->f_dentry->d_inode->i_rdev);
if (get_fb_phys_info(start, len, fb_num,
<API key>)) {
pr_err("get_fb_phys_info() failed\n");
ret = -1;
} else {
*p_file = file;
*p_need = put_needed;
}
} else {
pr_err("invalid FB_MAJOR failed\n");
ret = -1;
}
if (ret)
fput_light(file, put_needed);
return ret;
}
#endif
#ifdef <API key>
return <API key>(fbd->memory_id, domain, start,
len, p_ihdl, secure);
#endif
#ifdef CONFIG_ANDROID_PMEM
if (!get_pmem_file(fbd->memory_id, start, &vstart, len, p_file))
return 0;
else
return -ENOMEM;
#endif
}
static void put_img(struct file *p_file, struct ion_handle *p_ihdl,
int domain, unsigned int secure)
{
#ifdef CONFIG_ANDROID_PMEM
if (p_file != NULL)
put_pmem_file(p_file);
#endif
#ifdef <API key>
if (!IS_ERR_OR_NULL(p_ihdl)) {
pr_debug("%s(): p_ihdl %p\n", __func__, p_ihdl);
if (<API key>) {
if (!secure)
ion_unmap_iommu(msm_rotator_dev->client,
p_ihdl, domain, GEN_POOL);
} else {
ion_unmap_iommu(msm_rotator_dev->client,
p_ihdl, ROTATOR_SRC_DOMAIN, GEN_POOL);
}
ion_free(msm_rotator_dev->client, p_ihdl);
}
#endif
}
static int <API key>(
struct <API key> *data_info,
struct <API key> *commit_info)
{
unsigned int format;
struct <API key> info;
unsigned int in_paddr, out_paddr;
unsigned long src_len, dst_len;
int rc = 0, s;
struct file *srcp0_file = NULL, *dstp0_file = NULL;
struct file *srcp1_file = NULL, *dstp1_file = NULL;
struct ion_handle *srcp0_ihdl = NULL, *dstp0_ihdl = NULL;
struct ion_handle *srcp1_ihdl = NULL, *dstp1_ihdl = NULL;
int ps0_need, p_need;
unsigned int in_chroma_paddr = 0, out_chroma_paddr = 0;
unsigned int in_chroma2_paddr = 0, out_chroma2_paddr = 0;
struct <API key> *img_info;
struct <API key> src_planes, dst_planes;
mutex_lock(&msm_rotator_dev->rotator_lock);
info = *data_info;
for (s = 0; s < MAX_SESSIONS; s++)
if ((msm_rotator_dev->rot_session[s] != NULL) &&
(info.session_id ==
(unsigned int)msm_rotator_dev->rot_session[s]
))
break;
if (s == MAX_SESSIONS) {
pr_err("%s() : Attempt to use invalid session_id %d\n",
__func__, s);
rc = -EINVAL;
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
img_info = &(msm_rotator_dev->rot_session[s]->img_info);
if (img_info->enable == 0) {
dev_dbg(msm_rotator_dev->device,
"%s() : Session_id %d not enabled\n", __func__, s);
rc = -EINVAL;
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
if (<API key>(img_info->src.format,
img_info->src.width,
img_info->src.height,
&src_planes)) {
pr_err("%s: invalid src format\n", __func__);
rc = -EINVAL;
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
if (<API key>(img_info->dst.format,
img_info->dst.width,
img_info->dst.height,
&dst_planes)) {
pr_err("%s: invalid dst format\n", __func__);
rc = -EINVAL;
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
rc = get_img(&info.src, ROTATOR_SRC_DOMAIN, (unsigned long *)&in_paddr,
(unsigned long *)&src_len, &srcp0_file, &ps0_need,
&srcp0_ihdl, 0);
if (rc) {
pr_err("%s: in get_img() failed id=0x%08x\n",
DRIVER_NAME, info.src.memory_id);
goto <API key>;
}
rc = get_img(&info.dst, ROTATOR_DST_DOMAIN, (unsigned long *)&out_paddr,
(unsigned long *)&dst_len, &dstp0_file, &p_need,
&dstp0_ihdl, img_info->secure);
if (rc) {
pr_err("%s: out get_img() failed id=0x%08x\n",
DRIVER_NAME, info.dst.memory_id);
goto <API key>;
}
format = img_info->src.format;
if (((info.version_key & VERSION_KEY_MASK) == 0xA5B4C300) &&
((info.version_key & ~VERSION_KEY_MASK) > 0) &&
(src_planes.num_planes == 2)) {
if (checkoffset(info.src.offset,
src_planes.plane_size[0],
src_len)) {
pr_err("%s: invalid src buffer (len=%lu offset=%x)\n",
__func__, src_len, info.src.offset);
rc = -ERANGE;
goto <API key>;
}
if (checkoffset(info.dst.offset,
dst_planes.plane_size[0],
dst_len)) {
pr_err("%s: invalid dst buffer (len=%lu offset=%x)\n",
__func__, dst_len, info.dst.offset);
rc = -ERANGE;
goto <API key>;
}
rc = get_img(&info.src_chroma, ROTATOR_SRC_DOMAIN,
(unsigned long *)&in_chroma_paddr,
(unsigned long *)&src_len, &srcp1_file, &p_need,
&srcp1_ihdl, 0);
if (rc) {
pr_err("%s: in chroma get_img() failed id=0x%08x\n",
DRIVER_NAME, info.src_chroma.memory_id);
goto <API key>;
}
rc = get_img(&info.dst_chroma, ROTATOR_DST_DOMAIN,
(unsigned long *)&out_chroma_paddr,
(unsigned long *)&dst_len, &dstp1_file, &p_need,
&dstp1_ihdl, img_info->secure);
if (rc) {
pr_err("%s: out chroma get_img() failed id=0x%08x\n",
DRIVER_NAME, info.dst_chroma.memory_id);
goto <API key>;
}
if (checkoffset(info.src_chroma.offset,
src_planes.plane_size[1],
src_len)) {
pr_err("%s: invalid chr src buf len=%lu offset=%x\n",
__func__, src_len, info.src_chroma.offset);
rc = -ERANGE;
goto <API key>;
}
if (checkoffset(info.dst_chroma.offset,
src_planes.plane_size[1],
dst_len)) {
pr_err("%s: invalid chr dst buf len=%lu offset=%x\n",
__func__, dst_len, info.dst_chroma.offset);
rc = -ERANGE;
goto <API key>;
}
in_chroma_paddr += info.src_chroma.offset;
out_chroma_paddr += info.dst_chroma.offset;
} else {
if (checkoffset(info.src.offset,
src_planes.total_size,
src_len)) {
pr_err("%s: invalid src buffer (len=%lu offset=%x)\n",
__func__, src_len, info.src.offset);
rc = -ERANGE;
goto <API key>;
}
if (checkoffset(info.dst.offset,
dst_planes.total_size,
dst_len)) {
pr_err("%s: invalid dst buffer (len=%lu offset=%x)\n",
__func__, dst_len, info.dst.offset);
rc = -ERANGE;
goto <API key>;
}
}
in_paddr += info.src.offset;
out_paddr += info.dst.offset;
if (!in_chroma_paddr && src_planes.num_planes >= 2)
in_chroma_paddr = in_paddr + src_planes.plane_size[0];
if (!out_chroma_paddr && dst_planes.num_planes >= 2)
out_chroma_paddr = out_paddr + dst_planes.plane_size[0];
if (src_planes.num_planes >= 3)
in_chroma2_paddr = in_chroma_paddr + src_planes.plane_size[1];
if (dst_planes.num_planes >= 3)
out_chroma2_paddr = out_chroma_paddr + dst_planes.plane_size[1];
commit_info->data_info = info;
commit_info->img_info = *img_info;
commit_info->format = format;
commit_info->in_paddr = in_paddr;
commit_info->out_paddr = out_paddr;
commit_info->in_chroma_paddr = in_chroma_paddr;
commit_info->out_chroma_paddr = out_chroma_paddr;
commit_info->in_chroma2_paddr = in_chroma2_paddr;
commit_info->out_chroma2_paddr = out_chroma2_paddr;
commit_info->srcp0_file = srcp0_file;
commit_info->srcp1_file = srcp1_file;
commit_info->srcp0_ihdl = srcp0_ihdl;
commit_info->srcp1_ihdl = srcp1_ihdl;
commit_info->dstp0_file = dstp0_file;
commit_info->dstp0_ihdl = dstp0_ihdl;
commit_info->dstp1_file = dstp1_file;
commit_info->dstp1_ihdl = dstp1_ihdl;
commit_info->ps0_need = ps0_need;
commit_info->session_index = s;
commit_info->acq_fen = msm_rotator_dev->sync_info[s].acq_fen;
commit_info->fast_yuv_en = mrd->rot_session[s]->fast_yuv_enable;
mutex_unlock(&msm_rotator_dev->rotator_lock);
return 0;
<API key>:
put_img(dstp1_file, dstp1_ihdl, ROTATOR_DST_DOMAIN,
msm_rotator_dev->rot_session[s]->img_info.secure);
put_img(srcp1_file, srcp1_ihdl, ROTATOR_SRC_DOMAIN, 0);
put_img(dstp0_file, dstp0_ihdl, ROTATOR_DST_DOMAIN,
msm_rotator_dev->rot_session[s]->img_info.secure);
/* only source may use frame buffer */
if (info.src.flags & <API key>)
fput_light(srcp0_file, ps0_need);
else
put_img(srcp0_file, srcp0_ihdl, ROTATOR_SRC_DOMAIN, 0);
<API key>(s);
dev_dbg(msm_rotator_dev->device, "%s() returning rc = %d\n",
__func__, rc);
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
static int <API key>(
struct <API key> *commit_info)
{
unsigned int status, format;
struct <API key> info;
unsigned int in_paddr, out_paddr;
int use_imem = 0, rc = 0;
struct file *srcp0_file, *dstp0_file;
struct file *srcp1_file, *dstp1_file;
struct ion_handle *srcp0_ihdl, *dstp0_ihdl;
struct ion_handle *srcp1_ihdl, *dstp1_ihdl;
int s, ps0_need;
unsigned int in_chroma_paddr, out_chroma_paddr;
unsigned int in_chroma2_paddr, out_chroma2_paddr;
struct <API key> *img_info;
mutex_lock(&msm_rotator_dev->rotator_lock);
info = commit_info->data_info;
img_info = &commit_info->img_info;
format = commit_info->format;
in_paddr = commit_info->in_paddr;
out_paddr = commit_info->out_paddr;
in_chroma_paddr = commit_info->in_chroma_paddr;
out_chroma_paddr = commit_info->out_chroma_paddr;
in_chroma2_paddr = commit_info->in_chroma2_paddr;
out_chroma2_paddr = commit_info->out_chroma2_paddr;
srcp0_file = commit_info->srcp0_file;
srcp1_file = commit_info->srcp1_file;
srcp0_ihdl = commit_info->srcp0_ihdl;
srcp1_ihdl = commit_info->srcp1_ihdl;
dstp0_file = commit_info->dstp0_file;
dstp0_ihdl = commit_info->dstp0_ihdl;
dstp1_file = commit_info->dstp1_file;
dstp1_ihdl = commit_info->dstp1_ihdl;
ps0_need = commit_info->ps0_need;
s = commit_info->session_index;
<API key>(commit_info->acq_fen);
commit_info->acq_fen = NULL;
cancel_delayed_work(&msm_rotator_dev->rot_clk_work);
if (msm_rotator_dev->rot_clk_state != CLK_EN) {
enable_rot_clks();
msm_rotator_dev->rot_clk_state = CLK_EN;
}
enable_irq(msm_rotator_dev->irq);
#ifdef <API key>
use_imem = <API key>(ROTATOR_REQUEST);
#else
use_imem = 0;
#endif
/*
* workaround for a hardware bug. rotator hardware hangs when we
* use write burst beat size 16 on 128X128 tile fetch mode. As a
* temporary fix use 0x42 for BURST_SIZE when imem used.
*/
if (use_imem)
iowrite32(0x42, <API key>);
iowrite32(((img_info->src_rect.h & 0x1fff)
<< 16) |
(img_info->src_rect.w & 0x1fff),
<API key>);
iowrite32(((img_info->src_rect.y & 0x1fff)
<< 16) |
(img_info->src_rect.x & 0x1fff),
MSM_ROTATOR_SRC_XY);
iowrite32(((img_info->src.height & 0x1fff)
<< 16) |
(img_info->src.width & 0x1fff),
<API key>);
switch (format) {
case MDP_RGB_565:
case MDP_BGR_565:
case MDP_RGB_888:
case MDP_ARGB_8888:
case MDP_RGBA_8888:
case MDP_XRGB_8888:
case MDP_BGRA_8888:
case MDP_RGBX_8888:
case MDP_YCBCR_H1V1:
case MDP_YCRCB_H1V1:
rc = <API key>(img_info,
in_paddr, out_paddr,
use_imem,
msm_rotator_dev->last_session_idx
!= s);
break;
case MDP_Y_CBCR_H2V2:
case MDP_Y_CRCB_H2V2:
case MDP_Y_CB_CR_H2V2:
case MDP_Y_CR_CB_H2V2:
case MDP_Y_CR_CB_GH2V2:
case <API key>:
case <API key>:
rc = <API key>(img_info,
in_paddr, out_paddr, use_imem,
msm_rotator_dev->last_session_idx
!= s,
in_chroma_paddr,
out_chroma_paddr,
in_chroma2_paddr,
out_chroma2_paddr,
commit_info->fast_yuv_en);
break;
case MDP_Y_CBCR_H2V1:
case MDP_Y_CRCB_H2V1:
rc = <API key>(img_info,
in_paddr, out_paddr, use_imem,
msm_rotator_dev->last_session_idx
!= s,
in_chroma_paddr,
out_chroma_paddr);
break;
case MDP_YCRYCB_H2V1:
rc = msm_rotator_ycrycb(img_info,
in_paddr, out_paddr, use_imem,
msm_rotator_dev->last_session_idx != s,
out_chroma_paddr);
break;
default:
rc = -EINVAL;
pr_err("%s(): Unsupported format %u\n", __func__, format);
goto do_rotate_exit;
}
if (rc != 0) {
msm_rotator_dev->last_session_idx = INVALID_SESSION;
pr_err("%s(): Invalid session error\n", __func__);
goto do_rotate_exit;
}
iowrite32(3, <API key>);
msm_rotator_dev->processing = 1;
iowrite32(0x1, MSM_ROTATOR_START);
mutex_unlock(&msm_rotator_dev->rotator_lock);
wait_event(msm_rotator_dev->wq,
(msm_rotator_dev->processing == 0));
mutex_lock(&msm_rotator_dev->rotator_lock);
status = (unsigned char)ioread32(<API key>);
if ((status & 0x03) != 0x01) {
pr_err("%s(): AXI Bus Error, issuing SW_RESET\n", __func__);
iowrite32(0x1, <API key>);
rc = -EFAULT;
}
iowrite32(0, <API key>);
iowrite32(3, <API key>);
do_rotate_exit:
disable_irq(msm_rotator_dev->irq);
#ifdef <API key>
<API key>(ROTATOR_REQUEST);
#endif
<API key>(&msm_rotator_dev->rot_clk_work, HZ);
put_img(dstp1_file, dstp1_ihdl, ROTATOR_DST_DOMAIN,
img_info->secure);
put_img(srcp1_file, srcp1_ihdl, ROTATOR_SRC_DOMAIN, 0);
put_img(dstp0_file, dstp0_ihdl, ROTATOR_DST_DOMAIN,
img_info->secure);
/* only source may use frame buffer */
if (info.src.flags & <API key>)
fput_light(srcp0_file, ps0_need);
else
put_img(srcp0_file, srcp0_ihdl, ROTATOR_SRC_DOMAIN, 0);
<API key>(s);
mutex_unlock(&msm_rotator_dev->rotator_lock);
dev_dbg(msm_rotator_dev->device, "%s() returning rc = %d\n",
__func__, rc);
return rc;
}
static void <API key>(u32 is_all)
{
int ret = 0;
u32 loop_cnt = 0;
while (1) {
mutex_lock(&mrd->commit_mutex);
if (is_all && (atomic_read(&mrd->commit_q_cnt) == 0))
break;
if ((!is_all) &&
(atomic_read(&mrd->commit_q_cnt) < MAX_COMMIT_QUEUE))
break;
INIT_COMPLETION(mrd->commit_comp);
mutex_unlock(&mrd->commit_mutex);
ret = <API key>(
&mrd->commit_comp,
msecs_to_jiffies(WAIT_ROT_TIMEOUT));
if ((ret <= 0) ||
(atomic_read(&mrd->commit_q_cnt) >= MAX_COMMIT_QUEUE) ||
(loop_cnt > MAX_COMMIT_QUEUE)) {
pr_err("%s wait for commit queue failed ret=%d pointers:%d %d",
__func__, ret, atomic_read(&mrd->commit_q_r),
atomic_read(&mrd->commit_q_w));
mutex_lock(&mrd->commit_mutex);
ret = -ETIME;
break;
} else {
ret = 0;
}
loop_cnt++;
};
if (is_all || ret) {
atomic_set(&mrd->commit_q_r, 0);
atomic_set(&mrd->commit_q_cnt, 0);
atomic_set(&mrd->commit_q_w, 0);
}
mutex_unlock(&mrd->commit_mutex);
}
static int <API key>(unsigned long arg)
{
struct <API key> info;
struct rot_sync_info *sync_info;
int session_index, ret;
int commit_q_w;
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
return -EFAULT;
<API key>(false);
mutex_lock(&mrd->commit_mutex);
commit_q_w = atomic_read(&mrd->commit_q_w);
ret = <API key>(&info,
&mrd->commit_info[commit_q_w]);
if (ret) {
mutex_unlock(&mrd->commit_mutex);
return ret;
}
session_index = mrd->commit_info[commit_q_w].session_index;
sync_info = &msm_rotator_dev->sync_info[session_index];
mutex_lock(&sync_info->sync_mutex);
atomic_inc(&sync_info->queue_buf_cnt);
sync_info->acq_fen = NULL;
mutex_unlock(&sync_info->sync_mutex);
if (atomic_inc_return(&mrd->commit_q_w) >= MAX_COMMIT_QUEUE)
atomic_set(&mrd->commit_q_w, 0);
atomic_inc(&mrd->commit_q_cnt);
schedule_work(&mrd->commit_work);
mutex_unlock(&mrd->commit_mutex);
if (info.wait_for_finish)
<API key>(true);
return 0;
}
static void <API key>(struct work_struct *work)
{
mutex_lock(&mrd->commit_wq_mutex);
mutex_lock(&mrd->commit_mutex);
while (atomic_read(&mrd->commit_q_cnt) > 0) {
mrd->commit_running = true;
mutex_unlock(&mrd->commit_mutex);
<API key>(
&mrd->commit_info[atomic_read(&mrd->commit_q_r)]);
mutex_lock(&mrd->commit_mutex);
if (atomic_read(&mrd->commit_q_cnt) > 0) {
atomic_dec(&mrd->commit_q_cnt);
if (atomic_inc_return(&mrd->commit_q_r) >=
MAX_COMMIT_QUEUE)
atomic_set(&mrd->commit_q_r, 0);
}
complete_all(&mrd->commit_comp);
}
mrd->commit_running = false;
if (atomic_read(&mrd->commit_q_r) != atomic_read(&mrd->commit_q_w))
pr_err("%s invalid state: r=%d w=%d cnt=%d", __func__,
atomic_read(&mrd->commit_q_r),
atomic_read(&mrd->commit_q_w),
atomic_read(&mrd->commit_q_cnt));
mutex_unlock(&mrd->commit_mutex);
mutex_unlock(&mrd->commit_wq_mutex);
}
static void <API key>(u32 wh, u32 is_rgb)
{
u32 perf_level;
if (is_rgb)
perf_level = 1;
else if (wh <= (640 * 480))
perf_level = 2;
else if (wh <= (736 * 1280))
perf_level = 3;
else
perf_level = 4;
#ifdef <API key>
<API key>(msm_rotator_dev->bus_client_handle,
perf_level);
#endif
}
static int <API key>(struct msm_rotator_dev *rot_dev)
{
int ret = 0, i;
if (rot_dev->mmu_clk_on)
return 0;
for (i = 0; i < ARRAY_SIZE(rot_mmu_clks); i++) {
rot_mmu_clks[i].mmu_clk = clk_get(&msm_rotator_dev->pdev->dev,
rot_mmu_clks[i].mmu_clk_name);
if (IS_ERR(rot_mmu_clks[i].mmu_clk)) {
pr_err(" %s: Get failed for clk %s", __func__,
rot_mmu_clks[i].mmu_clk_name);
ret = PTR_ERR(rot_mmu_clks[i].mmu_clk);
break;
}
ret = clk_prepare_enable(rot_mmu_clks[i].mmu_clk);
if (ret) {
clk_put(rot_mmu_clks[i].mmu_clk);
rot_mmu_clks[i].mmu_clk = NULL;
}
}
if (ret) {
for (i--; i >= 0; i--) {
<API key>(rot_mmu_clks[i].mmu_clk);
clk_put(rot_mmu_clks[i].mmu_clk);
rot_mmu_clks[i].mmu_clk = NULL;
}
} else {
rot_dev->mmu_clk_on = 1;
}
return ret;
}
static int <API key>(struct msm_rotator_dev *rot_dev)
{
int i;
if (!rot_dev->mmu_clk_on)
return 0;
for (i = 0; i < ARRAY_SIZE(rot_mmu_clks); i++) {
<API key>(rot_mmu_clks[i].mmu_clk);
clk_put(rot_mmu_clks[i].mmu_clk);
rot_mmu_clks[i].mmu_clk = NULL;
}
rot_dev->mmu_clk_on = 0;
return 0;
}
static int map_sec_resource(struct msm_rotator_dev *rot_dev)
{
int ret = 0;
if (rot_dev->sec_mapped)
return 0;
ret = <API key>(rot_dev);
if (ret) {
pr_err("IOMMU clock enabled failed while open");
return ret;
}
ret = msm_ion_secure_heap(ION_HEAP(ION_CP_MM_HEAP_ID));
if (ret)
pr_err("ION heap secure failed heap id %d ret %d\n",
ION_CP_MM_HEAP_ID, ret);
else
rot_dev->sec_mapped = 1;
<API key>(rot_dev);
return ret;
}
static int unmap_sec_resource(struct msm_rotator_dev *rot_dev)
{
int ret = 0;
ret = <API key>(rot_dev);
if (ret) {
pr_err("IOMMU clock enabled failed while close\n");
return ret;
}
<API key>(ION_HEAP(ION_CP_MM_HEAP_ID));
rot_dev->sec_mapped = 0;
<API key>(rot_dev);
return ret;
}
static int msm_rotator_start(unsigned long arg,
struct msm_rotator_fd_info *fd_info)
{
struct <API key> info;
struct msm_rotator_session *rot_session = NULL;
int rc = 0;
int s, is_rgb = 0;
int first_free_idx = INVALID_SESSION;
unsigned int dst_w, dst_h;
unsigned int is_planar420 = 0;
int fast_yuv_en = 0;
struct rot_sync_info *sync_info;
if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
return -EFAULT;
if ((info.rotations > MSM_ROTATOR_MAX_ROT) ||
(info.src.height > MSM_ROTATOR_MAX_H) ||
(info.src.width > MSM_ROTATOR_MAX_W) ||
(info.dst.height > MSM_ROTATOR_MAX_H) ||
(info.dst.width > MSM_ROTATOR_MAX_W) ||
(info.downscale_ratio > MAX_DOWNSCALE_RATIO)) {
pr_err("%s: Invalid parameters\n", __func__);
return -EINVAL;
}
if (info.rotations & MDP_ROT_90) {
dst_w = info.src_rect.h >> info.downscale_ratio;
dst_h = info.src_rect.w >> info.downscale_ratio;
} else {
dst_w = info.src_rect.w >> info.downscale_ratio;
dst_h = info.src_rect.h >> info.downscale_ratio;
}
if (checkoffset(info.src_rect.x, info.src_rect.w, info.src.width) ||
checkoffset(info.src_rect.y, info.src_rect.h, info.src.height) ||
checkoffset(info.dst_x, dst_w, info.dst.width) ||
checkoffset(info.dst_y, dst_h, info.dst.height)) {
pr_err("%s: Invalid src or dst rect\n", __func__);
return -ERANGE;
}
switch (info.src.format) {
case MDP_Y_CB_CR_H2V2:
case MDP_Y_CR_CB_H2V2:
case MDP_Y_CR_CB_GH2V2:
is_planar420 = 1;
case MDP_Y_CBCR_H2V2:
case MDP_Y_CRCB_H2V2:
case <API key>:
case <API key>:
if (rotator_hw_revision >= ROTATOR_REVISION_V2 &&
!(info.downscale_ratio &&
(info.rotations & MDP_ROT_90)))
fast_yuv_en = !<API key>(
info.rotations,
info.src.width,
dst_w,
dst_h,
dst_w,
is_planar420);
break;
default:
fast_yuv_en = 0;
}
switch (info.src.format) {
case MDP_RGB_565:
case MDP_BGR_565:
case MDP_RGB_888:
case MDP_ARGB_8888:
case MDP_RGBA_8888:
case MDP_XRGB_8888:
case MDP_RGBX_8888:
case MDP_BGRA_8888:
is_rgb = 1;
info.dst.format = info.src.format;
break;
case MDP_Y_CBCR_H2V1:
if (info.rotations & MDP_ROT_90)
info.dst.format = MDP_Y_CBCR_H1V2;
break;
case MDP_Y_CRCB_H2V1:
if (info.rotations & MDP_ROT_90)
info.dst.format = MDP_Y_CRCB_H1V2;
break;
case MDP_Y_CBCR_H2V2:
case MDP_Y_CRCB_H2V2:
case MDP_YCBCR_H1V1:
case MDP_YCRCB_H1V1:
info.dst.format = info.src.format;
break;
case MDP_YCRYCB_H2V1:
if (info.rotations & MDP_ROT_90)
info.dst.format = MDP_Y_CRCB_H1V2;
else
info.dst.format = MDP_Y_CRCB_H2V1;
break;
case MDP_Y_CB_CR_H2V2:
if (fast_yuv_en) {
info.dst.format = info.src.format;
break;
}
case <API key>:
info.dst.format = MDP_Y_CBCR_H2V2;
break;
case MDP_Y_CR_CB_H2V2:
case MDP_Y_CR_CB_GH2V2:
if (fast_yuv_en) {
info.dst.format = info.src.format;
break;
}
case <API key>:
info.dst.format = MDP_Y_CRCB_H2V2;
break;
default:
return -EINVAL;
}
mutex_lock(&msm_rotator_dev->rotator_lock);
<API key>((info.src.width*info.src.height), is_rgb);
for (s = 0; s < MAX_SESSIONS; s++) {
if ((msm_rotator_dev->rot_session[s] != NULL) &&
(info.session_id ==
(unsigned int)msm_rotator_dev->rot_session[s]
)) {
rot_session = msm_rotator_dev->rot_session[s];
rot_session->img_info = info;
rot_session->fd_info = *fd_info;
rot_session->fast_yuv_enable = fast_yuv_en;
if (msm_rotator_dev->last_session_idx == s)
msm_rotator_dev->last_session_idx =
INVALID_SESSION;
break;
}
if ((msm_rotator_dev->rot_session[s] == NULL) &&
(first_free_idx == INVALID_SESSION))
first_free_idx = s;
}
if ((s == MAX_SESSIONS) && (first_free_idx != INVALID_SESSION)) {
/* allocate a session id */
msm_rotator_dev->rot_session[first_free_idx] =
kzalloc(sizeof(struct msm_rotator_session),
GFP_KERNEL);
if (!msm_rotator_dev->rot_session[first_free_idx]) {
printk(KERN_ERR "%s : unable to alloc mem\n",
__func__);
rc = -ENOMEM;
goto rotator_start_exit;
}
info.session_id = (unsigned int)
msm_rotator_dev->rot_session[first_free_idx];
rot_session = msm_rotator_dev->rot_session[first_free_idx];
rot_session->img_info = info;
rot_session->fd_info = *fd_info;
rot_session->fast_yuv_enable = fast_yuv_en;
s = first_free_idx;
} else if (s == MAX_SESSIONS) {
dev_dbg(msm_rotator_dev->device, "%s: all sessions in use\n",
__func__);
rc = -EBUSY;
}
if (rc == 0 && copy_to_user((void __user *)arg, &info, sizeof(info)))
rc = -EFAULT;
if ((rc == 0) && (info.secure))
map_sec_resource(msm_rotator_dev);
sync_info = &msm_rotator_dev->sync_info[s];
if ((rc == 0) && (sync_info->initialized == false)) {
char timeline_name[<API key>];
if (sync_info->timeline == NULL) {
snprintf(timeline_name, sizeof(timeline_name),
"msm_rot_%d", first_free_idx);
sync_info->timeline =
<API key>(timeline_name);
if (sync_info->timeline == NULL)
pr_err("%s: cannot create %s time line",
__func__, timeline_name);
sync_info->timeline_value = 0;
}
mutex_init(&sync_info->sync_mutex);
sync_info->initialized = true;
}
sync_info->acq_fen = NULL;
atomic_set(&sync_info->queue_buf_cnt, 0);
rotator_start_exit:
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
static int msm_rotator_finish(unsigned long arg)
{
int rc = 0;
int s;
unsigned int session_id;
if (copy_from_user(&session_id, (void __user *)arg, sizeof(s)))
return -EFAULT;
mutex_lock(&msm_rotator_dev->rotator_lock);
for (s = 0; s < MAX_SESSIONS; s++) {
if ((msm_rotator_dev->rot_session[s] != NULL) &&
(session_id ==
(unsigned int)msm_rotator_dev->rot_session[s])) {
if (msm_rotator_dev->last_session_idx == s)
msm_rotator_dev->last_session_idx =
INVALID_SESSION;
<API key>(s);
<API key>(s);
kfree(msm_rotator_dev->rot_session[s]);
msm_rotator_dev->rot_session[s] = NULL;
break;
}
}
if (s == MAX_SESSIONS)
rc = -EINVAL;
#ifdef <API key>
<API key>(msm_rotator_dev->bus_client_handle,
0);
#endif
if (msm_rotator_dev->sec_mapped)
unmap_sec_resource(msm_rotator_dev);
mutex_unlock(&msm_rotator_dev->rotator_lock);
return rc;
}
static int
msm_rotator_open(struct inode *inode, struct file *filp)
{
struct msm_rotator_fd_info *tmp, *fd_info = NULL;
int i;
if (filp->private_data)
return -EBUSY;
mutex_lock(&msm_rotator_dev->rotator_lock);
for (i = 0; i < MAX_SESSIONS; i++) {
if (msm_rotator_dev->rot_session[i] == NULL)
break;
}
if (i == MAX_SESSIONS) {
mutex_unlock(&msm_rotator_dev->rotator_lock);
return -EBUSY;
}
list_for_each_entry(tmp, &msm_rotator_dev->fd_list, list) {
if (tmp->pid == current->pid) {
fd_info = tmp;
break;
}
}
if (!fd_info) {
fd_info = kzalloc(sizeof(*fd_info), GFP_KERNEL);
if (!fd_info) {
mutex_unlock(&msm_rotator_dev->rotator_lock);
pr_err("%s: insufficient memory to alloc resources\n",
__func__);
return -ENOMEM;
}
list_add(&fd_info->list, &msm_rotator_dev->fd_list);
fd_info->pid = current->pid;
}
fd_info->ref_cnt++;
mutex_unlock(&msm_rotator_dev->rotator_lock);
filp->private_data = fd_info;
return 0;
}
static int
msm_rotator_close(struct inode *inode, struct file *filp)
{
struct msm_rotator_fd_info *fd_info;
int s;
fd_info = (struct msm_rotator_fd_info *)filp->private_data;
mutex_lock(&msm_rotator_dev->rotator_lock);
if (--fd_info->ref_cnt > 0) {
mutex_unlock(&msm_rotator_dev->rotator_lock);
return 0;
}
for (s = 0; s < MAX_SESSIONS; s++) {
if (msm_rotator_dev->rot_session[s] != NULL &&
&(msm_rotator_dev->rot_session[s]->fd_info) == fd_info) {
pr_debug("%s: freeing rotator session %p (pid %d)\n",
__func__, msm_rotator_dev->rot_session[s],
fd_info->pid);
<API key>(true);
<API key>(s);
kfree(msm_rotator_dev->rot_session[s]);
msm_rotator_dev->rot_session[s] = NULL;
if (msm_rotator_dev->last_session_idx == s)
msm_rotator_dev->last_session_idx =
INVALID_SESSION;
}
}
list_del(&fd_info->list);
kfree(fd_info);
mutex_unlock(&msm_rotator_dev->rotator_lock);
return 0;
}
static long msm_rotator_ioctl(struct file *file, unsigned cmd,
unsigned long arg)
{
struct msm_rotator_fd_info *fd_info;
if (_IOC_TYPE(cmd) != <API key>)
return -ENOTTY;
fd_info = (struct msm_rotator_fd_info *)file->private_data;
switch (cmd) {
case <API key>:
return msm_rotator_start(arg, fd_info);
case <API key>:
return <API key>(arg);
case <API key>:
return msm_rotator_finish(arg);
case <API key>:
return <API key>(arg);
default:
dev_dbg(msm_rotator_dev->device,
"unexpected IOCTL %d\n", cmd);
return -ENOTTY;
}
}
static const struct file_operations msm_rotator_fops = {
.owner = THIS_MODULE,
.open = msm_rotator_open,
.release = msm_rotator_close,
.unlocked_ioctl = msm_rotator_ioctl,
};
static int __devinit msm_rotator_probe(struct platform_device *pdev)
{
int rc = 0;
struct resource *res;
struct <API key> *pdata = NULL;
int i, number_of_clks;
uint32_t ver;
msm_rotator_dev = kzalloc(sizeof(struct msm_rotator_dev), GFP_KERNEL);
if (!msm_rotator_dev) {
printk(KERN_ERR "%s Unable to allocate memory for struct\n",
__func__);
return -ENOMEM;
}
for (i = 0; i < MAX_SESSIONS; i++)
msm_rotator_dev->rot_session[i] = NULL;
msm_rotator_dev->last_session_idx = INVALID_SESSION;
pdata = pdev->dev.platform_data;
number_of_clks = pdata->number_of_clocks;
<API key> = pdata-><API key>;
msm_rotator_dev->imem_owner = IMEM_NO_OWNER;
mutex_init(&msm_rotator_dev->imem_lock);
INIT_LIST_HEAD(&msm_rotator_dev->fd_list);
msm_rotator_dev->imem_clk_state = CLK_DIS;
INIT_DELAYED_WORK(&msm_rotator_dev->imem_clk_work,
<API key>);
msm_rotator_dev->imem_clk = NULL;
msm_rotator_dev->pdev = pdev;
msm_rotator_dev->core_clk = NULL;
msm_rotator_dev->pclk = NULL;
#ifdef <API key>
if (!msm_rotator_dev->bus_client_handle && pdata &&
pdata->bus_scale_table) {
msm_rotator_dev->bus_client_handle =
<API key>(
pdata->bus_scale_table);
if (!msm_rotator_dev->bus_client_handle) {
pr_err("%s not able to get bus scale handle\n",
__func__);
}
}
#endif
for (i = 0; i < number_of_clks; i++) {
if (pdata->rotator_clks[i].clk_type == ROTATOR_IMEM_CLK) {
msm_rotator_dev->imem_clk =
clk_get(&msm_rotator_dev->pdev->dev,
pdata->rotator_clks[i].clk_name);
if (IS_ERR(msm_rotator_dev->imem_clk)) {
rc = PTR_ERR(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk = NULL;
printk(KERN_ERR "%s: cannot get imem_clk "
"rc=%d\n", DRIVER_NAME, rc);
goto error_imem_clk;
}
if (pdata->rotator_clks[i].clk_rate)
clk_set_rate(msm_rotator_dev->imem_clk,
pdata->rotator_clks[i].clk_rate);
}
if (pdata->rotator_clks[i].clk_type == ROTATOR_PCLK) {
msm_rotator_dev->pclk =
clk_get(&msm_rotator_dev->pdev->dev,
pdata->rotator_clks[i].clk_name);
if (IS_ERR(msm_rotator_dev->pclk)) {
rc = PTR_ERR(msm_rotator_dev->pclk);
msm_rotator_dev->pclk = NULL;
printk(KERN_ERR "%s: cannot get pclk rc=%d\n",
DRIVER_NAME, rc);
goto error_pclk;
}
if (pdata->rotator_clks[i].clk_rate)
clk_set_rate(msm_rotator_dev->pclk,
pdata->rotator_clks[i].clk_rate);
}
if (pdata->rotator_clks[i].clk_type == ROTATOR_CORE_CLK) {
msm_rotator_dev->core_clk =
clk_get(&msm_rotator_dev->pdev->dev,
pdata->rotator_clks[i].clk_name);
if (IS_ERR(msm_rotator_dev->core_clk)) {
rc = PTR_ERR(msm_rotator_dev->core_clk);
msm_rotator_dev->core_clk = NULL;
printk(KERN_ERR "%s: cannot get core clk "
"rc=%d\n", DRIVER_NAME, rc);
goto error_core_clk;
}
if (pdata->rotator_clks[i].clk_rate)
clk_set_rate(msm_rotator_dev->core_clk,
pdata->rotator_clks[i].clk_rate);
}
}
msm_rotator_dev->regulator = regulator_get(&msm_rotator_dev->pdev->dev,
"vdd");
if (IS_ERR(msm_rotator_dev->regulator))
msm_rotator_dev->regulator = NULL;
msm_rotator_dev->rot_clk_state = CLK_DIS;
INIT_DELAYED_WORK(&msm_rotator_dev->rot_clk_work,
<API key>);
mutex_init(&msm_rotator_dev->rotator_lock);
#ifdef <API key>
msm_rotator_dev->client = <API key>(-1, pdev->name);
#endif
<API key>(pdev, msm_rotator_dev);
res = <API key>(pdev, IORESOURCE_MEM, 0);
if (!res) {
printk(KERN_ALERT
"%s: could not get IORESOURCE_MEM\n", DRIVER_NAME);
rc = -ENODEV;
goto error_get_resource;
}
msm_rotator_dev->io_base = ioremap(res->start,
resource_size(res));
#ifdef <API key>
if (msm_rotator_dev->imem_clk)
clk_prepare_enable(msm_rotator_dev->imem_clk);
#endif
enable_rot_clks();
ver = ioread32(<API key>);
disable_rot_clks();
#ifdef <API key>
if (msm_rotator_dev->imem_clk)
<API key>(msm_rotator_dev->imem_clk);
#endif
if (ver != pdata-><API key>)
pr_debug("%s: invalid HW version ver 0x%x\n",
DRIVER_NAME, ver);
rotator_hw_revision = ver;
rotator_hw_revision >>= 16; /* bit 31:16 */
rotator_hw_revision &= 0xff;
pr_info("%s: rotator_hw_revision=%x\n",
__func__, rotator_hw_revision);
msm_rotator_dev->irq = platform_get_irq(pdev, 0);
if (msm_rotator_dev->irq < 0) {
printk(KERN_ALERT "%s: could not get IORESOURCE_IRQ\n",
DRIVER_NAME);
rc = -ENODEV;
goto error_get_irq;
}
rc = request_irq(msm_rotator_dev->irq, msm_rotator_isr,
IRQF_TRIGGER_RISING, DRIVER_NAME, NULL);
if (rc) {
printk(KERN_ERR "%s: request_irq() failed\n", DRIVER_NAME);
goto error_get_irq;
}
/* we enable the IRQ when we need it in the ioctl */
disable_irq(msm_rotator_dev->irq);
rc = alloc_chrdev_region(&msm_rotator_dev->dev_num, 0, 1, DRIVER_NAME);
if (rc < 0) {
printk(KERN_ERR "%s: alloc_chrdev_region Failed rc = %d\n",
__func__, rc);
goto error_get_irq;
}
msm_rotator_dev->class = class_create(THIS_MODULE, DRIVER_NAME);
if (IS_ERR(msm_rotator_dev->class)) {
rc = PTR_ERR(msm_rotator_dev->class);
printk(KERN_ERR "%s: couldn't create class rc = %d\n",
DRIVER_NAME, rc);
goto error_class_create;
}
msm_rotator_dev->device = device_create(msm_rotator_dev->class, NULL,
msm_rotator_dev->dev_num, NULL,
DRIVER_NAME);
if (IS_ERR(msm_rotator_dev->device)) {
rc = PTR_ERR(msm_rotator_dev->device);
printk(KERN_ERR "%s: device_create failed %d\n",
DRIVER_NAME, rc);
goto <API key>;
}
cdev_init(&msm_rotator_dev->cdev, &msm_rotator_fops);
rc = cdev_add(&msm_rotator_dev->cdev,
MKDEV(MAJOR(msm_rotator_dev->dev_num), 0),
1);
if (rc < 0) {
printk(KERN_ERR "%s: cdev_add failed %d\n", __func__, rc);
goto error_cdev_add;
}
init_waitqueue_head(&msm_rotator_dev->wq);
INIT_WORK(&msm_rotator_dev->commit_work, <API key>);
init_completion(&msm_rotator_dev->commit_comp);
mutex_init(&msm_rotator_dev->commit_mutex);
mutex_init(&msm_rotator_dev->commit_wq_mutex);
atomic_set(&msm_rotator_dev->commit_q_w, 0);
atomic_set(&msm_rotator_dev->commit_q_r, 0);
atomic_set(&msm_rotator_dev->commit_q_cnt, 0);
dev_dbg(msm_rotator_dev->device, "probe successful\n");
return rc;
error_cdev_add:
device_destroy(msm_rotator_dev->class, msm_rotator_dev->dev_num);
<API key>:
class_destroy(msm_rotator_dev->class);
error_class_create:
<API key>(msm_rotator_dev->dev_num, 1);
error_get_irq:
iounmap(msm_rotator_dev->io_base);
error_get_resource:
mutex_destroy(&msm_rotator_dev->rotator_lock);
if (msm_rotator_dev->regulator)
regulator_put(msm_rotator_dev->regulator);
clk_put(msm_rotator_dev->core_clk);
error_core_clk:
clk_put(msm_rotator_dev->pclk);
error_pclk:
if (msm_rotator_dev->imem_clk)
clk_put(msm_rotator_dev->imem_clk);
error_imem_clk:
mutex_destroy(&msm_rotator_dev->imem_lock);
kfree(msm_rotator_dev);
return rc;
}
static int __devexit msm_rotator_remove(struct platform_device *plat_dev)
{
int i;
<API key>(true);
#ifdef <API key>
if (msm_rotator_dev->bus_client_handle) {
<API key>
(msm_rotator_dev->bus_client_handle);
msm_rotator_dev->bus_client_handle = 0;
}
#endif
free_irq(msm_rotator_dev->irq, NULL);
mutex_destroy(&msm_rotator_dev->rotator_lock);
cdev_del(&msm_rotator_dev->cdev);
device_destroy(msm_rotator_dev->class, msm_rotator_dev->dev_num);
class_destroy(msm_rotator_dev->class);
<API key>(msm_rotator_dev->dev_num, 1);
iounmap(msm_rotator_dev->io_base);
if (msm_rotator_dev->imem_clk) {
if (msm_rotator_dev->imem_clk_state == CLK_EN)
<API key>(msm_rotator_dev->imem_clk);
clk_put(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk = NULL;
}
if (msm_rotator_dev->rot_clk_state == CLK_EN)
disable_rot_clks();
clk_put(msm_rotator_dev->core_clk);
clk_put(msm_rotator_dev->pclk);
if (msm_rotator_dev->regulator)
regulator_put(msm_rotator_dev->regulator);
msm_rotator_dev->core_clk = NULL;
msm_rotator_dev->pclk = NULL;
mutex_destroy(&msm_rotator_dev->imem_lock);
for (i = 0; i < MAX_SESSIONS; i++)
if (msm_rotator_dev->rot_session[i] != NULL)
kfree(msm_rotator_dev->rot_session[i]);
kfree(msm_rotator_dev);
return 0;
}
#ifdef CONFIG_PM
static int msm_rotator_suspend(struct platform_device *dev, pm_message_t state)
{
<API key>(true);
mutex_lock(&msm_rotator_dev->imem_lock);
if (msm_rotator_dev->imem_clk_state == CLK_EN
&& msm_rotator_dev->imem_clk) {
<API key>(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk_state = CLK_SUSPEND;
}
mutex_unlock(&msm_rotator_dev->imem_lock);
mutex_lock(&msm_rotator_dev->rotator_lock);
if (msm_rotator_dev->rot_clk_state == CLK_EN) {
disable_rot_clks();
msm_rotator_dev->rot_clk_state = CLK_SUSPEND;
}
<API key>();
mutex_unlock(&msm_rotator_dev->rotator_lock);
return 0;
}
static int msm_rotator_resume(struct platform_device *dev)
{
mutex_lock(&msm_rotator_dev->imem_lock);
if (msm_rotator_dev->imem_clk_state == CLK_SUSPEND
&& msm_rotator_dev->imem_clk) {
clk_prepare_enable(msm_rotator_dev->imem_clk);
msm_rotator_dev->imem_clk_state = CLK_EN;
}
mutex_unlock(&msm_rotator_dev->imem_lock);
mutex_lock(&msm_rotator_dev->rotator_lock);
if (msm_rotator_dev->rot_clk_state == CLK_SUSPEND) {
enable_rot_clks();
msm_rotator_dev->rot_clk_state = CLK_EN;
}
mutex_unlock(&msm_rotator_dev->rotator_lock);
return 0;
}
#endif
static struct platform_driver <API key> = {
.probe = msm_rotator_probe,
.remove = __devexit_p(msm_rotator_remove),
#ifdef CONFIG_PM
.suspend = msm_rotator_suspend,
.resume = msm_rotator_resume,
#endif
.driver = {
.owner = THIS_MODULE,
.name = DRIVER_NAME
}
};
static int __init msm_rotator_init(void)
{
return <API key>(&<API key>);
}
static void __exit msm_rotator_exit(void)
{
return <API key>(&<API key>);
}
module_init(msm_rotator_init);
module_exit(msm_rotator_exit);
MODULE_DESCRIPTION("MSM Offline Image Rotator driver");
MODULE_VERSION("1.0");
MODULE_LICENSE("GPL v2"); |
#ifndef CGETFIELDPACKET_H_
#define CGETFIELDPACKET_H_
#include "CPacket.h"
namespace dvs {
class CGetFieldPacket: public dvs::CPacket {
public:
CGetFieldPacket(string data);
virtual ~CGetFieldPacket();
};
} /* namespace dvs */
#endif /* CGETFIELDPACKET_H_ */ |
<?php
$<API key> = array
(
'GM_BOX_TITLE' => '<API key> URLs Pro',
'GM_FORM_REPAIR' => 'URLs reparieren',
'<API key>' => 'Korrektur abgeschlossen!',
'GM_FORM_SUBMIT' => 'Speichern',
'GM_SEO_BOOST_TEXT' => 'Um den SEO Boost nutzen zu können, muss Ihr Server mod_rewrite unterstützen. Andernfalls kann der Shop nicht mehr aufgerufen werden.',
'GM_SEO_COPY_TEXT' => 'Kopieren Sie per FTP die Datei ".htaccess" aus dem Verzeichnis gm/seo_boost_an/ in das Hauptverzeichnis des Shops.',
'GM_TEXT_CATEGORIES' => '<API key> URLs Pro für Kategorieseiten aktivieren',
'GM_TEXT_CONTENT' => '<API key> URLs Pro für <API key> aktivieren',
'GM_TEXT_PRODUCTS' => '<API key> URLs Pro für Artikeldetailseiten aktivieren',
'HEADING_SUB_TITLE' => 'Gambio',
'HEADING_TITLE' => 'SEO Boost',
'<API key>' => 'Ländercode in URLs integrieren'
); |
body{
background:url('02.jpg');
}
.navbar .navbar-nav {
display: inline-block;
float: none;
vertical-align: top;
}
.navbar .navbar-collapse {
text-align: center;
}
#mynav{
margin-left:50px;
margin-right: 50px;
margin-top: 50px;
padding-top: 10px;
padding-bottom: 10px;
}
#login-dp{
min-width: 250px;
padding: 14px 14px 0;
overflow:hidden;
background-color:rgba(255,255,255,.8);
}
#login-dp .help-block{
font-size:12px
}
#login-dp .bottom{
background-color:rgba(255,255,255,.8);
border-top:1px solid #ddd;
clear:both;
padding:14px;
}
#login-dp .social-buttons{
margin:12px 0
}
#login-dp .social-buttons a{
width: 49%;
}
#login-dp .form-group {
margin-bottom: 10px;
}
.btn-fb{
color: #fff;
background-color:#3b5998;
}
.btn-fb:hover{
color: #fff;
background-color:#496ebc
}
.btn-tw{
color: #fff;
background-color:#55acee;
}
.btn-tw:hover{
color: #fff;
background-color:#59b5fa;
}
@media(max-width:768px){
#login-dp{
background-color: inherit;
color: #fff;
}
#login-dp .bottom{
background-color: inherit;
border-top:0 none;
}
}
body > .container {
padding-top: 500px;
}
.full {
width: 100%;
}
.gap {
height: 30px;
width: 100%;
clear: both;
display: block;
}
.footer {
background-image: -webkit-gradient(
radial,
left top,
left bottom,
color-stop(0, #670470),
color-stop(0.76, #2B0230)
margin-top: 3.3%;
);
background-image: -o-radial-gradient(bottom, #670470 0%, #2B0230 76%);
background-image: -moz-radial-gradient(bottom, #670470 0%, #2B0230 76%);
background-image: -<API key>(bottom, #670470 0%, #2B0230 76%);
background-image: -ms-radial-gradient(bottom, #670470 0%, #2B0230 76%);
background-image: radial-gradient(to bottom, #670470 0%, #2B0230 76%);
}
.footer p {
margin: 0;
}
.footer img {
max-width: 100%;
}
.footer h3 {
border-bottom: 1px solid #BAC1C8;
color: #54697E;
font-size: 18px;
font-weight: 600;
line-height: 27px;
padding: 40px 0 10px;
text-transform: uppercase;
}
.footer ul {
font-size: 13px;
list-style-type: none;
margin-left: 0;
padding-left: 0;
margin-top: 15px;
color: #7F8C8D;
}
.footer ul li a {
padding: 0 0 5px 0;
display: block;
}
.footer a {
color: #78828D
}
.supportLi h4 {
font-size: 20px;
font-weight: lighter;
line-height: normal;
margin-bottom: 0 !important;
padding-bottom: 0;
}
.newsletter-box input#appendedInputButton {
background: #FFFFFF;
display: inline-block;
float: left;
height: 30px;
clear: both;
width: 100%;
}
.newsletter-box .btn {
border: medium none;
-<API key>: 3px;
-moz-border-radius: 3px;
-o-border-radius: 3px;
-ms-border-radius: 3px;
border-radius: 3px;
display: inline-block;
height: 40px;
padding: 0;
width: 100%;
color: #fff;
}
.newsletter-box {
overflow: hidden;
}
.bg-gray {
background-image: -moz-linear-gradient(center bottom, #BBBBBB 0%, #F0F0F0 100%);
box-shadow: 0 1px 0 #B4B3B3;
}
.social li {
background: none repeat scroll 0 0 #B5B5B5;
border: 2px solid #B5B5B5;
-<API key>: 50%;
-moz-border-radius: 50%;
-o-border-radius: 50%;
-ms-border-radius: 50%;
border-radius: 50%;
float: left;
height: 36px;
line-height: 36px;
margin: 0 8px 0 0;
padding: 0;
text-align: center;
width: 36px;
transition: all 0.5s ease 0s;
-moz-transition: all 0.5s ease 0s;
-webkit-transition: all 0.5s ease 0s;
-ms-transition: all 0.5s ease 0s;
-o-transition: all 0.5s ease 0s;
}
.social li:hover {
transform: scale(1.15) rotate(360deg);
-webkit-transform: scale(1.1) rotate(360deg);
-moz-transform: scale(1.1) rotate(360deg);
-ms-transform: scale(1.1) rotate(360deg);
-o-transform: scale(1.1) rotate(360deg);
}
.social li a {
color: #EDEFF1;
}
.social li:hover {
border: 2px solid #2c3e50;
background: #2c3e50;
}
.social li a i {
font-size: 16px;
margin: 0 0 0 5px;
color: #EDEFF1 !important;
}
.footer-bottom {
background: #E3E3E3;
border-top: 1px solid #DDDDDD;
padding-top: 10px;
padding-bottom: 10px;
}
.footer-bottom p.pull-left {
padding-top: 6px;
}
.payments {
font-size: 1.5em;
} |
#ifndef __zypher__
#define __zypher__
static unsigned int size_zypher = 3198;
static unsigned char zypher[] __attribute__((aligned(16))) = {
0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xa0, 0xff, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
0xa0, 0x05, 0x00, 0x00, 0x01, 0x30, 0xa2, 0x10, 0x34, 0x00, 0x20, 0x00, 0x01, 0x00, 0x28, 0x00,
0x14, 0x00, 0x13, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x80, 0x40, 0x05, 0x00, 0x00, 0x48, 0x06, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x04, 0x3c, 0xf0, 0xff, 0xbd, 0x27, 0xbc, 0x04, 0x84, 0x24, 0x01, 0x00, 0x05, 0x24,
0x21, 0x30, 0x00, 0x00, 0x04, 0x00, 0xb1, 0xaf, 0x0c, 0x00, 0xbf, 0xaf, 0x08, 0x00, 0xb2, 0xaf,
0xae, 0x00, 0x00, 0x0c, 0x00, 0x00, 0xb0, 0xaf, 0x3f, 0x00, 0x40, 0x04, 0x21, 0x88, 0x40, 0x00,
0x21, 0x30, 0x00, 0x00, 0x21, 0x38, 0x00, 0x00, 0x02, 0x00, 0x08, 0x24, 0xb2, 0x00, 0x00, 0x0c,
0x21, 0x20, 0x40, 0x00, 0x21, 0x20, 0x20, 0x02, 0x21, 0x30, 0x00, 0x00, 0x21, 0x38, 0x00, 0x00,
0x21, 0x40, 0x00, 0x00, 0xb2, 0x00, 0x00, 0x0c, 0x21, 0x90, 0x40, 0x00, 0x00, 0x00, 0x05, 0x3c,
0x34, 0x05, 0xa5, 0x24, 0x01, 0x00, 0x04, 0x24, 0x21, 0x30, 0x00, 0x00, 0x21, 0x38, 0x40, 0x02,
0xb8, 0x00, 0x00, 0x0c, 0x21, 0x40, 0x00, 0x00, 0x2b, 0x00, 0x40, 0x04, 0x21, 0x80, 0x40, 0x00,
0xba, 0x00, 0x00, 0x0c, 0x21, 0x20, 0x40, 0x00, 0x21, 0x28, 0x40, 0x00, 0x21, 0x20, 0x20, 0x02,
0xb0, 0x00, 0x00, 0x0c, 0x21, 0x30, 0x40, 0x02, 0xba, 0x00, 0x00, 0x0c, 0x21, 0x20, 0x00, 0x02,
0x00, 0x00, 0x04, 0x3c, 0x4a, 0x00, 0x07, 0x24, 0x21, 0x28, 0x40, 0x00, 0xd8, 0x04, 0x84, 0x24,
0xaa, 0x00, 0x00, 0x0c, 0x21, 0x30, 0x40, 0x02, 0x00, 0x00, 0x10, 0x3c, 0x00, 0x00, 0x11, 0x3c,
0x57, 0x05, 0x06, 0x3c, 0xf0, 0x04, 0x04, 0x26, 0x5f, 0x2a, 0xc6, 0x34, 0xa2, 0x00, 0x00, 0x0c,
0xfc, 0x04, 0x25, 0x26, 0xc9, 0x2a, 0x06, 0x3c, 0x4b, 0x95, 0xc6, 0x34, 0xf0, 0x04, 0x04, 0x26,
0xfc, 0x04, 0x25, 0x26, 0x00, 0x00, 0x10, 0x3c, 0xa2, 0x00, 0x00, 0x0c, 0x40, 0x06, 0x02, 0xae,
0x40, 0x06, 0x04, 0x8e, 0x00, 0x00, 0x05, 0x3c, 0x40, 0x06, 0x10, 0x26, 0x04, 0x00, 0x02, 0xae,
0xa8, 0x00, 0x00, 0x0c, 0xe8, 0x01, 0xa5, 0x24, 0x04, 0x00, 0x04, 0x8e, 0x00, 0x00, 0x05, 0x3c,
0xa8, 0x00, 0x00, 0x0c, 0x6c, 0x02, 0xa5, 0x24, 0xb4, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
0xac, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xbf, 0x8f, 0x21, 0x10, 0x00, 0x00,
0x08, 0x00, 0xb2, 0x8f, 0x04, 0x00, 0xb1, 0x8f, 0x00, 0x00, 0xb0, 0x8f, 0x08, 0x00, 0xe0, 0x03,
0x10, 0x00, 0xbd, 0x27, 0xf0, 0xff, 0xbd, 0x27, 0x04, 0x00, 0xb0, 0xaf, 0x21, 0x20, 0x00, 0x00,
0x00, 0x00, 0x10, 0x3c, 0x0c, 0x00, 0xbf, 0xaf, 0x9d, 0x00, 0x00, 0x0c, 0x08, 0x00, 0xb1, 0xaf,
0x40, 0x06, 0x05, 0x8e, 0x00, 0x00, 0x04, 0x3c, 0xe8, 0x01, 0x84, 0x24, 0x40, 0x06, 0x10, 0x26,
0xa8, 0x00, 0x00, 0x0c, 0x21, 0x88, 0x40, 0x00, 0x04, 0x00, 0x05, 0x8e, 0x00, 0x00, 0x04, 0x3c,
0xa8, 0x00, 0x00, 0x0c, 0x6c, 0x02, 0x84, 0x24, 0x9d, 0x00, 0x00, 0x0c, 0x21, 0x20, 0x20, 0x02,
0x0c, 0x00, 0xbf, 0x8f, 0x21, 0x10, 0x00, 0x00, 0x08, 0x00, 0xb1, 0x8f, 0x04, 0x00, 0xb0, 0x8f,
0x08, 0x00, 0xe0, 0x03, 0x10, 0x00, 0xbd, 0x27, 0xf0, 0xff, 0xbd, 0x27, 0x08, 0x00, 0xb1, 0xaf,
0x21, 0x88, 0x80, 0x00, 0x21, 0x20, 0x00, 0x00, 0x0c, 0x00, 0xbf, 0xaf, 0x9d, 0x00, 0x00, 0x0c,
0x04, 0x00, 0xb0, 0xaf, 0x21, 0x80, 0x40, 0x00, 0xa6, 0x00, 0x00, 0x0c, 0x21, 0x20, 0x20, 0x02,
0x21, 0x20, 0x00, 0x02, 0x0c, 0x00, 0xbf, 0x8f, 0x08, 0x00, 0xb1, 0x8f, 0x04, 0x00, 0xb0, 0x8f,
0x9d, 0x00, 0x00, 0x08, 0x10, 0x00, 0xbd, 0x27, 0xc8, 0xff, 0xbd, 0x27, 0x21, 0x20, 0x00, 0x00,
0x34, 0x00, 0xbf, 0xaf, 0x30, 0x00, 0xb1, 0xaf, 0x9d, 0x00, 0x00, 0x0c, 0x2c, 0x00, 0xb0, 0xaf,
0x24, 0x00, 0x06, 0x24, 0x21, 0x20, 0xa0, 0x03, 0x21, 0x28, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x0c,
0x21, 0x88, 0x40, 0x00, 0x24, 0x00, 0x02, 0x24, 0x00, 0x00, 0xa2, 0xaf, 0x00, 0x00, 0x03, 0x3c,
0x23, 0x00, 0x02, 0x24, 0x0c, 0x05, 0x63, 0x24, 0x04, 0x00, 0xa2, 0xaf, 0x00, 0x00, 0x02, 0x3c,
0x21, 0x20, 0x60, 0x00, 0x21, 0x28, 0xa0, 0x03, 0x30, 0x05, 0x42, 0x24, 0x08, 0x00, 0xa3, 0xaf,
0xa4, 0x00, 0x00, 0x0c, 0x0c, 0x00, 0xa2, 0xaf, 0x21, 0x20, 0x20, 0x02, 0x9d, 0x00, 0x00, 0x0c,
0x21, 0x80, 0x40, 0x00, 0x34, 0x00, 0xbf, 0x8f, 0x21, 0x10, 0x00, 0x02, 0x30, 0x00, 0xb1, 0x8f,
0x2c, 0x00, 0xb0, 0x8f, 0x08, 0x00, 0xe0, 0x03, 0x38, 0x00, 0xbd, 0x27, 0x7a, 0x00, 0x00, 0x08,
0x00, 0x00, 0x00, 0x00, 0x21, 0x10, 0x60, 0x03, 0x08, 0x00, 0xe0, 0x03, 0x21, 0xd8, 0x80, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x21, 0x10, 0x60, 0x03, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0xe0, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x04, 0x01, 0x01, 0x00,
0xe0, 0x03, 0x00, 0x00, 0x38, 0x05, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x04, 0x00, 0x02, 0x00,
0xf0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,
0x00, 0x00, 0x09, 0x00, 0x05, 0x00, 0x05, 0x00, 0x88, 0x04, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00,
0x1c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0x9c, 0x04, 0x00, 0x00,
0xb0, 0x02, 0x00, 0x00, 0x34, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x03, 0x00,
0xa0, 0x04, 0x00, 0x00, 0xb8, 0x02, 0x00, 0x00, 0x4c, 0x04, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
0x05, 0x00, 0x01, 0x00, 0xac, 0x04, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x01, 0x00, 0xb0, 0x04, 0x00, 0x00, 0xd8, 0x02, 0x00, 0x00,
0x78, 0x04, 0x00, 0x00, 0x11, 0x00, 0x01, 0x00, 0x05, 0x00, 0x02, 0x00, 0xb4, 0x04, 0x00, 0x00,
0xe0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x10, 0x00, 0x01, 0x62, 0x6f, 0x6f, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x30, 0x86, 0x00, 0x00, 0xf4, 0x02, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x1c, 0x03, 0x00, 0x00,
0x94, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xdb, 0xac, 0x32, 0xd6, 0xa7, 0x73, 0x1d, 0xf0, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00,
0x3e, 0x24, 0x05, 0xb8, 0x7a, 0x30, 0x3d, 0x7f, 0x44, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x43, 0x74, 0x72, 0x6c, 0x46, 0x6f,
0x72, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6f, 0x61, 0x64,
0x43, 0x6f, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x49, 0x6f, 0x46, 0x69, 0x6c, 0x65, 0x4d, 0x67, 0x72, 0x46, 0x6f, 0x72,
0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x74, 0x69, 0x6c,
0x73, 0x46, 0x6f, 0x72, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x53, 0x79, 0x73, 0x63, 0x6c, 0x69, 0x62, 0x46, 0x6f, 0x72, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x79, 0x73, 0x4d, 0x65, 0x6d, 0x46, 0x6f,
0x72, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x00, 0xcc, 0xf5, 0x9a, 0x15, 0xb0, 0xf1, 0xa7, 0xab,
0xf0, 0x25, 0xb0, 0x5c, 0xe9, 0x68, 0x66, 0x82, 0x4e, 0x65, 0x0a, 0xce, 0xc6, 0x9a, 0x77, 0xd8,
0xbc, 0x50, 0x9f, 0x10, 0x83, 0x8d, 0x63, 0x6a, 0xb8, 0x27, 0xeb, 0x27, 0xfa, 0xc3, 0xd1, 0x79,
0x61, 0xbb, 0xf3, 0x10, 0x4f, 0xbd, 0x7d, 0x23, 0xa1, 0x5b, 0x9a, 0x9d, 0x6d, 0x73, 0x30, 0x3a,
0x2f, 0x73, 0x65, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x73, 0x2f, 0x7a, 0x79, 0x70, 0x68, 0x65,
0x72, 0x2e, 0x70, 0x72, 0x78, 0x00, 0x00, 0x00, 0x2f, 0x6b, 0x64, 0x2f, 0x75, 0x73, 0x65, 0x72,
0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x6c, 0x69, 0x62, 0x2e, 0x70, 0x72, 0x78, 0x00, 0x00, 0x00,
0x73, 0x63, 0x65, 0x4c, 0x6f, 0x61, 0x64, 0x45, 0x78, 0x65, 0x63, 0x00, 0x4c, 0x6f, 0x61, 0x64,
0x45, 0x78, 0x65, 0x63, 0x46, 0x6f, 0x72, 0x55, 0x73, 0x65, 0x72, 0x00, 0x6d, 0x73, 0x30, 0x3a,
0x2f, 0x50, 0x53, 0x50, 0x2f, 0x47, 0x41, 0x4d, 0x45, 0x2f, 0x5a, 0x79, 0x70, 0x68, 0x65, 0x72,
0x56, 0x30, 0x37, 0x31, 0x2f, 0x45, 0x42, 0x4f, 0x4f, 0x54, 0x2e, 0x50, 0x42, 0x50, 0x00, 0x00,
0x67, 0x61, 0x6d, 0x65, 0x00, 0x00, 0x00, 0x00, 0x52, 0x44, 0x4c, 0x69, 0x62, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x07, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x08, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x88, 0x02, 0x00, 0x00, 0xe8, 0x02, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x1f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf0, 0x02, 0x00, 0x00,
0x50, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0xf4, 0x02, 0x00, 0x00, 0x54, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x35, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x88, 0x0a, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x14, 0x03, 0x00, 0x00, 0x74, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x18, 0x03, 0x00, 0x00,
0x78, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x1c, 0x03, 0x00, 0x00, 0x7c, 0x03, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x67, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xa0, 0x0a, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x94, 0x03, 0x00, 0x00, 0xf4, 0x03, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x83, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa0, 0x03, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x70,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0b, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0xb3, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00,
0x40, 0x04, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x70,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x0b, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
0xdf, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x88, 0x04, 0x00, 0x00,
0xe8, 0x04, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xee, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x32, 0x00, 0x00, 0x00, 0xbc, 0x04, 0x00, 0x00, 0x1c, 0x05, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0xf6, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00,
0xa0, 0x05, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfb, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0b, 0x00, 0x00, 0x06, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x20, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x54, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x80, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x98, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0xac, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xb8, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0xcc, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0xdc, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xbc, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0xe0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xe8, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xec, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0xf8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xf4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x10, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
0x14, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x20, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x58, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xe4, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x64, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x50, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x70, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x7c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x84, 0x01, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x88, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xc8, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0xf8, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x1c, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x24, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x2c, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
0x40, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
0x6c, 0x02, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x04, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x1c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x2c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x30, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x3c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x44, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x54, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x64, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x68, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x6c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x7c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x8c, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x90, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0xc0, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xc4, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0xc8, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xcc, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0xd0, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0xec, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf8, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0xfc, 0x03, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x2e,
0x72, 0x65, 0x6c, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x2e, 0x73, 0x63, 0x65, 0x53, 0x74, 0x75,
0x62, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x65, 0x6e, 0x74, 0x2e,
0x74, 0x6f, 0x70, 0x00, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x65, 0x6e, 0x74, 0x00, 0x2e, 0x72, 0x65,
0x6c, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x65, 0x6e, 0x74, 0x00, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x65,
0x6e, 0x74, 0x2e, 0x62, 0x74, 0x6d, 0x00, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x73, 0x74, 0x75, 0x62,
0x2e, 0x74, 0x6f, 0x70, 0x00, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x73, 0x74, 0x75, 0x62, 0x00, 0x2e,
0x72, 0x65, 0x6c, 0x2e, 0x6c, 0x69, 0x62, 0x2e, 0x73, 0x74, 0x75, 0x62, 0x00, 0x2e, 0x6c, 0x69,
0x62, 0x2e, 0x73, 0x74, 0x75, 0x62, 0x2e, 0x62, 0x74, 0x6d, 0x00, 0x2e, 0x72, 0x6f, 0x64, 0x61,
0x74, 0x61, 0x2e, 0x73, 0x63, 0x65, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x00, 0x2e, 0x72, 0x65, 0x6c, 0x2e, 0x72, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x63, 0x65,
0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x00, 0x2e, 0x72, 0x6f, 0x64, 0x61,
0x74, 0x61, 0x2e, 0x73, 0x63, 0x65, 0x52, 0x65, 0x73, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x00, 0x2e,
0x72, 0x65, 0x6c, 0x2e, 0x72, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x63, 0x65, 0x52, 0x65,
0x73, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x00, 0x2e, 0x72, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73,
0x63, 0x65, 0x4e, 0x69, 0x64, 0x00, 0x2e, 0x72, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x00, 0x2e, 0x62,
0x73, 0x73, 0x00, 0x2e, 0x73, 0x68, 0x73, 0x74, 0x72, 0x74, 0x61, 0x62, 0x00, 0x00,
};
#endif |
module EdgeDetect
# The nearby module provides a method that uses the [x, y] method
# to query a two dimensional array.
module Nearby
# Returns the nearby values of the given coordinates (x, y) with respect to
# the given radius.
# @return [Array<Array<Value>>] a two dimensional array with the Values.
def nearby(x, y, radius)
output = []
((x - radius)..(x + radius)).each do |i|
row = []
((y - radius)..(y + radius)).each do |j|
row << self[i, j]
end
output << row
end
output
end
end
end |
#include <stdio.h>
#include <stdlib.h>
#include "pin.H"
// Test that using (IARG_REG_REFERENCE, REG_GAX) and (IARG_RETURN_REGS, REG_GFLAGS) to an anlysis function does not
// result in unexpected values in either register
ADDRINT <API key>(ADDRINT app_flags, ADDRINT gaxVal, ADDRINT *gaxRef)
{
*gaxRef = gaxVal;
return (app_flags);
}
int a[10];
int n = 10;
ADDRINT savedGaxVal, savedGFlagsVal;
ADDRINT <API key>(ADDRINT app_flags, ADDRINT gaxVal, ADDRINT *gaxRef)
{
for (int i = 0; i < n; i++)
{
a[i] = i;
}
*gaxRef = gaxVal;
savedGFlagsVal = app_flags;
savedGaxVal = gaxVal;
return (app_flags);
}
ADDRINT <API key>(ADDRINT app_flags, ADDRINT gaxVal, ADDRINT *gaxRef)
{
*gaxRef = gaxVal;
savedGFlagsVal = app_flags;
savedGaxVal = gaxVal;
return (app_flags);
}
void CompareGaxAndGFlags(ADDRINT app_flags, ADDRINT gaxVal)
{
BOOL haveError = FALSE;
if (savedGaxVal != gaxVal)
{
printf ("Error in gax val\n");
haveError = TRUE;
}
if (savedGFlagsVal != app_flags)
{
printf ("Error in flags val\n");
haveError = TRUE;
}
if (haveError)
{
exit(1);
}
}
int instrumentationNum=1;
VOID Instruction(INS ins, VOID *v)
{
if (instrumentationNum&0x1)
{
INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(<API key>),
IARG_REG_VALUE, REG_GFLAGS,
IARG_REG_VALUE, REG_GAX,
IARG_REG_REFERENCE, REG_GAX,
IARG_RETURN_REGS, REG_GFLAGS, IARG_END);
}
else
{
INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(<API key>),
IARG_REG_VALUE, REG_GFLAGS,
IARG_REG_VALUE, REG_GAX,
IARG_REG_REFERENCE, REG_GAX,
IARG_RETURN_REGS, REG_GFLAGS, IARG_END);
}
INS_InsertCall(ins, IPOINT_BEFORE, AFUNPTR(CompareGaxAndGFlags), IARG_REG_VALUE, REG_GFLAGS,
IARG_REG_VALUE, REG_GAX,IARG_END);
instrumentationNum++;
}
int main(int argc, char * argv[])
{
PIN_Init(argc, argv);
<API key>(Instruction, 0);
// Never returns
PIN_StartProgram();
return 0;
} |
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<!-- Start K2 Latest Layout -->
<div id="k2Container" class="latestView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">
<?php if($this->params->get('show_page_title')): ?>
<!-- Page title -->
<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
<?php echo $this->escape($this->params->get('page_title')); ?>
</div>
<?php endif; ?>
<?php foreach($this->blocks as $key=>$block): ?>
<div class="<API key>" style="width:<?php echo number_format(100/$this->params->get('latestItemsCols'), 1); ?>%;">
<?php if($this->source=='categories'): $category=$block; ?>
<?php if($this->params->get('categoryFeed') || $this->params->get('categoryImage') || $this->params->get('categoryTitle') || $this->params->get('categoryDescription')): ?>
<!-- Start K2 Category block -->
<div class="latestItemsCategory">
<?php if($this->params->get('categoryFeed')): ?>
<!-- RSS feed icon -->
<div class="k2FeedIcon">
<a href="<?php echo $category->feed; ?>" title="<?php echo JText::_('Subscribe to this RSS feed'); ?>">
<span><?php echo JText::_('Subscribe to this RSS feed'); ?></span>
</a>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if ($this->params->get('categoryImage') && !empty($category->image)): ?>
<div class="<API key>">
<img src="<?php echo $category->image; ?>" alt="<?php echo $category->name; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px;height:auto;" />
</div>
<?php endif; ?>
<?php if ($this->params->get('categoryTitle')): ?>
<h2><a href="<?php echo $category->link; ?>"><?php echo $category->name; ?></a></h2>
<?php endif; ?>
<?php if ($this->params->get('categoryDescription') && isset($category->description)): ?>
<p><?php echo $category->description; ?></p>
<?php endif; ?>
<div class="clr"></div>
<!-- K2 Plugins: K2CategoryDisplay -->
<?php echo $category->event->K2CategoryDisplay; ?>
<div class="clr"></div>
</div>
<!-- End K2 Category block -->
<?php endif; ?>
<?php else: $user=$block; ?>
<?php if ($this->params->get('userFeed') || $this->params->get('userImage') || $this->params->get('userName') || $this->params->get('userDescription') || $this->params->get('userURL') || $this->params->get('userEmail')): ?>
<!-- Start K2 User block -->
<div class="latestItemsUser">
<?php if($this->params->get('userFeed')): ?>
<!-- RSS feed icon -->
<div class="k2FeedIcon">
<a href="<?php echo $user->feed; ?>" title="<?php echo JText::_('Subscribe to this RSS feed'); ?>">
<span><?php echo JText::_('Subscribe to this RSS feed'); ?></span>
</a>
<div class="clr"></div>
</div>
<?php endif; ?>
<?php if ($this->params->get('userImage') && !empty($user->avatar)): ?>
<img src="<?php echo $user->avatar; ?>" alt="<?php echo $user->name; ?>" style="width:<?php echo $this->params->get('userImageWidth'); ?>px;height:auto;" />
<?php endif; ?>
<?php if ($this->params->get('userName')): ?>
<h2><a href="<?php echo $user->link; ?>"><?php echo $user->name; ?></a></h2>
<?php endif; ?>
<?php if ($this->params->get('userDescription') && isset($user->profile->description)): ?>
<p class="<API key>"><?php echo $user->profile->description; ?></p>
<?php endif; ?>
<?php if ($this->params->get('userURL') || $this->params->get('userEmail')): ?>
<p class="<API key>">
<?php if ($this->params->get('userURL') && isset($user->profile->url)): ?>
<span class="latestItemsUserURL">
<?php echo JText::_("Website URL"); ?>: <a href="<?php echo $user->profile->url; ?>" target="_blank"><?php echo $user->profile->url; ?></a>
</span>
<?php endif; ?>
<?php if ($this->params->get('userEmail')): ?>
<span class="<API key>">
<?php echo JText::_("E-mail"); ?>: <?php echo JHTML::_('Email.cloak', $user->email); ?>
</span>
<?php endif; ?>
</p>
<?php endif; ?>
<div class="clr"></div>
<?php echo $user->event->K2UserDisplay; ?>
<div class="clr"></div>
</div>
<!-- End K2 User block -->
<?php endif; ?>
<?php endif; ?>
<!-- Start Items list -->
<div class="latestItemList">
<?php if($this->params->get('<API key>')=="first"): ?>
<?php foreach ($block->items as $itemCounter=>$item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
<?php if($itemCounter==0): ?>
<?php $this->item=$item; echo $this->loadTemplate('item'); ?>
<?php else: ?>
<h2 class="latestItemTitleList">
<?php if ($item->params->get('<API key>')): ?>
<a href="<?php echo $item->link; ?>">
<?php echo $item->title; ?>
</a>
<?php else: ?>
<?php echo $item->title; ?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php foreach ($block->items as $item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
<?php $this->item=$item; echo $this->loadTemplate('item'); ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
<!-- End Item list -->
</div>
<?php if(($key+1)%($this->params->get('latestItemsCols'))==0): ?>
<div class="clr"></div>
<?php endif; ?>
<?php endforeach; ?>
<div class="clr"></div>
</div>
<!-- End K2 Latest Layout --> |
/* #define DEBUG_MENUS */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h>
#include "ghid-layer-selector.h"
#include "<API key>.h"
#include "gtkhid.h"
#include "gui.h"
#include "hid.h"
#include "../hidint.h"
#include "hid/common/hid_resource.h"
#include "action.h"
#include "autoplace.h"
#include "autoroute.h"
#include "buffer.h"
#include "change.h"
#include "copy.h"
#include "create.h"
#include "crosshair.h"
#include "draw.h"
#include "error.h"
#include "file.h"
#include "find.h"
#include "gpcb-menu.h"
#include "insert.h"
#include "line.h"
#include "mymem.h"
#include "misc.h"
#include "move.h"
#include "pcb-printf.h"
#include "polygon.h"
#include "rats.h"
#include "remove.h"
#include "report.h"
#include "resource.h"
#include "rotate.h"
#include "rubberband.h"
#include "search.h"
#include "select.h"
#include "set.h"
#include "undo.h"
#include "vendor.h"
#include "free_atexit.h"
#include "<API key>.data"
#include "gui-icons-misc.data"
#include "gui-trackball.h"
#ifdef HAVE_LIBDMALLOC
#include <dmalloc.h>
#endif
static bool ignore_layer_update;
static GtkWidget *ghid_load_menus (void);
GhidGui _ghidgui, *ghidgui = NULL;
GHidPort ghid_port, *gport;
static gchar *bg_image_file;
static struct { GtkAction *action; const Resource *node; }
ghid_hotkey_actions[256];
#define N_HOTKEY_ACTIONS \
(sizeof (ghid_hotkey_actions) / sizeof (ghid_hotkey_actions[0]))
/*!
* \brief Callback for <API key> ().
*/
void
<API key> (GtkAction *act, const char *tflag, const char *aflag)
{
if (tflag != NULL)
{
int v = hid_get_flag (tflag);
<API key> (GTK_TOGGLE_ACTION (act), !!v);
}
if (aflag != NULL)
{
int v = hid_get_flag (aflag);
<API key> (act, !!v);
}
}
/*!
* \brief sync the menu checkboxes with actual pcb state.
*/
void
<API key> ()
{
<API key> (GHID_MAIN_MENU (ghidgui->menu_bar),
<API key>);
}
static void
<API key> (GtkAdjustment * adj, GhidGui * g)
{
if (g-><API key>)
return;
<API key> ();
}
static void
<API key> (GtkAdjustment * adj, GhidGui * g)
{
if (g-><API key>)
return;
<API key> ();
}
/* Save size of top window changes so PCB can restart at its size at exit.
*/
static gint
<API key> (GtkWidget * widget, GdkEventConfigure * ev,
GHidPort * port)
{
GtkAllocation allocation;
gboolean new_w, new_h;
<API key> (widget, &allocation);
new_w = (ghidgui->top_window_width != allocation.width);
new_h = (ghidgui->top_window_height != allocation.height);
ghidgui->top_window_width = allocation.width;
ghidgui->top_window_height = allocation.height;
if (new_w || new_h)
ghidgui->config_modified = TRUE;
return FALSE;
}
static void
<API key> (GtkInfoBar *info_bar,
gint response_id,
GhidGui *_gui)
{
gtk_widget_destroy (_gui->info_bar);
_gui->info_bar = NULL;
if (response_id == GTK_RESPONSE_ACCEPT)
hid_parse_command("LoadFrom(Revert,ignored)");
//RevertPCB ();
}
static void
<API key> (void)
{
if (ghidgui->info_bar != NULL)
gtk_widget_destroy (ghidgui->info_bar);
ghidgui->info_bar = NULL;
}
static void
<API key> (void)
{
GtkWidget *button;
GtkWidget *button_image;
GtkWidget *icon;
GtkWidget *label;
GtkWidget *content_area;
char *file_path_utf8;
char *secondary_text;
char *markup;
<API key> ();
ghidgui->info_bar = gtk_info_bar_new ();
button = <API key> (GTK_INFO_BAR (ghidgui->info_bar),
_("Reload"),
GTK_RESPONSE_ACCEPT);
button_image = <API key> (GTK_STOCK_REFRESH,
<API key>);
<API key> (GTK_BUTTON (button), button_image);
<API key> (GTK_INFO_BAR (ghidgui->info_bar),
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL);
<API key> (GTK_INFO_BAR (ghidgui->info_bar),
GTK_MESSAGE_WARNING);
gtk_box_pack_start (GTK_BOX (ghidgui->vbox_middle),
ghidgui->info_bar, FALSE, FALSE, 0);
<API key> (GTK_BOX (ghidgui->vbox_middle), ghidgui->info_bar, 0);
g_signal_connect (ghidgui->info_bar, "response",
G_CALLBACK (<API key>), ghidgui);
file_path_utf8 = g_filename_to_utf8 (PCB->Filename, -1, NULL, NULL, NULL);
secondary_text = PCB->Changed ? _("Do you want to drop your changes and reload the file?") :
_("Do you want to reload the file?");
markup = <API key> (_("<b>The file %s has changed on disk</b>\n\n%s"),
file_path_utf8, secondary_text);
g_free (file_path_utf8);
content_area = <API key> (GTK_INFO_BAR (ghidgui->info_bar));
icon = <API key> (<API key>,
<API key>);
gtk_box_pack_start (GTK_BOX (content_area),
icon, FALSE, FALSE, 0);
label = gtk_label_new ("");
gtk_box_pack_start (GTK_BOX (content_area),
label, TRUE, TRUE, 6);
<API key> (GTK_LABEL (label), TRUE);
<API key> (GTK_LABEL (label), markup);
g_free (markup);
<API key> (GTK_MISC (label), 0., 0.5);
gtk_widget_show_all (ghidgui->info_bar);
}
static bool
<API key> (void)
{
GFile *file;
GFileInfo *info;
GTimeVal timeval;
/* Treat zero time as a flag to indicate we've not got an mtime yet */
if (PCB->Filename == NULL ||
(ghidgui->our_mtime.tv_sec == 0 &&
ghidgui->our_mtime.tv_usec == 0))
return false;
file = g_file_new_for_path (PCB->Filename);
info = g_file_query_info (file, <API key>,
<API key>, NULL, NULL);
g_object_unref (file);
if (info == NULL ||
!<API key> (info, <API key>))
return false;
<API key> (info, &timeval); //&ghidgui->last_seen_mtime);
g_object_unref (info);
/* Ignore when the file on disk is the same age as when we last looked */
if (timeval.tv_sec == ghidgui->last_seen_mtime.tv_sec &&
timeval.tv_usec == ghidgui->last_seen_mtime.tv_usec)
return false;
ghidgui->last_seen_mtime = timeval;
return (ghidgui->last_seen_mtime.tv_sec > ghidgui->our_mtime.tv_sec) ||
(ghidgui->last_seen_mtime.tv_sec == ghidgui->our_mtime.tv_sec &&
ghidgui->last_seen_mtime.tv_usec > ghidgui->our_mtime.tv_usec);
}
static gboolean
top_window_enter_cb (GtkWidget *widget, GdkEvent *event, GHidPort *port)
{
if (<API key> ())
<API key> ();
return FALSE;
}
/*!
* \brief Menu action callback function.
*
* This is the main menu callback function. The callback receives
* the original Resource pointer containing the HID actions to be
* executed.
*
* All hotkeys go through the menus which means they go through here.
* Some, such as tab, are caught by Gtk instead of passed here, so
* pcb calls this function directly through ghid_hotkey_cb() for them.
*
* \param [in] The action that was activated.
* \param [in] The menu resource associated with the action.
*/
static void
ghid_menu_cb (GtkAction *action, const Resource *node)
{
int i;
if (action == NULL || node == NULL)
return;
for (i = 1; i < node->c; i++)
if (resource_type (node->v[i]) == 10)
{
#ifdef DEBUG_MENUS
printf (" %s\n", node->v[i].value);
#endif
hid_parse_actions (node->v[i].value);
}
/* Sync gui widgets with pcb state */
<API key> ();
<API key> ();
/* Sync gui status display with pcb state */
<API key> ();
ghid_invalidate_all ();
<API key> (PCB->Name);
<API key> ();
}
/*!
* \brief Accelerator callback for accelerators gtk tries to hide from
* us.
*/
void ghid_hotkey_cb (int which)
{
if (ghid_hotkey_actions[which].action != NULL)
ghid_menu_cb (ghid_hotkey_actions[which].action,
(gpointer) ghid_hotkey_actions[which].node);
}
static void
<API key> (void)
{
GFile *file;
GFileInfo *info;
ghidgui->our_mtime.tv_sec = 0;
ghidgui->our_mtime.tv_usec = 0;
ghidgui->last_seen_mtime = ghidgui->our_mtime;
if (PCB->Filename == NULL)
return;
file = g_file_new_for_path (PCB->Filename);
info = g_file_query_info (file, <API key>,
<API key>, NULL, NULL);
g_object_unref (file);
if (info == NULL ||
!<API key> (info, <API key>))
return;
<API key> (info, &ghidgui->our_mtime);
g_object_unref (info);
ghidgui->last_seen_mtime = ghidgui->our_mtime;
}
/*!
* \brief Sync toggle states that were saved with the layout and notify
* the config code to update Settings values it manages.
*/
void
<API key> (void)
{
pcb_use_route_style (&PCB->RouteStyle[0]);
<API key>
(<API key> (ghidgui-><API key>),
&PCB->RouteStyle[0]);
<API key> ();
<API key> (PCB->Name);
<API key> ();
<API key> ();
<API key> ();
}
void
<API key> (const char *filename, bool done)
{
/* Do nothing if it is not the active PCB file that is being saved.
*/
if (PCB->Filename == NULL || strcmp (filename, PCB->Filename) != 0)
return;
if (done)
<API key> ();
}
void
<API key> (void)
{
/* Pick up the mtime of the new PCB file */
<API key> ();
}
/*!
* \brief Takes the index into the layers and produces the text string
* for the layer and if the layer is currently visible or not.
*
* This is used by a couple of functions.
*
*/
void
layer_process (gchar **color_string, char **text, int *set, int i)
{
int tmp;
char *tmps;
gchar *tmpc;
/* cheap hack to let users pass in NULL for either text or set if
* they don't care about the result
*/
if (color_string == NULL)
color_string = &tmpc;
if (text == NULL)
text = &tmps;
if (set == NULL)
set = &tmp;
switch (i)
{
case LAYER_BUTTON_SILK:
*color_string = Settings.ElementColor;
if (Settings.ShowBottomSide)
*text = (char *)UNKNOWN (PCB->Data->Layer[bottom_silk_layer].Name);
else
*text = (char *)UNKNOWN (PCB->Data->Layer[top_silk_layer].Name);
*set = PCB->ElementOn;
break;
case LAYER_BUTTON_RATS:
*color_string = Settings.RatColor;
*text = _( "rat lines");
*set = PCB->RatOn;
break;
case LAYER_BUTTON_PINS:
*color_string = Settings.PinColor;
*text = _( "pins/pads");
*set = PCB->PinOn;
break;
case LAYER_BUTTON_VIAS:
*color_string = Settings.ViaColor;
*text = _( "vias");
*set = PCB->ViaOn;
break;
case <API key>:
*color_string = Settings.<API key>;
*text = _( "far side");
*set = PCB->InvisibleObjectsOn;
break;
case LAYER_BUTTON_MASK:
*color_string = Settings.MaskColor;
*text = _( "solder mask");
*set = TEST_FLAG (SHOWMASKFLAG, PCB);
break;
default: /* layers */
*color_string = Settings.LayerColor[i];
*text = (char *)UNKNOWN (PCB->Data->Layer[i].Name);
*set = PCB->Data->Layer[i].On;
break;
}
}
/*!
* \brief Callback for GHidLayerSelector layer selection.
*/
static void
<API key> (GHidLayerSelector *ls, int layer, gpointer d)
{
ignore_layer_update = true;
/* Select Layer */
PCB->SilkActive = (layer == LAYER_BUTTON_SILK);
PCB->RatDraw = (layer == LAYER_BUTTON_RATS);
if (layer == LAYER_BUTTON_SILK)
{
PCB->ElementOn = true;
hid_action ("LayersChanged");
}
else if (layer == LAYER_BUTTON_RATS)
{
PCB->RatOn = true;
hid_action ("LayersChanged");
}
else if (layer < max_copper_layer)
<API key> (layer, TRUE, true);
ignore_layer_update = false;
ghid_invalidate_all ();
}
/*!
* \brief Callback for GHidLayerSelector layer renaming.
*/
static void
<API key> (GHidLayerSelector *ls,
int layer_id,
char *new_name,
void *userdata)
{
LayerType *layer = LAYER_PTR (layer_id);
if (new_name[0] == '\0')
return;
/* Don't bother if the name is identical to the current one */
if (strcmp (layer->Name, new_name) == 0)
return;
free (layer->Name);
layer->Name = strdup (new_name);
<API key> ();
if (!PCB->Changed)
{
SetChangedFlag (true);
<API key> (PCB->Name);
}
}
/*!
* \brief Callback for GHidLayerSelector layer toggling.
*/
static void
<API key> (GHidLayerSelector *ls, int layer, gpointer d)
{
gboolean redraw = FALSE;
gboolean active;
layer_process (NULL, NULL, &active, layer);
active = !active;
ignore_layer_update = true;
switch (layer)
{
case LAYER_BUTTON_SILK:
PCB->ElementOn = active;
PCB->Data->SILKLAYER.On = PCB->ElementOn;
PCB->Data->BACKSILKLAYER.On = PCB->ElementOn;
redraw = 1;
break;
case LAYER_BUTTON_RATS:
PCB->RatOn = active;
redraw = 1;
break;
case LAYER_BUTTON_PINS:
PCB->PinOn = active;
redraw |= (PCB->Data->ElementN != 0);
break;
case LAYER_BUTTON_VIAS:
PCB->ViaOn = active;
redraw |= (PCB->Data->ViaN != 0);
break;
case <API key>:
PCB->InvisibleObjectsOn = active;
PCB->Data->BACKSILKLAYER.On = (active && PCB->ElementOn);
redraw = TRUE;
break;
case LAYER_BUTTON_MASK:
if (active)
SET_FLAG (SHOWMASKFLAG, PCB);
else
CLEAR_FLAG (SHOWMASKFLAG, PCB);
redraw = TRUE;
break;
default:
/* Flip the visibility */
<API key> (layer, active, false);
redraw = TRUE;
break;
}
/* Select the next visible layer. (If there is none, this will
* select the currently-selected layer, triggering the selection
* callback, which will turn the visibility on.) This way we
* will never have an invisible layer selected.
*/
if (!active)
<API key> (ls);
ignore_layer_update = false;
if (redraw)
ghid_invalidate_all();
}
/*!
* \brief Install menu bar and accelerator groups.
*/
void
<API key> (GtkWindow *window, GhidGui *gui)
{
<API key>
(window, <API key>
(GHID_MAIN_MENU (gui->menu_bar)));
<API key>
(window, <API key>
(GHID_LAYER_SELECTOR (gui->layer_selector)));
<API key>
(window, <API key>
(<API key> (gui-><API key>)));
}
/*!
* \brief Remove menu bar and accelerator groups.
*/
void
<API key> (GtkWindow *window, GhidGui *gui)
{
<API key>
(window, <API key>
(GHID_MAIN_MENU (gui->menu_bar)));
<API key>
(window, <API key>
(GHID_LAYER_SELECTOR (gui->layer_selector)));
<API key>
(window, <API key>
(<API key> (gui-><API key>)));
}
/*!
* \brief Refreshes the window title bar and sets the PCB name to the
* window title bar or to a seperate label.
*/
void
<API key> (gchar * name)
{
gchar *str;
gchar *filename;
/* FIXME -- should this happen? It does... */
/* This happens if we're calling an exporter from the command line */
if (ghidgui == NULL)
return;
dup_string (&(ghidgui->name_label_string), name);
if (!ghidgui->name_label_string || !*ghidgui->name_label_string)
ghidgui->name_label_string = g_strdup (_("Unnamed"));
if (!PCB->Filename || !*PCB->Filename)
filename = g_strdup(_("Unsaved.pcb"));
else
filename = g_strdup(PCB->Filename);
str = g_strdup_printf ("%s%s (%s) - PCB", PCB->Changed ? "*": "",
ghidgui->name_label_string, filename);
<API key> (GTK_WINDOW (gport->top_window), str);
g_free (str);
g_free (filename);
}
static void
<API key> (GtkWidget * widget, gpointer data)
{
/* Button only toggles between mm and mil */
if (Settings.grid_unit == get_unit_struct ("mm"))
hid_actionl ("SetUnits", "mil", NULL);
else
hid_actionl ("SetUnits", "mm", NULL);
}
/*!
* \brief The two following callbacks are used to keep the absolute
* and relative cursor labels from growing and shrinking as you
* move the cursor around.
*/
static void
<API key> (GtkWidget * widget,
GtkRequisition *req, gpointer data)
{
static gint w = 0;
if (req->width > w)
w = req->width;
else
req->width = w;
}
static void
<API key> (GtkWidget * widget,
GtkRequisition *req, gpointer data)
{
static gint w = 0;
if (req->width > w)
w = req->width;
else
req->width = w;
}
static void
<API key> (GtkWidget * hbox, GHidPort * port)
{
GtkWidget *frame, *label;
/* The grid units button next to the cursor position labels.
*/
ghidgui->grid_units_button = gtk_button_new ();
label = gtk_label_new ("");
<API key> (GTK_LABEL (label),
Settings.grid_unit->in_suffix);
ghidgui->grid_units_label = label;
<API key> (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (ghidgui->grid_units_button), label);
gtk_box_pack_end (GTK_BOX (hbox), ghidgui->grid_units_button, FALSE, TRUE, 0);
g_signal_connect (ghidgui->grid_units_button, "clicked",
G_CALLBACK (<API key>), NULL);
/* The absolute cursor position label
*/
frame = gtk_frame_new (NULL);
gtk_box_pack_end (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
<API key> (GTK_CONTAINER (frame), 0);
<API key> (GTK_FRAME (frame), <API key>);
label = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (frame), label);
ghidgui-><API key> = label;
g_signal_connect (G_OBJECT (label), "size-request",
G_CALLBACK (<API key>), NULL);
/* The relative cursor position label
*/
frame = gtk_frame_new (NULL);
gtk_box_pack_end (GTK_BOX (hbox), frame, FALSE, TRUE, 0);
<API key> (GTK_CONTAINER (frame), 0);
<API key> (GTK_FRAME (frame), <API key>);
label = gtk_label_new (" __.__ __.__ ");
gtk_container_add (GTK_CONTAINER (frame), label);
ghidgui-><API key> = label;
g_signal_connect (G_OBJECT (label), "size-request",
G_CALLBACK (<API key>), NULL);
}
/*!
* \brief Add "virtual layers" to a layer selector.
*/
static void
<API key> (GtkWidget *layer_selector)
{
GHidLayerSelector *layersel = GHID_LAYER_SELECTOR (layer_selector);
gchar *text;
gchar *color_string;
gboolean active;
layer_process (&color_string, &text, &active, LAYER_BUTTON_SILK);
<API key> (layersel, LAYER_BUTTON_SILK,
text, color_string, active, TRUE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_RATS);
<API key> (layersel, LAYER_BUTTON_RATS,
text, color_string, active, TRUE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_PINS);
<API key> (layersel, LAYER_BUTTON_PINS,
text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_VIAS);
<API key> (layersel, LAYER_BUTTON_VIAS,
text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, <API key>);
<API key> (layersel, <API key>,
text, color_string, active, FALSE, FALSE);
layer_process (&color_string, &text, &active, LAYER_BUTTON_MASK);
<API key> (layersel, LAYER_BUTTON_MASK,
text, color_string, active, FALSE, FALSE);
}
/*!
* \brief Callback for <API key>.
*/
const gchar *
get_layer_color (gint layer)
{
gchar *rv;
layer_process (&rv, NULL, NULL, layer);
return rv;
}
/*!
* \brief Update a layer selector's color scheme.
*/
void
<API key> (void)
{
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector), get_layer_color);
<API key> (PCB);
}
/*!
* \brief Populate a layer selector with all layers Gtk is aware of.
*/
static void
make_layer_buttons (GtkWidget *layersel)
{
gint i;
gchar *text;
gchar *color_string;
gboolean active = TRUE;
for (i = 0; i < max_copper_layer; ++i)
{
layer_process (&color_string, &text, &active, i);
<API key> (GHID_LAYER_SELECTOR (layersel), i,
text, color_string, active, TRUE, TRUE);
}
}
/*!
* \brief Callback for <API key>.
*/
gboolean
get_layer_delete (gint layer)
{
return layer >= max_copper_layer;
}
/*!
* \brief Synchronize layer selector widget with current PCB state.
*
* Called when user toggles layer visibility or changes drawing layer,
* or when layer visibility is changed programatically.
*/
void
<API key> (void)
{
gint layer;
if (ignore_layer_update)
return;
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector),
get_layer_delete);
make_layer_buttons (ghidgui->layer_selector);
<API key> (ghidgui->layer_selector);
<API key>
(GHID_MAIN_MENU (ghidgui->menu_bar),
GHID_LAYER_SELECTOR (ghidgui->layer_selector));
/* Sync selected layer with PCB's state */
if (PCB->RatDraw)
layer = LAYER_BUTTON_RATS;
else if (PCB->SilkActive)
layer = LAYER_BUTTON_SILK;
else
layer = LayerStack[0];
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector), layer);
}
/*!
* \brief Called when user clicks OK on route style dialog.
*/
static void
<API key> (<API key> *rss, gboolean save,
gpointer data)
{
if (save)
{
g_free (Settings.Routes);
Settings.Routes = make_route_string (PCB->RouteStyle, NUM_STYLES);
ghidgui->config_modified = TRUE;
<API key> ();
}
<API key>
(GHID_MAIN_MENU (ghidgui->menu_bar),
<API key> (ghidgui-><API key>));
}
/*!
* \brief Called when a route style is selected.
*/
static void
<API key> (<API key> *rss, RouteStyleType *rst,
gpointer data)
{
pcb_use_route_style (rst);
<API key>();
}
/*!
* \brief Configure the route style selector.
*/
void
<API key> (<API key> *rss)
{
int i;
for (i = 0; i < NUM_STYLES; ++i)
<API key> (rss, &PCB->RouteStyle[i]);
g_signal_connect (G_OBJECT (rss), "select_style",
G_CALLBACK (<API key>), NULL);
g_signal_connect (G_OBJECT (rss), "style_edited",
G_CALLBACK (<API key>), NULL);
<API key>
(GHID_MAIN_MENU (ghidgui->menu_bar),
<API key> (ghidgui-><API key>));
}
/*!
* \brief Mode buttons.
*/
typedef struct
{
GtkWidget *button;
GtkWidget *toolbar_button;
guint button_cb_id;
guint <API key>;
gchar *name;
gint mode;
gchar **xpm;
gchar *tooltip;
}
ModeButton;
static ModeButton mode_buttons[] = {
{NULL, NULL, 0, 0, N_("via"), VIA_MODE, via,
N_("create vias with <select mouse button>")},
{NULL, NULL, 0, 0, N_("line"), LINE_MODE, line,
N_("create a line segment, toggle draw modes with '/' or '.'")},
{NULL, NULL, 0, 0, N_("arc"), ARC_MODE, arc,
N_("create an arc segment")},
{NULL, NULL, 0, 0, N_("text"), TEXT_MODE, text,
N_("create a text")},
{NULL, NULL, 0, 0, N_("rectangle"), RECTANGLE_MODE, rect,
N_("create a filled rectangle")},
{NULL, NULL, 0, 0, N_("polygon"), POLYGON_MODE, poly,
N_("create a polygon, <shift>-P for closing the polygon")},
{NULL, NULL, 0, 0, N_("polygonhole"), POLYGONHOLE_MODE, polyhole,
N_("create a hole into an existing polygon")},
{NULL, NULL, 0, 0, N_("buffer"), PASTEBUFFER_MODE, buf,
N_("paste the selection from buffer into the layout")},
{NULL, NULL, 0, 0, N_("remove"), REMOVE_MODE, del,
N_("remove objects under the cursor")},
{NULL, NULL, 0, 0, N_("rotate"), ROTATE_MODE, rot,
N_("rotate a selection or object CCW, hold the <shift> key to rotate CW")},
{NULL, NULL, 0, 0, N_("insertPoint"), INSERTPOINT_MODE, ins,
N_("add points into existing lines and polygons")},
{NULL, NULL, 0, 0, N_("thermal"), THERMAL_MODE, thrm,
N_("create thermals with <select mouse button>, toggle thermal style with <Shift> <select mouse button>")},
{NULL, NULL, 0, 0, N_("select"), ARROW_MODE, sel,
N_("select, deselect or move objects or selections")},
{NULL, NULL, 0, 0, N_("lock"), LOCK_MODE, lock,
N_("lock or unlock an object")}
};
static gint n_mode_buttons = G_N_ELEMENTS (mode_buttons);
static void
do_set_mode (int mode)
{
SetMode (mode);
ghid_mode_cursor (mode);
ghidgui->settings_mode = mode;
}
static void
<API key> (GtkToggleButton *button, ModeButton * mb)
{
gboolean active = <API key> (button);
if (mb->button != NULL)
{
<API key> (mb->button, mb->button_cb_id);
<API key> (GTK_TOGGLE_BUTTON (mb->button), active);
<API key> (mb->button, mb->button_cb_id);
}
if (active)
do_set_mode (mb->mode);
}
static void
<API key> (GtkWidget * widget, ModeButton * mb)
{
gboolean active = <API key> (GTK_TOGGLE_BUTTON (widget));
if (mb->toolbar_button != NULL)
{
<API key> (mb->toolbar_button, mb-><API key>);
<API key> (GTK_TOGGLE_BUTTON (mb->toolbar_button), active);
<API key> (mb->toolbar_button, mb-><API key>);
}
if (active)
do_set_mode (mb->mode);
}
void
<API key> (void)
{
ModeButton *mb;
gint i;
for (i = 0; i < n_mode_buttons; ++i)
{
mb = &mode_buttons[i];
if (Settings.Mode == mb->mode)
{
<API key> (mb->button, mb->button_cb_id);
<API key> (GTK_TOGGLE_BUTTON (mb->button), TRUE);
<API key> (mb->button, mb->button_cb_id);
<API key> (mb->toolbar_button, mb-><API key>);
<API key> (GTK_TOGGLE_BUTTON (mb->toolbar_button), TRUE);
<API key> (mb->toolbar_button, mb-><API key>);
break;
}
}
}
void
<API key> (void)
{
if (ghidgui->compact_vertical)
{
gtk_widget_hide (ghidgui->mode_buttons_frame);
gtk_widget_show_all (ghidgui->mode_toolbar);
}
else
{
gtk_widget_hide (ghidgui->mode_toolbar);
gtk_widget_show_all (ghidgui->mode_buttons_frame);
}
}
static void
<API key> (GtkWidget **mode_frame,
GtkWidget **mode_toolbar)
{
GtkToolItem *tool_item;
GtkWidget *vbox, *hbox = NULL;
GtkWidget *image;
GdkPixbuf *pixbuf;
GSList *group = NULL;
GSList *toolbar_group = NULL;
ModeButton *mb;
int i;
*mode_toolbar = gtk_toolbar_new ();
*mode_frame = gtk_frame_new (NULL);
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (*mode_frame), vbox);
for (i = 0; i < n_mode_buttons; ++i)
{
mb = &mode_buttons[i];
/* Create tool button for mode frame */
mb->button = <API key> (group);
<API key> (mb->button, _(mb->tooltip));
gtk_widget_set_name (mb->button, (mb->name));
group = <API key> (GTK_RADIO_BUTTON (mb->button));
<API key> (GTK_TOGGLE_BUTTON (mb->button), FALSE);
/* Create tool button for toolbar */
mb->toolbar_button = <API key> (toolbar_group);
<API key> (mb->toolbar_button, _(mb->tooltip));
gtk_widget_set_name (mb->toolbar_button, (mb->name));
toolbar_group = <API key> (GTK_RADIO_BUTTON (mb->toolbar_button));
<API key> (GTK_TOGGLE_BUTTON (mb->toolbar_button), FALSE);
/* Pack mode-frame button into the frame */
if ((i % ghidgui-><API key>) == 0)
{
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
}
gtk_box_pack_start (GTK_BOX (hbox), mb->button, FALSE, FALSE, 0);
/* Create a container for the toolbar button and add that */
tool_item = gtk_tool_item_new ();
gtk_container_add (GTK_CONTAINER (tool_item), mb->toolbar_button);
gtk_toolbar_insert (GTK_TOOLBAR (*mode_toolbar), tool_item, -1);
/* Load the image for the button, create GtkImage widgets for both
* the grid button and the toolbar button, then pack into the buttons
*/
pixbuf = <API key> ((const char **) mb->xpm);
image = <API key> (pixbuf);
gtk_container_add (GTK_CONTAINER (mb->button), image);
image = <API key> (pixbuf);
gtk_container_add (GTK_CONTAINER (mb->toolbar_button), image);
g_object_unref (pixbuf);
if (strcmp (mb->name, "select") == 0)
{
<API key> (GTK_TOGGLE_BUTTON (mb->button), TRUE);
<API key> (GTK_TOGGLE_BUTTON (mb->toolbar_button), TRUE);
}
mb->button_cb_id =
g_signal_connect (mb->button, "toggled",
G_CALLBACK (<API key>), mb);
mb-><API key> =
g_signal_connect (mb->toolbar_button, "toggled",
G_CALLBACK (<API key>), mb);
}
}
static gint
delete_chart_cb (GtkWidget * widget, GdkEvent * event, GHidPort * port)
{
<API key> ();
hid_action ("Quit");
/*
* Return TRUE to keep our app running. A FALSE here would let the
* delete signal continue on and kill our program.
*/
return TRUE;
}
static void
destroy_chart_cb (GtkWidget * widget, GHidPort * port)
{
<API key> (port);
gtk_main_quit ();
}
static void
get_widget_styles (GtkStyle **menu_bar_style,
GtkStyle **tool_button_style,
GtkStyle **<API key>)
{
GtkWidget *tool_button;
GtkWidget *tool_button_label;
GtkToolItem *tool_item;
/* Build a tool item to extract the theme's styling for a toolbar button with text */
tool_item = gtk_tool_item_new ();
gtk_toolbar_insert (GTK_TOOLBAR (ghidgui->mode_toolbar), tool_item, 0);
tool_button = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (tool_item), tool_button);
tool_button_label = gtk_label_new ("");
gtk_container_add (GTK_CONTAINER (tool_button), tool_button_label);
/* Grab the various styles we need */
<API key> (ghidgui->menu_bar);
*menu_bar_style = <API key> (ghidgui->menu_bar);
<API key> (tool_button);
*tool_button_style = <API key> (tool_button);
<API key> (tool_button_label);
*<API key> = <API key> (tool_button_label);
gtk_widget_destroy (GTK_WIDGET (tool_item));
}
static void
<API key> (void)
{
GtkWidget *rel_pos_frame;
GtkWidget *abs_pos_frame;
GtkStyle *menu_bar_style;
GtkStyle *tool_button_style;
GtkStyle *<API key>;
get_widget_styles (&menu_bar_style,
&tool_button_style,
&<API key>);
/* Style the top bar background as if it were all a menu bar */
<API key> (ghidgui->top_bar_background, menu_bar_style);
/* Style the cursor position labels using the menu bar style as well.
* If this turns out to cause problems with certain gtk themes, we may
* need to grab the GtkStyle associated with an actual menu item to
* get a text color to render with.
*/
<API key> (ghidgui-><API key>, menu_bar_style);
<API key> (ghidgui-><API key>, menu_bar_style);
/* Style the units button as if it were a toolbar button - hopefully
* this isn't too ugly sitting on a background themed as a menu bar.
* It is unlikely any theme defines colours for a GtkButton sitting on
* a menu bar.
*/
rel_pos_frame = <API key> (ghidgui-><API key>);
abs_pos_frame = <API key> (ghidgui-><API key>);
<API key> (rel_pos_frame, menu_bar_style);
<API key> (abs_pos_frame, menu_bar_style);
<API key> (ghidgui->grid_units_button, tool_button_style);
<API key> (ghidgui->grid_units_label, <API key>);
}
/*!
* \brief Attempt to produce a conststent style for our extra menu-bar
* items by copying aspects from the menu bar style set by the user's
* GTK theme.
*
* Setup signal handlers to update our efforts if the user changes their
* theme whilst we are running.
*/
static void
fix_topbar_theming (void)
{
GtkSettings *settings;
<API key> ();
settings = <API key> (ghidgui->top_bar_background);
g_signal_connect (settings, "notify::gtk-theme-name",
G_CALLBACK (<API key>), NULL);
g_signal_connect (settings, "notify::gtk-font-name",
G_CALLBACK (<API key>), NULL);
}
/*!
* \brief Create the top_window contents.
*
* The config settings should be loaded before this is called.
*/
static void
<API key> (void)
{
GtkWidget *window;
GtkWidget *vbox_main, *hbox_middle, *hbox;
GtkWidget *vbox, *frame;
GtkWidget *label;
/* FIXME: IFDEF HACK */
#ifdef ENABLE_GL
GtkWidget *trackball;
#endif
GHidPort *port = &ghid_port;
GtkWidget *scrolled;
window = gport->top_window;
vbox_main = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox_main);
/* -- Top control bar */
ghidgui->top_bar_background = gtk_event_box_new ();
gtk_box_pack_start (GTK_BOX (vbox_main),
ghidgui->top_bar_background, FALSE, FALSE, 0);
ghidgui->top_hbox = gtk_hbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (ghidgui->top_bar_background),
ghidgui->top_hbox);
/*
* menu_hbox will be made insensitive when the gui needs
* a modal button GetLocation button press.
*/
ghidgui->menu_hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (ghidgui->top_hbox), ghidgui->menu_hbox,
FALSE, FALSE, 0);
ghidgui-><API key> = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (ghidgui->menu_hbox),
ghidgui-><API key>, FALSE, FALSE, 0);
/* Build layer menus */
ghidgui->layer_selector = <API key> ();
make_layer_buttons (ghidgui->layer_selector);
<API key> (ghidgui->layer_selector);
g_signal_connect (G_OBJECT (ghidgui->layer_selector), "select-layer",
G_CALLBACK (<API key>),
NULL);
g_signal_connect (G_OBJECT (ghidgui->layer_selector), "toggle-layer",
G_CALLBACK (<API key>),
NULL);
g_signal_connect (G_OBJECT (ghidgui->layer_selector), "rename-layer",
G_CALLBACK (<API key>),
NULL);
/* Build main menu */
ghidgui->menu_bar = ghid_load_menus ();
gtk_box_pack_start (GTK_BOX (ghidgui-><API key>),
ghidgui->menu_bar, FALSE, FALSE, 0);
<API key> (&ghidgui->mode_buttons_frame,
&ghidgui->mode_toolbar);
gtk_box_pack_start (GTK_BOX (ghidgui-><API key>),
ghidgui->mode_toolbar, FALSE, FALSE, 0);
ghidgui->position_hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_end (GTK_BOX(ghidgui->top_hbox),
ghidgui->position_hbox, TRUE, TRUE, 0);
<API key> (ghidgui->position_hbox, port);
hbox_middle = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox_main), hbox_middle, TRUE, TRUE, 0);
fix_topbar_theming (); /* Must be called after toolbar is created */
/* -- Left control bar */
/*
* This box will be made insensitive when the gui needs
* a modal button GetLocation button press.
*/
ghidgui->left_toolbar = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox_middle),
ghidgui->left_toolbar, FALSE, FALSE, 0);
vbox = ghid_scrolled_vbox (ghidgui->left_toolbar, &scrolled,
GTK_POLICY_NEVER, <API key>);
gtk_box_pack_start (GTK_BOX(vbox), ghidgui->layer_selector,
FALSE, FALSE, 0);
/* FIXME: IFDEF HACK */
#ifdef ENABLE_GL
trackball = ghid_trackball_new ();
g_signal_connect (trackball, "rotation-changed",
G_CALLBACK (ghid_port_rotate), NULL);
g_signal_connect (trackball, "view-2d-changed",
G_CALLBACK (ghid_view_2d), NULL);
gtk_box_pack_start (GTK_BOX(ghidgui->left_toolbar),
trackball, FALSE, FALSE, 0);
#endif
/* ghidgui->mode_buttons_frame was created above in the call to
* <API key> (...);
*/
gtk_box_pack_start (GTK_BOX (ghidgui->left_toolbar),
ghidgui->mode_buttons_frame, FALSE, FALSE, 0);
frame = gtk_frame_new(NULL);
gtk_box_pack_end (GTK_BOX (ghidgui->left_toolbar), frame, FALSE, FALSE, 0);
vbox = gtk_vbox_new(FALSE, 0);
gtk_container_add(GTK_CONTAINER(frame), vbox);
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, FALSE, 1);
ghidgui-><API key> = <API key> ();
<API key>
(<API key> (ghidgui-><API key>));
gtk_box_pack_start(GTK_BOX(hbox), ghidgui-><API key>,
FALSE, FALSE, 0);
ghidgui->vbox_middle = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox_middle),
ghidgui->vbox_middle, TRUE, TRUE, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (ghidgui->vbox_middle), hbox, TRUE, TRUE, 0);
/* -- The PCB layout output drawing area */
gport->drawing_area = <API key> ();
<API key> (gport->drawing_area, gport);
<API key> (gport->drawing_area, GDK_EXPOSURE_MASK
| <API key> | <API key>
| <API key> | <API key>
| <API key> | GDK_KEY_PRESS_MASK
| <API key> | <API key>
| <API key>);
/*
* This is required to get the drawing_area key-press-event. Also the
* enter and button press callbacks grab focus to be sure we have it
* when in the drawing_area.
*/
<API key> (gport->drawing_area, TRUE);
gtk_box_pack_start (GTK_BOX (hbox), gport->drawing_area, TRUE, TRUE, 0);
ghidgui->v_adjustment = gtk_adjustment_new (0.0, 0.0, 100.0,
10.0, 10.0, 10.0);
ghidgui->v_range =
gtk_vscrollbar_new (GTK_ADJUSTMENT (ghidgui->v_adjustment));
gtk_box_pack_start (GTK_BOX (hbox), ghidgui->v_range, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (ghidgui->v_adjustment), "value_changed",
G_CALLBACK (<API key>), ghidgui);
ghidgui->h_adjustment = gtk_adjustment_new (0.0, 0.0, 100.0,
10.0, 10.0, 10.0);
ghidgui->h_range =
gtk_hscrollbar_new (GTK_ADJUSTMENT (ghidgui->h_adjustment));
gtk_box_pack_start (GTK_BOX (ghidgui->vbox_middle),
ghidgui->h_range, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (ghidgui->h_adjustment), "value_changed",
G_CALLBACK (<API key>), ghidgui);
/* -- The bottom status line label */
ghidgui->status_line_hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (ghidgui->vbox_middle),
ghidgui->status_line_hbox, FALSE, FALSE, 0);
label = gtk_label_new ("");
<API key> (GTK_LABEL (label), TRUE);
gtk_box_pack_start (GTK_BOX (ghidgui->status_line_hbox), label, FALSE,
FALSE, 0);
ghidgui->status_line_label = label;
/* Depending on user setting, the command_combo_box may get packed into
| the status_line_hbox, but it will happen on demand the first time
| the user does a command entry.
*/
g_signal_connect (G_OBJECT (gport->drawing_area), "realize",
G_CALLBACK (<API key>),
port);
g_signal_connect (G_OBJECT (gport->drawing_area), "expose_event",
G_CALLBACK (<API key>),
port);
g_signal_connect (G_OBJECT (gport->top_window), "configure_event",
G_CALLBACK (<API key>), port);
g_signal_connect (gport->top_window, "enter-notify-event",
G_CALLBACK (top_window_enter_cb), port);
g_signal_connect (G_OBJECT (gport->drawing_area), "configure_event",
G_CALLBACK (<API key>),
port);
/* Mouse and key events will need to be intercepted when PCB needs a
| location from the user.
*/
<API key> ();
g_signal_connect (G_OBJECT (gport->drawing_area), "enter_notify_event",
G_CALLBACK (<API key>), port);
g_signal_connect (G_OBJECT (gport->drawing_area), "leave_notify_event",
G_CALLBACK (<API key>), port);
g_signal_connect (G_OBJECT (gport->drawing_area), "motion_notify_event",
G_CALLBACK (<API key>), port);
g_signal_connect (G_OBJECT (window), "delete_event",
G_CALLBACK (delete_chart_cb), port);
g_signal_connect (G_OBJECT (window), "destroy",
G_CALLBACK (destroy_chart_cb), port);
ghidgui->creating = FALSE;
gtk_widget_show_all (gport->top_window);
<API key> ();
<API key> (<API key> (gport->drawing_area),
NULL, FALSE);
port-><API key> = 0;
}
/* Connect and disconnect just the signals a g_main_loop() will need.
| Cursor and motion events still need to be handled by the top level
| loop, so don't connect/reconnect these.
| A g_main_loop will be running when PCB wants the user to select a
| location or if command entry is needed in the status line hbox.
| During these times normal button/key presses are intercepted, either
| by new signal handlers or the command_combo_box entry.
*/
static gulong <API key>;
static gulong <API key>;
static gulong <API key>;
static gulong key_press_handler;
static gulong key_release_handler;
/*!
* \brief Connect just the signals a g_main_loop() will need.
*
* Cursor and motion events still need to be handled by the top level
* loop, so don't connect/reconnect these.
* A g_main_loop will be running when PCB wants the user to select a
* location or if command entry is needed in the status line hbox.
* During these times normal button/key presses are intercepted, either
* by new signal handlers or the command_combo_box entry.
*/
void
<API key> (void)
{
<API key> =
g_signal_connect (G_OBJECT (gport->drawing_area), "button_press_event",
G_CALLBACK (<API key>), NULL);
<API key> =
g_signal_connect (G_OBJECT (gport->drawing_area), "<API key>",
G_CALLBACK (<API key>), NULL);
<API key> =
g_signal_connect (G_OBJECT (gport->drawing_area), "scroll_event",
G_CALLBACK (<API key>), NULL);
key_press_handler =
g_signal_connect (G_OBJECT (gport->drawing_area), "key_press_event",
G_CALLBACK (<API key>), NULL);
key_release_handler =
g_signal_connect (G_OBJECT (gport->drawing_area), "key_release_event",
G_CALLBACK (<API key>), NULL);
}
/*!
* \brief Disconnect just the signals a g_main_loop() will need.
*
* Cursor and motion events still need to be handled by the top level
* loop, so don't disconnect these.
* A g_main_loop will be running when PCB wants the user to select a
* location or if command entry is needed in the status line hbox.
* During these times normal button/key presses are intercepted, either
* by new signal handlers or the command_combo_box entry.
*/
void
<API key> (void)
{
if (<API key>)
<API key> (gport->drawing_area, <API key>);
if (<API key>)
<API key> (gport->drawing_area, <API key>);
if (<API key>)
<API key> (gport->drawing_area, <API key>);
if (key_press_handler)
<API key> (gport->drawing_area, key_press_handler);
if (key_release_handler)
<API key> (gport->drawing_area, key_release_handler);
<API key> = 0;
<API key> = 0;
<API key> = 0;
key_press_handler = 0;
key_release_handler = 0;
}
/*!
* \brief We'll set the interface insensitive when a g_main_loop is
* running so the Gtk menus and buttons don't respond and interfere with
* the special entry the user needs to be doing.
*/
void
<API key> (gboolean sensitive)
{
<API key> (ghidgui->left_toolbar, sensitive);
<API key> (ghidgui->menu_hbox, sensitive);
}
/*!
* \brief Initializes icon pixmap and also cursor bit maps.
*/
static void
ghid_init_icons (GHidPort * port)
{
GdkWindow *window = <API key> (gport->top_window);
XC_clock_source = <API key> (window,
(char *) rotateIcon_bits,
rotateIcon_width,
rotateIcon_height);
XC_clock_mask =
<API key> (window, (char *) rotateMask_bits,
rotateMask_width, rotateMask_height);
XC_hand_source = <API key> (window,
(char *) handIcon_bits,
handIcon_width,
handIcon_height);
XC_hand_mask =
<API key> (window, (char *) handMask_bits,
handMask_width, handMask_height);
XC_lock_source = <API key> (window,
(char *) lockIcon_bits,
lockIcon_width,
lockIcon_height);
XC_lock_mask =
<API key> (window, (char *) lockMask_bits,
lockMask_width, lockMask_height);
}
void
<API key> (void)
{
GHidPort *port = &ghid_port;
GError *err = NULL;
if (bg_image_file)
ghidgui->bg_pixbuf = <API key>(bg_image_file, &err);
if (err)
{
g_error("%s", err->message);
g_error_free(err);
}
<API key> ();
<API key> (GTK_WINDOW (port->top_window), ghidgui);
<API key> ();
ghid_init_icons (port);
SetMode (ARROW_MODE);
<API key> ();
}
static gboolean
ghid_listener_cb (GIOChannel *source,
GIOCondition condition,
gpointer data)
{
GIOStatus status;
gchar *str;
gsize len;
gsize term;
GError *err = NULL;
if (condition & G_IO_HUP)
{
gui->log (_("Read end of pipe died!\n"));
return FALSE;
}
if (condition == G_IO_IN)
{
status = <API key> (source, &str, &len, &term, &err);
switch (status)
{
case G_IO_STATUS_NORMAL:
hid_parse_actions (str);
g_free (str);
break;
case G_IO_STATUS_ERROR:
gui->log (_("ERROR status from <API key>\n"));
return FALSE;
break;
case G_IO_STATUS_EOF:
gui->log (_("Input pipe returned EOF. The --listen option is \n"
"probably not running anymore in this session.\n"));
return FALSE;
break;
case G_IO_STATUS_AGAIN:
gui->log (_("AGAIN status from <API key>\n"));
return FALSE;
break;
default:
fprintf (stderr, _("ERROR: unhandled case in ghid_listener_cb\n"));
return FALSE;
break;
}
}
else
fprintf (stderr, _("Unknown condition in ghid_listener_cb\n"));
return TRUE;
}
static void
<API key> (void)
{
GIOChannel *channel;
int fd = fileno (stdin);
channel = <API key> (fd);
g_io_add_watch (channel, G_IO_IN, ghid_listener_cb, NULL);
}
static int stdin_listen = 0;
static char *pcbmenu_path = "gpcb-menu.res";
HID_Attribute ghid_attribute_list[] = {
/* %start-doc options "21 GTK+ GUI Options"
@ftable @code
@item --listen
Listen for actions on stdin.
@end ftable
%end-doc
*/
{"listen", N_("Listen for actions on stdin"),
HID_Boolean, 0, 0, {0, 0, 0}, 0, &stdin_listen},
#define HA_listen 0
/* %start-doc options "21 GTK+ GUI Options"
@ftable @code
@item --bg-image <string>
File name of an image to put into the background of the GUI canvas. The image must
be a color PPM image, in binary (not ASCII) format. It can be any size, and will be
automatically scaled to fit the canvas.
@end ftable
%end-doc
*/
{"bg-image", N_("Background Image"),
HID_String, 0, 0, {0, 0, 0}, 0, &bg_image_file},
#define HA_bg_image 1
/* %start-doc options "21 GTK+ GUI Options"
@ftable @code
@item --pcb-menu <string>
Location of the @file{gpcb-menu.res} file which defines the menu for the GTK+ GUI.
@end ftable
%end-doc
*/
{"pcb-menu", N_("Location of gpcb-menu.res file"),
HID_String, 0, 0, {0, PCBLIBDIR "/gpcb-menu.res", 0}, 0, &pcbmenu_path}
#define HA_pcbmenu 2
};
REGISTER_ATTRIBUTES (ghid_attribute_list)
HID_Attribute *
<API key> (int *n_ret)
{
*n_ret = sizeof (ghid_attribute_list) / sizeof (HID_Attribute);
return ghid_attribute_list;
}
/*!
* \brief Create top level window for routines that will need top_window
* before <API key>() is called.
*/
void
<API key> (int *argc, char ***argv)
{
GtkWidget *window;
gint i;
GdkPixbuf *icon;
/* on windows we need to figure out the installation directory */
#ifdef WIN32
char * tmps;
char * libdir;
tmps = <API key> (NULL);
#define REST_OF_PATH G_DIR_SEPARATOR_S "share" G_DIR_SEPARATOR_S PACKAGE G_DIR_SEPARATOR_S "newlib"
libdir = (char *) malloc(strlen(tmps) +
strlen(REST_OF_PATH) +
1);
sprintf(libdir, "%s%s", tmps, REST_OF_PATH);
free(tmps);
Settings.LibraryTree = libdir;
#undef REST_OF_PATH
#endif
#if defined (DEBUG)
for (i = 0; i < *argc; i++)
{
printf ("<API key>(): *argv[%d] = \"%s\"\n", i, (*argv)[i]);
}
#endif
/* Threads aren't used in PCB, but this call would go here.
*/
/* g_thread_init (NULL); */
/*
* Prevent gtk_init() and gtk_init_check() from automatically calling
* setlocale (LC_ALL, "") which would undo LC_NUMERIC handling in main().
*/
<API key> ();
gtk_init (argc, argv);
gport = &ghid_port;
gport->view.coord_per_px = 300.0;
pixel_slop = 300;
ghid_init_renderer (argc, argv, gport);
<API key> (argc, argv);
Settings.AutoPlace = 0;
for (i = 0; i < *argc; i++)
{
if (strcmp ((*argv)[i], "-auto-place") == 0)
Settings.AutoPlace = 1;
}
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
<API key> (PACKAGE, "UTF-8");
icon = <API key> ((const gchar **) icon_bits);
<API key> (icon);
window = gport->top_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
<API key> (GTK_WINDOW (window), "PCB");
gtk_window_resize (GTK_WINDOW(window),
ghidgui->top_window_width, ghidgui->top_window_height);
if (Settings.AutoPlace)
gtk_window_move (GTK_WINDOW (window), 10, 10);
gtk_widget_show_all (gport->top_window);
ghidgui->creating = TRUE;
}
void
ghid_do_export (HID_Attr_Val * options)
{
<API key> ();
/* These are needed to make sure the @layerpick and @layerview menus
* are properly initialized and synchronized with the current PCB.
*/
<API key> ();
<API key>
(GHID_MAIN_MENU (ghidgui->menu_bar),
<API key> (ghidgui-><API key>));
if (stdin_listen)
<API key> ();
<API key> ();
gtk_main ();
<API key> ();
}
/*!
* \brief callback for.
*/
static gboolean
<API key> (int id)
{
int visible;
layer_process (NULL, NULL, &visible, id);
return visible;
}
gint
LayersChanged (int argc, char **argv, Coord x, Coord y)
{
if (!ghidgui || !ghidgui->menu_bar)
return 0;
<API key>();
<API key> ();
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector), <API key>);
/*! \todo If a layer is moved it should retain its color. But layers
* currently can't do that because color info is not saved in the
* pcb file. So this makes a moved layer change its color to reflect
* the way it will be when the pcb is reloaded.
*/
<API key> (PCB);
return 0;
}
static const char toggleview_syntax[] =
N_("ToggleView(1..MAXLAYER)\n"
"ToggleView(layername)\n"
"ToggleView(Silk|Rats|Pins|Vias|Mask|BackSide)");
static const char toggleview_help[] =
N_("Toggle the visibility of the specified layer or layer group.");
/* %start-doc actions ToggleView
If you pass an integer, that layer is specified by index (the first
layer is @code{1}, etc). If you pass a layer name, that layer is
specified by name. When a layer is specified, the visibility of the
layer group containing that layer is toggled.
If you pass a special layer name, the visibility of those components
(silk, rats, etc) is toggled. Note that if you have a layer named
the same as a special layer, the layer is chosen over the special layer.
%end-doc */
static int
ToggleView (int argc, char **argv, Coord x, Coord y)
{
int i, l;
#ifdef DEBUG_MENUS
puts ("Starting ToggleView().");
#endif
if (argc == 0)
{
AFAIL (toggleview);
}
if (isdigit ((int) argv[0][0]))
{
l = atoi (argv[0]) - 1;
}
else if (strcmp (argv[0], "Silk") == 0)
l = LAYER_BUTTON_SILK;
else if (strcmp (argv[0], "Rats") == 0)
l = LAYER_BUTTON_RATS;
else if (strcmp (argv[0], "Pins") == 0)
l = LAYER_BUTTON_PINS;
else if (strcmp (argv[0], "Vias") == 0)
l = LAYER_BUTTON_VIAS;
else if (strcmp (argv[0], "Mask") == 0)
l = LAYER_BUTTON_MASK;
else if (strcmp (argv[0], "BackSide") == 0)
l = <API key>;
else
{
l = -1;
for (i = 0; i < max_copper_layer + SILK_LAYER; i++)
if (strcmp (argv[0], PCB->Data->Layer[i].Name) == 0)
{
l = i;
break;
}
if (l == -1)
{
AFAIL (toggleview);
}
}
/* Now that we've figured out which toggle button ought to control
* this layer, simply hit the button and let the pre-existing code deal
*/
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector), l);
return 0;
}
static const char selectlayer_syntax[] =
N_("SelectLayer(1..MAXLAYER|Silk|Rats)");
static const char selectlayer_help[] =
N_("Select which layer is the current layer.");
/* %start-doc actions SelectLayer
The specified layer becomes the currently active layer. It is made
visible if it is not already visible
%end-doc */
static int
SelectLayer (int argc, char **argv, Coord x, Coord y)
{
int i;
int newl = -1;
if (argc == 0)
AFAIL (selectlayer);
for (i = 0; i < max_copper_layer; ++i)
if (strcasecmp (argv[0], PCB->Data->Layer[i].Name) == 0)
newl = i;
if (strcasecmp (argv[0], "silk") == 0)
newl = LAYER_BUTTON_SILK;
else if (strcasecmp (argv[0], "rats") == 0)
newl = LAYER_BUTTON_RATS;
else if (newl == -1)
newl = atoi (argv[0]) - 1;
#ifdef DEBUG_MENUS
printf ("SelectLayer(): newl = %d\n", newl);
#endif
/* Now that we've figured out which radio button ought to select
* this layer, simply hit the button and let the pre-existing code deal
*/
<API key>
(GHID_LAYER_SELECTOR (ghidgui->layer_selector), newl);
return 0;
}
HID_Action <API key>[] = {
{"LayersChanged", 0, LayersChanged,
layerschanged_help, <API key>},
{"SelectLayer", 0, SelectLayer,
selectlayer_help, selectlayer_syntax},
{"ToggleView", 0, ToggleView,
toggleview_help, toggleview_syntax}
};
REGISTER_ACTIONS (<API key>)
/*!
* \brief This function is used to check if a specified hotkey in the
* menu resource file is "special".
*
* In this case "special" means that gtk assigns a particular meaning to
* it and the normal menu setup will never see these key presses.
* We capture those and feed them back into the menu callbacks.
* This function is called as new accelerators are added when the menus
* are being built.
*/
static void
<API key> (const char *accel, GtkAction *action,
const Resource *node)
{
size_t len;
unsigned int mods;
unsigned int ind;
if (action == NULL || accel == NULL || *accel == '\0')
return ;
#ifdef DEBUG_MENUS
printf ("%s(\"%s\", \"%s\")\n", __FUNCTION__, accel, name);
#endif
mods = 0;
if (strstr (accel, "<alt>") )
{
mods |= GHID_KEY_ALT;
}
if (strstr (accel, "<ctrl>") )
{
mods |= GHID_KEY_CONTROL;
}
if (strstr (accel, "<shift>") )
{
mods |= GHID_KEY_SHIFT;
}
len = strlen (accel);
#define CHECK_KEY(a) ((len >= strlen (a)) && (strcmp (accel + len - strlen (a), (a)) == 0))
ind = 0;
if ( CHECK_KEY ("Tab") )
{
ind = mods | GHID_KEY_TAB;
}
else if ( CHECK_KEY ("Up") )
{
ind = mods | GHID_KEY_UP;
}
else if ( CHECK_KEY ("Down") )
{
ind = mods | GHID_KEY_DOWN;
}
else if ( CHECK_KEY ("Left") )
{
ind = mods | GHID_KEY_LEFT;
}
else if ( CHECK_KEY ("Right") )
{
ind = mods | GHID_KEY_RIGHT;
}
if (ind > 0)
{
if (ind >= N_HOTKEY_ACTIONS)
{
fprintf (stderr, _("ERROR: overflow of the ghid_hotkey_actions array. Index = %d\n"
"Please report this.\n"), ind);
exit (1);
}
ghid_hotkey_actions[ind].action = action;
ghid_hotkey_actions[ind].node = node;
#ifdef DEBUG_MENUS
printf ("Adding \"special\" hotkey to ghid_hotkey_actions[%u] :"
" %s (%s)\n", ind, accel, name);
#endif
}
}
/*!
* \brief Finds the gpcb-menu.res file.
*/
char *
get_menu_filename (void)
{
char *rv = NULL;
char *home_pcbmenu = NULL;
/* homedir is set by the core */
if (homedir)
{
Message (_("Note: home directory is \"%s\"\n"), homedir);
home_pcbmenu = Concat (homedir, PCB_DIR_SEPARATOR_S, ".pcb",
PCB_DIR_SEPARATOR_S, "gpcb-menu.res", NULL);
}
else
Message (_("Warning: could not determine home directory\n"));
if (access ("gpcb-menu.res", R_OK) == 0)
rv = strdup ("gpcb-menu.res");
else if (home_pcbmenu != NULL && (access (home_pcbmenu, R_OK) == 0) )
rv = home_pcbmenu;
else if (access (pcbmenu_path, R_OK) == 0)
rv = strdup (pcbmenu_path);
return rv;
}
static GtkWidget *
ghid_load_menus (void)
{
char *filename;
const Resource *r = 0, *bir;
const Resource *mr;
GtkWidget *menu_bar = NULL;
int i;
for (i = 0; i < N_HOTKEY_ACTIONS; i++)
{
ghid_hotkey_actions[i].action = NULL;
ghid_hotkey_actions[i].node = NULL;
}
bir = resource_parse (0, gpcb_menu_default);
if (!bir)
{
fprintf (stderr, _("Error: internal menu resource didn't parse\n"));
exit(1);
}
filename = get_menu_filename ();
if (filename)
{
Message (_("Loading menus from %s\n"), filename);
r = resource_parse (filename, 0);
}
if (!r)
{
Message (_("Using default menus\n"));
r = bir;
}
free (filename);
mr = resource_subres (r, "MainMenu");
if (!mr)
mr = resource_subres (bir, "MainMenu");
if (mr)
{
menu_bar = ghid_main_menu_new (G_CALLBACK (ghid_menu_cb),
<API key>);
<API key> (GHID_MAIN_MENU (menu_bar), mr);
}
mr = resource_subres (r, "PopupMenus");
if (!mr)
mr = resource_subres (bir, "PopupMenus");
if (mr)
{
int i;
for (i = 0; i < mr->c; i++)
if (resource_type (mr->v[i]) == 101)
/* This is a named resource which defines a popup menu */
<API key> (GHID_MAIN_MENU (menu_bar),
mr->v[i].name, mr->v[i].subres);
}
#ifdef DEBUG_MENUS
puts ("Finished loading menus.");
#endif
mr = resource_subres (r, "Mouse");
if (!mr)
mr = resource_subres (bir, "Mouse");
if (mr)
load_mouse_resource (mr);
return menu_bar;
}
static const char adjuststyle_syntax[] =
N_("AdjustStyle()\n");
static const char adjuststyle_help[] =
N_("Open the window which allows editing of the route styles.");
/* %start-doc actions AdjustStyle
Opens the window which allows editing of the route styles.
%end-doc */
static int
AdjustStyle(int argc, char **argv, Coord x, Coord y)
{
<API key>
(<API key> (ghidgui-><API key>));
return 0;
}
static const char <API key>[] =
N_("EditLayerGroups()\n");
static const char <API key>[] =
N_("Open the preferences window which allows editing of the layer groups.");
/* %start-doc actions EditLayerGroups
Opens the preferences window which is where the layer groups
are edited. This action is primarily provides to provide menu
resource compatibility with the lesstif HID.
%end-doc */
static int
EditLayerGroups(int argc, char **argv, Coord x, Coord y)
{
if (argc != 0)
AFAIL (editlayergroups);
hid_actionl ("DoWindows", "Preferences", NULL);
return 0;
}
HID_Action <API key>[] = {
{"AdjustStyle", 0, AdjustStyle, adjuststyle_help, adjuststyle_syntax},
{"EditLayerGroups", 0, EditLayerGroups, <API key>, <API key>}
};
REGISTER_ACTIONS (<API key>) |
'use strict';
module.exports = {
context: {
id: 'input-radio',
label: 'radio buttons',
options: [
{
label: 'Radio option 1',
name: 'radiogroup',
id: 'radio-1'
},
{
label: 'Radio option 2',
name: 'radiogroup',
id: 'radio-2'
}
]
},
variants: [
{
name: 'with-error',
context: {
id: 'input_text--error',
label: 'input-text',
modifier: 'error',
field_description: 'You can add an optional field description here.',
field_message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec laoreet, urna sit amet convallis rhoncus, felis ex.',
options: [
{
label: 'Radio option 1',
name: 'radiogroup-error',
id: 'radio-error-1'
},
{
label: 'Radio option 2',
name: 'radiogroup-error',
id: 'radio-error-2'
}
]
}
},
{
name: 'with-success',
context: {
id: 'input-text--success',
label: 'input-text',
modifier: 'success',
field_description: 'You can add an optional field description here.',
field_message: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec laoreet, urna sit amet convallis rhoncus, felis ex.',
options: [
{
label: 'Radio option 1',
name: 'radiogroup-success',
id: 'radio-success-1'
},
{
label: 'Radio option 2',
name: 'radiogroup-success',
id: 'radio-success-2'
}
]
}
}
]
}; |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './viewer.ui'
# Created: Sun Aug 23 04:04:27 2009
# by: PyQt4 UI code generator 4.4.2
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(566,421)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.label = QtGui.QLabel(self.centralwidget)
self.label.setObjectName("label")
self.horizontalLayout.addWidget(self.label)
self.pathEdit = QtGui.QLineEdit(self.centralwidget)
self.pathEdit.setObjectName("pathEdit")
self.horizontalLayout.addWidget(self.pathEdit)
self.browseButton = QtGui.QPushButton(self.centralwidget)
self.browseButton.setObjectName("browseButton")
self.horizontalLayout.addWidget(self.browseButton)
spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.label_3 = QtGui.QLabel(self.centralwidget)
self.label_3.setObjectName("label_3")
self.horizontalLayout.addWidget(self.label_3)
self.ppsSpin = QtGui.QSpinBox(self.centralwidget)
self.ppsSpin.setMaximum(10000)
self.ppsSpin.setSingleStep(10)
self.ppsSpin.setProperty("value",QtCore.QVariant(100))
self.ppsSpin.setObjectName("ppsSpin")
self.horizontalLayout.addWidget(self.ppsSpin)
self.verticalLayout.addLayout(self.horizontalLayout)
self.scrollArea = QtGui.QScrollArea(self.centralwidget)
self.scrollArea.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.scrollArea.setObjectName("scrollArea")
self.<API key> = QtGui.QWidget(self.scrollArea)
self.<API key>.setGeometry(QtCore.QRect(0,1,513,290))
self.<API key>.setObjectName("<API key>")
self.horizontalLayout_3 = QtGui.QHBoxLayout(self.<API key>)
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.imageLabel = CursorLabel(self.<API key>)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
sizePolicy.<API key>(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.imageLabel.sizePolicy().hasHeightForWidth())
self.imageLabel.setSizePolicy(sizePolicy)
self.imageLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
self.imageLabel.setObjectName("imageLabel")
self.horizontalLayout_3.addWidget(self.imageLabel)
self.verticalLayout.addWidget(self.scrollArea)
self.progress = QtGui.QProgressBar(self.centralwidget)
self.progress.setProperty("value",QtCore.QVariant(0))
self.progress.setTextVisible(False)
self.progress.setObjectName("progress")
self.verticalLayout.addWidget(self.progress)
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.commandCheck = QtGui.QCheckBox(self.centralwidget)
self.commandCheck.setObjectName("commandCheck")
self.horizontalLayout_2.addWidget(self.commandCheck)
self.commandEdit = QtGui.QLineEdit(self.centralwidget)
self.commandEdit.setObjectName("commandEdit")
self.horizontalLayout_2.addWidget(self.commandEdit)
spacerItem1 = QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem1)
self.centeredCheck = QtGui.QCheckBox(self.centralwidget)
self.centeredCheck.setChecked(True)
self.centeredCheck.setObjectName("centeredCheck")
self.horizontalLayout_2.addWidget(self.centeredCheck)
spacerItem2 = QtGui.QSpacerItem(20,20,QtGui.QSizePolicy.Fixed,QtGui.QSizePolicy.Minimum)
self.horizontalLayout_2.addItem(spacerItem2)
self.playButton = QtGui.QPushButton(self.centralwidget)
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(170,0,0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active,QtGui.QPalette.Button,brush)
brush = QtGui.QBrush(QtGui.QColor(170,0,0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive,QtGui.QPalette.Button,brush)
brush = QtGui.QBrush(QtGui.QColor(170,0,0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled,QtGui.QPalette.Button,brush)
self.playButton.setPalette(palette)
self.playButton.setObjectName("playButton")
self.horizontalLayout_2.addWidget(self.playButton)
self.stopButton = QtGui.QPushButton(self.centralwidget)
self.stopButton.setObjectName("stopButton")
self.horizontalLayout_2.addWidget(self.stopButton)
self.verticalLayout.addLayout(self.horizontalLayout_2)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("MainWindow", "Spectrogram", None, QtGui.QApplication.UnicodeUTF8))
self.browseButton.setText(QtGui.QApplication.translate("MainWindow", "Browse", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Pixels per second", None, QtGui.QApplication.UnicodeUTF8))
self.imageLabel.setText(QtGui.QApplication.translate("MainWindow", "[image]", None, QtGui.QApplication.UnicodeUTF8))
self.commandCheck.setText(QtGui.QApplication.translate("MainWindow", "Command", None, QtGui.QApplication.UnicodeUTF8))
self.commandEdit.setText(QtGui.QApplication.translate("MainWindow", "xmms -p", None, QtGui.QApplication.UnicodeUTF8))
self.centeredCheck.setText(QtGui.QApplication.translate("MainWindow", "Centered", None, QtGui.QApplication.UnicodeUTF8))
self.playButton.setText(QtGui.QApplication.translate("MainWindow", "Play", None, QtGui.QApplication.UnicodeUTF8))
self.stopButton.setText(QtGui.QApplication.translate("MainWindow", "Stop", None, QtGui.QApplication.UnicodeUTF8))
from cursorlabel import CursorLabel |
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<meta name="robots" content="all" />
<meta name="author" content="w3school.com.cn" />
<link rel="stylesheet" type="text/css" href="../c5.css" />
<title>HTML DOM - HTML </title>
</head>
<body class="browserscripting">
<div id="wrapper">
<div id="header">
<a href="../index-2.html" title="w3school " style="float:left;">w3school </a>
<div id="ad_head">
<script type="text/javascript"><!
google_ad_client = "<API key>";
/* 728x90, 08-12-1 */
google_ad_slot = "7423315034";
google_ad_width = 728;
google_ad_height = 90;
</script>
<script type="text/javascript"
src="../../pagead2.googlesyndication.com/pagead/f.txt">
</script>
</div>
</div>
<div id="navfirst">
<ul id="menu">
<li id="h"><a href="../h.html" title="HTML ">HTML </a></li>
<li id="b"><a href="../b.html" title=""></a></li>
<li id="s"><a href="../s.html" title=""></a></li>
<li id="d"><a href="../d.html" title="ASP.NET ">ASP.NET </a></li>
<li id="x"><a href="../x.html" title="XML ">XML </a></li>
<li id="ws"><a href="../ws.html" title="Web Services ">Web Services </a></li>
<li id="w"><a href="../w.html" title=""></a></li>
</ul>
</div>
<div id="navsecond">
<div id="course"><h2>HTML DOM</h2>
<ul>
<li><a href="index.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_intro.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_nodes.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_methods.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_properties.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_using.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_modify.html" title="HTML DOM ">DOM </a></li>
<li class="currentLink"><a href="dom_content.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_elements.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_events.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_navigation.html" title="HTML DOM ">DOM </a></li>
<li><a href="dom_summary.html" title=" HTML DOM">DOM </a></li>
</ul>
<h2>DOM </h2>
<ul>
<li><a href="../example/hdom_examples.html" title="HTML DOM ">DOM </a></li>
</ul>
<h2>DOM </h2>
<ul>
<li><a href="../jsref/index.html" title="JavaScript HTML DOM ">DOM </a></li>
</ul>
</div><div id="selected">
<h2></h2>
<ul>
<li><a href="../site/index.html" title=""></a></li>
<li><a href="../w3c/index.html" title=" (W3C)"> (W3C)</a></li>
<li><a href="../browsers/index.html" title=""></a></li>
<li><a href="../quality/index.html" title=""></a></li>
<li><a href="../semweb/index.html" title=""></a></li>
<li><a href="../careers/index.asp" title=""></a></li>
<li><a href="../hosting/index.html" title=""></a></li>
</ul>
<h2><a href="../about/index.html" title=" W3School" id="link_about"> W3School</a></h2>
<h2><a href="../about/about_helping.html" title=" W3School" id="link_help"> W3School</a></h2>
</div>
</div>
<div id="maincontent">
<h1>HTML DOM - HTML </h1>
<div id="tpn">
<ul class="prenext">
<li class="pre"><a href="dom_modify.html" title="HTML DOM ">DOM </a></li>
<li class="next"><a href="dom_elements.html" title="HTML DOM ">DOM </a></li>
</ul>
</div>
<div id="intro">
<p> HTML DOMJavaScript HTML </p>
</div>
<div>
<h2> HTML </h2>
<p> innerHTML </p>
<p> <p> HTML </p>
<h3></h3>
<pre>
<html>
<body>
<p id="p1">Hello World!</p>
<script>
document.getElementById("p1").innerHTML="New text!";
</script>
</body>
</html>
</pre>
<p class="tiy"><a target="_blank" href="../tiy/t2b48.html?f=dom_changetext"></a></p>
</div>
<div>
<h2> HTML </h2>
<p> HTML DOM HTML </p>
<p> HTML </p>
<h3></h3>
<pre>
<html>
<body>
<p id="p2">Hello world!</p>
<script>
document.getElementById("p2").style.color="blue";
</script>
</body>
</html>
</pre>
<p class="tiy"><a target="_blank" href="../tiy/t179b.html?f=dom_changestyle"></a></p>
</div>
<div>
<h2></h2>
<p>HTML DOM </p>
<p> HTML ”“</p>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<p></p>
<p> <body> </p>
<h3></h3>
<pre>
<html>
<body>
<input type="button" onclick="document.body.style.backgroundColor='lavender';"
value="Change background color" />
</body>
</html>
</pre>
<p class="tiy"><a target="_blank" href="../tiy/tbfbb.html?f=<API key>"></a></p>
<p></p>
<h3></h3>
<pre>
<html>
<body>
<script>
function ChangeBackground()
{
document.body.style.backgroundColor="lavender";
}
</script>
<input type="button" onclick="ChangeBackground()"
value="Change background color" />
</body>
</html>
</pre>
<p class="tiy"><a target="_blank" href="../tiy/t7f70.html?f=<API key>"></a></p>
<p> <p> </p>
<h3></h3>
<pre>
<html>
<body>
<p id="p1">Hello world!</p>
<script>
function ChangeText()
{
document.getElementById("p1").innerHTML="New text!";
}
</script>
<input type="button" onclick="ChangeText()" value="Change text">
</body>
</html>
</pre>
<p class="tiy"><a target="_blank" href="../tiy/t2f05.html?f=dom_changetext2"></a></p>
</div>
<div id="bpn">
<ul class="prenext">
<li class="pre"><a href="dom_modify.html" title="HTML DOM ">DOM </a></li>
<li class="next"><a href="dom_elements.html" title="HTML DOM ">DOM </a></li>
</ul>
</div>
</div>
<!-- maincontent end -->
<div id="sidebar">
<div id="searchui">
<form method="get" id="searchform" action="http:
<p><label for="searched_content">Search:</label></p>
<p><input type="hidden" name="sitesearch" value="w3school.com.cn" /></p>
<p>
<input type="text" name="as_q" class="box" id="searched_content" title="" />
<input type="submit" value="Go" class="button" title="" />
</p>
</form>
</div>
<div id="tools">
<h5 id="tools_reference"><a href="../jsref/index.html">HTML DOM </a></h5>
<h5 id="tools_example"><a href="../example/hdom_examples.html">HTML DOM </a></h5>
</div>
<div id="ad">
<script type="text/javascript"><!
google_ad_client = "<API key>";
/* sidebar-160x600 */
google_ad_slot = "3772569310";
google_ad_width = 160;
google_ad_height = 600;
</script>
<script type="text/javascript"
src="../../pagead2.googlesyndication.com/pagead/f.txt">
</script>
</div>
</div>
<div id="footer">
<p>
W3School W3School
</p>
<p>
<a href="../about/about_use.html" title=""></a><a href="../about/about_privacy.html" title=""></a>
<a href="http:
<a href="http:
</p>
</div>
</div>
<!-- wrapper end -->
</body>
</html> |
/* -*- Mode: C ; c-basic-offset: 4 -*- */
#ifndef <API key>
#define <API key>
void *
<API key>(
DBusConnection *connection);
void
jack_controller_run(
void *controller_ptr);
void
<API key>(
void *controller_ptr);
#endif /* #ifndef <API key> */ |
var AddServerView = function (data) {
//View for the login screen and login functionality
this.initialize = function () {
// View constructor
if (data){
// check the input
if (!('ip' in data) || !data['ip'] || !checkIsIPV4(data['ip'])){
error = 'The IP address given is invalid.';
$('#ip').addClass('has-error');
}
if (!('user' in data) || !data['user'] || !data['user'].length > 2){
error = error + 'The username given is invalid.';
$('#user').addClass('has-error');
}
if (!('password' in data) || !data['password'] || !data['password'].length > 4){
error = error + 'The password given is invalid';
$('#password').addClass('has-error');
}
if (error){
log('faulty parameters');
render('addserver', data);
} else {
// parameters should work
log('testing login details');
if (ping(data['ip'])){
log('pinged successfully');
} else {
log('Could not reach FN server; ' + data['ip']);
error = 'Could not reach FreeNAS server ' + data['ip'];
render('addserver', data);
}
}
} else {
log('loginview, no data');
info = 'You haven\'t added any servers yet.';
render('addserver', {
'user' : 'root', //for the moment, FN only supports 'root' as rest user
});
}
$(document).on('click', "#addsbutton", function(e) {
redirect("#doadd");
});
}
this.initialize();
} |
<?php
get_header(); ?>
<div id="container">
<div id="content" role="main">
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
get_template_part( 'loop', 'index' );
?>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> |
package sun.java2d.pipe;
import java.awt.AlphaComposite;
import java.awt.Composite;
import sun.java2d.SurfaceData;
import sun.java2d.loops.Blit;
import sun.java2d.loops.CompositeType;
import sun.java2d.loops.MaskBlit;
import sun.java2d.loops.SurfaceType;
import static sun.java2d.pipe.BufferedOpCodes.*;
/**
* The MaskBlit operation is expressed as:
* dst = ((src <MODE> dst) * pathA) + (dst * (1 - pathA))
*
* The OGL/D3D implementation of the MaskBlit operation differs from the above
* equation because it is not possible to perform such a complex operation in
* OpenGL/Direct3D (without the use of advanced techniques like fragment
* shaders and multitexturing). Therefore, the BufferedMaskBlit operation
* is expressed as:
* dst = (src * pathA) <SrcOver> dst
*
* This simplified formula is only equivalent to the "true" MaskBlit equation
* in the following situations:
* - <MODE> is SrcOver
* - <MODE> is Src, extra alpha == 1.0, and the source surface is opaque
*
* Therefore, we register BufferedMaskBlit primitives for only the SurfaceType
* and CompositeType restrictions mentioned above. In addition for the Src
* case, we must override the composite with a SrcOver (no extra alpha)
* instance, so that we set up the OpenGL/Direct3D blending mode to match the
* BufferedMaskBlit equation.
*/
public abstract class BufferedMaskBlit extends MaskBlit {
private static final int ST_INT_ARGB = 0;
private static final int ST_INT_ARGB_PRE = 1;
private static final int ST_INT_RGB = 2;
private static final int ST_INT_BGR = 3;
private final RenderQueue rq;
private final int srcTypeVal;
private Blit blitop;
protected BufferedMaskBlit(RenderQueue rq,
SurfaceType srcType,
CompositeType compType,
SurfaceType dstType)
{
super(srcType, compType, dstType);
this.rq = rq;
if (srcType == SurfaceType.IntArgb) {
this.srcTypeVal = ST_INT_ARGB;
} else if (srcType == SurfaceType.IntArgbPre) {
this.srcTypeVal = ST_INT_ARGB_PRE;
} else if (srcType == SurfaceType.IntRgb) {
this.srcTypeVal = ST_INT_RGB;
} else if (srcType == SurfaceType.IntBgr) {
this.srcTypeVal = ST_INT_BGR;
} else {
throw new InternalError("unrecognized source surface type");
}
}
@Override
public void MaskBlit(SurfaceData src, SurfaceData dst,
Composite comp, Region clip,
int srcx, int srcy,
int dstx, int dsty,
int width, int height,
byte[] mask, int maskoff, int maskscan)
{
if (width <= 0 || height <= 0) {
return;
}
if (mask == null) {
// no mask involved; delegate to regular blit loop
if (blitop == null) {
blitop = Blit.getFromCache(src.getSurfaceType(),
CompositeType.AnyAlpha,
this.getDestType());
}
blitop.Blit(src, dst,
comp, clip,
srcx, srcy, dstx, dsty,
width, height);
return;
}
AlphaComposite acomp = (AlphaComposite)comp;
if (acomp.getRule() != AlphaComposite.SRC_OVER) {
comp = AlphaComposite.SrcOver;
}
rq.lock();
try {
validateContext(dst, comp, clip);
RenderBuffer buf = rq.getBuffer();
int totalBytesRequired = 20 + (width * height * 4);
/*
* REMIND: we should fix this so that it works with tiles that
* are larger than the entire buffer, but the native
* OGL/D3DMaskBlit isn't even prepared for tiles larger
* than 32x32 pixels, so there's no urgency here...
*/
rq.ensureCapacity(totalBytesRequired);
// enqueue parameters and tile pixels
int newpos = enqueueTile(buf.getAddress(), buf.position(),
src, src.getNativeOps(), srcTypeVal,
mask, mask.length, maskoff, maskscan,
srcx, srcy, dstx, dsty,
width, height);
buf.position(newpos);
} finally {
rq.unlock();
}
}
private native int enqueueTile(long buf, int bpos,
SurfaceData srcData,
long pSrcOps, int srcType,
byte[] mask, int masklen,
int maskoff, int maskscan,
int srcx, int srcy, int dstx, int dsty,
int width, int height);
/**
* Validates the context state using the given destination surface
* and composite/clip values.
*/
protected abstract void validateContext(SurfaceData dstData,
Composite comp, Region clip);
} |
#ifndef <API key>
#define <API key>
#include "CwxPre.h"
#include "CwxGlobalMacro.h"
#include "CwxType.h"
#include "CwxAppMacro.h"
#include "CwxAppConfig.h"
#include "CwxStl.h"
#include "CwxAppFramework.h"
<API key>
class CWX_API CwxAppProcessInfo
{
public:
¹¤×÷½ø³Ì״̬
enum{
PROC_STATE_RUNNING = 1,
<API key> = 2,
PROC_STATE_STOPPING = 3,
PROC_STATE_STOPPED = 4
};
public:
¹¹Ô캯Êý
CwxAppProcessInfo()
{
m_pApp = NULL;
m_unProcId = 0;
m_pid = 0;
m_ttLastChildHeat = 0;
m_unState = PROC_STATE_STOPPED;
}
Îö¹¹º¯Êý
~CwxAppProcessInfo()
{
if (m_pApp) delete m_pApp;
}
public:
CwxAppFramework* m_pApp;
CWX_UINT16 m_unProcId;
pid_t m_pid;
time_t m_ttLastChildHeat;
CWX_UINT8 m_unState;
};
class CWX_API CwxAppProcessMgr
{
public:
static int init(CwxAppFramework* pApp);
static int start(int argc, char** argv, CWX_UINT16 <API key>, CWX_UINT16 unDelaySec);
private:
×¢²áÐźŴ¦Àíhandle
static int regSigHandle();
¼ì²é·þÎñÆô¶¯µÄÃüÁîÐвÎÊý
static int checkRunCmd(int argc, char** argv);
Æô¶¯¹¤×÷½ø³Ì
static int startProcess(int argc, char** argv, CWX_UINT16 unDelaySec);
SIGQUIT Ðźžä±ú
static void stopHandler(int , siginfo_t *info, void *);
SIGINT Ðźžä±ú
static void restartHandler(int , siginfo_t *info, void *);
SIGCHLD Ðźžä±ú£¬´ËΪ¹¤×÷½ø³ÌÍ˳öµÄÐźÅ
static void childExitHandler(int , siginfo_t *info, void *);
SIGHUPµÄÐÄÌøÐźžä±ú
static void childHeatHandler(int , siginfo_t *info, void *);
×èÈûÖ¸¶¨µÄÐźÅ
static void blockSignal(int signal);
È¡Ïû×èÈûÖ¸¶¨µÄÐźÅ
static void unblockSignal(int signal);
Ëø×¡½ø³ÌÎļþ¡£·µ»Ø½ø³ÌÎļþµÄFILE
static FILE* lock();
½âËø½ø³ÌÎļþ¡£Í¬Ê±¹Ø±ÕÎļþ
static void unlock(FILE* fd);
ÅжϽø³ÌÊÇ·ñ´æÔÚ,-1£ºÊ§°Ü£»0£º²»´æÔÚ£»1£º´æÔÚ
static int isExistProc(char const* szProcName, int pid);
»ñÈ¡pidÎļþÖеĽø³Ìid£¬-1£ºÊ§°Ü
static int getProcId(char const* szPidFile);
private:
½ûÖ¹´´½¨¶ÔÏóʵÀý
CwxAppProcessMgr()
{
}
private:
static CwxAppProcessInfo* m_pProcess;
static string m_strPorcfile;
static string m_strAppName;
static string m_strAppLockFile;
static bool m_bExit;
};
<API key>
#include "CwxPost.h"
#endif |
#include "module.h"
#include "module-formats.h"
#include "signals.h"
#include "commands.h"
#include "misc.h"
#include "servers.h"
#include "settings.h"
#include "levels.h"
#include "themes.h"
#include "fe-windows.h"
#include "window-items.h"
#include "windows-layout.h"
#include "printtext.h"
static void window_print_binds(WINDOW_REC *win)
{
GSList *tmp;
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
for (tmp = win->bound_items; tmp != NULL; tmp = tmp->next) {
WINDOW_BIND_REC *bind = tmp->data;
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>,
bind->name, bind->servertag,
bind->sticky ? "sticky" : "");
}
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
}
static void window_print_items(WINDOW_REC *win)
{
GSList *tmp;
const char *type;
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
for (tmp = win->items; tmp != NULL; tmp = tmp->next) {
WI_ITEM_REC *item = tmp->data;
type = module_find_id_str("WINDOW ITEM TYPE", item->type);
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>,
type == NULL ? "??" : type,
item->visible_name,
item->server == NULL ? "" :
item->server->tag);
}
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
}
static void cmd_window_info(WINDOW_REC *win)
{
char *levelstr;
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
/* Window reference number + sticky status */
if (!win->sticky_refnum) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>, win->refnum);
} else {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>, win->refnum);
}
/* Window name */
if (win->name != NULL) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>, win->name);
}
/* Window width / height */
printformat_window(win, MSGLEVEL_CLIENTCRAP, <API key>,
win->width, win->height);
/* Window immortality */
if (win->immortal) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
}
/* Window history name */
if (win->history_name != NULL) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>, win->history_name);
}
/* Window level */
levelstr = win->level == 0 ?
g_strdup("NONE") : bits2level(win->level);
printformat_window(win, MSGLEVEL_CLIENTCRAP, <API key>,
levelstr);
g_free(levelstr);
/* Active window server + sticky status */
if (win->servertag == NULL) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>,
win->active_server != NULL ?
win->active_server->tag : "NONE");
} else {
if (win->active_server != NULL &&
strcmp(win->active_server->tag, win->servertag) != 0)
g_warning("Active server isn't the sticky server!");
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>,
win->servertag);
}
/* Window theme + error status */
if (win->theme_name != NULL) {
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>, win->theme_name,
win->theme != NULL ? "" : "(not loaded)");
}
/* Bound items in window */
if (win->bound_items != NULL)
window_print_binds(win);
/* Item */
if (win->items != NULL)
window_print_items(win);
signal_emit("window print info", 1, win);
printformat_window(win, MSGLEVEL_CLIENTCRAP,
<API key>);
}
static void cmd_window(const char *data, void *server, WI_ITEM_REC *item)
{
while (*data == ' ') data++;
if (*data == '\0')
cmd_window_info(active_win);
else if (is_numeric(data, 0))
signal_emit("command window refnum", 3, data, server, item);
else
command_runsub("window", data, server, item);
}
/* SYNTAX: WINDOW NEW [HIDDEN|SPLIT] */
static void cmd_window_new(const char *data, void *server, WI_ITEM_REC *item)
{
WINDOW_REC *window;
int type;
g_return_if_fail(data != NULL);
type = (g_ascii_strncasecmp(data, "hid", 3) == 0 || g_ascii_strcasecmp(data, "tab") == 0) ? 1 :
(g_ascii_strcasecmp(data, "split") == 0 ? 2 : 0);
signal_emit("gui window create override", 1, GINT_TO_POINTER(type));
window = window_create(NULL, FALSE);
<API key>(window, server);
}
/* SYNTAX: WINDOW CLOSE [<first> [<last>]] */
static void cmd_window_close(const char *data)
{
GSList *tmp, *destroys;
char *first, *last;
int first_num, last_num;
void *free_arg;
if (!cmd_get_params(data, &free_arg, 2, &first, &last))
return;
if ((*first != '\0' && !is_numeric(first, '\0')) ||
((*last != '\0') && !is_numeric(last, '\0'))) {
cmd_params_free(free_arg);
return;
}
first_num = *first == '\0' ? active_win->refnum : atoi(first);
last_num = *last == '\0' ? first_num : atoi(last);
/* get list of windows to destroy */
destroys = NULL;
for (tmp = windows; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data;
if (rec->refnum >= first_num && rec->refnum <= last_num)
destroys = g_slist_append(destroys, rec);
}
/* really destroy the windows */
while (destroys != NULL) {
WINDOW_REC *rec = destroys->data;
if (windows->next != NULL) {
if (!rec->immortal)
window_destroy(rec);
else {
printformat_window(rec, <API key>,
<API key>);
}
}
destroys = g_slist_remove(destroys, rec);
}
cmd_params_free(free_arg);
}
/* SYNTAX: WINDOW REFNUM <number> */
static void cmd_window_refnum(const char *data)
{
WINDOW_REC *window;
if (!is_numeric(data, 0))
return;
window = window_find_refnum(atoi(data));
if (window != NULL)
window_set_active(window);
}
/**
* return the window with the highest activity
*
* If ignore_refnum is true, the most recently active window with the highest
* activity will be returned. If ignore_refnum is false, the refnum will be used
* to break ties between windows with equally high activity.
*/
static WINDOW_REC *<API key>(WINDOW_REC *window,
int ignore_refnum)
{
WINDOW_REC *rec, *max_win;
GSList *tmp;
int max_act, max_ref, through;
<API key>(window != NULL, NULL);
max_win = NULL; max_act = 0; max_ref = 0; through = FALSE;
tmp = g_slist_find(windows, window);
for (;; tmp = tmp->next) {
if (tmp == NULL) {
tmp = windows;
through = TRUE;
}
if (through && tmp->data == window)
break;
rec = tmp->data;
/* ignore refnum */
if (ignore_refnum &&
rec->data_level > 0 && max_act < rec->data_level) {
max_act = rec->data_level;
max_win = rec;
}
/* windows with lower refnums break ties */
else if (!ignore_refnum &&
rec->data_level > 0 &&
(rec->data_level > max_act ||
(rec->data_level == max_act && rec->refnum < max_ref))) {
max_act = rec->data_level;
max_win = rec;
max_ref = rec->refnum;
}
}
return max_win;
}
static inline int is_nearer(int r1, int r2)
{
int a = r2 < active_win->refnum;
int b = r1 < r2;
if (r1 > active_win->refnum)
return a || b;
else
return a && b;
}
static WINDOW_REC *<API key>(SERVER_REC *server, const char *name)
{
WINDOW_REC *rec, *win;
GSList *tmp;
win = NULL;
tmp = g_slist_find(windows, active_win);
tmp = tmp->next;
for (;; tmp = tmp->next) {
if (tmp == NULL)
tmp = windows;
if (tmp->data == active_win)
break;
rec = tmp->data;
if (<API key>(rec, server, name) != NULL &&
(win == NULL || is_nearer(rec->refnum, win->refnum))) {
win = rec;
if (server != NULL) break;
}
}
return win;
}
/* SYNTAX: WINDOW GOTO active|<number>|<name> */
static void cmd_window_goto(const char *data)
{
WINDOW_REC *window;
char *target;
void *free_arg;
g_return_if_fail(data != NULL);
if (is_numeric(data, 0)) {
cmd_window_refnum(data);
return;
}
if (!cmd_get_params(data, &free_arg, 1, &target))
return;
if (g_ascii_strcasecmp(target, "active") == 0)
window = <API key>(active_win,
settings_get_bool("<API key>"));
else {
window = window_find_name(target);
if (window == NULL && active_win->active_server != NULL)
window = <API key>(active_win->active_server, target);
if (window == NULL)
window = <API key>(NULL, target);
}
if (window != NULL)
window_set_active(window);
cmd_params_free(free_arg);
}
/* SYNTAX: WINDOW NEXT */
static void cmd_window_next(void)
{
int num;
num = window_refnum_next(active_win->refnum, TRUE);
if (num < 1) num = windows_refnum_last();
window_set_active(window_find_refnum(num));
}
/* SYNTAX: WINDOW LAST */
static void cmd_window_last(void)
{
if (windows->next != NULL)
window_set_active(windows->next->data);
}
/* SYNTAX: WINDOW PREVIOUS */
static void cmd_window_previous(void)
{
int num;
num = window_refnum_prev(active_win->refnum, TRUE);
if (num < 1) num = window_refnum_next(0, TRUE);
window_set_active(window_find_refnum(num));
}
/* SYNTAX: WINDOW LEVEL [<level>] */
static void cmd_window_level(const char *data)
{
char *level;
g_return_if_fail(data != NULL);
window_set_level(active_win, combine_level(active_win->level, data));
level = active_win->level == 0 ? g_strdup("NONE") :
bits2level(active_win->level);
printformat_window(active_win, <API key>,
TXT_WINDOW_LEVEL, level);
g_free(level);
}
/* SYNTAX: WINDOW IMMORTAL on|off|toggle */
static void cmd_window_immortal(const char *data)
{
int set;
if (*data == '\0')
set = active_win->immortal;
else if (g_ascii_strcasecmp(data, "ON") == 0)
set = TRUE;
else if (g_ascii_strcasecmp(data, "OFF") == 0)
set = FALSE;
else if (g_ascii_strcasecmp(data, "TOGGLE") == 0)
set = !active_win->immortal;
else {
printformat_window(active_win, <API key>,
TXT_NOT_TOGGLE);
return;
}
if (set) {
window_set_immortal(active_win, TRUE);
printformat_window(active_win, <API key>,
<API key>);
} else {
window_set_immortal(active_win, FALSE);
printformat_window(active_win, <API key>,
<API key>);
}
}
/* SYNTAX: WINDOW SERVER [-sticky | -unsticky] <tag> */
static void cmd_window_server(const char *data)
{
GHashTable *optlist;
SERVER_REC *server;
char *tag;
void *free_arg;
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
"window server", &optlist, &tag))
return;
if (*tag == '\0' && active_win->active_server != NULL &&
(g_hash_table_lookup(optlist, "sticky") != NULL ||
g_hash_table_lookup(optlist, "unsticky") != NULL)) {
tag = active_win->active_server->tag;
}
if (*tag == '\0')
cmd_param_error(<API key>);
server = server_find_tag(tag);
if (server == NULL)
server = <API key>(tag);
if (g_hash_table_lookup(optlist, "unsticky") != NULL &&
active_win->servertag != NULL) {
g_free_and_null(active_win->servertag);
printformat_window(active_win, <API key>,
<API key>);
}
if (active_win->servertag != NULL &&
g_hash_table_lookup(optlist, "sticky") == NULL) {
printformat_window(active_win, <API key>,
<API key>);
} else if (server == NULL) {
printformat_window(active_win, <API key>,
<API key>, tag);
} else if (active_win->active == NULL) {
<API key>(active_win, server);
if (g_hash_table_lookup(optlist, "sticky") != NULL) {
g_free_not_null(active_win->servertag);
active_win->servertag = g_strdup(server->tag);
printformat_window(active_win, <API key>,
<API key>, server->tag);
}
printformat_window(active_win, <API key>,
TXT_SERVER_CHANGED,
server->tag, server->connrec->address,
server->connrec->chatnet == NULL ? "" :
server->connrec->chatnet);
}
cmd_params_free(free_arg);
}
static void cmd_window_item(const char *data, void *server, WI_ITEM_REC *item)
{
while (*data == ' ') data++;
if (is_numeric(data, '\0'))
signal_emit("command window item goto", 3, data, server, item);
else
command_runsub("window item", data, server, item);
}
/* SYNTAX: WINDOW ITEM PREV */
static void <API key>(void)
{
window_item_prev(active_win);
}
/* SYNTAX: WINDOW ITEM NEXT */
static void <API key>(void)
{
window_item_next(active_win);
}
/* SYNTAX: WINDOW ITEM GOTO <number>|<name> */
static void <API key>(const char *data, SERVER_REC *server)
{
WI_ITEM_REC *item;
GSList *tmp;
void *free_arg;
char *target;
if (!cmd_get_params(data, &free_arg, 1, &target))
return;
if (is_numeric(target, '\0')) {
/* change to specified number */
tmp = g_slist_nth(active_win->items, atoi(target)-1);
item = tmp == NULL ? NULL : tmp->data;
} else {
item = <API key>(active_win, server, target);
}
if (item != NULL)
<API key>(active_win, item);
cmd_params_free(free_arg);
}
/* SYNTAX: WINDOW ITEM MOVE <number>|<name> */
static void <API key>(const char *data, SERVER_REC *server,
WI_ITEM_REC *item)
{
WINDOW_REC *window;
void *free_arg;
char *target;
if (!cmd_get_params(data, &free_arg, 1, &target))
return;
if (is_numeric(target, '\0')) {
/* move current window item to specified window */
window = window_find_refnum(atoi(target));
} else {
/* move specified window item to current window */
item = window_item_find(server, target);
window = active_win;
}
if (window != NULL && item != NULL)
<API key>(window, item);
cmd_params_free(free_arg);
}
/* SYNTAX: WINDOW NUMBER [-sticky] <number> */
static void cmd_window_number(const char *data)
{
GHashTable *optlist;
char *refnum;
void *free_arg;
int num;
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
"window number", &optlist, &refnum))
return;
if (*refnum == '\0')
cmd_param_error(<API key>);
num = atoi(refnum);
if (num < 1) {
printformat_window(active_win, <API key>,
TXT_REFNUM_TOO_LOW);
} else {
window_set_refnum(active_win, num);
active_win->sticky_refnum =
g_hash_table_lookup(optlist, "sticky") != NULL;
}
cmd_params_free(free_arg);
}
/* SYNTAX: WINDOW NAME <name> */
static void cmd_window_name(const char *data)
{
WINDOW_REC *win;
win = window_find_name(data);
if (win == NULL || win == active_win)
window_set_name(active_win, data);
else if (active_win->name == NULL ||
strcmp(active_win->name, data) != 0) {
printformat_window(active_win, <API key>,
<API key>, data);
}
}
/* SYNTAX: WINDOW HISTORY <name> */
void cmd_window_history(const char *data)
{
window_set_history(active_win, data);
}
/* we're moving the first window to last - move the first contiguous block
of refnums to left. Like if there's windows 1..5 and 7..10, move 1 to
11, 2..5 to 1..4 and leave 7..10 alone */
static void <API key>(WINDOW_REC *move_window)
{
WINDOW_REC *window;
int refnum, new_refnum;
new_refnum = windows_refnum_last();
for (refnum = move_window->refnum+1; refnum <= new_refnum; refnum++) {
window = window_find_refnum(refnum);
if (window == NULL) {
new_refnum++;
break;
}
window_set_refnum(window, refnum-1);
}
window_set_refnum(move_window, new_refnum);
}
/* we're moving the last window to first - make some space so we can use the
refnum 1 */
static void <API key>(WINDOW_REC *move_window)
{
WINDOW_REC *window;
int refnum, new_refnum;
new_refnum = 1;
if (window_find_refnum(new_refnum) == NULL) {
window_set_refnum(move_window, new_refnum);
return;
}
/* find the first unused refnum, like if there's windows
1..5 and 7..10, we only need to move 1..5 to 2..6 */
refnum = new_refnum;
while (move_window->refnum == refnum ||
window_find_refnum(refnum) != NULL) refnum++;
refnum
while (refnum >= new_refnum) {
window = window_find_refnum(refnum);
window_set_refnum(window, refnum+1);
refnum
}
window_set_refnum(move_window, new_refnum);
}
/* SYNTAX: WINDOW MOVE PREV */
static void <API key>(void)
{
int refnum;
refnum = window_refnum_prev(active_win->refnum, FALSE);
if (refnum != -1) {
window_set_refnum(active_win, refnum);
return;
}
<API key>(active_win);
}
/* SYNTAX: WINDOW MOVE NEXT */
static void <API key>(void)
{
int refnum;
refnum = window_refnum_next(active_win->refnum, FALSE);
if (refnum != -1) {
window_set_refnum(active_win, refnum);
return;
}
<API key>(active_win);
}
static void <API key>(int new_refnum)
{
int refnum;
if (new_refnum > active_win->refnum) {
for (;;) {
refnum = window_refnum_next(active_win->refnum, FALSE);
if (refnum == -1 || refnum > new_refnum)
break;
window_set_refnum(active_win, refnum);
}
} else {
for (;;) {
refnum = window_refnum_prev(active_win->refnum, FALSE);
if (refnum == -1 || refnum < new_refnum)
break;
window_set_refnum(active_win, refnum);
}
}
}
/* SYNTAX: WINDOW MOVE FIRST */
static void <API key>(void)
{
<API key>(1);
}
/* SYNTAX: WINDOW MOVE LAST */
static void <API key>(void)
{
<API key>(windows_refnum_last());
}
/* SYNTAX: WINDOW MOVE <number>|<direction> */
static void cmd_window_move(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
if (!is_numeric(data, 0)) {
command_runsub("window move", data, server, item);
return;
}
<API key>(atoi(data));
}
/* SYNTAX: WINDOW LIST */
static void cmd_window_list(void)
{
GSList *tmp, *sorted;
char *levelstr;
sorted = windows_get_sorted();
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, <API key>);
for (tmp = sorted; tmp != NULL; tmp = tmp->next) {
WINDOW_REC *rec = tmp->data;
levelstr = bits2level(rec->level);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_WINDOWLIST_LINE,
rec->refnum, rec->name == NULL ? "" : rec->name,
rec->active == NULL ? "" : rec->active->visible_name,
rec->active_server == NULL ? "" : ((SERVER_REC *) rec->active_server)->tag,
levelstr);
g_free(levelstr);
}
g_slist_free(sorted);
printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, <API key>);
}
/* SYNTAX: WINDOW THEME [-delete] [<name>] */
static void cmd_window_theme(const char *data)
{
THEME_REC *theme;
GHashTable *optlist;
char *name;
void *free_arg;
if (!cmd_get_params(data, &free_arg, 1 | PARAM_FLAG_OPTIONS,
"window theme", &optlist, &name))
return;
if (g_hash_table_lookup(optlist, "delete") != NULL) {
g_free_and_null(active_win->theme_name);
printformat_window(active_win, <API key>,
<API key>);
} else if (*name == '\0') {
if (active_win->theme == NULL) {
printformat_window(active_win, <API key>,
<API key>);
} else {
theme = active_win->theme;
printformat_window(active_win, <API key>,
TXT_WINDOW_THEME,
theme->name, theme->path);
}
} else {
g_free_not_null(active_win->theme_name);
active_win->theme_name = g_strdup(data);
active_win->theme = theme = theme_load(data);
if (theme != NULL) {
printformat_window(active_win, <API key>,
<API key>,
theme->name, theme->path);
} else {
printformat_window(active_win, <API key>,
TXT_THEME_NOT_FOUND, data);
}
}
cmd_params_free(free_arg);
}
static void cmd_layout(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
command_runsub("layout", data, server, item);
}
/* SYNTAX: FOREACH WINDOW <command> */
static void cmd_foreach_window(const char *data)
{
WINDOW_REC *old;
GSList *list;
old = active_win;
list = g_slist_copy(windows);
while (list != NULL) {
WINDOW_REC *rec = list->data;
active_win = rec;
signal_emit("send command", 3, data, rec->active_server,
rec->active);
list = g_slist_remove(list, list->data);
}
if (g_slist_find(windows, old) != NULL)
active_win = old;
}
void window_console(void)
{
WINDOW_REC *window;
window = window_find_console();
if (!window)
return;
window_set_active(window);
}
void <API key>(void)
{
settings_add_bool("lookandfeel", "<API key>", TRUE);
command_bind("window", NULL, (SIGNAL_FUNC) cmd_window);
command_bind("window new", NULL, (SIGNAL_FUNC) cmd_window_new);
command_bind("window close", NULL, (SIGNAL_FUNC) cmd_window_close);
command_bind("window kill", NULL, (SIGNAL_FUNC) cmd_window_close);
command_bind("window server", NULL, (SIGNAL_FUNC) cmd_window_server);
command_bind("window refnum", NULL, (SIGNAL_FUNC) cmd_window_refnum);
command_bind("window goto", NULL, (SIGNAL_FUNC) cmd_window_goto);
command_bind("window previous", NULL, (SIGNAL_FUNC) cmd_window_previous);
command_bind("window next", NULL, (SIGNAL_FUNC) cmd_window_next);
command_bind("window last", NULL, (SIGNAL_FUNC) cmd_window_last);
command_bind("window level", NULL, (SIGNAL_FUNC) cmd_window_level);
command_bind("window immortal", NULL, (SIGNAL_FUNC) cmd_window_immortal);
command_bind("window item", NULL, (SIGNAL_FUNC) cmd_window_item);
command_bind("window item prev", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window item next", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window item goto", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window item move", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window number", NULL, (SIGNAL_FUNC) cmd_window_number);
command_bind("window name", NULL, (SIGNAL_FUNC) cmd_window_name);
command_bind("window history", NULL, (SIGNAL_FUNC) cmd_window_history);
command_bind("window move", NULL, (SIGNAL_FUNC) cmd_window_move);
command_bind("window move prev", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window move next", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window move first", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window move last", NULL, (SIGNAL_FUNC) <API key>);
command_bind("window list", NULL, (SIGNAL_FUNC) cmd_window_list);
command_bind("window theme", NULL, (SIGNAL_FUNC) cmd_window_theme);
command_bind("layout", NULL, (SIGNAL_FUNC) cmd_layout);
/* SYNTAX: LAYOUT SAVE */
command_bind("layout save", NULL, (SIGNAL_FUNC) windows_layout_save);
/* SYNTAX: LAYOUT RESET */
command_bind("layout reset", NULL, (SIGNAL_FUNC) <API key>);
command_bind("foreach window", NULL, (SIGNAL_FUNC) cmd_foreach_window);
command_set_options("window number", "sticky");
command_set_options("window server", "sticky unsticky");
command_set_options("window theme", "delete");
}
void <API key>(void)
{
command_unbind("window", (SIGNAL_FUNC) cmd_window);
command_unbind("window new", (SIGNAL_FUNC) cmd_window_new);
command_unbind("window close", (SIGNAL_FUNC) cmd_window_close);
command_unbind("window kill", (SIGNAL_FUNC) cmd_window_close);
command_unbind("window server", (SIGNAL_FUNC) cmd_window_server);
command_unbind("window refnum", (SIGNAL_FUNC) cmd_window_refnum);
command_unbind("window goto", (SIGNAL_FUNC) cmd_window_goto);
command_unbind("window previous", (SIGNAL_FUNC) cmd_window_previous);
command_unbind("window next", (SIGNAL_FUNC) cmd_window_next);
command_unbind("window last", (SIGNAL_FUNC) cmd_window_last);
command_unbind("window level", (SIGNAL_FUNC) cmd_window_level);
command_unbind("window immortal", (SIGNAL_FUNC) cmd_window_immortal);
command_unbind("window item", (SIGNAL_FUNC) cmd_window_item);
command_unbind("window item prev", (SIGNAL_FUNC) <API key>);
command_unbind("window item next", (SIGNAL_FUNC) <API key>);
command_unbind("window item goto", (SIGNAL_FUNC) <API key>);
command_unbind("window item move", (SIGNAL_FUNC) <API key>);
command_unbind("window number", (SIGNAL_FUNC) cmd_window_number);
command_unbind("window name", (SIGNAL_FUNC) cmd_window_name);
command_unbind("window history", (SIGNAL_FUNC) cmd_window_history);
command_unbind("window move", (SIGNAL_FUNC) cmd_window_move);
command_unbind("window move prev", (SIGNAL_FUNC) <API key>);
command_unbind("window move next", (SIGNAL_FUNC) <API key>);
command_unbind("window move first", (SIGNAL_FUNC) <API key>);
command_unbind("window move last", (SIGNAL_FUNC) <API key>);
command_unbind("window list", (SIGNAL_FUNC) cmd_window_list);
command_unbind("window theme", (SIGNAL_FUNC) cmd_window_theme);
command_unbind("layout", (SIGNAL_FUNC) cmd_layout);
command_unbind("layout save", (SIGNAL_FUNC) windows_layout_save);
command_unbind("layout reset", (SIGNAL_FUNC) <API key>);
command_unbind("foreach window", (SIGNAL_FUNC) cmd_foreach_window);
} |
#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
//#include "tm_p.h"
#include "diagnostic.h"
#include "tree-flow.h"
#include "tree-pass.h"
#include "toplev.h"
#include "gimple-pretty-print.h"
#include "cgraph.h"
#include "coretypes.h"
#include "tree.h"
#include "diagnostic.h"
#include "timevar.h"
#include "alloc-pool.h"
#include "params.h"
#include "ggc.h"
#include "vec.h"
//#include "df.h"
#include "bitmap.h"
#include "tree-ssa-operands.h"
#include "tree-flow-inline.h"
int <API key>;
static unsigned int print_liveness(void);
static void process_function (void);
struct simple_ipa_opt_pass pass_plugin = {
{
SIMPLE_IPA_PASS,
"liveness", /* name */
NULL, /* gate */
print_liveness, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static pass number */
TV_INTEGRATION, /* tv_id */
0, /* properties required */
0, /* properties provided */
0, /* properties destroyed */
0, /* todo_flags start */
0 /* todo_flags end */
}
};
struct register_pass_info pass_info = {
&(pass_plugin.pass), /* Address of new pass, here, the 'struct
opt_pass' field of 'simple_ipa_opt_pass'
defined above */
"pta", /* Name of the reference pass for hooking up
the new pass. */
0, /* Insert the pass at the specified instance
number of the reference pass. Do it for
every instance if it is 0. */
<API key> /* how to insert the new pass: before,
after, or replace. Here we are inserting
a pass names 'plug' after the pass named
'pta' */
};
int plugin_init(struct plugin_name_args *plugin_info,struct plugin_gcc_version *version)
{
register_callback (
plugin_info->base_name, /* char *name: Plugin name, could be any
name. plugin_info->base_name gives this
filename */
<API key>, /* int event: The event code. Here, setting
up a new pass */
NULL, /* The function that handles event */
&pass_info); /* plugin specific data */
return 0;
}
static unsigned int print_liveness(void)
{
struct cgraph_node *node;
for (node = cgraph_nodes; node; node = node->next)
{
if (gimple_has_body_p(node->decl))
{
push_cfun (<API key> (node->decl));
process_function ();
pop_cfun ();
}
}
return 0;
}
static void process_function (void)
{
basic_block bb;
<API key> si;
int k = 0;
FOR_EACH_BB (bb)
{
for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
gimple phi = gsi_stmt (si);
int n = gimple_phi_num_args (phi);
k++;
fprintf(stderr, "%d %d %d:\t", bb->index, k, gimple_code (phi) == GIMPLE_ASSIGN);
print_gimple_stmt(stderr, phi, 0, TDF_SLIM);
if ( (GIMPLE_ASSIGN != gimple_code (phi)))
continue;
//for (int i = 0; i < n; i++)
//tree name = gimple_phi_arg_def (phi, i);
struct ptr_info_def * def = SSA_NAME_PTR_INFO (PHI_RESULT(phi));
fprintf(stderr, "%d %d:\t", bb->index, n);
if (! def)
continue;
if (def->pt.anything)
fprintf(dump_file, "ANYTHING");
if (def->pt.nonlocal)
fprintf(dump_file, "NONLOCAL");
if (def->pt.escaped)
fprintf(dump_file, "ESCAPED");
if (def->pt.ipa_escaped)
fprintf(dump_file, "IPA_ESCAPED");
if (def->pt.null)
fprintf(dump_file, "NULL");
}
fprintf (stderr, "<API key>!\t %d\n", k );
}
return;
} |
#ifndef <API key>
#define <API key>
/** @page <API key> is used to generate movements
* of waypoints and flight paths. Each serves the purpose
* of generate activities so that it generates updated
* packets for the players.
*/
#include "MovementGenerator.h"
#include "WaypointManager.h"
#include "Path.h"
#include "Player.h"
#include <vector>
#include <set>
#define <API key> 100
#define <API key> 3 * MINUTE * IN_MILLISECONDS // 3 Minutes
#define TIMEDIFF_NEXT_WP 250
template<class T, class P>
class PathMovementBase
{
public:
PathMovementBase() : i_path(NULL), i_currentNode(0) { }
virtual ~PathMovementBase() { };
// template pattern, not defined .. override required
void LoadPath(T &);
uint32 GetCurrentNode() const { return i_currentNode; }
protected:
P i_path;
uint32 i_currentNode;
};
template<class T>
class <API key>;
template<>
class <API key><Creature> : public <API key>< Creature, <API key><Creature> >,
public PathMovementBase<Creature, WaypointPath const*>
{
public:
<API key>(uint32 _path_id = 0, bool _repeating = true)
: i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) { }
~<API key>() { i_path = NULL; }
void DoInitialize(Creature*);
void DoFinalize(Creature*);
void DoReset(Creature*);
bool DoUpdate(Creature*, uint32 diff);
void MovementInform(Creature*);
<API key> <API key>() override { return <API key>; }
// now path movement implmementation
void LoadPath(Creature*);
bool GetResetPos(Creature*, float& x, float& y, float& z);
private:
void Stop(int32 time) { i_nextMoveTime.Reset(time);}
bool Stopped() { return !i_nextMoveTime.Passed();}
bool CanMove(int32 diff)
{
i_nextMoveTime.Update(diff);
return i_nextMoveTime.Passed();
}
void OnArrived(Creature*);
bool StartMove(Creature*);
void StartMoveNow(Creature* creature)
{
i_nextMoveTime.Reset(0);
StartMove(creature);
}
TimeTrackerSmall i_nextMoveTime;
bool m_isArrivalDone;
uint32 path_id;
bool repeating;
};
/** <API key> generates movement of the player for the paths
* and hence generates ground and activities for the player.
*/
class <API key> : public <API key>< Player, <API key> >,
public PathMovementBase<Player, TaxiPathNodeList const*>
{
public:
explicit <API key>(TaxiPathNodeList const& pathnodes, uint32 startNode = 0)
{
i_path = &pathnodes;
i_currentNode = startNode;
_endGridX = 0.0f;
_endGridY = 0.0f;
_endMapId = 0;
_preloadTargetNode = 0;
}
void DoInitialize(Player*);
void DoReset(Player*);
void DoFinalize(Player*);
bool DoUpdate(Player*, uint32);
<API key> <API key>() override { return FLIGHT_MOTION_TYPE; }
TaxiPathNodeList const& GetPath() { return *i_path; }
uint32 GetPathAtMapEnd() const;
bool HasArrived() const { return (i_currentNode >= i_path->size()); }
void <API key>();
void SkipCurrentNode() { ++i_currentNode; }
void DoEventIfAny(Player* player, TaxiPathNodeEntry const& node, bool departure);
bool GetResetPos(Player*, float& x, float& y, float& z);
void InitEndGridInfo();
void PreloadEndGrid();
private:
float _endGridX; //! X coord of last node location
float _endGridY; //! Y coord of last node location
uint32 _endMapId; //! map Id of last node location
uint32 _preloadTargetNode; //! node index where preloading starts
};
#endif |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.