sourcepawn/decompiler/main.cpp
author David Anderson <danderson@mozilla.com>
Thu Aug 08 09:40:23 2013 -0700 (2013-08-08)
changeset 3976 bc77cfde7c5c
parent 2325 7a24ee5557fb
permissions -rw-r--r--
Add -Wno-narrowing to support building on GCC-4.7 (no bug, r=me).
     1 #include <stdio.h>
     2 #include <stdlib.h>
     3 #include "decompiler.h"
     4 
     5 int main()
     6 {
     7 	int err;
     8 	sp_decomp_t *dc;
     9 
    10 	const char *file = "../../plugins/test.smx";
    11 
    12 	if ((dc = Sp_InitDecomp(file, &err)) == NULL)
    13 	{
    14 		fprintf(stderr, "Could not parse plugin (error %d)\n", err);
    15 		exit(1);
    16 	}
    17 
    18 	if ((err = Sp_DecompFunction(dc, dc->plugin->publics[0].code_offs, true)) != SP_ERROR_NONE)
    19 	{
    20 		fprintf(stderr, "Failed to decode function (error %d)\n", err);
    21 	}
    22 
    23 	Sp_FreeDecomp(dc);
    24 }