satdir.h

Go to the documentation of this file.
00001 //@<head>
00002 //& <prolog>
00003 //& ****************************************************************************
00004 //&
00005 //& Written by Ingo Blank & Claudio Lapilli
00006 //&
00007 //& Low level routines by Claudio Lapilli, Copyright (C) 2005 Claudio Lapilli
00008 //& High level API by Ingo Blank,  Copyright (C) 2005 Ingo Blank
00009 //&
00010 //& Copyright (C) 2005 Blank, Lapilli, HP-GCC Development Team
00011 //&
00012 //& ****************************************************************************
00013 //&
00014 //&
00015 //&
00016 //& This file is part of HP-GCC.
00017 //&
00018 //& HP-GCC is free software; you can redistribute it and/or modify
00019 //& it under the terms of the GNU General Public License as published by
00020 //& the Free Software Foundation; either version 2, or (at your option)
00021 //& any later version.
00022 //& 
00023 //& HP-GCC is distributed in the hope that it will be useful,
00024 //& but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 //& MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 //& GNU General Public License for more details.
00027 //& 
00028 //& You should have received a copy of the GNU General Public License
00029 //& along with HP-GCC; see the file COPYING. 
00030 //&
00031 //& As a special exception, you may use this file as part of a free software
00032 //& library without restriction.  Specifically, if other files instantiate
00033 //& templates or use macros or inline functions from this file, or you compile
00034 //& this file and link it with other files to produce an executable, this
00035 //& file does not by itself cause the resulting executable to be covered by
00036 //& the GNU General Public License.  This exception does not however
00037 //& invalidate any other reasons why the executable file might be covered by
00038 //& the GNU General Public License.
00039 //&
00040 //& ****************************************************************************
00041 
00042 //& </prolog>
00043 
00044 // $Header: satdir.h , 2005/08/13 16:18:06 , ingo Exp $
00045 
00046 //@</head>
00047 
00048 #ifndef __SAT_DIR_H
00049 #define __SAT_DIR_H
00050 
00059 #define SAT_CONTEXT 0x8071b
00060 #define SAT_USEROB  0x80711
00061 
00062 // --- DATA STRUCTURES
00063 
00075 typedef
00076 struct _sat_obj_dscr {
00077     char *name;
00078     unsigned addr;
00079 } SAT_OBJ_DSCR;
00080 
00096 typedef
00097 struct _sat_dir_entry {
00098         SAT_OBJ_DSCR *sat_obj;       
00099         struct _sat_dir_entry *next;
00100 } SAT_DIR_ENTRY;
00101 
00121 typedef
00122 struct _sat_dir_node {
00123         char *name;
00124         struct _sat_dir_node *parent,*sibling,*child;
00125         struct _sat_dir_entry *object;
00126 } SAT_DIR_NODE;
00127 
00139 typedef
00140 struct _sat_dir_slist {
00141     char *str;
00142     struct _sat_dir_slist *next;
00143 } SAT_DIR_SLIST;
00144 
00145 // --- GLOBALS
00146 
00147 extern SAT_DIR_NODE *__sat_cwd, *__sat_root;
00148 
00149 // --- LOW LEVEL SATURN DIR HANDLING
00150 
00151 // TODO: Add low level API documentation
00152 
00153 int sat_skipob(int objaddr);
00154 int sat_objgetdir(int objaddr);
00155 int sat_dircurrent();
00156 int sat_objcurdir();
00157 int sat_dirhome();
00158 int sat_objhome();
00159 int sat_dirfindfirst(int diraddr);
00160 int sat_dirfindnext(int diritem);
00161 int sat_itemgetdir(int itemaddr);
00162 int sat_sknameup(int itemaddr);
00163 int sat_sknamedn(int objaddr);
00164 int sat_objgetitem(int objptr);
00165 int sat_itemgetname(int diritem,char *name);
00166 
00167 // --- LOCAL HELPERS
00168 
00176 SAT_DIR_NODE *_sat_find_path(char *path);
00177 
00183 char *_sat_dir_path(SAT_DIR_NODE *p);
00184 
00189 SAT_DIR_NODE *_sat_dir_getroot();
00190 
00195 SAT_DIR_NODE *_sat_dir_getcwd();
00196 
00204 void _sat_dir_destroy_slist(SAT_DIR_SLIST *s);
00205 
00215 void _sat_dir_split_path(char *path,char **dir, char **base);
00216 int _sat_dir_getprolog(SAT_OBJ_DSCR *obj);
00217 
00218 // --- HIGH LEVEL "HIDDEN" API (DON'T USE EXPLICITLY)
00219 
00226 void sat_dir_open();
00227 
00235 void sat_dir_close();
00236 
00237 //  --- HIGH LEVEL DIR  API 
00238 
00245 char *sat_dir_curdir();
00246 
00254 int sat_dir_chdir(char *path);
00255 
00267 SAT_OBJ_DSCR *sat_dir_getobject(char *path);
00268 
00278 SAT_OBJ_DSCR *sat_dir_rclobject(char *path);
00279 
00289 int sat_dir_searchobject(char *name, SAT_DIR_SLIST **path_list);
00290 
00291 // --- DATA ACCESS API
00292 
00300 int sat_obj_is_real(SAT_OBJ_DSCR *obj);
00301 
00311 double _sat_dir_fetchreal(char *path, double defval, char *mode);
00312 
00317 #define sat_dir_getreal(p,v) _sat_dir_fetchreal((p),(v),"g")
00318 
00323 #define sat_dir_rclreal(p,v) _sat_dir_fetchreal((p),(v),"r")
00324 
00325 #endif

Generated on Fri Feb 16 16:43:16 2007 for HP-GCCLibrary by  doxygen 1.5.0