All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gen.lib.cgraph.id__c Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
/* +=======================================================================
 * |
 * |      PlantUML : a free UML diagram generator
 * |
 * +=======================================================================
 *
 * (C) Copyright 2009-2024, Arnaud Roques
 *
 * Project Info:  https://plantuml.com
 *
 * If you like this project or if you find it useful, you can support us at:
 *
 * https://plantuml.com/patreon (only 1$ per month!)
 * https://plantuml.com/liberapay (only 1€ per month!)
 * https://plantuml.com/paypal
 *
 *
 * PlantUML is free software; you can redistribute it and/or modify it
 * under the terms of the MIT License.
 *
 * See http://opensource.org/licenses/MIT
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * PlantUML can occasionally display sponsored or advertising messages. Those
 * messages are usually generated on welcome or error images and never on
 * functional diagrams.
 * See https://plantuml.com/professional if you want to remove them
 *
 * Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML
 * are owned by the author of their corresponding sources code (that is, their
 * textual description in PlantUML language). Those images are not covered by
 * this MIT license.
 *
 * The generated images can then be used without any reference to the MIT license.
 * It is not even necessary to stipulate that they have been generated with PlantUML,
 * although this will be appreciated by the PlantUML team.
 *
 * There is an exception : if the textual description in PlantUML language is also covered
 * by any license, then the generated images are logically covered
 * by the very same license.
 *
 * This is the IGY distribution (Install GraphViz by Yourself).
 * You have to install GraphViz and to setup the GRAPHVIZ_DOT environment variable
 * (see https://plantuml.com/graphviz-dot )
 *
 * Icons provided by OpenIconic :  https://useiconic.com/open
 * Archimate sprites provided by Archi :  http://www.archimatetool.com
 * Stdlib AWS provided by https://github.com/milo-minderbinder/AWS-PlantUML
 * Stdlib Icons provided https://github.com/tupadr3/plantuml-icon-font-sprites
 * ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen
 * ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman
 * CafeUndZopfli ported by Eugene Klyuchnikov https://github.com/eustas/CafeUndZopfli
 * Brotli (c) by the Brotli Authors https://github.com/google/brotli
 * Themes (c) by Brett Schwarz https://github.com/bschwarz/puml-themes
 * Twemoji (c) by Twitter at https://twemoji.twitter.com/
 *
 */
package gen.lib.cgraph;
import static gen.lib.cgraph.imap__c.aginternalmapinsert;
import static gen.lib.cgraph.imap__c.aginternalmaplookup;
import static gen.lib.cgraph.imap__c.aginternalmapprint;
import static gen.lib.cgraph.obj__c.agraphof;
import static gen.lib.cgraph.refstr__c.agstrbind;
import static gen.lib.cgraph.refstr__c.agstrdup;
import static smetana.core.Macro.AGCLOS_id;
import static smetana.core.Macro.AGDISC_id;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;

import gen.annotation.Difficult;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
import h.ST_Agdisc_s;
import h.ST_Agobj_s;
import h.ST_Agraph_s;
import h.ST_dt_s;
import smetana.core.CFunction;
import smetana.core.CFunctionAbstract;
import smetana.core.CString;
import smetana.core.Globals;
import smetana.core.Memory;
import smetana.core.__ptr__;

public class id__c {
    // ::remove folder when __HAXE__

public static CFunction idopen = new CFunctionAbstract("idopen") {
	
	public Object exe(Globals zz, Object... args) {
		return idopen((ST_Agraph_s)args[0], (ST_Agdisc_s)args[1]);
	}};
		

//3 a0a2zxsu8n019hzm1rwf1jc7f
// static void *idopen(Agraph_t * g, Agdisc_t* disc) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="", key="a0a2zxsu8n019hzm1rwf1jc7f", definition="static void *idopen(Agraph_t * g, Agdisc_t* disc)")
public static Object idopen(ST_Agraph_s g, ST_Agdisc_s disc) {
ENTERING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
try {
	return g;
} finally {
LEAVING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
}
}



public static CFunction idmap = new CFunctionAbstract("idmap") {
	
	public Object exe(Globals zz, Object... args) {
		return idmap(zz, (Object)args[0], (Integer)args[1], (CString)args[2], (int[])args[3], (Boolean)args[4]);
	}};

//3 lsl0c1gejls1wv04ga6xy2cf
// static long idmap(void *state, int objtype, char *str, unsigned long *id, 		  int createflag) 
//static int ctr = 1;
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="", key="", definition="")
public static int idmap(Globals zz, Object state, int objtype, CString str, int id[], boolean createflag) {
ENTERING("lsl0c1gejls1wv04ga6xy2cf","idmap");
try {
    CString s;
    if (str!=null) {
	ST_Agraph_s g;
	g = (ST_Agraph_s) state;
	if (createflag)
	    s = agstrdup(zz, g, str);
	else
	    s = agstrbind(zz, g, str);
	id[0] = Memory.identityHashCode(zz, s);
    } else {
	id[0] = zz.ctr;
	zz.ctr += 2;
    }
    return true ? 1 : 0;
} finally {
LEAVING("lsl0c1gejls1wv04ga6xy2cf","idmap");
}
}



