type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <freerdp/gdi/gdi.h>
includes
#include <freerdp/gdi/region.h>
functions
HGDI_RGN gdi_CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) { HGDI_RGN hRgn = (HGDI_RGN) malloc(sizeof(GDI_RGN)); if (!hRgn) return NULL; hRgn->objectType = GDIOBJECT_REGION; hRgn->x = nLeftRect; hRgn->y = nTopRect; hRgn->w = nRightRect - nLeftRect + 1; hRgn->h = nBottomRect - nTop...
functions
HGDI_RECT gdi_CreateRect(int xLeft, int yTop, int xRight, int yBottom) { HGDI_RECT hRect = (HGDI_RECT) malloc(sizeof(GDI_RECT)); if (!hRect) return NULL; hRect->objectType = GDIOBJECT_RECT; hRect->left = xLeft; hRect->top = yTop; hRect->right = xRight; hRect->bottom = yBottom; return hRect; }
functions
void gdi_RectToRgn(HGDI_RECT rect, HGDI_RGN rgn) { rgn->x = rect->left; rgn->y = rect->top; rgn->w = rect->right - rect->left + 1; rgn->h = rect->bottom - rect->top + 1; }
functions
void gdi_CRectToRgn(int left, int top, int right, int bottom, HGDI_RGN rgn) { rgn->x = left; rgn->y = top; rgn->w = right - left + 1; rgn->h = bottom - top + 1; }
functions
void gdi_RectToCRgn(HGDI_RECT rect, int *x, int *y, int *w, int *h) { *x = rect->left; *y = rect->top; *w = rect->right - rect->left + 1; *h = rect->bottom - rect->top + 1; }
functions
void gdi_CRectToCRgn(int left, int top, int right, int bottom, int *x, int *y, int *w, int *h) { *x = left; *y = top; *w = right - left + 1; *h = bottom - top + 1; }
functions
void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect) { rect->left = rgn->x; rect->top = rgn->y; rect->right = rgn->x + rgn->w - 1; rect->bottom = rgn->y + rgn->h - 1; }
functions
void gdi_CRgnToRect(int x, int y, int w, int h, HGDI_RECT rect) { rect->left = x; rect->top = y; rect->right = x + w - 1; rect->bottom = y + h - 1; }
functions
void gdi_RgnToCRect(HGDI_RGN rgn, int *left, int *top, int *right, int *bottom) { *left = rgn->x; *top = rgn->y; *right = rgn->x + rgn->w - 1; *bottom = rgn->y + rgn->h - 1; }
functions
void gdi_CRgnToCRect(int x, int y, int w, int h, int *left, int *top, int *right, int *bottom) { *left = x; *top = y; *right = x + w - 1; *bottom = y + h - 1; }
functions
int gdi_CopyOverlap(int x, int y, int width, int height, int srcx, int srcy) { GDI_RECT dst; GDI_RECT src; gdi_CRgnToRect(x, y, width, height, &dst); gdi_CRgnToRect(srcx, srcy, width, height, &src); return (dst.right > src.left && dst.left < src.right && dst.bottom > src.top && dst.top < src.bottom) ? 1 : 0; }
functions
int gdi_SetRect(HGDI_RECT rc, int xLeft, int yTop, int xRight, int yBottom) { rc->left = xLeft; rc->top = yTop; rc->right = xRight; rc->bottom = yBottom; return 1; }
functions
int gdi_SetRgn(HGDI_RGN hRgn, int nXLeft, int nYLeft, int nWidth, int nHeight) { hRgn->x = nXLeft; hRgn->y = nYLeft; hRgn->w = nWidth; hRgn->h = nHeight; hRgn->null = 0; return 0; }
functions
int gdi_SetRectRgn(HGDI_RGN hRgn, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect) { gdi_CRectToRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, hRgn); hRgn->null = 0; return 0; }
functions
int gdi_EqualRgn(HGDI_RGN hSrcRgn1, HGDI_RGN hSrcRgn2) { if ((hSrcRgn1->x == hSrcRgn2->x) && (hSrcRgn1->y == hSrcRgn2->y) && (hSrcRgn1->w == hSrcRgn2->w) && (hSrcRgn1->h == hSrcRgn2->h)) { return 1; }
functions
int gdi_CopyRect(HGDI_RECT dst, HGDI_RECT src) { dst->left = src->left; dst->top = src->top; dst->right = src->right; dst->bottom = src->bottom; return 1; }
functions
int gdi_PtInRect(HGDI_RECT rc, int x, int y) { /* * points on the left and top sides are considered in, * while points on the right and bottom sides are considered out */ if (x >= rc->left && x <= rc->right) { if (y >= rc->top && y <= rc->bottom) { return 1; }
functions
BOOL gdi_InvalidateRegion(HGDI_DC hdc, int x, int y, int w, int h) { GDI_RECT inv; GDI_RECT rgn; HGDI_RGN invalid; HGDI_RGN cinvalid; if (!hdc->hwnd) return TRUE; if (!hdc->hwnd->invalid) return TRUE; if (w == 0 || h == 0) return TRUE; cinvalid = hdc->hwnd->cinvalid; if ((hdc->hwnd->ninvalid + 1) > ...
includes
#include <stdio.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <unistd.h>
includes
#include <ncurses.h>
includes
#include <ncurses/ncurses.h>
includes
#include <pdcurses.h>
includes
#include <curses.h>
defines
#define COB_GEN_SCREENIO
defines
#define COB_GEN_SCREENIO
defines
#define COB_GEN_SCREENIO
defines
#define COB_GEN_SCREENIO
defines
#define COB_INP_SIZE 1920 * sizeof(struct cob_inp_struct)
structs
struct cob_inp_struct { cob_screen *scr; size_t up_index; size_t down_index; int this_y; int this_x; };
functions
void get_line_column (cob_field *fline, cob_field *fcol, int *line, int *col) { int l; int c; int p; if (fline == NULL) { *line = 0; *col = 0; return; }
functions
void cob_screen_attr (cob_field *fgc, cob_field *bgc, const int attr) { size_t i; int styles = 0; int line; int column; short fgcolor; short bgcolor; short fgdef; short bgdef; attrset (A_NORMAL); if (attr & COB_SCREEN_REVERSE) { styles |= A_REVERSE; }
functions
COB_NOINLINE cob_screen_init (void) { char *s; if (!cob_screen_initialized) { s = getenv ("COB_SCREEN_EXCEPTIONS"); if (s) { if (*s == 'Y' || *s == 'y') { cob_extended_status = 1; s = getenv ("COB_SCREEN_ESC"); if (s) { if (*s == 'Y' || *s == 'y') { cob_use_esc = 1; }
functions
void cob_screen_terminate (void) { if (cob_screen_initialized) { cob_screen_initialized = 0; endwin (); }
functions
COB_NOINLINE cob_check_pos_status (int fret) { cob_field *f; int sline; int scolumn; char datbuf[8]; if (fret) { cob_set_exception (COB_EC_IMP_ACCEPT); }
functions
void cob_screen_puts (cob_screen *s, cob_field *f) { unsigned char *p; size_t size; int y; int x; int line; int column; getyx (stdscr, y, x); if (!s->line) { line = y; }
functions
else if (s->attr & COB_SCREEN_LINE_MINUS) { line = y - line + 1; }
functions
else if (s->attr & COB_SCREEN_COLUMN_MINUS) { column = x - column + 1; }
functions
else if (*p <= ' ') { addch ('_'); }
functions
void cob_screen_get_all (void) { struct cob_inp_struct *sptr; cob_screen *s; unsigned char *p; int keyp; int sline; int scolumn; int cline; int ccolumn; int rightpos; int ateof; int gotbacksp; int ungetched; sptr = cob_base_inp; s = sptr->scr; sline = sptr->this_y; scolumn = sptr->t...
functions
else if (s->attr & COB_SCREEN_PROMPT) { addch ('_'); }
functions
int compare_yx (const void *m1, const void *m2) { const struct cob_inp_struct *s1; const struct cob_inp_struct *s2; s1 = m1; s2 = m2; if (s1->this_y < s2->this_y) { return -1; }
functions
void cob_prep_input (cob_screen *s) { struct cob_inp_struct *sptr; int n; switch (s->type) { case COB_SCREEN_TYPE_GROUP: for (s = s->child; s; s = s->next) { cob_prep_input (s); }
functions
void cob_screen_display (cob_screen *s, cob_field *line, cob_field *column) { int n; if (!cob_screen_initialized) { cob_screen_init (); }
functions
void cob_screen_accept (cob_screen *s, cob_field *line, cob_field *column) { struct cob_inp_struct *sptr; struct cob_inp_struct *sptr2; size_t idx; size_t n; size_t posu; size_t posd; size_t prevy; size_t firsty; int starty; if (!cob_screen_initialized) { cob_screen_init (); }
functions
void cob_field_display (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, cob_field *scroll, const int attr) { int sline; int scolumn; if (!cob_screen_initialized) { cob_screen_init (); }
functions
void cob_field_accept (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, cob_field *scroll, const int attr) { unsigned char *p; size_t count; int keyp; int fret; int sline; int scolumn; int cline; int ccolumn; int rightpos; int ateof; int gotbacksp; if (!co...
functions
else if (attr & COB_SCREEN_UPDATE) { fret = *p++; addch ((unsigned int)fret); }
functions
else if (attr & COB_SCREEN_PROMPT) { addch ('_'); }
functions
void cob_screen_line_col (cob_field *f, const int l_or_c) { if (!cob_screen_initialized) { cob_screen_init (); }
functions
void cob_screen_set_mode (const size_t smode) { if (!smode) { refresh (); def_prog_mode (); endwin (); }
functions
void cob_screen_terminate (void) { }
functions
void cob_field_display (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, const int attr) { }
functions
void cob_field_accept (cob_field *f, cob_field *line, cob_field *column, cob_field *fgc, cob_field *bgc, const int attr) { }
functions
void cob_screen_display (cob_screen *s, cob_field *line, cob_field *column) { }
functions
void cob_screen_accept (cob_screen *s, cob_field *line, cob_field *column) { }
functions
void cob_screen_line_col (cob_field *f, const int l_or_c) { }
functions
void cob_screen_set_mode (const size_t smode) { }
functions
void TIM_Config(void) { GPIO_InitTypeDef GPIO_InitStructure; NVIC_InitTypeDef NVIC_InitStructure; /* GPIOA and GPIOB clocks enable */ RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOB | RCC_AHB1Periph_GPIOE, ENABLE); /* TIM1 clock enable */ RCC_APB2PeriphClockCmd(RCC_APB2Periph...
functions
void SysTickConfig(void) { /* Setup SysTick Timer for 100 msec interrupts */ if (SysTick_Config((SystemCoreClock) / 100)) { /* Capture error */ while (1); }
functions
void assert_failed(uint8_t* file, uint32_t line) { /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ while (1) {}
main
int main(void) { /*!< At this stage the microcontroller clock setting is already configured, this is done through SystemInit() function which is called from startup files (startup_stm32f40_41xxx.s/startup_stm32f427_437xx.s/startup_stm32f429_439xx.s) before to branch to application main. ...
includes
#include <ntddk.h>
includes
#include <initguid.h>
includes
#include <wmistr.h>
includes
#include <wmilib.h>
includes
#include <stdio.h>
includes
#include <ntddk.h>
includes
#include <guiddef.h>
includes
#include<ntstrsafe.h>
includes
#include <version.h>
defines
#define NTSTRSAFE_LIB
defines
#define UTF8MASK2 0x1FFF80
defines
#define UTF8MASK3 0x1FF800
defines
#define UTF8MASK4 0x1F0000
defines
#define WMITYPECASE(_wmitype, _type, _align) \
defines
#define MAX_WATCH_COUNT (MAXIMUM_WAIT_OBJECTS -1)
functions
void LockSessions( XENIFACE_FDO* fdoData) { ASSERT(KeGetCurrentIrql() <= APC_LEVEL); ExAcquireFastMutex(&fdoData->SessionLock); }
functions
void UnlockSessions( XENIFACE_FDO* fdoData) { ASSERT(KeGetCurrentIrql() == APC_LEVEL); #pragma prefast (suppress:26110) ExReleaseFastMutex(&fdoData->SessionLock); }
functions
void GetUnicodeString(UNICODE_STRING *unicode, USHORT maxlength, LPWSTR location) { int i; USHORT length=0; unicode->MaximumLength=maxlength; unicode->Buffer=location; // No appropriate fucntion to determine the length of a possibly null // terminated string withing a fixed sized buffer exists. ...
functions
NTSTATUS GetAnsiString(ANSI_STRING *ansi, USHORT maxlength, LPWSTR location) { UNICODE_STRING unicode; NTSTATUS status; GetUnicodeString(&unicode, maxlength, location); status = RtlUnicodeStringToAnsiString(ansi, &unicode, TRUE); return status; }
functions
USHORT Utf32FromUtf16(ULONG *utf32, const WCHAR* utf16) { ULONG w; ULONG u; ULONG xa; ULONG xb; ULONG x; if (((utf16[0]) & 0xFC00) == 0xD800) { w = ((utf16[0]) & 0X03FF) >>6; u = w+1; xa = utf16[0] & 0x3F; xb = utf16[1] & 0x03FF; x = (xa<<10) | xb; ...
functions
USHORT Utf32FromUtf8(ULONG *utf32, const CHAR *utf8) { ULONG y; ULONG x; ULONG z; ULONG ua; ULONG ub; ULONG u; if ((utf8[0] & 0x80) == 0) { *utf32 = utf8[0]; return 1; }
functions
USHORT Utf16FromUtf32(WCHAR *utf16, const ULONG utf32) { WCHAR u; WCHAR w; WCHAR x; if ((utf32 > 0xFFFF)) { u = (utf32 & 0x1F0000) >> 16; w = u-1; x = utf32 & 0xFFFF; utf16[0] = 0xD800 | (w<<6) | (x>>10); utf16[1] = 0xDC00 | (x & 0x3F); return 2; }
functions
USHORT CountUtf8FromUtf32(ULONG utf32) { if (utf32 & UTF8MASK4) return 4; if (utf32 & UTF8MASK3) return 3; if (utf32 & UTF8MASK2) return 2; return 1; }
functions
USHORT CountUtf16FromUtf32(ULONG utf32) { if ((utf32 & 0xFF0000) > 0) { return 2; }
functions
USHORT Utf8FromUtf32(CHAR *dest, ULONG utf32) { CHAR u; CHAR y; CHAR x; CHAR z; if (utf32 & UTF8MASK4) { x = utf32 & 0x3f; y = (utf32 >> 6) & 0x3f; z = (utf32 >> 12) & 0xf; u = (utf32 >> 16) & 0x1f; dest[0] = 0xf0 | u>>2; dest[1] = 0x80 | (u & 0x3) <<...
functions
else if (utf32 & UTF8MASK3) { x = utf32 & 0x3f; y = (utf32 >> 6) & 0x3f; z = (utf32 >> 12) & 0xf; dest[0] = 0xe0 | z; dest[1] = 0x80 | y; dest[2] = 0x80 | x; return 3; }
functions
else if (utf32 & UTF8MASK2) { x = utf32 & 0x3f; y = (utf32 >> 6) & 0x3f; dest[0] = 0xc0 | y; dest[1] = 0x80 | x; return 2; }
functions
USHORT CountBytesUtf16FromUtf8String(const UTF8_STRING *utf8) { ULONG utf32; int i = 0; USHORT bytecount = 0; while (i<utf8->Length && utf8->Buffer[i] !=0) { i += Utf32FromUtf8(&utf32, &utf8->Buffer[i]); bytecount += CountUtf16FromUtf32(utf32); }
functions
USHORT CountBytesUtf16FromUtf8(const UCHAR *utf8) { ULONG utf32; int i = 0; USHORT bytecount = 0; while (utf8[i] !=0) { i += Utf32FromUtf8(&utf32, &utf8[i]); bytecount += CountUtf16FromUtf32(utf32); }
functions
NTSTATUS GetUTF8String(UTF8_STRING** utf8, USHORT bufsize, LPWSTR ustring) { USHORT bytecount = 0; USHORT i; ULONG utf32; i = 0; while (i < (bufsize/sizeof(WCHAR))) { i += Utf32FromUtf16(&utf32, &ustring[i]); bytecount += CountUtf8FromUtf32(utf32); }
functions
void FreeUTF8String(UTF8_STRING *utf8) { ExFreePoolWithTag(utf8, 'XIU8'); }
functions
NTSTATUS GetCountedUTF8String(UTF8_STRING **utf8, UCHAR *location) { USHORT bufsize = *(USHORT*)location; LPWSTR ustring = (LPWSTR)(location+sizeof(USHORT)); return GetUTF8String(utf8, bufsize, ustring); }
functions
void GetCountedUnicodeString(UNICODE_STRING *unicode, UCHAR *location) { USHORT bufsize = *(USHORT*)location; LPWSTR ustring = (LPWSTR)(location+sizeof(USHORT)); GetUnicodeString(unicode, bufsize, ustring); }
functions
NTSTATUS GetCountedAnsiString(ANSI_STRING *ansi, UCHAR *location) { USHORT bufsize = *(USHORT*)location; LPWSTR ustring = (LPWSTR)(location+sizeof(USHORT)); return GetAnsiString(ansi, bufsize, ustring); }