Skip to content

Commit

Permalink
Imported Upstream version 1.2.26
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Davidsaver committed Mar 8, 2012
1 parent cac0a69 commit b107702
Show file tree
Hide file tree
Showing 26 changed files with 306 additions and 217 deletions.
16 changes: 6 additions & 10 deletions alConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ int context,int caConnect,struct mainGroup *pmainGroup)
float rate =1.0;
float rateIn;
char *str;
int i,len;
int i;
size_t len;
int rtn;

/* config optional lines */
Expand Down Expand Up @@ -607,13 +608,12 @@ int context,int caConnect,struct mainGroup *pmainGroup)

} else {
print_error(buf,"Invalid $SEVRPV Line");
}
}

return;
}

if (strncmp(&buf[1],"COMMAND",7)==0) { /*COMMAND*/
int len;

if (gcdata->command) return;
sscanf(buf,"%20s",command);
Expand All @@ -627,7 +627,6 @@ int context,int caConnect,struct mainGroup *pmainGroup)
}

if (strncmp(&buf[1],"SEVRCOMMAND",11)==0) { /*SEVRCOMMAND*/
int len;

sscanf(buf,"%20s",command);
len = strlen(command);
Expand All @@ -640,7 +639,6 @@ int context,int caConnect,struct mainGroup *pmainGroup)
}

if (strncmp(&buf[1],"STATCOMMAND",11)==0) { /*STATCOMMAND*/
int len;

if(context!=CHANNEL) {
print_error(buf,"Logic error: STATCOMMAND: Context not a channel");
Expand All @@ -659,7 +657,6 @@ int context,int caConnect,struct mainGroup *pmainGroup)
}

if (strncmp(&buf[1],"ALIAS",5)==0) { /*ALIAS*/
int len;

if (gcdata->alias) return;
sscanf(buf,"%20s",command);
Expand Down Expand Up @@ -702,7 +699,6 @@ int context,int caConnect,struct mainGroup *pmainGroup)
}

if (strncmp(&buf[1],"GUIDANCE",8)==0) { /*GUIDANCE*/
int len;

sscanf(buf,"%20s",command);
len = strlen(command);
Expand Down Expand Up @@ -982,7 +978,7 @@ static void alConfigTreePrint(FILE *fw,GLINK *glink,char *treeSym)
struct groupData *gdata;
struct chanData *cdata;
SNODE *pt;
int length;
size_t length;

int symSize = 3;
static char symMiddle[]="+--";
Expand Down Expand Up @@ -1161,7 +1157,7 @@ void getStringSevrCommandList(ELLLIST *pList,char **pstr)
char *str;
struct sevrCommand *sevrCommand;
ELLNODE *pt;
int i;
size_t i;

pt = ellFirst(pList);
i=0;
Expand Down Expand Up @@ -1272,7 +1268,7 @@ void getStringStatCommandList(ELLLIST *pList,char **pstr)
char *str;
struct statCommand *statCommand;
ELLNODE *pt;
int i;
size_t i;

pt = ellFirst(pList);
i=0;
Expand Down
16 changes: 7 additions & 9 deletions alLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ char *Strncat(
/* max must be >= 0 and no more than stringsize - 1 */
/* for char string[10]; max must be <= 9 */

int l, newMax;
size_t l, newMax;
char *s;

l = strlen( dest );
Expand Down Expand Up @@ -1181,13 +1181,12 @@ static void alUpdateGroupMask(CLINK *clink,int index,int op)
labelStr[80] = 0;

}

str = XmStringCreateSimple(labelStr);
XtVaSetValues(areaTop->blinkButton,
XmNlabelString, str,
NULL);
XmStringFree(str);

if (areaTop->blinkButton) {
str = XmStringCreateSimple(labelStr);
XtVaSetValues(areaTop->blinkButton,
XmNlabelString, str, NULL);
XmStringFree(str);
}
}

}
Expand Down Expand Up @@ -1409,7 +1408,6 @@ void alChangeChanMask(CLINK *clink,MASK mask)
}



}

