tied resource initialization into the main control flow
This commit is contained in:
		
							parent
							
								
									751c0674d1
								
							
						
					
					
						commit
						9348673adb
					
				@ -1,12 +1,12 @@
 | 
				
			|||||||
/*
 | 
					/*
 | 
				
			||||||
 * UPIWIN - Micro Pi Windowing Framework Kernel
 | 
					 * UPIWIN - Micro Pi Windowing Framework Kernel
 | 
				
			||||||
 * Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
 | 
					 * Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
 | 
				
			||||||
 *    
 | 
					 *
 | 
				
			||||||
 * This program is free software; you can redistribute it and/or modify
 | 
					 * 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
 | 
					 * it under the terms of the GNU General Public License as published by
 | 
				
			||||||
 * the Free Software Foundation; either version 2 of the License, or
 | 
					 * the Free Software Foundation; either version 2 of the License, or
 | 
				
			||||||
 * (at your option) any later version.
 | 
					 * (at your option) any later version.
 | 
				
			||||||
 *    
 | 
					 *
 | 
				
			||||||
 * This program is distributed in the hope that it will be useful,
 | 
					 * This program is distributed in the hope that it will be useful,
 | 
				
			||||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
					 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
				
			||||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
					 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
				
			||||||
@ -25,6 +25,7 @@
 | 
				
			|||||||
#include "config.h"
 | 
					#include "config.h"
 | 
				
			||||||
#include "gpio.h"
 | 
					#include "gpio.h"
 | 
				
			||||||
#include "fbinit.h"
 | 
					#include "fbinit.h"
 | 
				
			||||||
 | 
					#include "resources.h"
 | 
				
			||||||
#include "fontengine.h"
 | 
					#include "fontengine.h"
 | 
				
			||||||
#include "time_func.h"
 | 
					#include "time_func.h"
 | 
				
			||||||
#include "ep_init.h"
 | 
					#include "ep_init.h"
 | 
				
			||||||
@ -41,6 +42,8 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
    return EXIT_FAILURE;
 | 
					    return EXIT_FAILURE;
 | 
				
			||||||
  else if (hr != S_OK)
 | 
					  else if (hr != S_OK)
 | 
				
			||||||
    return EXIT_SUCCESS;
 | 
					    return EXIT_SUCCESS;
 | 
				
			||||||
 | 
					  if (FAILED(Rsrc_setup()))
 | 
				
			||||||
 | 
					    return EXIT_FAILURE;
 | 
				
			||||||
  if (FAILED(Fb_setup()))
 | 
					  if (FAILED(Fb_setup()))
 | 
				
			||||||
    return EXIT_FAILURE;
 | 
					    return EXIT_FAILURE;
 | 
				
			||||||
  if (FAILED(FontEng_setup()))
 | 
					  if (FAILED(FontEng_setup()))
 | 
				
			||||||
@ -57,7 +60,7 @@ int main(int argc, char *argv[])
 | 
				
			|||||||
  Fb_clear();
 | 
					  Fb_clear();
 | 
				
			||||||
  if (FAILED(Epython_run()))
 | 
					  if (FAILED(Epython_run()))
 | 
				
			||||||
    return EXIT_FAILURE;
 | 
					    return EXIT_FAILURE;
 | 
				
			||||||
 
 | 
					
 | 
				
			||||||
  Log(LINFO, "Script returned with exit code %d", Sys_Exit_Code);
 | 
					  Log(LINFO, "Script returned with exit code %d", Sys_Exit_Code);
 | 
				
			||||||
  return Sys_Exit_Code;
 | 
					  return Sys_Exit_Code;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -61,7 +61,7 @@ static void rsrc_cleanup(void)
 | 
				
			|||||||
  sysresource = NULL;
 | 
					  sysresource = NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HRESULT Rsrc_init(void)
 | 
					HRESULT Rsrc_setup(void)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  HRESULT hr = S_OK;
 | 
					  HRESULT hr = S_OK;
 | 
				
			||||||
  zip_source_t *syssource;
 | 
					  zip_source_t *syssource;
 | 
				
			||||||
 | 
				
			|||||||
@ -27,6 +27,6 @@ typedef HANDLE HRSRC;       /* handle to resource */
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern HRESULT Rsrc_init(void);
 | 
					extern HRESULT Rsrc_setup(void);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* __RESOURCES_H_INCLUDED */
 | 
					#endif /* __RESOURCES_H_INCLUDED */
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user