Skip to content

Instantly share code, notes, and snippets.

View Nihlus's full-sized avatar

Jarl Gullberg Nihlus

View GitHub Profile
@Nihlus
Nihlus / NullableTLayoutScanner.cs
Last active December 21, 2018 15:53
Magic internals in ADL.
//
// NullableTLayoutScanner.cs
//
// Copyright (c) 2018 Firwood Software
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
build:
stage: build
only:
- triggers
- web
changes:
- SPECS/**/*.spec
script:
- make
{
parserClass="org.nihlus.lace.language.parser.AdaParser"
extends="com.intellij.extapi.psi.ASTWrapperPsiElement"
psiClassPrefix="Ada"
psiImplClassSuffix="Impl"
psiPackage="org.nihlus.lace.language.psi"
psiImplPackage="org.nihlus.lace.language.psi.Implementation"
/// <inheritdoc/>
public override void EmitPrologue(ILGenerator il, PipelineWorkUnit<IntrospectiveMethodInfo> workUnit)
{
var definition = workUnit.Definition;
// Create the argument list as an array
var argumentArray = il.DeclareLocal(typeof(object[]));
il.EmitConstantInt(definition.ParameterTypes.Count);
il.EmitNewArray<object>();
string GetLocalNetworkAddress()
{
// Find the IP address we're on, given a configured interface
const string interface = "enx847beb51d7b4";
ifaddrs* adresses { };
getifaddrs(&adresses);
ifaddrs* currentAddress = adresses;
// Find the IP address we're on, given a configured interface
const string interface = "enx847beb51d7b4";
ifaddrs* adresses { };
getifaddrs(&adresses);
while (adresses->ifa_name != interface)
{
if (adresses->ifa_next == nullptr)
{
var functionDocumentations = new List<FunctionDocumentation>();
var namespaceManager = new XmlNamespaceManager(new NameTable());
namespaceManager.AddNamespace("mml", "http://www.w3.org/1998/Math/MathML");
var parserContext = new XmlParserContext(null, namespaceManager, null, XmlSpace.None);
var schemas = new XmlSchemaSet(new NameTable());
var xmlSettings = new XmlReaderSettings
{
DtdProcessing = DtdProcessing.Ignore,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBegin">
<refmeta>
<refmetainfo>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using AdvancedDLSupport;
namespace Scratchpad
{
public struct BsDiffStream_Impl
{
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using Bind.Structures;
using Bind.XML.Signatures;
using Bind.XML.Signatures.Enumerations;