public static CFunction idalloc = new CFunctionAbstract("idalloc") {
	
	public Object exe(Globals zz, Object... args) {
		return idalloc(args);
	}};

//3 8ynmf2fueegi7vjejal3ri1ax
// static long idalloc(void *state, int objtype, unsigned long request) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="idalloc", key="8ynmf2fueegi7vjejal3ri1ax", definition="static long idalloc(void *state, int objtype, unsigned long request)")
public static Object idalloc(Object... arg_) {
UNSUPPORTED("1z2o91qjhxg0zcs8vgzyl9bf1"); // static long idalloc(void *state, int objtype, unsigned long request)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("2s0qc9g3dasd7eqa3rhtlxrae"); //     (void) state;
UNSUPPORTED("x0ltcg0hfp8jlgbjde43bdwj"); //     (void) objtype;
UNSUPPORTED("6xs9bwnce34njm5w424uwon6d"); //     (void) request;
UNSUPPORTED("297p5iu8oro94tdg9v29bbgiw"); //     return (0);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

throw new UnsupportedOperationException();
}



public static CFunction idfree = new CFunctionAbstract("idfree") {
	
	public Object exe(Globals zz, Object... args) {
		return idfree(args);
	}};

//3 5fsdlq8w38bfd7gtwz1z8arad
// static void idfree(void *state, int objtype, unsigned long id) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="idfree", key="5fsdlq8w38bfd7gtwz1z8arad", definition="static void idfree(void *state, int objtype, unsigned long id)")
public static Object idfree(Object... arg_) {
UNSUPPORTED("adq5fviqjzpkxrjt37qxo1ywh"); // static void idfree(void *state, int objtype, unsigned long id)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("x0ltcg0hfp8jlgbjde43bdwj"); //     (void) objtype;
UNSUPPORTED("e3dd233viwus8xrkad68a1qhr"); //     if (id % 2 == 0)
UNSUPPORTED("69x6bjndheh46syz632mlu192"); // 	agstrfree((Agraph_t *) state, (char *) id);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

throw new UnsupportedOperationException();
}



public static CFunction idprint = new CFunctionAbstract("idprint") {
	
	public Object exe(Globals zz, Object... args) {
		return idprint(zz, (__ptr__)args[0], (Integer)args[1], (Integer)args[2]);
	}};

@Difficult
@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/cgraph/id.c", name="", key="8143j507ej7uqqjzw5i32xej5", definition="static char *idprint(void *state, int objtype, unsigned long id)")
public static CString idprint(Globals zz, __ptr__ state, int objtype, int id) {
ENTERING("8143j507ej7uqqjzw5i32xej5","idprint");
try {
    if (id % 2 == 0)
	return (CString) Memory.fromIdentityHashCode(zz, id);
    else
	return null;
} finally {
LEAVING("8143j507ej7uqqjzw5i32xej5","idprint");
}
}



public static CFunction idclose = new CFunctionAbstract("idclose") {
	
	public Object exe(Globals zz, Object... args) {
		return idclose((ST_dt_s)args[0], (__ptr__)args[1], (Integer)args[2]);
	}};