/***********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion alLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef struct countFilter {
short ackt; /* acknowledge transients? */
char value[MAX_STRING_SIZE]; /* channel value from CA */
int countIndex;
int alarmTime;
time_t alarmTime;
time_t *alarmTimeHistory;
void *clink;
XtIntervalId timeoutId;
Expand Down
2 changes: 1 addition & 1 deletion alView.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void treeView(GLINK *glink,int command,char *treeSym,int (*viewFilter)())
SNODE *pt;
int subcommand;
int oldViewCount=0;
int length;
size_t length;
static char symMiddle={
0x15 };
static char symContinue={
Expand Down
8 changes: 8 additions & 0 deletions alh.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
**********************************************************************/

#define DEBUG_CALLBACKS 0
#define MIN_MULTICLICK_INTERVAL 500

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -52,6 +53,8 @@ XFontStruct *font_info;

int main(int argc,char *argv[])
{

int interval=0;
/* OS specific initialization */
#ifdef WIN32
HCLXmInit();
Expand All @@ -71,6 +74,11 @@ int main(int argc,char *argv[])
exit(-1);
}

interval = XtGetMultiClickTime(display);
if (interval < MIN_MULTICLICK_INTERVAL) XtSetMultiClickTime(display,MIN_MULTICLICK_INTERVAL);
interval = XtGetMultiClickTime(display);


XtAppSetWarningMsgHandler(appContext,
(XtErrorMsgHandler)trapExtraneousWarningsHandler);

Expand Down
2 changes: 1 addition & 1 deletion alh.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ struct setup {
char logFile[NAMEDEFAULT_SIZE]; /* alarm log file name */
char opModFile[NAMEDEFAULT_SIZE]; /* opMod log file name */
char saveFile[NAMEDEFAULT_SIZE]; /* save config file name */
short silenceForever; /* 1 - beepoff forever is true */
Boolean silenceForever; /* 1 - beepoff forever is true */
short silenceOneHour; /* 1 - beepoff one hour is true */
short silenceCurrent; /* 1 - current beep on 0 - off */
short beepSevr; /* 1,2,3,4,5 */
Expand Down
14 changes: 14 additions & 0 deletions alh.notes
Original file line number Diff line number Diff line change
Expand Up @@ -574,3 +574,17 @@ Mon Aug 18 15:59:03 CDT 2008
Thu Oct 15 09:44:40 CDT 2009 ALH_1_2_25
Removed usage of YES macro for build with base R3.14.11.
Added comment in alAudio.c to uncomment/modify for alarm sounds.

Tue Oct 27 15:17:33 CDT 2009
Changes to avoid compile warning messages.

Fri Jul 9 15:14:24 CDT 2010 ALH_1_2_26
Master/slave locking bug fix from Andreas Luedeke.
Rewrote doubleclick code so it works the same on all operating systems.
Portablility changes.
Bug fix: set current value to -999 to recalculate and test the force pv
expression after user changes are Applied from the ForcePV dialog box.
Core dump bug fix: Test for existance before trying to modify runtime
window string. Alh may be started with main window only (-mainwindow).
Removed references to Alarm Configuration Tool in ALH Users Manual.

14 changes: 11 additions & 3 deletions awAlh.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ void awUpdateRowWidgets(line) Update line widgets

#include <stdlib.h>
#include <stdio.h>
#ifndef CYGWIN32
#ifndef WIN32
#include <unistd.h>
#include <pwd.h>
#endif
#endif
#include <errno.h>
#include <sys/types.h>

Expand Down Expand Up @@ -269,11 +271,11 @@ Display* d = XtDisplay( w );
if (*target == XA_TARGETS(d)) {

Atom* targetP;
Atom* std_targets;
caddr_t std_targets;
unsigned long std_length;

XmuConvertStandardSelection( w, req->time, selection, target, type_return,
(XPointer*) &std_targets, &std_length, format_return );
&std_targets, &std_length, format_return );

*value =
(char*) XtMalloc( sizeof(Atom) * ( (unsigned) std_length + 5 ) );
Expand Down Expand Up @@ -337,7 +339,7 @@ static Boolean cvt (
Display *d;
struct anyLine *line;
Atom MOTIF_DROP;
int l;
size_t l;
char *dragData;

d = XtDisplay( w );
Expand Down Expand Up @@ -566,6 +568,7 @@ Widget alhCreateMenu(Widget parent,XtPointer user_data)
{NULL},
};
/* Albert Kagarmanov new */
#ifndef CYGWIN32
#ifndef WIN32
static MenuItem setup_broadcast_mess_menu[] = {
{ "Common Message", PushButtonGadgetClass, 'C', NULL, NULL,
Expand All @@ -580,6 +583,7 @@ Widget alhCreateMenu(Widget parent,XtPointer user_data)
{NULL},
};

#endif
#endif
/* end Albert Kagarmanov new */
/* ******************************************** Albert1 : ************************************ */
Expand All @@ -601,9 +605,11 @@ static MenuItem action_menuNew[] = {
{ "NoAck for One Hour ...", ToggleButtonGadgetClass, 'N', "Ctrl<Key>N", "Ctrl+N",
alhActionCallback, (XtPointer)MENU_ACTION_NOACKTIMER, (MenuItem *)NULL, 0 },
/* Albert1 For MESSAGE BROADCAST: */
#ifndef CYGWIN32
#ifndef WIN32
{ "Send Message ...", PushButtonGadgetClass, 'B', "Ctrl<Key>B", "Ctrl+B",
0, 0, (MenuItem *)setup_broadcast_mess_menu, 0 },
#endif
#endif
{NULL},
};
Expand Down Expand Up @@ -1098,6 +1104,7 @@ XmSelectionBoxCallbackStruct *call_data)
XtUnmanageChild(w);
}

#ifndef CYGWIN32
#ifndef WIN32
struct messBroadcastData
{
Expand Down Expand Up @@ -1311,6 +1318,7 @@ XtUnmanageChild(w);
lockf(messBroadcastDeskriptor, F_ULOCK, 0L);
}

#endif
#endif

/******************************************************
Expand Down
Loading

0 comments on commit b107702

Please sign in to comment.