ARB
AW_help.cxx
Go to the documentation of this file.
1 // ================================================================ //
2 // //
3 // File : AW_help.cxx //
4 // Purpose : //
5 // //
6 // Institute of Microbiology (Technical University Munich) //
7 // http://www.arb-home.de/ //
8 // //
9 // ================================================================ //
10 
11 #include "aw_awar.hxx"
12 #include "aw_window.hxx"
13 #include "aw_edit.hxx"
14 #include "aw_root.hxx"
15 #include "aw_global_awars.hxx"
16 #include "aw_msg.hxx"
17 #include "aw_select.hxx"
18 #include "aw_system.hxx"
19 
20 #include <arb_file.h>
21 #include <arb_strarray.h>
22 #include <arb_strbuf.h>
23 #include <arb_str.h>
24 
25 #include <sys/stat.h>
26 
27 #define AWAR_HELP "tmp/help/"
28 #define AWAR_HELPFILE AWAR_HELP "file"
29 #define AWAR_HELPTEXT AWAR_HELP "text"
30 #define AWAR_HELPSEARCH AWAR_HELP "search"
31 
32 void AW_system(const char *command) {
33  aw_message_if(GBK_system(command));
34 }
35 void AW_system_async(const char *command) {
36  size_t len = strlen(command);
37 
38  GBS_strstruct async(len+4);
39  async.put('(');
40  async.ncat(command, len);
41  async.ncat(")&", 2);
42 
43  AW_system(async.get_data());
44 }
45 void AW_console() {
47 }
48 
49 static const char *develDocPath() {
50  return GB_path_in_ARBHOME("HELP_SOURCE/source");
51 }
52 
53 void AW_openURL(AW_root *aw_root, const char *url) {
54  char *browser = aw_root->awar(AWAR_WWW_BROWSER)->read_string();
55  while (GB_CSTR ka = GBS_find_string(browser, "$(URL)", 0)) {
56  char *start = ARB_strpartdup(browser, ka-1);
57  char *new_browser = GBS_global_string_copy("%s%s%s", start, url, ka+6);
58 
59  free(start);
60  freeset(browser, new_browser);
61  }
62 
63  char *command = GBS_global_string_copy("(%s)&", browser);
64  free(browser);
65 
66  AW_system(command);
67  free(command);
68 }
69 
70 // --------------------
71 // help window
72 
73 static struct {
76  char *history;
77 } HELP;
78 
79 static char *get_full_qualified_help_file_name(const char *helpfile, bool path_for_edit = false) {
81  const char *user_doc_path = GB_getenvDOCPATH();
82  char *devel_doc_path = strdup(develDocPath());
83  size_t user_doc_path_len = strlen(user_doc_path);
84  size_t devel_doc_path_len = strlen(devel_doc_path);
85 
86  const char *rel_path = NULp;
87  if (strncmp(helpfile, user_doc_path, user_doc_path_len) == 0 && helpfile[user_doc_path_len] == '/') {
88  rel_path = helpfile+user_doc_path_len+1;
89  }
90  else if (strncmp(helpfile, devel_doc_path, devel_doc_path_len) == 0 && helpfile[devel_doc_path_len] == '/') {
91  aw_assert(0); // when does this happen ? never ?
92  rel_path = helpfile+devel_doc_path_len+1;
93  }
94 
95  if (helpfile[0]=='/' && !rel_path) {
96  result = GBS_static_string(helpfile);
97  }
98  else {
99  if (!rel_path) rel_path = helpfile;
100 
101  if (rel_path[0]) {
102  if (path_for_edit) {
103 #if defined(DEBUG)
104  char *gen_doc_path = strdup(GB_path_in_ARBHOME("HELP_SOURCE/genhelp"));
105 
106  char *devel_source = GBS_global_string_copy("%s/%s", devel_doc_path, rel_path);
107  char *gen_source = GBS_global_string_copy("%s/%s", gen_doc_path, rel_path);
108 
109  int devel_size = GB_size_of_file(devel_source);
110  int gen_size = GB_size_of_file(gen_source);
111 
112  aw_assert(devel_size <= 0 || gen_size <= 0); // only one of them shall exist
113 
114  if (gen_size>0) {
115  result = GBS_static_string(gen_source); // edit generated doc
116  }
117  else {
118  result = GBS_static_string(devel_source); // use normal help source (may be non-existing)
119  }
120 
121  free(gen_source);
122  free(devel_source);
123  free(gen_doc_path);
124 #else
125  result = GBS_global_string("%s/%s", user_doc_path, rel_path); // use real help file in RELEASE
126 #endif // DEBUG
127  }
128  else {
129  result = GBS_global_string("%s/%s", user_doc_path, rel_path);
130  }
131  }
132  else {
133  result = "";
134  }
135  }
136 
137  free(devel_doc_path);
138 
139  return strdup(result);
140 }
141 
142 static char *get_full_qualified_help_file_name(AW_root *awr, bool path_for_edit = false) {
143  char *helpfile = awr->awar(AWAR_HELPFILE)->read_string();
144  char *qualified = get_full_qualified_help_file_name(helpfile, path_for_edit);
145  free(helpfile);
146  return qualified;
147 }
148 
149 static char *get_local_help_url(AW_root *awr) {
150  char *helpfile = get_full_qualified_help_file_name(awr, false);
151  const char *user_doc_path = GB_getenvDOCPATH();
152  const char *user_htmldoc_path = GB_getenvHTMLDOCPATH();
153  size_t user_doc_path_len = strlen(user_doc_path);
154  char *result = NULp;
155 
156  if (strncmp(helpfile, user_doc_path, user_doc_path_len) == 0) { // "real" help file
157  result = GBS_global_string_copy("%s%s_", user_htmldoc_path, helpfile+user_doc_path_len);
158  size_t result_len = strlen(result);
159 
160  aw_assert(result_len > 5);
161 
162  if (strcmp(result+result_len-5, ".hlp_") == 0) {
163  strcpy(result+result_len-5, ".html");
164  }
165  else {
166  freenull(result);
167  GB_export_error("Can't browse that file type.");
168  }
169  }
170  else { // on-the-fly-generated help file (e.g. search help)
171  GB_export_error("Can't browse temporary help node");
172  }
173 
174  free(helpfile);
175 
176  return result;
177 }
178 
179 #if defined(NDEBUG)
180 static void store_helpfile_in_tarball(const char *path, const char *mode) {
181  GB_ERROR error = NULp;
182  const char *base = GB_getenvDOCPATH();
183 
184  if (ARB_strBeginsWith(path, base)) {
185  char *cmd = GBS_global_string_copy("arb_help_useredit.sh %s %s", path+strlen(base)+1, mode);
186  error = GBK_system(cmd);
187  }
188  else {
189  error = "Unexpected helpfile name (in store_helpfile_in_tarball)";
190  }
191 
192  if (error) aw_message(error);
193 }
194 static void aw_helpfile_modified_cb(const char *path) {
195  static enum { UNMODIFIED, MODIFIED, NOTIFIED } state = UNMODIFIED;
196 
197  store_helpfile_in_tarball(path, "end");
198  if (state == UNMODIFIED) state = MODIFIED;
199 
200  if (state == MODIFIED) {
201  aw_message("Your changes to ARB help have been stored in an archive.\n"
202  "See console for what to send to ARB developers!");
203  state = NOTIFIED;
204  }
205 }
206 #endif
207 
208 
209 static void aw_help_edit_help(AW_window *aww) {
210  char *helpfile = get_full_qualified_help_file_name(aww->get_root(), true);
211 
212  if (GB_size_of_file(helpfile)<=0) {
213 #if defined(NDEBUG)
214  const char *base = GB_getenvDOCPATH();
215 #else
216  const char *base = develDocPath();
217 #endif
218 
219  if (GB_is_directory(base)) {
220  const char *copy_cmd = GBS_global_string("cp %s/FORM.hlp %s", base, helpfile); // uses_hlp_res("FORM.hlp"); see ../SOURCE_TOOLS/check_resources.pl@uses_hlp_res
221  AW_system(copy_cmd);
222  }
223  }
224 
225  if (!GB_is_regularfile(helpfile)) {
226  aw_message(GBS_global_string("Cannot edit '%s' (no such file)", helpfile));
227  }
228  else {
229 #if defined(NDEBUG)
230  store_helpfile_in_tarball(helpfile, "start");
231 
232  if (!GB_is_writeablefile(helpfile)) {
233  aw_message("Warning: you do not have the permission to save changes to that helpfile\n"
234  "(ask your admin to gain write access)");
235  }
236 
237  AW_edit_notified(helpfile, makeFileChangedCallback(aw_helpfile_modified_cb));
238 #else
239  AW_edit(helpfile);
240 #endif
241  }
242  free(helpfile);
243 }
244 
245 static char *aw_ref_to_title(const char *ref) {
246  if (!ref) return NULp;
247 
248  if (GBS_string_matches(ref, "*.ps", GB_IGNORE_CASE)) { // Postscript file
249  return GBS_global_string_copy("Postscript: %s", ref);
250  }
251 
252  char *result = NULp;
253  char *file = NULp;
254  {
255  char *helpfile = get_full_qualified_help_file_name(ref);
256  file = GB_read_file(helpfile);
257  free(helpfile);
258  }
259 
260  if (file) {
261  result = GBS_string_eval(file, "*\nTITLE*\n*=*2:\t=");
262  if (strcmp(file, result)==0) freenull(result);
263  free(file);
264  }
265  else {
266  GB_clear_error();
267  }
268 
269  if (!result) {
270  result = strdup(ref);
271  }
272 
273  return result;
274 }
275 
277  char *history = HELP.history;
278  if (history) {
279  const char *sep = strchr(history, '#');
280  char *lastHelp = sep ? ARB_strpartdup(history, sep-1) : strdup(history);
281 
282  aw_root->awar(AWAR_HELPFILE)->write_string(lastHelp);
283  free(lastHelp);
284  }
285 }
286 
287 static void aw_help_back(AW_window *aww) {
288  AW_root *aw_root = aww->get_root();
289  const char *history = HELP.history;
290  if (history) {
291  const char *currHelp = aw_root->awar(AWAR_HELPFILE)->read_char_pntr();
292  if (currHelp[0]) { // if showing some help
293  const char *sep = strchr(history, '#');
294  if (sep) {
295  char *first = ARB_strpartdup(history, sep-1);
296  freeset(HELP.history, GBS_global_string_copy("%s#%s", sep+1, first)); // wrap first to end
297  free(first);
299  }
300  }
301  else { // e.g. inside history
303  }
304  }
305 }
306 
307 static void aw_help_history(AW_window *aww) {
308  ConstStrArray entries;
309  GBT_split_string(entries, HELP.history, '#');
310 
311  if (entries.size()) {
312  AW_root *aw_root = aww->get_root();
313  const char *currHelp = aw_root->awar(AWAR_HELPFILE)->read_char_pntr();
314 
315  if (currHelp[0]) {
316  aw_root->awar(AWAR_HELPFILE)->write_string("");
317 
318  HELP.uplinks->clear();
319  HELP.links->clear();
320 
321  for (size_t i = 0; i<entries.size(); ++i) {
322  char *title = aw_ref_to_title(entries[i]);
323  HELP.links->insert(title, entries[i]);
324  free(title);
325  }
326 
327  HELP.uplinks->insert_default(" ", ""); HELP.uplinks->update();
328  HELP.links ->insert_default(" ", ""); HELP.links ->update();
329 
330  aw_root->awar(AWAR_HELPTEXT)->write_string("Your previously visited help topics are listed under 'Subtopics'");
331  }
332  else { // e.g. already in HISTORY
333  aw_help_back(aww);
334  }
335  }
336 }
337 
338 static GB_ERROR aw_help_show_external_format(const char *help_file, const char *viewer) {
339  // Called to show *.ps or *.pdf in external viewer.
340  // Can as well show *.suffix.gz (decompresses to temporary *.suffix)
341 
342  struct stat st;
343  GB_ERROR error = NULp;
344  char sys[1024];
345 
346  sys[0] = 0;
347 
348  if (stat(help_file, &st) == 0) { // *.ps exists
349  GBS_global_string_to_buffer(sys, sizeof(sys), "%s %s &", viewer, help_file);
350  }
351  else {
352  char *compressed = GBS_global_string_copy("%s.gz", help_file);
353 
354  if (stat(compressed, &st) == 0) { // *.ps.gz exists
355  char *name_ext;
356  GB_split_full_path(compressed, NULp, NULp, &name_ext, NULp);
357  // 'name_ext' contains xxx.ps or xxx.pdf
358  char *name, *suffix;
359  GB_split_full_path(name_ext, NULp, NULp, &name, &suffix);
360 
361  char *tempname = GB_unique_filename(name, suffix);
362  char *uncompressed = GB_create_tempfile(tempname);
363 
364  GBS_global_string_to_buffer(sys, sizeof(sys),
365  "(gunzip <%s >%s ; %s %s ; rm %s) &",
366  compressed, uncompressed,
367  viewer, uncompressed,
368  uncompressed);
369 
370  free(uncompressed);
371  free(tempname);
372  free(name);
373  free(suffix);
374  free(name_ext);
375  }
376  else {
377  error = GBS_global_string("Neither %s nor %s exists", help_file, compressed);
378  }
379  free(compressed);
380  }
381 
382  if (sys[0] && !error) error = GBK_system(sys);
383 
384  return error;
385 }
386 
387 #if defined(DEBUG)
388 # define TRACK_HELPFILE
389 // # define AUTOBUILD_CHANGED_HELPFILE
390 #endif
391 
392 #if defined(TRACK_HELPFILE)
393 // automatically update helpfile after changes in DEBUG mode
394 
395 static bool track_helpfile = false;
396 static unsigned long helpfile_stamp = 0;
397 static unsigned long helpfile_edited_stamp = 0;
398 
399 const unsigned TRACK_FREQUENCY = 500; // ms
400 
401 static unsigned autorefresh_helpfile(AW_root *awr) {
402  char *help_file = get_full_qualified_help_file_name(awr);
403  unsigned callAgainIn = TRACK_FREQUENCY;
404 
405  if (help_file[0]) {
406  unsigned long lastChanged = GB_time_of_file(help_file);
407 
408  if (lastChanged != helpfile_stamp) {
409  awr->awar(AWAR_HELPFILE)->touch(); // reload
410  aw_assert(helpfile_stamp == lastChanged);
411  }
412 #if defined(AUTOBUILD_CHANGED_HELPFILE)
413  else { // automatically make help
414  char *edited_help_file = get_full_qualified_help_file_name(awr, true);
415  if (strcmp(help_file, edited_help_file) != 0) {
416  unsigned long editLastChanged = GB_time_of_file(edited_help_file);
417 
418  if (editLastChanged>helpfile_edited_stamp) {
419  AW_system("cd $ARBHOME; make help");
420  helpfile_edited_stamp = editLastChanged;
421  callAgainIn = 10;
422  }
423  }
424 
425  free(edited_help_file);
426  }
427 #endif
428  }
429  free(help_file);
430 
431  return callAgainIn;
432 }
433 
434 #endif
435 
437  char *help_file = get_full_qualified_help_file_name(awr);
438 
439 #if defined(TRACK_HELPFILE)
440  track_helpfile = false;
441 #endif
442 
443  if (!strlen(help_file)) {
444  awr->awar(AWAR_HELPTEXT)->write_string("Select one of the topics from the lists on the left side or\n"
445  "press the BACK button above.");
446  }
447  else if (GBS_string_matches(help_file, "*.ps", GB_IGNORE_CASE)) { // Postscript file
449  if (error) aw_message(error);
451  }
452  else if (GBS_string_matches(help_file, "*.pdf", GB_IGNORE_CASE)) { // PDF file
454  if (error) aw_message(error);
456  }
457  else {
458  if (HELP.history) {
459  if (strncmp(help_file, HELP.history, strlen(help_file)) != 0) {
460  // remove current help from history (if present) and prefix it to history
461  char *srt = GBS_global_string_copy("*#%s*=*1*2:*=%s#*1", help_file, help_file);
462  char *h = GBS_string_eval(HELP.history, srt);
463 
464  aw_assert(h);
465  freeset(HELP.history, h);
466  free(srt);
467  }
468  }
469  else {
470  HELP.history = strdup(help_file);
471  }
472 
473 #if defined(TRACK_HELPFILE)
474  track_helpfile = true;
475  helpfile_edited_stamp = helpfile_stamp = GB_time_of_file(help_file);
476 #endif
477 
478  char *helptext = GB_read_file(help_file);
479  if (helptext) {
480  char *ptr;
481  char *h, *h2, *tok;
482 
483  ptr = strdup(helptext);
484  HELP.uplinks->clear();
485  h2 = GBS_find_string(ptr, "\nUP", 0);
486  while ((h = h2)) {
487  h2 = GBS_find_string(h2+1, "\nUP", 0);
488  tok = strtok(h+3, " \n\t"); // now I got UP
489  char *title = aw_ref_to_title(tok);
490  if (tok) HELP.uplinks->insert(title, tok);
491  free(title);
492  }
493  free(ptr);
494  HELP.uplinks->insert_default(" ", "");
495  HELP.uplinks->update();
496 
497  ptr = strdup(helptext);
498  HELP.links->clear();
499  h2 = GBS_find_string(ptr, "\nSUB", 0);
500  while ((h = h2)) {
501  h2 = GBS_find_string(h2+1, "\nSUB", 0);
502  tok = strtok(h+4, " \n\t"); // now I got SUB
503  char *title = aw_ref_to_title(tok);
504  if (tok) HELP.links->insert(title, tok);
505  free(title);
506  }
507  free(ptr);
508  HELP.links->insert_default(" ", "");
509  HELP.links->update();
510 
511  ptr = GBS_find_string(helptext, "TITLE", 0);
512  if (!ptr) ptr = helptext;
513  ptr = GBS_string_eval(ptr, "{*\\:*}=*2");
514 
515  awr->awar(AWAR_HELPTEXT)->write_string(ptr);
516  free(ptr);
517  free(helptext);
518  }
519  else {
520  char *msg = GBS_global_string_copy("I cannot find the help file '%s'\n\n"
521  "Please help us to complete the ARB-Help by submitting\n"
522  "this missing helplink via ARB_NT/File/About/SubmitBug\n"
523  "Thank you.\n"
524  "\n"
525  "Details:\n"
526  "%s",
527  help_file, GB_await_error());
528  awr->awar(AWAR_HELPTEXT)->write_string(msg);
529  free(msg);
530  }
531  }
532  free(help_file);
533 }
534 
535 static void aw_help_browse(AW_window *aww) {
536  char *help_url = get_local_help_url(aww->get_root());
537  if (help_url) {
538  AW_openURL(aww->get_root(), help_url);
539  free(help_url);
540  }
541  else {
542  aw_message(GBS_global_string("Can't detect URL of help file\n(Reason: %s)", GB_await_error()));
543  }
544 }
545 
546 static void aw_help_search(AW_window *aww) {
547  GB_ERROR error = NULp;
548  char *searchtext = aww->get_root()->awar(AWAR_HELPSEARCH)->read_string();
549 
550  if (searchtext[0]==0) error = "Empty searchstring";
551  else {
552  char *helpfilename = NULp;
553  static char *last_help; // tempfile containing last search result
554 
555  // replace all spaces in 'searchtext' by '.*' (also eliminate multi-spaces)
556  freeset(searchtext, GBS_string_eval(searchtext, " = : =.*"));
557 
559 
560  // grep .hlp for occurrences of 'searchtext'.
561  // write filenames of matching files into 'helpfilename'
562  {
563  const char *existingSearch = (const char*)GBS_read_hash(searchHash, searchtext);
564  if (existingSearch) {
565  helpfilename = strdup(existingSearch);
566  }
567  else {
568  char *helpname = GB_unique_filename("arb", "hlp");
569  helpfilename = GB_create_tempfile(helpname);
570  free(helpname);
571  }
572 
573  if (!helpfilename) error = GB_await_error();
574  else {
575  char *quotedSearchExpression = GBK_singlequote(GBS_global_string("^[^#]*%s", searchtext));
576  char *quotedDocpath = GBK_singlequote(GB_getenvDOCPATH());
577  const char *gen_help_tmpl = "cd %s;grep -i %s `find . -name \"*.hlp\"` | arb_sed -e 'sI:.*IIg' -e 'sI^\\./IIg' | sort | uniq > %s";
578  char *gen_help_cmd = GBS_global_string_copy(gen_help_tmpl, quotedDocpath, quotedSearchExpression, helpfilename);
579 
580  error = GBK_system(gen_help_cmd);
581 
582  free(gen_help_cmd);
583  free(quotedDocpath);
584  free(quotedSearchExpression);
585  GB_remove_on_exit(helpfilename);
586  }
587  }
588 
589  if (!error) {
590  char *result = GB_read_file(helpfilename);
591  if (!result) error = GB_await_error();
592  else {
593  // write temporary helpfile containing links to matches as subtopics
594 
595  FILE *helpfp = fopen(helpfilename, "wt");
596  if (!helpfp) error = GB_export_IO_error("writing helpfile", helpfilename);
597  else {
598  fprintf(helpfp, "\nUP arb.hlp\n");
599  if (last_help) fprintf(helpfp, "UP %s\n", last_help);
600  fputc('\n', helpfp);
601 
602  int results = 0;
603  char *rp = result;
604  while (1) {
605  char *eol = strchr(rp, '\n');
606  if (!eol) {
607  eol = rp;
608  while (*eol) ++eol;
609  }
610  if (eol>rp) {
611  char old = eol[0];
612  eol[0] = 0;
613  fprintf(helpfp, "SUB %s\n", rp);
614  results++;
615  eol[0] = old;
616  }
617  if (eol[0]==0) break; // all results inserted
618  rp = eol+1;
619  }
620 
621  fprintf(helpfp, "\nTITLE\t\tResult of search for '%s'\n\n", searchtext);
622  if (results>0) fprintf(helpfp, "\t\t%i results are shown as subtopics\n", results);
623  else fprintf(helpfp, "\t\tThere are no results.\n");
624 
625  if (results>0) freedup(last_help, helpfilename);
626 
627  fclose(helpfp);
628  aww->get_root()->awar(AWAR_HELPFILE)->write_string(helpfilename); // display results in aws
629  }
630  free(result);
631  GBS_write_hash(searchHash, searchtext, (long)strdup(helpfilename));
632  }
633  }
634  free(helpfilename);
635  }
636 
637  if (error) aw_message(error);
638 
639  free(searchtext);
640 }
641 
642 void AW_help_popup(UNFIXED, const char *help_file) {
643  static AW_window_simple *aws = NULp;
644 
646 
647  if (!aws) {
652 
653  aws = new AW_window_simple;
654  aws->reset_layout("20251113"); // resets stored size of help window once in userland (required after changing width)
655  aws->init(awr, "HELP", "HELP WINDOW");
656  aws->load_xfig("help.fig");
657 
658  aws->button_length(9);
659  aws->auto_space(5, 5);
660 
661  aws->at("close");
662  aws->callback(AW_POPDOWN);
663  aws->create_button("CLOSE", "CLOSE", "C");
664 
665  aws->callback(aw_help_back);
666  aws->create_button("BACK", "BACK", "B");
667 
668  aws->callback(aw_help_history);
669  aws->create_button("HISTORY", "HISTORY", "H");
670 
671  aws->at("expression");
672  aws->d_callback(makeWindowCallback(aw_help_search)); // enable ENTER in searchfield to start search
673  aws->create_input_field(AWAR_HELPSEARCH, 40);
674  aws->callback(aw_help_search);
675  aws->create_button("SEARCH", "SEARCH", "S", "+");
676 
677  aws->at("browse");
678  aws->callback(aw_help_browse);
679  aws->create_button("BROWSE", "BROWSE", "B");
680 
681  aws->callback(aw_help_edit_help);
682  aws->create_button("EDIT", "EDIT", "E");
683 
684  aws->at("super");
685  HELP.uplinks = aws->create_selection_list(AWAR_HELPFILE);
686  HELP.uplinks->insert_default(" ", "");
687  HELP.uplinks->update();
688 
689  aws->at("sub");
690  HELP.links = aws->create_selection_list(AWAR_HELPFILE);
691  HELP.links->insert_default(" ", "");
692  HELP.links->update();
693  HELP.history = NULp;
694 
695  aws->at("text");
696  aws->create_text_field(AWAR_HELPTEXT, 3, 3);
697 
698 #if defined(TRACK_HELPFILE)
699  awr->add_timed_callback(TRACK_FREQUENCY, makeTimedCallback(autorefresh_helpfile));
700 #endif
701  }
702 
703  aw_assert(help_file);
704 
705  awr->awar(AWAR_HELPFILE)->write_string(help_file);
706 
707  if (!GBS_string_matches(help_file, "*.ps", GB_IGNORE_CASE) &&
708  !GBS_string_matches(help_file, "*.pdf", GB_IGNORE_CASE))
709  { // don't open help if postscript or pdf file
710  aws->activate();
711  }
712 }
713 
714 
715 
GB_ERROR GBK_system(const char *system_command)
Definition: arb_msg.cxx:571
const char * GB_ERROR
Definition: arb_core.h:25
string result
static void aw_help_back(AW_window *aww)
Definition: AW_help.cxx:287
void GB_remove_on_exit(const char *filename)
Definition: adsocket.cxx:1249
size_t size() const
Definition: arb_strarray.h:85
static void aw_help_helpfile_changed_cb(AW_root *awr)
Definition: AW_help.cxx:436
long GBS_write_hash(GB_HASH *hs, const char *key, long val)
Definition: adhash.cxx:454
static GB_ERROR aw_help_show_external_format(const char *help_file, const char *viewer)
Definition: AW_help.cxx:338
const char * GBS_global_string_to_buffer(char *buffer, size_t bufsize, const char *templat,...)
Definition: arb_msg.cxx:178
void AW_edit(const char *path)
Definition: AW_edit.cxx:16
static void aw_help_browse(AW_window *aww)
Definition: AW_help.cxx:535
static const char * develDocPath()
Definition: AW_help.cxx:49
static void aw_help_select_newest_in_history(AW_root *aw_root)
Definition: AW_help.cxx:276
void AW_edit_notified(const char *path, const FileChangedCallback &callback)
Definition: AW_edit.cxx:33
#define AWAR_HELPSEARCH
Definition: AW_help.cxx:30
GB_ERROR GB_export_IO_error(const char *action, const char *filename)
Definition: arb_msg.cxx:318
const char * GBS_global_string(const char *templat,...)
Definition: arb_msg.cxx:203
static struct @64 HELP
const char * title
Definition: readseq.c:22
void AW_console()
Definition: AW_help.cxx:45
GB_HASH * GBS_create_dynaval_hash(long estimated_elements, GB_CASE case_sens, void(*freefun)(long))
Definition: adhash.cxx:271
char * GBS_string_eval(const char *insource, const char *icommand)
Definition: admatch.cxx:699
void AW_POPDOWN(AW_window *window)
Definition: AW_window.cxx:52
void add_timed_callback(int ms, const TimedCallback &tcb)
Definition: AW_root.cxx:538
char * ARB_strpartdup(const char *start, const char *end)
Definition: arb_string.h:51
long GB_size_of_file(const char *path)
Definition: arb_file.cxx:28
GB_CSTR GB_getenvARB_GS(void)
Definition: adsocket.cxx:641
GB_CSTR GBS_find_string(GB_CSTR cont, GB_CSTR substr, int match_mode)
Definition: admatch.cxx:103
AW_awar * add_callback(const RootCallback &cb)
Definition: AW_awar.cxx:231
struct Unfixed_cb_parameter * UNFIXED
Definition: cb_base.h:15
static HelixNrInfo * start
const char * read_char_pntr() const
Definition: AW_awar.cxx:168
void AW_system(const char *command)
Definition: AW_help.cxx:32
GB_ERROR GB_export_error(const char *error)
Definition: arb_msg.cxx:257
GB_ERROR GB_await_error()
Definition: arb_msg.cxx:342
static AW_root * SINGLETON
Definition: aw_root.hxx:102
char * GB_create_tempfile(const char *name)
Definition: adsocket.cxx:1213
#define AWAR_HELPTEXT
Definition: AW_help.cxx:29
static char * get_local_help_url(AW_root *awr)
Definition: AW_help.cxx:149
void GB_clear_error()
Definition: arb_msg.cxx:354
unsigned long GB_time_of_file(const char *path)
Definition: arb_file.cxx:44
#define aw_assert(bed)
Definition: aw_position.hxx:29
static void aw_help_search(AW_window *aww)
Definition: AW_help.cxx:546
void touch()
Definition: AW_awar.cxx:207
static void error(const char *msg)
Definition: mkptypes.cxx:96
#define AWAR_HELPFILE
Definition: AW_help.cxx:28
GB_CSTR GB_path_in_ARBHOME(const char *relative_path)
Definition: adsocket.cxx:1140
fputc('\n', stderr)
GB_CSTR GB_getenvHTMLDOCPATH(void)
Definition: adsocket.cxx:687
GB_CSTR GB_getenvDOCPATH(void)
Definition: adsocket.cxx:677
static void aw_help_history(AW_window *aww)
Definition: AW_help.cxx:307
void GBS_dynaval_free(long val)
Definition: adhash.cxx:278
char * read_string() const
Definition: AW_awar.cxx:198
AW_awar * awar(const char *awar)
Definition: AW_root.cxx:554
void AW_system_async(const char *command)
Definition: AW_help.cxx:35
char * history
Definition: AW_help.cxx:76
AW_selection_list * links
Definition: AW_help.cxx:75
bool GB_is_writeablefile(const char *filename)
Definition: arb_file.cxx:148
static char * aw_ref_to_title(const char *ref)
Definition: AW_help.cxx:245
char * GB_unique_filename(const char *name_prefix, const char *suffix)
Definition: adsocket.cxx:1224
void ncat(const char *from, size_t count)
Definition: arb_strbuf.h:189
char * GBK_singlequote(const char *arg)
Definition: arb_msg.cxx:599
bool GB_is_directory(const char *path)
Definition: arb_file.cxx:176
static char eol[3]
GB_CSTR GB_getenvARB_PDFVIEW(void)
Definition: adsocket.cxx:660
const char * GBS_static_string(const char *str)
Definition: arb_msg.cxx:212
void aw_message(const char *msg)
Definition: AW_status.cxx:1142
AW_root * get_root()
Definition: aw_window.hxx:359
void GB_split_full_path(const char *fullpath, char **res_dir, char **res_fullname, char **res_name_only, char **res_suffix)
Definition: adsocket.cxx:1259
#define NULp
Definition: cxxforward.h:116
bool GB_is_regularfile(const char *path)
Definition: arb_file.cxx:76
static void aw_help_edit_help(AW_window *aww)
Definition: AW_help.cxx:209
void AW_help_popup(UNFIXED, const char *help_file)
Definition: AW_help.cxx:642
#define AWAR_WWW_BROWSER
GB_ERROR write_string(const char *aw_string)
static char * command
Definition: arb_a2ps.c:319
void GBT_split_string(ConstStrArray &dest, const char *namelist, const char *separator, SplitMode mode)
Definition: arb_strarray.h:223
static char * get_full_qualified_help_file_name(const char *helpfile, bool path_for_edit=false)
Definition: AW_help.cxx:79
bool ARB_strBeginsWith(const char *str, const char *with)
Definition: arb_str.h:42
const char * get_data() const
Definition: arb_strbuf.h:120
AW_awar * awar_string(const char *var_name, const char *default_value="", AW_default default_file=AW_ROOT_DEFAULT)
Definition: AW_root.cxx:570
bool GBS_string_matches(const char *str, const char *expr, GB_CASE case_sens)
Definition: admatch.cxx:193
GB_CSTR GB_getenvARB_XTERM(void)
Definition: adsocket.cxx:524
void AW_openURL(AW_root *aw_root, const char *url)
Definition: AW_help.cxx:53
const char * GB_CSTR
Definition: arbdb_base.h:25
#define AW_ROOT_DEFAULT
Definition: aw_base.hxx:106
long GBS_read_hash(const GB_HASH *hs, const char *key)
Definition: adhash.cxx:392
AW_selection_list * uplinks
Definition: AW_help.cxx:74
void aw_message_if(GB_ERROR error)
Definition: aw_msg.hxx:21
char * GBS_global_string_copy(const char *templat,...)
Definition: arb_msg.cxx:194
void put(char c)
Definition: arb_strbuf.h:174
char * GB_read_file(const char *path)
Definition: adsocket.cxx:288