//3 44seyu1scoubb1wsuhwlghwyz
// static void idclose(void *state) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="idclose", key="44seyu1scoubb1wsuhwlghwyz", definition="static void idclose(void *state)")
public static Object idclose(Object... arg_) {
UNSUPPORTED("18oh21h7t6fg06ozg64u87nyu"); // static void idclose(void *state)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("2s0qc9g3dasd7eqa3rhtlxrae"); //     (void) state;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

throw new UnsupportedOperationException();
}



public static CFunction idregister = new CFunctionAbstract("idregister") {
	
	public Object exe(Globals zz, Object... args) {
		idregister((Object)args[0], (Integer)args[1], (Object)args[2]);
		return null;
	}};

//3 5bjqo0ihl0x25vaspoiehmwzk
// static void idregister(void *state, int objtype, void *obj) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="idregister", key="5bjqo0ihl0x25vaspoiehmwzk", definition="static void idregister(void *state, int objtype, void *obj)")
public static void idregister(Object state, int objtype, Object obj) {
ENTERING("5bjqo0ihl0x25vaspoiehmwzk","idregister");
try {
 
} finally {
LEAVING("5bjqo0ihl0x25vaspoiehmwzk","idregister");
}
}



//3 aq30wwcj4ugatsgx0zdtdmeed
// int agmapnametoid(Agraph_t * g, int objtype, char *str, 		  unsigned long *result, int createflag) 
@Unused
@Original(version="2.38.0", path="lib/cgraph/id.c", name="agmapnametoid", key="aq30wwcj4ugatsgx0zdtdmeed", definition="int agmapnametoid(Agraph_t * g, int objtype, char *str, 		  unsigned long *result, int createflag)")
public static int agmapnametoid(Globals zz, ST_Agraph_s g, int objtype, CString str, final int result[], boolean createflag) {
ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
try {
    int rv;
    if (str!=null && (str.charAt(0) != '%')) {
    	rv = (Integer) AGDISC_id(g).map.exe(zz, AGCLOS_id(g), objtype, str, result, createflag);
	if (rv!=0)
	    return rv;
    }
    /* either an internal ID, or disc. can't map strings */
    if (str!=null) {
	rv = aginternalmaplookup(g, objtype, str, result);
	if (rv!=0)
	    return rv;
    } else
	rv = 0;
    if (createflag) {
	/* get a new anonymous ID, and store in the internal map */
	rv = (Integer) AGDISC_id(g).map.exe(zz, AGCLOS_id(g), objtype, null, result,
				createflag);
	if (rv!=0 && str!=null)
	    aginternalmapinsert(g, objtype, str, result[0]);
    }
    return rv;
} finally {
LEAVING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
}
}







/* agnameof:
 * Return string representation of object.
 * In general, returns the name of node or graph,
 * and the key of an edge. If edge is anonymous, returns NULL.
 * Uses static buffer for anonymous graphs.
 */
@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/cgraph/id.c", name="agnameof", key="cctsybrl54fy799aynfej4iiy", definition="char *agnameof(void *obj)")
public static CString agnameof(Globals zz, ST_Agobj_s obj) {
ENTERING("cctsybrl54fy799aynfej4iiy","agnameof");
try {
    ST_Agraph_s g;
    CString rv;
    /* perform internal lookup first */
    g = agraphof(obj);
    if ((rv = aginternalmapprint(g, obj.tag.objtype, obj.tag.id))!=null)
	return rv;
    if (AGDISC_id(g).print!=null) {
	if ((rv =
	     (CString) AGDISC_id(g).print.exe(zz, AGCLOS_id(g), obj.tag.objtype, obj.tag.id))!=null)
	    return rv;
    }
    if (obj.tag.objtype != AGEDGE) {
      rv = new CString("%"+obj.tag.id);
    }
    else
	rv = null;
    return rv;
} finally {
LEAVING("cctsybrl54fy799aynfej4iiy","agnameof");
}
}








@Reviewed(when = "12/11/2020")
@Original(version="2.38.0", path="lib/cgraph/id.c", name="agregister", key="emt63ldde99jnwe2vvjal9kt9", definition="void agregister(Agraph_t * g, int objtype, void *obj)")
public static void agregister(Globals zz, ST_Agraph_s g, int objtype, Object obj) {
ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister");
try {
	AGDISC_id(g).idregister.exe(zz, AGCLOS_id(g), objtype, obj);
} finally {
LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister");
}
}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy